Re: ??: How to get driver letter from \Device\HarddiskVolume1

Hi,

Is it is correct if i get the pointer to the caller¡¯s stack location ( by
using IoGetCurrentIrpStackLocation) and using that device object of caller’s
stack, can i call the RtlVolumeDeviceToDosName to get the drive Name?

With Regards,
A.Ilamparithi

“Neal Christiansen” wrote in message
news:xxxxx@ntfsd…
This API blue screens if you send it a “file system stack” device object.
You must send it a “storage stack” device object.

You can get this by calling “IoGetDiskDeviceObject()” which will give you
the storage stack device object given a file system stack device object.
This object is returned referenced so be sure and call ObReleaseObject()
when you are done querying the driver letter.

Unfortunately this API does not exist on W2K. To work around this you would
have to load your filter at boot time and save the storage stack device
object in your device object extension as the volumes mount. Note that both
the sfilter and filespy samples in the IFSKit show you how to save the
storage stack device object when a volume mounts.

Note that an appropriate bug has been filed to get the documentation updated
for this API.

Neal Christiansen
Microsoft File System Filter Group Lead
This posting is provided “AS IS” with no warranties, and confers no rights.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Brilly Wu (HangZhou)
Sent: Tuesday, July 06, 2004 10:01 PM
To: Windows File Systems Devs Interest List
Subject: [ntfsd] ??: [ntfsd] How to get driver letter from
\Device\HarddiskVolume1

But how to use it?
status = IoVolumeDeviceToDosName(
irpSp->FileObject->DeviceObject,dosName);
DBGD1( “IoVolumeDeviceToDosName return status
”,status );
if (NT_SUCCESS( status ) )
{
DBGPUS( dosName );
ExFreePool( dosName );
}

It blue screen.

-----ÓʼþÔ­¼þ-----
·¢¼þÈË: Prokash Sinha [mailto:xxxxx@garlic.com]
·¢ËÍʱ¼ä: 2004Äê7ÔÂ7ÈÕ 12:03
ÊÕ¼þÈË: Windows File Systems Devs Interest List
Ö÷Ìâ: RE:
[ntfsd] How to get driver letter from \Device\HarddiskVolume1

IoVolumeDeviceToDosName().

-pro

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of cnmmd
Sent: Tuesday, July 06, 2004 6:45 PM
To: Windows File Systems Devs Interest List
Subject: [Norton AntiSpam] [ntfsd] How to get driver letter from
\Device\HarddiskVolume1

A F.S. filter driver,In the IRP_CREATE routine,the file path is such as
\Device\HarddiskVolumeX\xxxx
How to translate it to C:\xxxx?


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

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


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: xxxxx@viatech.com.cn
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

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

If I could recall, you are right there, it works…

But make sure U visit the code example Neal mentioned. I did it following
the examples, and it works. In case you dont get it until monday, at least
flush the message on sunday (USA time). Then one of us would be able to
flush the code you need :).

Yes it is a bad idea to depend on drive letter, but then …

-pro

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of A.Ilamparithi
Sent: Saturday, July 10, 2004 8:05 PM
To: Windows File Systems Devs Interest List
Subject: Re: ??: [ntfsd] How to get driver letter from
\Device\HarddiskVolume1

Hi,

Is it is correct if i get the pointer to the caller??s stack location ( by
using IoGetCurrentIrpStackLocation) and using that device object of caller’s
stack, can i call the RtlVolumeDeviceToDosName to get the drive Name?

With Regards,
A.Ilamparithi

“Neal Christiansen” wrote in message
news:xxxxx@ntfsd…
This API blue screens if you send it a “file system stack” device object.
You must send it a “storage stack” device object.

You can get this by calling “IoGetDiskDeviceObject()” which will give you
the storage stack device object given a file system stack device object.
This object is returned referenced so be sure and call ObReleaseObject()
when you are done querying the driver letter.

Unfortunately this API does not exist on W2K. To work around this you would
have to load your filter at boot time and save the storage stack device
object in your device object extension as the volumes mount. Note that both
the sfilter and filespy samples in the IFSKit show you how to save the
storage stack device object when a volume mounts.

Note that an appropriate bug has been filed to get the documentation updated
for this API.

Neal Christiansen
Microsoft File System Filter Group Lead
This posting is provided “AS IS” with no warranties, and confers no rights.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Brilly Wu (HangZhou)
Sent: Tuesday, July 06, 2004 10:01 PM
To: Windows File Systems Devs Interest List
Subject: [ntfsd] ??: [ntfsd] How to get driver letter from
\Device\HarddiskVolume1

But how to use it?
status = IoVolumeDeviceToDosName(
irpSp->FileObject->DeviceObject,dosName);
DBGD1( “IoVolumeDeviceToDosName return status
”,status );
if (NT_SUCCESS( status ) )
{
DBGPUS( dosName );
ExFreePool( dosName );
}

It blue screen.

-----?ʼ?ԭ??-----
???: Prokash Sinha [mailto:xxxxx@garlic.com]
???ʱ??: 2004??7??7?? 12:03
?ռ???: Windows File Systems Devs Interest List
???: RE:
[ntfsd] How to get driver letter from \Device\HarddiskVolume1

IoVolumeDeviceToDosName().

-pro

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of cnmmd
Sent: Tuesday, July 06, 2004 6:45 PM
To: Windows File Systems Devs Interest List
Subject: [Norton AntiSpam] [ntfsd] How to get driver letter from
\Device\HarddiskVolume1

A F.S. filter driver,In the IRP_CREATE routine,the file path is such as
\Device\HarddiskVolumeX\xxxx
How to translate it to C:\xxxx?


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

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


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: xxxxx@viatech.com.cn
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

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


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

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

Hi,

DBGSTATIC
NTSTATUS
SfCreate(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp
)
{
.
.
.

/////////////////////////////////////
PDEVICE_EXTENSION deviceExtension;
PUNICODE_STRING DriveName;
NTSTATUS Status;

deviceExtension = DeviceObject->DeviceExtension;

status=RtlVolumeDeviceToDosName(deviceExtension->FileSystemDeviceObject,&Dri
veName);
if (NT_SUCCESS( status ))
{
DbgPrint(“Success”);
DbgPrint(“Drive Name is %S”,DriveName->Buffer);

}
else
{
DbgPrint(“Failure”);
}
/////////////////////////
.
.
.
.

}

This code results in blue screen!?!?!?!

Can anyone find what went wrong here?

With Thanks & Regards,
A.Ilamparithi.

“Neal Christiansen” wrote in message
news:xxxxx@ntfsd…
This API blue screens if you send it a “file system stack” device object.
You must send it a “storage stack” device object.

You can get this by calling “IoGetDiskDeviceObject()” which will give you
the storage stack device object given a file system stack device object.
This object is returned referenced so be sure and call ObReleaseObject()
when you are done querying the driver letter.

Unfortunately this API does not exist on W2K. To work around this you would
have to load your filter at boot time and save the storage stack device
object in your device object extension as the volumes mount. Note that both
the sfilter and filespy samples in the IFSKit show you how to save the
storage stack device object when a volume mounts.

Note that an appropriate bug has been filed to get the documentation updated
for this API.

Neal Christiansen
Microsoft File System Filter Group Lead
This posting is provided “AS IS” with no warranties, and confers no rights.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Brilly Wu (HangZhou)
Sent: Tuesday, July 06, 2004 10:01 PM
To: Windows File Systems Devs Interest List
Subject: [ntfsd] ??: [ntfsd] How to get driver letter from
\Device\HarddiskVolume1

But how to use it?
status = IoVolumeDeviceToDosName(
irpSp->FileObject->DeviceObject,dosName);
DBGD1( “IoVolumeDeviceToDosName return status
”,status );
if (NT_SUCCESS( status ) )
{
DBGPUS( dosName );
ExFreePool( dosName );
}

It blue screen.

-----ÓʼþÔ­¼þ-----
·¢¼þÈË: Prokash Sinha [mailto:xxxxx@garlic.com]
·¢ËÍʱ¼ä: 2004Äê7ÔÂ7ÈÕ 12:03
ÊÕ¼þÈË: Windows File Systems Devs Interest List
Ö÷Ìâ: RE: [ntfsd] How to get driver letter from \Device\HarddiskVolume1

IoVolumeDeviceToDosName().

-pro

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of cnmmd
Sent: Tuesday, July 06, 2004 6:45 PM
To: Windows File Systems Devs Interest List
Subject: [Norton AntiSpam] [ntfsd] How to get driver letter from
\Device\HarddiskVolume1

A F.S. filter driver,In the IRP_CREATE routine,the file path is such as
\Device\HarddiskVolumeX\xxxx
How to translate it to C:\xxxx?


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

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


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: xxxxx@viatech.com.cn
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the IFS FAQ at https://www.osronline.com/article.cfm?id=17

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

Hi,

I tried by using the deivce object from the caller’s stack, but i also
results in BLUE SCREEN !

:frowning:

With Thanks & Regards,
A.Ilamparithi.

“Prokash Sinha” wrote in message news:xxxxx@ntfsd…
If I could recall, you are right there, it works…

But make sure U visit the code example Neal mentioned. I did it following
the examples, and it works. In case you dont get it until monday, at least
flush the message on sunday (USA time). Then one of us would be able to
flush the code you need :).

Yes it is a bad idea to depend on drive letter, but then …

-pro

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of A.Ilamparithi
Sent: Saturday, July 10, 2004 8:05 PM
To: Windows File Systems Devs Interest List
Subject: Re: ??: [ntfsd] How to get driver letter from
\Device\HarddiskVolume1

Hi,

Is it is correct if i get the pointer to the caller¡¯s stack location ( by
using IoGetCurrentIrpStackLocation) and using that device object of caller’s
stack, can i call the RtlVolumeDeviceToDosName to get the drive Name?

With Regards,
A.Ilamparithi

“Neal Christiansen” wrote in message
news:xxxxx@ntfsd…
This API blue screens if you send it a “file system stack” device object.
You must send it a “storage stack” device object.

You can get this by calling “IoGetDiskDeviceObject()” which will give you
the storage stack device object given a file system stack device object.
This object is returned referenced so be sure and call ObReleaseObject()
when you are done querying the driver letter.

Unfortunately this API does not exist on W2K. To work around this you would
have to load your filter at boot time and save the storage stack device
object in your device object extension as the volumes mount. Note that both
the sfilter and filespy samples in the IFSKit show you how to save the
storage stack device object when a volume mounts.

Note that an appropriate bug has been filed to get the documentation updated
for this API.

Neal Christiansen
Microsoft File System Filter Group Lead
This posting is provided “AS IS” with no warranties, and confers no rights.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Brilly Wu (HangZhou)
Sent: Tuesday, July 06, 2004 10:01 PM
To: Windows File Systems Devs Interest List
Subject: [ntfsd] ??: [ntfsd] How to get driver letter from
\Device\HarddiskVolume1

But how to use it?
status = IoVolumeDeviceToDosName(
irpSp->FileObject->DeviceObject,dosName);
DBGD1( “IoVolumeDeviceToDosName return status
”,status );
if (NT_SUCCESS( status ) )
{
DBGPUS( dosName );
ExFreePool( dosName );
}

It blue screen.

-----ÓʼþÔ­¼þ-----
·¢¼þÈË: Prokash Sinha [mailto:xxxxx@garlic.com]
·¢ËÍʱ¼ä: 2004Äê7ÔÂ7ÈÕ 12:03
ÊÕ¼þÈË: Windows File Systems Devs Interest List
Ö÷Ìâ: RE:
[ntfsd] How to get driver letter from \Device\HarddiskVolume1

IoVolumeDeviceToDosName().

-pro

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of cnmmd
Sent: Tuesday, July 06, 2004 6:45 PM
To: Windows File Systems Devs Interest List
Subject: [Norton AntiSpam] [ntfsd] How to get driver letter from
\Device\HarddiskVolume1

A F.S. filter driver,In the IRP_CREATE routine,the file path is such as
\Device\HarddiskVolumeX\xxxx
How to translate it to C:\xxxx?


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

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


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: xxxxx@viatech.com.cn
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

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


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

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

But instead of IoGetDiskDeviceObject() iam using RtlVolumeDeviceToDosName(),
as iam using Windows 2000.

A.Ilamparithi.

“A.Ilamparithi” wrote in message news:xxxxx@ntfsd…
> Hi,
>
> I tried by using the deivce object from the caller’s stack, but i also
> results in BLUE SCREEN !
>
> :frowning:
>
> With Thanks & Regards,
> A.Ilamparithi.
>
> “Prokash Sinha” wrote in message news:xxxxx@ntfsd…
> If I could recall, you are right there, it works…
>
> But make sure U visit the code example Neal mentioned. I did it following
> the examples, and it works. In case you dont get it until monday, at least
> flush the message on sunday (USA time). Then one of us would be able to
> flush the code you need :).
>
> Yes it is a bad idea to depend on drive letter, but then …
>
> -pro
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com]On Behalf Of A.Ilamparithi
> Sent: Saturday, July 10, 2004 8:05 PM
> To: Windows File Systems Devs Interest List
> Subject: Re: ??: [ntfsd] How to get driver letter from
> \Device\HarddiskVolume1
>
>
> Hi,
>
> Is it is correct if i get the pointer to the caller¡¯s stack location ( by
> using IoGetCurrentIrpStackLocation) and using that device object of
caller’s
> stack, can i call the RtlVolumeDeviceToDosName to get the drive Name?
>
> With Regards,
> A.Ilamparithi
>
>
> “Neal Christiansen” wrote in message
> news:xxxxx@ntfsd…
> This API blue screens if you send it a “file system stack” device object.
> You must send it a “storage stack” device object.
>
> You can get this by calling “IoGetDiskDeviceObject()” which will give you
> the storage stack device object given a file system stack device object.
> This object is returned referenced so be sure and call ObReleaseObject()
> when you are done querying the driver letter.
>
> Unfortunately this API does not exist on W2K. To work around this you
would
> have to load your filter at boot time and save the storage stack device
> object in your device object extension as the volumes mount. Note that
both
> the sfilter and filespy samples in the IFSKit show you how to save the
> storage stack device object when a volume mounts.
>
> Note that an appropriate bug has been filed to get the documentation
updated
> for this API.
>
> Neal Christiansen
> Microsoft File System Filter Group Lead
> This posting is provided “AS IS” with no warranties, and confers no
rights.
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of Brilly Wu
(HangZhou)
> Sent: Tuesday, July 06, 2004 10:01 PM
> To: Windows File Systems Devs Interest List
> Subject: [ntfsd] ??: [ntfsd] How to get driver letter from
> \Device\HarddiskVolume1
>
> But how to use it?
> status = IoVolumeDeviceToDosName(
> irpSp->FileObject->DeviceObject,dosName);
> DBGD1( "IoVolumeDeviceToDosName return status
> ",status );
> if (NT_SUCCESS( status ) )
> {
> DBGPUS( dosName );
> ExFreePool( dosName );
> }
>
> It blue screen.
>
> -----ÓʼþÔ­¼þ-----
> ·¢¼þÈË: Prokash Sinha [mailto:xxxxx@garlic.com]
> ·¢ËÍʱ¼ä: 2004Äê7ÔÂ7ÈÕ 12:03
> ÊÕ¼þÈË: Windows File Systems Devs Interest List
> Ö÷Ìâ: RE:
> [ntfsd] How to get driver letter from \Device\HarddiskVolume1
>
> IoVolumeDeviceToDosName().
>
> -pro
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com]On Behalf Of cnmmd
> Sent: Tuesday, July 06, 2004 6:45 PM
> To: Windows File Systems Devs Interest List
> Subject: [Norton AntiSpam] [ntfsd] How to get driver letter from
> \Device\HarddiskVolume1
>
>
> A F.S. filter driver,In the IRP_CREATE routine,the file path is such as
> \Device\HarddiskVolumeX\xxxx
> How to translate it to C:\xxxx?
>
>
>
> —
> Questions? First check the IFS FAQ at
> https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to ntfsd as: xxxxx@garlic.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
>
> —
> Questions? First check the IFS FAQ at
> https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to ntfsd as: xxxxx@viatech.com.cn
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
> —
> Questions? First check the IFS FAQ at
> https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to ntfsd as: xxxxx@windows.microsoft.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
>
>
> —
> Questions? First check the IFS FAQ at
> https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to ntfsd as: xxxxx@garlic.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
>
>
>
>
>

>>>>> TRY THE FOLLOWING IT WORKS ON XP THAT I KNOW, IT SHOULD WORK ON
W2K, IT WAS A PRTOTYPE CODE, AND THERE ARE OTHER WAYS TO DO USING VPB, AND
REAL OBJECT THAT I DONT REMEMBER OFF HAND <<<<<

//
// Damage starts here
//
NTSTATUS getDriveLetter(IN PVOID pVolObj, OUT PUNICODE_STRING pUcDospath)
{
NTSTATUS Status = STATUS_SUCCESS;
ULONG unDbg = 0;

//if (!unDbg) return Status;

if (!pVolObj || ! pUcDospath )
return Status;

#if WINVER >= 0x0501
//xp+
Status = IoVolumeDeviceToDosName(pVolObj, pUcDospath);

#else
//2k
Status = RtlVolumeDeviceToDosName(pVolObj, pUcDospath);

#endif

return Status;
}

Following block goes to your Create Dispatch routine

{
UNICODE_STRING pUcDospath = {0};
PIO_STACK_LOCATION irpSp;
//PUNICODE_STRING name;

//
// Get current IRP stack
//
irpSp = IoGetCurrentIrpStackLocation( Irp );
getDriveLetter(irpSp->FileObject->DeviceObject, &pUcDospath);
if(pUcDospath.Buffer){
SF_LOG_PRINT( SFDEBUG_DISPLAY_CREATE_NAMES,
(“SFilter!SfCreate: %wZ \n”, &pUcDospath) );
ExFreePool( pUcDospath.Buffer );
}

SfDisplayCreateFileName( Irp );

}

//
// Damage ends
//

-pro

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of A.Ilamparithi
Sent: Saturday, July 10, 2004 8:31 PM
To: Windows File Systems Devs Interest List
Subject: Re: ??: [ntfsd] How to get driver letter from
\Device\HarddiskVolume1

Hi,

DBGSTATIC
NTSTATUS
SfCreate(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp
)
{
.
.
.

/////////////////////////////////////
PDEVICE_EXTENSION deviceExtension;
PUNICODE_STRING DriveName;
NTSTATUS Status;

deviceExtension = DeviceObject->DeviceExtension;

status=RtlVolumeDeviceToDosName(deviceExtension->FileSystemDeviceObject,&Dri
veName);
if (NT_SUCCESS( status ))
{
DbgPrint(“Success”);
DbgPrint(“Drive Name is %S”,DriveName->Buffer);

}
else
{
DbgPrint(“Failure”);
}
/////////////////////////
.
.
.
.

}

This code results in blue screen!?!?!?!

Can anyone find what went wrong here?

With Thanks & Regards,
A.Ilamparithi.

“Neal Christiansen” wrote in message
news:xxxxx@ntfsd…
This API blue screens if you send it a “file system stack” device object.
You must send it a “storage stack” device object.

You can get this by calling “IoGetDiskDeviceObject()” which will give you
the storage stack device object given a file system stack device object.
This object is returned referenced so be sure and call ObReleaseObject()
when you are done querying the driver letter.

Unfortunately this API does not exist on W2K. To work around this you would
have to load your filter at boot time and save the storage stack device
object in your device object extension as the volumes mount. Note that both
the sfilter and filespy samples in the IFSKit show you how to save the
storage stack device object when a volume mounts.

Note that an appropriate bug has been filed to get the documentation updated
for this API.

Neal Christiansen
Microsoft File System Filter Group Lead
This posting is provided “AS IS” with no warranties, and confers no rights.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Brilly Wu (HangZhou)
Sent: Tuesday, July 06, 2004 10:01 PM
To: Windows File Systems Devs Interest List
Subject: [ntfsd] ??: [ntfsd] How to get driver letter from
\Device\HarddiskVolume1

But how to use it?
status = IoVolumeDeviceToDosName(
irpSp->FileObject->DeviceObject,dosName);
DBGD1( “IoVolumeDeviceToDosName return status
”,status );
if (NT_SUCCESS( status ) )
{
DBGPUS( dosName );
ExFreePool( dosName );
}

It blue screen.

-----?ʼ?ԭ??-----
???: Prokash Sinha [mailto:xxxxx@garlic.com]
???ʱ??: 2004??7??7?? 12:03
?ռ???: Windows File Systems Devs Interest List
???: RE: [ntfsd] How to get driver letter from \Device\HarddiskVolume1

