From: Mohamad Al-Jaf mohamadaljaf@gmail.com
The game INVERSUS Deluxe calls upon this function and crashes without it.
Signed-off-by: Mohamad Al-Jaf mohamadaljaf@gmail.com Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/hid/hid.spec | 2 +- dlls/hid/hidd.c | 6 ++++++ include/ddk/hidsdi.h | 1 + 3 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/dlls/hid/hid.spec b/dlls/hid/hid.spec index 37dfdbce307..67c4473129d 100644 --- a/dlls/hid/hid.spec +++ b/dlls/hid/hid.spec @@ -9,7 +9,7 @@ @ stdcall HidD_GetManufacturerString(long ptr long) @ stub HidD_GetMsGenreDescriptor @ stdcall HidD_GetNumInputBuffers(long ptr) -@ stub HidD_GetPhysicalDescriptor +@ stdcall HidD_GetPhysicalDescriptor(long ptr long) @ stdcall HidD_GetPreparsedData(ptr ptr) @ stdcall HidD_GetProductString(long ptr long) @ stdcall HidD_GetSerialNumberString(long ptr long) diff --git a/dlls/hid/hidd.c b/dlls/hid/hidd.c index 3b2e5a9fe4e..af024b456b4 100644 --- a/dlls/hid/hidd.c +++ b/dlls/hid/hidd.c @@ -121,6 +121,12 @@ BOOLEAN WINAPI HidD_SetNumInputBuffers( HANDLE file, ULONG num_buffer ) return sync_ioctl( file, IOCTL_SET_NUM_DEVICE_INPUT_BUFFERS, &num_buffer, sizeof(num_buffer), NULL, 0 ); }
+BOOLEAN WINAPI HidD_GetPhysicalDescriptor( HANDLE file, void *buffer, ULONG buffer_len ) +{ + TRACE( "file %p, buffer %p, buffer_len %lu.\n", file, buffer, buffer_len ); + return sync_ioctl( file, IOCTL_GET_PHYSICAL_DESCRIPTOR, NULL, 0, buffer, buffer_len ); +} + BOOLEAN WINAPI HidD_GetProductString( HANDLE file, void *buffer, ULONG buffer_len ) { TRACE( "file %p, buffer %p, buffer_len %lu.\n", file, buffer, buffer_len ); diff --git a/include/ddk/hidsdi.h b/include/ddk/hidsdi.h index 22f64e687e7..72470079a79 100644 --- a/include/ddk/hidsdi.h +++ b/include/ddk/hidsdi.h @@ -41,6 +41,7 @@ BOOLEAN WINAPI HidD_GetIndexedString(HANDLE file, ULONG index, void *buffer, ULO BOOLEAN WINAPI HidD_GetInputReport(HANDLE HidDeviceObject, PVOID ReportBuffer, ULONG ReportBufferLength); BOOLEAN WINAPI HidD_GetManufacturerString(HANDLE HidDeviceObject, PVOID Buffer, ULONG BufferLength); BOOLEAN WINAPI HidD_GetNumInputBuffers(HANDLE HidDeviceObject, ULONG *NumberBuffers); +BOOLEAN WINAPI HidD_GetPhysicalDescriptor(HANDLE HidDeviceObject, PVOID Buffer, ULONG BufferLength); BOOLEAN WINAPI HidD_GetProductString(HANDLE HidDeviceObject, PVOID Buffer, ULONG BufferLength); BOOLEAN WINAPI HidD_GetSerialNumberString(HANDLE HidDeviceObject, PVOID Buffer, ULONG BufferLength); BOOLEAN WINAPI HidD_SetFeature(HANDLE HidDeviceObject, PVOID ReportBuffer, ULONG ReportBufferLength);
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/dinput/tests/driver_bus.c | 5 +++++ dlls/dinput/tests/hid.c | 5 +++++ 2 files changed, 10 insertions(+)
diff --git a/dlls/dinput/tests/driver_bus.c b/dlls/dinput/tests/driver_bus.c index be38de1999e..6d7f86d0691 100644 --- a/dlls/dinput/tests/driver_bus.c +++ b/dlls/dinput/tests/driver_bus.c @@ -1156,6 +1156,11 @@ static NTSTATUS WINAPI pdo_internal_ioctl( DEVICE_OBJECT *device, IRP *irp ) status = STATUS_SUCCESS; break;
+ case IOCTL_GET_PHYSICAL_DESCRIPTOR: + irp->IoStatus.Information = 0; + status = STATUS_NOT_SUPPORTED; + break; + default: ok( 0, "unexpected call\n" ); status = irp->IoStatus.Status; diff --git a/dlls/dinput/tests/hid.c b/dlls/dinput/tests/hid.c index 8f984a006ac..1059d6c2b57 100644 --- a/dlls/dinput/tests/hid.c +++ b/dlls/dinput/tests/hid.c @@ -1545,6 +1545,11 @@ static void test_hidp( HANDLE file, HANDLE async_file, int report_id, BOOL polle USHORT count; BOOL ret;
+ SetLastError( 0xdeadbeef ); + ret = HidD_GetPhysicalDescriptor( file, buffer, sizeof(buffer) ); + ok( !ret, "HidD_GetPhysicalDescriptor succeeded\n" ); + ok( GetLastError() == ERROR_NOT_SUPPORTED, "got error %lu\n", GetLastError() ); + ret = HidD_GetPreparsedData( file, &preparsed_data ); ok( ret, "HidD_GetPreparsedData failed with error %lu\n", GetLastError() );
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=111611
Your paranoid android.
=== w7u_adm (32 bit report) ===
dinput: device8: Timeout
=== w8 (32 bit report) ===
dinput: device8.c:909: Test failed: Expected 1 element, received 0 device8.c:913: Test failed: Expected DIK_SPACE key state down device8.c:921: Test failed: Expected 1 element, received 0 device8.c:936: Test failed: Expected key 0 state down