forked from citizenfx/fivem
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathOMProxies.Win32.cpp
More file actions
52 lines (39 loc) · 1.23 KB
/
OMProxies.Win32.cpp
File metadata and controls
52 lines (39 loc) · 1.23 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#include <StdInc.h>
#define FXOM_NO_HELPERS
#include <../citicore/om/core.h> // HACKHACK
extern "C" intptr_t fxFindFirstImpl(const guid_t& iid, guid_t* clsid)
{
static intptr_t(*func)(const guid_t&, guid_t*);
if (!func)
{
func = (decltype(func))GetProcAddress(GetModuleHandle(L"CoreRT.dll"), "CoreFxFindFirstImpl");
}
return func(iid, clsid);
}
extern "C" int32_t fxFindNextImpl(intptr_t findHandle, guid_t* clsid)
{
static int32_t(*func)(intptr_t, guid_t*);
if (!func)
{
func = (decltype(func))GetProcAddress(GetModuleHandle(L"CoreRT.dll"), "CoreFxFindNextImpl");
}
return func(findHandle, clsid);
}
extern "C" void fxFindImplClose(intptr_t findHandle)
{
static void(*func)(intptr_t);
if (!func)
{
func = (decltype(func))GetProcAddress(GetModuleHandle(L"CoreRT.dll"), "CoreFxFindImplClose");
}
return func(findHandle);
}
extern "C" result_t fxCreateObjectInstance(const guid_t& guid, const guid_t& iid, void** objectRef)
{
static result_t(*func)(const guid_t&, const guid_t&, void**);
if (!func)
{
func = (decltype(func))GetProcAddress(GetModuleHandle(L"CoreRT.dll"), "CoreFxCreateObjectInstance");
}
return func(guid, iid, objectRef);
}