IoVolumeDeviceToDosName returns STATUS_INVALID_DEVICE_REQUEST

Hello,
I wrote a FileSystem Filter driver with two binaries…one for Win2K another
for Win2K3. Thanks for previously helping me figure out that I can’t build
a Win2K3 driver on a Win2K system.

I make the call in IRP_MJ_CREATE. In Win2K I call
RtlVolumeDeviceToDosName( ), and it works like a charm. I call the
IoVolumeDeviceToDosName( ) in the Win2K3 driver, and I get the error
‘STATUS_INVALID_DEVICE_REQUEST ((NTSTATUS)0xC0000010L)’
What am I missing?

Win2K works.
status = RtlVolumeDeviceToDosName( irpSp->DeviceObject, &DosName );

Win2K3 doesn’t work.
status = IoVolumeDeviceToDosName( irpSp->DeviceObject, &DosName );
Regards,
Here are snippets to show how the code works…

typedef
NTSTATUS
(*PSF_IO_VOLUME_DEVICE_TO_DOS_NAME) (
IN PVOID VolumeDeviceObject,
OUT PUNICODE_STRING DosName
);

typedef struct _SF_DYNAMIC_FUNCTION_POINTERS {
//
// The following routines should all be available on Windows XP (5.1)
and
// later.
//
PSF_REGISTER_FILE_SYSTEM_FILTER_CALLBACKS
RegisterFileSystemFilterCallbacks;
PSF_ATTACH_DEVICE_TO_DEVICE_STACK_SAFE AttachDeviceToDeviceStackSafe;

PSF_GET_VERSION GetVersion;
PSF_IO_VOLUME_DEVICE_TO_DOS_NAME IoVolumeDeviceToDosName;

} SF_DYNAMIC_FUNCTION_POINTERS, *PSF_DYNAMIC_FUNCTION_POINTERS;

SF_DYNAMIC_FUNCTION_POINTERS gSfDynamicFunctions = {0};
.
.
.
VOID
SfLoadDynamicFunctions ( )
{

RtlInitUnicodeString( &functionName, L"IoVolumeDeviceToDosName" );
gSfDynamicFunctions.IoVolumeDeviceToDosName =
MmGetSystemRoutineAddress( &functionName );
//This works, because I checked that
gSfDynamicFunctions.IoVolumeDeviceToDosName is not NULL.
}
.
.
.
NTSTATUS
SfCreate (
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp )
{

PIO_STACK_LOCATION irpSp = IoGetCurrentIrpStackLocation( Irp );

status =
gSfDynamicFunctions.IoVolumeDeviceToDosName(irpSp->DeviceObject,
&DosName );

// This is where I get the error status = 'STATUS_INVALID_DEVICE_REQUEST
((NTSTATUS)0xC0000010L)

}

Thank you,

-SteveC

You are passing a wrong device object to the IoVolumeDeviceToDosName - this
function expects a device object from storage stack and not a device object
created by a file system filter. W2K should be failing it too to be
consistent.

Alexei.

-----Original Message-----
From: AlphaGrey [mailto:cooksd@us.ibm.com]
Sent: Thursday, December 09, 2004 11:33 AM
To: Windows File Systems Devs Interest List
Subject: [ntfsd] IoVolumeDeviceToDosName returns
STATUS_INVALID_DEVICE_REQUEST

Hello,
I wrote a FileSystem Filter driver with two binaries…one for Win2K another
for Win2K3. Thanks for previously helping me figure out that I can’t build
a Win2K3 driver on a Win2K system.

I make the call in IRP_MJ_CREATE. In Win2K I call
RtlVolumeDeviceToDosName( ), and it works like a charm. I call the
IoVolumeDeviceToDosName( ) in the Win2K3 driver, and I get the error
‘STATUS_INVALID_DEVICE_REQUEST ((NTSTATUS)0xC0000010L)’
What am I missing?

Win2K works.
status = RtlVolumeDeviceToDosName( irpSp->DeviceObject, &DosName );

Win2K3 doesn’t work.
status = IoVolumeDeviceToDosName( irpSp->DeviceObject, &DosName );
Regards,
Here are snippets to show how the code works…

typedef
NTSTATUS
(*PSF_IO_VOLUME_DEVICE_TO_DOS_NAME) (
IN PVOID VolumeDeviceObject,
OUT PUNICODE_STRING DosName
);

