Vitaliy Margolen : dinput: Fix buffer size in test.

Alexandre Julliard julliard at winehq.org
Mon Oct 17 13:08:53 CDT 2011


Module: wine
Branch: master
Commit: e93998002728b58cbf1097c515fd09cc1d22cd59
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=e93998002728b58cbf1097c515fd09cc1d22cd59

Author: Vitaliy Margolen <wine-patches at kievinfo.com>
Date:   Sun Oct 16 12:36:43 2011 -0600

dinput: Fix buffer size in test.

---

 dlls/dinput/tests/device.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/dlls/dinput/tests/device.c b/dlls/dinput/tests/device.c
index 2e4e4f8..7171bb8 100644
--- a/dlls/dinput/tests/device.c
+++ b/dlls/dinput/tests/device.c
@@ -127,7 +127,7 @@ static void test_object_info(LPDIRECTINPUTDEVICE device, HWND hwnd)
         ok(hr == DI_OK, "SetProperty() failed: %08x\n", hr);
 
         cnt = 5;
-        hr = IDirectInputDevice_GetDeviceData(device, sizeof(buffer), buffer, &cnt, 0);
+        hr = IDirectInputDevice_GetDeviceData(device, sizeof(buffer[0]), buffer, &cnt, 0);
         ok(hr == DI_OK && cnt == 5, "GetDeviceData() failed: %08x cnt: %d\n", hr, cnt);
 
         dp.dwData = 20;
@@ -135,15 +135,17 @@ static void test_object_info(LPDIRECTINPUTDEVICE device, HWND hwnd)
         ok(hr == DI_OK, "SetProperty() failed: %08x\n", hr);
 
         cnt = 1;
-        hr = IDirectInputDevice_GetDeviceData(device, sizeof(buffer), buffer, &cnt, 0);
+        hr = IDirectInputDevice_GetDeviceData(device, sizeof(buffer[0]), buffer, &cnt, 0);
         ok(hr == DI_OK, "GetDeviceData() failed: %08x\n", hr);
 
         /* Cannot change mode while acquired */
         hr = IDirectInputDevice_Acquire(device);
         ok(hr == DI_OK, "Acquire() failed: %08x\n", hr);
         cnt = 1;
-        hr = IDirectInputDevice_GetDeviceData(device, sizeof(buffer), buffer, &cnt, 0);
+        hr = IDirectInputDevice_GetDeviceData(device, sizeof(buffer[0]), buffer, &cnt, 0);
         ok(hr == DI_OK, "GetDeviceData() failed: %08x\n", hr);
+
+
         hr = IDirectInputDevice_SetProperty(device, DIPROP_AXISMODE, &dp.diph);
         ok(hr == DIERR_ACQUIRED, "SetProperty() returned: %08x\n", hr);
         hr = IDirectInputDevice_Unacquire(device);




More information about the wine-cvs mailing list