I have written the following but when I have dwUserIndex as 0,1,2,3 or any number, doesn't really matter, it always returns ERROR_BAD_ARGUMENTS.
DWORD XInputGetState(DWORD dwUserIndex, XINPUT_STATE* pState) { FIXME("Stub - Controller: %d \n", dwUserIndex);
if (dwUserIndex >= 0 && dwUserIndex < 4) { return ERROR_DEVICE_NOT_CONNECTED; /* If controller is connected return ERROR_SUCCESS */ } return ERROR_BAD_ARGUMENTS; }