The StorPortGetPhysicalAddress routine converts a given virtual address range to a physical address range for a DMA operation.
STORPORT_API STOR_PHYSICAL_ADDRESS StorPortGetPhysicalAddress( _In_ PVOID HwDeviceExtension, _In_opt_ PSCSI_REQUEST_BLOCK Srb, _In_ PVOID VirtualAddress, _Out_ ULONG *Length );
- HwDeviceExtension [in]
A pointer to the hardware device extension. This is a per HBA storage area that the port driver allocates and initializes on behalf of the miniport driver. Miniport drivers usually store HBA-specific information in this extension, such as the state of the HBA and the mapped access ranges for the HBA. This area is available to the miniport driver in the DeviceExtension->HwDeviceExtension member of the device object for the HBA immediately after the miniport driver calls StorPortInitialize. The port driver frees this memory when it removes the device.
- Srb [in, optional]
Pointer to the SCSI request block if the virtual address to be converted comes from that SRB's DataBuffer member or SenseInfoBuffer member. Otherwise, this parameter must be NULL.
- VirtualAddress [in]
Pointer to the base virtual address to be converted. If this virtual address falls within the range for an SRB-supplied DataBuffer, the caller also must provide the Srb pointer.
- Length [out]
Pointer to a value indicating the number of bytes mapped, starting at the returned physical address.
StorPortGetPhysicalAddress returns the corresponding physical address for a given virtual address. If the given address cannot be converted, the function returns NULL.
If the virtual address passed to StorPortGetPhysicalAddress is obtained from StorPortAllocateContiguousMemorySpecifyCacheNode, the value returned for Length should be ignored.
Starting in Windows 8, the Srb parameter may point to either SCSI_REQUEST_BLOCK or STORAGE_REQUEST_BLOCK. If the function identifier in the Function field of Srb is SRB_FUNCTION_STORAGE_REQUEST_BLOCK, the SRB is a STORAGE_REQUEST_BLOCK request structure.
Build date: 11/16/2013