typedef struct _SF_DYNAMIC_FUNCTION_POINTERS {
//
// The following routines should all be available on Windows XP (5.1)
and
// later.
//
PSF_REGISTER_FILE_SYSTEM_FILTER_CALLBACKS
RegisterFileSystemFilterCallbacks;
PSF_ATTACH_DEVICE_TO_DEVICE_STACK_SAFE AttachDeviceToDeviceStackSafe;

PSF_GET_VERSION GetVersion;
PSF_IO_VOLUME_DEVICE_TO_DOS_NAME IoVolumeDeviceToDosName;

} SF_DYNAMIC_FUNCTION_POINTERS, *PSF_DYNAMIC_FUNCTION_POINTERS;

SF_DYNAMIC_FUNCTION_POINTERS gSfDynamicFunctions = {0};
.
.
.
VOID
SfLoadDynamicFunctions ( )
{

RtlInitUnicodeString( &functionName, L"IoVolumeDeviceToDosName" );
gSfDynamicFunctions.IoVolumeDeviceToDosName =
MmGetSystemRoutineAddress( &functionName );
//This works, because I checked that
gSfDynamicFunctions.IoVolumeDeviceToDosName is not NULL.
}
.
.
.
NTSTATUS
SfCreate (
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp )
{

PIO_STACK_LOCATION irpSp = IoGetCurrentIrpStackLocation( Irp );

status =
gSfDynamicFunctions.IoVolumeDeviceToDosName(irpSp->DeviceObject,
&DosName );

// This is where I get the error status = 'STATUS_INVALID_DEVICE_REQUEST
((NTSTATUS)0xC0000010L)

}

Thank you,

-SteveC


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

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

Thanks for responding Alexei,
Where do I get a pointer to the storage stack device object? From the irp
sent to my SfCreate function?
Thanks again,
-Steven Cook.

“Alexei Jelvis” wrote in message news:xxxxx@ntfsd…
You are passing a wrong device object to the IoVolumeDeviceToDosName - this
function expects a device object from storage stack and not a device object
created by a file system filter. W2K should be failing it too to be
consistent.

Alexei.

-----Original Message-----
From: AlphaGrey [mailto:cooksd@us.ibm.com]
Sent: Thursday, December 09, 2004 11:33 AM
To: Windows File Systems Devs Interest List
Subject: [ntfsd] IoVolumeDeviceToDosName returns
STATUS_INVALID_DEVICE_REQUEST

Hello,
I wrote a FileSystem Filter driver with two binaries…one for Win2K another
for Win2K3. Thanks for previously helping me figure out that I can’t build
a Win2K3 driver on a Win2K system.

I make the call in IRP_MJ_CREATE. In Win2K I call
RtlVolumeDeviceToDosName( ), and it works like a charm. I call the
IoVolumeDeviceToDosName( ) in the Win2K3 driver, and I get the error
‘STATUS_INVALID_DEVICE_REQUEST ((NTSTATUS)0xC0000010L)’
What am I missing?

Win2K works.
status = RtlVolumeDeviceToDosName( irpSp->DeviceObject, &DosName );

Win2K3 doesn’t work.
status = IoVolumeDeviceToDosName( irpSp->DeviceObject, &DosName );
Regards,
Here are snippets to show how the code works…

typedef
NTSTATUS
(*PSF_IO_VOLUME_DEVICE_TO_DOS_NAME) (
IN PVOID VolumeDeviceObject,
OUT PUNICODE_STRING DosName
);

typedef struct _SF_DYNAMIC_FUNCTION_POINTERS {
//
// The following routines should all be available on Windows XP (5.1)
and
// later.
//
PSF_REGISTER_FILE_SYSTEM_FILTER_CALLBACKS
RegisterFileSystemFilterCallbacks;
PSF_ATTACH_DEVICE_TO_DEVICE_STACK_SAFE AttachDeviceToDeviceStackSafe;

PSF_GET_VERSION GetVersion;
PSF_IO_VOLUME_DEVICE_TO_DOS_NAME IoVolumeDeviceToDosName;

} SF_DYNAMIC_FUNCTION_POINTERS, *PSF_DYNAMIC_FUNCTION_POINTERS;

SF_DYNAMIC_FUNCTION_POINTERS gSfDynamicFunctions = {0};
.
.
.
VOID
SfLoadDynamicFunctions ( )
{

RtlInitUnicodeString( &functionName, L"IoVolumeDeviceToDosName" );
gSfDynamicFunctions.IoVolumeDeviceToDosName =
MmGetSystemRoutineAddress( &functionName );
//This works, because I checked that
gSfDynamicFunctions.IoVolumeDeviceToDosName is not NULL.
}
.
.
.
NTSTATUS
SfCreate (
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp )
{

PIO_STACK_LOCATION irpSp = IoGetCurrentIrpStackLocation( Irp );

status =
gSfDynamicFunctions.IoVolumeDeviceToDosName(irpSp->DeviceObject,
&DosName );

// This is where I get the error status = 'STATUS_INVALID_DEVICE_REQUEST
((NTSTATUS)0xC0000010L)

}

