SCSIPORT question

okay! Now I am upto creating the PDO for the disk class driver. I get hit
with a IRP_MJ_PNP, IRP_MN_QUERY_ID IRP. The IRP is asking for the
BusQueryDeviceID. I think you would return “GenDisk” in the following
manner.

swprintf(wcTmpBuf, L"GenDisk\0");
pwcBuffer = wcTmpBuf;
while(*(pwcBuffer++))
{
while(*(pwcBuffer++));
}

ulLength = (ULONG)(pwcBuffer - wcTmpBuf) * sizeof(WCHAR);
pwcBuffer = (PWCHAR)SunAllocMemory(PagedPool, ulLength,
MEMORY_POOL_TAG,
MODULE_BUG_CHECK_VALUE);
if(!pwcBuffer)
{
Status = STATUS_INSUFFICIENT_RESOURCES;
pIrp->IoStatus.Information = 0;
}
else
{

RtlCopyMemory(pwcBuffer, wcTmpBuf, ulLength);
pIrp->IoStatus.Information = (ULONG_PTR)pwcBuffer;
Status = STATUS_SUCCESS;
}
break;
}

but low and behold I get a BSOD of 0xCA. I looked it up in the DDK and it
is said that my deviceID name is using invalid characters or is not properly
terminated. I know I am not using invalid characters. I believe I am
properly terminated based on this code coming from the bus toaster example.

Any ideas?

Joe


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

I give up. Did you try using a debugger to verify ulLength and pwcBuffer?

Personally I find the construct:

while(*(pwcBuffer++))
{
while(*(pwcBuffer++));
}

hideous, I don’t care where it came from. Why would I even want to know what
that does?

Try wcslen, you are already using the kernel C runtime routines, why start
rolling your own?

p.s.
WCHAR buffer = L"GenDisk"; // its null terminated too
ULONG bufLen = sizeof(buffer);

lets the compiler figure this crap out rather than some runtime nonsense.

-----Original Message-----
From: Joe Moriarty [mailto:xxxxx@east.sun.com]
Sent: Thursday, September 27, 2001 8:28 AM
To: NT Developers Interest List
Subject: [ntdev] SCSIPORT question

okay! Now I am upto creating the PDO for the disk class driver. I get hit
with a IRP_MJ_PNP, IRP_MN_QUERY_ID IRP. The IRP is asking for the
BusQueryDeviceID. I think you would return “GenDisk” in the following
manner.

swprintf(wcTmpBuf, L"GenDisk\0");
pwcBuffer = wcTmpBuf;
while(*(pwcBuffer++))
{
while(*(pwcBuffer++));
}

ulLength = (ULONG)(pwcBuffer - wcTmpBuf) * sizeof(WCHAR);
pwcBuffer = (PWCHAR)SunAllocMemory(PagedPool, ulLength,
MEMORY_POOL_TAG,
MODULE_BUG_CHECK_VALUE);
if(!pwcBuffer)
{
Status = STATUS_INSUFFICIENT_RESOURCES;
pIrp->IoStatus.Information = 0;
}
else
{

RtlCopyMemory(pwcBuffer, wcTmpBuf, ulLength);
pIrp->IoStatus.Information = (ULONG_PTR)pwcBuffer;
Status = STATUS_SUCCESS;
}
break;
}

but low and behold I get a BSOD of 0xCA. I looked it up in the DDK and it
is said that my deviceID name is using invalid characters or is not properly
terminated. I know I am not using invalid characters. I believe I am
properly terminated based on this code coming from the bus toaster example.

Any ideas?

Joe


You are currently subscribed to ntdev as: xxxxx@stratus.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

That’s why I like C++, this whole can of worms is delegated to the “new”
operator, and I can override it with special purpose code if I feel the
need.

Alberto.

-----Original Message-----
From: Roddy, Mark [mailto:xxxxx@stratus.com]
Sent: Thursday, September 27, 2001 10:22 AM
To: NT Developers Interest List
Subject: [ntdev] RE: SCSIPORT question

I give up. Did you try using a debugger to verify ulLength and pwcBuffer?

Personally I find the construct:

while(*(pwcBuffer++))
{
while(*(pwcBuffer++));
}

hideous, I don’t care where it came from. Why would I even want to know what
that does?

Try wcslen, you are already using the kernel C runtime routines, why start
rolling your own?

p.s.
WCHAR buffer = L"GenDisk"; // its null terminated too
ULONG bufLen = sizeof(buffer);

lets the compiler figure this crap out rather than some runtime nonsense.

-----Original Message-----
From: Joe Moriarty [mailto:xxxxx@east.sun.com]
Sent: Thursday, September 27, 2001 8:28 AM
To: NT Developers Interest List
Subject: [ntdev] SCSIPORT question

okay! Now I am upto creating the PDO for the disk class driver. I get hit
with a IRP_MJ_PNP, IRP_MN_QUERY_ID IRP. The IRP is asking for the
BusQueryDeviceID. I think you would return “GenDisk” in the following
manner.

swprintf(wcTmpBuf, L"GenDisk\0");
pwcBuffer = wcTmpBuf;
while(*(pwcBuffer++))
{
while(*(pwcBuffer++));
}

ulLength = (ULONG)(pwcBuffer - wcTmpBuf) * sizeof(WCHAR);
pwcBuffer = (PWCHAR)SunAllocMemory(PagedPool, ulLength,
MEMORY_POOL_TAG,
MODULE_BUG_CHECK_VALUE);
if(!pwcBuffer)
{
Status = STATUS_INSUFFICIENT_RESOURCES;
pIrp->IoStatus.Information = 0;
}
else
{

RtlCopyMemory(pwcBuffer, wcTmpBuf, ulLength);
pIrp->IoStatus.Information = (ULONG_PTR)pwcBuffer;
Status = STATUS_SUCCESS;
}
break;
}

but low and behold I get a BSOD of 0xCA. I looked it up in the DDK and it
is said that my deviceID name is using invalid characters or is not properly
terminated. I know I am not using invalid characters. I believe I am
properly terminated based on this code coming from the bus toaster example.

Any ideas?

Joe


You are currently subscribed to ntdev as: xxxxx@stratus.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@compuware.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Trust me. I tried multiple variations. This was my last resort try. I
personally found it hideous as well. But when your left with no
alternatives you will try anything. So back to my own code again. Since
nothing is working.

case BusQueryDeviceID:
{
RtlInitAnsiString(&AnsiIdString, “SUNEMDK\HardDisk”);
Status = RtlAnsiStringToUnicodeString(&UnicodeIdString,
&AnsiIdString, TRUE);
if(Status == STATUS_SUCCESS)
{
pIrp->IoStatus.Information = (ULONG_PTR)UnicodeIdString.Buffer;
}
else
{
pIrp->IoStatus.Information = 0;
}
break;
}

Well in Win2K my bus driver would do this just fine. It took in
“SUNEMDK\HardDisk” searched the infs for the device and loaded my disk
class driver. It even works in WinXP.

But…

if you change
RtlInitAnsiString(&AnsiIdString, “SUNEMDK\HardDisk”);
to
RtlInitAnsiString(&AnsiIdString, “GenDisk”);

I get the BSOD 0xCA(3, xxxx, xxxxx, 1);

Now if I change the above line to
RtlInitAnsiString(&AnsiIdString, “SUNEMDK\GenDisk”);

then I don’t get a BSOD, but of course the Disk Class driver does not get
loaded.

This is so stupid that it’s driving me crazy.
Joe

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Roddy, Mark
Sent: Thursday, September 27, 2001 10:22 AM
To: NT Developers Interest List
Subject: [ntdev] RE: SCSIPORT question

I give up. Did you try using a debugger to verify ulLength and pwcBuffer?

Personally I find the construct:

while(*(pwcBuffer++))
{
while(*(pwcBuffer++));
}

hideous, I don’t care where it came from. Why would I even want
to know what
that does?

Try wcslen, you are already using the kernel C runtime routines, why start
rolling your own?

p.s.
WCHAR buffer = L"GenDisk"; // its null terminated too
ULONG bufLen = sizeof(buffer);

lets the compiler figure this crap out rather than some runtime nonsense.

