Handal,
Are you sending the request to the file system stack or the storage stack? You should be sending it directly to the storage stack.
At what point are you sending the request, while you are processing a mount or are you doing this at some other time like in a worker thread? It sounds to me like you were trying to do your own “open” to get this information.
The system supports the concept of a “Direct Device Open”. I looked at the IFSKit docs and they do not talk about this. I have filed a doc bug to get this fixed.
In the meantime:
If you do a volume open (volume name only) with no related file object and specify “FILE_READ_ATTRIBUTES” for the “Desired Access” parameter it will open the storage stack device directly and not mount the volume. You should then be able to do the query. You need to be careful because you are not talking to a file system, you are talking directly to the storage stack. This should work from both user mode and kernel mode.
Note that you can also specify the SYNCHORNIZE flag in the “Desired Access” parameter if you want to.
Neal Christiansen
Microsoft File System Filter Group Lead
This posting is provided “AS IS” with no warranties, and confers no rights
From: Handal, Thomas [mailto:xxxxx@websense.com]
Sent: Monday, January 24, 2005 4:37 PM
To: xxxxx@lists.osr.com
Cc: Neal Christiansen
Subject: RE: FILE_READ_ONLY_DEVICE is Wrong on certain drives
Hi Neal!
Thanks for the input… I seem to be having a problem though… I implemented the IOCTL and it seems to be mounting the drive to actually check the media for read-only info.? The problem is that the point of my FSF is to BLOCK mounts.? If the IOCTL is mounting, I have no control over it, so it defeats the purpose.? I need to check to see if the device is writable or read-only without actually mounting it. That is why the characteristics FILE_READ_ONLY_DEVICE would have been good. ??Do you have any ideas?
Thanks!
Tom
Subject: RE: FILE_READ_ONLY_DEVICE is Wrong on certain drives
From: “Neal Christiansen”
Newsgroups: ntfsd
To: “Windows File Systems Devs Interest List”
Handal,
The READ_ONLY characteristic is not reliable and should not be used.? Use the IOCTL described below.? If you look at the SFILTER and FileSpy samples in the IFSKit they have a routine for detecting snapshot volumes which uses this IOCTL.
Snapshot volumes are a good example of this problem, they are readonly but do not set this flag.? I wanted them to fix this but their response was that since no one used the flag why should they bother setting it.
The flag should be deprecated.
Neal Christiansen
Microsoft File System Filter Group Lead
This posting is provided “AS IS” with no warranties, and confers no rights
________________________________________
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Maxim S. Shatskih
Sent: Friday, January 21, 2005 10:36 AM
To: Windows File Systems Devs Interest List
Subject: Re: [ntfsd] FILE_READ_ONLY_DEVICE is Wrong on certain drives
??? IOCTL_DISK_IS_WRITABLE
?
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com
----- Original Message -----
From: Handal, Thomas
To: Windows File Systems Devs Interest List
Sent: Thursday, January 20, 2005 2:27 AM
Subject: [ntfsd] FILE_READ_ONLY_DEVICE is Wrong on certain drives
Hi All,
I am currently writing a FSF and am having a problem. I need to determine if a drive is read only or not. This is before it is mounted, but during the mount IRP.? I look at the Characteristics & FILE_READ_ONLY_DEVICE bit, which works on about 90% of the drives that I test, but once in awhile it reports writable on certain drives which are CD-ROMs, which are obviously not writable.
These are not CD-Rs or RWs… I am not sure if this is a bug in the driver code for that CD-ROM or if the firmware of the CD-ROM is reporting writable for some reason??? I am baffled here… And apparently this only happens on XP, not NT or 2000. ?Anyone run into anything like this? I am stuck…
Thanks in advance
Tom
?
—
Questions? First check the IFS FAQ at https://www.osronline.com/article.cfm?id=17
You are currently subscribed to ntfsd as: unknown lmsubst tag argument: ‘’
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: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com