Hello,
Thank you for your reply.
FileObject->DeviceObject points to the device object on which the file is
opened. That’s exactly what you need.
But if I have the mentioned file on a cdrom disc (with no UDF) the device
FileObject->DeviceObject points to a device created by the the
“\driver\cdfs”
but I can not find the connection to “\device\cdromX”.
Best Regards
Michael
> Is it possible to get information about the physical device, a file is
> located on, if I’m having a FileObject?
>
> e.g:
> “FileObject” describes a file “\mytestfile.txt” on a cd drive.
> Is it possible to find the cddrive (device) the file is located on ?
If FileObject->DeviceObject points to file system device object this means
that this file is not used for accessing data on physical media. Such files
are usually used for controlling file system device object via
DeviceIoControl. FileObject->DeviceObject must point to physical media
device object. Otherwise, file system drivers get very unhappy.
-htfv
----- Original Message -----
From: “Michael Kurz”
To: “Windows System Software Devs Interest List”
Sent: Friday, September 19, 2003 1:25 PM
Subject: [ntdev] AW: Re: FileObject -> drive/ device.
> Hello,
>
> Thank you for your reply.
>
> >FileObject->DeviceObject points to the device object on which the file is
> >opened. That’s exactly what you need.
>
> But if I have the mentioned file on a cdrom disc (with no UDF) the device
> FileObject->DeviceObject points to a device created by the the
> “\driver\cdfs”
> but I can not find the connection to “\device\cdromX”.
>
> Best Regards
> Michael
>
>
>
> >> Is it possible to get information about the physical device, a file is
> >> located on, if I’m having a FileObject?
> >>
> >> e.g:
> >> “FileObject” describes a file “\mytestfile.txt” on a cd drive.
> >> Is it possible to find the cddrive (device) the file is located on ?
>
>
> —
> Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@vba.com.by
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
Although it’s not documented behavior, from what I’ve seen
FileObject->DeviceObject always points to a device in the storage stack
(cdfs is a filesystem driver). I just tested this and for a CD-ROM file
opened on my system, this pointer does indeed point to a \Driver\Cdrom
device object. You’re sure you seeing what you’re seeing? 
Michael Kurz wrote:
Hello,
Thank you for your reply.
>FileObject->DeviceObject points to the device object on which the file is
>opened. That’s exactly what you need.
But if I have the mentioned file on a cdrom disc (with no UDF) the device
FileObject->DeviceObject points to a device created by the the
“\driver\cdfs”
but I can not find the connection to “\device\cdromX”.
Best Regards
Michael
>>Is it possible to get information about the physical device, a file is
>>located on, if I’m having a FileObject?
>>
>>e.g:
>>“FileObject” describes a file “\mytestfile.txt” on a cd drive.
>>Is it possible to find the cddrive (device) the file is located on ?
–
Nick Ryan (MVP for DDK)