feat: added Files app USB medium detection

This commit is contained in:
2026-05-18 20:00:42 +02:00
parent 2ceefaf1ca
commit 47e3bb54a5
14 changed files with 50 additions and 2 deletions
+12
View File
@@ -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;