diff --git a/progmgr/desktop.c b/progmgr/desktop.c index 20e5825..f313605 100644 --- a/progmgr/desktop.c +++ b/progmgr/desktop.c @@ -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 }; diff --git a/progmgr/progmgr.h b/progmgr/progmgr.h index 447c817..b4b3ffe 100644 --- a/progmgr/progmgr.h +++ b/progmgr/progmgr.h @@ -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); @@ -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); diff --git a/progmgr/progmgr.vcxproj b/progmgr/progmgr.vcxproj index 0642c6a..3258dcd 100644 --- a/progmgr/progmgr.vcxproj +++ b/progmgr/progmgr.vcxproj @@ -168,7 +168,6 @@ - diff --git a/progmgr/progmgr.vcxproj.filters b/progmgr/progmgr.vcxproj.filters index 6924698..eced364 100644 --- a/progmgr/progmgr.vcxproj.filters +++ b/progmgr/progmgr.vcxproj.filters @@ -36,9 +36,6 @@ Header Files - - Header Files - diff --git a/progmgr/registry.c b/progmgr/registry.c index 3765e9b..1189014 100644 --- a/progmgr/registry.c +++ b/progmgr/registry.c @@ -41,6 +41,7 @@ PWSTR pszSettings = L"Settings"; // Settings Subkeys PWSTR pszSettingsWindow = L"Window"; PWSTR pszSettingsMask = L"SettingsMask"; +// Permissions (Global) /* Functions */ @@ -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)) @@ -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""; @@ -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; diff --git a/progmgr/registry.h b/progmgr/registry.h index bda91bc..bccfa8a 100644 --- a/progmgr/registry.h +++ b/progmgr/registry.h @@ -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 diff --git a/progmgr/wndproc.c b/progmgr/wndproc.c index 1c19ad9..cd700e0 100644 --- a/progmgr/wndproc.c +++ b/progmgr/wndproc.c @@ -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;