778 |
778 |
779 void FiosGetDrives() |
779 void FiosGetDrives() |
780 { |
780 { |
781 #if defined(WINCE) |
781 #if defined(WINCE) |
782 /* WinCE only knows one drive: / */ |
782 /* WinCE only knows one drive: / */ |
783 FiosItem *fios = _fios_items.Append()(); |
783 FiosItem *fios = _fios_items.Append(); |
784 fios->type = FIOS_TYPE_DRIVE; |
784 fios->type = FIOS_TYPE_DRIVE; |
785 fios->mtime = 0; |
785 fios->mtime = 0; |
786 snprintf(fios->name, lengthof(fios->name), PATHSEP ""); |
786 snprintf(fios->name, lengthof(fios->name), PATHSEP ""); |
787 ttd_strlcpy(fios->title, fios->name, lengthof(fios->title)); |
787 ttd_strlcpy(fios->title, fios->name, lengthof(fios->title)); |
788 #else |
788 #else |
789 TCHAR drives[256]; |
789 TCHAR drives[256]; |
790 const TCHAR *s; |
790 const TCHAR *s; |
791 |
791 |
792 GetLogicalDriveStrings(sizeof(drives), drives); |
792 GetLogicalDriveStrings(sizeof(drives), drives); |
793 for (s = drives; *s != '\0';) { |
793 for (s = drives; *s != '\0';) { |
794 FiosItem *fios = _fios_items.Append()(); |
794 FiosItem *fios = _fios_items.Append(); |
795 fios->type = FIOS_TYPE_DRIVE; |
795 fios->type = FIOS_TYPE_DRIVE; |
796 fios->mtime = 0; |
796 fios->mtime = 0; |
797 snprintf(fios->name, lengthof(fios->name), "%c:", s[0] & 0xFF); |
797 snprintf(fios->name, lengthof(fios->name), "%c:", s[0] & 0xFF); |
798 ttd_strlcpy(fios->title, fios->name, lengthof(fios->title)); |
798 ttd_strlcpy(fios->title, fios->name, lengthof(fios->title)); |
799 while (*s++ != '\0') { /* Nothing */ } |
799 while (*s++ != '\0') { /* Nothing */ } |