Hi,
I have a disk filter which will filter all removable storage devices so that
these devices is read-only.
I check for IOCTL_DISK_IS_WRITABLE and return NTSTATUS =
STATUS_MEDIA_WRITE_PROTECTED.
It worked for almost all the devices except for USB hard disk and cdrw
drive.
It is still able to write to the disk.
Should I return STATUS_IO_DEVICE_ERROR instead?
Will there be a difference?
Is it possible to make a hard disk or cdrw read-only?
How can I do that?
Thank You!
cheers,
vincent
Take a break! Find destinations on MSN Travel. http://www.msn.com.sg/travel/
USB hard disks are not removable media devices, so i don’t think the file systems care about the value returned by IOCTL_DISK_IS_WRITABLE. If you want to block writes to these devices you’ll need to catch and fail IRP_MJ_WRITE.
for the CD-RW, the disk specific IOCTL “ioctl_DISK_is_writable” doesn’t apply. You’d need to catch the CD IOCTLs which Windows uses to determine if cd burning is available and block them. of course this still won’t stop things like ASPI CD-R software which bypass the storage drivers entirely and thus are much more difficult to filter.
-p
From: xxxxx@lists.osr.com on behalf of vincent gambit
Sent: Tue 6/10/2003 9:28 AM
To: NT Developers Interest List
Subject: [ntdev] read-only hard disk howto?
Hi,
I have a disk filter which will filter all removable storage devices so that
these devices is read-only.
I check for IOCTL_DISK_IS_WRITABLE and return NTSTATUS =
STATUS_MEDIA_WRITE_PROTECTED.
It worked for almost all the devices except for USB hard disk and cdrw
drive.
It is still able to write to the disk.
Should I return STATUS_IO_DEVICE_ERROR instead?
Will there be a difference?
Is it possible to make a hard disk or cdrw read-only?
How can I do that?
Thank You!
cheers,
vincent
Take a break! Find destinations on MSN Travel. http://www.msn.com.sg/travel/
You are currently subscribed to ntdev as: xxxxx@microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com
> USB hard disks are not removable media devices, so i don’t think
the file systems care about the value returned by
IOCTL_DISK_IS_WRITABLE. If you want to block writes to
these devices you’ll need to catch and fail IRP_MJ_WRITE.
And if the disk is formatted NTFS, you cannot make them read-only
on W2K. I think the system needs to update the last access time and
other information.
Hi peter,
Thanks for your reply.
I understand that I can fail IRP_MJ_WRITE
However it did not reflect the failt write in windows explorer.
Windows Explorer shows that the file is actually written to the disk
although in actual fact it is not written as when I reboot my system the
file is not there.
Why is that?
I guess the filesystem will allow the write n update accordingly without
performing the actual write since it is cached.
Using this method it will confuse the users.
Or is there other mehtods?
Hope you can help.
Thank You!
cheers,
vincent
From: “Peter Wieland”
>Reply-To: “NT Developers Interest List”
>To: “NT Developers Interest List”
>Subject: [ntdev] RE: read-only hard disk howto?
>Date: Tue, 10 Jun 2003 11:39:36 -0700
>
>USB hard disks are not removable media devices, so i don’t think the file
>systems care about the value returned by IOCTL_DISK_IS_WRITABLE. If you
>want to block writes to these devices you’ll need to catch and fail
>IRP_MJ_WRITE.
>
>for the CD-RW, the disk specific IOCTL “ioctl_DISK_is_writable” doesn’t
>apply. You’d need to catch the CD IOCTLs which Windows uses to determine
>if cd burning is available and block them. of course this still won’t stop
>things like ASPI CD-R software which bypass the storage drivers entirely
>and thus are much more difficult to filter.
>
>-p
>
>
>
>From: xxxxx@lists.osr.com on behalf of vincent gambit
>Sent: Tue 6/10/2003 9:28 AM
>To: NT Developers Interest List
>Subject: [ntdev] read-only hard disk howto?
>
>
>
>Hi,
>
>I have a disk filter which will filter all removable storage devices so
>that
>these devices is read-only.
>I check for IOCTL_DISK_IS_WRITABLE and return NTSTATUS =
>STATUS_MEDIA_WRITE_PROTECTED.
>It worked for almost all the devices except for USB hard disk and cdrw
>drive.
>It is still able to write to the disk.
>Should I return STATUS_IO_DEVICE_ERROR instead?
>Will there be a difference?
>
>Is it possible to make a hard disk or cdrw read-only?
>How can I do that?
>
>Thank You!
>
>cheers,
>vincent
>
>_________________________________
>Take a break! Find destinations on MSN Travel.
>http://www.msn.com.sg/travel/
>
>
>
>—
>You are currently subscribed to ntdev as: xxxxx@microsoft.com
>To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
>
>
>—
>You are currently subscribed to ntdev as: xxxxx@hotmail.com
>To unsubscribe send a blank email to xxxxx@lists.osr.com
_________________________________________________________________
Download Norah Jones, Eminem and more! http://www.msn.com.sg/ringtones/
>USB hard disks are not removable media devices, so i don’t think the file
systems care about the value returned by IOCTL_DISK_IS_WRITABLE. If you
want to >block writes to these devices you’ll need to catch and fail
IRP_MJ_WRITE.
FAT file system does care about value returned by IOCTL_DISK_IS_WRITABLE
regardless if it is removable device or not.
NTFS prior to XP doesn’t care about IOCTL_DISK_IS_WRITABLE at all and always
consider disk as being writable.
Alexei.
Hi,
Thanks for the reply.
I am using Windows XP but it still ignore the value returned.
So how can I make hard disk read-only for NTFS?
Thank You!
cheers,
vincent
From: “Alexei Jelvis”
>Reply-To: “NT Developers Interest List”
>To: “NT Developers Interest List”
>Subject: [ntdev] Re: read-only hard disk howto?
>Date: Tue, 10 Jun 2003 23:14:10 -0400
>
> >USB hard disks are not removable media devices, so i don’t think the file
>systems care about the value returned by IOCTL_DISK_IS_WRITABLE. If you
>want to >block writes to these devices you’ll need to catch and fail
>IRP_MJ_WRITE.
>
>FAT file system does care about value returned by IOCTL_DISK_IS_WRITABLE
>regardless if it is removable device or not.
>NTFS prior to XP doesn’t care about IOCTL_DISK_IS_WRITABLE at all and
>always
>consider disk as being writable.
>
>Alexei.
>
>
>
>—
>You are currently subscribed to ntdev as: xxxxx@hotmail.com
>To unsubscribe send a blank email to xxxxx@lists.osr.com
_________________________________________________________________
Send a fun phone greeting to your friend!
http://www.msn.com.sg/mobile/fungreetings/