SRB->DataBuffer NULL in Stor Port Driver.

Hi All,
I am working on StorPort driver and strangly i am getting
Srb->SrbDataBuffer = 0x00000000. Obviously i will see a crash in my system.

Is there a reason why i am getting this kind of SRB??
What should i do with this SRB???

Any help is highly appriciated.
Thanks,
Ajitabh

this isn’t uncommon if the request doesn’t transfer any data.
TEST_UNIT_READY, for example, doesn’t have a data phase.

in a scsiport miniport you need to test the direction flags
(SRB_FLAGS_DATA_IN & SRB_FLAGS_DATA_OUT) and the data transfer length
and only try to use the data buffer if there’s data to transfer. I
strongly suspect the same is true for storport.

-p

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Saxena, Ajitabh
Prakash
Sent: Tuesday, January 27, 2004 1:38 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] SRB->DataBuffer NULL in Stor Port Driver.

Hi All,
I am working on StorPort driver and strangly i am getting
Srb->SrbDataBuffer = 0x00000000. Obviously i will see a crash in my
system.

Is there a reason why i am getting this kind of SRB??
What should i do with this SRB???

Any help is highly appriciated.
Thanks,
Ajitabh


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

Now here my Srb->CDB[0] = 28 -> SCSIOP_READ.
My Srb->DataTransferLength = 0x200 -> 512 Bytes.
When i do a StorPortGetScatterGatherList i get a SG list with one element
and with a proper Address.

-Ajitabh

-----Original Message-----
From: Peter Wieland [mailto:xxxxx@windows.microsoft.com]
Sent: Tuesday, January 27, 2004 4:51 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] SRB->DataBuffer NULL in Stor Port Driver.

this isn’t uncommon if the request doesn’t transfer any data.
TEST_UNIT_READY, for example, doesn’t have a data phase.

in a scsiport miniport you need to test the direction flags
(SRB_FLAGS_DATA_IN & SRB_FLAGS_DATA_OUT) and the data transfer length
and only try to use the data buffer if there’s data to transfer. I
strongly suspect the same is true for storport.

-p

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Saxena, Ajitabh
Prakash
Sent: Tuesday, January 27, 2004 1:38 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] SRB->DataBuffer NULL in Stor Port Driver.

Hi All,
I am working on StorPort driver and strangly i am getting
Srb->SrbDataBuffer = 0x00000000. Obviously i will see a crash in my
system.

Is there a reason why i am getting this kind of SRB??
What should i do with this SRB???

Any help is highly appriciated.
Thanks,
Ajitabh


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@lsil.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

If you didn’t set MapBuffers to true when you initialized the miniport you
probably won’t get a DataBuffer in the SRB.

=====================
Mark Roddy

-----Original Message-----
From: Saxena, Ajitabh Prakash [mailto:xxxxx@lsil.com]
Sent: Tuesday, January 27, 2004 5:00 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] SRB->DataBuffer NULL in Stor Port Driver.

Now here my Srb->CDB[0] = 28 -> SCSIOP_READ.
My Srb->DataTransferLength = 0x200 -> 512 Bytes.
When i do a StorPortGetScatterGatherList i get a SG list with
one element and with a proper Address.

-Ajitabh

-----Original Message-----
From: Peter Wieland [mailto:xxxxx@windows.microsoft.com]
Sent: Tuesday, January 27, 2004 4:51 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] SRB->DataBuffer NULL in Stor Port Driver.

this isn’t uncommon if the request doesn’t transfer any data.
TEST_UNIT_READY, for example, doesn’t have a data phase.

in a scsiport miniport you need to test the direction flags
(SRB_FLAGS_DATA_IN & SRB_FLAGS_DATA_OUT) and the data
transfer length and only try to use the data buffer if
there’s data to transfer. I strongly suspect the same is
true for storport.

-p

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
Saxena, Ajitabh Prakash
Sent: Tuesday, January 27, 2004 1:38 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] SRB->DataBuffer NULL in Stor Port Driver.

Hi All,
I am working on StorPort driver and strangly i am getting
Srb->SrbDataBuffer = 0x00000000. Obviously i will see a crash in my
system.

Is there a reason why i am getting this kind of SRB??
What should i do with this SRB???

Any help is highly appriciated.
Thanks,
Ajitabh


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as:
xxxxx@windows.microsoft.com To unsubscribe send a blank
email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@lsil.com
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as:
xxxxx@stratus.com To unsubscribe send a blank email to
xxxxx@lists.osr.com

ok. the former is a very common mistake.

did you tell storport that you need virtual addresses for your buffers
(the scsiport equivalent is MapBuffers, I don’t know this exists in
storport though)? If you didn’t then you won’t get a SrbDataBuffer
pointer because the buffer isn’t necessarily mapped into system address
space.