-----Original Message-----
From: Joe Moriarty [mailto:xxxxx@east.sun.com]
Sent: Thursday, September 27, 2001 8:28 AM
To: NT Developers Interest List
Subject: [ntdev] SCSIPORT question

okay! Now I am upto creating the PDO for the disk class driver.
I get hit
with a IRP_MJ_PNP, IRP_MN_QUERY_ID IRP. The IRP is asking for the
BusQueryDeviceID. I think you would return “GenDisk” in the following
manner.

swprintf(wcTmpBuf, L"GenDisk\0");
pwcBuffer = wcTmpBuf;
while(*(pwcBuffer++))
{
while(*(pwcBuffer++));
}

ulLength = (ULONG)(pwcBuffer - wcTmpBuf) * sizeof(WCHAR);
pwcBuffer = (PWCHAR)SunAllocMemory(PagedPool, ulLength,
MEMORY_POOL_TAG,
MODULE_BUG_CHECK_VALUE);
if(!pwcBuffer)
{
Status = STATUS_INSUFFICIENT_RESOURCES;
pIrp->IoStatus.Information = 0;
}
else
{

RtlCopyMemory(pwcBuffer, wcTmpBuf, ulLength);
pIrp->IoStatus.Information = (ULONG_PTR)pwcBuffer;
Status = STATUS_SUCCESS;
}
break;
}

but low and behold I get a BSOD of 0xCA. I looked it up in the DDK and it
is said that my deviceID name is using invalid characters or is
not properly
terminated. I know I am not using invalid characters. I believe I am
properly terminated based on this code coming from the bus
toaster example.

Any ideas?

Joe


You are currently subscribed to ntdev as: xxxxx@stratus.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@east.sun.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

This construct would find the length of a double-null terminated sequence of
null-terminated strings. These are used in certain common dialogs and other
MS constructs.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Roddy, Mark
Sent: Thursday, September 27, 2001 9:22 AM
To: NT Developers Interest List
Subject: [ntdev] RE: SCSIPORT question

I give up. Did you try using a debugger to verify ulLength and pwcBuffer?

Personally I find the construct:

while(*(pwcBuffer++))
{
while(*(pwcBuffer++));
}

hideous, I don’t care where it came from. Why would I even want to know what
that does?

Try wcslen, you are already using the kernel C runtime routines, why start
rolling your own?

p.s.
WCHAR buffer = L"GenDisk"; // its null terminated too
ULONG bufLen = sizeof(buffer);

lets the compiler figure this crap out rather than some runtime nonsense.

-----Original Message-----
From: Joe Moriarty [mailto:xxxxx@east.sun.com]
Sent: Thursday, September 27, 2001 8:28 AM
To: NT Developers Interest List
Subject: [ntdev] SCSIPORT question

okay! Now I am upto creating the PDO for the disk class driver. I get hit
with a IRP_MJ_PNP, IRP_MN_QUERY_ID IRP. The IRP is asking for the
BusQueryDeviceID. I think you would return “GenDisk” in the following
manner.

swprintf(wcTmpBuf, L"GenDisk\0");
pwcBuffer = wcTmpBuf;
while(*(pwcBuffer++))
{
while(*(pwcBuffer++));
}

ulLength = (ULONG)(pwcBuffer - wcTmpBuf) * sizeof(WCHAR);
pwcBuffer = (PWCHAR)SunAllocMemory(PagedPool, ulLength,
MEMORY_POOL_TAG,
MODULE_BUG_CHECK_VALUE);
if(!pwcBuffer)
{
Status = STATUS_INSUFFICIENT_RESOURCES;
pIrp->IoStatus.Information = 0;
}
else
{

RtlCopyMemory(pwcBuffer, wcTmpBuf, ulLength);
pIrp->IoStatus.Information = (ULONG_PTR)pwcBuffer;
Status = STATUS_SUCCESS;
}
break;
}

but low and behold I get a BSOD of 0xCA. I looked it up in the DDK and it
is said that my deviceID name is using invalid characters or is not properly
terminated. I know I am not using invalid characters. I believe I am
properly terminated based on this code coming from the bus toaster example.

Any ideas?

Joe


You are currently subscribed to ntdev as: xxxxx@stratus.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@pdq.net
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Why aren’t you sending back “SCSI\GenDisk”? That is what you should be
sending back if you are emulating the scsi port driver.

Mark J. Cariddi
Consulting Associate
Open Systems Resources, Inc.
http://www.osr.com/

-----Original Message-----
From: Joe Moriarty [mailto:xxxxx@east.sun.com]
Sent: Thursday, September 27, 2001 11:01 AM
To: NT Developers Interest List
Subject: [ntdev] RE: SCSIPORT question

Trust me. I tried multiple variations. This was my last resort try. I
personally found it hideous as well. But when your left with no
alternatives you will try anything. So back to my own code again. Since
nothing is working.

case BusQueryDeviceID:
{
RtlInitAnsiString(&AnsiIdString, “SUNEMDK\HardDisk”);
Status = RtlAnsiStringToUnicodeString(&UnicodeIdString,
&AnsiIdString, TRUE);
if(Status == STATUS_SUCCESS)
{
pIrp->IoStatus.Information = (ULONG_PTR)UnicodeIdString.Buffer;
}
else
{
pIrp->IoStatus.Information = 0;
}
break;
}

Well in Win2K my bus driver would do this just fine. It took in
“SUNEMDK\HardDisk” searched the infs for the device and loaded my disk
class driver. It even works in WinXP.

But…

if you change
RtlInitAnsiString(&AnsiIdString, “SUNEMDK\HardDisk”);
to
RtlInitAnsiString(&AnsiIdString, “GenDisk”);

I get the BSOD 0xCA(3, xxxx, xxxxx, 1);

Now if I change the above line to
RtlInitAnsiString(&AnsiIdString, “SUNEMDK\GenDisk”);

then I don’t get a BSOD, but of course the Disk Class driver does not get
loaded.

This is so stupid that it’s driving me crazy.
Joe

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Roddy, Mark
Sent: Thursday, September 27, 2001 10:22 AM
To: NT Developers Interest List
Subject: [ntdev] RE: SCSIPORT question

I give up. Did you try using a debugger to verify ulLength and
pwcBuffer?

Personally I find the construct:

while(*(pwcBuffer++))
{
while(*(pwcBuffer++));
}

hideous, I don’t care where it came from. Why would I even want to
know what that does?

Try wcslen, you are already using the kernel C runtime routines, why
start rolling your own?

p.s.
WCHAR buffer = L"GenDisk"; // its null terminated too
ULONG bufLen = sizeof(buffer);

lets the compiler figure this crap out rather than some runtime
nonsense.

-----Original Message-----
From: Joe Moriarty [mailto:xxxxx@east.sun.com]
Sent: Thursday, September 27, 2001 8:28 AM
To: NT Developers Interest List
Subject: [ntdev] SCSIPORT question

okay! Now I am upto creating the PDO for the disk class driver. I get
hit with a IRP_MJ_PNP, IRP_MN_QUERY_ID IRP. The IRP is asking for the
BusQueryDeviceID. I think you would return “GenDisk” in the following
manner.

swprintf(wcTmpBuf, L"GenDisk\0");
pwcBuffer = wcTmpBuf;
while(*(pwcBuffer++))
{
while(*(pwcBuffer++));
}

ulLength = (ULONG)(pwcBuffer - wcTmpBuf) * sizeof(WCHAR);
pwcBuffer = (PWCHAR)SunAllocMemory(PagedPool, ulLength,
MEMORY_POOL_TAG,
MODULE_BUG_CHECK_VALUE);
if(!pwcBuffer)
{
Status = STATUS_INSUFFICIENT_RESOURCES;
pIrp->IoStatus.Information = 0;
}
else
{

RtlCopyMemory(pwcBuffer, wcTmpBuf, ulLength);
pIrp->IoStatus.Information = (ULONG_PTR)pwcBuffer;
Status = STATUS_SUCCESS;
}
break;
}

but low and behold I get a BSOD of 0xCA. I looked it up in the DDK
and it is said that my deviceID name is using invalid characters or is
not properly terminated. I know I am not using invalid characters. I
believe I am properly terminated based on this code coming from the
bus toaster example.

Any ideas?

Joe


