StorPortGetPhysicalAddress returning NULL

Hi,

In my Storport miniport driver I see that *sometimes* StorPortGetPhysicalAddress returns NULL. The documentation says: “If the given address cannot be converted, the function returns NULL”.

Would someone know when this would likely happen? I am passing the address received from Srb’s Databuffer.

Getting a NULL is an expected behavior that a developer is expected to handle, or I might have some bug in the code? Thanks.

Regards,
Suresh

I am currently calling StorPortGetPhysicalAddress in a loop for one page at a time to retrieve the corresponding physical pages. But as I mentioned above, I see that ‘once in a while’ I get NULL.
Am I supposed to use StorPortGetScatterGatherList instead?

Btw what is the difference between StorPortGetScatterGatherList and StorPortGetDataInBufferScatterGatherList? Thanks.

You’ll get NULL if the address is outside of the range described by the
DataBuffer in the SRB, so I’d assume you have a bug. But you’re generally
better off just calling StorPortGetScatterGatherList and getting the SG list
all at once anyway.

StorPortGetDataInBufferScatterGatherList is for getting the input buffer
supplied for a bidirectional transfer (e.g. SCSI_PASS_THROUGH_EX)

-scott
OSR
@OSRDrivers

wrote in message news:xxxxx@ntdev…

I am currently calling StorPortGetPhysicalAddress in a loop for one page at
a time to retrieve the corresponding physical pages. But as I mentioned
above, I see that ‘once in a while’ I get NULL.
Am I supposed to use StorPortGetScatterGatherList instead?

Btw what is the difference between StorPortGetScatterGatherList and
StorPortGetDataInBufferScatterGatherList? Thanks.