mirror of
https://github.com/vxunderground/VXUG-Papers.git
synced 2026-06-16 07:49:26 +00:00
Add files via upload
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
#include <windows.h>
|
||||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
|
||||
std::vector<std::string> getListOfDrives() {
|
||||
std::vector<std::string> arrayOfDrives;
|
||||
char* szDrives = new char[MAX_PATH]();
|
||||
|
||||
if (GetLogicalDriveStringsA(MAX_PATH, szDrives));
|
||||
|
||||
for (int i = 0; i < 100; i += 4)
|
||||
if (szDrives[i] != (char)0)
|
||||
arrayOfDrives.push_back(std::string{ szDrives[i],szDrives[i + 1],szDrives[i + 2] });
|
||||
delete[] szDrives;
|
||||
return arrayOfDrives;
|
||||
}
|
||||
Reference in New Issue
Block a user