阅读:1192回复:1
How to read/write employ hidclass minidriver for USB device
NTSTATUS DispatchReadReport(
IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp ) { PDEVICE_EXTENSION deviceExtension; NTSTATUS status; PIO_STACK_LOCATION irpStack; // get our device extension deviceExtension = GET_DEVICE_EXTENSION(DeviceObject); irpStack = IoGetCurrentIrpStackLocation(Irp); if (sizeof(Report_Struct) <= irpStack->Parameters.DeviceIoControl.OutputBufferLength) { <obtain report data> //how to obtain report data RtlCopyMemory( Irp->UserBuffer, Report_Struct, sizeof(Report_Struct) ); Irp->IoStatus.Information = sizeof(Report_Struct); } else { status = STATUS_BUFFER_TOO_SMALL; } return status; } [编辑 - 5/12/04 by baronwang] [编辑 - 5/12/04 by baronwang] [编辑 - 5/12/04 by baronwang] |
|
沙发#
发布于:2004-05-19 18:25
在(Programming the Microsoft WDM 2e)所真, 要取得Data需用URB
|
|