Drive letter in IRP_MJ_CREATE......

I am using sfilter from IFS windows server 2003 …

I use “IoVolumeDeviceToDosName” to get the driver letter.

the following is the function …

PUNICODE_STRING GetDriveLetter(PDEVICE_OBJECT StorageDevice)
{
NTSTATUS ntstat;

// Drive , drivebuffer is declared as global…
RtlInitEmptyUnicodeString(&Drive,drivebuffer,sizeof(drivebuffer) );

ntstat = IoVolumeDeviceToDosName( StorageDevice,&Drive);
if( STATUS_SUCCESS != ntstat )
{
DbgPrint(“\n IoVolumeDeviceToDosName Failed “);
}
else
DbgPrint(”\n DRIVE_LETTER =%wZ”,&Drive);

return &Drive;
}

I am calling the above function in IRP_MJ_CREATE dispatch …

PSFILTER_DEVICE_EXTENSION devExt = DeviceObject->DeviceExtension;

GetDriveLetter(devExt->StorageStackDeviceObject);
-…-…-…-…-.

I do not know what is wrong with my code …

It is working fine for first few IRP_MJ_CREATE but after few IRP_MJ_CREATE it hangs …
No blue screen but…
I noticed that the IoVolumeDeviceToDosName is not returning …

Any help on “what could be the problem…”…??

PRIYA MS


Do you Yahoo!?
Yahoo! Mail - Easier than ever with enhanced search. Learn more.

We have discussed this problem several times to death
(If I am authorized to use Peter Viscarola’s words :-).

Please, search the archives of this list server, you will
find lots of threads dedicated to this problem.

L.

RtlInitEmptyUnicodeString is used to initialize an empty counted string,
but in your case since Drive is a global variable, you might be calling
it with the non empty string , so make sure that each time you call
RtlInitEmptyUnicodeString with “Drive” variable being empty or try using
RtlInitUnicodeString.


K.Raju


From: NTFSD NTDEV [mailto:xxxxx@yahoo.com]
Sent: Friday, December 03, 2004 1:30 PM
To: Windows File Systems Devs Interest List
Subject: [ntfsd] Drive letter in IRP_MJ_CREATE…

I am using sfilter from IFS windows server 2003 …

I use “IoVolumeDeviceToDosName” to get the driver letter.

the following is the function …

PUNICODE_STRING GetDriveLetter(PDEVICE_OBJECT StorageDevice)
{
NTSTATUS ntstat;

// Drive , drivebuffer is declared as global…
RtlInitEmptyUnicodeString(&Drive,drivebuffer,sizeof(drivebuffer) );

ntstat = IoVolumeDeviceToDosName( StorageDevice,&Drive);
if( STATUS_SUCCESS != ntstat )
{
DbgPrint(“\n IoVolumeDeviceToDosName Failed “);
}
else
DbgPrint(”\n DRIVE_LETTER =%wZ”,&Drive);

return &Drive;
}

I am calling the above function in IRP_MJ_CREATE dispatch …

PSFILTER_DEVICE_EXTENSION devExt = DeviceObject->DeviceExtension;

GetDriveLetter(devExt->StorageStackDeviceObject);
-…-…-…-…
…-.

I do not know what is wrong with my code …

It is working fine for first few IRP_MJ_CREATE but after few
IRP_MJ_CREATE it hangs …
No blue screen but…
I noticed that the IoVolumeDeviceToDosName is not returning …

Any help on “what could be the problem…”…??

PRIYA MS


Do you Yahoo!?
Yahoo! Mail - Easier than ever with enhanced search. Learn more.
http:
— Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17 You are currently subscribed
to ntfsd as: xxxxx@inquesttechnologies.com To unsubscribe send a blank
email to xxxxx@lists.osr.com</http:>