WdfRequestSend

Hi,
Online MSDN says that WdfRequestSend with WDF_REQUEST_SEND_OPTION_SYNCHRONOUS can only be sent in Passive level. But the help which comes with WDK 7600 says WdfRequestSend can be sent at <= Dispatch irrespective of flags used.

Which one is true in this.

Similarly, in help of WDK KeWaitForSingleObject can return STATUS_ABANDONED_WAIT_0
but online help doesnot mention this in possible return codes.

Msdn wins when the synch flag is set

d

Bent from my phone


From: xxxxx@gmail.commailto:xxxxx
Sent: ?8/?31/?2014 9:41 PM
To: Windows System Software Devs Interest Listmailto:xxxxx
Subject: [ntdev] WdfRequestSend

Hi,
Online MSDN says that WdfRequestSend with WDF_REQUEST_SEND_OPTION_SYNCHRONOUS can only be sent in Passive level. But the help which comes with WDK 7600 says WdfRequestSend can be sent at <= Dispatch irrespective of flags used.

Which one is true in this.

Similarly, in help of WDK KeWaitForSingleObject can return STATUS_ABANDONED_WAIT_0
but online help doesnot mention this in possible return codes.


NTDEV is sponsored by OSR

Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev

OSR is HIRING!! See http://www.osr.com/careers

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer</mailto:xxxxx></mailto:xxxxx>

Hi Doron,

if I use ‘WdfUsbTargetDeviceSendControlTransferSynchronously’ API Verifier reports IRQL issue because i am in DISPATCH_LEVEL and this API is allowed in PASSIVE_LEVEL.

So to fix this i used ‘WdfUsbTargetDeviceFormatRequestForControlTransfer’ and to make the call synchronous i used flag ‘WDF_REQUEST_SEND_OPTION_SYNCHRONOUS’ with ‘WdfRequestSend’.

with these changes i can see that Verifier donot report any issue with new code changes. Since DDK help donot have remarks that WdfRequestSend if called for synchronous flag should be at PASSIVE_LEVEL.

can i assume that this implementation is ok though msdn says we cannot call the API at DISPATCH_LEVEL. because Verifier is passing?

Thanks
Ramana

No, you can’t use Send() with the synchronous flag at dispatch level. It is the same as SendSynchronously(). verifier doesn’t cover 100% of the behavioral rules, so the absence of a check does not mean it is ok to do something if the docs say it is not allowed

d

Bent from my phone


From: xxxxx@yahoo.commailto:xxxxx
Sent: ?9/?2/?2014 12:25 AM
To: Windows System Software Devs Interest Listmailto:xxxxx
Subject: RE:[ntdev] WdfRequestSend

Hi Doron,

if I use ‘WdfUsbTargetDeviceSendControlTransferSynchronously’ API Verifier reports IRQL issue because i am in DISPATCH_LEVEL and this API is allowed in PASSIVE_LEVEL.

So to fix this i used ‘WdfUsbTargetDeviceFormatRequestForControlTransfer’ and to make the call synchronous i used flag ‘WDF_REQUEST_SEND_OPTION_SYNCHRONOUS’ with ‘WdfRequestSend’.

with these changes i can see that Verifier donot report any issue with new code changes. Since DDK help donot have remarks that WdfRequestSend if called for synchronous flag should be at PASSIVE_LEVEL.

can i assume that this implementation is ok though msdn says we cannot call the API at DISPATCH_LEVEL. because Verifier is passing?

Thanks
Ramana


NTDEV is sponsored by OSR

Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev

OSR is HIRING!! See http://www.osr.com/careers

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer</mailto:xxxxx></mailto:xxxxx>

If the documentation says then maybe the corner cases are not getting generated. We should always
adhere to documentation.

-Rohan.

On Tue, Sep 2, 2014 at 7:28 PM, Doron Holan
wrote:

> No, you can’t use Send() with the synchronous flag at dispatch level.
> It is the same as SendSynchronously(). verifier doesn’t cover 100% of the
> behavioral rules, so the absence of a check does not mean it is ok to do
> something if the docs say it is not allowed
>
>
> d
>
> Bent from my phone
> ------------------------------
> From: xxxxx@yahoo.com
> Sent: ‎9/‎2/‎2014 12:25 AM
>
> To: Windows System Software Devs Interest List
> Subject: RE:[ntdev] WdfRequestSend
>
> Hi Doron,
>
> if I use ‘WdfUsbTargetDeviceSendControlTransferSynchronously’ API Verifier
> reports IRQL issue because i am in DISPATCH_LEVEL and this API is allowed
> in PASSIVE_LEVEL.
>
> So to fix this i used ‘WdfUsbTargetDeviceFormatRequestForControlTransfer’
> and to make the call synchronous i used flag
> ‘WDF_REQUEST_SEND_OPTION_SYNCHRONOUS’ with ‘WdfRequestSend’.
>
> with these changes i can see that Verifier donot report any issue with new
> code changes. Since DDK help donot have remarks that WdfRequestSend if
> called for synchronous flag should be at PASSIVE_LEVEL.
>
> can i assume that this implementation is ok though msdn says we cannot
> call the API at DISPATCH_LEVEL. because Verifier is passing?
>
>
> Thanks
> Ramana
>
> —
> NTDEV is sponsored by OSR
>
> Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev
>
> OSR is HIRING!! See http://www.osr.com/careers
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>
> —
> NTDEV is sponsored by OSR
>
> Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev
>
> OSR is HIRING!! See http://www.osr.com/careers
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>

The help which comes with WDK 7600 is wrong.

You can’t perform *any* synchronous send at IRQL DISPATCH_LEVEL or above.

Think about what this does: You do the send, and they you WAIT for an event to be signaled. You can’t WAIT at IRQL DISPATCH_LEVEL or above.

You have to think through what you’re doing and follow the Windows OS architecture. SDV is a great tool, but if it says everything is fine that does NOT mean everything is fine. Like any tool, it only knows about certain things… it can’t catch everything.

Peter
OSR
@OSRDrivers

I have added a WdfRequestSendSyncAtDispatch rule to SDV to catch this type of issue in KMDF drivers.

This will be available with the next release of the WDK.

Thanks
-Con.

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@osr.com
Sent: Tuesday, September 2, 2014 1:56 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] WdfRequestSend

The help which comes with WDK 7600 is wrong.

You can’t perform *any* synchronous send at IRQL DISPATCH_LEVEL or above.

Think about what this does: You do the send, and they you WAIT for an event to be signaled. You can’t WAIT at IRQL DISPATCH_LEVEL or above.

You have to think through what you’re doing and follow the Windows OS architecture. SDV is a great tool, but if it says everything is fine that does NOT mean everything is fine. Like any tool, it only knows about certain things… it can’t catch everything.

Peter
OSR
@OSRDrivers


NTDEV is sponsored by OSR

Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev

OSR is HIRING!! See http://www.osr.com/careers

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

Thanks Con… That’s good to know.

It’s a common bug,

Peter
OSR
@OSRDrivers