// vhf.h
typedef struct _VHF_CONFIG {
ULONG Size;
PVOID VhfClientContext;
ULONG OperationContextSize;
#ifdef _KERNEL_MODE
PDEVICE_OBJECT DeviceObject;
#else
HANDLE FileHandle;
#endif
USHORT VendorID;
USHORT ProductID;
USHORT VersionNumber;
GUID ContainerID;
USHORT InstanceIDLength;
_Field_size_bytes_full_(InstanceIDLength)
PWSTR InstanceID;
USHORT ReportDescriptorLength;
_Field_size_full_(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;
_Field_size_bytes_full_(HardwareIDsLength)
PWSTR HardwareIDs;
} VHF_CONFIG, *PVHF_CONFIG;
View the official Windows Driver Kit DDI referenceNo description available.
Contains initial configuration information that is provided by the HID source driver when it calls VhfCreate to create a virtual HID device.
typedef struct _VHF_CONFIG {
ULONG Size;
PVOID VhfClientContext;
ULONG OperationContextSize;
#ifdef _KERNEL_MODE
PDEVICE_OBJECT DeviceObject;
#else
HANDLE FileHandle;
#endif
USHORT VendorID;
USHORT ProductID;
USHORT VersionNumber;
GUID ContainerID;
USHORT InstanceIDLength;
_Field_size_bytes_full_(InstanceIDLength)
PWSTR InstanceID;
USHORT ReportDescriptorLength;
_Field_size_full_(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;
_Field_size_bytes_full_(HardwareIDsLength)
PWSTR HardwareIDs;
} VHF_CONFIG, *PVHF_CONFIG;
SizeRequired. Size of this structure initialized by VHF_CONFIG_INIT.
VhfClientContextOptional. An opaque pointer to HID source driver-allocated memory that the Virtual HID Framework (VHF) passes when it invokes those callback functions.
OperationContextSizeOptional. Size of the buffer that VHF must allocate for an asynchronous operation started by EvtVhfAsyncOperation. If non-zero, VHF allocates a buffer of this size and passes a pointer to that buffer in the VhfOperationContext parameter each time it invokes EvtVhfAsyncOperation to start a new operation.
DeviceObjectRequired for kernel-mode drivers. A pointer to the DEVICE_OBJECT structure for the HID source driver. Get that pointer by calling WdfDeviceWdmGetDeviceObject and passing the WDFDEVICE handle that the driver received in the WdfDeviceCreate call.
FileHandleRequired for user-mode drivers. A file handle obtained by calling WdfIoTargetWdmGetTargetFileHandle. To open a WDFIOTARGET, a user-mode (UMDF) VHF source driver should call WdfIoTargetOpen with OpenParams.Type set to WdfIoTargetOpenLocalTargetByFile.
VendorIDOptional. Vendor ID of the virtual HID device to be created.
ProductIDOptional. Product ID of the virtual HID device to be created.
VersionNumberOptional. Version number of the virtual HID device to be created.
ContainerIDOptional. Container ID of the virtual HID device to be created.
InstanceIDLengthInstanceIDReportDescriptorLengthRequired. The length of the HID Report Descriptor contained in a buffer pointed by ReportDescriptor.
ReportDescriptorRequired. A pointer to a HID source driver-allocated buffer that contains the HID Report Descriptor.
EvtVhfReadyForNextReadReportOptional. A pointer to an EvtVhfReadyForNextReadReport 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 VhfReadReportSubmit, each time VHF invokes EvtVhfReadyForNextReadReport.
EvtVhfAsyncOperationGetFeatureOptional. A pointer to an EvtVhfAsyncOperation 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 Top-Level Collection from the HID class driver pair. The driver can get a Feature Report only if the Report Descriptor declares it.
EvtVhfAsyncOperationSetFeatureOptional. A pointer to an EvtVhfAsyncOperation 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 Top-Level Collection to the HID class driver pair. The driver can set a Feature Report only if the Report Descriptor declares it.
EvtVhfAsyncOperationWriteReportOptional. A pointer to an EvtVhfAsyncOperation 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.
EvtVhfAsyncOperationGetInputReportOptional. A pointer to an EvtVhfAsyncOperation callback. The HID source driver must implement and register this callback function if it wants to support on-demand query for Input Reports.
EvtVhfCleanupOptional. A pointer to a EvtVhfCleanup 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.
HardwareIDsLengthHardwareIDsWrite a HID source driver by using Virtual HID Framework (VHF)