From 5e6f59f946857b659f0ac4f829d3c64a1c73e4b3 Mon Sep 17 00:00:00 2001 From: freedom7341 Date: Thu, 28 Sep 2023 10:49:42 -0600 Subject: [PATCH] make it compile again --- progmgr/group.c | 9 ++------- progmgr/group.h | 4 ++-- progmgr/resource.h | Bin 6700 -> 6756 bytes 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/progmgr/group.c b/progmgr/group.c index f027eb4..326ed3d 100644 --- a/progmgr/group.c +++ b/progmgr/group.c @@ -99,7 +99,7 @@ HWND CreateGroupWindow(GROUP grp) // Unless... this just works a different way and I don't have to // keep track of all these stupid little pointers... since I can // just associate this with the appropriate window. - pGroup = (PGROUP)malloc(sizeof(grp) + sizeof(ITEM) * grp.cItemArray); + pGroup = (PGROUP)malloc(sizeof(grp) + sizeof(ITEM) * (grp.cItemArray + 1)); // Get group minimized/maximized flags @@ -124,7 +124,7 @@ HWND CreateGroupWindow(GROUP grp) return NULL; // Associate the group structure pointer to the group window - SetWindowLongPtr(hWndGroup, GWLP_USERDATA, pGroup); + SetWindowLongPtr(hWndGroup, GWLP_USERDATA, (LONG_PTR)pGroup); // Load the group icon if (ExtractIconEx(grp.szIconPath, grp.iIconIndex, &hIconLarge, &hIconSmall, 1)) @@ -164,11 +164,6 @@ BOOL RemoveGroupWindow(HWND hWndGroup) // should group deletion be "abstracted" here or should i handle windows // and groups separately? - if ((hGroupHeap = GetWindowLongPtr(hWndGroup, GWLP_USERDATA)) != NULL) - { - if (HeapDestroy(hGroupHeap)) - return TRUE; - } return FALSE; } diff --git a/progmgr/group.h b/progmgr/group.h index f134754..4f97e26 100644 --- a/progmgr/group.h +++ b/progmgr/group.h @@ -13,10 +13,10 @@ /* Definitions */ #define MAX_GROUPS 512 #define MAX_ITEMS 512 -#define MAX_TITLE_LENGTH MAX_PATH +#define MAX_TITLE_LENGTH 255 // Same as the registry key name max length // Group Format Definitions #define GRP_SIGNATURE 0x47324D50L // PM2G -#define GRP_VERSION 1 // Increment for breaking changes +#define GRP_VERSION 2 // Increment for breaking changes, format version // Group Flag Values (DWORD) #define GRP_FLAG_COMMON 0x00000001 #define GRP_FLAG_READONLY 0x00000002 diff --git a/progmgr/resource.h b/progmgr/resource.h index 609b87d768546bc63faeddc6c80de113990b9005..4a357c5bbd63eeb59b390498f74932ee06f46256 100644 GIT binary patch delta 40 ucmZ2u^2B6=j@0BAVltB_NU}%-F!(csGq^GYF>nH*F@phv2?H+!7XtwAF9<;Z delta 7 OcmaE2vc_bCjuZe6DFW{R