IoVolumeDeviceToDosName().

-pro

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of cnmmd
Sent: Tuesday, July 06, 2004 6:45 PM
To: Windows File Systems Devs Interest List
Subject: [Norton AntiSpam] [ntfsd] How to get driver letter from
\Device\HarddiskVolume1

A F.S. filter driver,In the IRP_CREATE routine,the file path is such as
\Device\HarddiskVolumeX\xxxx
How to translate it to C:\xxxx?


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

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


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: xxxxx@viatech.com.cn
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

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


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

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

One thing I noticed, DriverName is PUNICODE, and you are passing the address
of it, so it is PPUNICODE.

Also as per doc the VolObject is created by the disk class driver, that is
what it wants as arg and it should be
of the form of your subject line…

Ouch, it hurts to try randomly :-).

-pro

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of A.Ilamparithi
Sent: Saturday, July 10, 2004 8:31 PM
To: Windows File Systems Devs Interest List
Subject: Re: ??: [ntfsd] How to get driver letter from
\Device\HarddiskVolume1

Hi,

DBGSTATIC
NTSTATUS
SfCreate(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp
)
{
.
.
.

/////////////////////////////////////
PDEVICE_EXTENSION deviceExtension;
PUNICODE_STRING DriveName;
NTSTATUS Status;

deviceExtension = DeviceObject->DeviceExtension;

status=RtlVolumeDeviceToDosName(deviceExtension->FileSystemDeviceObject,&Dri
veName);
if (NT_SUCCESS( status ))
{
DbgPrint(“Success”);
DbgPrint(“Drive Name is %S”,DriveName->Buffer);

}
else
{
DbgPrint(“Failure”);
}
/////////////////////////
.
.
.
.

}

This code results in blue screen!?!?!?!

Can anyone find what went wrong here?

With Thanks & Regards,
A.Ilamparithi.

“Neal Christiansen” wrote in message
news:xxxxx@ntfsd…
This API blue screens if you send it a “file system stack” device object.
You must send it a “storage stack” device object.

You can get this by calling “IoGetDiskDeviceObject()” which will give you
the storage stack device object given a file system stack device object.
This object is returned referenced so be sure and call ObReleaseObject()
when you are done querying the driver letter.

Unfortunately this API does not exist on W2K. To work around this you would
have to load your filter at boot time and save the storage stack device
object in your device object extension as the volumes mount. Note that both
the sfilter and filespy samples in the IFSKit show you how to save the
storage stack device object when a volume mounts.

Note that an appropriate bug has been filed to get the documentation updated
for this API.

Neal Christiansen
Microsoft File System Filter Group Lead
This posting is provided “AS IS” with no warranties, and confers no rights.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Brilly Wu (HangZhou)
Sent: Tuesday, July 06, 2004 10:01 PM
To: Windows File Systems Devs Interest List
Subject: [ntfsd] ??: [ntfsd] How to get driver letter from
\Device\HarddiskVolume1

But how to use it?
status = IoVolumeDeviceToDosName(
irpSp->FileObject->DeviceObject,dosName);
DBGD1( “IoVolumeDeviceToDosName return status
”,status );
if (NT_SUCCESS( status ) )
{
DBGPUS( dosName );
ExFreePool( dosName );
}

It blue screen.

-----?ʼ?ԭ??-----
???: Prokash Sinha [mailto:xxxxx@garlic.com]
???ʱ??: 2004??7??7?? 12:03
?ռ???: Windows File Systems Devs Interest List
???: RE: [ntfsd] How to get driver letter from \Device\HarddiskVolume1

IoVolumeDeviceToDosName().

-pro

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of cnmmd
Sent: Tuesday, July 06, 2004 6:45 PM
To: Windows File Systems Devs Interest List
Subject: [Norton AntiSpam] [ntfsd] How to get driver letter from
\Device\HarddiskVolume1

A F.S. filter driver,In the IRP_CREATE routine,the file path is such as
\Device\HarddiskVolumeX\xxxx
How to translate it to C:\xxxx?


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

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


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: xxxxx@viatech.com.cn
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

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


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

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

No. You need a disk stack’s device object. Use FileObject->DeviceObject for
this.

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

----- Original Message -----
From: “A.Ilamparithi”
Newsgroups: ntfsd
To: “Windows File Systems Devs Interest List”
Sent: Sunday, July 11, 2004 7:04 AM
Subject: Re: ??: [ntfsd] How to get driver letter from \Device\HarddiskVolume1

> Hi,
>
> Is it is correct if i get the pointer to the caller??s stack location ( by
> using IoGetCurrentIrpStackLocation) and using that device object of caller’s
> stack, can i call the RtlVolumeDeviceToDosName to get the drive Name?
>
> With Regards,
> A.Ilamparithi
>
>
> “Neal Christiansen” wrote in message
> news:xxxxx@ntfsd…
> This API blue screens if you send it a “file system stack” device object.
> You must send it a “storage stack” device object.
>
> You can get this by calling “IoGetDiskDeviceObject()” which will give you
> the storage stack device object given a file system stack device object.
> This object is returned referenced so be sure and call ObReleaseObject()
> when you are done querying the driver letter.
>
> Unfortunately this API does not exist on W2K. To work around this you would
> have to load your filter at boot time and save the storage stack device
> object in your device object extension as the volumes mount. Note that both
> the sfilter and filespy samples in the IFSKit show you how to save the
> storage stack device object when a volume mounts.
>
> Note that an appropriate bug has been filed to get the documentation updated
> for this API.
>
> Neal Christiansen
> Microsoft File System Filter Group Lead
> This posting is provided “AS IS” with no warranties, and confers no rights.
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of Brilly Wu (HangZhou)
> Sent: Tuesday, July 06, 2004 10:01 PM
> To: Windows File Systems Devs Interest List
> Subject: [ntfsd] ??: [ntfsd] How to get driver letter from
> \Device\HarddiskVolume1
>
> But how to use it?
> status = IoVolumeDeviceToDosName(
> irpSp->FileObject->DeviceObject,dosName);
> DBGD1( "IoVolumeDeviceToDosName return status
> ",status );
> if (NT_SUCCESS( status ) )
> {
> DBGPUS( dosName );
> ExFreePool( dosName );
> }
>
> It blue screen.
>
> -----?ʼ?ԭ??-----
> ???: Prokash Sinha [mailto:xxxxx@garlic.com]
> ???ʱ??: 2004??7??7?? 12:03
> ?ռ???: Windows File Systems Devs Interest List
> ???: RE:
> [ntfsd] How to get driver letter from \Device\HarddiskVolume1
>
> IoVolumeDeviceToDosName().
>
> -pro
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com]On Behalf Of cnmmd
> Sent: Tuesday, July 06, 2004 6:45 PM
> To: Windows File Systems Devs Interest List
> Subject: [Norton AntiSpam] [ntfsd] How to get driver letter from
> \Device\HarddiskVolume1
>
>
> A F.S. filter driver,In the IRP_CREATE routine,the file path is such as
> \Device\HarddiskVolumeX\xxxx
> How to translate it to C:\xxxx?
>
>
>
> —
> Questions? First check the IFS FAQ at
> https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to ntfsd as: xxxxx@garlic.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
>
> —
> Questions? First check the IFS FAQ at
> https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to ntfsd as: xxxxx@viatech.com.cn
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
> —
> Questions? First check the IFS FAQ at
> https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to ntfsd as: xxxxx@windows.microsoft.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
>
>
> —
> Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com

