Expand Minimize

WdfRequestIsCanceled method

[Applies to KMDF and UMDF]

The WdfRequestIsCanceled method determines whether the I/O manager has attempted to cancel a specified I/O request.

Syntax


BOOLEAN WdfRequestIsCanceled(
  [in]  WDFREQUEST Request
);

Parameters

Request [in]

A handle to a framework request object.

Return value

WdfRequestIsCanceled returns TRUE if the I/O manager has attempted to cancel the specified I/O request. This method may return TRUE even if the calling driver does not own the request. If the driver does not own the request, it should not call WdfRequestIsCanceled. See additional information in Remarks.

WdfRequestIsCanceled returns FALSE for one of the following reasons:

A bug check occurs if the driver supplies an invalid object handle.

Remarks

If your driver has not called WdfRequestMarkCancelable or WdfRequestMarkCancelableEx to register an EvtRequestCancel callback function, but if you want your driver to determine if the I/O manager has attempted to cancel an I/O request, the driver can call WdfRequestIsCanceled.

If the driver has called WdfRequestMarkCancelable or WdfRequestMarkCancelableEx, it must call WdfRequestUnmarkCancelable before calling WdfRequestIsCanceled.

A driver can call WdfRequestIsCanceled for a request only if the driver owns the I/O request.

If WdfRequestIsCanceled returns TRUE, your driver should cancel the request by calling WdfRequestComplete with a Status parameter of STATUS_CANCELLED. If the driver attempts to complete a request that it does not own, the driver can cause the system to crash.

For more information about WdfRequestIsCanceled, see Canceling I/O Requests

Examples

The following code example calls WdfRequestComplete if WdfRequestIsCanceled returns TRUE.


if (WdfRequestIsCanceled(request)) {
    WdfRequestComplete(
                       request,
                       STATUS_CANCELLED
                       );
}

Requirements

Minimum KMDF version

1.0

Minimum UMDF version

2.0

Header

Wdfrequest.h (include Wdf.h)

Library

Wdf01000.sys (KMDF);
WUDFx02000.dll (UMDF)

IRQL

<=DISPATCH_LEVEL

DDI compliance rules

DriverCreate, KmdfIrql, KmdfIrql2, ReqIsCancOnCancReq

See also

WdfRequestComplete
WdfRequestMarkCancelable
WdfRequestMarkCancelableEx
WdfRequestUnmarkCancelable
EvtRequestCancel

 

 

Send comments about this topic to Microsoft

顯示:
© 2014 Microsoft