forked from winnerspiros/UnleashedRecomp_Android
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathxdm.cpp
More file actions
37 lines (30 loc) · 666 Bytes
/
Copy pathxdm.cpp
File metadata and controls
37 lines (30 loc) · 666 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include <stdafx.h>
#include "xdm.h"
#include "freelist.h"
Mutex g_kernelLock;
void DestroyKernelObject(KernelObject* obj)
{
obj->~KernelObject();
g_userHeap.Free(obj);
}
uint32_t GetKernelHandle(KernelObject* obj)
{
assert(obj != GetInvalidKernelObject());
return g_memory.MapVirtual(obj);
}
void DestroyKernelObject(uint32_t handle)
{
DestroyKernelObject(GetKernelObject(handle));
}
bool IsKernelObject(uint32_t handle)
{
return (handle & 0x80000000) != 0;
}
bool IsKernelObject(void* obj)
{
return IsKernelObject(g_memory.MapVirtual(obj));
}
bool IsInvalidKernelObject(void* obj)
{
return obj == GetInvalidKernelObject();
}