forked from TeamTofuShop/segatools
added setupapi hook to elisabeth
This commit is contained in:
@ -284,6 +284,8 @@ static HMODULE WINAPI hook_LoadLibraryW(const wchar_t *name)
|
||||
{
|
||||
HMODULE result;
|
||||
|
||||
dprintf("hook_LoadLibraryW: Loading %S\n", name);
|
||||
|
||||
if (name == NULL) {
|
||||
SetLastError(ERROR_INVALID_PARAMETER);
|
||||
|
||||
|
@ -134,22 +134,27 @@ end:
|
||||
return hr;
|
||||
}
|
||||
|
||||
static void setupapi_hook_init(void)
|
||||
static void setupapi_hook_init()
|
||||
{
|
||||
if (setupapi_initted) {
|
||||
return;
|
||||
}
|
||||
|
||||
hook_table_apply(
|
||||
NULL,
|
||||
"setupapi.dll",
|
||||
setupapi_syms,
|
||||
_countof(setupapi_syms));
|
||||
setupapi_hook_insert_hooks(NULL);
|
||||
|
||||
InitializeCriticalSection(&setupapi_lock);
|
||||
setupapi_initted = true;
|
||||
}
|
||||
|
||||
void setupapi_hook_insert_hooks(HMODULE target)
|
||||
{
|
||||
hook_table_apply(
|
||||
target,
|
||||
"setupapi.dll",
|
||||
setupapi_syms,
|
||||
_countof(setupapi_syms));
|
||||
}
|
||||
|
||||
static HDEVINFO WINAPI my_SetupDiGetClassDevsW(
|
||||
const GUID *ClassGuid,
|
||||
wchar_t *Enumerator,
|
||||
@ -191,6 +196,7 @@ static BOOL WINAPI my_SetupDiEnumDeviceInterfaces(
|
||||
DWORD MemberIndex,
|
||||
SP_DEVICE_INTERFACE_DATA *DeviceInterfaceData)
|
||||
{
|
||||
dprintf("my_SetupDiEnumDeviceInterfaces hit!\n");
|
||||
const struct setupapi_class *class_;
|
||||
size_t i;
|
||||
|
||||
|
@ -5,3 +5,4 @@
|
||||
#include <stddef.h>
|
||||
|
||||
HRESULT setupapi_add_phantom_dev(const GUID *iface_class, const wchar_t *path);
|
||||
void setupapi_hook_insert_hooks(HMODULE target);
|
||||
|
Reference in New Issue
Block a user