You are currently subscribed to ntdev as: xxxxx@stratus.com To
unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@east.sun.com To
unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@osr.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Joe,

Stupid question: Did you look at the returned ID’s and other fields pointed
to by the bug check display? The 3 in parameter 1 says you have an invalid
PDO. 2 and 3 point to PDO and buffers respectively, and the 1 in parameter 4
says the device ID was bogus. Look for invalid characters and termination.
Shouldn’t this be a null terminated string?

Also, have you tried “!analyzebugcheck -v” at the trap?

Now if you’ve done all the above … ignore me. My wife does. A lot. :slight_smile:

Gary G. Little
Staff Engineer
Broadband Storage, Inc.
xxxxx@broadstor.com

-----Original Message-----
From: Joe Moriarty [mailto:xxxxx@east.sun.com]
Sent: Thursday, September 27, 2001 8:01 AM
To: NT Developers Interest List
Subject: [ntdev] RE: SCSIPORT question

Trust me. I tried multiple variations. This was my last resort try. I
personally found it hideous as well. But when your left with no
alternatives you will try anything. So back to my own code again. Since
nothing is working.

case BusQueryDeviceID:
{
RtlInitAnsiString(&AnsiIdString, “SUNEMDK\HardDisk”);
Status = RtlAnsiStringToUnicodeString(&UnicodeIdString,
&AnsiIdString, TRUE);
if(Status == STATUS_SUCCESS)
{
pIrp->IoStatus.Information = (ULONG_PTR)UnicodeIdString.Buffer;
}
else
{
pIrp->IoStatus.Information = 0;
}
break;
}

Well in Win2K my bus driver would do this just fine. It took in
“SUNEMDK\HardDisk” searched the infs for the device and loaded my disk
class driver. It even works in WinXP.

But…

if you change
RtlInitAnsiString(&AnsiIdString, “SUNEMDK\HardDisk”);
to
RtlInitAnsiString(&AnsiIdString, “GenDisk”);

I get the BSOD 0xCA(3, xxxx, xxxxx, 1);

Now if I change the above line to
RtlInitAnsiString(&AnsiIdString, “SUNEMDK\GenDisk”);

then I don’t get a BSOD, but of course the Disk Class driver does not get
loaded.

This is so stupid that it’s driving me crazy.
Joe

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Roddy, Mark
Sent: Thursday, September 27, 2001 10:22 AM
To: NT Developers Interest List
Subject: [ntdev] RE: SCSIPORT question

I give up. Did you try using a debugger to verify ulLength and pwcBuffer?

Personally I find the construct:

while(*(pwcBuffer++))
{
while(*(pwcBuffer++));
}

hideous, I don’t care where it came from. Why would I even want
to know what
that does?

Try wcslen, you are already using the kernel C runtime routines, why start
rolling your own?

p.s.
WCHAR buffer = L"GenDisk"; // its null terminated too
ULONG bufLen = sizeof(buffer);

lets the compiler figure this crap out rather than some runtime nonsense.

-----Original Message-----
From: Joe Moriarty [mailto:xxxxx@east.sun.com]
Sent: Thursday, September 27, 2001 8:28 AM
To: NT Developers Interest List
Subject: [ntdev] SCSIPORT question

okay! Now I am upto creating the PDO for the disk class driver.
I get hit
with a IRP_MJ_PNP, IRP_MN_QUERY_ID IRP. The IRP is asking for the
BusQueryDeviceID. I think you would return “GenDisk” in the following
manner.

swprintf(wcTmpBuf, L"GenDisk\0");
pwcBuffer = wcTmpBuf;
while(*(pwcBuffer++))
{
while(*(pwcBuffer++));
}

ulLength = (ULONG)(pwcBuffer - wcTmpBuf) * sizeof(WCHAR);
pwcBuffer = (PWCHAR)SunAllocMemory(PagedPool, ulLength,
MEMORY_POOL_TAG,
MODULE_BUG_CHECK_VALUE);
if(!pwcBuffer)
{
Status = STATUS_INSUFFICIENT_RESOURCES;
pIrp->IoStatus.Information = 0;
}
else
{

RtlCopyMemory(pwcBuffer, wcTmpBuf, ulLength);
pIrp->IoStatus.Information = (ULONG_PTR)pwcBuffer;
Status = STATUS_SUCCESS;
}
break;
}

but low and behold I get a BSOD of 0xCA. I looked it up in the DDK and it
is said that my deviceID name is using invalid characters or is
not properly
terminated. I know I am not using invalid characters. I believe I am
properly terminated based on this code coming from the bus
toaster example.

Any ideas?

Joe


You are currently subscribed to ntdev as: xxxxx@stratus.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@east.sun.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@broadstor.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Just a thought: isn’t GenDisk the compatible id, not the DeviceId? Shouldn’t
the device id be something a bit more hardware specific as in
BUS\DiskVendorModelString ? I think perhaps that is your problem. Also be
aware that anything that is supposed to return a multistring must be double
null terminated.

-----Original Message-----
From: Joe Moriarty [mailto:xxxxx@east.sun.com]
Sent: Thursday, September 27, 2001 11:01 AM
To: NT Developers Interest List
Subject: [ntdev] RE: SCSIPORT question

Trust me. I tried multiple variations. This was my last resort try. I
personally found it hideous as well. But when your left with no
alternatives you will try anything. So back to my own code again. Since
nothing is working.

case BusQueryDeviceID:
{
RtlInitAnsiString(&AnsiIdString, “SUNEMDK\HardDisk”);
Status = RtlAnsiStringToUnicodeString(&UnicodeIdString,
&AnsiIdString, TRUE);
if(Status == STATUS_SUCCESS)
{
pIrp->IoStatus.Information = (ULONG_PTR)UnicodeIdString.Buffer;
}
else
{
pIrp->IoStatus.Information = 0;
}
break;
}

Well in Win2K my bus driver would do this just fine. It took in
“SUNEMDK\HardDisk” searched the infs for the device and loaded my disk
class driver. It even works in WinXP.

But…

if you change
RtlInitAnsiString(&AnsiIdString, “SUNEMDK\HardDisk”);
to
RtlInitAnsiString(&AnsiIdString, “GenDisk”);

I get the BSOD 0xCA(3, xxxx, xxxxx, 1);

Now if I change the above line to
RtlInitAnsiString(&AnsiIdString, “SUNEMDK\GenDisk”);

then I don’t get a BSOD, but of course the Disk Class driver does not get
loaded.

This is so stupid that it’s driving me crazy.
Joe

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Roddy, Mark
Sent: Thursday, September 27, 2001 10:22 AM
To: NT Developers Interest List
Subject: [ntdev] RE: SCSIPORT question

I give up. Did you try using a debugger to verify ulLength and pwcBuffer?

Personally I find the construct:

while(*(pwcBuffer++))
{
while(*(pwcBuffer++));
}

hideous, I don’t care where it came from. Why would I even want
to know what
that does?

Try wcslen, you are already using the kernel C runtime routines, why start
rolling your own?

p.s.
WCHAR buffer = L"GenDisk"; // its null terminated too
ULONG bufLen = sizeof(buffer);

lets the compiler figure this crap out rather than some runtime nonsense.

-----Original Message-----
From: Joe Moriarty [mailto:xxxxx@east.sun.com]
Sent: Thursday, September 27, 2001 8:28 AM
To: NT Developers Interest List
Subject: [ntdev] SCSIPORT question

okay! Now I am upto creating the PDO for the disk class driver.
I get hit
with a IRP_MJ_PNP, IRP_MN_QUERY_ID IRP. The IRP is asking for the
BusQueryDeviceID. I think you would return “GenDisk” in the following
manner.

swprintf(wcTmpBuf, L"GenDisk\0");
pwcBuffer = wcTmpBuf;
while(*(pwcBuffer++))
{
while(*(pwcBuffer++));
}

ulLength = (ULONG)(pwcBuffer - wcTmpBuf) * sizeof(WCHAR);
pwcBuffer = (PWCHAR)SunAllocMemory(PagedPool, ulLength,
MEMORY_POOL_TAG,
MODULE_BUG_CHECK_VALUE);
if(!pwcBuffer)
{
Status = STATUS_INSUFFICIENT_RESOURCES;
pIrp->IoStatus.Information = 0;
}
else
{

RtlCopyMemory(pwcBuffer, wcTmpBuf, ulLength);
pIrp->IoStatus.Information = (ULONG_PTR)pwcBuffer;
Status = STATUS_SUCCESS;
}
break;
}