Hi,

I tried this code.

It results in a blue screen with the message.

STOP 0x00000023 (0x000e00a7,…,…,…)

FAT_FILE_SYSTEM

With Thanks & Regards,
A.Ilamparithi.

“Prokash Sinha” wrote in message news:xxxxx@ntfsd…

>>>>> TRY THE FOLLOWING IT WORKS ON XP THAT I KNOW, IT SHOULD WORK ON
W2K, IT WAS A PRTOTYPE CODE, AND THERE ARE OTHER WAYS TO DO USING VPB, AND
REAL OBJECT THAT I DONT REMEMBER OFF HAND <<<<<

//
// Damage starts here
//
NTSTATUS getDriveLetter(IN PVOID pVolObj, OUT PUNICODE_STRING pUcDospath)
{
NTSTATUS Status = STATUS_SUCCESS;
ULONG unDbg = 0;

file://if (!unDbg) return Status;

if (!pVolObj || ! pUcDospath )
return Status;

#if WINVER >= 0x0501
file://xp+
Status = IoVolumeDeviceToDosName(pVolObj, pUcDospath);

#else
file://2k
Status = RtlVolumeDeviceToDosName(pVolObj, pUcDospath);

#endif

return Status;
}

Following block goes to your Create Dispatch routine

{
UNICODE_STRING pUcDospath = {0};
PIO_STACK_LOCATION irpSp;
file://PUNICODE_STRING name;

//
// Get current IRP stack
//
irpSp = IoGetCurrentIrpStackLocation( Irp );
getDriveLetter(irpSp->FileObject->DeviceObject, &pUcDospath);
if(pUcDospath.Buffer){
SF_LOG_PRINT( SFDEBUG_DISPLAY_CREATE_NAMES,
(“SFilter!SfCreate: %wZ \n”, &pUcDospath) );
ExFreePool( pUcDospath.Buffer );
}

SfDisplayCreateFileName( Irp );

}

//
// Damage ends
//

-pro

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of A.Ilamparithi
Sent: Saturday, July 10, 2004 8:31 PM
To: Windows File Systems Devs Interest List
Subject: Re: ??: [ntfsd] How to get driver letter from
\Device\HarddiskVolume1

Hi,

DBGSTATIC
NTSTATUS
SfCreate(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp
)
{
.
.
.

/////////////////////////////////////
PDEVICE_EXTENSION deviceExtension;
PUNICODE_STRING DriveName;
NTSTATUS Status;

deviceExtension = DeviceObject->DeviceExtension;

status=RtlVolumeDeviceToDosName(deviceExtension->FileSystemDeviceObject,&Dri
veName);
if (NT_SUCCESS( status ))
{
DbgPrint(“Success”);
DbgPrint(“Drive Name is %S”,DriveName->Buffer);

}
else
{
DbgPrint(“Failure”);
}
/////////////////////////
.
.
.
.

}

This code results in blue screen!?!?!?!

Can anyone find what went wrong here?

With Thanks & Regards,
A.Ilamparithi.

“Neal Christiansen” wrote in message
news:xxxxx@ntfsd…
This API blue screens if you send it a “file system stack” device object.
You must send it a “storage stack” device object.

You can get this by calling “IoGetDiskDeviceObject()” which will give you
the storage stack device object given a file system stack device object.
This object is returned referenced so be sure and call ObReleaseObject()
when you are done querying the driver letter.

Unfortunately this API does not exist on W2K. To work around this you would
have to load your filter at boot time and save the storage stack device
object in your device object extension as the volumes mount. Note that both
the sfilter and filespy samples in the IFSKit show you how to save the
storage stack device object when a volume mounts.

Note that an appropriate bug has been filed to get the documentation updated
for this API.

Neal Christiansen
Microsoft File System Filter Group Lead
This posting is provided “AS IS” with no warranties, and confers no rights.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Brilly Wu (HangZhou)
Sent: Tuesday, July 06, 2004 10:01 PM
To: Windows File Systems Devs Interest List
Subject: [ntfsd] ??: [ntfsd] How to get driver letter from
\Device\HarddiskVolume1

But how to use it?
status = IoVolumeDeviceToDosName(
irpSp->FileObject->DeviceObject,dosName);
DBGD1( “IoVolumeDeviceToDosName return status
”,status );
if (NT_SUCCESS( status ) )
{
DBGPUS( dosName );
ExFreePool( dosName );
}

It blue screen.

-----ÓʼþÔ­¼þ-----
·¢¼þÈË: Prokash Sinha [mailto:xxxxx@garlic.com]
·¢ËÍʱ¼ä: 2004Äê7ÔÂ7ÈÕ 12:03
ÊÕ¼þÈË: Windows File Systems Devs Interest List
Ö÷Ìâ: RE: [ntfsd] How to get driver letter from \Device\HarddiskVolume1

IoVolumeDeviceToDosName().

-pro

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of cnmmd
Sent: Tuesday, July 06, 2004 6:45 PM
To: Windows File Systems Devs Interest List
Subject: [Norton AntiSpam] [ntfsd] How to get driver letter from
\Device\HarddiskVolume1

A F.S. filter driver,In the IRP_CREATE routine,the file path is such as
\Device\HarddiskVolumeX\xxxx
How to translate it to C:\xxxx?


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

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


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: xxxxx@viatech.com.cn
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

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


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

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

Has it got to something wih FAT filesystem??

Iam using win 2000 with FAT.

Thanks & Regards,
A.Ilamparithi

