From 364afc74388e1f40358a6142c4a6b0e6d34877cd Mon Sep 17 00:00:00 2001 From: freedom Date: Fri, 11 Aug 2023 01:59:43 -0600 Subject: [PATCH] fixed it --- progmgr/registry.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/progmgr/registry.c b/progmgr/registry.c index 589836a..881f452 100644 --- a/progmgr/registry.c +++ b/progmgr/registry.c @@ -125,6 +125,7 @@ DWORD SaveGroupToRegistry(_In_ PGROUP pg) if (pg == NULL) return RCE_FAILURE; + // Save group if (!RegSetValueEx(hKeyProgramGroups, pg->szGroupName, 0, REG_BINARY, (const BYTE*)pg, (sizeof(*pg) + sizeof(ITEM) * pg->cItems)) == ERROR_SUCCESS) dwConfigStatus = dwConfigStatus && RCE_GROUPS; @@ -141,14 +142,13 @@ DWORD SaveGroupToRegistry(_In_ PGROUP pg) DWORD LoadGroupFromRegistry(_Inout_ PGROUP pg, _Out_ DWORD dwBufferSize) { DWORD dwConfigStatus = RCE_SUCCESS; - DWORD dwBufferSize = (sizeof(*pg) + sizeof(ITEM) * pg->cItems); DWORD dwType = REG_BINARY; // If the pointer is invalid then fail out if (pg == NULL) return RCE_FAILURE; - // Load window position + // Load group if (!RegQueryValueEx(hKeyProgramGroups, pg->szGroupName, 0, &dwType, (LPBYTE)pg, &dwBufferSize) == ERROR_SUCCESS) dwConfigStatus = dwConfigStatus && RCE_POSITION;