| version 1.1 | | version 1.2 |
|---|
| | |
| | | #define byte w32_byte |
| #define WIN32_LEAN_AND_MEAN | | #define WIN32_LEAN_AND_MEAN |
| #include <windows.h> | | #include <windows.h> |
| #include <stdio.h> | | #include <stdio.h> |
| #include <dinput.h> | | #include <dinput.h> |
| | | #undef byte |
| //#include "inferno.h" | | //#include "inferno.h" |
| #include "fix.h" | | #include "fix.h" |
| #include "timer.h" | | #include "timer.h" |
| | |
| | | |
| HRESULT ReadKey (DIDEVICEOBJECTDATA *pdidod) | | HRESULT ReadKey (DIDEVICEOBJECTDATA *pdidod) |
| { | | { |
| ULONG cElements = 1; | | DWORD cElements = 1; |
| HRESULT hr; | | HRESULT hr; |
| if (g_lpdidKeybd == NULL) | | if (g_lpdidKeybd == NULL) |
| return E_FAIL; | | return E_FAIL; |
| | |
| g_lpdidKeybd, | | g_lpdidKeybd, |
| sizeof (*pdidod), | | sizeof (*pdidod), |
| pdidod, | | pdidod, |
| (int *) &cElements, | | &cElements, |
| 0); | | 0); |
| if (SUCCEEDED (hr) && cElements != 1) | | if (SUCCEEDED (hr) && cElements != 1) |
| hr = E_FAIL; | | hr = E_FAIL; |
| | |
| { | | { |
| if (EnsureInit ()) | | if (EnsureInit ()) |
| { | | { |
| ULONG cElements = INFINITE; | | DWORD cElements = INFINITE; |
| // HRESULT hr = | | // HRESULT hr = |
| IDirectInputDevice_GetDeviceData ( | | IDirectInputDevice_GetDeviceData ( |
| g_lpdidKeybd, | | g_lpdidKeybd, |
| sizeof (DIDEVICEOBJECTDATA), | | sizeof (DIDEVICEOBJECTDATA), |
| NULL, | | NULL, |
| (int *) &cElements, | | &cElements, |
| 0); | | 0); |
| | | |
| } | | } |