Hi,
Since I installed the usb video lower filter driver, I am trying to get and print the webcam data in my ‘EvtIoInternalCompletion’ routine. My code is as follows
VOID
KMDFDriver1EvtIoInternalDeviceControl(
In WDFQUEUE Queue,
In WDFREQUEST Request,
In size_t OutputBufferLength,
In size_t InputBufferLength,
In ULONG IoControlCode
)
{
WDFDEVICE device;
PIRP wdmIrp;
WDF_REQUEST_PARAMETERS params;
UNREFERENCED_PARAMETER( Queue);
//
// Get the WDM IRP
//
wdmIrp = WdfRequestWdmGetIrp(Request);
WDF_REQUEST_PARAMETERS_INIT(¶ms);
WdfRequestGetParameters(Request, ¶ms);
WdfFltrTrace((“IRP-0x%p; InputBufferLength-%ld; OutputBufferLength-%ld; I/O Control
Code-0x%x;\n”,
wdmIrp, (long)InputBufferLength, (long)OutputBufferLength, IoControlCode));
device = WdfIoQueueGetDevice(Queue);
FilterForwardRequestWithCompletion(Request, WdfDeviceGetIoTarget(device),
InternalIOCompletionRoutine, WDF_NO_CONTEXT);
return;
}
void InternalIOCompletionRoutine(
__in WDFREQUEST Request,
__in WDFIOTARGET Target,
__in PWDF_REQUEST_COMPLETION_PARAMS Params,
__in WDFCONTEXT Context
){
PIRP wdmIrp;
UNREFERENCED_PARAMETER(Target);
UNREFERENCED_PARAMETER(Context);
wdmIrp = WdfRequestWdmGetIrp(Request);
WdfFltrTrace(("MDL adress-%p; IRP User Buffer Address-%p; IRP SystemBuffer
Address-%p;\n ", wdmIrp->MdlAddress, wdmIrp->UserBuffer,
wdmIrp->AssociatedIrp.SystemBuffer));
/*
WdfFltrTrace((“IRP-%p; Status-0x%x; Type-0x%x; Size-0x%x\n”,
wdmIrp, Params->IoStatus.Status,
Params->Type, Params->Parameters.Ioctl.Output.Offset));
*/
WdfRequestComplete(Request, Params->IoStatus.Status);
return;
}
VOID
FilterForwardRequestWithCompletion(
IN WDFREQUEST Request,
IN WDFIOTARGET Target,
IN PFN_WDF_REQUEST_COMPLETION_ROUTINE CompletionRoutine,
IN WDFCONTEXT CompletionContext
)
{
NTSTATUS status;
WdfRequestFormatRequestUsingCurrentType(Request);
WdfRequestSetCompletionRoutine(Request, CompletionRoutine, CompletionContext);
if(!WdfRequestSend(Request, Target, WDF_NO_SEND_OPTIONS)){
status = WdfRequestGetStatus(Request);
WdfFltrTrace((“WdfRequestSend failed - 0x%x\n”, status));
WdfRequestComplete(Request, status);
}
return;
}
However, my debug output is
Filter!KMDFDriver1EvtIoInternalDeviceControl: IRP-0x854DDE28; InputBufferLength-0; OutputBufferLength–2065253848; I/O Control Code-0x220003;
Filter!InternalIOCompletionRoutine: MDL adress-00000000; IRP User Buffer Address-00000000; IRP SystemBuffer Address-00000000;
All the data buffers are null. Even if when I print Params->Type, it shows 0xff which means ‘WdfRequestTypeNoFormat’. The Params->Parameters.Ioctl.Output.Offset prints 0x0. The UsbCompletionParams in the WDF_REQUEST_Completion_Params is also null.
Do I have to format the request while forwarding or do anything specific to USB? Please help me with some directions. Thanks for your patience and support.