- if (ulDriveMap & ( 1 << i ))
- {
- wxString path, name;
- path.Printf(wxT("%c:\\"), 'A' + i);
- name.Printf(wxT("%c:"), 'A' + i);
-
- int imageId;
- if (path == wxT("A:\\") || path == wxT("B:\\"))
- imageId = wxFileIconsTable::floppy;
- else
- imageId = wxFileIconsTable::drive;
- paths.Add(path);
- names.Add(name);
- icon_ids.Add(imageId);
- }
+ if (ulDriveMap & ( 1 << i ))
+ {
+ wxString path, name;
+ path.Printf(wxT("%c:\\"), 'A' + i);
+ name.Printf(wxT("%c:"), 'A' + i);
+
+ // Note: If _filesys is unsupported by some compilers,
+ // we can always replace it by DosQueryFSAttach
+ char filesysname[20];
+#ifdef __WATCOMC__
+ ULONG cbBuffer = sizeof(filesysname);
+ PFSQBUFFER2 pfsqBuffer = (PFSQBUFFER2)filesysname;
+ APIRET rc = ::DosQueryFSAttach(name.fn_str(),0,FSAIL_QUERYNAME,pfsqBuffer,&cbBuffer);
+ if (rc != NO_ERROR)
+ {
+ filesysname[0] = '\0';
+ }
+#else
+ _filesys(name.fn_str(), filesysname, sizeof(filesysname));
+#endif
+ /* FAT, LAN, HPFS, CDFS, NFS */
+ int imageId;
+ if (path == wxT("A:\\") || path == wxT("B:\\"))
+ imageId = wxFileIconsTable::floppy;
+ else if (!strcmp(filesysname, "CDFS"))
+ imageId = wxFileIconsTable::cdrom;
+ else if (!strcmp(filesysname, "LAN") ||
+ !strcmp(filesysname, "NFS"))
+ imageId = wxFileIconsTable::drive;
+ else
+ imageId = wxFileIconsTable::drive;
+ paths.Add(path);
+ names.Add(name);
+ icon_ids.Add(imageId);
+ }