Changeset 796
- Timestamp:
- Oct 18, 2010, 7:09:36 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/corelib/io/qfsfileengine_os2.cpp
r794 r796 69 69 #include <grp.h> 70 70 71 71 72 #include "qt_os2.h" 72 73 … … 590 591 QFileInfoList ret; 591 592 592 ULONG driveBits, dummy; 593 DosQueryCurrentDisk(&dummy, &driveBits); 594 driveBits &= 0x3ffffff; 595 596 char driveName[4]; 597 qstrcpy(driveName, "A:/"); 598 599 while(driveBits) { 600 if (driveBits & 1) 593 ULONG driveBits, dummy; 594 DosQueryCurrentDisk(&dummy, &driveBits); 595 driveBits &= 0x3ffffff; 596 597 char driveName[4] = "A:/"; 598 599 while (driveBits) { 600 if (driveName[0] < 'C') { 601 // hide non-existent floppies 602 BIOSPARAMETERBLOCK bpb; 603 UCHAR ioc[2] = { 0, driveName[0] - 'A' }; 604 if (DosDevIOCtl((HFILE)-1, IOCTL_DISK, DSK_GETDEVICEPARAMS, 605 ioc, 2, NULL, &bpb, sizeof(bpb), NULL) != 0) { 606 driveBits &= ~1; 607 } 608 } 609 if (driveBits & 1) 601 610 ret.append(QString::fromLatin1(driveName).toUpper()); 602 603 604 611 driveName[0]++; 612 driveBits = driveBits >> 1; 613 } 605 614 606 615 return ret;
Note:
See TracChangeset
for help on using the changeset viewer.