| 9 | |
| 10 | |
| 11 | BOOL GetClusterSize(const TCHAR *drive, DWORD *pdwClusterSize) |
| 12 | { |
| 13 | DWORD dwSectorsPerCluster; |
| 14 | DWORD dwBytesPerSector; |
| 15 | BOOL bRet = GetDiskFreeSpace(drive,&dwSectorsPerCluster,&dwBytesPerSector,NULL,NULL); |
| 16 | |
| 17 | if(!bRet) |
| 18 | { |
| 19 | return FALSE; |
| 20 | } |
| 21 | |
| 22 | /* It's not expected that this |
| 23 | will ever actually overflow. |
| 24 | The cluster size should be |
| 25 | _far_ below the maximum |
| 26 | DWORD value. */ |
| 27 | HRESULT hr = DWordMult(dwBytesPerSector, dwSectorsPerCluster, pdwClusterSize); |
| 28 | |
| 29 | if(FAILED(hr)) |
| 30 | { |
| 31 | return FALSE; |
| 32 | } |
| 33 | |
| 34 | return TRUE; |
| 35 | } |
| 36 | |
| 37 | TCHAR GetDriveLetterFromMask(ULONG unitmask) |
| 38 | { |
no outgoing calls
no test coverage detected