diff --git a/docs/rh-log.txt b/docs/rh-log.txt index 690ece343..f497a0ac8 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,4 +1,9 @@ -June 7, 2009 (Changes by Graf Zahl) +June 8, 2009 +- Fixed: The RAWINPUT buffer that GetRawInputData() fills in is 40 bytes on + Win32 but 48 bytes on Win64, so Raw Mouse on x64 builds was getting random + data off the stack because I also interpreted the error return incorrectly. + +June 7, 2009 (Changes by Graf Zahl) - added parameter to A_FadeOut so that removing the actor can be made an option. - added PERSISTENTPOWER and TRANSFERPOINTERS submissions by Gez. - fixed FORCEPAIN logic. diff --git a/src/win32/i_mouse.cpp b/src/win32/i_mouse.cpp index 611784a5a..9130a9d7f 100644 --- a/src/win32/i_mouse.cpp +++ b/src/win32/i_mouse.cpp @@ -575,12 +575,14 @@ bool FRawMouse::WndProcHook(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPara } if (message == WM_INPUT) { - BYTE buffer[40]; + BYTE buffer[sizeof(RAWINPUT)]; UINT size = sizeof(buffer); int i; USHORT mask; + UINT gridret; - if (MyGetRawInputData((HRAWINPUT)lParam, RID_INPUT, buffer, &size, sizeof(RAWINPUTHEADER)) > 0) + gridret = MyGetRawInputData((HRAWINPUT)lParam, RID_INPUT, buffer, &size, sizeof(RAWINPUTHEADER)); + if (gridret != (UINT)-1 && gridret > 0) { RAWINPUT *raw = (RAWINPUT *)buffer; if (raw->header.dwType != RIM_TYPEMOUSE)