[delphizip] Handling CDRW packet drives

  • From: "James Turner" <james.d.h.turner@xxxxxxxxxxxx>
  • To: <delphizip@xxxxxxxxxxxxx>
  • Date: Sun, 1 Dec 2002 11:47:24 -0000

This is a minor problem in my own software that I have rather skirted
around, however, the solution I way toying with was to write my own
GetDriveType function, say GetDriveTypeEx, that would call GetDriveType and
then call GetDiskFreeSpace if it appears to be a DRIVE_CDROM. If the free
space is greater than zero, return the value DRIVE_REMOVABLE.

Since I haven't tried this, I cannot say for certain that it would work, but
I presume that ZipMaster would go on to treat the CDRW disk as a big floppy.

This would require all calls to GetDriveType (both in Delphi code and in
DLLs) to be replaced by calls to GetDriveTypeEx, but that should be easy
enough.

This may not solve all associated problems, but should be easy to implement
and is not likely to introduce new bugs into stable code.

Hope this helps

-- James Turner
www.skaro.net

PS
If memory serves me correctly, GetDiskFreeSpace has been rather bodged by
Microsoft. I think I have a proper version somewhere that works on all
platforms. Let me know if you need it.



Other related posts: