I want to be able to detect if a removable media drive (except for CDROM) is ready (ie media is in the drive) before I try to read to or write from it. The method needs to work on Windows 95 (original edition) and later as well as NT 4.0 and later. Besides being able to check floppies and other removable media (e.g Zip drives) on the local machine, it should also be able to check such drives accessed over a network with UNC names.
All the methods I have tried work in some situations and not others. E.g. GetDiskFreeSpace works on local drives but when used on network (UNC) paths returns a "network request is not supported" error. I can't get CreateFile to work on Win 9x. DeviceIoControl with vwin32 of course only works on Win 9x and only for floppies. I have searched for "drive ready" in MSDN and found nothing useful. Also I can find no info in a similar search on this site and some others. I can't be the first person to ever have this problem.
The need to check for drive ready is such a common need. Most Windows programs seem to be able to trap this conditon. Am I making this more complicated that I need? It seems there ought to be a simple way to do this. Any suggestions would be appreciated. An example in C++ Win API would be most helpful.