VhfDelete function (vhf.h)
The HID Source device driver calls this method to delete a VHF device.
void VhfDelete( VHFHANDLE VhfHandle, BOOLEAN Wait );
[in] A handle to a virtual HID device that your HID source driver received in the previous call to VhfCreate.
[in] TRUE to return synchronously after deleting a device. In this case, Virtual HID Framework (VHF) does not return until the device is reported as missing to PnP Manager and EvtVhfCleanup callback function returns.
FALSE to return asynchronously. See Remarks for more information.
The HID source driver must stop initiating new requests for the Virtual HID Framework (VHF) just before calling VhfDelete. VhfDelete can be called synchronously or asynchronously.
To call VhfDelete synchronously, call it at PASSIVE_LEVEL with the Wait parameter set to TRUE. In this case, it returns synchronously after completing the deletion. If the HID source driver has registered an EvtVhfCleanup callback function with VHF, it invokes that callback before VhfDelete returns. The function might be invoked on the same thread.
To call VhfDelete asynchronously, call it at maximum DISPATCH_LEVEL. If you call it at DISPATCH_LEVEL, then Wait parameter must be set to FALSE, the function returns immediately. VHF invokes the EvtVhfCleanup callback at a later time after the deletion has completed.
There are no restrictions on when a KMDF driver should call this function. It is recommended to call it from a function matching the VhfCreate call. For example, if VhfCreate is called from EvtDriverDeviceAdd, then call VhfDelete synchronously from EvtDeviceCleanupCallback.
|IRQL||If Wait is TRUE, PASSIVE_LEVEL; if Wait is FALSE <= DISPATCH_LEVEL|