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