prep for memory management

This commit is contained in:
freedom7341
2023-09-22 14:17:16 -06:00
parent 6943fc563b
commit 24a17d0287
8 changed files with 50 additions and 4 deletions

View File

@@ -88,6 +88,9 @@ BOOL CALLBACK NewGroupDlgProc(HWND hWndDlg, UINT message, WPARAM wParam, LPARAM
// Disable the OK button since we're starting with no text in the box.
EnableWindow(GetDlgItem(hWndDlg, IDD_OK), bOKEnabled);
// Enable the common group checkbox if perms are good
EnableWindow(GetDlgItem(hWndDlg, IDD_COMMGROUP), bPermAdmin);
break;
case WM_COMMAND:

View File

@@ -97,6 +97,7 @@ HWND CreateGroupWindow(GROUP grp)
// of group pointers in PGARRAY, then pass this to
// the group window in that little pointer thing :D
// Get group minimized/maximized flags
mcs.szClass = szGrpClass;

18
progmgr/memmgmt.c Normal file
View File

@@ -0,0 +1,18 @@
/* * * * * * * *\
MEMMGMT.C -
Copyright (c) 2023 Vortesys
DESCRIPTION -
Program Manager's memory management functions
LICENSE INFORMATION -
MIT License, see LICENSE.txt in the root folder
\* * * * * * * */
/* Headers */
#include "memmgmt.h"
// #define WIN32_LEAN_AND_MEAN
#include <Windows.h>
/* Variables */
/* Functions */

15
progmgr/memmgmt.h Normal file
View File

@@ -0,0 +1,15 @@
/* * * * * * * *\
MEMMGMT.H -
Copyright (c) 2023 Vortesys
DESCRIPTION -
Header containing the functions and variables
related to Program Manager's memory management.
LICENSE INFORMATION -
MIT License, see LICENSE.txt in the root folder
\* * * * * * * */
/* Pragmas */
#pragma once
/* Includes */
#include <wtypes.h>

View File

@@ -53,9 +53,10 @@ BOOL bPermPower; // Has power option permissions
\* * * */
BOOL UpdatePermissions(VOID)
{
bPermAdmin = SE_SHUTDOWN_NAME;
bPermGuest = SE_SHUTDOWN_NAME;
bPermPower = SE_SHUTDOWN_NAME;
// SE_SHUTDOWN_NAME
bPermAdmin = FALSE;
bPermGuest = FALSE;
bPermPower = FALSE;
return FALSE;
}

View File

@@ -168,6 +168,7 @@
<ClInclude Include="dialog.h" />
<ClInclude Include="group.h" />
<ClInclude Include="grpupdat.h" />
<ClInclude Include="memmgmt.h" />
<ClInclude Include="progmgr.h" />
<ClInclude Include="registry.h" />
<ClInclude Include="resource.h" />
@@ -176,6 +177,7 @@
<ClCompile Include="desktop.c" />
<ClCompile Include="desktop2.c" />
<ClCompile Include="dialog.c" />
<ClCompile Include="memmgmt.c" />
<ClCompile Include="progmgr.c" />
<ClCompile Include="registry.c" />
<ClCompile Include="group.c" />

View File

@@ -36,6 +36,9 @@
<ClInclude Include="dialog.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="memmgmt.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="progmgr.c">
@@ -62,6 +65,9 @@
<ClCompile Include="desktop2.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="memmgmt.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="resource.rc">

View File

@@ -148,7 +148,7 @@ DWORD LoadGroupFromRegistry(_Inout_ PGROUP pg, _Out_ PDWORD pdwBufferSize)
// TODO: rethink this
// If the pointer is invalid then fail out
if (pg == NULL | pdwBufferSize == NULL)
if ((pg == NULL) | (pdwBufferSize == NULL))
return RCE_FAILURE;
// Load group