From cc6b3bbb58d5bd7c8b6e2e68a9df967e3eba7fd2 Mon Sep 17 00:00:00 2001 From: DavidXanatos <3890945+DavidXanatos@users.noreply.github.com> Date: Sat, 16 Dec 2023 21:55:54 +0100 Subject: [PATCH] 1.12.4 --- CHANGELOG.md | 1 + SandboxiePlus/SandMan/Helpers/StorageInfo.cpp | 10 ++++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 69749abb..223fa256 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - fixed UseNewSymlinkResolver causes applications to create both the link and the target folder [#3481](https://github.com/sandboxie-plus/Sandboxie/issues/3481) - fixed Renaming a sandbox breaks Group hierarchy [#3430](https://github.com/sandboxie-plus/Sandboxie/issues/3430) - fixed Encrypted confidential Box + red box preset blocks box access to it's own root directories [#3475](https://github.com/sandboxie-plus/Sandboxie/issues/3475) +- fixed SandMan-v1.12.3 crashed! [#3492](https://github.com/sandboxie-plus/Sandboxie/issues/3492) diff --git a/SandboxiePlus/SandMan/Helpers/StorageInfo.cpp b/SandboxiePlus/SandMan/Helpers/StorageInfo.cpp index e608dd99..0c5fee21 100644 --- a/SandboxiePlus/SandMan/Helpers/StorageInfo.cpp +++ b/SandboxiePlus/SandMan/Helpers/StorageInfo.cpp @@ -229,10 +229,10 @@ std::wstring QueryDiskDeviceInterfaceString(PWSTR DeviceInterface, CONST DEVPROP WCHAR deviceInstanceId[MAX_DEVICE_ID_LEN + 1] = L""; if (CM_Get_Device_Interface_Property(DeviceInterface, &DEVPKEY_Device_InstanceId, &devicePropertyType, (PBYTE)deviceInstanceId, &deviceInstanceIdLength, 0 ) != CR_SUCCESS) - return FALSE; + return L""; if (CM_Locate_DevNode(&deviceInstanceHandle, deviceInstanceId, CM_LOCATE_DEVNODE_PHANTOM ) != CR_SUCCESS) - return FALSE; + return L""; bufferSize = 0x40; std::wstring deviceDescription; @@ -290,9 +290,11 @@ std::map ListAllDrives() if (DeviceIoControl(deviceHandle, IOCTL_STORAGE_GET_DEVICE_NUMBER, NULL, 0, &result, sizeof(result), &dwRet, NULL)) { std::wstring name = QueryDiskDeviceInterfaceString(deviceInterface, &DEVPKEY_Device_FriendlyName); - std::wstring enumerator = QueryDiskDeviceInterfaceString(deviceInterface, &DEVPKEY_Device_EnumeratorName); + if (!name.empty()) { + std::wstring enumerator = QueryDiskDeviceInterfaceString(deviceInterface, &DEVPKEY_Device_EnumeratorName); - drives[pdevice->prefix + std::to_wstring(result.DeviceNumber)] = SDriveInfo{ name , deviceInterface , enumerator}; + drives[pdevice->prefix + std::to_wstring(result.DeviceNumber)] = SDriveInfo{ name , deviceInterface , enumerator }; + } } // else // not connected