dinput/tests: Improve controller debug information

Bruno Jesus 00cpxxx at gmail.com
Sun Aug 14 13:12:54 CDT 2016


Was useful to find differences between Wine/Windows device
enumeration. Sample output:

---- Controller Information ----
Product Name  : USB GamePad STD. (js)
Instance Name : USB GamePad STD. (js)
devType       : 0x00000204
GUID Product  : {68750603-0000-0000-0000-504944564944}
GUID Instance : {9e573ed9-7734-0001-8d4a-23903fb6bdf7}
HID Page      : 0x0000
HID Usage     : 0x0000

Signed-off-by: Bruno Jesus <00cpxxx at gmail.com>
-------------- next part --------------
diff --git a/dlls/dinput/tests/joystick.c b/dlls/dinput/tests/joystick.c
index b196ea7..4882744 100644
--- a/dlls/dinput/tests/joystick.c
+++ b/dlls/dinput/tests/joystick.c
@@ -203,7 +203,21 @@ static BOOL CALLBACK EnumJoysticks(const DIDEVICEINSTANCEA *lpddi, void *pvRef)
     if (hr!=DI_OK)
         goto DONE;
 
-    trace("---- %s ----\n", lpddi->tszProductName);
+    trace("---- Controller Information ----\n"
+          "Product Name  : %s\n"
+          "Instance Name : %s\n"
+          "devType       : 0x%08x\n"
+          "GUID Product  : %s\n"
+          "GUID Instance : %s\n"
+          "HID Page      : 0x%04x\n"
+          "HID Usage     : 0x%04x\n",
+          lpddi->tszProductName,
+          lpddi->tszInstanceName,
+          lpddi->dwDevType,
+          wine_dbgstr_guid(&lpddi->guidProduct),
+          wine_dbgstr_guid(&lpddi->guidInstance),
+          lpddi->wUsagePage,
+          lpddi->wUsage);
 
     /* Test for joystick ID property */
     ZeroMemory(&dipw, sizeof(dipw));


More information about the wine-patches mailing list