StorPortGetPfns function (storport.h)

The StorPortGetPfns routine can be called when a miniport needs to retrieve PFNs associated with a MDL for a SRB.

Syntax

ULONG StorPortGetPfns(
  [in]  PVOID               HwDeviceExtension,
  [in]  PSCSI_REQUEST_BLOCK Srb,
  [in]  PVOID               Mdl,
  [out] PVOID               *Pfns,
  [out] ULONG               *PfnCount,
  [out] ULONG               *StartingOffset
);

Parameters

[in] HwDeviceExtension

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.

[in] Srb

A pointer to the source SCSI request block (SRB).

[in] Mdl

A pointer to the MDL for which Pfns are requested. Only MDLs obtained using StorPortGetOriginalMdl or StorPortGetDataInBufferMdl are supported.

[out] Pfns

A pointer to the beginning of the array of physical page numbers that are associated with the MDL. Callers must NOT modify or update or free the list.

[out] PfnCount

Specifies the number of PFNs in the array.

[out] StartingOffset

Specifies the byte offset within the initial page of the buffer described by the given MDL.

Return value

StorPortGetPfns returns one of the following status codes:

Return code Description
STOR_STATUS_NOT_IMPLEMENTED This function is not implemented on the active operating system.
STOR_STATUS_SUCCESS The list items were removed successfully or the list is already empty.
STOR_STATUS_INVALID_PARAMETER A pointer to one of the parameters is NULL.

Remarks

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.

Starting in Windows 8, the Srb parameter may point to either SCSI_REQUEST_BLOCK or STORAGE_REQUEST_BLOCK.

Requirements

Requirement Value
Target Platform Universal
Header storport.h

See also

StorPortGetDataInBufferMdl

StorPortGetOriginalMdl

StorPortInitialize