mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 18:15:11 +00:00
[SDK] Add cicRealCoCreateInstance into <cicero/cicbase.h>
It looks like Cicero wants to hook CoCreateInstance. CORE-19363
This commit is contained in:
parent
eb72347672
commit
f2d34ab4c9
1 changed files with 24 additions and 14 deletions
|
@ -241,6 +241,28 @@ _cicGetSetUserCoCreateInstance(FN_CoCreateInstance fnUserCoCreateInstance)
|
||||||
return s_fn;
|
return s_fn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline HRESULT
|
||||||
|
cicRealCoCreateInstance(
|
||||||
|
REFCLSID rclsid,
|
||||||
|
LPUNKNOWN pUnkOuter,
|
||||||
|
DWORD dwClsContext,
|
||||||
|
REFIID iid,
|
||||||
|
LPVOID *ppv)
|
||||||
|
{
|
||||||
|
static HINSTANCE s_hOle32 = NULL;
|
||||||
|
static FN_CoCreateInstance s_fnCoCreateInstance = NULL;
|
||||||
|
if (!s_fnCoCreateInstance)
|
||||||
|
{
|
||||||
|
if (!s_hOle32)
|
||||||
|
s_hOle32 = cicLoadSystemLibrary(L"ole32.dll", FALSE);
|
||||||
|
s_fnCoCreateInstance = (FN_CoCreateInstance)GetProcAddress(s_hOle32, "CoCreateInstance");
|
||||||
|
if (!s_fnCoCreateInstance)
|
||||||
|
return E_NOTIMPL;
|
||||||
|
}
|
||||||
|
|
||||||
|
return s_fnCoCreateInstance(rclsid, pUnkOuter, dwClsContext, iid, ppv);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @implemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
|
@ -252,24 +274,12 @@ cicCoCreateInstance(
|
||||||
REFIID iid,
|
REFIID iid,
|
||||||
LPVOID *ppv)
|
LPVOID *ppv)
|
||||||
{
|
{
|
||||||
|
// NOTE: It looks like Cicero wants to hook CoCreateInstance
|
||||||
FN_CoCreateInstance fnUserCoCreateInstance = _cicGetSetUserCoCreateInstance(NULL);
|
FN_CoCreateInstance fnUserCoCreateInstance = _cicGetSetUserCoCreateInstance(NULL);
|
||||||
if (fnUserCoCreateInstance)
|
if (fnUserCoCreateInstance)
|
||||||
return fnUserCoCreateInstance(rclsid, pUnkOuter, dwClsContext, iid, ppv);
|
return fnUserCoCreateInstance(rclsid, pUnkOuter, dwClsContext, iid, ppv);
|
||||||
|
|
||||||
static HINSTANCE s_hOle32 = NULL;
|
return cicRealCoCreateInstance(rclsid, pUnkOuter, dwClsContext, iid, ppv);
|
||||||
static FN_CoCreateInstance s_fnCoCreateInstance = NULL;
|
|
||||||
if (!s_fnCoCreateInstance)
|
|
||||||
{
|
|
||||||
if (!s_hOle32)
|
|
||||||
s_hOle32 = cicLoadSystemLibrary(L"ole32.dll", FALSE);
|
|
||||||
if (!s_hOle32)
|
|
||||||
return E_NOTIMPL;
|
|
||||||
s_fnCoCreateInstance = (FN_CoCreateInstance)GetProcAddress(s_hOle32, "CoCreateInstance");
|
|
||||||
if (!s_fnCoCreateInstance)
|
|
||||||
return E_NOTIMPL;
|
|
||||||
}
|
|
||||||
|
|
||||||
return s_fnCoCreateInstance(rclsid, pUnkOuter, dwClsContext, iid, ppv);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue