Commit 913cbb9f authored by Lucas Zawacki's avatar Lucas Zawacki Committed by Alexandre Julliard

dinput/tests: Test for DIPROP_INSTANCENAME and DIPROP_GUIDANDPATH.

parent 59c144f1
......@@ -181,6 +181,9 @@ static BOOL CALLBACK EnumJoysticks(
DIDEVICEINSTANCE inst;
DIDEVICEINSTANCE_DX3 inst3;
DIPROPDWORD dipw;
DIPROPSTRING dps;
DIPROPGUIDANDPATH dpg;
WCHAR nameBuffer[MAX_PATH];
HWND hWnd = get_hwnd();
char oldstate[248], curstate[248];
......@@ -216,6 +219,29 @@ static BOOL CALLBACK EnumJoysticks(
hr = IDirectInputDevice_GetProperty(pJoystick, DIPROP_JOYSTICKID, &dipw.diph);
ok(SUCCEEDED(hr), "IDirectInputDevice_GetProperty() for DIPROP_JOYSTICKID failed\n");
/* Test for INSTANCENAME property */
memset(&dps, 0, sizeof(dps));
dps.diph.dwSize = sizeof(DIPROPSTRING);
dps.diph.dwHeaderSize = sizeof(DIPROPHEADER);
dps.diph.dwHow = DIPH_DEVICE;
hr = IDirectInputDevice_GetProperty(pJoystick, DIPROP_INSTANCENAME, &dps.diph);
ok(SUCCEEDED(hr), "IDirectInput_GetProperty() for DIPROP_INSTANCENAME failed: %08x\n", hr);
/* Test if instance name is the same as present in DIDEVICEINSTANCE */
MultiByteToWideChar(CP_ACP, 0, lpddi->tszInstanceName, -1, nameBuffer, MAX_PATH);
ok(!lstrcmpW(nameBuffer, dps.wsz), "DIPROP_INSTANCENAME returned is wrong. Expected: %s Got: %s\n",
wine_dbgstr_w(nameBuffer), wine_dbgstr_w(dps.wsz));
/* Test for GUIDPATH properties */
memset(&dpg, 0, sizeof(dpg));
dpg.diph.dwSize = sizeof(DIPROPGUIDANDPATH);
dpg.diph.dwHeaderSize = sizeof(DIPROPHEADER);
dpg.diph.dwHow = DIPH_DEVICE;
hr = IDirectInputDevice_GetProperty(pJoystick, DIPROP_GUIDANDPATH, &dpg.diph);
todo_wine ok(SUCCEEDED(hr), "IDirectInput_GetProperty() for DIPROP_GUIDANDPATH failed: %08x\n", hr);
hr = IDirectInputDevice_SetDataFormat(pJoystick, NULL);
ok(hr==E_POINTER,"IDirectInputDevice_SetDataFormat() should have returned "
"E_POINTER, returned: %08x\n", hr);
......
......@@ -905,6 +905,8 @@ typedef const DIPROPSTRING *LPCDIPROPSTRING;
#define DIPROP_CALIBRATION MAKEDIPROP(11)
#define DIPROP_GUIDANDPATH MAKEDIPROP(12)
#define DIPROP_INSTANCENAME MAKEDIPROP(13)
#define DIPROP_JOYSTICKID MAKEDIPROP(15)
#define DIPROP_KEYNAME MAKEDIPROP(20)
#define DIPROP_VIDPID MAKEDIPROP(24)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment