-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathxinput1_3.c
More file actions
36 lines (26 loc) · 781 Bytes
/
xinput1_3.c
File metadata and controls
36 lines (26 loc) · 781 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
#include "xinput1_3.h"
XInputSetStatePtr realXInputSetState = NULL;
DWORD WINAPI XInputSetState(DWORD dwUserIndex, XINPUT_VIBRATION *pVibration)
{
if (realXInputSetState)
{
return realXInputSetState(dwUserIndex, pVibration);
}
return ERROR_DEVICE_NOT_CONNECTED;
}
void initXInputWrapper(void)
{
HMODULE xinput1_3dll;
char path[MAX_PATH];
GetSystemDirectoryA(path, MAX_PATH);
strcat_s(path, MAX_PATH, "\\xinput1_3.dll");
LOG("loading XInput1_3 from path %s", path);
xinput1_3dll = LoadLibrary(path);
if (!xinput1_3dll)
{
LOG("can't load the real XInput1_3 dll");
return;
}
realXInputSetState = (XInputSetStatePtr)GetProcAddress(xinput1_3dll, "XInputSetState");
LOG("loaded XInput1_3");
}