Skip to content

Commit fee0fbb

Browse files
committed
WIP win-vhid iter10: deliver raw 8-byte input report (unnumbered, fits read buffer)
1 parent 2f9de0a commit fee0fbb

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

src/tests/windows/driver/vhidmini.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1324,7 +1324,7 @@ Return Value:
13241324
PMANUAL_QUEUE_CONTEXT queueContext;
13251325
WDFREQUEST request;
13261326
LONG command;
1327-
UCHAR inputReport[1 + TEST_VDEV_REPORT_SIZE]; /* report id + payload */
1327+
const UCHAR *payload;
13281328
static const UCHAR inputA[TEST_VDEV_REPORT_SIZE] = { TEST_VDEV_INPUT_A_BYTES };
13291329
static const UCHAR inputB[TEST_VDEV_REPORT_SIZE] = { TEST_VDEV_INPUT_B_BYTES };
13301330

@@ -1352,12 +1352,11 @@ Return Value:
13521352
return;
13531353
}
13541354

1355-
inputReport[0] = 0; /* report id (the device is unnumbered) */
1356-
RtlCopyMemory(inputReport + 1,
1357-
(command == TEST_VDEV_CMD_EMIT_B) ? inputB : inputA,
1358-
TEST_VDEV_REPORT_SIZE);
1359-
1360-
status = RequestCopyFromBuffer(request, inputReport, sizeof(inputReport));
1355+
/* Deliver the raw report bytes (no report-id prefix: the device is
1356+
unnumbered, so the report on the wire is just the payload). hidclass
1357+
frames it for user mode; HIDAPI returns exactly these bytes. */
1358+
payload = (command == TEST_VDEV_CMD_EMIT_B) ? inputB : inputA;
1359+
status = RequestCopyFromBuffer(request, (PVOID)payload, TEST_VDEV_REPORT_SIZE);
13611360
WdfRequestComplete(request, status);
13621361
}
13631362

0 commit comments

Comments
 (0)