Hi,
I have came across the problem to determine if a volume
is read-only or not. I know that there is a cool-looking,
always-working IOCTL, called IOCTL_DISK_IS_WRITABLE.
My case is an user-mode app, not a driver.
However - if I try to use it under non-privileged user,
there’s a problem with obtaining the handle for using this IOCTL -
CreateFile(“\.\C:”, FILE_READ_DATA, …) fails with ERROR_ACCESS_DENIED.
Tested on Vista, test app has been ran in admin-approval mode (UAC).
GetVolumeInformation offers another way, there’s a flag FILE_READ_ONLY_VOLUME
set, but only supported under Windows XP and newer.
Has anyone of you ever tried to determine read-only status under
normal user account ? Or is that information considered “classified”
and only admin-type users are able to get it ?
L.