Skip to content

Commit

Permalink
prep for memory management
Browse files Browse the repository at this point in the history
  • Loading branch information
freedom7341 committed Sep 22, 2023
1 parent 6943fc5 commit 24a17d0
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 4 deletions.
3 changes: 3 additions & 0 deletions progmgr/dialog.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions progmgr/group.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
18 changes: 18 additions & 0 deletions progmgr/memmgmt.c
Original file line number Diff line number Diff line change
@@ -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 changes: 15 additions & 0 deletions progmgr/memmgmt.h
Original file line number Diff line number Diff line change
@@ -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>
7 changes: 4 additions & 3 deletions progmgr/progmgr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
2 changes: 2 additions & 0 deletions progmgr/progmgr.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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" />
Expand All @@ -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" />
Expand Down
6 changes: 6 additions & 0 deletions progmgr/progmgr.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand All @@ -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">
Expand Down
2 changes: 1 addition & 1 deletion progmgr/registry.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 24a17d0

Please sign in to comment.