Вы должны взглянуть на GetVolumeInformation()
, Взгляните на этот API .
Пример, здесь :
#include <stdio.h>
#include <Windows.h>
int wmain()
{
// + 1 is for NULL
WCHAR volumeName[MAX_PATH + 1] = { 0 };
WCHAR fileSystemName[MAX_PATH + 1] = { 0 };
DWORD serialNumber = 0;
DWORD maxComponentLen = 0;
DWORD fileSystemFlags = 0;
if (GetVolumeInformation(
L"C:\\", L"\\MyServer\MyShare\"
volumeName,
sizeof(volumeName),
&serialNumber,
&maxComponentLen,
&fileSystemFlags,
fileSystemName,
sizeof(fileSystemName)) == TRUE)
{
wprintf(L"GetVolumeInformation() should be fine!\n");
wprintf(L"Volume Name: %s\n", volumeName);
wprintf(L"Serial Number: %lu\n", serialNumber);
wprintf(L"File System Name: %s\n", fileSystemName);
wprintf(L"Max Component Length: %lu\n", maxComponentLen);
wprintf(L"File system flags: 0X%.08X\n", fileSystemFlags);
}
else
{
wprintf(L"GetVolumeInformation() failed, error %u\n", GetLastError());
}
return 0;
}
Вывод:
информация о томе