Andrew Eikum : hid: Pass a buffer to DeviceIoControl in HidD_SetNumInputBuffers.

Alexandre Julliard julliard at winehq.org
Tue Jan 9 15:49:38 CST 2018


Module: wine
Branch: master
Commit: 2de3dc3dd6059a1297a698c72a92b23eda853483
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=2de3dc3dd6059a1297a698c72a92b23eda853483

Author: Andrew Eikum <aeikum at codeweavers.com>
Date:   Tue Jan  9 10:28:18 2018 -0600

hid: Pass a buffer to DeviceIoControl in HidD_SetNumInputBuffers.

DeviceIoControl expects a pointer, and this value gets dereferenced as a
ULONG* in hidclass.sys.

Signed-off-by: Andrew Eikum <aeikum at codeweavers.com>
Signed-off-by: Aric Stewart <aric at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/hid/hidd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dlls/hid/hidd.c b/dlls/hid/hidd.c
index 1161f0c..614e7c4 100644
--- a/dlls/hid/hidd.c
+++ b/dlls/hid/hidd.c
@@ -102,7 +102,7 @@ BOOLEAN WINAPI HidD_SetFeature(HANDLE HidDeviceObject, PVOID ReportBuffer, ULONG
 BOOLEAN WINAPI HidD_SetNumInputBuffers(HANDLE HidDeviceObject, ULONG NumberBuffers)
 {
     TRACE("(%p %i)\n", HidDeviceObject, NumberBuffers);
-    return DeviceIoControl(HidDeviceObject, IOCTL_SET_NUM_DEVICE_INPUT_BUFFERS, UlongToPtr(NumberBuffers), sizeof(NumberBuffers), NULL, 0, NULL, NULL);
+    return DeviceIoControl(HidDeviceObject, IOCTL_SET_NUM_DEVICE_INPUT_BUFFERS, &NumberBuffers, sizeof(NumberBuffers), NULL, 0, NULL, NULL);
 }
 
 BOOLEAN WINAPI HidD_GetProductString(HANDLE HidDeviceObject, PVOID Buffer, ULONG BufferLength)




More information about the wine-cvs mailing list