WriteReqs rule (kmdf)

The WriteReqs rule specifies that a write request is not passed to inappropriate KMDF methods.

All requests presented to the driver in the EvtIoWrite event callback function callback are guaranteed to be write requests. These requests cannot be sent by using KMDF methods that are specifically designed to send read or IOCTL requests.

The write requests cannot be sent to the following methods

WdfUsbTargetPipeReadSynchronously

WdfIoTargetSendIoctlSynchronously,

WdfIoTargetSendInternalIoctlSynchronously,

WdfIoTargetSendInternalIoctlOthersSynchronously,

WdfIoTargetSendReadSynchronously.

Driver model: KMDF

How to test

At compile time

Run Static Driver Verifier and specify the WriteReqs rule.

Use the following steps to run an analysis of your code:
  1. Prepare your code (use role type declarations).
  2. Run Static Driver Verifier.
  3. View and analyze the results.

For more information, see Using Static Driver Verifier to Find Defects in Drivers.

Applies to

WdfIoTargetSendInternalIoctlOthersSynchronously WdfIoTargetSendInternalIoctlSynchronously WdfIoTargetSendIoctlSynchronously WdfIoTargetSendReadSynchronously WdfUsbTargetPipeReadSynchronously