“A.Ilamparithi” wrote in message news:xxxxx@ntfsd…
> Hi,
>
> I tried this code.
>
> It results in a blue screen with the message.
>
> STOP 0x00000023 (0x000e00a7,…,…,…)
>
> FAT_FILE_SYSTEM
>
> With Thanks & Regards,
> A.Ilamparithi.
>
>
>
>
>
> “Prokash Sinha” wrote in message news:xxxxx@ntfsd…
>
> >>>>> TRY THE FOLLOWING IT WORKS ON XP THAT I KNOW, IT SHOULD WORK ON
> W2K, IT WAS A PRTOTYPE CODE, AND THERE ARE OTHER WAYS TO DO USING VPB, AND
> REAL OBJECT THAT I DONT REMEMBER OFF HAND <<<<<
>
> //
> // Damage starts here
> //
> NTSTATUS getDriveLetter(IN PVOID pVolObj, OUT PUNICODE_STRING pUcDospath)
> {
> NTSTATUS Status = STATUS_SUCCESS;
> ULONG unDbg = 0;
>
> file://if (!unDbg) return Status;
>
> if (!pVolObj || ! pUcDospath )
> return Status;
>
> #if WINVER >= 0x0501
> file://xp+
> Status = IoVolumeDeviceToDosName(pVolObj, pUcDospath);
>
>
> #else
> file://2k
> Status = RtlVolumeDeviceToDosName(pVolObj, pUcDospath);
>
> #endif
>
> return Status;
> }
>
> Following block goes to your Create Dispatch routine
>
> {
> UNICODE_STRING pUcDospath = {0};
> PIO_STACK_LOCATION irpSp;
> file://PUNICODE_STRING name;
>
> //
> // Get current IRP stack
> //
> irpSp = IoGetCurrentIrpStackLocation( Irp );
> getDriveLetter(irpSp->FileObject->DeviceObject, &pUcDospath);
> if(pUcDospath.Buffer){
> SF_LOG_PRINT( SFDEBUG_DISPLAY_CREATE_NAMES,
> (“SFilter!SfCreate: %wZ \n”, &pUcDospath) );
> ExFreePool( pUcDospath.Buffer );
> }
>
> SfDisplayCreateFileName( Irp );
>
>
>
>
> }
>
> //
> // Damage ends
> //
>
> -pro
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com]On Behalf Of A.Ilamparithi
> Sent: Saturday, July 10, 2004 8:31 PM
> To: Windows File Systems Devs Interest List
> Subject: Re: ??: [ntfsd] How to get driver letter from
> \Device\HarddiskVolume1
>
>
> Hi,
>
> DBGSTATIC
> NTSTATUS
> SfCreate(
> IN PDEVICE_OBJECT DeviceObject,
> IN PIRP Irp
> )
> {
> .
> .
> .
>
> /////////////////////////////////////
> PDEVICE_EXTENSION deviceExtension;
> PUNICODE_STRING DriveName;
> NTSTATUS Status;
>
> deviceExtension = DeviceObject->DeviceExtension;
>
>
status=RtlVolumeDeviceToDosName(deviceExtension->FileSystemDeviceObject,&Dri
> veName);
> if (NT_SUCCESS( status ))
> {
> DbgPrint(“Success”);
> DbgPrint(“Drive Name is %S”,DriveName->Buffer);
>
> }
> else
> {
> DbgPrint(“Failure”);
> }
> /////////////////////////
> .
> .
> .
> .
>
> }
>
> This code results in blue screen!?!?!?!
>
> Can anyone find what went wrong here?
>
> With Thanks & Regards,
> A.Ilamparithi.
>
>
> “Neal Christiansen” wrote in message
> news:xxxxx@ntfsd…
> This API blue screens if you send it a “file system stack” device object.
> You must send it a “storage stack” device object.
>
> You can get this by calling “IoGetDiskDeviceObject()” which will give you
> the storage stack device object given a file system stack device object.
> This object is returned referenced so be sure and call ObReleaseObject()
> when you are done querying the driver letter.
>
> Unfortunately this API does not exist on W2K. To work around this you
would
> have to load your filter at boot time and save the storage stack device
> object in your device object extension as the volumes mount. Note that
both
> the sfilter and filespy samples in the IFSKit show you how to save the
> storage stack device object when a volume mounts.
>
> Note that an appropriate bug has been filed to get the documentation
updated
> for this API.
>
> Neal Christiansen
> Microsoft File System Filter Group Lead
> This posting is provided “AS IS” with no warranties, and confers no
rights.
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of Brilly Wu
(HangZhou)
> Sent: Tuesday, July 06, 2004 10:01 PM
> To: Windows File Systems Devs Interest List
> Subject: [ntfsd] ??: [ntfsd] How to get driver letter from
> \Device\HarddiskVolume1
>
> But how to use it?
> status = IoVolumeDeviceToDosName(
> irpSp->FileObject->DeviceObject,dosName);
> DBGD1( "IoVolumeDeviceToDosName return status
> ",status );
> if (NT_SUCCESS( status ) )
> {
> DBGPUS( dosName );
> ExFreePool( dosName );
> }
>
> It blue screen.
>
> -----ÓʼþÔ­¼þ-----
> ·¢¼þÈË: Prokash Sinha [mailto:xxxxx@garlic.com]
> ·¢ËÍʱ¼ä: 2004Äê7ÔÂ7ÈÕ 12:03
> ÊÕ¼þÈË: Windows File Systems Devs Interest List
> Ö÷Ìâ: RE: [ntfsd] How to get driver letter from \Device\HarddiskVolume1
>
> IoVolumeDeviceToDosName().
>
> -pro
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com]On Behalf Of cnmmd
> Sent: Tuesday, July 06, 2004 6:45 PM
> To: Windows File Systems Devs Interest List
> Subject: [Norton AntiSpam] [ntfsd] How to get driver letter from
> \Device\HarddiskVolume1
>
>
> A F.S. filter driver,In the IRP_CREATE routine,the file path is such as
> \Device\HarddiskVolumeX\xxxx
> How to translate it to C:\xxxx?
>
>
>
> —
> Questions? First check the IFS FAQ at
> https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to ntfsd as: xxxxx@garlic.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
>
> —
> Questions? First check the IFS FAQ at
> https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to ntfsd as: xxxxx@viatech.com.cn
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
> —
> Questions? First check the IFS FAQ at
> https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to ntfsd as: xxxxx@windows.microsoft.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
>
>
>
> —
> Questions? First check the IFS FAQ at
> https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to ntfsd as: xxxxx@garlic.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
>
>
>
>
>

Status=RtlVolumeDeviceToDosName(current->FileObject->DeviceObject, &DRIVE);

Status=RtlVolumeDeviceToDosName(DeviceObject, &DRIVE);

Status=RtlVolumeDeviceToDosName(deviceextension->DeviceObject, &DRIVE);

All these results in Blue Screen.

?!?!

Regards,
A.Ilamparithi

