// storport.h
typedef struct _VIRTUAL_HW_INITIALIZATION_DATA {
ULONG HwInitializationDataSize;
INTERFACE_TYPE AdapterInterfaceType;
PHW_INITIALIZE HwInitialize;
PHW_STARTIO HwStartIo;
PHW_INTERRUPT HwInterrupt;
PVIRTUAL_HW_FIND_ADAPTER HwFindAdapter;
PHW_RESET_BUS HwResetBus;
PHW_DMA_STARTED HwDmaStarted;
PHW_ADAPTER_STATE HwAdapterState;
ULONG DeviceExtensionSize;
ULONG SpecificLuExtensionSize;
ULONG SrbExtensionSize;
ULONG NumberOfAccessRanges;
PVOID Reserved;
UCHAR MapBuffers;
BOOLEAN NeedPhysicalAddresses;
BOOLEAN TaggedQueuing;
BOOLEAN AutoRequestSense;
BOOLEAN MultipleRequestPerLu;
BOOLEAN ReceiveEvent;
USHORT VendorIdLength;
PVOID VendorId;
union {
USHORT ReservedUshort;
USHORT PortVersionFlags;
};
USHORT DeviceIdLength;
PVOID DeviceId;
PHW_ADAPTER_CONTROL HwAdapterControl;
PHW_BUILDIO HwBuildIo;
PHW_FREE_ADAPTER_RESOURCES HwFreeAdapterResources;
PHW_PROCESS_SERVICE_REQUEST HwProcessServiceRequest;
PHW_COMPLETE_SERVICE_IRP HwCompleteServiceIrp;
PHW_INITIALIZE_TRACING HwInitializeTracing;
PHW_CLEANUP_TRACING HwCleanupTracing;
} VIRTUAL_HW_INITIALIZATION_DATA, *PVIRTUAL_HW_INITIALIZATION_DATA;
View the official Windows Driver Kit DDI referenceNo description available.
The VIRTUAL_HW_INITIALIZATION_DATA structure contains information particular to each virtual miniport driver.
HwInitializationDataSizeSpecifies the size of this structure in bytes, as returned by sizeof(). This member indicates the version of this structure that is used by the virtual miniport driver. A virtual miniport driver's DriverEntry routine should set this member's value for the port driver.
AdapterInterfaceTypeFor storport virtual miniport drivers, the value for AdapterInterfaceType will almost always be internal. This is because the Storport driver does not support legacy buses.
Note that because of this, most of the adapter interface types that are used with the SCSI port driver are invalid for Storport drivers. In particular, Storport does not support:
Additionally, unlike the SCSI port case, a virtual miniport driver that works with the Storport driver is not required to supply values for the following members:
HwInitializeA pointer to the virtual miniport driver's HwStorInitialize routine, which is a required entry point for all virtual miniport drivers.
HwStartIoA pointer to the virtual miniport driver's HwStorStartIo routine, which is a required entry point for all virtual miniport drivers.
HwInterruptNot used. Virtual miniport drivers do not process interrupts.
HwFindAdapterA pointer to the virtual miniport driver's VirtualHwStorFindAdapter routine, which is a required entry point for all virtual miniport drivers.
HwResetBusA pointer to the virtual miniport driver's HwStorResetBus routine, which is a required entry point for all virtual miniport drivers.
HwDmaStartedNot used. Virtual miniport drivers do not perform DMA.
HwAdapterStateThe Storport driver does not support legacy drivers. Therefore, this member must be NULL.
DeviceExtensionSizeSpecifies the size, in bytes, that is required by the virtual miniport driver for its per-adapter non-paged device extension. A virtual miniport driver uses its device extension as storage for driver-determined adapter information. The operating system-specific port driver initializes each device extension that it allocates with zeros, and passes a pointer to the adapter-specific device extension in most calls to the virtual miniport driver. The given size does not include any virtual miniport driver-requested per-logical-unit storage.
SpecificLuExtensionSizeSpecifies the size, in bytes, that is required by the virtual miniport driver for its per-logical-unit non-paged storage, if any. A virtual miniport driver can use its logical unit (LU) extensions as storage for driver-determined LU information about peripherals on the virtual bus. The operating system-specific port driver initializes each LU extension that it allocates with zeros. Leave this member set to zero if the virtual miniport driver does not maintain per-LU information for which it requires storage.
SrbExtensionSizeSpecifies the size, in bytes, that is required by the virtual miniport driver for its per-request non-paged storage, if any. Because virtual miniport drivers that work with the Storport driver must support scatter/gather lists, and the per-SRB scatter/gather lists are usually allocated in the SRB extension, this member is rarely zero.
NumberOfAccessRangesNot used. Virtual miniport drivers do not support hardware.
ReservedReserved for system use.
MapBuffers| Name | Description |
|---|---|
| STOR_MAP_NO_BUFFERS | Only maps buffer for SRB_FUNCTION_IO_CONTROL and SRB_FUNCTION_WMI. |
| STOR_MAP_ALL_BUFFERS | Obsolete, same behavior as STOR_MAP_NON_READ_WRITE_BUFFERS. |
| STOR_MAP_NON_READ_WRITE_BUFFERS | Maps buffer for IO requests except READ and WRITE. |
| STOR_MAP_ALL_BUFFERS_INCLUDING_READ_WRITE | Maps buffer for all IO requests including READ and WRITE. Miniport drivers will typically use this setting. |
NeedPhysicalAddressesNot used. Virtual miniport drivers do not support hardware.
TaggedQueuingMust be set to TRUE. A value of TRUE indicates that the virtual miniport driver supports tagged queuing.
AutoRequestSenseMust be set to TRUE. A value of TRUE indicates that the HBA can perform a request-sense operation without requiring an explicit request to do so.
MultipleRequestPerLuMust be set to TRUE. A value of TRUE indicates that the virtual miniport driver can queue multiple requests per logical unit (LU).
ReceiveEventThis value is no longer used, and can be set to either TRUE or FALSE.
VendorIdLengthThe length, in bytes, of the vendor identifier.
VendorIdThe vendor identifier.
ReservedUshortReserved.
PortVersionFlagsA bitmap of flags that indicate the features that the port driver supports. Currently, the only flag available is SP_VER_TRACE_SUPPORT, which indicates that the port driver supports tracing.
DeviceIdLengthThe length, in bytes, of the device identifier.
DeviceIdThe device identifier.
HwAdapterControlA pointer to the virtual miniport driver's HwStorAdapterControl routine.
HwBuildIoThis member is not used.
HwFreeAdapterResourcesA pointer to the virtual miniport driver's HwStorFreeAdapterResources routine, which is a required entry point for all virtual miniport drivers.
HwProcessServiceRequestA pointer to the virtual miniport driver's HwStorProcessServiceRequest routine.
HwCompleteServiceIrpA pointer to the virtual miniport driver's HwStorCompleteServiceIrp routine.
HwInitializeTracingA pointer to the virtual miniport driver's HwStorInitializeTracing routine.
HwCleanupTracingA pointer to the virtual miniport driver's HwStorCleanupTracing routine.
If a virtual miniport driver will execute only on Windows 8 or later, the driver should use the HW_INITIALIZATION_DATA structure instead of VIRTUAL_HW_INITIALIZATION_DATA.