load group wip
This commit is contained in:
@@ -64,7 +64,7 @@ typedef struct _GROUP {
|
|||||||
INT iIconIndex;
|
INT iIconIndex;
|
||||||
// Items
|
// Items
|
||||||
WORD cItemArray; // Number of items in pItemArray
|
WORD cItemArray; // Number of items in pItemArray
|
||||||
ITEM pItemArray; // Array of items
|
ITEM pItemArray[1]; // Array of items
|
||||||
} GROUP, * PGROUP;
|
} GROUP, * PGROUP;
|
||||||
|
|
||||||
/* Global Variables */
|
/* Global Variables */
|
||||||
|
|||||||
@@ -148,8 +148,10 @@ DWORD RegistryLoadGroup(_Inout_ PGROUP pg, _Out_ PDWORD pdwBufferSize)
|
|||||||
|
|
||||||
// TODO: rethink this
|
// TODO: rethink this
|
||||||
|
|
||||||
// If the pointer is invalid then fail out
|
// If the pointers are invalid then fail out
|
||||||
if ((pg == NULL) | (pdwBufferSize == NULL))
|
if (pg == NULL)
|
||||||
|
return RCE_FAILURE;
|
||||||
|
if (pdwBufferSize == NULL)
|
||||||
return RCE_FAILURE;
|
return RCE_FAILURE;
|
||||||
|
|
||||||
// Load group
|
// Load group
|
||||||
@@ -306,8 +308,32 @@ DWORD LoadConfig(_In_ BOOL bSettings, _In_ BOOL bPos, _In_ BOOL bGroups)
|
|||||||
|
|
||||||
if (bGroups)
|
if (bGroups)
|
||||||
{
|
{
|
||||||
// TODO: this is unbearable
|
DWORD dwBufferSize = sizeof(dwSettingsMask);
|
||||||
dwConfigStatus = dwConfigStatus && RCE_GROUPS;
|
DWORD dwType = REG_BINARY;
|
||||||
|
PGROUP pgrp = NULL;
|
||||||
|
UINT cGroupKeys = 0;
|
||||||
|
UINT cGroupCycle = 0;
|
||||||
|
|
||||||
|
if (!RegQueryInfoKey(hKeyProgramGroups, NULL, NULL, NULL,
|
||||||
|
NULL, NULL, NULL, &cGroupKeys,
|
||||||
|
NULL, NULL, NULL, NULL) == ERROR_SUCCESS)
|
||||||
|
{
|
||||||
|
dwConfigStatus = dwConfigStatus && RCE_SETTINGS;
|
||||||
|
|
||||||
|
// I can get away with returning here upon
|
||||||
|
// failure since this is the last one
|
||||||
|
return dwConfigStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cGroupKeys < 1)
|
||||||
|
{
|
||||||
|
while (cGroupKeys >= cGroupCycle)
|
||||||
|
{
|
||||||
|
|
||||||
|
// increment
|
||||||
|
cGroupCycle++;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return dwConfigStatus;
|
return dwConfigStatus;
|
||||||
|
|||||||
Reference in New Issue
Block a user