From ff8d4b46ef1fff095bd8bdaef3164dec5dd55a5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Sun, 22 Mar 2026 20:21:11 +0800 Subject: [PATCH] Icons (Windows): handles the case when users never changes the default settings --- src/detection/icons/icons_windows.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/detection/icons/icons_windows.c b/src/detection/icons/icons_windows.c index 8aa75e2de..79f6cfe09 100644 --- a/src/detection/icons/icons_windows.c +++ b/src/detection/icons/icons_windows.c @@ -6,7 +6,11 @@ const char* ffDetectIcons(FFIconsResult* result) FF_AUTO_CLOSE_FD HANDLE hKey = NULL; if(!ffRegOpenKeyForRead(HKEY_CURRENT_USER, L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\HideDesktopIcons\\NewStartPanel", &hKey, NULL) && !ffRegOpenKeyForRead(HKEY_CURRENT_USER, L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\HideDesktopIcons\\ClassicStartMenu", &hKey, NULL)) - return "ffRegOpenKeyForRead(Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\HideDesktopIcons\\{NewStartPanel|ClassicStartMenu}) failed"; + { + // If the key doesn't exist, it means that the user never changed the default settings. + ffStrbufSetStatic(&result->icons2, "Recycle Bin"); + return NULL; + } // Whether these icons are hidden uint32_t ThisPC = 1, UsersFiles = 1, RemoteNetwork = 1, RecycleBin = 0 /* Shown by default */, ControlPanel = 1;