setting MapBuffers is quite expensive. Don’t do it unless you actually
need to get at the data buffer.

-p

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Saxena, Ajitabh
Prakash
Sent: Tuesday, January 27, 2004 2:00 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] SRB->DataBuffer NULL in Stor Port Driver.

Now here my Srb->CDB[0] = 28 -> SCSIOP_READ.
My Srb->DataTransferLength = 0x200 -> 512 Bytes.
When i do a StorPortGetScatterGatherList i get a SG list with one
element and with a proper Address.

-Ajitabh

-----Original Message-----
From: Peter Wieland [mailto:xxxxx@windows.microsoft.com]
Sent: Tuesday, January 27, 2004 4:51 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] SRB->DataBuffer NULL in Stor Port Driver.

this isn’t uncommon if the request doesn’t transfer any data.
TEST_UNIT_READY, for example, doesn’t have a data phase.

in a scsiport miniport you need to test the direction flags
(SRB_FLAGS_DATA_IN & SRB_FLAGS_DATA_OUT) and the data transfer length
and only try to use the data buffer if there’s data to transfer. I
strongly suspect the same is true for storport.

-p

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Saxena, Ajitabh
Prakash
Sent: Tuesday, January 27, 2004 1:38 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] SRB->DataBuffer NULL in Stor Port Driver.

Hi All,
I am working on StorPort driver and strangly i am getting
Srb->SrbDataBuffer = 0x00000000. Obviously i will see a crash in my
system.

Is there a reason why i am getting this kind of SRB??
What should i do with this SRB???

Any help is highly appriciated.
Thanks,
Ajitabh


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@lsil.com To
unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

Thanks. Looks like this was the probelm.

-----Original Message-----
From: Peter Wieland [mailto:xxxxx@windows.microsoft.com]
Sent: Tuesday, January 27, 2004 5:12 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] SRB->DataBuffer NULL in Stor Port Driver.

ok. the former is a very common mistake.

did you tell storport that you need virtual addresses for your buffers
(the scsiport equivalent is MapBuffers, I don’t know this exists in
storport though)? If you didn’t then you won’t get a SrbDataBuffer
pointer because the buffer isn’t necessarily mapped into system address
space.

setting MapBuffers is quite expensive. Don’t do it unless you actually
need to get at the data buffer.

-p

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Saxena, Ajitabh
Prakash
Sent: Tuesday, January 27, 2004 2:00 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] SRB->DataBuffer NULL in Stor Port Driver.

Now here my Srb->CDB[0] = 28 -> SCSIOP_READ.
My Srb->DataTransferLength = 0x200 -> 512 Bytes.
When i do a StorPortGetScatterGatherList i get a SG list with one
element and with a proper Address.

-Ajitabh

-----Original Message-----
From: Peter Wieland [mailto:xxxxx@windows.microsoft.com]
Sent: Tuesday, January 27, 2004 4:51 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] SRB->DataBuffer NULL in Stor Port Driver.

this isn’t uncommon if the request doesn’t transfer any data.
TEST_UNIT_READY, for example, doesn’t have a data phase.

in a scsiport miniport you need to test the direction flags
(SRB_FLAGS_DATA_IN & SRB_FLAGS_DATA_OUT) and the data transfer length
and only try to use the data buffer if there’s data to transfer. I
strongly suspect the same is true for storport.

-p

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Saxena, Ajitabh
Prakash
Sent: Tuesday, January 27, 2004 1:38 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] SRB->DataBuffer NULL in Stor Port Driver.

Hi All,
I am working on StorPort driver and strangly i am getting
Srb->SrbDataBuffer = 0x00000000. Obviously i will see a crash in my
system.

Is there a reason why i am getting this kind of SRB??
What should i do with this SRB???

Any help is highly appriciated.
Thanks,
Ajitabh


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@lsil.com To
unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@lsil.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

This is normally for DMA case of MapBuffers = FALSE. In this case, you have
no possibility of touching your data by pointer - only the DMA can touch it.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

----- Original Message -----
From: “Saxena, Ajitabh Prakash”
To: “Windows System Software Devs Interest List”
Sent: Wednesday, January 28, 2004 12:38 AM
Subject: [ntdev] SRB->DataBuffer NULL in Stor Port Driver.

> Hi All,
> I am working on StorPort driver and strangly i am getting
> Srb->SrbDataBuffer = 0x00000000. Obviously i will see a crash in my system.
>
> Is there a reason why i am getting this kind of SRB??
> What should i do with this SRB???
>
> Any help is highly appriciated.
> Thanks,
> Ajitabh
>
> —
> Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com