but low and behold I get a BSOD of 0xCA. I looked it up in the DDK and it
is said that my deviceID name is using invalid characters or is
not properly
terminated. I know I am not using invalid characters. I believe I am
properly terminated based on this code coming from the bus
toaster example.

Any ideas?

Joe


You are currently subscribed to ntdev as: xxxxx@stratus.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@east.sun.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@stratus.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Thank you Mark. That is probably what the whole problem is. I’ll give it a
shot.

Joe

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Mark Cariddi
Sent: Thursday, September 27, 2001 12:05 PM
To: NT Developers Interest List
Subject: [ntdev] RE: SCSIPORT question

Why aren’t you sending back “SCSI\GenDisk”? That is what you should be
sending back if you are emulating the scsi port driver.

Mark J. Cariddi
Consulting Associate
Open Systems Resources, Inc.
http://www.osr.com/

-----Original Message-----
From: Joe Moriarty [mailto:xxxxx@east.sun.com]
Sent: Thursday, September 27, 2001 11:01 AM
To: NT Developers Interest List
Subject: [ntdev] RE: SCSIPORT question

Trust me. I tried multiple variations. This was my last resort try. I
personally found it hideous as well. But when your left with no
alternatives you will try anything. So back to my own code again. Since
nothing is working.

case BusQueryDeviceID:
{
RtlInitAnsiString(&AnsiIdString, “SUNEMDK\HardDisk”);
Status = RtlAnsiStringToUnicodeString(&UnicodeIdString,
&AnsiIdString, TRUE);
if(Status == STATUS_SUCCESS)
{
pIrp->IoStatus.Information =
(ULONG_PTR)UnicodeIdString.Buffer;
}
else
{
pIrp->IoStatus.Information = 0;
}
break;
}

Well in Win2K my bus driver would do this just fine. It took in
“SUNEMDK\HardDisk” searched the infs for the device and loaded my disk
class driver. It even works in WinXP.

But…

if you change
RtlInitAnsiString(&AnsiIdString, “SUNEMDK\HardDisk”);
to
RtlInitAnsiString(&AnsiIdString, “GenDisk”);

I get the BSOD 0xCA(3, xxxx, xxxxx, 1);

Now if I change the above line to
RtlInitAnsiString(&AnsiIdString, “SUNEMDK\GenDisk”);

then I don’t get a BSOD, but of course the Disk Class driver does not get
loaded.

This is so stupid that it’s driving me crazy.
Joe

> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com]On Behalf Of Roddy, Mark
> Sent: Thursday, September 27, 2001 10:22 AM
> To: NT Developers Interest List
> Subject: [ntdev] RE: SCSIPORT question
>
>
> I give up. Did you try using a debugger to verify ulLength and
> pwcBuffer?
>
> Personally I find the construct:
>
> while(*(pwcBuffer++))
> {
> while(*(pwcBuffer++));
> }
>
> hideous, I don’t care where it came from. Why would I even want to
> know what that does?
>
> Try wcslen, you are already using the kernel C runtime routines, why
> start rolling your own?
>
> p.s.
> WCHAR buffer = L"GenDisk"; // its null terminated too
> ULONG bufLen = sizeof(buffer);
>
> lets the compiler figure this crap out rather than some runtime
> nonsense.
>
>
>
> -----Original Message-----
> From: Joe Moriarty [mailto:xxxxx@east.sun.com]
> Sent: Thursday, September 27, 2001 8:28 AM
> To: NT Developers Interest List
> Subject: [ntdev] SCSIPORT question
>
>
> okay! Now I am upto creating the PDO for the disk class driver. I get
> hit with a IRP_MJ_PNP, IRP_MN_QUERY_ID IRP. The IRP is asking for the
> BusQueryDeviceID. I think you would return “GenDisk” in the following
> manner.
>
> swprintf(wcTmpBuf, L"GenDisk\0");
> pwcBuffer = wcTmpBuf;
> while(*(pwcBuffer++))
> {
> while(*(pwcBuffer++));
> }
>
> ulLength = (ULONG)(pwcBuffer - wcTmpBuf) * sizeof(WCHAR);
> pwcBuffer = (PWCHAR)SunAllocMemory(PagedPool, ulLength,
> MEMORY_POOL_TAG,
> MODULE_BUG_CHECK_VALUE);
> if(!pwcBuffer)
> {
> Status = STATUS_INSUFFICIENT_RESOURCES;
> pIrp->IoStatus.Information = 0;
> }
> else
> {
>
> RtlCopyMemory(pwcBuffer, wcTmpBuf, ulLength);
> pIrp->IoStatus.Information = (ULONG_PTR)pwcBuffer;
> Status = STATUS_SUCCESS;
> }
> break;
> }
>
> but low and behold I get a BSOD of 0xCA. I looked it up in the DDK
> and it is said that my deviceID name is using invalid characters or is
> not properly terminated. I know I am not using invalid characters. I
> believe I am properly terminated based on this code coming from the
> bus toaster example.
>
> Any ideas?
>
> Joe
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@stratus.com To
> unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>
> —
> You are currently subscribed to ntdev as: xxxxx@east.sun.com To
> unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>


You are currently subscribed to ntdev as: xxxxx@osr.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@east.sun.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

This is suppose to be the length, not a pointer :slight_smile:

pIrp->IoStatus.Information = (ULONG_PTR)pwcBuffer;

Jamey
xxxxx@storagecraft.com

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Joe Moriarty
Sent: Thursday, September 27, 2001 5:28 AM
To: NT Developers Interest List
Subject: [ntdev] SCSIPORT question

okay! Now I am upto creating the PDO for the disk class driver. I get
hit with a IRP_MJ_PNP, IRP_MN_QUERY_ID IRP. The IRP is asking for the
BusQueryDeviceID. I think you would return “GenDisk” in the following
manner.

swprintf(wcTmpBuf, L"GenDisk\0");
pwcBuffer = wcTmpBuf;
while(*(pwcBuffer++))
{
while(*(pwcBuffer++));
}

ulLength = (ULONG)(pwcBuffer - wcTmpBuf) * sizeof(WCHAR);
pwcBuffer = (PWCHAR)SunAllocMemory(PagedPool, ulLength,
MEMORY_POOL_TAG,
MODULE_BUG_CHECK_VALUE);
if(!pwcBuffer)
{
Status = STATUS_INSUFFICIENT_RESOURCES;
pIrp->IoStatus.Information = 0;
}
else
{

RtlCopyMemory(pwcBuffer, wcTmpBuf, ulLength);
pIrp->IoStatus.Information = (ULONG_PTR)pwcBuffer;
Status = STATUS_SUCCESS;
}
break;
}

but low and behold I get a BSOD of 0xCA. I looked it up in the DDK and
it is said that my deviceID name is using invalid characters or is not
properly terminated. I know I am not using invalid characters. I
believe I am properly terminated based on this code coming from the bus
toaster example.

Any ideas?

Joe


You are currently subscribed to ntdev as: xxxxx@storagecraft.com To
unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

This is why I hate C++ for driver development. I hate to have the
compiler and runtime ode to delegate anything for me. I want it to be
clear as to exactly what is going on. I sure do not need anything else
to make by debugging more difficult.

Jamey
xxxxx@storagecraft.com

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Moreira, Alberto
Sent: Thursday, September 27, 2001 8:06 AM
To: NT Developers Interest List
Subject: [ntdev] RE: SCSIPORT question

That’s why I like C++, this whole can of worms is delegated to the “new”
operator, and I can override it with special purpose code if I feel the
need.

Alberto.

-----Original Message-----
From: Roddy, Mark [mailto:xxxxx@stratus.com]
Sent: Thursday, September 27, 2001 10:22 AM
To: NT Developers Interest List
Subject: [ntdev] RE: SCSIPORT question

I give up. Did you try using a debugger to verify ulLength and
pwcBuffer?

Personally I find the construct:

while(*(pwcBuffer++))
{
while(*(pwcBuffer++));
}

