IRemoteTargetCallbackRemoval::OnRemoteTargetQueryRemove method

[Applies to UMDF 1.x only]

A UMDF-based driver's OnRemoteTargetQueryRemove event callback function determines whether a remote I/O target's device can be stopped and removed.

Syntax


BOOL OnRemoteTargetQueryRemove(
  [in]  IWDFRemoteTarget *pWdfRemoteTarget
);

Parameters

pWdfRemoteTarget [in]

A pointer to the IWDFRemoteTarget interface of a remote target object that represents a remote I/O target. The driver obtains this pointer when it calls IWDFDevice2::CreateRemoteTarget.

Return value

If the driver determines that the device can be stopped and removed, the OnRemoteTargetQueryRemove event callback function must return TRUE. Otherwise, the callback function must return FALSE.

Remarks

If your driver provides an OnRemoteTargetQueryRemove event callback function, the callback function should determine if the operating system should allow removal of the device. If the driver determines that the device can be removed, it should do the following:

  1. Do any driver-specific actions needed to stop I/O to the remote target.

  2. Call IWDFRemoteTarget::CloseForQueryRemove.

  3. Return TRUE to indicate that the removal can occur.

If the driver determines that the device should not be removed, the callback function must return FALSE. Typically, drivers should avoid returning FALSE, because a FALSE return value can cause Windows to restart.

If the driver does not provide this callback function, the framework calls IWDFRemoteTarget::CloseForQueryRemove for the driver. In other words, the framework always allows the device to be removed unless the driver provides an OnRemoteTargetQueryRemove event callback function.

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

Requirements

End of support

Unavailable in UMDF 2.0 and later.

Minimum UMDF version

1.9

Header

Wudfddi.h (include Wudfddi.h)

See also

IRemoteTargetCallbackRemoval
IRemoteTargetCallbackRemoval::OnRemoteTargetRemoveCanceled
IRemoteTargetCallbackRemoval::OnRemoteTargetRemoveComplete

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft