Changeset 60
- Timestamp:
- Apr 18, 2001, 7:17:09 PM (24 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/helpers/dosh.h
r59 r60 64 64 ********************************************************************/ 65 65 66 VOID doshEnumDrives(PSZ pszBuffer, 67 const char *pcszFileSystem, 68 BOOL fSkipRemoveables); 66 VOID XWPENTRY doshEnumDrives(PSZ pszBuffer, 67 const char *pcszFileSystem, 68 BOOL fSkipRemoveables); 69 typedef VOID XWPENTRY DOSHENUMDRIVES(PSZ pszBuffer, 70 const char *pcszFileSystem, 71 BOOL fSkipRemoveables); 72 typedef DOSHENUMDRIVES *PDOSHENUMDRIVES; 69 73 70 74 CHAR doshQueryBootDrive(VOID); … … 74 78 APIRET doshSetLogicalMap(ULONG ulLogicalDrive); 75 79 76 APIRET doshQueryDiskFree(ULONG ulLogicalDrive, 77 double *pdFree); 78 79 APIRET doshQueryDiskFSType(ULONG ulLogicalDrive, 80 PSZ pszBuf, 81 ULONG cbBuf); 80 APIRET XWPENTRY doshQueryDiskSize(ULONG ulLogicalDrive, double *pdSize); 81 typedef APIRET XWPENTRY DOSHQUERYDISKSIZE(ULONG ulLogicalDrive, double *pdSize); 82 typedef DOSHQUERYDISKSIZE *PDOSHQUERYDISKSIZE; 83 84 APIRET XWPENTRY doshQueryDiskFree(ULONG ulLogicalDrive, double *pdFree); 85 typedef APIRET XWPENTRY DOSHQUERYDISKFREE(ULONG ulLogicalDrive, double *pdFree); 86 typedef DOSHQUERYDISKFREE *PDOSHQUERYDISKFREE; 87 88 APIRET XWPENTRY doshQueryDiskFSType(ULONG ulLogicalDrive, PSZ pszBuf, ULONG cbBuf); 89 typedef APIRET XWPENTRY DOSHQUERYDISKFSTYPE(ULONG ulLogicalDrive, PSZ pszBuf, ULONG cbBuf); 90 typedef DOSHQUERYDISKFSTYPE *PDOSHQUERYDISKFSTYPE; 82 91 83 92 APIRET doshIsFixedDisk(ULONG ulLogicalDrive, -
trunk/src/helpers/dosh.c
r55 r60 572 572 | OPEN_SHARE_DENYNONE, 573 573 0); 574 574 575 if (rc == NO_ERROR) 575 576 { … … 589 590 590 591 /* 591 *@@ doshQueryDiskFree: 592 * returns the number of bytes remaining on the disk 593 * specified by the given logical drive. 594 * 595 * Note: This returns a "double" value, because a ULONG 596 * can only hold values of some 4 billion, which would 597 * lead to funny results for drives > 4 GB. 598 * 599 *@@changed V0.9.0 [umoeller]: fixed another > 4 GB bug (thanks to Rdiger Ihle) 600 *@@changed V0.9.7 (2000-12-01) [umoeller]: changed prototype 601 */ 602 603 APIRET doshQueryDiskFree(ULONG ulLogicalDrive, // in: 1 for A:, 2 for B:, 3 for C:, ... 604 double *pdFree) 592 *@@ doshQueryDiskSize: 593 * returns the size of the specified disk in bytes. 594 * 595 * Note: This returns a "double" value, because a ULONG 596 * can only hold values of some 4 billion, which would 597 * lead to funny results for drives > 4 GB. 598 * 599 *@@added V0.9.11 (2001-04-18) [umoeller] 600 */ 601 602 APIRET doshQueryDiskSize(ULONG ulLogicalDrive, // in: 1 for A:, 2 for B:, 3 for C:, ... 603 double *pdSize) 605 604 { 606 605 APIRET arc = NO_ERROR; … … 608 607 double dbl = -1; 609 608 610 arc = DosQueryFSInfo(ulLogicalDrive, FSIL_ALLOC, &fsa, sizeof(fsa)); 611 if (arc == NO_ERROR) 609 if (!(arc = DosQueryFSInfo(ulLogicalDrive, FSIL_ALLOC, &fsa, sizeof(fsa)))) 610 *pdSize = ((double)fsa.cSectorUnit * fsa.cbSector * fsa.cUnit); 611 612 return (arc); 613 } 614 615 /* 616 *@@ doshQueryDiskFree: 617 * returns the number of bytes remaining on the disk 618 * specified by the given logical drive. 619 * 620 * Note: This returns a "double" value, because a ULONG 621 * can only hold values of some 4 billion, which would 622 * lead to funny results for drives > 4 GB. 623 * 624 *@@changed V0.9.0 [umoeller]: fixed another > 4 GB bug (thanks to Rdiger Ihle) 625 *@@changed V0.9.7 (2000-12-01) [umoeller]: changed prototype 626 */ 627 628 APIRET doshQueryDiskFree(ULONG ulLogicalDrive, // in: 1 for A:, 2 for B:, 3 for C:, ... 629 double *pdFree) 630 { 631 APIRET arc = NO_ERROR; 632 FSALLOCATE fsa; 633 double dbl = -1; 634 635 if (!(arc = DosQueryFSInfo(ulLogicalDrive, FSIL_ALLOC, &fsa, sizeof(fsa)))) 612 636 *pdFree = ((double)fsa.cSectorUnit * fsa.cbSector * fsa.cUnitAvail); 613 637 // ^ fixed V0.9.0
Note:
See TracChangeset
for help on using the changeset viewer.