Author: ekohl
Date: Sat Nov 3 17:39:08 2007
New Revision: 30090
URL:
http://svn.reactos.org/svn/reactos?rev=30090&view=rev
Log:
Coding style clean-up. No code changes.
Modified:
trunk/reactos/dll/cpl/sysdm/advanced.c
trunk/reactos/dll/cpl/sysdm/general.c
trunk/reactos/dll/cpl/sysdm/hardprof.c
trunk/reactos/dll/cpl/sysdm/hardware.c
trunk/reactos/dll/cpl/sysdm/licence.c
trunk/reactos/dll/cpl/sysdm/resource.h
trunk/reactos/dll/cpl/sysdm/startrec.c
trunk/reactos/dll/cpl/sysdm/sysdm.c
trunk/reactos/dll/cpl/sysdm/userprofile.c
trunk/reactos/dll/cpl/sysdm/virtmem.c
Modified: trunk/reactos/dll/cpl/sysdm/advanced.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/sysdm/advanced.c?r…
==============================================================================
--- trunk/reactos/dll/cpl/sysdm/advanced.c (original)
+++ trunk/reactos/dll/cpl/sysdm/advanced.c Sat Nov 3 17:39:08 2007
@@ -28,58 +28,49 @@
case WM_COMMAND:
{
- switch(LOWORD(wParam))
+ switch (LOWORD(wParam))
{
case IDC_PERFOR:
- {
DialogBox(hApplet,
MAKEINTRESOURCE(IDD_VIRTMEM),
hwndDlg,
(DLGPROC)VirtMemDlgProc);
- }
- break;
+ break;
case IDC_USERPROFILE:
- {
DialogBox(hApplet,
MAKEINTRESOURCE(IDD_USERPROFILE),
hwndDlg,
(DLGPROC)UserProfileDlgProc);
- }
- break;
+ break;
case IDC_STAREC:
- {
DialogBox(hApplet,
MAKEINTRESOURCE(IDD_STARTUPRECOVERY),
hwndDlg,
(DLGPROC)StartRecDlgProc);
- }
- break;
+ break;
case IDC_ENVVAR:
- {
DialogBox(hApplet,
MAKEINTRESOURCE(IDD_ENVIRONMENT_VARIABLES),
hwndDlg,
(DLGPROC)EnvironmentDlgProc);
- }
- break;
+ break;
case IDC_ERRORREPORT:
- {
ShellExecute(NULL,
_T("open"),
BugLink,
NULL,
NULL,
SW_SHOWNORMAL);
- }
- break;
+ break;
}
}
break;
}
+
return FALSE;
}
Modified: trunk/reactos/dll/cpl/sysdm/general.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/sysdm/general.c?re…
==============================================================================
--- trunk/reactos/dll/cpl/sysdm/general.c (original)
+++ trunk/reactos/dll/cpl/sysdm/general.c Sat Nov 3 17:39:08 2007
@@ -28,15 +28,15 @@
LastError = GetLastError();
- if((LastError == 0) ||
- !FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
- FORMAT_MESSAGE_FROM_SYSTEM,
- NULL,
- LastError,
- MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
- (LPTSTR)&lpMsg,
- 0,
- NULL))
+ if ((LastError == 0) ||
+ !FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
+ FORMAT_MESSAGE_FROM_SYSTEM,
+ NULL,
+ LastError,
+ MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
+ (LPTSTR)&lpMsg,
+ 0,
+ NULL))
{
return;
}
@@ -91,7 +91,8 @@
lpBuf = HeapAlloc(GetProcessHeap(),
0,
BufSize);
- if (!lpBuf) return;
+ if (!lpBuf)
+ return;
if (RegQueryValueEx(hKey,
Value,
@@ -136,7 +137,8 @@
lpBuf = HeapAlloc(GetProcessHeap(),
0,
BufSize);
- if (!lpBuf) return 0;
+ if (!lpBuf)
+ return 0;
if (RegQueryValueEx(hKey,
Value,
@@ -145,7 +147,7 @@
(PBYTE)lpBuf,
&BufSize) == ERROR_SUCCESS)
{
- if(BufSize > ((30 + 1) * sizeof(TCHAR)))
+ if (BufSize > ((30 + 1) * sizeof(TCHAR)))
{
/* Wrap the Processor Name String like XP does:
*
* - Take the first 30 characters and look for the last space.
*
@@ -159,8 +161,10 @@
szBuf[30] = 0;
szLastSpace = _tcsrchr(szBuf, ' ');
- if(szLastSpace == 0)
+ if (szLastSpace == 0)
+ {
LastSpace = 30;
+ }
else
{
LastSpace = (szLastSpace - szBuf);
@@ -205,13 +209,13 @@
{
TCHAR szDecimalSeparator[4];
- // Get the decimal separator for the current locale
- if( GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SDECIMAL, szDecimalSeparator,
sizeof(szDecimalSeparator) / sizeof(TCHAR)) > 0)
+ /* Get the decimal separator for the current locale */
+ if (GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SDECIMAL, szDecimalSeparator,
sizeof(szDecimalSeparator) / sizeof(TCHAR)) > 0)
{
UCHAR uDecimals;
UINT uIntegral;
- // Show the value with two decimals
+ /* Show the value with two decimals */
uIntegral = (UINT)*dFloatValue;
uDecimals = (UCHAR)((UINT)(*dFloatValue * 100) - uIntegral * 100);
@@ -337,10 +341,14 @@
dTotalPhys = (double)MemStat.ullTotalPhys / 1024;
}
else
+ {
dTotalPhys = (double)MemStat.ullTotalPhys / 1024;
+ }
}
else
+ {
dTotalPhys = (double)MemStat.ullTotalPhys / 1024;
+ }
LoadString(hApplet, uStrId[i], szStr, sizeof(szStr) / sizeof(TCHAR));
MakeFloatValueString(&dTotalPhys, Buf, szStr);
@@ -369,17 +377,14 @@
UNREFERENCED_PARAMETER(lParam);
UNREFERENCED_PARAMETER(wParam);
- switch(uMsg)
+ switch (uMsg)
{
case WM_INITDIALOG:
- {
InitImageInfo(&ImgInfo);
GetSystemInformation(hwndDlg);
- }
- break;
+ break;
case WM_COMMAND:
- {
if (LOWORD(wParam) == IDC_LICENCE)
{
DialogBox(hApplet,
@@ -389,14 +394,13 @@
return TRUE;
}
- }
- break;
+ break;
case WM_DRAWITEM:
{
LPDRAWITEMSTRUCT lpDrawItem;
lpDrawItem = (LPDRAWITEMSTRUCT) lParam;
- if(lpDrawItem->CtlID == IDC_ROSIMG)
+ if (lpDrawItem->CtlID == IDC_ROSIMG)
{
HDC hdcMem;
LONG left;
Modified: trunk/reactos/dll/cpl/sysdm/hardprof.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/sysdm/hardprof.c?r…
==============================================================================
--- trunk/reactos/dll/cpl/sysdm/hardprof.c (original)
+++ trunk/reactos/dll/cpl/sysdm/hardprof.c Sat Nov 3 17:39:08 2007
@@ -19,24 +19,21 @@
UNREFERENCED_PARAMETER(lParam);
UNREFERENCED_PARAMETER(wParam);
UNREFERENCED_PARAMETER(hwndDlg);
- switch(uMsg)
+
+ switch (uMsg)
{
case WM_INITDIALOG:
- {
MessageBox(hwndDlg, _T("Dialog not yet implemented!"), NULL, 0);
- }
- break;
+ break;
case WM_COMMAND:
- {
if ((LOWORD(wParam) == IDOK) || (LOWORD(wParam) == IDCANCEL))
{
EndDialog(hwndDlg,
LOWORD(wParam));
return TRUE;
}
- }
- break;
+ break;
}
return FALSE;
}
@@ -52,36 +49,31 @@
UNREFERENCED_PARAMETER(lParam);
UNREFERENCED_PARAMETER(wParam);
UNREFERENCED_PARAMETER(hwndDlg);
- switch(uMsg)
+
+ switch (uMsg)
{
case WM_INITDIALOG:
- {
MessageBox(hwndDlg, _T("Dialog not yet implemented!"), NULL, 0);
- }
- break;
+ break;
case WM_COMMAND:
- {
switch (LOWORD(wParam))
{
case IDC_HRDPROFRENAME:
- {
DialogBox(hApplet,
MAKEINTRESOURCE(IDD_RENAMEPROFILE),
hwndDlg,
(DLGPROC)RenameProfDlgProc);
- }
+ break;
case IDOK:
case IDCANCEL:
- {
EndDialog(hwndDlg,
LOWORD(wParam));
return TRUE;
- }
}
- }
- break;
+ break;
}
+
return FALSE;
}
Modified: trunk/reactos/dll/cpl/sysdm/hardware.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/sysdm/hardware.c?r…
==============================================================================
--- trunk/reactos/dll/cpl/sysdm/hardware.c (original)
+++ trunk/reactos/dll/cpl/sysdm/hardware.c Sat Nov 3 17:39:08 2007
@@ -12,7 +12,8 @@
typedef BOOL (STDCALL *PDEVMGREXEC)(HWND hWndParent, HINSTANCE hInst, PVOID Unknown, int
nCmdShow);
-BOOL LaunchDeviceManager(HWND hWndParent)
+static BOOL
+LaunchDeviceManager(HWND hWndParent)
{
/* hack for ROS to start our devmgmt until we have mmc */
#ifdef __REACTOS__
@@ -49,37 +50,29 @@
{
UNREFERENCED_PARAMETER(lParam);
- switch(uMsg)
+ switch (uMsg)
{
case WM_INITDIALOG:
- break;
+ break;
case WM_COMMAND:
- {
- switch(LOWORD(wParam))
+ switch (LOWORD(wParam))
{
case IDC_HARDWARE_DEVICE_MANAGER:
- {
- if(!LaunchDeviceManager(hwndDlg))
+ if (!LaunchDeviceManager(hwndDlg))
{
/* FIXME */
}
-
return TRUE;
- }
case IDC_HARDWARE_PROFILE:
- {
DialogBox(hApplet,
MAKEINTRESOURCE(IDD_HARDWAREPROFILES),
hwndDlg,
(DLGPROC)HardProfDlgProc);
-
return TRUE;
- }
}
- }
- break;
+ break;
}
return FALSE;
Modified: trunk/reactos/dll/cpl/sysdm/licence.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/sysdm/licence.c?re…
==============================================================================
--- trunk/reactos/dll/cpl/sysdm/licence.c (original)
+++ trunk/reactos/dll/cpl/sysdm/licence.c Sat Nov 3 17:39:08 2007
@@ -12,7 +12,7 @@
INT_PTR CALLBACK
LicenceDlgProc(HWND hDlg,
- UINT message,
+ UINT uMsg,
WPARAM wParam,
LPARAM lParam)
{
@@ -23,10 +23,9 @@
UNREFERENCED_PARAMETER(lParam);
- switch (message)
+ switch (uMsg)
{
case WM_INITDIALOG:
- {
hIcon = LoadImage(hApplet,
MAKEINTRESOURCE(IDI_CPLSYSTEM),
IMAGE_ICON,
@@ -61,10 +60,8 @@
0);
return TRUE;
- }
case WM_COMMAND:
- {
if ((LOWORD(wParam) == IDOK) || (LOWORD(wParam) == IDCANCEL))
{
DestroyIcon(hIcon);
@@ -72,8 +69,7 @@
LOWORD(wParam));
return TRUE;
}
- }
- break;
+ break;
}
return FALSE;
Modified: trunk/reactos/dll/cpl/sysdm/resource.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/sysdm/resource.h?r…
==============================================================================
--- trunk/reactos/dll/cpl/sysdm/resource.h (original)
+++ trunk/reactos/dll/cpl/sysdm/resource.h Sat Nov 3 17:39:08 2007
@@ -40,10 +40,10 @@
/* propsheet - hardware */
#define IDD_PROPPAGEHARDWARE 300
-#define IDC_HARDWARE_WIZARD 207
+#define IDC_HARDWARE_WIZARD 207
#define IDC_HARDWARE_PROFILE 209
#define IDC_HARDWARE_DRIVER_SIGN 210
-#define IDC_HARDWARE_DEVICE_MANAGER 211
+#define IDC_HARDWARE_DEVICE_MANAGER 211
/* propsheet - advanced */
Modified: trunk/reactos/dll/cpl/sysdm/startrec.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/sysdm/startrec.c?r…
==============================================================================
--- trunk/reactos/dll/cpl/sysdm/startrec.c (original)
+++ trunk/reactos/dll/cpl/sysdm/startrec.c Sat Nov 3 17:39:08 2007
@@ -1,4 +1,3 @@
-
/*
* PROJECT: ReactOS System Control Panel Applet
* LICENSE: GPL - See COPYING in the top level directory
@@ -16,7 +15,8 @@
static TCHAR m_szMinidumpDir[MAX_PATH];
static DWORD m_dwCrashDumpEnabled = 0;
-void SetTimeout(HWND hwndDlg, int Timeout)
+static VOID
+SetTimeout(HWND hwndDlg, INT Timeout)
{
if (Timeout == 0)
{
@@ -26,12 +26,15 @@
{
EnableWindow(GetDlgItem(hwndDlg, IDC_STRRECLISTUPDWN), TRUE);
}
+
SendDlgItemMessage(hwndDlg, IDC_STRRECLISTUPDWN, UDM_SETPOS, (WPARAM) 0, (LPARAM)
MAKELONG((short) Timeout, 0));
}
-DWORD GetSystemDrive(TCHAR ** szSystemDrive)
+static DWORD
+GetSystemDrive(TCHAR **szSystemDrive)
{
DWORD dwBufSize;
+
/* get Path to freeldr.ini or boot.ini */
*szSystemDrive = HeapAlloc(GetProcessHeap(), 0, MAX_PATH * sizeof(TCHAR));
if (szSystemDrive != NULL)
@@ -59,34 +62,38 @@
*szSystemDrive = NULL;
return FALSE;
}
+
return dwBufSize;
}
+
return FALSE;
}
-PBOOTRECORD ReadFreeldrSection(HINF hInf, TCHAR * szSectionName)
-{
- PBOOTRECORD pRecord;
- INFCONTEXT InfContext;
- TCHAR szName[MAX_PATH];
- TCHAR szValue[MAX_PATH];
- DWORD LineLength;
-
- if (!SetupFindFirstLine(hInf,
- szSectionName,
- NULL,
- &InfContext))
- {
- /* failed to find section */
- return NULL;
- }
-
- pRecord = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(BOOTRECORD));
- if (pRecord == NULL)
- {
- return NULL;
- }
- _tcscpy(pRecord->szSectionName, szSectionName);
+static PBOOTRECORD
+ReadFreeldrSection(HINF hInf, TCHAR *szSectionName)
+{
+ PBOOTRECORD pRecord;
+ INFCONTEXT InfContext;
+ TCHAR szName[MAX_PATH];
+ TCHAR szValue[MAX_PATH];
+ DWORD LineLength;
+
+ if (!SetupFindFirstLine(hInf,
+ szSectionName,
+ NULL,
+ &InfContext))
+ {
+ /* failed to find section */
+ return NULL;
+ }
+
+ pRecord = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(BOOTRECORD));
+ if (pRecord == NULL)
+ {
+ return NULL;
+ }
+
+ _tcscpy(pRecord->szSectionName, szSectionName);
do
{
@@ -107,7 +114,6 @@
{
break;
}
-
if (!_tcsnicmp(szName, _T("BootType"), 8))
{
@@ -131,13 +137,15 @@
_tcscpy(pRecord->szOptions, szValue);
}
- }while(SetupFindNextLine(&InfContext, &InfContext));
+ }
+ while (SetupFindNextLine(&InfContext, &InfContext));
return pRecord;
}
-int LoadFreeldrSettings(HINF hInf, HWND hwndDlg)
+static INT
+LoadFreeldrSettings(HINF hInf, HWND hwndDlg)
{
INFCONTEXT InfContext;
PBOOTRECORD pRecord;
@@ -228,15 +236,14 @@
/* we store the friendly name as key */
_tcscpy(szDefaultOs, szValue);
}
-
}
else
{
HeapFree(GetProcessHeap(), 0, pRecord);
}
}
-
- }while(SetupFindNextLine(&InfContext, &InfContext));
+ }
+ while (SetupFindNextLine(&InfContext, &InfContext));
/* find default os in list */
lResult = SendDlgItemMessage(hwndDlg, IDC_STRECOSCOMBO, CB_FINDSTRING, (WPARAM)-1,
(LPARAM)szDefaultOs);
@@ -250,11 +257,14 @@
{
SendDlgItemMessage(hwndDlg, IDC_STRECLIST, BM_SETCHECK, (WPARAM)BST_CHECKED,
(LPARAM)0);
}
+
SetTimeout(hwndDlg, TimeOut);
+
return TRUE;
}
-int LoadBootSettings(HINF hInf, HWND hwndDlg)
+static INT
+LoadBootSettings(HINF hInf, HWND hwndDlg)
{
INFCONTEXT InfContext;
TCHAR szName[MAX_PATH];
@@ -304,7 +314,8 @@
_tcscpy(szDefaultOS, szValue);
}
- }while(SetupFindNextLine(&InfContext, &InfContext));
+ }
+ while (SetupFindNextLine(&InfContext, &InfContext));
if (!SetupFindFirstLine(hInf,
_T("operating systems"),
@@ -366,7 +377,9 @@
}
}
- }while(SetupFindNextLine(&InfContext, &InfContext));
+ }
+ while (SetupFindNextLine(&InfContext, &InfContext));
+
/* find default os in list */
lResult = SendDlgItemMessage(hwndDlg, IDC_STRECOSCOMBO, CB_FINDSTRING, (WPARAM)0,
(LPARAM)szDefaultOS);
if (lResult != CB_ERR)
@@ -374,22 +387,24 @@
/* set cur sel */
SendDlgItemMessage(hwndDlg, IDC_STRECOSCOMBO, CB_SETCURSEL, (WPARAM)lResult,
(LPARAM)0);
}
+
if(TimeOut)
{
SendDlgItemMessage(hwndDlg, IDC_STRECLIST, BM_SETCHECK, (WPARAM)BST_CHECKED,
(LPARAM)0);
}
SetTimeout(hwndDlg, TimeOut);
+
return TRUE;
}
-void DeleteBootRecords(HWND hwndDlg)
+static VOID
+DeleteBootRecords(HWND hwndDlg)
{
LRESULT lIndex;
LONG index;
PBOOTRECORD pRecord;
-
lIndex = SendDlgItemMessage(hwndDlg, IDC_STRECOSCOMBO, CB_GETCOUNT, (WPARAM)0,
(LPARAM)0);
if (lIndex == CB_ERR)
return;
@@ -402,10 +417,12 @@
HeapFree(GetProcessHeap(), 0, pRecord);
}
}
+
SendDlgItemMessage(hwndDlg, IDC_STRECOSCOMBO, CB_RESETCONTENT, (WPARAM)0,
(LPARAM)0);
}
-LRESULT LoadOSList(HWND hwndDlg)
+static LRESULT
+LoadOSList(HWND hwndDlg)
{
DWORD dwBufSize;
TCHAR *szSystemDrive;
@@ -415,9 +432,9 @@
if (!dwBufSize)
return FALSE;
-
_tcscpy(m_szFreeldrIni, szSystemDrive);
_tcscat(m_szFreeldrIni, _T("\\freeldr.ini"));
+
if (PathFileExists(m_szFreeldrIni))
{
/* freeldr.ini exists */
@@ -435,6 +452,7 @@
}
return FALSE;
}
+
/* try load boot.ini settings */
_tcscpy(m_szFreeldrIni, szSystemDrive);
_tcscat(m_szFreeldrIni, _T("\\boot.ini"));
@@ -454,12 +472,15 @@
m_FreeLdrIni = 2;
return TRUE;
}
- return FALSE;
- }
+
+ return FALSE;
+ }
+
return FALSE;
}
-void SetCrashDlgItems(HWND hwnd)
+static VOID
+SetCrashDlgItems(HWND hwnd)
{
if (m_dwCrashDumpEnabled == 0)
{
@@ -484,7 +505,8 @@
SendDlgItemMessage(hwnd, IDC_STRRECDEBUGCOMBO, CB_SETCURSEL,
(WPARAM)m_dwCrashDumpEnabled, (LPARAM)0);
}
-void WriteStartupRecoveryOptions(HWND hwndDlg)
+static VOID
+WriteStartupRecoveryOptions(HWND hwndDlg)
{
HKEY hKey;
DWORD lResult;
@@ -526,7 +548,8 @@
RegCloseKey(hKey);
}
-void LoadRecoveryOptions(HWND hwndDlg)
+static VOID
+LoadRecoveryOptions(HWND hwndDlg)
{
HKEY hKey;
DWORD dwValues;
@@ -617,17 +640,19 @@
if (LoadString(hApplet, IDS_NO_DUMP, szValue, sizeof(szValue) / sizeof(TCHAR)) <
sizeof(szValue) / sizeof(TCHAR))
SendDlgItemMessage(hwndDlg, IDC_STRRECDEBUGCOMBO, CB_ADDSTRING, (WPARAM)0,
(LPARAM) szValue);
+
if (LoadString(hApplet, IDS_FULL_DUMP, szValue, sizeof(szValue) / sizeof(TCHAR)) <
sizeof(szValue) / sizeof(TCHAR))
SendDlgItemMessage(hwndDlg, IDC_STRRECDEBUGCOMBO, CB_ADDSTRING, (WPARAM)0,
(LPARAM) szValue);
+
if (LoadString(hApplet, IDS_KERNEL_DUMP, szValue, sizeof(szValue) / sizeof(TCHAR))
< sizeof(szValue) / sizeof(TCHAR))
SendDlgItemMessage(hwndDlg, IDC_STRRECDEBUGCOMBO, CB_ADDSTRING, (WPARAM)0,
(LPARAM) szValue);
+
if (LoadString(hApplet, IDS_MINI_DUMP, szValue, sizeof(szValue) / sizeof(TCHAR)) <
sizeof(szValue) / sizeof(TCHAR))
SendDlgItemMessage(hwndDlg, IDC_STRRECDEBUGCOMBO, CB_ADDSTRING, (WPARAM)0,
(LPARAM) szValue);
SetCrashDlgItems(hwndDlg);
RegCloseKey(hKey);
}
-
/* Property page dialog callback */
@@ -647,26 +672,20 @@
switch(uMsg)
{
case WM_INITDIALOG:
- {
LoadRecoveryOptions(hwndDlg);
return LoadOSList(hwndDlg);
- }
- break;
case WM_COMMAND:
- {
switch(LOWORD(wParam))
{
case IDC_STRRECEDIT:
- {
ShellExecute(0, _T("open"), _T("notepad"),
m_szFreeldrIni, NULL, SW_SHOWNORMAL);
- // FIXME use CreateProcess and wait untill finished
- // DeleteBootRecords(hwndDlg);
- // LoadOSList(hwndDlg);
+ // FIXME use CreateProcess and wait untill finished
+ // DeleteBootRecords(hwndDlg);
+ // LoadOSList(hwndDlg);
break;
- }
+
case IDOK:
- {
/* save timeout */
if (SendDlgItemMessage(hwndDlg, IDC_STRECLIST, BM_GETCHECK,
(WPARAM)0, (LPARAM)0) == BST_CHECKED)
iTimeout = SendDlgItemMessage(hwndDlg, IDC_STRRECLISTUPDWN,
UDM_GETPOS, (WPARAM)0, (LPARAM)0);
@@ -681,7 +700,6 @@
DeleteBootRecords(hwndDlg);
return TRUE;
}
-
pRecord = (PBOOTRECORD) SendDlgItemMessage(hwndDlg, IDC_STRECOSCOMBO,
CB_GETITEMDATA, (WPARAM)lResult, (LPARAM)0);
@@ -716,28 +734,27 @@
}
}
+
WriteStartupRecoveryOptions(hwndDlg);
DeleteBootRecords(hwndDlg);
EndDialog(hwndDlg,
LOWORD(wParam));
return TRUE;
- }
+
case IDCANCEL:
- {
DeleteBootRecords(hwndDlg);
EndDialog(hwndDlg,
LOWORD(wParam));
return TRUE;
- }
+
case IDC_STRECLIST:
- {
if (SendDlgItemMessage(hwndDlg, IDC_STRECLIST, BM_GETCHECK,
(WPARAM)0, (LPARAM)0) == BST_CHECKED)
SetTimeout(hwndDlg, 30);
else
SetTimeout(hwndDlg, 0);
- }
+ break;
+
case IDC_STRRECDEBUGCOMBO:
- {
if (HIWORD(wParam) == CBN_SELCHANGE)
{
LRESULT lResult;
@@ -753,16 +770,15 @@
{
SendDlgItemMessage(hwndDlg, IDC_STRRECDUMPFILE,
WM_GETTEXT, (WPARAM)sizeof(m_szMinidumpDir) / sizeof(TCHAR), (LPARAM)m_szMinidumpDir);
}
+
m_dwCrashDumpEnabled = lResult;
SetCrashDlgItems(hwndDlg);
}
}
break;
- }
-
}
- }
- break;
- }
+ break;
+ }
+
return FALSE;
}
Modified: trunk/reactos/dll/cpl/sysdm/sysdm.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/sysdm/sysdm.c?rev=…
==============================================================================
--- trunk/reactos/dll/cpl/sysdm/sysdm.c (original)
+++ trunk/reactos/dll/cpl/sysdm/sysdm.c Sat Nov 3 17:39:08 2007
@@ -148,57 +148,56 @@
/* Control Panel Callback */
LONG CALLBACK
-CPlApplet(
- HWND hwndCPl,
- UINT uMsg,
- LPARAM lParam1,
- LPARAM lParam2)
-{
- int i = (int)lParam1;
+CPlApplet(HWND hwndCPl,
+ UINT uMsg,
+ LPARAM lParam1,
+ LPARAM lParam2)
+{
+ INT i = (INT)lParam1;
+
UNREFERENCED_PARAMETER(hwndCPl);
- switch(uMsg)
+ switch (uMsg)
{
case CPL_INIT:
- {
return TRUE;
- }
+
case CPL_GETCOUNT:
- {
return NUM_APPLETS;
- }
+
case CPL_INQUIRE:
- {
- CPLINFO *CPlInfo = (CPLINFO*)lParam2;
- CPlInfo->lData = 0;
- CPlInfo->idIcon = Applets[i].idIcon;
- CPlInfo->idName = Applets[i].idName;
- CPlInfo->idInfo = Applets[i].idDescription;
+ {
+ CPLINFO *CPlInfo = (CPLINFO*)lParam2;
+ CPlInfo->lData = 0;
+ CPlInfo->idIcon = Applets[i].idIcon;
+ CPlInfo->idName = Applets[i].idName;
+ CPlInfo->idInfo = Applets[i].idDescription;
+ }
break;
- }
+
case CPL_DBLCLK:
- {
Applets[i].AppletProc();
break;
- }
- }
+ }
+
return FALSE;
}
BOOL STDCALL
-DllMain(
- HINSTANCE hinstDLL,
- DWORD dwReason,
- LPVOID lpvReserved)
+DllMain(HINSTANCE hinstDLL,
+ DWORD dwReason,
+ LPVOID lpvReserved)
{
UNREFERENCED_PARAMETER(lpvReserved);
- switch(dwReason)
+
+ switch (dwReason)
{
case DLL_PROCESS_ATTACH:
case DLL_THREAD_ATTACH:
hApplet = hinstDLL;
break;
}
+
return TRUE;
}
Modified: trunk/reactos/dll/cpl/sysdm/userprofile.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/sysdm/userprofile.…
==============================================================================
--- trunk/reactos/dll/cpl/sysdm/userprofile.c (original)
+++ trunk/reactos/dll/cpl/sysdm/userprofile.c Sat Nov 3 17:39:08 2007
@@ -17,28 +17,20 @@
WPARAM wParam,
LPARAM lParam)
{
- UNREFERENCED_PARAMETER(lParam);
- UNREFERENCED_PARAMETER(wParam);
- UNREFERENCED_PARAMETER(hwndDlg);
-
- switch(uMsg)
+ switch (uMsg)
{
case WM_INITDIALOG:
- {
MessageBox(hwndDlg, _T("Dialog not yet implemented!"), NULL, 0);
- }
- break;
+ break;
case WM_COMMAND:
- {
if ((LOWORD(wParam) == IDOK) || (LOWORD(wParam) == IDCANCEL))
{
EndDialog(hwndDlg,
LOWORD(wParam));
return TRUE;
}
- }
- break;
+ break;
case WM_NOTIFY:
{
@@ -56,5 +48,6 @@
break;
}
}
+
return FALSE;
}
Modified: trunk/reactos/dll/cpl/sysdm/virtmem.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/sysdm/virtmem.c?re…
==============================================================================
--- trunk/reactos/dll/cpl/sysdm/virtmem.c (original)
+++ trunk/reactos/dll/cpl/sysdm/virtmem.c Sat Nov 3 17:39:08 2007
@@ -20,22 +20,22 @@
DWORD dwDataSize;
BOOL bRet = FALSE;
- if(RegCreateKeyEx(HKEY_LOCAL_MACHINE,
- lpKey,
- 0,
- NULL,
- REG_OPTION_NON_VOLATILE,
- KEY_QUERY_VALUE,
- NULL,
- &hkey,
- NULL) == ERROR_SUCCESS)
- {
- if(RegQueryValueEx(hkey,
- _T("PagingFiles"),
- NULL,
- &dwType,
- NULL,
- &dwDataSize) == ERROR_SUCCESS)
+ if (RegCreateKeyEx(HKEY_LOCAL_MACHINE,
+ lpKey,
+ 0,
+ NULL,
+ REG_OPTION_NON_VOLATILE,
+ KEY_QUERY_VALUE,
+ NULL,
+ &hkey,
+ NULL) == ERROR_SUCCESS)
+ {
+ if (RegQueryValueEx(hkey,
+ _T("PagingFiles"),
+ NULL,
+ &dwType,
+ NULL,
+ &dwDataSize) == ERROR_SUCCESS)
{
pVirtMem->szPagingFiles = (LPTSTR)HeapAlloc(GetProcessHeap(),
0,
@@ -44,12 +44,12 @@
{
ZeroMemory(pVirtMem->szPagingFiles,
dwDataSize);
- if(RegQueryValueEx(hkey,
- _T("PagingFiles"),
- NULL,
- &dwType,
- (PBYTE)pVirtMem->szPagingFiles,
- &dwDataSize) == ERROR_SUCCESS)
+ if (RegQueryValueEx(hkey,
+ _T("PagingFiles"),
+ NULL,
+ &dwType,
+ (PBYTE)pVirtMem->szPagingFiles,
+ &dwDataSize) == ERROR_SUCCESS)
{
bRet = TRUE;
}
@@ -117,10 +117,10 @@
/* copy the 'X:' portion */
lstrcpyn(szDrive, DrivePtr, sizeof(szDrive) / sizeof(TCHAR));
- if(GetDriveType(DrivePtr) == DRIVE_FIXED)
+ if (GetDriveType(DrivePtr) == DRIVE_FIXED)
{
/* does drive match the one in the registry ? */
- if(!_tcsncmp(pVirtMem->szPagingFiles, szDrive, 2))
+ if (!_tcsncmp(pVirtMem->szPagingFiles, szDrive, 2))
{
/* FIXME: we only check the first available pagefile in the reg */
InitialSize = GetPageFileSizes(pVirtMem->szPagingFiles);
@@ -188,16 +188,15 @@
{
HKEY hk = NULL;
TCHAR szPagingFiles[2048];
+ TCHAR szText[256];
INT i;
INT nPos = 0;
BOOL bErr = TRUE;
- for(i = 0; i < pVirtMem->Count; ++i)
- {
- if(pVirtMem->Pagefile[i].bUsed)
- {
- TCHAR szText[256];
-
+ for (i = 0; i < pVirtMem->Count; ++i)
+ {
+ if (pVirtMem->Pagefile[i].bUsed)
+ {
_stprintf(szText, _T("%s\\pagefile.sys %i %i"),
pVirtMem->Pagefile[i].szDrive,
pVirtMem->Pagefile[i].InitialValue,
@@ -215,15 +214,15 @@
}
}
- if(RegCreateKeyEx(HKEY_LOCAL_MACHINE,
- lpKey,
- 0,
- NULL,
- REG_OPTION_NON_VOLATILE,
- KEY_WRITE,
- NULL,
- &hk,
- NULL) == ERROR_SUCCESS)
+ if (RegCreateKeyEx(HKEY_LOCAL_MACHINE,
+ lpKey,
+ 0,
+ NULL,
+ REG_OPTION_NON_VOLATILE,
+ KEY_WRITE,
+ NULL,
+ &hk,
+ NULL) == ERROR_SUCCESS)
{
if (RegSetValueEx(hk,
_T("PagingFiles"),
@@ -247,6 +246,7 @@
SetListBoxColumns(HWND hwndListBox)
{
const INT tabs[2] = {30, 170};
+
SendMessage(hwndListBox, LB_SETTABSTOPS, (WPARAM)2, (LPARAM)&tabs[0]);
}
@@ -292,12 +292,11 @@
LB_GETCURSEL,
0,
0);
-
- if(Index < pVirtMem->Count)
+ if (Index < pVirtMem->Count)
{
/* check if custom settings are checked */
- if(IsDlgButtonChecked(pVirtMem->hSelf,
- IDC_CUSTOM) == BST_CHECKED)
+ if (IsDlgButtonChecked(pVirtMem->hSelf,
+ IDC_CUSTOM) == BST_CHECKED)
{
Value = GetDlgItemInt(pVirtMem->hSelf,
IDC_INITIALSIZE,
@@ -313,7 +312,9 @@
FALSE);
}
else
+ {
pVirtMem->Pagefile[Index].InitialValue = Value;
+ }
Value = GetDlgItemInt(pVirtMem->hSelf,
IDC_MAXSIZE,
@@ -329,7 +330,9 @@
FALSE);
}
else
+ {
pVirtMem->Pagefile[Index].MaxValue = Value;
+ }
}
else
{
@@ -362,11 +365,11 @@
0,
0);
- if(Index < pVirtMem->Count)
- {
-
- if(pVirtMem->Pagefile[Index].InitialValue != 0 &&
- pVirtMem->Pagefile[Index].MaxValue != 0)
+ if (Index < pVirtMem->Count)
+ {
+
+ if (pVirtMem->Pagefile[Index].InitialValue != 0 &&
+ pVirtMem->Pagefile[Index].MaxValue != 0)
{
/* enable and fill the custom values */
EnableWindow(GetDlgItem(pVirtMem->hSelf, IDC_MAXSIZE), TRUE);
@@ -393,7 +396,7 @@
EnableWindow(GetDlgItem(pVirtMem->hSelf, IDC_INITIALSIZE), FALSE);
/* is it system managed */
- if(pVirtMem->Pagefile[Index].bUsed)
+ if (pVirtMem->Pagefile[Index].bUsed)
{
CheckDlgButton(pVirtMem->hSelf,
IDC_SYSMANSIZE,
@@ -415,7 +418,7 @@
static VOID
OnOk(PVIRTMEM pVirtMem)
{
- if(pVirtMem->bSave == TRUE)
+ if (pVirtMem->bSave == TRUE)
{
WritePageFileSettings(pVirtMem);
}
@@ -491,7 +494,6 @@
break;
case WM_COMMAND:
- {
switch (LOWORD(wParam))
{
case IDCANCEL:
@@ -529,8 +531,7 @@
}
break;
}
- }
- break;
+ break;
}
return FALSE;