Commit 44303b66 authored by Bruno Jesus's avatar Bruno Jesus Committed by Alexandre Julliard

dinput: Implement DIPROP_PRODUCTNAME in GetProperty.

parent aab54da6
......@@ -583,6 +583,7 @@ HRESULT WINAPI JoystickWGenericImpl_GetProperty(LPDIRECTINPUTDEVICE8W iface, REF
}
break;
}
case (DWORD_PTR) DIPROP_PRODUCTNAME:
case (DWORD_PTR) DIPROP_INSTANCENAME: {
DIPROPSTRING *ps = (DIPROPSTRING*) pdiph;
DIDEVICEINSTANCEW didev;
......@@ -590,7 +591,10 @@ HRESULT WINAPI JoystickWGenericImpl_GetProperty(LPDIRECTINPUTDEVICE8W iface, REF
didev.dwSize = sizeof(didev);
IDirectInputDevice_GetDeviceInfo(iface, &didev);
lstrcpynW(ps->wsz, didev.tszInstanceName, MAX_PATH);
if (LOWORD(rguid) == (DWORD_PTR) DIPROP_PRODUCTNAME)
lstrcpynW(ps->wsz, didev.tszProductName, MAX_PATH);
else
lstrcpynW(ps->wsz, didev.tszInstanceName, MAX_PATH);
return DI_OK;
}
......
......@@ -253,6 +253,14 @@ static BOOL CALLBACK EnumJoysticks(const DIDEVICEINSTANCEA *lpddi, void *pvRef)
ok(!lstrcmpW(nameBuffer, dps.wsz), "DIPROP_INSTANCENAME returned is wrong. Expected: %s Got: %s\n",
wine_dbgstr_w(nameBuffer), wine_dbgstr_w(dps.wsz));
hr = IDirectInputDevice_GetProperty(pJoystick, DIPROP_PRODUCTNAME, &dps.diph);
ok(SUCCEEDED(hr), "IDirectInput_GetProperty() for DIPROP_PRODUCTNAME failed: %08x\n", hr);
/* Test if product name is the same as present in DIDEVICEINSTANCE */
MultiByteToWideChar(CP_ACP, 0, lpddi->tszProductName, -1, nameBuffer, MAX_PATH);
ok(!lstrcmpW(nameBuffer, dps.wsz), "DIPROP_PRODUCTNAME 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);
......
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