1 //GetLogicalDriveStrings.cpp: Defines the entry point of the console application. 2 //3 4#include"stdafx.h"5#include <Windows.h>6#include <iostream>7 8 using namespacestd;9 Ten voidSub_1 ();//Enumerate Volumes---> Disks && NTFS (WIN10) for a computer One A - intMain () - { the - sub_1 (); - - return 0; + } - + voidsub_1 () A { at Charvolumedevicestring[0x500] = {0 }; - //The previous byte is a message type, and the following 52 bytes are drive-related properties -BYTE bufferdata[0x1000] = {0 }; - CharFilesystem[max_path] = {0 }; - Char*travel =NULL; - inGetLogicalDriveStrings (sizeof(volumedevicestring), volumedevicestring); - to + //Get drive Information - /* the 0x001ff228 3a 5c (3a) 5c 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 The xx xx xx (c) xx xx xx at xx. E:\ ........ * */ $ Panax Notoginseng //0018f460 3 A 5C 3 a 5C 3 a 5C xx 3 a c \. D:\. E:\. F: - //0018f46e 5C 3 A 5C 3 a 5C 4 a 3 a 5C 00 \. G:\. H:\. J:\. theTravel =volumedevicestring; + ADWORD Offset =0; the for(Offset =1; *travel! =' /'; Travel + = Lstrlen (travel) +1)//+1 here for the sake of. + { -memset (FileSystem,0,sizeof(FileSystem));//File System NTFS $ $ //get file system information and size -GetVolumeInformation (Travel, NULL,0, NULL, NULL, NULL, FileSystem, MAX_PATH); -ULONG filesystemlength = lstrlen (FileSystem) +1; the - intA =0;Wuyi } the - Wu}
Get drive information volume device &&ring3 get Disk File system (NTFS WIN10)