Commit dd7b6573 authored by Bruno Jesus's avatar Bruno Jesus Committed by Alexandre Julliard

dinput: Implement GetDeviceInfo(A) using the W version in the event driver.

parent 4277b055
...@@ -339,7 +339,7 @@ static void find_joydevs(void) ...@@ -339,7 +339,7 @@ static void find_joydevs(void)
} }
} }
static void fill_joystick_dideviceinstanceA(LPDIDEVICEINSTANCEA lpddi, DWORD version, int id) static void fill_joystick_dideviceinstanceW(LPDIDEVICEINSTANCEW lpddi, DWORD version, int id)
{ {
DWORD dwSize = lpddi->dwSize; DWORD dwSize = lpddi->dwSize;
...@@ -356,29 +356,31 @@ static void fill_joystick_dideviceinstanceA(LPDIDEVICEINSTANCEA lpddi, DWORD ver ...@@ -356,29 +356,31 @@ static void fill_joystick_dideviceinstanceA(LPDIDEVICEINSTANCEA lpddi, DWORD ver
else else
lpddi->dwDevType = DIDEVTYPE_JOYSTICK | (DIDEVTYPEJOYSTICK_TRADITIONAL << 8); lpddi->dwDevType = DIDEVTYPE_JOYSTICK | (DIDEVTYPEJOYSTICK_TRADITIONAL << 8);
strcpy(lpddi->tszInstanceName, joydevs[id].name); MultiByteToWideChar(CP_ACP, 0, joydevs[id].name, -1, lpddi->tszInstanceName, MAX_PATH);
strcpy(lpddi->tszProductName, joydevs[id].name); MultiByteToWideChar(CP_ACP, 0, joydevs[id].name, -1, lpddi->tszProductName, MAX_PATH);
} }
static void fill_joystick_dideviceinstanceW(LPDIDEVICEINSTANCEW lpddi, DWORD version, int id) static void fill_joystick_dideviceinstanceA(LPDIDEVICEINSTANCEA lpddi, DWORD version, int id)
{ {
DIDEVICEINSTANCEW lpddiW;
DWORD dwSize = lpddi->dwSize; DWORD dwSize = lpddi->dwSize;
lpddiW.dwSize = sizeof(lpddiW);
fill_joystick_dideviceinstanceW(&lpddiW, version, id);
TRACE("%d %p\n", dwSize, lpddi); TRACE("%d %p\n", dwSize, lpddi);
memset(lpddi, 0, dwSize); memset(lpddi, 0, dwSize);
/* Convert W->A */
lpddi->dwSize = dwSize; lpddi->dwSize = dwSize;
lpddi->guidInstance = joydevs[id].guid; lpddi->guidInstance = lpddiW.guidInstance;
lpddi->guidProduct = joydevs[id].guid_product; lpddi->guidProduct = lpddiW.guidProduct;
lpddi->guidFFDriver = GUID_NULL; lpddi->dwDevType = lpddiW.dwDevType;
strcpy(lpddi->tszInstanceName, joydevs[id].name);
if (version >= 0x0800) strcpy(lpddi->tszProductName, joydevs[id].name);
lpddi->dwDevType = DI8DEVTYPE_JOYSTICK | (DI8DEVTYPEJOYSTICK_STANDARD << 8); lpddi->guidFFDriver = lpddiW.guidFFDriver;
else lpddi->wUsagePage = lpddiW.wUsagePage;
lpddi->dwDevType = DIDEVTYPE_JOYSTICK | (DIDEVTYPEJOYSTICK_TRADITIONAL << 8); lpddi->wUsage = lpddiW.wUsage;
MultiByteToWideChar(CP_ACP, 0, joydevs[id].name, -1, lpddi->tszInstanceName, MAX_PATH);
MultiByteToWideChar(CP_ACP, 0, joydevs[id].name, -1, lpddi->tszProductName, MAX_PATH);
} }
static HRESULT joydev_enum_deviceA(DWORD dwDevType, DWORD dwFlags, LPDIDEVICEINSTANCEA lpddi, DWORD version, int id) static HRESULT joydev_enum_deviceA(DWORD dwDevType, DWORD dwFlags, LPDIDEVICEINSTANCEA lpddi, DWORD version, int id)
......
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