Thank you,

-SteveC


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

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

There is no easy way to get it before IRP is completed by the underlying
file system.
You can retrieve it while processing mount request and store in your device
object extension.

Alexei.

“AlphaGrey” wrote in message news:xxxxx@ntfsd…
> Thanks for responding Alexei,
> Where do I get a pointer to the storage stack device object? From the irp
> sent to my SfCreate function?
> Thanks again,
> -Steven Cook.
>
> “Alexei Jelvis” wrote in message news:xxxxx@ntfsd…
> You are passing a wrong device object to the IoVolumeDeviceToDosName -
this
> function expects a device object from storage stack and not a device
object
> created by a file system filter. W2K should be failing it too to be
> consistent.
>
> Alexei.
>
> -----Original Message-----
> From: AlphaGrey [mailto:cooksd@us.ibm.com]
> Sent: Thursday, December 09, 2004 11:33 AM
> To: Windows File Systems Devs Interest List
> Subject: [ntfsd] IoVolumeDeviceToDosName returns
> STATUS_INVALID_DEVICE_REQUEST
>
>
> Hello,
> I wrote a FileSystem Filter driver with two binaries…one for Win2K
another
> for Win2K3. Thanks for previously helping me figure out that I can’t
build
> a Win2K3 driver on a Win2K system.
>
> I make the call in IRP_MJ_CREATE. In Win2K I call
> RtlVolumeDeviceToDosName( ), and it works like a charm. I call the
> IoVolumeDeviceToDosName( ) in the Win2K3 driver, and I get the error
> ‘STATUS_INVALID_DEVICE_REQUEST ((NTSTATUS)0xC0000010L)’
> What am I missing?
>
> Win2K works.
> status = RtlVolumeDeviceToDosName( irpSp->DeviceObject, &DosName );
>
> Win2K3 doesn’t work.
> status = IoVolumeDeviceToDosName( irpSp->DeviceObject, &DosName );
> Regards,
> Here are snippets to show how the code works…
>
> typedef
> NTSTATUS
> (*PSF_IO_VOLUME_DEVICE_TO_DOS_NAME) (
> IN PVOID VolumeDeviceObject,
> OUT PUNICODE_STRING DosName
> );
>
> typedef struct _SF_DYNAMIC_FUNCTION_POINTERS {
> //
> // The following routines should all be available on Windows XP (5.1)
> and
> // later.
> //
> PSF_REGISTER_FILE_SYSTEM_FILTER_CALLBACKS
> RegisterFileSystemFilterCallbacks;
> PSF_ATTACH_DEVICE_TO_DEVICE_STACK_SAFE AttachDeviceToDeviceStackSafe;
> …
> PSF_GET_VERSION GetVersion;
> PSF_IO_VOLUME_DEVICE_TO_DOS_NAME IoVolumeDeviceToDosName;
>
> } SF_DYNAMIC_FUNCTION_POINTERS, *PSF_DYNAMIC_FUNCTION_POINTERS;
>
> SF_DYNAMIC_FUNCTION_POINTERS gSfDynamicFunctions = {0};
> .
> .
> .
> VOID
> SfLoadDynamicFunctions ( )
> {
> …
> RtlInitUnicodeString( &functionName, L"IoVolumeDeviceToDosName" );
> gSfDynamicFunctions.IoVolumeDeviceToDosName =
> MmGetSystemRoutineAddress( &functionName );
> //This works, because I checked that
> gSfDynamicFunctions.IoVolumeDeviceToDosName is not NULL.
> }
> .
> .
> .
> NTSTATUS
> SfCreate (
> IN PDEVICE_OBJECT DeviceObject,
> IN PIRP Irp )
> {
> …
> PIO_STACK_LOCATION irpSp = IoGetCurrentIrpStackLocation( Irp );
> …
> status =
> gSfDynamicFunctions.IoVolumeDeviceToDosName(irpSp->DeviceObject,
> &DosName );
>
> // This is where I get the error status = 'STATUS_INVALID_DEVICE_REQUEST
> ((NTSTATUS)0xC0000010L)
> …
> }
>
> Thank you,
>
> -SteveC
>
>
>
> —
> Questions? First check the IFS FAQ at
> https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to ntfsd as: xxxxx@vmware.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
>