dinput: Implement DIPROP_PRODUCTNAME in GetProperty.

Signed-off-by: Bruno Jesus <00cpxxx@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
oldstable
Bruno Jesus 2016-08-18 16:40:22 -03:00 committed by Alexandre Julliard
parent aab54da669
commit 44303b6625
2 changed files with 13 additions and 1 deletions

View File

@ -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;
}

View File

@ -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);