make item batch count a define instead of being as hard-coded

This commit is contained in:
freedom
2023-10-13 08:26:03 -06:00
parent f718eb4d51
commit 475d868825
2 changed files with 4 additions and 2 deletions

View File

@@ -417,8 +417,8 @@ UINT CalculateGroupMemory(_In_ PGROUP pGroup, _In_ UINT cItems)
// have some memory ready
cItemBlock = pGroup->cItemArray + cItems;
// round the amount of items to the nearest but highest 16
cItemBlock = ((cItemBlock + 16) / 16) * 16;
// round the amount of items to the nearest but highest ITEM_BATCH_COUNT
cItemBlock = ((cItemBlock + ITEM_BATCH_COUNT) / ITEM_BATCH_COUNT) * ITEM_BATCH_COUNT;
// finally calculate the total group size
cbGroupSize += cItemBlock * sizeof(ITEM);

View File

@@ -17,6 +17,7 @@
#define MAX_GROUPS 512
#define MAX_ITEMS 512
#define MAX_TITLE_LENGTH 255 // Same as the registry key name max length
#define ITEM_BATCH_COUNT 8
// Group Format Definitions
#define GRP_SIGNATURE 0x47324D50L // PM2G
#define GRP_VERSION 2 // Increment for breaking changes, format version
@@ -28,6 +29,7 @@
// Item Flag Values (DWORD)
#define ITM_FLAG_MINIMIZED 0x00000001
#define ITM_FLAG_MAXIMIZED 0x00000002
#define ITM_FLAG_PRIVILEGE 0x00000004
/* Structures */
// Item Structure