EvtIoTargetRemoveCanceled function

[Applies to KMDF and UMDF]

A driver's EvtIoTargetRemoveCanceled event callback function performs operations when the removal of a specified remote I/O target is canceled.

Syntax


EVT_WDF_IO_TARGET_REMOVE_CANCELED EvtIoTargetRemoveCanceled;

VOID EvtIoTargetRemoveCanceled(
  _In_  WDFIOTARGET IoTarget
)
{ ... }

Parameters

IoTarget [in]

A handle to an I/O target object.

Return value

None

Remarks

To register an EvtIoTargetRemoveCanceled callback function, place the callback function's address in the I/O target's WDF_IO_TARGET_OPEN_PARAMS structure.

If the driver's EvtIoTargetQueryRemove callback function called WdfIoTargetCloseForQueryRemove, the driver's EvtIoTargetRemoveCanceled callback function must call WdfIoTargetOpen to re-enable sending I/O requests to the I/O target. When the driver calls WdfIoTargetOpen, it can specify WdfIoTargetOpenReopen for the Type member of the WDF_IO_TARGET_OPEN_PARAMS structure.

The optional EvtIoTargetRemoveCanceled callback function should perform any additional operations that might be necessary before the driver resumes sending I/O requests to the I/O target.

For more information about the EvtIoTargetRemoveCanceled callback function, see Controlling a General I/O Target's State.

Examples

To define an EvtIoTargetRemoveCanceled callback function, you must first provide a function declaration that identifies the type of callback function you’re defining. Windows provides a set of callback function types for drivers. Declaring a function using the callback function types helps Code Analysis for Drivers, Static Driver Verifier (SDV), and other verification tools find errors, and it’s a requirement for writing drivers for the Windows operating system.

For example, to define an EvtIoTargetRemoveCanceled callback function that is named MyIoTargetRemoveCanceled, use the EVT_WDF_IO_TARGET_REMOVE_CANCELED type as shown in this code example:


EVT_WDF_IO_TARGET_REMOVE_CANCELED  MyIoTargetRemoveCanceled;

Then, implement your callback function as follows:


_Use_decl_annotations_
VOID
 MyIoTargetRemoveCanceled (
    WDFIOTARGET  IoTarget
    )
  {...}

The EVT_WDF_IO_TARGET_REMOVE_CANCELED function type is defined in the WdfIoTarget.h header file. To more accurately identify errors when you run the code analysis tools, be sure to add the _Use_decl_annotations_ annotation to your function definition. The _Use_decl_annotations_ annotation ensures that the annotations that are applied to the EVT_WDF_IO_TARGET_REMOVE_CANCELED function type in the header file are used. For more information about the requirements for function declarations, see Declaring Functions by Using Function Role Types for KMDF Drivers. For information about _Use_decl_annotations_, see Annotating Function Behavior.

Requirements

Minimum KMDF version

1.0

Minimum UMDF version

2.0

Header

WdfIoTarget.h (include Wdf.h)

IRQL

PASSIVE_LEVEL

See also

EvtIoTargetRemoveComplete
EvtIoTargetQueryRemove
WDF_IO_TARGET_OPEN_PARAMS
WdfIoTargetCloseForQueryRemove
WdfIoTargetOpen

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft. All rights reserved.