MCPcopy Create free account
hub / github.com/PCSX2/pcsx2 / GetValidDrive

Function GetValidDrive

pcsx2/CDVD/Windows/DriveUtility.cpp:24–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22}
23
24void GetValidDrive(std::string& drive)
25{
26 if (drive.empty() || GetDriveTypeA(drive.c_str()) != DRIVE_CDROM)
27 {
28 auto drives = GetOpticalDriveList();
29 if (drives.empty())
30 {
31 drive.clear();
32 return;
33 }
34 drive = drives.front();
35 }
36
37 printf(" * CDVD: Opening drive '%s'...\n", drive.data());
38
39 // The drive string has the form "X:\", but to open the drive, the string
40 // has to be in the form "\\.\X:"
41 drive.pop_back();
42 drive.insert(0, "\\\\.\\");
43}

Callers

nothing calls this directly

Calls 9

printfFunction · 0.85
GetOpticalDriveListFunction · 0.70
emptyMethod · 0.45
c_strMethod · 0.45
clearMethod · 0.45
frontMethod · 0.45
dataMethod · 0.45
pop_backMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected