From ef4bb7a57e9396c8415ea0c9cd4c1f12781ab302 Mon Sep 17 00:00:00 2001 From: Duke Manchester Date: Fri, 26 Jun 2026 11:05:33 -0600 Subject: [PATCH] avoid running 'GetVolumeInformationW' on network drives --- drivers/windows/dir_access_windows.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/windows/dir_access_windows.cpp b/drivers/windows/dir_access_windows.cpp index d4dab4e533bd..0e7d021f4c76 100644 --- a/drivers/windows/dir_access_windows.cpp +++ b/drivers/windows/dir_access_windows.cpp @@ -143,6 +143,11 @@ void DirAccessWindows::_update_drives() { String drive = String::chr('A' + i) + ':'; String path = drive + '\\'; String label; + UINT type = GetDriveTypeW((LPCWSTR)(path).utf16().get_data()); + if (type == DRIVE_REMOTE) { + drives.push_back(DriveInfo{ drive, "[network]" }); + continue; + } char16_t wlabel[4096]; if (GetVolumeInformationW((LPCWSTR)(path).utf16().get_data(), (LPWSTR)wlabel, 4096, nullptr, nullptr, nullptr, nullptr, 0)) { label = String::utf16(wlabel);