Skip to content

Commit

Permalink
work is happening
Browse files Browse the repository at this point in the history
  • Loading branch information
freedom7341 committed Sep 15, 2023
1 parent d16b725 commit 48c8f54
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 14 deletions.
2 changes: 1 addition & 1 deletion progmgr/desktop.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ HWND CreateListView(HWND hWndParent, RECT rc);
RETURNS -
True if successful, false if unsuccessful.
\* * * */
BOOL CreateDesktopWindow()
BOOL CreateDesktopWindow(VOID)
{
MSG msg = { 0 };
WNDCLASSEX wc = { 0 };
Expand Down
4 changes: 2 additions & 2 deletions progmgr/progmgr.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ extern WCHAR szClass[16];

/* Function Prototypes */
// DESKTOP.C
BOOL CreateDesktopWindow();// SYSINT.C
BOOL CreateDesktopWindow(VOID);// SYSINT.C
// SYSINT.C
BOOL RunFileDlg(HWND hWndOwner, HICON hIcon, LPWSTR lpszDir, LPWSTR lpszTitle, LPWSTR lpszDesc, DWORD dwFlags);
BOOL ExitWindowsDialog(HWND hWndOwner);
Expand All @@ -55,4 +55,4 @@ BOOL SetShellWindow(HWND hWndShell);
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
LRESULT CALLBACK CmdProc(HWND hWnd, WPARAM wParam, LPARAM lParam);
VOID UpdateChecks(BOOL bVarMenu, UINT uSubMenu, UINT uID);
VOID UpdateWindowTitle();
VOID UpdateWindowTitle(VOID);
1 change: 0 additions & 1 deletion progmgr/progmgr.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@
<ClInclude Include="dialog.h" />
<ClInclude Include="group.h" />
<ClInclude Include="grpupdat.h" />
<ClInclude Include="perms.h" />
<ClInclude Include="progmgr.h" />
<ClInclude Include="registry.h" />
<ClInclude Include="resource.h" />
Expand Down
3 changes: 0 additions & 3 deletions progmgr/progmgr.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@
<ClInclude Include="dialog.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="perms.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="progmgr.c">
Expand Down
13 changes: 8 additions & 5 deletions progmgr/registry.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ PWSTR pszSettings = L"Settings";
// Settings Subkeys
PWSTR pszSettingsWindow = L"Window";
PWSTR pszSettingsMask = L"SettingsMask";
// Permissions (Global)

/* Functions */

Expand All @@ -51,7 +52,7 @@ PWSTR pszSettingsMask = L"SettingsMask";
RETURNS -
TRUE if successful, FALSE if unsuccessful.
\* * * */
BOOL InitializeRegistryKeys()
BOOL InitializeRegistryKeys(VOID)
{
if (!RegCreateKeyEx(HKEY_CURRENT_USER, PROGMGR_KEY, 0, szProgMgr, 0,
KEY_READ | KEY_WRITE, NULL, &hKeyProgramManager, NULL))
Expand All @@ -74,7 +75,7 @@ BOOL InitializeRegistryKeys()
TRUE if Program Manager is the default shell,
FALSE if otherwise or an error occurs.
\* * * */
BOOL IsProgMgrDefaultShell()
BOOL IsProgMgrDefaultShell(VOID)
{
HKEY hKeyWinlogon;
WCHAR szShell[HKEYMAXLEN] = L"";
Expand Down Expand Up @@ -139,18 +140,20 @@ DWORD SaveGroupToRegistry(_In_ PGROUP pg)
RETURNS -
RCE_* configuration error value
\* * * */
DWORD LoadGroupFromRegistry(_Inout_ PGROUP pg, _Out_ DWORD dwBufferSize)
DWORD LoadGroupFromRegistry(_Inout_ PGROUP pg, _Out_ PDWORD pdwBufferSize)
{
DWORD dwConfigStatus = RCE_SUCCESS;
DWORD dwType = REG_BINARY;

// TODO: rethink this

// If the pointer is invalid then fail out
if (pg == NULL)
if (pg == NULL | pdwBufferSize == NULL)
return RCE_FAILURE;

// Load group
if (!RegQueryValueEx(hKeyProgramGroups, pg->szName, 0, &dwType,
(LPBYTE)pg, &dwBufferSize) == ERROR_SUCCESS)
(LPBYTE)pg, pdwBufferSize) == ERROR_SUCCESS)
dwConfigStatus = dwConfigStatus && RCE_POSITION;

return dwConfigStatus;
Expand Down
7 changes: 6 additions & 1 deletion progmgr/registry.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,18 @@ extern BOOL bTopMost;
extern BOOL bShowUsername;
extern BOOL bSaveSettings;
extern RECT rcMainWindow;
// Permissions
extern BOOL bPermAdmin; // Has Administrator permissions
extern BOOL bPermGuest; // Has Guest permissions
extern BOOL bPermPower; // Has power option permissions

/* Function Prototypes */
BOOL InitializeRegistryKeys(VOID);
BOOL IsProgMgrDefaultShell(VOID);
// Groups
DWORD SaveGroupToRegistry(_In_ PGROUP pg);
DWORD LoadGroupFromRegistry(_Inout_ PGROUP pg, _Out_ DWORD dwBufferSize);
DWORD LoadGroupFromRegistry(_Inout_ PGROUP pg, _Out_ PDWORD pdwBufferSize);
// Settings
DWORD SaveConfig(BOOL bSettings, BOOL bPos, BOOL bGroups);
DWORD LoadConfig(BOOL bSettings, BOOL bPos, BOOL bGroups);
// Permissions
2 changes: 1 addition & 1 deletion progmgr/wndproc.c
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ VOID UpdateChecks(BOOL bVarMenu, UINT uSubMenu, UINT uID)
RETURNS -
Nothing!
\* * * */
VOID UpdateWindowTitle()
VOID UpdateWindowTitle(VOID)
{
WCHAR szUsername[UNLEN + 1] = L"";
DWORD dwUsernameLen = UNLEN;
Expand Down

0 comments on commit 48c8f54

Please sign in to comment.