From time to time I run into a situation where a Windows program reacts poorly to certain drive classes. For example:
- A backup program that only backs up fixed, local drives, and I want it to back-up a removable drive or a network drive.
- A program that does something to all fixed, local drives, and I want to prevent it from accessing one of the drives by marking the drive as removable.
I need a way to tell Windows that it should say that the drive is different than it really is.
Here are some ideas/notes.
- You can do some of this by using dummydisk.sys or cfadisk.sys, but they deal only with fixed/removable, and I want network/local.
- Maybe I could hook GetDriveType (http://msdn.microsoft.com/en-us/library/aa364939%28VS.85%29.aspx), and have it lie to ONLY the program I want to lie to. (It could be bad to have it lie to Windows.)
- http://www.codeproject.com/KB/system/soviet_direct_hooking.aspx?msg=1468013 is an article about hooking system API DLLs.
- http://forum.madshi.net/viewtopic.php?p=4420&sid=82111e2f2e1c485c02ebf1d01a80a4aa is thread about hooking and hooking problems.
- Windows volume management functions: http://msdn.microsoft.com/en-us/library/aa365730%28VS.85%29.aspx
- Might need to also hook DeviceIoControl because http://www.eggheadcafe.com/software/aspnet/35336538/alternative-to-getdrivety.aspx mentions "Open the volume (CreateFile with something like "\\.\U:") and call DeviceIoControl with IOCTL_STORAGE_QUERY_PROPERTY."
- What about creating a filter driver to create a virtual local drive on top of the network drive?
- Maybe a shell namespace utility? Like GDrive?
There are plenty of people looking for this ability, but I haven’t seen any web pages about anyone succeeding.