feat: added Files app USB medium detection
This commit is contained in:
@@ -142,6 +142,18 @@ namespace Fs::FsProbe {
|
||||
return -1;
|
||||
}
|
||||
|
||||
int GetBlockDeviceForDrive(int driveNum) {
|
||||
if (driveNum < 0) return -1;
|
||||
int partCount = Drivers::Storage::Gpt::GetPartitionCount();
|
||||
for (int i = 0; i < partCount && i < Drivers::Storage::Gpt::MaxPartitions; i++) {
|
||||
if (g_mounted[i] && g_driveForPart[i] == driveNum) {
|
||||
auto* part = Drivers::Storage::Gpt::GetPartition(i);
|
||||
if (part) return part->BlockDevIndex;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
int UnmountPartitionsForBlockDevice(int blockDevIndex) {
|
||||
int partCount = Drivers::Storage::Gpt::GetPartitionCount();
|
||||
int unmounted = 0;
|
||||
|
||||
Reference in New Issue
Block a user