From: valouflo on 5 Nov 2008 08:24 I followed your advise. I changed the way I got USBD_STATUS in completion parameters. I'm using WdfUsbTargetDeviceFormatRequestForControlTransfer() WdfRequestSetCompletionRoutine(..,YourCompletionRoutine,..) WdfRequestSend() with WDF_REQUEST_SEND_OPTION_SYNCHRONOUS This is working fine with kmdf 1.5 and also kmdf 1.7. Is that meaning that completion parameters are not available after calling WdfUsbTargetDeviceSendControlTransferSynchronously? On 1 nov, 00:22, Vishal Manan [MSFT] <VishalMananM...(a)discussions.microsoft.com> wrote: > This worked by chance on v1.5 and is not a regression. We fixed a bug in the > v1.5 code releated to this which could have potentially caused a crash. > > ------ > Please do not send e-mail directly to this alias. This alias is for > newsgroup purposes only. > The posting is provided "AS IS" with no warranties, and confers no rights.. > > "valouflo" wrote: > > Thanks for your help. > > > There is something that I don't understand. > > Why it is working with kmdf 1.5 and not with kmdf 1.7? > > > On 29 oct, 22:22, "Doron Holan [MSFT]" <dor...(a)online.microsoft.com> > > wrote: > > > the completion params are still valid in the request in the format+send > > > pattern after the send returns. they will remain valid until the request is > > > either deleted or reformatted > > > > d > > > > -- > > > Please do not send e-mail directly to this alias. this alias is for > > > newsgroup purposes only. > > > This posting is provided "AS IS" with no warranties, and confers no rights. > > > > "Vishal Manan [MSFT]" <VishalMananM...(a)discussions.microsoft.com> wrote in > > > messagenews:2AF5CDEE-AE05-44DC-8067-CF1797F8F0C2(a)microsoft.com... > > > > > If you need to check the completion params (usbd status etc) use the > > > > format + > > > > end pattern instead of calling > > > > WdfUsbTargetDeviceSendControlTransferSynchronously . > > > > > The following is the pseudo code with the pattern: > > > > > WdfUsbTargetDeviceFormatRequestForControlTransfer() > > > > WdfRequestSetCompletionRoutine(..,YourCompletionRoutine,..) > > > > Call WdfRequestSend() with WDF_REQUEST_SEND_OPTION_SYNCHRONOUS > > > > > The completion params will be passed into your "YourCompletionRoutine" . > > > > Let us know if you have any questions releated to the above. > > > > > Vishal > > > > > ------ > > > > Please do not send e-mail directly to this alias. This alias is for > > > > newsgroup purposes only. > > > > The posting is provided "AS IS" with no warranties, and confers no rights. > > > > > "valouflo" wrote: > > > > >> Finally, I got WDF symbols, but I don't see what is wrong in logs. > > > >> Here is my debug: > > > > >> ******************************************************************* > > > >> *************** breakpoint in WINDBG ************************ > > > >> ******************************************************************* > > > >> VOID > > > >> FORCEINLINE > > > >> WdfRequestGetCompletionParams( > > > >> __in > > > >> WDFREQUEST Request, > > > >> __out > > > >> PWDF_REQUEST_COMPLETION_PARAMS Params > > > >> ) > > > >> { > > > >> ((PFN_WDFREQUESTGETCOMPLETIONPARAMS) > > > >> WdfFunctions[WdfRequestGetCompletionParamsTableIndex]) > > > >> (WdfDriverGlobals, Request, Params); > > > >> } > > > >> ******************************************************************* > > > >> *************** Parameters ************************************* > > > >> ******************************************************************** > > > >> Params > > > >> ------------- > > > >> Size = 0x28 > > > >> Type = WdfRequestTypeNoFormat(255) > > > >> IOStatus > > > >> Status = 0 > > > >> Pointer = 0x00000000 > > > > >> Request > > > >> ------------- > > > >> DBGENG: 'c:\winddk\6001\inc\wdf\kmdf\1.7\wdfrequest.h' - found > > > >> kd> !wdfrequest 0x7a262390 > > > >> !IRP 0x85dad008 > > > >> State: Allocated by driver, IRP allocated by WDF > > > >> !WDFIOTARGET 0x7a062b78 > > > > >> kd> !irp 0x85dad008 > > > >> Irp is active with 5 stacks 6 is current (= 0x85dad12c) > > > >> No Mdl: No System Buffer: Thread 00000000: Irp is completed. > > > >> cmd flg cl Device File Completion-Context > > > >> [ 0, 0] 0 0 00000000 00000000 00000000-00000000 > > > > >> Args: 00000000 00000000 00000000 00000000 > > > >> [ 0, 0] 0 0 00000000 00000000 00000000-00000000 > > > > >> Args: 00000000 00000000 00000000 00000000 > > > >> [ 0, 0] 0 0 00000000 00000000 00000000-00000000 > > > > >> Args: 00000000 00000000 00000000 00000000 > > > >> [ f, 0] 0 0 85e3e030 00000000 00000000-00000000 > > > >> \Driver\usbehci > > > >> Args: 00000000 00000000 00000000 00000000 > > > >> [ f, 0] 0 0 85af7ba0 00000000 808183e6-85d98b30 > > > >> \Driver\usbccgp nt!IopUnloadSafeCompletion > > > >> Args: 00000000 00000000 00000000 00000000 > > > >> kd> !WDFIOTARGET 0x7a062b78 > > > > >> WDFIOTARGET 7a062b78 > > > >> ========================= > > > >> WDFDEVICE: 0x7a53ea58 > > > >> Target Device: !devobj 0x85af7ba0 > > > >> Target PDO: !devobj 0x85af7ba0 > > > > >> Type: Instack target > > > >> State: WdfIoTargetStarted > > > > >> Requests pending: 0 > > > > >> Requests sent: 0 > > > > >> Requests sent with ignore-target-state: 0 > > > > >> ********************************************************************************** > > > >> ******************* Messages in WINDBG > > > >> *********************************** > > > >> ********************************************************************************** > > > >> kd> p > > > >> ocsIccd!WdfRequestGetCompletionParams+0x5: > > > >> f3f60245 8b450c mov eax,dword ptr [ebp+0Ch] > > > >> kd> p > > > >> KMDF detected potentially invalid operation by ocsIccd.sys. Turn on > > > >> framework verifier to break into the debugger. > > > >> ocsIccd!WdfRequestGetCompletionParams+0x1a: > > > >> f3f6025a 5d pop ebp > > > > >> ********************************************************************************* > > > >> ******************* WDF log Dump > > > >> ******************************************* > > > >> ********************************************************************************** > > > >> 220: FxRequest::_Create - Irp 00000000 Ownership FxRequestOwnsIrp > > > >> FxRequest 85D9DC68, status STATUS_SUCCESS > > > >> 221: imp_WdfRequestCreate - Created WDFREQUEST 7A262390, status > > > >> STATUS_SUCCESS > > > >> 222: imp_WdfUsbTargetDeviceSendControlTransferSynchronously - > > > >> WDFUSBDEVICE 7A062B78 control transfer sync > > > >> 223: imp_WdfUsbTargetDeviceSendControlTransferSynchronously - > > > >> WDFUSBDEVICE 7A062B78, WDFREQUEST 7A262390 being submitted > > > >> 224: FxIoTarget::SubmitSync - WDFIOTARGET 7A062B78, WDFREQUEST > > > >> 7A262390 > > > >> 225: FxIoTarget::SubmitSync - action 0x11 > > > >> 226: FxIoTarget::SubmitSync - Sending WDFREQUEST 7A262390, Irp > > > >> 85DAD008 > > > >> 227: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7A262390 > > > >> 228: FxIoTarget::RemoveCompletedRequestLocked - WDFIOTARGET 7A062B78, > > > >> WDFREQUEST 7A262390 > > > >> 229: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7A262390 > > > >> completed in completion routine > > > >> 230: imp_WdfUsbTargetDeviceSendControlTransferSynchronously - > > > >> WDFUSBDEVICE 7A062B78, STATUS_SUCCESS > > > >> 231: FxSyncRequest::SelfDestruct - SyncRequest BA0BD6A0, signaling > > > >> event BA0BD718 on SelfDestruct > > > >> 232: imp_WdfRequestGetCompletionParams - Enter: WDFREQUEST 7A262390, > > > >> Params BA0BD888 > > > > >> I hope you could give me some ideas > > > > >> On 27 oct, 14:19, valouflo <foulie...(a)yahoo.fr> wrote: > > > >> > Thanks for your help. > > > >> > But I have a problem, it seems that I don't have correct symbols for > > > >> > WDF. Actually, I don't have any symbols for WDF. > > > >> > Is there an other way than sym server to get WDF symbols? > > > >> > (PC that I'm using can't be connected to internet.) > > > > >> > On 25 oct, 00:35, Vishal Manan [MSFT] <Vishal Manan > > > > >> > [MSFT]@discussions.microsoft.com> wrote: > > > >> > > The trace message in the framework log should tell you what is going > > > >> > > on.. This > > > >> > > link shows you how to dump the trace > > > >> > > log:http://www.microsoft.com/whdc/Driver/tips/KMDF_IfrLog.mspx > > > >> > > Could you try dumping the log and if it doesn't help you, copy and > > > >> > > paste it > > > >> > > in your message? > > > > >> > > Thanks, > > > >> > > Vishal > > > > >> > > ------ > > > >> > > Please do not send e-mail directly to this alias. This alias is for > > > >> > > newsgroup purposes only. > > > >> > > The posting is provided "AS IS" with no warranties, and confers no > > > >> > > rights. > > > > >> > > "valouflo" wrote: > > > >> > > > Hi, > > > >> > > > I developped a usb driver based on WDF, first with kmdf 1.5. > > > >> > > > I used synchronous request to send control transfer to the device. > > > >> > > > As > > > >> > > > I needed to get the USBDSTATUS (in fact I checked if there was no > > > >> > > > STALL), I used WdfRequestGetCompletionParams function. > > > > >> > > > All is working fine with kmdf 1.5 but I had a problem when I wanted > > > >> > > > to > > > >> > > > use the version 1.7. > > > >> > > > Here is the code > > > > >> > > > nbBytes = 0; > > > >> > > > status = WdfUsbTargetDeviceSendControlTransferSynchronously( > > > >> > > > pDevContext->UsbDevice, > > > >> > > > request,//WDF_NO_HANDLE, // Optional WDFREQUEST > > > >> > > > &syncReqOptions, // PWDF_REQUEST_SEND_OPTIONS > > > >> > > > &controlSetupPacket, > > > >> > > > &outMemDesc, // MemoryDescriptor > > > >> > > > &nbBytes); // BytesTransferred > > > >> > > > WDF_REQUEST_COMPLETION_PARAMS_INIT(&completionParams); > > > >> > > > WdfRequestGetCompletionParams( > > > >> > > > request, > > > >> > > > &completionParams); > > > > >> > > > usbCompletionParams = completionParams.Parameters.Usb.Completion; > > > >> > > > if (usbCompletionParams != NULL) > > > >> > > > { > > > >> > > > KdPrint((DRIVERNAME " - nbBytes read = %d, usbCompletionParams- > > > >> > > > >Parameters.DeviceControlTransfer.Length = %d\n", > > > >> > > > nbBytes, usbCompletionParams- > > > >> > > > >Parameters.DeviceControlTransfer.Length)); > > > >> > > > nbBytes = usbCompletionParams- > > > >> > > > >Parameters.DeviceControlTransfer.Length; > > > >> > > > } > > > >> > > > else > > > >> > > > KdPrint((DRIVERNAME " - WdfRequestGetCompletionParams > > > >> > > > failed\n")); > > > > >> > > > In looking traces made by my driver I found this message: > > > >> > > > "KMDF detected potentially invalid operation by mydriver.sys.. Turn > > > >> > > > on > > > >> > > > framework verifier to > > ... > > plus de détails »
From: Doron Holan [MSFT] on 11 Nov 2008 17:42 yes -- Please do not send e-mail directly to this alias. this alias is for newsgroup purposes only. This posting is provided "AS IS" with no warranties, and confers no rights. "valouflo" <foulieres(a)yahoo.fr> wrote in message news:9de024ad-a474-45b0-9010-77f90ed3f62f(a)p10g2000prf.googlegroups.com... I followed your advise. I changed the way I got USBD_STATUS in completion parameters. I'm using WdfUsbTargetDeviceFormatRequestForControlTransfer() WdfRequestSetCompletionRoutine(..,YourCompletionRoutine,..) WdfRequestSend() with WDF_REQUEST_SEND_OPTION_SYNCHRONOUS This is working fine with kmdf 1.5 and also kmdf 1.7. Is that meaning that completion parameters are not available after calling WdfUsbTargetDeviceSendControlTransferSynchronously? On 1 nov, 00:22, Vishal Manan [MSFT] <VishalMananM...(a)discussions.microsoft.com> wrote: > This worked by chance on v1.5 and is not a regression. We fixed a bug in > the > v1.5 code releated to this which could have potentially caused a crash. > > ------ > Please do not send e-mail directly to this alias. This alias is for > newsgroup purposes only. > The posting is provided "AS IS" with no warranties, and confers no rights. > > "valouflo" wrote: > > Thanks for your help. > > > There is something that I don't understand. > > Why it is working with kmdf 1.5 and not with kmdf 1.7? > > > On 29 oct, 22:22, "Doron Holan [MSFT]" <dor...(a)online.microsoft.com> > > wrote: > > > the completion params are still valid in the request in the > > > format+send > > > pattern after the send returns. they will remain valid until the > > > request is > > > either deleted or reformatted > > > > d > > > > -- > > > Please do not send e-mail directly to this alias. this alias is for > > > newsgroup purposes only. > > > This posting is provided "AS IS" with no warranties, and confers no > > > rights. > > > > "Vishal Manan [MSFT]" <VishalMananM...(a)discussions.microsoft.com> > > > wrote in > > > messagenews:2AF5CDEE-AE05-44DC-8067-CF1797F8F0C2(a)microsoft.com... > > > > > If you need to check the completion params (usbd status etc) use the > > > > format + > > > > end pattern instead of calling > > > > WdfUsbTargetDeviceSendControlTransferSynchronously . > > > > > The following is the pseudo code with the pattern: > > > > > WdfUsbTargetDeviceFormatRequestForControlTransfer() > > > > WdfRequestSetCompletionRoutine(..,YourCompletionRoutine,..) > > > > Call WdfRequestSend() with WDF_REQUEST_SEND_OPTION_SYNCHRONOUS > > > > > The completion params will be passed into your > > > > "YourCompletionRoutine" . > > > > Let us know if you have any questions releated to the above. > > > > > Vishal > > > > > ------ > > > > Please do not send e-mail directly to this alias. This alias is for > > > > newsgroup purposes only. > > > > The posting is provided "AS IS" with no warranties, and confers no > > > > rights. > > > > > "valouflo" wrote: > > > > >> Finally, I got WDF symbols, but I don't see what is wrong in logs. > > > >> Here is my debug: > > > > >> ******************************************************************* > > > >> *************** breakpoint in WINDBG ************************ > > > >> ******************************************************************* > > > >> VOID > > > >> FORCEINLINE > > > >> WdfRequestGetCompletionParams( > > > >> __in > > > >> WDFREQUEST Request, > > > >> __out > > > >> PWDF_REQUEST_COMPLETION_PARAMS Params > > > >> ) > > > >> { > > > >> ((PFN_WDFREQUESTGETCOMPLETIONPARAMS) > > > >> WdfFunctions[WdfRequestGetCompletionParamsTableIndex]) > > > >> (WdfDriverGlobals, Request, Params); > > > >> } > > > >> ******************************************************************* > > > >> *************** Parameters ************************************* > > > >> ******************************************************************** > > > >> Params > > > >> ------------- > > > >> Size = 0x28 > > > >> Type = WdfRequestTypeNoFormat(255) > > > >> IOStatus > > > >> Status = 0 > > > >> Pointer = 0x00000000 > > > > >> Request > > > >> ------------- > > > >> DBGENG: 'c:\winddk\6001\inc\wdf\kmdf\1.7\wdfrequest.h' - found > > > >> kd> !wdfrequest 0x7a262390 > > > >> !IRP 0x85dad008 > > > >> State: Allocated by driver, IRP allocated by WDF > > > >> !WDFIOTARGET 0x7a062b78 > > > > >> kd> !irp 0x85dad008 > > > >> Irp is active with 5 stacks 6 is current (= 0x85dad12c) > > > >> No Mdl: No System Buffer: Thread 00000000: Irp is completed. > > > >> cmd flg cl Device File Completion-Context > > > >> [ 0, 0] 0 0 00000000 00000000 00000000-00000000 > > > > >> Args: 00000000 00000000 00000000 00000000 > > > >> [ 0, 0] 0 0 00000000 00000000 00000000-00000000 > > > > >> Args: 00000000 00000000 00000000 00000000 > > > >> [ 0, 0] 0 0 00000000 00000000 00000000-00000000 > > > > >> Args: 00000000 00000000 00000000 00000000 > > > >> [ f, 0] 0 0 85e3e030 00000000 00000000-00000000 > > > >> \Driver\usbehci > > > >> Args: 00000000 00000000 00000000 00000000 > > > >> [ f, 0] 0 0 85af7ba0 00000000 808183e6-85d98b30 > > > >> \Driver\usbccgp nt!IopUnloadSafeCompletion > > > >> Args: 00000000 00000000 00000000 00000000 > > > >> kd> !WDFIOTARGET 0x7a062b78 > > > > >> WDFIOTARGET 7a062b78 > > > >> ========================= > > > >> WDFDEVICE: 0x7a53ea58 > > > >> Target Device: !devobj 0x85af7ba0 > > > >> Target PDO: !devobj 0x85af7ba0 > > > > >> Type: Instack target > > > >> State: WdfIoTargetStarted > > > > >> Requests pending: 0 > > > > >> Requests sent: 0 > > > > >> Requests sent with ignore-target-state: 0 > > > > >> ********************************************************************************** > > > >> ******************* Messages in WINDBG > > > >> *********************************** > > > >> ********************************************************************************** > > > >> kd> p > > > >> ocsIccd!WdfRequestGetCompletionParams+0x5: > > > >> f3f60245 8b450c mov eax,dword ptr [ebp+0Ch] > > > >> kd> p > > > >> KMDF detected potentially invalid operation by ocsIccd.sys. Turn on > > > >> framework verifier to break into the debugger. > > > >> ocsIccd!WdfRequestGetCompletionParams+0x1a: > > > >> f3f6025a 5d pop ebp > > > > >> ********************************************************************************* > > > >> ******************* WDF log Dump > > > >> ******************************************* > > > >> ********************************************************************************** > > > >> 220: FxRequest::_Create - Irp 00000000 Ownership FxRequestOwnsIrp > > > >> FxRequest 85D9DC68, status STATUS_SUCCESS > > > >> 221: imp_WdfRequestCreate - Created WDFREQUEST 7A262390, status > > > >> STATUS_SUCCESS > > > >> 222: imp_WdfUsbTargetDeviceSendControlTransferSynchronously - > > > >> WDFUSBDEVICE 7A062B78 control transfer sync > > > >> 223: imp_WdfUsbTargetDeviceSendControlTransferSynchronously - > > > >> WDFUSBDEVICE 7A062B78, WDFREQUEST 7A262390 being submitted > > > >> 224: FxIoTarget::SubmitSync - WDFIOTARGET 7A062B78, WDFREQUEST > > > >> 7A262390 > > > >> 225: FxIoTarget::SubmitSync - action 0x11 > > > >> 226: FxIoTarget::SubmitSync - Sending WDFREQUEST 7A262390, Irp > > > >> 85DAD008 > > > >> 227: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7A262390 > > > >> 228: FxIoTarget::RemoveCompletedRequestLocked - WDFIOTARGET > > > >> 7A062B78, > > > >> WDFREQUEST 7A262390 > > > >> 229: FxIoTarget::RequestCompletionRoutine - WDFREQUEST 7A262390 > > > >> completed in completion routine > > > >> 230: imp_WdfUsbTargetDeviceSendControlTransferSynchronously - > > > >> WDFUSBDEVICE 7A062B78, STATUS_SUCCESS > > > >> 231: FxSyncRequest::SelfDestruct - SyncRequest BA0BD6A0, signaling > > > >> event BA0BD718 on SelfDestruct > > > >> 232: imp_WdfRequestGetCompletionParams - Enter: WDFREQUEST > > > >> 7A262390, > > > >> Params BA0BD888 > > > > >> I hope you could give me some ideas > > > > >> On 27 oct, 14:19, valouflo <foulie...(a)yahoo.fr> wrote: > > > >> > Thanks for your help. > > > >> > But I have a problem, it seems that I don't have correct symbols > > > >> > for > > > >> > WDF. Actually, I don't have any symbols for WDF. > > > >> > Is there an other way than sym server to get WDF symbols? > > > >> > (PC that I'm using can't be connected to internet.) > > > > >> > On 25 oct, 00:35, Vishal Manan [MSFT] <Vishal Manan > > > > >> > [MSFT]@discussions.microsoft.com> wrote: > > > >> > > The trace message in the framework log should tell you what is > > > >> > > going > > > >> > > on.. This > > > >> > > link shows you how to dump the trace > > > >> > > log:http://www.microsoft.com/whdc/Driver/tips/KMDF_IfrLog.mspx > > > >> > > Could you try dumping the log and if it doesn't help you, copy > > > >> > > and > > > >> > > paste it > > > >> > > in your message? > > > > >> > > Thanks, > > > >> > > Vishal > > > > >> > > ------ > > > >> > > Please do not send e-mail directly to this alias. This alias is > > > >> > > for > > > >> > > newsgroup purposes only. > > > >> > > The posting is provided "AS IS" with no warranties, and confers > > > >> > > no > > > >> > > rights. > > > > >> > > "valouflo" wrote: > > > >> > > > Hi, > > > >> > > > I developped a usb driver based on WDF, first with kmdf 1.5. > > > >> > > > I used synchronous request to send control transfer to the > > > >> > > > device. > > > >> > > > As > > > >> > > > I needed to get the USBDSTATUS (in fact I checked if there > > > >> > > > was no > > > >> > > > STALL), I used WdfRequestGetCompletionParams function. > > > > >> > > > All is working fine with kmdf 1.5 but I had a problem when I > > > >> > > > wanted > > > >> > > > to > > > >> > > > use the version 1.7. > > > >> > > > Here is the code > > > > >> > > > nbBytes = 0; > > > >> > > > status = WdfUsbTargetDeviceSendControlTransferSynchronously( > > > >> > > > pDevContext->UsbDevice, > > > >> > > > request,//WDF_NO_HANDLE, // Optional WDFREQUEST > > > >> > > > &syncReqOptions, // PWDF_REQUEST_SEND_OPTIONS > > > >> > > > &controlSetupPacket, > > > >> > > > &outMemDesc, // MemoryDescriptor > > > >> > > > &nbBytes); // BytesTransferred > > > >> > > > WDF_REQUEST_COMPLETION_PARAMS_INIT(&completionParams); > > > >> > > > WdfRequestGetCompletionParams( > > > >> > > > request, > > > >> > > > &completionParams); > > > > >> > > > usbCompletionParams = > > > >> > > > completionParams.Parameters.Usb.Completion; > > > >> > > > if (usbCompletionParams != NULL) > > > >> > > > { > > > >> > > > KdPrint((DRIVERNAME " - nbBytes read = %d, > > > >> > > > usbCompletionParams- > > > >> > > > >Parameters.DeviceControlTransfer.Length = %d\n", > > > >> > > > nbBytes, usbCompletionParams- > > > >> > > > >Parameters.DeviceControlTransfer.Length)); > > > >> > > > nbBytes = usbCompletionParams- > > > >> > > > >Parameters.DeviceControlTransfer.Length; > > > >> > > > } > > > >> > > > else > > > >> > > > KdPrint((DRIVERNAME " - WdfRequestGetCompletionParams > > > >> > > > failed\n")); > > > > >> > > > In looking traces made by my driver I found this message: > > > >> > > > "KMDF detected potentially invalid operation by mydriver.sys. > > > >> > > > Turn > > > >> > > > on > > > >> > > > framework verifier to > > ... > > plus de d�tails �
|
Pages: 1 Prev: SoftIce and WDK symbols Next: Blue screen with UMDF driver |