“A.Ilamparithi” wrote in message news:xxxxx@ntfsd…
> Hi,
>
> I tried this code.
>
> It results in a blue screen with the message.
>
> STOP 0x00000023 (0x000e00a7,…,…,…)
>
> FAT_FILE_SYSTEM
>
> With Thanks & Regards,
> A.Ilamparithi.
>
>
>
>
>
> “Prokash Sinha” wrote in message news:xxxxx@ntfsd…
>
> >>>>> TRY THE FOLLOWING IT WORKS ON XP THAT I KNOW, IT SHOULD WORK ON
> W2K, IT WAS A PRTOTYPE CODE, AND THERE ARE OTHER WAYS TO DO USING VPB, AND
> REAL OBJECT THAT I DONT REMEMBER OFF HAND <<<<<
>
> //
> // Damage starts here
> //
> NTSTATUS getDriveLetter(IN PVOID pVolObj, OUT PUNICODE_STRING pUcDospath)
> {
> NTSTATUS Status = STATUS_SUCCESS;
> ULONG unDbg = 0;
>
> file://if (!unDbg) return Status;
>
> if (!pVolObj || ! pUcDospath )
> return Status;
>
> #if WINVER >= 0x0501
> file://xp+
> Status = IoVolumeDeviceToDosName(pVolObj, pUcDospath);
>
>
> #else
> file://2k
> Status = RtlVolumeDeviceToDosName(pVolObj, pUcDospath);
>
> #endif
>
> return Status;
> }
>
> Following block goes to your Create Dispatch routine
>
> {
> UNICODE_STRING pUcDospath = {0};
> PIO_STACK_LOCATION irpSp;
> file://PUNICODE_STRING name;
>
> //
> // Get current IRP stack
> //
> irpSp = IoGetCurrentIrpStackLocation( Irp );
> getDriveLetter(irpSp->FileObject->DeviceObject, &pUcDospath);
> if(pUcDospath.Buffer){
> SF_LOG_PRINT( SFDEBUG_DISPLAY_CREATE_NAMES,
> (“SFilter!SfCreate: %wZ \n”, &pUcDospath) );
> ExFreePool( pUcDospath.Buffer );
> }
>
> SfDisplayCreateFileName( Irp );
>
>
>
>
> }
>
> //
> // Damage ends
> //
>
> -pro
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com]On Behalf Of A.Ilamparithi
> Sent: Saturday, July 10, 2004 8:31 PM
> To: Windows File Systems Devs Interest List
> Subject: Re: ??: [ntfsd] How to get driver letter from
> \Device\HarddiskVolume1
>
>
> Hi,
>
> DBGSTATIC
> NTSTATUS
> SfCreate(
> IN PDEVICE_OBJECT DeviceObject,
> IN PIRP Irp
> )
> {
> .
> .
> .
>
> /////////////////////////////////////
> PDEVICE_EXTENSION deviceExtension;
> PUNICODE_STRING DriveName;
> NTSTATUS Status;
>
> deviceExtension = DeviceObject->DeviceExtension;
>
>
status=RtlVolumeDeviceToDosName(deviceExtension->FileSystemDeviceObject,&Dri
> veName);
> if (NT_SUCCESS( status ))
> {
> DbgPrint(“Success”);
> DbgPrint(“Drive Name is %S”,DriveName->Buffer);
>
> }
> else
> {
> DbgPrint(“Failure”);
> }
> /////////////////////////
> .
> .
> .
> .
>
> }
>
> This code results in blue screen!?!?!?!
>
> Can anyone find what went wrong here?
>
> With Thanks & Regards,
> A.Ilamparithi.
>
>
> “Neal Christiansen” wrote in message
> news:xxxxx@ntfsd…
> This API blue screens if you send it a “file system stack” device object.
> You must send it a “storage stack” device object.
>
> You can get this by calling “IoGetDiskDeviceObject()” which will give you
> the storage stack device object given a file system stack device object.
> This object is returned referenced so be sure and call ObReleaseObject()
> when you are done querying the driver letter.
>
> Unfortunately this API does not exist on W2K. To work around this you
would
> have to load your filter at boot time and save the storage stack device
> object in your device object extension as the volumes mount. Note that
both
> the sfilter and filespy samples in the IFSKit show you how to save the
> storage stack device object when a volume mounts.
>
> Note that an appropriate bug has been filed to get the documentation
updated
> for this API.
>
> Neal Christiansen
> Microsoft File System Filter Group Lead
> This posting is provided “AS IS” with no warranties, and confers no
rights.
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of Brilly Wu
(HangZhou)
> Sent: Tuesday, July 06, 2004 10:01 PM
> To: Windows File Systems Devs Interest List
> Subject: [ntfsd] ??: [ntfsd] How to get driver letter from
> \Device\HarddiskVolume1
>
> But how to use it?
> status = IoVolumeDeviceToDosName(
> irpSp->FileObject->DeviceObject,dosName);
> DBGD1( "IoVolumeDeviceToDosName return status
> ",status );
> if (NT_SUCCESS( status ) )
> {
> DBGPUS( dosName );
> ExFreePool( dosName );
> }
>
> It blue screen.
>
> -----ÓʼþÔ­¼þ-----
> ·¢¼þÈË: Prokash Sinha [mailto:xxxxx@garlic.com]
> ·¢ËÍʱ¼ä: 2004Äê7ÔÂ7ÈÕ 12:03
> ÊÕ¼þÈË: Windows File Systems Devs Interest List
> Ö÷Ìâ: RE: [ntfsd] How to get driver letter from \Device\HarddiskVolume1
>
> IoVolumeDeviceToDosName().
>
> -pro
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com]On Behalf Of cnmmd
> Sent: Tuesday, July 06, 2004 6:45 PM
> To: Windows File Systems Devs Interest List
> Subject: [Norton AntiSpam] [ntfsd] How to get driver letter from
> \Device\HarddiskVolume1
>
>
> A F.S. filter driver,In the IRP_CREATE routine,the file path is such as
> \Device\HarddiskVolumeX\xxxx
> How to translate it to C:\xxxx?
>
>
>
> —
> Questions? First check the IFS FAQ at
> https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to ntfsd as: xxxxx@garlic.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
>
> —
> Questions? First check the IFS FAQ at
> https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to ntfsd as: xxxxx@viatech.com.cn
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
> —
> Questions? First check the IFS FAQ at
> https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to ntfsd as: xxxxx@windows.microsoft.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
>
>
>
> —
> Questions? First check the IFS FAQ at
> https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to ntfsd as: xxxxx@garlic.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
>
>
>
>
>

Say !analyze -v in WinDbg, it will help a lot.

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

----- Original Message -----
From: “A.Ilamparithi”
Newsgroups: ntfsd
To: “Windows File Systems Devs Interest List”
Sent: Monday, July 12, 2004 4:47 AM
Subject: Re:[ntfsd] ??: How to get driver letter from \Device\HarddiskVolume1