hideous, I don’t care where it came from. Why would I even want to know
what that does?

Try wcslen, you are already using the kernel C runtime routines, why
start rolling your own?

p.s.
WCHAR buffer = L"GenDisk"; // its null terminated too
ULONG bufLen = sizeof(buffer);

lets the compiler figure this crap out rather than some runtime
nonsense.

-----Original Message-----
From: Joe Moriarty [mailto:xxxxx@east.sun.com]
Sent: Thursday, September 27, 2001 8:28 AM
To: NT Developers Interest List
Subject: [ntdev] SCSIPORT question

okay! Now I am upto creating the PDO for the disk class driver. I get
hit with a IRP_MJ_PNP, IRP_MN_QUERY_ID IRP. The IRP is asking for the
BusQueryDeviceID. I think you would return “GenDisk” in the following
manner.

swprintf(wcTmpBuf, L"GenDisk\0");
pwcBuffer = wcTmpBuf;
while(*(pwcBuffer++))
{
while(*(pwcBuffer++));
}

ulLength = (ULONG)(pwcBuffer - wcTmpBuf) * sizeof(WCHAR);
pwcBuffer = (PWCHAR)SunAllocMemory(PagedPool, ulLength,
MEMORY_POOL_TAG,
MODULE_BUG_CHECK_VALUE);
if(!pwcBuffer)
{
Status = STATUS_INSUFFICIENT_RESOURCES;
pIrp->IoStatus.Information = 0;
}
else
{

RtlCopyMemory(pwcBuffer, wcTmpBuf, ulLength);
pIrp->IoStatus.Information = (ULONG_PTR)pwcBuffer;
Status = STATUS_SUCCESS;
}
break;
}

but low and behold I get a BSOD of 0xCA. I looked it up in the DDK and
it is said that my deviceID name is using invalid characters or is not
properly terminated. I know I am not using invalid characters. I
believe I am properly terminated based on this code coming from the bus
toaster example.

Any ideas?

Joe


You are currently subscribed to ntdev as: xxxxx@stratus.com To
unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@compuware.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@storagecraft.com To
unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Aahhhh Haaaa! … lay odds it’s that second null that is needed!

Gary G. Little
Staff Engineer
Broadband Storage, Inc.
xxxxx@broadstor.com

-----Original Message-----
From: Roddy, Mark [mailto:xxxxx@stratus.com]
Sent: Thursday, September 27, 2001 9:31 AM
To: NT Developers Interest List
Subject: [ntdev] RE: SCSIPORT question

Just a thought: isn’t GenDisk the compatible id, not the DeviceId? Shouldn’t
the device id be something a bit more hardware specific as in
BUS\DiskVendorModelString ? I think perhaps that is your problem. Also be
aware that anything that is supposed to return a multistring must be double
null terminated.

-----Original Message-----
From: Joe Moriarty [mailto:xxxxx@east.sun.com]
Sent: Thursday, September 27, 2001 11:01 AM
To: NT Developers Interest List
Subject: [ntdev] RE: SCSIPORT question

Trust me. I tried multiple variations. This was my last resort try. I
personally found it hideous as well. But when your left with no
alternatives you will try anything. So back to my own code again. Since
nothing is working.

case BusQueryDeviceID:
{
RtlInitAnsiString(&AnsiIdString, “SUNEMDK\HardDisk”);
Status = RtlAnsiStringToUnicodeString(&UnicodeIdString,
&AnsiIdString, TRUE);
if(Status == STATUS_SUCCESS)
{
pIrp->IoStatus.Information = (ULONG_PTR)UnicodeIdString.Buffer;
}
else
{
pIrp->IoStatus.Information = 0;
}
break;
}

Well in Win2K my bus driver would do this just fine. It took in
“SUNEMDK\HardDisk” searched the infs for the device and loaded my disk
class driver. It even works in WinXP.

But…

if you change
RtlInitAnsiString(&AnsiIdString, “SUNEMDK\HardDisk”);
to
RtlInitAnsiString(&AnsiIdString, “GenDisk”);

I get the BSOD 0xCA(3, xxxx, xxxxx, 1);

Now if I change the above line to
RtlInitAnsiString(&AnsiIdString, “SUNEMDK\GenDisk”);

then I don’t get a BSOD, but of course the Disk Class driver does not get
loaded.

This is so stupid that it’s driving me crazy.
Joe

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Roddy, Mark
Sent: Thursday, September 27, 2001 10:22 AM
To: NT Developers Interest List
Subject: [ntdev] RE: SCSIPORT question

I give up. Did you try using a debugger to verify ulLength and pwcBuffer?

Personally I find the construct:

while(*(pwcBuffer++))
{
while(*(pwcBuffer++));
}

hideous, I don’t care where it came from. Why would I even want
to know what
that does?

Try wcslen, you are already using the kernel C runtime routines, why start
rolling your own?

p.s.
WCHAR buffer = L"GenDisk"; // its null terminated too
ULONG bufLen = sizeof(buffer);

lets the compiler figure this crap out rather than some runtime nonsense.

-----Original Message-----
From: Joe Moriarty [mailto:xxxxx@east.sun.com]
Sent: Thursday, September 27, 2001 8:28 AM
To: NT Developers Interest List
Subject: [ntdev] SCSIPORT question

okay! Now I am upto creating the PDO for the disk class driver.
I get hit
with a IRP_MJ_PNP, IRP_MN_QUERY_ID IRP. The IRP is asking for the
BusQueryDeviceID. I think you would return “GenDisk” in the following
manner.

swprintf(wcTmpBuf, L"GenDisk\0");
pwcBuffer = wcTmpBuf;
while(*(pwcBuffer++))
{
while(*(pwcBuffer++));
}

ulLength = (ULONG)(pwcBuffer - wcTmpBuf) * sizeof(WCHAR);
pwcBuffer = (PWCHAR)SunAllocMemory(PagedPool, ulLength,
MEMORY_POOL_TAG,
MODULE_BUG_CHECK_VALUE);
if(!pwcBuffer)
{
Status = STATUS_INSUFFICIENT_RESOURCES;
pIrp->IoStatus.Information = 0;
}
else
{

RtlCopyMemory(pwcBuffer, wcTmpBuf, ulLength);
pIrp->IoStatus.Information = (ULONG_PTR)pwcBuffer;
Status = STATUS_SUCCESS;
}
break;
}

but low and behold I get a BSOD of 0xCA. I looked it up in the DDK and it
is said that my deviceID name is using invalid characters or is
not properly
terminated. I know I am not using invalid characters. I believe I am
properly terminated based on this code coming from the bus
toaster example.

Any ideas?

Joe


You are currently subscribed to ntdev as: xxxxx@stratus.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@east.sun.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@stratus.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@broadstor.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

To really do a SCSIPORT driver correctly, you need to really emulate the MS
scsiport driver. The best way to do that is to write a filter driver for
the scsiport driver and observe what information it returns for various PnP
Requests. Secondly, you need to look in the registry. The Scsiport
driver creates many keys in the registry under HKLM\devicemap\scsi key
that applications look for. Thirdly, if you are emulating SCSI disks, you
need to build the Disk Class driver in the ddk in debug mode and observe
what it does. The disk class driver plays some games with the SRB and mdl
when it splits a read or write request. If you don’t handle it correctly,
you will get incorrect data…

-----Original Message-----
From: Joe Moriarty [mailto:xxxxx@east.sun.com]
Sent: Thursday, September 27, 2001 12:55 PM
To: NT Developers Interest List
Subject: [ntdev] RE: SCSIPORT question

Thank you Mark. That is probably what the whole problem is. I’ll give it a
shot.

Joe

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Mark Cariddi
Sent: Thursday, September 27, 2001 12:05 PM
To: NT Developers Interest List
Subject: [ntdev] RE: SCSIPORT question

Why aren’t you sending back “SCSI\GenDisk”? That is what you should be
sending back if you are emulating the scsi port driver.

Mark J. Cariddi
Consulting Associate
Open Systems Resources, Inc.
http://www.osr.com/

-----Original Message-----
From: Joe Moriarty [mailto:xxxxx@east.sun.com]
Sent: Thursday, September 27, 2001 11:01 AM
To: NT Developers Interest List
Subject: [ntdev] RE: SCSIPORT question

