[PATCH 8/9] dinput/tests: Remove output and feature report buffers length checks.
Rémi Bernon
wine at gitlab.winehq.org
Tue May 3 04:20:50 CDT 2022
From: Rémi Bernon <rbernon at codeweavers.com>
They are checked against the expected packet anyway, and they otherwise
are enforced to match their specific individual report length, which we
don't have any info about here.
Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
---
dlls/dinput/tests/driver_bus.c | 19 +++++--------------
dlls/dinput/tests/force_feedback.c | 20 +++++++++++++++++---
2 files changed, 22 insertions(+), 17 deletions(-)
diff --git a/dlls/dinput/tests/driver_bus.c b/dlls/dinput/tests/driver_bus.c
index 9ece4414a1a..6554d50c14b 100644
--- a/dlls/dinput/tests/driver_bus.c
+++ b/dlls/dinput/tests/driver_bus.c
@@ -1072,11 +1072,10 @@ static NTSTATUS WINAPI pdo_internal_ioctl( DEVICE_OBJECT *device, IRP *irp )
case IOCTL_HID_WRITE_REPORT:
{
HID_XFER_PACKET *packet = irp->UserBuffer;
- ULONG expected_size = impl->caps.OutputReportByteLength - (impl->use_report_id ? 0 : 1);
ok( in_size == sizeof(*packet), "got input size %lu\n", in_size );
ok( !out_size, "got output size %lu\n", out_size );
- ok( packet->reportBufferLen >= expected_size, "got report size %lu\n", packet->reportBufferLen );
+ ok( !!packet->reportBuffer, "got buffer %p\n", packet->reportBuffer );
expect_queue_next( &impl->expect_queue, code, packet, &index, &expect, TRUE, context, sizeof(context) );
winetest_push_context( "%s expect[%ld]", context, index );
@@ -1095,11 +1094,9 @@ static NTSTATUS WINAPI pdo_internal_ioctl( DEVICE_OBJECT *device, IRP *irp )
case IOCTL_HID_GET_INPUT_REPORT:
{
HID_XFER_PACKET *packet = irp->UserBuffer;
- ULONG expected_size = impl->caps.InputReportByteLength - (impl->use_report_id ? 0 : 1);
+
ok( !in_size, "got input size %lu\n", in_size );
ok( out_size == sizeof(*packet), "got output size %lu\n", out_size );
-
- ok( packet->reportBufferLen >= expected_size, "got len %lu\n", packet->reportBufferLen );
ok( !!packet->reportBuffer, "got buffer %p\n", packet->reportBuffer );
expect_queue_next( &impl->expect_queue, code, packet, &index, &expect, FALSE, context, sizeof(context) );
@@ -1119,11 +1116,9 @@ static NTSTATUS WINAPI pdo_internal_ioctl( DEVICE_OBJECT *device, IRP *irp )
case IOCTL_HID_SET_OUTPUT_REPORT:
{
HID_XFER_PACKET *packet = irp->UserBuffer;
- ULONG expected_size = impl->caps.OutputReportByteLength - (impl->use_report_id ? 0 : 1);
+
ok( in_size == sizeof(*packet), "got input size %lu\n", in_size );
ok( !out_size, "got output size %lu\n", out_size );
-
- ok( packet->reportBufferLen >= expected_size, "got len %lu\n", packet->reportBufferLen );
ok( !!packet->reportBuffer, "got buffer %p\n", packet->reportBuffer );
expect_queue_next( &impl->expect_queue, code, packet, &index, &expect, TRUE, context, sizeof(context) );
@@ -1143,11 +1138,9 @@ static NTSTATUS WINAPI pdo_internal_ioctl( DEVICE_OBJECT *device, IRP *irp )
case IOCTL_HID_GET_FEATURE:
{
HID_XFER_PACKET *packet = irp->UserBuffer;
- ULONG expected_size = impl->caps.FeatureReportByteLength - (impl->use_report_id ? 0 : 1);
+
ok( !in_size, "got input size %lu\n", in_size );
ok( out_size == sizeof(*packet), "got output size %lu\n", out_size );
-
- ok( packet->reportBufferLen >= expected_size, "got len %lu\n", packet->reportBufferLen );
ok( !!packet->reportBuffer, "got buffer %p\n", packet->reportBuffer );
expect_queue_next( &impl->expect_queue, code, packet, &index, &expect, FALSE, context, sizeof(context) );
@@ -1167,11 +1160,9 @@ static NTSTATUS WINAPI pdo_internal_ioctl( DEVICE_OBJECT *device, IRP *irp )
case IOCTL_HID_SET_FEATURE:
{
HID_XFER_PACKET *packet = irp->UserBuffer;
- ULONG expected_size = impl->caps.FeatureReportByteLength - (impl->use_report_id ? 0 : 1);
+
ok( in_size == sizeof(*packet), "got input size %lu\n", in_size );
ok( !out_size, "got output size %lu\n", out_size );
-
- ok( packet->reportBufferLen >= expected_size, "got len %lu\n", packet->reportBufferLen );
ok( !!packet->reportBuffer, "got buffer %p\n", packet->reportBuffer );
expect_queue_next( &impl->expect_queue, code, packet, &index, &expect, TRUE, context, sizeof(context) );
diff --git a/dlls/dinput/tests/force_feedback.c b/dlls/dinput/tests/force_feedback.c
index 993fdfd41c2..e0f5ce4bca1 100644
--- a/dlls/dinput/tests/force_feedback.c
+++ b/dlls/dinput/tests/force_feedback.c
@@ -2012,7 +2012,11 @@ static BOOL test_force_feedback_joystick( DWORD version )
struct hid_device_desc desc =
{
.use_report_id = TRUE,
- .caps = { .InputReportByteLength = 5 },
+ .caps =
+ {
+ .InputReportByteLength = 5,
+ .OutputReportByteLength = 11,
+ },
.attributes = default_attributes,
};
const DIDEVCAPS expect_caps =
@@ -3467,7 +3471,12 @@ static void test_device_managed_effect(void)
struct hid_device_desc desc =
{
.use_report_id = TRUE,
- .caps = { .InputReportByteLength = 5 },
+ .caps =
+ {
+ .InputReportByteLength = 5,
+ .OutputReportByteLength = 11,
+ .FeatureReportByteLength = 5,
+ },
.attributes = default_attributes,
};
struct hid_expect expect_acquire[] =
@@ -5004,7 +5013,12 @@ static void test_windows_gaming_input(void)
struct hid_device_desc desc =
{
.use_report_id = TRUE,
- .caps = { .InputReportByteLength = 6 },
+ .caps =
+ {
+ .InputReportByteLength = 6,
+ .OutputReportByteLength = 11,
+ .FeatureReportByteLength = 5,
+ },
.attributes = default_attributes,
};
struct hid_expect expect_init[] =
--
GitLab
https://gitlab.winehq.org/wine/wine/-/merge_requests/26
More information about the wine-devel
mailing list