[PATCH v2 3/5] dinput: Implement DIPROP_VIDPID property.
Rémi Bernon
rbernon at codeweavers.com
Tue Jun 29 08:15:22 CDT 2021
Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
---
dlls/dinput/joystick_hid.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/dlls/dinput/joystick_hid.c b/dlls/dinput/joystick_hid.c
index ea7c55ab923..63cd5d7ca14 100644
--- a/dlls/dinput/joystick_hid.c
+++ b/dlls/dinput/joystick_hid.c
@@ -53,6 +53,7 @@ struct hid_joystick
PHIDP_PREPARSED_DATA preparsed;
DIDEVICEINSTANCEW instance;
+ HIDD_ATTRIBUTES attrs;
};
static inline struct hid_joystick *impl_from_IDirectInputDevice8W( IDirectInputDevice8W *iface )
@@ -118,6 +119,13 @@ static HRESULT WINAPI hid_joystick_GetProperty( IDirectInputDevice8W *iface, REF
lstrcpynW( value->wsz, impl->instance.tszInstanceName, MAX_PATH );
return DI_OK;
}
+ case (DWORD_PTR)DIPROP_VIDPID:
+ {
+ DIPROPDWORD *value = (DIPROPDWORD *)header;
+ if (!impl->attrs.VendorID || !impl->attrs.ProductID) return DIERR_UNSUPPORTED;
+ value->dwData = MAKELONG( impl->attrs.VendorID, impl->attrs.ProductID );
+ return DI_OK;
+ }
case (DWORD_PTR)DIPROP_JOYSTICKID:
{
DIPROPDWORD *value = (DIPROPDWORD *)header;
@@ -452,6 +460,7 @@ static HRESULT hid_joystick_create_device( IDirectInputImpl *dinput, REFGUID gui
impl->preparsed = preparsed;
impl->instance = instance;
+ impl->attrs = attrs;
if (!(format = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*format) ))) goto failed;
impl->base.data_format.wine_df = format;
--
2.32.0
More information about the wine-devel
mailing list