> Has it got to something wih FAT filesystem??
>
> Iam using win 2000 with FAT.
>
> Thanks & Regards,
> A.Ilamparithi
>
> “A.Ilamparithi” wrote in message news:xxxxx@ntfsd…
> > Hi,
> >
> > I tried this code.
> >
> > It results in a blue screen with the message.
> >
> > STOP 0x00000023 (0x000e00a7,…,…,…)
> >
> > FAT_FILE_SYSTEM
> >
> > With Thanks & Regards,
> > A.Ilamparithi.
> >
> >
> >
> >
> >
> > “Prokash Sinha” wrote in message news:xxxxx@ntfsd…
> >
> > >>>>> TRY THE FOLLOWING IT WORKS ON XP THAT I KNOW, IT SHOULD WORK ON
> > W2K, IT WAS A PRTOTYPE CODE, AND THERE ARE OTHER WAYS TO DO USING VPB, AND
> > REAL OBJECT THAT I DONT REMEMBER OFF HAND <<<<<
> >
> > //
> > // Damage starts here
> > //
> > NTSTATUS getDriveLetter(IN PVOID pVolObj, OUT PUNICODE_STRING pUcDospath)
> > {
> > NTSTATUS Status = STATUS_SUCCESS;
> > ULONG unDbg = 0;
> >
> > file://if (!unDbg) return Status;
> >
> > if (!pVolObj || ! pUcDospath )
> > return Status;
> >
> > #if WINVER >= 0x0501
> > file://xp+
> > Status = IoVolumeDeviceToDosName(pVolObj, pUcDospath);
> >
> >
> > #else
> > file://2k
> > Status = RtlVolumeDeviceToDosName(pVolObj, pUcDospath);
> >
> > #endif
> >
> > return Status;
> > }
> >
> > Following block goes to your Create Dispatch routine
> >
> > {
> > UNICODE_STRING pUcDospath = {0};
> > PIO_STACK_LOCATION irpSp;
> > file://PUNICODE_STRING name;
> >
> > //
> > // Get current IRP stack
> > //
> > irpSp = IoGetCurrentIrpStackLocation( Irp );
> > getDriveLetter(irpSp->FileObject->DeviceObject, &pUcDospath);
> > if(pUcDospath.Buffer){
> > SF_LOG_PRINT( SFDEBUG_DISPLAY_CREATE_NAMES,
> > (“SFilter!SfCreate: %wZ \n”, &pUcDospath) );
> > ExFreePool( pUcDospath.Buffer );
> > }
> >
> > SfDisplayCreateFileName( Irp );
> >
> >
> >
> >
> > }
> >
> > //
> > // Damage ends
> > //
> >
> > -pro
> >
> > -----Original Message-----
> > From: xxxxx@lists.osr.com
> > [mailto:xxxxx@lists.osr.com]On Behalf Of A.Ilamparithi
> > Sent: Saturday, July 10, 2004 8:31 PM
> > To: Windows File Systems Devs Interest List
> > Subject: Re: ??: [ntfsd] How to get driver letter from
> > \Device\HarddiskVolume1
> >
> >
> > Hi,
> >
> > DBGSTATIC
> > NTSTATUS
> > SfCreate(
> > IN PDEVICE_OBJECT DeviceObject,
> > IN PIRP Irp
> > )
> > {
> > .
> > .
> > .
> >
> > /////////////////////////////////////
> > PDEVICE_EXTENSION deviceExtension;
> > PUNICODE_STRING DriveName;
> > NTSTATUS Status;
> >
> > deviceExtension = DeviceObject->DeviceExtension;
> >
> >
> status=RtlVolumeDeviceToDosName(deviceExtension->FileSystemDeviceObject,&Dri
> > veName);
> > if (NT_SUCCESS( status ))
> > {
> > DbgPrint(“Success”);
> > DbgPrint(“Drive Name is %S”,DriveName->Buffer);
> >
> > }
> > else
> > {
> > DbgPrint(“Failure”);
> > }
> > /////////////////////////
> > .
> > .
> > .
> > .
> >
> > }
> >
> > This code results in blue screen!?!?!?!
> >
> > Can anyone find what went wrong here?
> >
> > With Thanks & Regards,
> > A.Ilamparithi.
> >
> >
> > “Neal Christiansen” wrote in message
> > news:xxxxx@ntfsd…
> > This API blue screens if you send it a “file system stack” device object.
> > You must send it a “storage stack” device object.
> >
> > You can get this by calling “IoGetDiskDeviceObject()” which will give you
> > the storage stack device object given a file system stack device object.
> > This object is returned referenced so be sure and call ObReleaseObject()
> > when you are done querying the driver letter.
> >
> > Unfortunately this API does not exist on W2K. To work around this you
> would
> > have to load your filter at boot time and save the storage stack device
> > object in your device object extension as the volumes mount. Note that
> both
> > the sfilter and filespy samples in the IFSKit show you how to save the
> > storage stack device object when a volume mounts.
> >
> > Note that an appropriate bug has been filed to get the documentation
> updated
> > for this API.
> >
> > Neal Christiansen
> > Microsoft File System Filter Group Lead
> > This posting is provided “AS IS” with no warranties, and confers no
> rights.
> >
> > -----Original Message-----
> > From: xxxxx@lists.osr.com
> > [mailto:xxxxx@lists.osr.com] On Behalf Of Brilly Wu
> (HangZhou)
> > Sent: Tuesday, July 06, 2004 10:01 PM
> > To: Windows File Systems Devs Interest List
> > Subject: [ntfsd] ??: [ntfsd] How to get driver letter from
> > \Device\HarddiskVolume1
> >
> > But how to use it?
> > status = IoVolumeDeviceToDosName(
> > irpSp->FileObject->DeviceObject,dosName);
> > DBGD1( "IoVolumeDeviceToDosName return status
> > ",status );
> > if (NT_SUCCESS( status ) )
> > {
> > DBGPUS( dosName );
> > ExFreePool( dosName );
> > }
> >
> > It blue screen.
> >
> > -----?ʼ?ԭ??-----
> > ???: Prokash Sinha [mailto:xxxxx@garlic.com]
> > ???ʱ??: 2004??7??7?? 12:03
> > ?ռ???: Windows File Systems Devs Interest List
> > ???: RE: [ntfsd] How to get driver letter from \Device\HarddiskVolume1
> >
> > IoVolumeDeviceToDosName().
> >
> > -pro
> >
> > -----Original Message-----
> > From: xxxxx@lists.osr.com
> > [mailto:xxxxx@lists.osr.com]On Behalf Of cnmmd
> > Sent: Tuesday, July 06, 2004 6:45 PM
> > To: Windows File Systems Devs Interest List
> > Subject: [Norton AntiSpam] [ntfsd] How to get driver letter from
> > \Device\HarddiskVolume1
> >
> >
> > A F.S. filter driver,In the IRP_CREATE routine,the file path is such as
> > \Device\HarddiskVolumeX\xxxx
> > How to translate it to C:\xxxx?
> >
> >
> >
> > —
> > Questions? First check the IFS FAQ at
> > https://www.osronline.com/article.cfm?id=17
> >
> > You are currently subscribed to ntfsd as: xxxxx@garlic.com
> > To unsubscribe send a blank email to xxxxx@lists.osr.com
> >
> >
> >
> > —
> > Questions? First check the IFS FAQ at
> > https://www.osronline.com/article.cfm?id=17
> >
> > You are currently subscribed to ntfsd as: xxxxx@viatech.com.cn
> > To unsubscribe send a blank email to xxxxx@lists.osr.com
> >
> > —
> > Questions? First check the IFS FAQ at
> > https://www.osronline.com/article.cfm?id=17
> >
> > You are currently subscribed to ntfsd as: xxxxx@windows.microsoft.com
> > To unsubscribe send a blank email to xxxxx@lists.osr.com
> >
> >
> >
> >
> >
> > —
> > Questions? First check the IFS FAQ at
> > https://www.osronline.com/article.cfm?id=17
> >
> > You are currently subscribed to ntfsd as: xxxxx@garlic.com
> > To unsubscribe send a blank email to xxxxx@lists.osr.com
> >
> >
> >
> >
> >
> >
> >
>
>
>
> —
> Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com