I also tried it without the cast to IDirectInput8, but it still returns NULL.
My GetInterfaceMethod() is defined as:
Code: Select all
PVOID GetInterfaceMethod(PVOID intf, DWORD methodIndex)
{
return *(PVOID*)(*(DWORD*)intf + methodIndex * 4);
}
Code: Select all
PVOID GetInterfaceMethod(PVOID intf, DWORD methodIndex)
{
return *(PVOID*)(*(DWORD*)intf + methodIndex * 4);
}
Code: Select all
HRESULT DICreateDeviceCallback(LPVOID Self, REFGUID rguid, LPDIRECTINPUTDEVICE *lplpDirectInputDevice, LPUNKNOWN pUnkOuter)
{
sprintf((char*) &s, "Got DirectInput::CreateDevice!\n");
WriteFile(hStdOut, &s, strlen(s), &x, NULL);
HRESULT res = DICreateDeviceNextHook(Self, rguid, lplpDirectInputDevice , pUnkOuter);
return res;
}