GROUPS LOAD
This commit is contained in:
@@ -78,7 +78,11 @@ BOOL InitializeGroups(VOID)
|
|||||||
if (!RegisterClassEx(&wce))
|
if (!RegisterClassEx(&wce))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
// TODO: go thru registry and load all saved groups here
|
// Now we can create the groups
|
||||||
|
if(LoadConfig(FALSE, FALSE, TRUE) != RCE_SUCCESS)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
// TODO: if loading groups fails, throw an error
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -331,14 +331,15 @@ DWORD LoadConfig(_In_ BOOL bSettings, _In_ BOOL bPos, _In_ BOOL bGroups)
|
|||||||
while (cGroupKeys >= cGroupIndex)
|
while (cGroupKeys >= cGroupIndex)
|
||||||
{
|
{
|
||||||
WCHAR szValueName[MAX_TITLE_LENGTH] = TEXT("");
|
WCHAR szValueName[MAX_TITLE_LENGTH] = TEXT("");
|
||||||
UINT cbValueName = 0;
|
UINT cbValueName = sizeof(szValueName);
|
||||||
|
DWORD dwTemp = 0;
|
||||||
|
|
||||||
// TODO: figure out where i'm really going to store the
|
// TODO: figure out where i'm really going to store the
|
||||||
// group name, if not in the group structure then in
|
// group name, if not in the group structure then in
|
||||||
// the name of the registry key (val 3 here)
|
// the name of the registry key (val 3 here)
|
||||||
|
|
||||||
// get the size of the group
|
// get the size of the group
|
||||||
RegEnumValue(hKeyProgramGroups, cGroupIndex, (LPWSTR)szValueName,
|
RegEnumValue(hKeyProgramGroups, cGroupIndex, szValueName,
|
||||||
&cbValueName, NULL, &dwType, NULL, &cbGroup);
|
&cbValueName, NULL, &dwType, NULL, &cbGroup);
|
||||||
|
|
||||||
// allocate and zero memory for the group
|
// allocate and zero memory for the group
|
||||||
@@ -346,12 +347,8 @@ DWORD LoadConfig(_In_ BOOL bSettings, _In_ BOOL bPos, _In_ BOOL bGroups)
|
|||||||
ZeroMemory(pGroup, cbGroup);
|
ZeroMemory(pGroup, cbGroup);
|
||||||
|
|
||||||
// get the group
|
// get the group
|
||||||
RegQueryValueEx(hKeyProgramGroups, (LPWSTR)szValueName, NULL,
|
dwTemp = RegQueryValueEx(hKeyProgramGroups, szValueName, NULL,
|
||||||
&dwType, (LPBYTE)pGroup, &cbGroup);
|
&dwType, pGroup, &cbGroup);
|
||||||
/*
|
|
||||||
RegGetValue(hKeyProgramGroups, NULL, (LPWSTR)szValueName,
|
|
||||||
RRF_RT_REG_BINARY, &dwType, (LPBYTE)pGroup, &cbGroup);
|
|
||||||
*/
|
|
||||||
|
|
||||||
// verify part of the group is valid
|
// verify part of the group is valid
|
||||||
// TODO: use checksums instead of/alongside signatures
|
// TODO: use checksums instead of/alongside signatures
|
||||||
|
|||||||
@@ -35,11 +35,6 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
|||||||
|
|
||||||
case WM_CREATE:
|
case WM_CREATE:
|
||||||
{
|
{
|
||||||
// Now we can create the groups
|
|
||||||
if(LoadConfig(FALSE, FALSE, TRUE) != RCE_SUCCESS)
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
// TODO: if loading groups fails, throw an error
|
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user