VhfCreate function (vhf.h)

The HID source driver calls this method to create a virtual HID device.

Syntax

NTSTATUS VhfCreate(
  [in]  PVHF_CONFIG VhfConfig,
  [out] VHFHANDLE   *VhfHandle
);

Parameters

[in] VhfConfig

A pointer to a VHF_CONFIG structure.

[out] VhfHandle

A handle to the new virtual HID device.

Return value

If the VhfCreate call succeeds, the method returns STATUS_SUCCESS. Otherwise an appropriate NTSTATUS value.

Remarks

This method returns synchronously after validating the VHF_CONFIG structure and creating a virtual HID device. The virtual HID device is only reported to PnP. The initialization, installation, and starting of the device may not complete before this method returns.

A Kernel-Mode Driver Framework (KMDF) driver can call VhfCreate at any point after successfully creating its own device object by calling WdfDeviceCreate. The driver can do so in its EvtDriverDeviceAdd, EvtDevicePrepareHardware, EvtDeviceD0Entry, EvtDeviceSelfManagedIoInit.

VHF does not invoke any callback functions that are specified in VHF_CONFIG until the HID source driver calls VhfStart.

Requirements

Requirement Value
Target Platform Windows
Header vhf.h
Library VhfKm.lib
IRQL PASSIVE_LEVEL

See also

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