From 28e7fa0ad7589e0f8f75ace33a0452addd9ccaa0 Mon Sep 17 00:00:00 2001 From: freedom Date: Mon, 4 Dec 2023 13:29:59 -0700 Subject: [PATCH] registry file update --- progmgr/registry.c | 41 ++++++----------------------------------- progmgr/registry.h | 1 - 2 files changed, 6 insertions(+), 36 deletions(-) diff --git a/progmgr/registry.c b/progmgr/registry.c index 598bd9b..a9b7852 100644 --- a/progmgr/registry.c +++ b/progmgr/registry.c @@ -135,33 +135,6 @@ DWORD RegistrySaveGroup(_In_ PGROUP pg) return dwConfigStatus; } -/* * * *\ - RegistryLoadGroup - - Loads a group structure from the registry. - RETURNS - - RCE_* configuration error value -\* * * */ -DWORD RegistryLoadGroup(_Inout_ PGROUP pg, _Out_ DWORD dwBufferSize) -{ - DWORD dwConfigStatus = RCE_SUCCESS; - DWORD dwType = REG_BINARY; - - dwBufferSize = 0; - - // TODO: rethink this - - // If the pointers are invalid then fail out - if (pg == NULL) - return RCE_FAILURE; - - // Load group - if (!RegQueryValueEx(hKeyProgramGroups, pg->szName, 0, &dwType, - (LPBYTE)pg, &dwBufferSize) == ERROR_SUCCESS) - dwConfigStatus = dwConfigStatus && RCE_POSITION; - - return dwConfigStatus; -} - /* * * *\ SaveConfig - Finds and collapses all settings @@ -192,7 +165,7 @@ DWORD SaveConfig(_In_ BOOL bSettings, _In_ BOOL bPos, _In_ BOOL bGroups, _In_ BO if (bPos) { - WINDOWPLACEMENT wpProgMgr; + WINDOWPLACEMENT wpProgMgr = { 0 }; RECT rcWindow; // Get and save window position @@ -209,10 +182,6 @@ DWORD SaveConfig(_In_ BOOL bSettings, _In_ BOOL bPos, _In_ BOOL bGroups, _In_ BO { HWND hWndGroup = NULL; - // TODO: Get list of groups, iterate through, - // save each one as an individual subkey based - // on the name of the group - EnumChildWindows(hWndMDIClient, &SaveWindowEnumProc, (LPARAM)bExit); } @@ -349,11 +318,13 @@ DWORD LoadConfig(_In_ BOOL bSettings, _In_ BOOL bPos, _In_ BOOL bGroups) (LPBYTE)pGroup, &cbGroup); // load the group - CreateGroup(pGroup); - - // free memory if (pGroup) + { + CreateGroup(pGroup); + + // free memory free(pGroup); + } // increment cGroupIndex++; diff --git a/progmgr/registry.h b/progmgr/registry.h index b2bbe7c..1be396a 100644 --- a/progmgr/registry.h +++ b/progmgr/registry.h @@ -51,7 +51,6 @@ BOOL InitializeRegistryKeys(VOID); BOOL IsProgMgrDefaultShell(VOID); // Groups DWORD RegistrySaveGroup(_In_ PGROUP pg); -DWORD RegistryLoadGroup(_Inout_ PGROUP pg, _Out_ DWORD dwBufferSize); // Settings DWORD SaveConfig(_In_ BOOL bSettings, _In_ BOOL bPos, _In_ BOOL bGroups, _In_ BOOL bExit); DWORD LoadConfig(_In_ BOOL bSettings, _In_ BOOL bPos, _In_ BOOL bGroups);