Trust me. I tried multiple variations. This was my last resort try.
I personally found it hideous as well. But when your left with no
alternatives you will try anything. So back to my own code again.
Since nothing is working.

case BusQueryDeviceID:
{
RtlInitAnsiString(&AnsiIdString, “SUNEMDK\HardDisk”);
Status = RtlAnsiStringToUnicodeString(&UnicodeIdString,
&AnsiIdString, TRUE);
if(Status == STATUS_SUCCESS)
{
pIrp->IoStatus.Information =
(ULONG_PTR)UnicodeIdString.Buffer;
}
else
{
pIrp->IoStatus.Information = 0;
}
break;
}

Well in Win2K my bus driver would do this just fine. It took in
“SUNEMDK\HardDisk” searched the infs for the device and loaded my
disk class driver. It even works in WinXP.

But…

if you change
RtlInitAnsiString(&AnsiIdString, “SUNEMDK\HardDisk”);
to
RtlInitAnsiString(&AnsiIdString, “GenDisk”);

I get the BSOD 0xCA(3, xxxx, xxxxx, 1);

Now if I change the above line to
RtlInitAnsiString(&AnsiIdString, “SUNEMDK\GenDisk”);

then I don’t get a BSOD, but of course the Disk Class driver does not
get loaded.

This is so stupid that it’s driving me crazy.
Joe

> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com]On Behalf Of Roddy, Mark
> Sent: Thursday, September 27, 2001 10:22 AM
> To: NT Developers Interest List
> Subject: [ntdev] RE: SCSIPORT question
>
>
> I give up. Did you try using a debugger to verify ulLength and
> pwcBuffer?
>
> Personally I find the construct:
>
> while(*(pwcBuffer++))
> {
> while(*(pwcBuffer++));
> }
>
> hideous, I don’t care where it came from. Why would I even want to
> know what that does?
>
> Try wcslen, you are already using the kernel C runtime routines, why
> start rolling your own?
>
> p.s.
> WCHAR buffer = L"GenDisk"; // its null terminated too ULONG bufLen
> = sizeof(buffer);
>
> lets the compiler figure this crap out rather than some runtime
> nonsense.
>
>
>
> -----Original Message-----
> From: Joe Moriarty [mailto:xxxxx@east.sun.com]
> Sent: Thursday, September 27, 2001 8:28 AM
> To: NT Developers Interest List
> Subject: [ntdev] SCSIPORT question
>
>
> okay! Now I am upto creating the PDO for the disk class driver. I
> get hit with a IRP_MJ_PNP, IRP_MN_QUERY_ID IRP. The IRP is asking
> for the BusQueryDeviceID. I think you would return “GenDisk” in the
> following manner.
>
> swprintf(wcTmpBuf, L"GenDisk\0");
> pwcBuffer = wcTmpBuf;
> while(*(pwcBuffer++))
> {
> while(*(pwcBuffer++));
> }
>
> ulLength = (ULONG)(pwcBuffer - wcTmpBuf) * sizeof(WCHAR);
> pwcBuffer = (PWCHAR)SunAllocMemory(PagedPool, ulLength,
> MEMORY_POOL_TAG,
> MODULE_BUG_CHECK_VALUE);
> if(!pwcBuffer)
> {
> Status = STATUS_INSUFFICIENT_RESOURCES;
> pIrp->IoStatus.Information = 0;
> }
> else
> {
>
> RtlCopyMemory(pwcBuffer, wcTmpBuf, ulLength);
> pIrp->IoStatus.Information = (ULONG_PTR)pwcBuffer;
> Status = STATUS_SUCCESS;
> }
> break;
> }
>
> but low and behold I get a BSOD of 0xCA. I looked it up in the DDK
> and it is said that my deviceID name is using invalid characters or
> is not properly terminated. I know I am not using invalid
> characters. I believe I am properly terminated based on this code
> coming from the bus toaster example.
>
> Any ideas?
>
> Joe
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@stratus.com To
> unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>
> —
> You are currently subscribed to ntdev as: xxxxx@east.sun.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>


You are currently subscribed to ntdev as: xxxxx@osr.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@east.sun.com To
unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@osr.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Don’t confuse DeviceId, HardwareId(s) and CompatibleId, as they are not the
same.
Check the XP ddk, as it spells this out in all the gory detail:

From Identifiers for SCSI Devices in Device Installation\Device
Identification Strings

"An example of a device ID for a disk drive would be:

SCSI\DiskSEAGATE_ST39102LW_______0004

There are four hardware IDs in addition to the device ID:

SCSI\t*v(8)p(16)

SCSI\t*v(8)

SCSI\v(8)p(16)r(1)

V(8)p(16)r(1)

In the third and fourth of these additional identifiers, r(1) represents
just the first character of the revision identifier. These hardware IDs are
illustrated by the following examples:

SCSI\DiskSEAGATE_ST39102LW_______

SCSI\DiskSEAGATE_

SCSI\DiskSEAGATE_ST39102LW_______0

SEAGATE_ST39102LW_______0

The ScsiPort driver supplies only one compatible ID, one of the
variable-sized generic type codes from the preceding table.

For example, the compatible ID for a disk drive is:

GenDisk

The generic identifier is used in INF files for SCSI devices more than any
other, because SCSI drivers tend to be generic. Note that ScsiPort returns
no generic name at all for sequential access and “processor” devices"

-----Original Message-----
From: Joe Moriarty [mailto:xxxxx@east.sun.com]
Sent: Thursday, September 27, 2001 12:55 PM
To: NT Developers Interest List
Subject: [ntdev] RE: SCSIPORT question

Thank you Mark. That is probably what the whole problem is. I’ll give it a
shot.

Joe

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Mark Cariddi
Sent: Thursday, September 27, 2001 12:05 PM
To: NT Developers Interest List
Subject: [ntdev] RE: SCSIPORT question

Why aren’t you sending back “SCSI\GenDisk”? That is what you should be
sending back if you are emulating the scsi port driver.

Mark J. Cariddi
Consulting Associate
Open Systems Resources, Inc.
http://www.osr.com/

-----Original Message-----
From: Joe Moriarty [mailto:xxxxx@east.sun.com]
Sent: Thursday, September 27, 2001 11:01 AM
To: NT Developers Interest List
Subject: [ntdev] RE: SCSIPORT question

Trust me. I tried multiple variations. This was my last resort try. I
personally found it hideous as well. But when your left with no
alternatives you will try anything. So back to my own code again. Since
nothing is working.

case BusQueryDeviceID:
{
RtlInitAnsiString(&AnsiIdString, “SUNEMDK\HardDisk”);
Status = RtlAnsiStringToUnicodeString(&UnicodeIdString,
&AnsiIdString, TRUE);
if(Status == STATUS_SUCCESS)
{
pIrp->IoStatus.Information =
(ULONG_PTR)UnicodeIdString.Buffer;
}
else
{
pIrp->IoStatus.Information = 0;
}
break;
}

Well in Win2K my bus driver would do this just fine. It took in
“SUNEMDK\HardDisk” searched the infs for the device and loaded my disk
class driver. It even works in WinXP.

But…

if you change
RtlInitAnsiString(&AnsiIdString, “SUNEMDK\HardDisk”);
to
RtlInitAnsiString(&AnsiIdString, “GenDisk”);

I get the BSOD 0xCA(3, xxxx, xxxxx, 1);

Now if I change the above line to
RtlInitAnsiString(&AnsiIdString, “SUNEMDK\GenDisk”);

then I don’t get a BSOD, but of course the Disk Class driver does not get
loaded.

This is so stupid that it’s driving me crazy.
Joe

> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com]On Behalf Of Roddy, Mark
> Sent: Thursday, September 27, 2001 10:22 AM
> To: NT Developers Interest List
> Subject: [ntdev] RE: SCSIPORT question
>
>
> I give up. Did you try using a debugger to verify ulLength and
> pwcBuffer?
>
> Personally I find the construct:
>
> while(*(pwcBuffer++))
> {
> while(*(pwcBuffer++));
> }
>
> hideous, I don’t care where it came from. Why would I even want to
> know what that does?
>
> Try wcslen, you are already using the kernel C runtime routines, why
> start rolling your own?
>
> p.s.
> WCHAR buffer = L"GenDisk"; // its null terminated too
> ULONG bufLen = sizeof(buffer);
>
> lets the compiler figure this crap out rather than some runtime
> nonsense.
>
>
>
> -----Original Message-----
> From: Joe Moriarty [mailto:xxxxx@east.sun.com]
> Sent: Thursday, September 27, 2001 8:28 AM
> To: NT Developers Interest List
> Subject: [ntdev] SCSIPORT question
>
>
> okay! Now I am upto creating the PDO for the disk class driver. I get
> hit with a IRP_MJ_PNP, IRP_MN_QUERY_ID IRP. The IRP is asking for the
> BusQueryDeviceID. I think you would return “GenDisk” in the following
> manner.
>
> swprintf(wcTmpBuf, L"GenDisk\0");
> pwcBuffer = wcTmpBuf;
> while(*(pwcBuffer++))
> {
> while(*(pwcBuffer++));
> }
>
> ulLength = (ULONG)(pwcBuffer - wcTmpBuf) * sizeof(WCHAR);
> pwcBuffer = (PWCHAR)SunAllocMemory(PagedPool, ulLength,
> MEMORY_POOL_TAG,
> MODULE_BUG_CHECK_VALUE);
> if(!pwcBuffer)
> {
> Status = STATUS_INSUFFICIENT_RESOURCES;
> pIrp->IoStatus.Information = 0;
> }
> else
> {
>
> RtlCopyMemory(pwcBuffer, wcTmpBuf, ulLength);
> pIrp->IoStatus.Information = (ULONG_PTR)pwcBuffer;
> Status = STATUS_SUCCESS;
> }
> break;
> }
>
> but low and behold I get a BSOD of 0xCA. I looked it up in the DDK
> and it is said that my deviceID name is using invalid characters or is
> not properly terminated. I know I am not using invalid characters. I
> believe I am properly terminated based on this code coming from the
> bus toaster example.
>
> Any ideas?
>
> Joe
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@stratus.com To
> unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>
> —
> You are currently subscribed to ntdev as: xxxxx@east.sun.com To
> unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>


You are currently subscribed to ntdev as: xxxxx@osr.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@east.sun.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@stratus.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Not for pnp requests. The folks who implemented pnp irp processing had their
own distinct style for associating data with pnp irps, a style that had
nothing at all with any of the existing IRP based data processing in NT.
IoStatus.Information gets overloaded as a pointer to data. IRP stack
locations don’t get used for this, as one would expect, and as they do
throughout the rest of the operating system. I’d guess these folks were from
the (win)DOS(98) side, although I have heard reasonable explanations for why
overloading IoStatus is a good idea.

-----Original Message-----
From: Jamey Kirby [mailto:xxxxx@storagecraft.com]
Sent: Thursday, September 27, 2001 1:11 PM
To: NT Developers Interest List
Subject: [ntdev] RE: SCSIPORT question

This is suppose to be the length, not a pointer :slight_smile:

pIrp->IoStatus.Information = (ULONG_PTR)pwcBuffer;

Jamey
xxxxx@storagecraft.com

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Joe Moriarty
Sent: Thursday, September 27, 2001 5:28 AM
To: NT Developers Interest List
Subject: [ntdev] SCSIPORT question

okay! Now I am upto creating the PDO for the disk class driver. I get
hit with a IRP_MJ_PNP, IRP_MN_QUERY_ID IRP. The IRP is asking for the
BusQueryDeviceID. I think you would return “GenDisk” in the following
manner.

swprintf(wcTmpBuf, L"GenDisk\0");
pwcBuffer = wcTmpBuf;
while(*(pwcBuffer++))
{
while(*(pwcBuffer++));
}

ulLength = (ULONG)(pwcBuffer - wcTmpBuf) * sizeof(WCHAR);
pwcBuffer = (PWCHAR)SunAllocMemory(PagedPool, ulLength,
MEMORY_POOL_TAG,
MODULE_BUG_CHECK_VALUE);
if(!pwcBuffer)
{
Status = STATUS_INSUFFICIENT_RESOURCES;
pIrp->IoStatus.Information = 0;
}
else
{

RtlCopyMemory(pwcBuffer, wcTmpBuf, ulLength);
pIrp->IoStatus.Information = (ULONG_PTR)pwcBuffer;
Status = STATUS_SUCCESS;
}
break;
}

but low and behold I get a BSOD of 0xCA. I looked it up in the DDK and
it is said that my deviceID name is using invalid characters or is not
properly terminated. I know I am not using invalid characters. I
believe I am properly terminated based on this code coming from the bus
toaster example.

Any ideas?

Joe


You are currently subscribed to ntdev as: xxxxx@storagecraft.com To
unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@stratus.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

I would like to thank everyone that responded with information on my quest
of writing a SCSIPORT driver. The disk driver is getting hit with it’s
AddDevice Routine now . Now it’s time to debug and develop the
rest of the PDO.

Thanks,
Joe

> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com]On Behalf Of Roddy, Mark
> Sent: Thursday, September 27, 2001 2:30 PM
> To: NT Developers Interest List
> Subject: [ntdev] RE: SCSIPORT question
>
>
> Don’t confuse DeviceId, HardwareId(s) and CompatibleId, as they
> are not the
> same.
> Check the XP ddk, as it spells this out in all the gory detail:
>
> From Identifiers for SCSI Devices in Device Installation\Device
> Identification Strings
>
> “An example of a device ID for a disk drive would be:
>
> SCSI\DiskSEAGATE_ST39102LW_______0004
>
> There are four hardware IDs in addition to the device ID:
>
> SCSI\tv(8)p(16)
>
> SCSI\t
v(8)
>
> SCSI\v(8)p(16)r(1)
>
> V(8)p(16)r(1)
>
> In the third and fourth of these additional identifiers, r(1) represents
> just the first character of the revision identifier. These
> hardware IDs are
> illustrated by the following examples:
>
> SCSI\DiskSEAGATE_ST39102LW_______
>
> SCSI\DiskSEAGATE_
>
> SCSI\DiskSEAGATE_ST39102LW 0
>
> SEAGATE_ST39102LW
0
>
> The ScsiPort driver supplies only one compatible ID, one of the
> variable-sized generic type codes from the preceding table.
>
> For example, the compatible ID for a disk drive is:
>
> GenDisk
>
> The generic identifier is used in INF files for SCSI devices more than any
> other, because SCSI drivers tend to be generic. Note that ScsiPort returns
> no generic name at all for sequential access and “processor” devices”
>
> -----Original Message-----
> From: Joe Moriarty [mailto:xxxxx@east.sun.com]
> Sent: Thursday, September 27, 2001 12:55 PM
> To: NT Developers Interest List
> Subject: [ntdev] RE: SCSIPORT question
>
>
> Thank you Mark. That is probably what the whole problem is. I’ll
> give it a
> shot.
>
> Joe
>
> > -----Original Message-----
> > From: xxxxx@lists.osr.com
> > [mailto:xxxxx@lists.osr.com]On Behalf Of Mark Cariddi
> > Sent: Thursday, September 27, 2001 12:05 PM
> > To: NT Developers Interest List
> > Subject: [ntdev] RE: SCSIPORT question
> >
> >
> > Why aren’t you sending back “SCSI\GenDisk”? That is what you
> should be
> > sending back if you are emulating the scsi port driver.
> >
> > Mark J. Cariddi
> > Consulting Associate
> > Open Systems Resources, Inc.
> > http://www.osr.com/
> >
> >
> > -----Original Message-----
> > From: Joe Moriarty [mailto:xxxxx@east.sun.com]
> > Sent: Thursday, September 27, 2001 11:01 AM
> > To: NT Developers Interest List
> > Subject: [ntdev] RE: SCSIPORT question
> >
> >
> > Trust me. I tried multiple variations. This was my last resort try. I
> > personally found it hideous as well. But when your left with no
> > alternatives you will try anything. So back to my own code
> again. Since
> > nothing is working.
> >
> > case BusQueryDeviceID:
> > {
> > RtlInitAnsiString(&AnsiIdString, “SUNEMDK\HardDisk”);
> > Status = RtlAnsiStringToUnicodeString(&UnicodeIdString,
> > &AnsiIdString, TRUE);
> > if(Status == STATUS_SUCCESS)
> > {
> > pIrp->IoStatus.Information =
> > (ULONG_PTR)UnicodeIdString.Buffer;
> > }
> > else
> > {
> > pIrp->IoStatus.Information = 0;
> > }
> > break;
> > }
> >
> > Well in Win2K my bus driver would do this just fine. It took in
> > “SUNEMDK\HardDisk” searched the infs for the device and loaded my disk
> > class driver. It even works in WinXP.
> >
> > But…
> >
> > if you change
> > RtlInitAnsiString(&AnsiIdString, “SUNEMDK\HardDisk”);
> > to
> > RtlInitAnsiString(&AnsiIdString, “GenDisk”);
> >
> > I get the BSOD 0xCA(3, xxxx, xxxxx, 1);
> >
> > Now if I change the above line to
> > RtlInitAnsiString(&AnsiIdString, “SUNEMDK\GenDisk”);
> >
> > then I don’t get a BSOD, but of course the Disk Class driver
> does not get
> > loaded.
> >
> > This is so stupid that it’s driving me crazy.
> > Joe
> >
> > > -----Original Message-----
> > > From: xxxxx@lists.osr.com
> > > [mailto:xxxxx@lists.osr.com]On Behalf Of Roddy, Mark
> > > Sent: Thursday, September 27, 2001 10:22 AM
> > > To: NT Developers Interest List
> > > Subject: [ntdev] RE: SCSIPORT question
> > >
> > >
> > > I give up. Did you try using a debugger to verify ulLength and
> > > pwcBuffer?
> > >
> > > Personally I find the construct:
> > >
> > > while((pwcBuffer++))
> > > {
> > > while(
(pwcBuffer++));
> > > }
> > >
> > > hideous, I don’t care where it came from. Why would I even want to
> > > know what that does?
> > >
> > > Try wcslen, you are already using the kernel C runtime routines, why
> > > start rolling your own?
> > >
> > > p.s.
> > > WCHAR buffer = L"GenDisk"; // its null terminated too
> > > ULONG bufLen = sizeof(buffer);
> > >
> > > lets the compiler figure this crap out rather than some runtime
> > > nonsense.
> > >
> > >
> > >
> > > -----Original Message-----
> > > From: Joe Moriarty [mailto:xxxxx@east.sun.com]
> > > Sent: Thursday, September 27, 2001 8:28 AM
> > > To: NT Developers Interest List
> > > Subject: [ntdev] SCSIPORT question
> > >
> > >
> > > okay! Now I am upto creating the PDO for the disk class driver. I get
> > > hit with a IRP_MJ_PNP, IRP_MN_QUERY_ID IRP. The IRP is asking for the
> > > BusQueryDeviceID. I think you would return “GenDisk” in the following
> > > manner.
> > >
> > > swprintf(wcTmpBuf, L"GenDisk\0");
> > > pwcBuffer = wcTmpBuf;
> > > while((pwcBuffer++))
> > > {
> > > while(
(pwcBuffer++));
> > > }
> > >
> > > ulLength = (ULONG)(pwcBuffer - wcTmpBuf) * sizeof(WCHAR);
> > > pwcBuffer = (PWCHAR)SunAllocMemory(PagedPool, ulLength,
> > > MEMORY_POOL_TAG,
> > > MODULE_BUG_CHECK_VALUE);
> > > if(!pwcBuffer)
> > > {
> > > Status = STATUS_INSUFFICIENT_RESOURCES;
> > > pIrp->IoStatus.Information = 0;
> > > }
> > > else
> > > {
> > >
> > > RtlCopyMemory(pwcBuffer, wcTmpBuf, ulLength);
> > > pIrp->IoStatus.Information = (ULONG_PTR)pwcBuffer;
> > > Status = STATUS_SUCCESS;
> > > }
> > > break;
> > > }
> > >
> > > but low and behold I get a BSOD of 0xCA. I looked it up in the DDK
> > > and it is said that my deviceID name is using invalid characters or is
> > > not properly terminated. I know I am not using invalid characters. I
> > > believe I am properly terminated based on this code coming from the
> > > bus toaster example.
> > >
> > > Any ideas?
> > >
> > > Joe
> > >
> > >
> > > —
> > > You are currently subscribed to ntdev as: xxxxx@stratus.com To
> > > unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
> > >
> > > —
> > > You are currently subscribed to ntdev as: xxxxx@east.sun.com To
> > > unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
> > >
> >
> >
> > —
> > You are currently subscribed to ntdev as: xxxxx@osr.com
> > To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
> >
> > —
> > You are currently subscribed to ntdev as: xxxxx@east.sun.com
> > To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
> >
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@stratus.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>
> —
> You are currently subscribed to ntdev as: xxxxx@east.sun.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

It’s me again. The disk driver is making a ClaimDevice call. Basically a

Srb.Function = SRB_FUNCTION_CLAIM_DEVICE

I process the call in my PDO. I get an assert upon return in the disk
driver. The code is

ASSERT(srb.DataBuffer != NULL);

What are they wanting in the DataBuffer? The disk driver doesn’t use it.
Let’s just make sure the PDO is returning something. What’s that something.
No documentation in the DDK on this as well _statement>.

Joe


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com_

Hi Joe,
Try sending back DeviceObject (which you receive in
the InternalIoControl) in the DataBuffer to the disk.

Regards,
Gurpreet
— Joe Moriarty wrote:
> It’s me again. The disk driver is making a
> ClaimDevice call. Basically a
>
> Srb.Function = SRB_FUNCTION_CLAIM_DEVICE
>
> I process the call in my PDO. I get an assert upon
> return in the disk
> driver. The code is
>
> ASSERT(srb.DataBuffer != NULL);
>
> What are they wanting in the DataBuffer? The disk
> driver doesn’t use it.
> Let’s just make sure the PDO is returning something.
> What’s that something.
> No documentation in the DDK on this as well > be wrong on this last
> statement>.
>
> Joe
>
>
> —
> You are currently subscribed to ntdev as:
> xxxxx@yahoo.com
> To unsubscribe send a blank email to
leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

__________________________________________________
Do You Yahoo!?
Listen to your Yahoo! Mail messages from any phone.
http://phone.yahoo.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Any non-null value will do. You have the code to disk.sys - note that he
just checks for a non-null value on a claim success, and then throws it away
(the srb is local to ClassClaimDevice. Pretty much useless, huh?

-----Original Message-----
From: Joe Moriarty [mailto:xxxxx@east.sun.com]
Sent: Friday, September 28, 2001 2:33 PM
To: NT Developers Interest List
Subject: [ntdev] SCSIPORT question

It’s me again. The disk driver is making a ClaimDevice call. Basically a

Srb.Function = SRB_FUNCTION_CLAIM_DEVICE

I process the call in my PDO. I get an assert upon return in the disk
driver. The code is

ASSERT(srb.DataBuffer != NULL);

What are they wanting in the DataBuffer? The disk driver doesn’t use it.
Let’s just make sure the PDO is returning something. What’s that something.
No documentation in the DDK on this as well _statement>.

Joe


You are currently subscribed to ntdev as: xxxxx@stratus.com To
unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com_

Driver for real HDDs return PDO here. Also it returns something into
SrbExtension field, for instance this field contains 1 for IDE drives and 2
for SCSI drives.
Does anybody know SrbExtension filed destination in this case?

Regards,
Dennis.

----- Èñõîäíîå ñîîáùåíèå -----
Îò: Joe Moriarty
Êîìó: NT Developers Interest List
Îòïðàâëåíî: 28 ñåíòÿáðÿ 2001 ã. 22:32
Òåìà: [ntdev] SCSIPORT question

> It’s me again. The disk driver is making a ClaimDevice call. Basically a
>
> Srb.Function = SRB_FUNCTION_CLAIM_DEVICE
>
> I process the call in my PDO. I get an assert upon return in the disk
> driver. The code is
>
> ASSERT(srb.DataBuffer != NULL);
>
> What are they wanting in the DataBuffer? The disk driver doesn’t use it.
> Let’s just make sure the PDO is returning something. What’s that
something.
> No documentation in the DDK on this as well > statement>.
>
> Joe
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@acronis.ru
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com