VHF_CONFIG structure

Contains initial configuration information that is provided by the HID source driver when it calls VhfCreate to create a virtual HID device.

Syntax

typedef struct _VHF_CONFIG {
  ULONG                               Size;
  PVOID                               VhfClientContext;
  ULONG                               OperationContextSize;
  PDEVICE_OBJECT                      DeviceObject;
  PVOID                               Reserved;
  USHORT                              VendorID;
  USHORT                              ProductID;
  USHORT                              VersionNumber;
  GUID                                ContainerID;
  USHORT                              InstanceIDLength;
  PWSTR                               InstanceID;
  USHORT                              ReportDescriptorLength;
  PUCHAR                              ReportDescriptor;
  PEVT_VHF_READY_FOR_NEXT_READ_REPORT EvtVhfReadyForNextReadReport;
  PEVT_VHF_ASYNC_OPERATION            EvtVhfAsyncOperationGetFeature;
  PEVT_VHF_ASYNC_OPERATION            EvtVhfAsyncOperationSetFeature;
  PEVT_VHF_ASYNC_OPERATION            EvtVhfAsyncOperationWriteReport;
  PEVT_VHF_ASYNC_OPERATION            EvtVhfAsyncOperationGetInputReport;
  PEVT_VHF_CLEANUP                    EvtVhfCleanup;
  USHORT                              HardwareIDsLength;
  PWSTR                               HardwareIDs;
} VHF_CONFIG, *PVHF_CONFIG;

Members

        `Size`

        Required. Size of this structure initialized by <a href="https://docs.microsoft.com/windows-hardware/drivers/ddi/vhf/nf-vhf-vhf_config_init">VHF_CONFIG_INIT</a>.
    
    
        `VhfClientContext`

        Optional. An opaque pointer to HID source driver-allocated memory that the Virtual HID Framework (VHF) passes when it invokes  those callback functions.
    
    
        `OperationContextSize`

        Optional. Size of the buffer that VHF must allocate for an asynchronous operation started by <a href="https://docs.microsoft.com/windows-hardware/drivers/ddi/vhf/nc-vhf-evt_vhf_async_operation">EvtVhfAsyncOperation</a>. If non-zero, VHF allocates a buffer of this size and passes a pointer to that buffer in the <i>VhfOperationContext</i> parameter each time it invokes <i>EvtVhfAsyncOperation</i> to start a new operation.
    
    
        `DeviceObject`

        Required. A pointer to the <a href="https://docs.microsoft.com/windows-hardware/drivers/ddi/wdm/ns-wdm-_device_object">DEVICE_OBJECT</a> structure for the HID source driver. Get that pointer by calling  <a href="https://docs.microsoft.com/windows-hardware/drivers/ddi/wdfdevice/nf-wdfdevice-wdfdevicewdmgetdeviceobject">WdfDeviceWdmGetDeviceObject</a> and passing the WDFDEVICE handle that the driver received in the <a href="https://docs.microsoft.com/windows-hardware/drivers/ddi/wdfdevice/nf-wdfdevice-wdfdevicecreate">WdfDeviceCreate</a> call.
    
    
        `Reserved`

        
    
    
        `VendorID`

        Optional. Vendor ID of the virtual HID device to be created.
    
    
        `ProductID`

        Optional. Product ID of the virtual HID device to be created.
    
    
        `VersionNumber`

        Optional. Version number of the virtual HID device to be created.
    
    
        `ContainerID`

        Optional. Container ID of the virtual HID device to be created.
    
    
        `InstanceIDLength`

        
    
    
        `InstanceID`

        
    
    
        `ReportDescriptorLength`

        Required. The length of the HID Report Descriptor contained in a buffer pointed by <b>ReportDescriptor</b>.
    
    
        `ReportDescriptor`

        Required. A pointer to a HID source driver-allocated buffer that contains the  HID Report Descriptor.
    
    
        `EvtVhfReadyForNextReadReport`

        Optional. A pointer to an <a href="https://docs.microsoft.com/windows-hardware/drivers/ddi/vhf/nc-vhf-evt_vhf_ready_for_next_read_report">EvtVhfReadyForNextReadReport</a> callback. The HID source driver must implement and register this callback function if it wants to handle the buffering policy for submitting HID Input Reports. If this callback is specified, VHF does not buffer those reports. The HID source driver should submit one report by calling <a href="https://docs.microsoft.com/windows-hardware/drivers/ddi/vhf/nf-vhf-vhfreadreportsubmit">VhfReadReportSubmit</a>, each time VHF invokes   <i>EvtVhfReadyForNextReadReport</i>.
    
    
        `EvtVhfAsyncOperationGetFeature`

        Optional. A pointer to an <a href="https://docs.microsoft.com/windows-hardware/drivers/ddi/vhf/nc-vhf-evt_vhf_async_operation">EvtVhfAsyncOperation</a> callback. The HID source driver must implement and register this callback function if it wants to a get a HID Feature Report associated with a <a href="https://docs.microsoft.com/windows-hardware/drivers/hid/top-level-collections">Top-Level Collection</a> from the HID class driver pair.

The driver can get a Feature Report only if the Report Descriptor declares it.

        `EvtVhfAsyncOperationSetFeature`

        Optional. A pointer to an <a href="https://docs.microsoft.com/windows-hardware/drivers/ddi/vhf/nc-vhf-evt_vhf_async_operation">EvtVhfAsyncOperation</a> callback. The HID source driver must implement and register this callback function if it wants to a send  a HID Feature Report associated with a <a href="https://docs.microsoft.com/windows-hardware/drivers/hid/top-level-collections">Top-Level Collection</a> to the HID class driver pair. The driver can set a Feature Report only if the Report Descriptor declares it.
    
    
        `EvtVhfAsyncOperationWriteReport`

        Optional. A pointer to an <a href="https://docs.microsoft.com/windows-hardware/drivers/ddi/vhf/nc-vhf-evt_vhf_async_operation">EvtVhfAsyncOperation</a> callback. The HID source driver must implement and register this callback function if it wants to a support HID Output Reports and send  them to the  HID class driver pair.
    
    
        `EvtVhfAsyncOperationGetInputReport`

        Optional. A pointer to an <a href="https://docs.microsoft.com/windows-hardware/drivers/ddi/vhf/nc-vhf-evt_vhf_async_operation">EvtVhfAsyncOperation</a> callback. The HID source driver must implement and register this callback function if it wants to support on-demand query for Input Reports.
    
    
        `EvtVhfCleanup`

        Optional. A pointer to a <a href="https://docs.microsoft.com/windows-hardware/drivers/ddi/vhf/nc-vhf-evt_vhf_cleanup">EvtVhfCleanup</a> callback. The HID source driver can implement and register this callback function if it wants to free the allocated resources for the virtual HID device.
    
    
        `HardwareIDsLength`

        
    
    
        `HardwareIDs`

        
    

Requirements

   
Minimum supported client Windows 10
Minimum supported server None supported
Header vhf.h
## See Also

    <a href="https://docs.microsoft.com/windows-hardware/drivers/hid/virtual-hid-framework--vhf-">Write a HID source driver by using Virtual HID Framework (VHF)</a>