EVT_VHF_CLEANUP callback function

The HID source driver implements this event callback to free resources that might the driver allocated to the virtual HID device.



void EvtVhfCleanup(
  PVOID VhfClientContext



Pointer to the HID source driver-defined context structure that the driver passed in the previous call to VhfCreate to create the virtual HID device.

Return value



To delete the virtual HID device, the HID source driver calls VhfDelete. That call causes Virtual HID Framework (VHF) to invoke the previously-registered EvtVhfCleanup, if the callback function is implemented by the HID source driver. When the driver calls VhfDelete with Wait set to TRUE, EvtVhfCleanup gets called before VhfDelete returns. If Wait is FALSE, it might get called any time after VhfDelete is called that is before or after VhfDelete returns.

The call gives the HID source driver an opportunity to free resources allocated for the virtual HID device when that device is deleted.

The HID source driver must not use the VHFHANDLE for the virtual HID device (created by VhfCreate) after this callback function returns. Before invoking this callback function, VHF makes sure that there are no asynchronous operations pending.


Minimum supported client Windows 10
Minimum supported server None supported
Target Platform Desktop
Header vhf.h

See also

Write a HID source driver by using Virtual HID Framework (VHF)