MCPcopy Create free account
hub / github.com/derceg/explorerplusplus / GetClusterSize

Function GetClusterSize

Explorer++/Helper/DriveInfo.cpp:11–35  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9
10
11BOOL 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
37TCHAR GetDriveLetterFromMask(ULONG unitmask)
38{

Callers 2

GetRealSizeColumnRawDataFunction · 0.85
GetFileClusterSizeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected