Lucas Zawacki : dinput/tests: Added a test for DIPROP_JOYSTICKID.

Alexandre Julliard julliard at winehq.org
Wed May 30 13:18:52 CDT 2012


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

Author: Lucas Zawacki <lfzawacki at gmail.com>
Date:   Tue May 29 13:42:28 2012 -0300

dinput/tests: Added a test for DIPROP_JOYSTICKID.

---

 dlls/dinput/tests/joystick.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/dlls/dinput/tests/joystick.c b/dlls/dinput/tests/joystick.c
index c2f63c2..a49ee2e 100644
--- a/dlls/dinput/tests/joystick.c
+++ b/dlls/dinput/tests/joystick.c
@@ -180,6 +180,7 @@ static BOOL CALLBACK EnumJoysticks(
     ULONG ref;
     DIDEVICEINSTANCE inst;
     DIDEVICEINSTANCE_DX3 inst3;
+    DIPROPDWORD dipw;
     HWND hWnd = get_hwnd();
     char oldstate[248], curstate[248];
 
@@ -205,6 +206,16 @@ static BOOL CALLBACK EnumJoysticks(
 
     trace("---- %s ----\n", lpddi->tszProductName);
 
+    /* Test for joystick ID property */
+    ZeroMemory(&dipw, sizeof(dipw));
+    dipw.diph.dwSize = sizeof(DIPROPDWORD);
+    dipw.diph.dwHeaderSize = sizeof(DIPROPHEADER);
+    dipw.diph.dwObj = 0;
+    dipw.diph.dwHow = DIPH_DEVICE;
+
+    hr = IDirectInputDevice_GetProperty(pJoystick, DIPROP_JOYSTICKID, &dipw.diph);
+    ok(SUCCEEDED(hr), "IDirectInputDevice_GetProperty() for DIPROP_JOYSTICKID failed\n");
+
     hr = IDirectInputDevice_SetDataFormat(pJoystick, NULL);
     ok(hr==E_POINTER,"IDirectInputDevice_SetDataFormat() should have returned "
        "E_POINTER, returned: %08x\n", hr);




More information about the wine-cvs mailing list