Author: cfinck
Date: Sun Jul 29 19:05:09 2007
New Revision: 28007
URL:
http://svn.reactos.org/svn/reactos?rev=28007&view=rev
Log:
Merge down r27781:r27789
Modified:
branches/ros-branch-0_3_3/reactos/dll/cpl/sysdm/advanced.c
branches/ros-branch-0_3_3/reactos/dll/cpl/sysdm/environment.c
branches/ros-branch-0_3_3/reactos/dll/cpl/sysdm/general.c
branches/ros-branch-0_3_3/reactos/dll/cpl/sysdm/hardprof.c
branches/ros-branch-0_3_3/reactos/dll/cpl/sysdm/hardware.c
branches/ros-branch-0_3_3/reactos/dll/cpl/sysdm/licence.c
branches/ros-branch-0_3_3/reactos/dll/cpl/sysdm/resources/gpl.txt
branches/ros-branch-0_3_3/reactos/dll/cpl/sysdm/startrec.c
branches/ros-branch-0_3_3/reactos/dll/cpl/sysdm/sysdm.c
branches/ros-branch-0_3_3/reactos/dll/cpl/sysdm/userprofile.c
branches/ros-branch-0_3_3/reactos/dll/cpl/sysdm/virtmem.c
Modified: branches/ros-branch-0_3_3/reactos/dll/cpl/sysdm/advanced.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-branch-0_3_3/reactos/dll/cp…
==============================================================================
--- branches/ros-branch-0_3_3/reactos/dll/cpl/sysdm/advanced.c (original)
+++ branches/ros-branch-0_3_3/reactos/dll/cpl/sysdm/advanced.c Sun Jul 29 19:05:09 2007
@@ -24,7 +24,7 @@
switch (uMsg)
{
case WM_INITDIALOG:
- break;
+ break;
case WM_COMMAND:
{
@@ -76,11 +76,10 @@
SW_SHOWNORMAL);
}
break;
-
}
}
- break;
+ break;
}
return FALSE;
}
Modified: branches/ros-branch-0_3_3/reactos/dll/cpl/sysdm/environment.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-branch-0_3_3/reactos/dll/cp…
==============================================================================
--- branches/ros-branch-0_3_3/reactos/dll/cpl/sysdm/environment.c (original)
+++ branches/ros-branch-0_3_3/reactos/dll/cpl/sysdm/environment.c Sun Jul 29 19:05:09
2007
@@ -12,11 +12,10 @@
typedef struct _VARIABLE_DATA
{
- LPTSTR lpName;
- LPTSTR lpRawValue;
- LPTSTR lpCookedValue;
+ LPTSTR lpName;
+ LPTSTR lpRawValue;
+ LPTSTR lpCookedValue;
} VARIABLE_DATA, *PVARIABLE_DATA;
-
INT_PTR CALLBACK
@@ -25,573 +24,574 @@
WPARAM wParam,
LPARAM lParam)
{
- PVARIABLE_DATA VarData;
- DWORD dwNameLength;
- DWORD dwValueLength;
-
- VarData = (PVARIABLE_DATA)GetWindowLongPtr(hwndDlg, GWL_USERDATA);
-
- switch (uMsg)
- {
- case WM_INITDIALOG:
- SetWindowLongPtr(hwndDlg, GWL_USERDATA, (LONG_PTR)lParam);
- VarData = (PVARIABLE_DATA)lParam;
-
- if (VarData->lpName != NULL)
- {
- SendDlgItemMessage(hwndDlg, IDC_VARIABLE_NAME, WM_SETTEXT, 0,
(LPARAM)VarData->lpName);
- }
-
- if (VarData->lpRawValue != NULL)
- {
- SendDlgItemMessage(hwndDlg, IDC_VARIABLE_VALUE, WM_SETTEXT, 0,
(LPARAM)VarData->lpRawValue);
- }
- break;
-
- case WM_COMMAND:
- switch (LOWORD(wParam))
- {
- case IDOK:
- dwNameLength = (DWORD)SendDlgItemMessage(hwndDlg, IDC_VARIABLE_NAME,
WM_GETTEXTLENGTH, 0, 0);
- dwValueLength = (DWORD)SendDlgItemMessage(hwndDlg, IDC_VARIABLE_VALUE,
WM_GETTEXTLENGTH, 0, 0);
- if (dwNameLength != 0 && dwValueLength != 0)
- {
- if (VarData->lpName == NULL)
- {
- VarData->lpName = GlobalAlloc(GPTR, (dwNameLength + 1) *
sizeof(TCHAR));
- }
- else if (_tcslen(VarData->lpName) < dwNameLength)
- {
- GlobalFree(VarData->lpName);
- VarData->lpName = GlobalAlloc(GPTR, (dwNameLength + 1) *
sizeof(TCHAR));
- }
- SendDlgItemMessage(hwndDlg, IDC_VARIABLE_NAME, WM_GETTEXT, dwNameLength + 1,
(LPARAM)VarData->lpName);
-
- if (VarData->lpRawValue == NULL)
- {
- VarData->lpRawValue = GlobalAlloc(GPTR, (dwValueLength + 1) *
sizeof(TCHAR));
- }
- else if (_tcslen(VarData->lpRawValue) < dwValueLength)
- {
- GlobalFree(VarData->lpRawValue);
- VarData->lpRawValue = GlobalAlloc(GPTR, (dwValueLength + 1) *
sizeof(TCHAR));
- }
- SendDlgItemMessage(hwndDlg, IDC_VARIABLE_VALUE, WM_GETTEXT, dwValueLength +
1, (LPARAM)VarData->lpRawValue);
-
- if (_tcschr(VarData->lpRawValue, _T('%')))
- {
- if (VarData->lpCookedValue == NULL)
- {
- VarData->lpCookedValue = GlobalAlloc(GPTR, 2 * MAX_PATH *
sizeof(TCHAR));
- }
-
- ExpandEnvironmentStrings(VarData->lpRawValue,
- VarData->lpCookedValue,
- 2 * MAX_PATH);
- }
- else if (VarData->lpCookedValue)
- {
- GlobalFree(VarData->lpCookedValue);
- }
- }
- EndDialog(hwndDlg, 1);
- return TRUE;
-
- case IDCANCEL:
- EndDialog(hwndDlg, 0);
- return TRUE;
- }
- break;
- }
-
- return FALSE;
+ PVARIABLE_DATA VarData;
+ DWORD dwNameLength;
+ DWORD dwValueLength;
+
+ VarData = (PVARIABLE_DATA)GetWindowLongPtr(hwndDlg, GWL_USERDATA);
+
+ switch (uMsg)
+ {
+ case WM_INITDIALOG:
+ SetWindowLongPtr(hwndDlg, GWL_USERDATA, (LONG_PTR)lParam);
+ VarData = (PVARIABLE_DATA)lParam;
+
+ if (VarData->lpName != NULL)
+ {
+ SendDlgItemMessage(hwndDlg, IDC_VARIABLE_NAME, WM_SETTEXT, 0,
(LPARAM)VarData->lpName);
+ }
+
+ if (VarData->lpRawValue != NULL)
+ {
+ SendDlgItemMessage(hwndDlg, IDC_VARIABLE_VALUE, WM_SETTEXT, 0,
(LPARAM)VarData->lpRawValue);
+ }
+ break;
+
+ case WM_COMMAND:
+ switch (LOWORD(wParam))
+ {
+ case IDOK:
+ dwNameLength = (DWORD)SendDlgItemMessage(hwndDlg, IDC_VARIABLE_NAME,
WM_GETTEXTLENGTH, 0, 0);
+ dwValueLength = (DWORD)SendDlgItemMessage(hwndDlg,
IDC_VARIABLE_VALUE, WM_GETTEXTLENGTH, 0, 0);
+ if (dwNameLength != 0 && dwValueLength != 0)
+ {
+ if (VarData->lpName == NULL)
+ {
+ VarData->lpName = GlobalAlloc(GPTR, (dwNameLength + 1) *
sizeof(TCHAR));
+ }
+ else if (_tcslen(VarData->lpName) < dwNameLength)
+ {
+ GlobalFree(VarData->lpName);
+ VarData->lpName = GlobalAlloc(GPTR, (dwNameLength + 1) *
sizeof(TCHAR));
+ }
+ SendDlgItemMessage(hwndDlg, IDC_VARIABLE_NAME, WM_GETTEXT,
dwNameLength + 1, (LPARAM)VarData->lpName);
+
+ if (VarData->lpRawValue == NULL)
+ {
+ VarData->lpRawValue = GlobalAlloc(GPTR, (dwValueLength +
1) * sizeof(TCHAR));
+ }
+ else if (_tcslen(VarData->lpRawValue) < dwValueLength)
+ {
+ GlobalFree(VarData->lpRawValue);
+ VarData->lpRawValue = GlobalAlloc(GPTR, (dwValueLength +
1) * sizeof(TCHAR));
+ }
+ SendDlgItemMessage(hwndDlg, IDC_VARIABLE_VALUE, WM_GETTEXT,
dwValueLength + 1, (LPARAM)VarData->lpRawValue);
+
+ if (_tcschr(VarData->lpRawValue, _T('%')))
+ {
+ if (VarData->lpCookedValue == NULL)
+ {
+ VarData->lpCookedValue = GlobalAlloc(GPTR, 2 *
MAX_PATH * sizeof(TCHAR));
+ }
+
+ ExpandEnvironmentStrings(VarData->lpRawValue,
+ VarData->lpCookedValue,
+ 2 * MAX_PATH);
+ }
+ else if (VarData->lpCookedValue)
+ {
+ GlobalFree(VarData->lpCookedValue);
+ }
+ }
+ EndDialog(hwndDlg, 1);
+ return TRUE;
+
+ case IDCANCEL:
+ EndDialog(hwndDlg, 0);
+ return TRUE;
+ }
+ break;
+ }
+
+ return FALSE;
}
static VOID
SetEnvironmentVariables(HWND hwndListView,
- HKEY hRootKey,
- LPTSTR lpSubKeyName)
-{
- HKEY hKey;
- DWORD dwValues;
- DWORD dwMaxValueNameLength;
- DWORD dwMaxValueDataLength;
- DWORD i;
- LPTSTR lpName;
- LPTSTR lpData;
- LPTSTR lpExpandData = NULL;
- DWORD dwNameLength;
- DWORD dwDataLength;
- DWORD dwType;
- PVARIABLE_DATA VarData;
-
- LV_ITEM lvi;
- int iItem;
-
- if (RegOpenKeyEx(hRootKey,
- lpSubKeyName,
- 0,
- KEY_READ,
- &hKey))
- return;
-
- if (RegQueryInfoKey(hKey,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- &dwValues,
- &dwMaxValueNameLength,
- &dwMaxValueDataLength,
- NULL,
- NULL))
- {
- RegCloseKey(hKey);
- return;
- }
-
- lpName = GlobalAlloc(GPTR, (dwMaxValueNameLength + 1) * sizeof(TCHAR));
- if (lpName == NULL)
- {
- RegCloseKey(hKey);
- return;
- }
-
- lpData = GlobalAlloc(GPTR, (dwMaxValueDataLength + 1) * sizeof(TCHAR));
- if (lpData == NULL)
- {
- GlobalFree(lpData);
- RegCloseKey(hKey);
- return;
- }
-
- for (i = 0; i < dwValues; i++)
- {
- dwNameLength = dwMaxValueNameLength + 1;
- dwDataLength = dwMaxValueDataLength + 1;
- if (RegEnumValue(hKey,
- i,
- lpName,
- &dwNameLength,
- NULL,
- &dwType,
- (LPBYTE)lpData,
- &dwDataLength))
- {
- GlobalFree(lpName);
- GlobalFree(lpData);
- RegCloseKey(hKey);
- return;
- }
-
- VarData = GlobalAlloc(GPTR, sizeof(VARIABLE_DATA));
-
- VarData->lpName = GlobalAlloc(GPTR, (dwNameLength + 1) * sizeof(TCHAR));
- _tcscpy(VarData->lpName, lpName);
-
- VarData->lpRawValue = GlobalAlloc(GPTR, (dwDataLength + 1) * sizeof(TCHAR));
- _tcscpy(VarData->lpRawValue, lpData);
-
- if (dwType == REG_EXPAND_SZ)
- {
- lpExpandData = GlobalAlloc(GPTR, MAX_PATH * 2* sizeof(TCHAR));
- if (lpExpandData == NULL)
- {
- GlobalFree(lpName);
+ HKEY hRootKey,
+ LPTSTR lpSubKeyName)
+{
+ HKEY hKey;
+ DWORD dwValues;
+ DWORD dwMaxValueNameLength;
+ DWORD dwMaxValueDataLength;
+ DWORD i;
+ LPTSTR lpName;
+ LPTSTR lpData;
+ LPTSTR lpExpandData = NULL;
+ DWORD dwNameLength;
+ DWORD dwDataLength;
+ DWORD dwType;
+ PVARIABLE_DATA VarData;
+
+ LV_ITEM lvi;
+ int iItem;
+
+ if (RegOpenKeyEx(hRootKey,
+ lpSubKeyName,
+ 0,
+ KEY_READ,
+ &hKey))
+ return;
+
+ if (RegQueryInfoKey(hKey,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ &dwValues,
+ &dwMaxValueNameLength,
+ &dwMaxValueDataLength,
+ NULL,
+ NULL))
+ {
+ RegCloseKey(hKey);
+ return;
+ }
+
+ lpName = GlobalAlloc(GPTR, (dwMaxValueNameLength + 1) * sizeof(TCHAR));
+ if (lpName == NULL)
+ {
+ RegCloseKey(hKey);
+ return;
+ }
+
+ lpData = GlobalAlloc(GPTR, (dwMaxValueDataLength + 1) * sizeof(TCHAR));
+ if (lpData == NULL)
+ {
GlobalFree(lpData);
RegCloseKey(hKey);
return;
- }
-
- ExpandEnvironmentStrings(lpData,
- lpExpandData,
- 2 * MAX_PATH);
-
- VarData->lpCookedValue = GlobalAlloc(GPTR, (_tcslen(lpExpandData) + 1) *
sizeof(TCHAR));
- _tcscpy(VarData->lpCookedValue, lpExpandData);
- GlobalFree(lpExpandData);
+ }
+
+ for (i = 0; i < dwValues; i++)
+ {
+ dwNameLength = dwMaxValueNameLength + 1;
+ dwDataLength = dwMaxValueDataLength + 1;
+
+ if (RegEnumValue(hKey,
+ i,
+ lpName,
+ &dwNameLength,
+ NULL,
+ &dwType,
+ (LPBYTE)lpData,
+ &dwDataLength))
+ {
+ GlobalFree(lpName);
+ GlobalFree(lpData);
+ RegCloseKey(hKey);
+ return;
+ }
+
+ VarData = GlobalAlloc(GPTR, sizeof(VARIABLE_DATA));
+
+ VarData->lpName = GlobalAlloc(GPTR, (dwNameLength + 1) * sizeof(TCHAR));
+ _tcscpy(VarData->lpName, lpName);
+
+ VarData->lpRawValue = GlobalAlloc(GPTR, (dwDataLength + 1) * sizeof(TCHAR));
+ _tcscpy(VarData->lpRawValue, lpData);
+
+ if (dwType == REG_EXPAND_SZ)
+ {
+ lpExpandData = GlobalAlloc(GPTR, MAX_PATH * 2* sizeof(TCHAR));
+ if (lpExpandData == NULL)
+ {
+ GlobalFree(lpName);
+ GlobalFree(lpData);
+ RegCloseKey(hKey);
+ return;
+ }
+
+ ExpandEnvironmentStrings(lpData,
+ lpExpandData,
+ 2 * MAX_PATH);
+
+ VarData->lpCookedValue = GlobalAlloc(GPTR, (_tcslen(lpExpandData) + 1) *
sizeof(TCHAR));
+ _tcscpy(VarData->lpCookedValue, lpExpandData);
+ GlobalFree(lpExpandData);
+ }
+
+ memset(&lvi, 0x00, sizeof(lvi));
+ lvi.mask = LVIF_TEXT | LVIF_STATE | LVIF_PARAM;
+ lvi.lParam = (LPARAM)VarData;
+ lvi.pszText = VarData->lpName;
+ lvi.state = (i == 0) ? LVIS_SELECTED : 0;
+ iItem = ListView_InsertItem(hwndListView, &lvi);
+
+ ListView_SetItemText(hwndListView, iItem, 1,
+ (VarData->lpCookedValue) ? VarData->lpCookedValue :
VarData->lpRawValue);
+ }
+
+ GlobalFree(lpName);
+ GlobalFree(lpData);
+ RegCloseKey(hKey);
+}
+
+
+static VOID
+SetListViewColumns(HWND hwndListView)
+{
+ RECT rect;
+ LV_COLUMN column;
+ TCHAR szStr[32];
+
+ GetClientRect(hwndListView, &rect);
+
+ memset(&column, 0x00, sizeof(column));
+ column.mask=LVCF_FMT | LVCF_WIDTH | LVCF_SUBITEM | LVCF_TEXT;
+ column.fmt=LVCFMT_LEFT;
+ column.cx = (INT)((rect.right - rect.left) * 0.32);
+ column.iSubItem = 0;
+ LoadString(hApplet, IDS_VARIABLE, szStr, sizeof(szStr) / sizeof(szStr[0]));
+ column.pszText = szStr;
+ (void)ListView_InsertColumn(hwndListView, 0, &column);
+
+ column.cx = (INT)((rect.right - rect.left) * 0.63);
+ column.iSubItem = 1;
+ LoadString(hApplet, IDS_VALUE, szStr, sizeof(szStr) / sizeof(szStr[0]));
+ column.pszText = szStr;
+ (void)ListView_InsertColumn(hwndListView, 1, &column);
+}
+
+
+static VOID
+OnInitDialog(HWND hwndDlg)
+{
+ HWND hwndListView;
+
+ /* Set user environment variables */
+ hwndListView = GetDlgItem(hwndDlg, IDC_USER_VARIABLE_LIST);
+
+ SetListViewColumns(hwndListView);
+
+ SetEnvironmentVariables(hwndListView,
+ HKEY_CURRENT_USER,
+ _T("Environment"));
+
+ (void)ListView_SetColumnWidth(hwndListView,2,LVSCW_AUTOSIZE_USEHEADER);
+ (void)ListView_Update(hwndListView,0);
+
+
+ /* Set system environment variables */
+ hwndListView = GetDlgItem(hwndDlg, IDC_SYSTEM_VARIABLE_LIST);
+
+ SetListViewColumns(hwndListView);
+
+ SetEnvironmentVariables(hwndListView,
+ HKEY_LOCAL_MACHINE,
+ _T("SYSTEM\\CurrentControlSet\\Control\\Session
Manager\\Environment"));
+
+ (void)ListView_SetColumnWidth(hwndListView,2,LVSCW_AUTOSIZE_USEHEADER);
+ (void)ListView_Update(hwndListView,0);
+}
+
+
+VOID
+OnNewVariable(HWND hwndDlg,
+ int iDlgItem)
+{
+ HWND hwndListView;
+ PVARIABLE_DATA VarData;
+ LV_ITEM lvi;
+ int iItem;
+
+ hwndListView = GetDlgItem(hwndDlg, iDlgItem);
+
+ VarData = GlobalAlloc(GPTR, sizeof(VARIABLE_DATA));
+
+ if (!DialogBoxParam(hApplet,
+ MAKEINTRESOURCE(IDD_EDIT_VARIABLE),
+ hwndDlg,
+ (DLGPROC) EditVariableDlgProc,
+ (LPARAM)VarData) > 0)
+ {
+ if (VarData->lpName != NULL)
+ GlobalFree(VarData->lpName);
+
+ if (VarData->lpRawValue != NULL)
+ GlobalFree(VarData->lpRawValue);
+
+ if (VarData->lpCookedValue != NULL)
+ GlobalFree(VarData->lpCookedValue);
+
+ GlobalFree(VarData);
}
memset(&lvi, 0x00, sizeof(lvi));
lvi.mask = LVIF_TEXT | LVIF_STATE | LVIF_PARAM;
lvi.lParam = (LPARAM)VarData;
lvi.pszText = VarData->lpName;
- lvi.state = (i == 0) ? LVIS_SELECTED : 0;
+ lvi.state = 0;
iItem = ListView_InsertItem(hwndListView, &lvi);
ListView_SetItemText(hwndListView, iItem, 1,
(VarData->lpCookedValue) ? VarData->lpCookedValue :
VarData->lpRawValue);
- }
-
- GlobalFree(lpName);
- GlobalFree(lpData);
- RegCloseKey(hKey);
-}
-
-
-static VOID
-SetListViewColumns(HWND hwndListView)
-{
- RECT rect;
- LV_COLUMN column;
- TCHAR szStr[32];
-
- GetClientRect(hwndListView, &rect);
-
- memset(&column, 0x00, sizeof(column));
- column.mask=LVCF_FMT | LVCF_WIDTH | LVCF_SUBITEM | LVCF_TEXT;
- column.fmt=LVCFMT_LEFT;
- column.cx = (INT)((rect.right - rect.left) * 0.32);
- column.iSubItem = 0;
- LoadString(hApplet, IDS_VARIABLE, szStr, sizeof(szStr) / sizeof(szStr[0]));
- column.pszText = szStr;
- (void)ListView_InsertColumn(hwndListView, 0, &column);
-
- column.cx = (INT)((rect.right - rect.left) * 0.63);
- column.iSubItem = 1;
- LoadString(hApplet, IDS_VALUE, szStr, sizeof(szStr) / sizeof(szStr[0]));
- column.pszText = szStr;
- (void)ListView_InsertColumn(hwndListView, 1, &column);
-}
-
-
-static VOID
-OnInitDialog(HWND hwndDlg)
-{
- HWND hwndListView;
-
- /* Set user environment variables */
- hwndListView = GetDlgItem(hwndDlg, IDC_USER_VARIABLE_LIST);
-
- SetListViewColumns(hwndListView);
-
- SetEnvironmentVariables(hwndListView,
- HKEY_CURRENT_USER,
- _T("Environment"));
-
- (void)ListView_SetColumnWidth(hwndListView,2,LVSCW_AUTOSIZE_USEHEADER);
- (void)ListView_Update(hwndListView,0);
-
-
- /* Set system environment variables */
- hwndListView = GetDlgItem(hwndDlg, IDC_SYSTEM_VARIABLE_LIST);
-
- SetListViewColumns(hwndListView);
-
- SetEnvironmentVariables(hwndListView,
- HKEY_LOCAL_MACHINE,
- _T("SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment"));
-
- (void)ListView_SetColumnWidth(hwndListView,2,LVSCW_AUTOSIZE_USEHEADER);
- (void)ListView_Update(hwndListView,0);
-}
-
-
-VOID
-OnNewVariable(HWND hwndDlg,
- int iDlgItem)
-{
- HWND hwndListView;
- PVARIABLE_DATA VarData;
- LV_ITEM lvi;
- int iItem;
-
- hwndListView = GetDlgItem(hwndDlg, iDlgItem);
-
- VarData = GlobalAlloc(GPTR, sizeof(VARIABLE_DATA));
-
- if (!DialogBoxParam(hApplet,
- MAKEINTRESOURCE(IDD_EDIT_VARIABLE),
- hwndDlg,
- (DLGPROC) EditVariableDlgProc,
- (LPARAM)VarData) > 0)
- {
- if (VarData->lpName != NULL)
- GlobalFree(VarData->lpName);
-
- if (VarData->lpRawValue != NULL)
- GlobalFree(VarData->lpRawValue);
-
- if (VarData->lpCookedValue != NULL)
- GlobalFree(VarData->lpCookedValue);
-
- GlobalFree(VarData);
- }
-
- memset(&lvi, 0x00, sizeof(lvi));
- lvi.mask = LVIF_TEXT | LVIF_STATE | LVIF_PARAM;
- lvi.lParam = (LPARAM)VarData;
- lvi.pszText = VarData->lpName;
- lvi.state = 0;
- iItem = ListView_InsertItem(hwndListView, &lvi);
-
- ListView_SetItemText(hwndListView, iItem, 1,
- (VarData->lpCookedValue) ? VarData->lpCookedValue :
VarData->lpRawValue);
}
VOID
OnEditVariable(HWND hwndDlg,
- int iDlgItem)
-{
- HWND hwndListView;
- PVARIABLE_DATA VarData;
- LV_ITEM lvi;
- int iItem;
-
- hwndListView = GetDlgItem(hwndDlg, iDlgItem);
-
- iItem = ListView_GetSelectionMark(hwndListView);
- if (iItem != -1)
- {
- memset(&lvi, 0x00, sizeof(lvi));
- lvi.mask = LVIF_PARAM;
- lvi.iItem = iItem;
-
- if (ListView_GetItem(hwndListView, &lvi))
- {
- VarData = (PVARIABLE_DATA)lvi.lParam;
-
- if (DialogBoxParam(hApplet,
- MAKEINTRESOURCE(IDD_EDIT_VARIABLE),
- hwndDlg,
- (DLGPROC) EditVariableDlgProc,
- (LPARAM)VarData) > 0)
- {
- ListView_SetItemText(hwndListView, iItem, 0, VarData->lpName);
- ListView_SetItemText(hwndListView, iItem, 1,
- (VarData->lpCookedValue) ? VarData->lpCookedValue :
VarData->lpRawValue);
- }
- }
- }
+ int iDlgItem)
+{
+ HWND hwndListView;
+ PVARIABLE_DATA VarData;
+ LV_ITEM lvi;
+ int iItem;
+
+ hwndListView = GetDlgItem(hwndDlg, iDlgItem);
+
+ iItem = ListView_GetSelectionMark(hwndListView);
+ if (iItem != -1)
+ {
+ memset(&lvi, 0x00, sizeof(lvi));
+ lvi.mask = LVIF_PARAM;
+ lvi.iItem = iItem;
+
+ if (ListView_GetItem(hwndListView, &lvi))
+ {
+ VarData = (PVARIABLE_DATA)lvi.lParam;
+
+ if (DialogBoxParam(hApplet,
+ MAKEINTRESOURCE(IDD_EDIT_VARIABLE),
+ hwndDlg,
+ (DLGPROC) EditVariableDlgProc,
+ (LPARAM)VarData) > 0)
+ {
+ ListView_SetItemText(hwndListView, iItem, 0, VarData->lpName);
+ ListView_SetItemText(hwndListView, iItem, 1,
+ (VarData->lpCookedValue) ?
VarData->lpCookedValue : VarData->lpRawValue);
+ }
+ }
+ }
}
VOID
OnDeleteVariable(HWND hwndDlg,
- int iDlgItem)
-{
- HWND hwndListView;
- PVARIABLE_DATA VarData;
- LV_ITEM lvi;
- int iItem;
-
- hwndListView = GetDlgItem(hwndDlg, iDlgItem);
-
- iItem = ListView_GetSelectionMark(hwndListView);
- if (iItem != -1)
- {
- memset(&lvi, 0x00, sizeof(lvi));
- lvi.mask = LVIF_PARAM;
- lvi.iItem = iItem;
-
- if (ListView_GetItem(hwndListView, &lvi))
- {
- VarData = (PVARIABLE_DATA)lvi.lParam;
- if (VarData != NULL)
- {
- if (VarData->lpName != NULL)
- GlobalFree(VarData->lpName);
-
- if (VarData->lpRawValue != NULL)
- GlobalFree(VarData->lpRawValue);
-
- if (VarData->lpCookedValue != NULL)
- GlobalFree(VarData->lpCookedValue);
-
- GlobalFree(VarData);
- lvi.lParam = 0;
- }
- }
-
- (void)ListView_DeleteItem(hwndListView, iItem);
- }
+ int iDlgItem)
+{
+ HWND hwndListView;
+ PVARIABLE_DATA VarData;
+ LV_ITEM lvi;
+ int iItem;
+
+ hwndListView = GetDlgItem(hwndDlg, iDlgItem);
+
+ iItem = ListView_GetSelectionMark(hwndListView);
+ if (iItem != -1)
+ {
+ memset(&lvi, 0x00, sizeof(lvi));
+ lvi.mask = LVIF_PARAM;
+ lvi.iItem = iItem;
+
+ if (ListView_GetItem(hwndListView, &lvi))
+ {
+ VarData = (PVARIABLE_DATA)lvi.lParam;
+ if (VarData != NULL)
+ {
+ if (VarData->lpName != NULL)
+ GlobalFree(VarData->lpName);
+
+ if (VarData->lpRawValue != NULL)
+ GlobalFree(VarData->lpRawValue);
+
+ if (VarData->lpCookedValue != NULL)
+ GlobalFree(VarData->lpCookedValue);
+
+ GlobalFree(VarData);
+ lvi.lParam = 0;
+ }
+ }
+
+ (void)ListView_DeleteItem(hwndListView, iItem);
+ }
}
VOID
ReleaseListViewItems(HWND hwndDlg,
- int iDlgItem)
-{
- HWND hwndListView;
- PVARIABLE_DATA VarData;
- int nItemCount;
- LV_ITEM lvi;
- int i;
-
- hwndListView = GetDlgItem(hwndDlg, iDlgItem);
-
- memset(&lvi, 0x00, sizeof(lvi));
-
- nItemCount = ListView_GetItemCount(hwndListView);
- for (i = 0; i < nItemCount; i++)
- {
- lvi.mask = LVIF_PARAM;
- lvi.iItem = i;
-
- if (ListView_GetItem(hwndListView, &lvi))
- {
- VarData = (PVARIABLE_DATA)lvi.lParam;
- if (VarData != NULL)
- {
- if (VarData->lpName != NULL)
- GlobalFree(VarData->lpName);
-
- if (VarData->lpRawValue != NULL)
- GlobalFree(VarData->lpRawValue);
-
- if (VarData->lpCookedValue != NULL)
- GlobalFree(VarData->lpCookedValue);
-
- GlobalFree(VarData);
- lvi.lParam = 0;
- }
- }
- }
+ int iDlgItem)
+{
+ HWND hwndListView;
+ PVARIABLE_DATA VarData;
+ int nItemCount;
+ LV_ITEM lvi;
+ int i;
+
+ hwndListView = GetDlgItem(hwndDlg, iDlgItem);
+
+ memset(&lvi, 0x00, sizeof(lvi));
+
+ nItemCount = ListView_GetItemCount(hwndListView);
+ for (i = 0; i < nItemCount; i++)
+ {
+ lvi.mask = LVIF_PARAM;
+ lvi.iItem = i;
+
+ if (ListView_GetItem(hwndListView, &lvi))
+ {
+ VarData = (PVARIABLE_DATA)lvi.lParam;
+ if (VarData != NULL)
+ {
+ if (VarData->lpName != NULL)
+ GlobalFree(VarData->lpName);
+
+ if (VarData->lpRawValue != NULL)
+ GlobalFree(VarData->lpRawValue);
+
+ if (VarData->lpCookedValue != NULL)
+ GlobalFree(VarData->lpCookedValue);
+
+ GlobalFree(VarData);
+ lvi.lParam = 0;
+ }
+ }
+ }
}
VOID
SetAllVars(HWND hwndDlg,
INT iDlgItem)
{
- HWND hwndListView;
- PVARIABLE_DATA VarData;
- LV_ITEM lvi;
- INT iItem;
- HKEY hk;
- DWORD Type = 0;
-
- memset(&lvi, 0x00, sizeof(lvi));
-
- /* Get the handle to the list box with all system vars in it */
- hwndListView = GetDlgItem(hwndDlg, iDlgItem);
- /* first item is 0 */
- iItem = 0;
- /* set up struct to retreive item */
- lvi.mask = LVIF_PARAM;
- lvi.iItem = iItem;
-
- /* Open or create the key */
- if (RegCreateKeyEx((iDlgItem == IDC_SYSTEM_VARIABLE_LIST ? HKEY_LOCAL_MACHINE :
HKEY_CURRENT_USER),
- (iDlgItem == IDC_SYSTEM_VARIABLE_LIST ?
_T("SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment") :
_T("Environment")),
- 0,
- NULL,
- REG_OPTION_NON_VOLATILE,
- KEY_WRITE | KEY_READ,
- NULL,
- &hk,
- NULL))
- {
- return;
- }
-
- /* loop through all system variables */
- while(ListView_GetItem(hwndListView, &lvi))
- {
- /* Get the data in each item */
- VarData = (PVARIABLE_DATA)lvi.lParam;
- if (VarData != NULL)
- {
- /* Get the type */
- RegQueryValueEx(hk,VarData->lpName,NULL,&Type,NULL,NULL);
-
- /* Set the new value */
- if (RegSetValueEx(hk,
- VarData->lpName,
- 0,
- Type,
- (LPBYTE) VarData->lpRawValue,
- (DWORD) (_tcslen(VarData->lpRawValue)* sizeof(TCHAR))+1)) // was
_tcsclen. lstrlen?
- {
- RegCloseKey(hk);
- return;
- }
- }
- /* Fill struct for next item */
- lvi.mask = LVIF_PARAM;
- lvi.iItem = ++iItem;
- }
-
- RegCloseKey(hk);
+ HWND hwndListView;
+ PVARIABLE_DATA VarData;
+ LV_ITEM lvi;
+ INT iItem;
+ HKEY hk;
+ DWORD Type = 0;
+
+ memset(&lvi, 0x00, sizeof(lvi));
+
+ /* Get the handle to the list box with all system vars in it */
+ hwndListView = GetDlgItem(hwndDlg, iDlgItem);
+ /* first item is 0 */
+ iItem = 0;
+ /* set up struct to retreive item */
+ lvi.mask = LVIF_PARAM;
+ lvi.iItem = iItem;
+
+ /* Open or create the key */
+ if (RegCreateKeyEx((iDlgItem == IDC_SYSTEM_VARIABLE_LIST ? HKEY_LOCAL_MACHINE :
HKEY_CURRENT_USER),
+ (iDlgItem == IDC_SYSTEM_VARIABLE_LIST ?
_T("SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment") :
_T("Environment")),
+ 0,
+ NULL,
+ REG_OPTION_NON_VOLATILE,
+ KEY_WRITE | KEY_READ,
+ NULL,
+ &hk,
+ NULL))
+ {
+ return;
+ }
+
+ /* loop through all system variables */
+ while(ListView_GetItem(hwndListView, &lvi))
+ {
+ /* Get the data in each item */
+ VarData = (PVARIABLE_DATA)lvi.lParam;
+ if (VarData != NULL)
+ {
+ /* Get the type */
+ RegQueryValueEx(hk,VarData->lpName,NULL,&Type,NULL,NULL);
+
+ /* Set the new value */
+ if (RegSetValueEx(hk,
+ VarData->lpName,
+ 0,
+ Type,
+ (LPBYTE) VarData->lpRawValue,
+ (DWORD) (_tcslen(VarData->lpRawValue)*
sizeof(TCHAR))+1)) // was _tcsclen. lstrlen?
+ {
+ RegCloseKey(hk);
+ return;
+ }
+ }
+ /* Fill struct for next item */
+ lvi.mask = LVIF_PARAM;
+ lvi.iItem = ++iItem;
+ }
+
+ RegCloseKey(hk);
}
/* Environment dialog procedure */
INT_PTR CALLBACK
EnvironmentDlgProc(HWND hwndDlg,
- UINT uMsg,
- WPARAM wParam,
- LPARAM lParam)
-{
- switch (uMsg)
- {
- case WM_INITDIALOG:
- OnInitDialog(hwndDlg);
- break;
-
- case WM_COMMAND:
- switch (LOWORD(wParam))
- {
- case IDC_USER_VARIABLE_NEW:
- OnNewVariable(hwndDlg, IDC_USER_VARIABLE_LIST);
- return TRUE;
-
- case IDC_USER_VARIABLE_EDIT:
- OnEditVariable(hwndDlg, IDC_USER_VARIABLE_LIST);
- return TRUE;
-
- case IDC_USER_VARIABLE_DELETE:
- OnDeleteVariable(hwndDlg, IDC_USER_VARIABLE_LIST);
- return TRUE;
-
- case IDC_SYSTEM_VARIABLE_NEW:
- OnNewVariable(hwndDlg, IDC_SYSTEM_VARIABLE_LIST);
- return TRUE;
-
- case IDC_SYSTEM_VARIABLE_EDIT:
- OnEditVariable(hwndDlg, IDC_SYSTEM_VARIABLE_LIST);
- return TRUE;
-
- case IDC_SYSTEM_VARIABLE_DELETE:
- OnDeleteVariable(hwndDlg, IDC_SYSTEM_VARIABLE_LIST);
- return TRUE;
-
- case IDOK:
- SetAllVars(hwndDlg, IDC_USER_VARIABLE_LIST);
- SetAllVars(hwndDlg, IDC_SYSTEM_VARIABLE_LIST);
-
- case IDCANCEL:
- ReleaseListViewItems(hwndDlg, IDC_USER_VARIABLE_LIST);
- ReleaseListViewItems(hwndDlg, IDC_SYSTEM_VARIABLE_LIST);
- EndDialog(hwndDlg, 0);
- return TRUE;
- }
- break;
-
- case WM_NOTIFY:
- {
- NMHDR *phdr;
-
- phdr = (NMHDR*)lParam;
- switch(phdr->code)
- {
- case NM_DBLCLK:
- {
- if (phdr->idFrom == IDC_USER_VARIABLE_LIST ||
- phdr->idFrom == IDC_SYSTEM_VARIABLE_LIST)
+ UINT uMsg,
+ WPARAM wParam,
+ LPARAM lParam)
+{
+ switch (uMsg)
+ {
+ case WM_INITDIALOG:
+ OnInitDialog(hwndDlg);
+ break;
+
+ case WM_COMMAND:
+ switch (LOWORD(wParam))
+ {
+ case IDC_USER_VARIABLE_NEW:
+ OnNewVariable(hwndDlg, IDC_USER_VARIABLE_LIST);
+ return TRUE;
+
+ case IDC_USER_VARIABLE_EDIT:
+ OnEditVariable(hwndDlg, IDC_USER_VARIABLE_LIST);
+ return TRUE;
+
+ case IDC_USER_VARIABLE_DELETE:
+ OnDeleteVariable(hwndDlg, IDC_USER_VARIABLE_LIST);
+ return TRUE;
+
+ case IDC_SYSTEM_VARIABLE_NEW:
+ OnNewVariable(hwndDlg, IDC_SYSTEM_VARIABLE_LIST);
+ return TRUE;
+
+ case IDC_SYSTEM_VARIABLE_EDIT:
+ OnEditVariable(hwndDlg, IDC_SYSTEM_VARIABLE_LIST);
+ return TRUE;
+
+ case IDC_SYSTEM_VARIABLE_DELETE:
+ OnDeleteVariable(hwndDlg, IDC_SYSTEM_VARIABLE_LIST);
+ return TRUE;
+
+ case IDOK:
+ SetAllVars(hwndDlg, IDC_USER_VARIABLE_LIST);
+ SetAllVars(hwndDlg, IDC_SYSTEM_VARIABLE_LIST);
+
+ case IDCANCEL:
+ ReleaseListViewItems(hwndDlg, IDC_USER_VARIABLE_LIST);
+ ReleaseListViewItems(hwndDlg, IDC_SYSTEM_VARIABLE_LIST);
+ EndDialog(hwndDlg, 0);
+ return TRUE;
+ }
+ break;
+
+ case WM_NOTIFY:
+ {
+ NMHDR *phdr;
+
+ phdr = (NMHDR*)lParam;
+ switch(phdr->code)
+ {
+ case NM_DBLCLK:
{
- OnEditVariable(hwndDlg, (INT)phdr->idFrom);
- return TRUE;
+ if (phdr->idFrom == IDC_USER_VARIABLE_LIST ||
+ phdr->idFrom == IDC_SYSTEM_VARIABLE_LIST)
+ {
+ OnEditVariable(hwndDlg, (INT)phdr->idFrom);
+ return TRUE;
+ }
}
- }
- }
- }
- break;
- }
-
- return FALSE;
+ }
+ }
+ break;
+ }
+
+ return FALSE;
}
/* EOF */
Modified: branches/ros-branch-0_3_3/reactos/dll/cpl/sysdm/general.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-branch-0_3_3/reactos/dll/cp…
==============================================================================
--- branches/ros-branch-0_3_3/reactos/dll/cpl/sysdm/general.c (original)
+++ branches/ros-branch-0_3_3/reactos/dll/cpl/sysdm/general.c Sun Jul 29 19:05:09 2007
@@ -5,7 +5,7 @@
* PURPOSE: General System Information
* COPYRIGHT: Copyright Thomas Weidenmueller <w3seek(a)reactos.org>
* Copyright 2006 Ged Murphy <gedmurphy(a)gmail.com>
- * Copyright 2006 Colin Finck <mail(a)colinfinck.de>
+ * Copyright 2006-2007 Colin Finck <mail(a)colinfinck.de>
*
*/
@@ -23,27 +23,27 @@
void
ShowLastWin32Error(HWND hWndOwner)
{
- LPTSTR lpMsg;
- DWORD LastError;
-
- LastError = GetLastError();
-
- if((LastError == 0) ||
- !FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
+ LPTSTR lpMsg;
+ DWORD LastError;
+
+ 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))
- {
- return;
- }
-
- MessageBox(hWndOwner, lpMsg, NULL, MB_OK | MB_ICONERROR);
-
- LocalFree((LPVOID)lpMsg);
+ NULL,
+ LastError,
+ MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
+ (LPTSTR)&lpMsg,
+ 0,
+ NULL))
+ {
+ return;
+ }
+
+ MessageBox(hWndOwner, lpMsg, NULL, MB_OK | MB_ICONERROR);
+
+ LocalFree((LPVOID)lpMsg);
}
@@ -145,56 +145,57 @@
(PBYTE)lpBuf,
&BufSize) == ERROR_SUCCESS)
{
- 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.
*
- * Then wrap the string after this space.
*
- * - If no space is found, wrap the string after character 30.
*
- *
*
- * For example the Processor Name String of a Pentium 4 is right-aligned.
*
- * With this wrapping the first line looks centered.
*/
-
- _tcsncpy(szBuf, lpBuf, 30);
- szLastSpace = _tcsrchr(szBuf, ' ');
-
- if(szLastSpace == 0)
- LastSpace = 30;
- else
- LastSpace = (szLastSpace - szBuf);
-
- _tcsncpy(szBuf, lpBuf, LastSpace);
- szBuf[LastSpace] = 0;
-
- SetDlgItemText(hwnd,
- uID1,
- szBuf);
-
- SetDlgItemText(hwnd,
- uID2,
- lpBuf+LastSpace+1);
-
- /* Return the number of used lines */
- Ret = 2;
+ 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.
*
+ * Then wrap the string after this space.
*
+ * - If no space is found, wrap the string after character 30.
*
+ *
*
+ * For example the Processor Name String of a Pentium 4 is right-aligned.
*
+ * With this wrapping the first line looks centered.
*/
+
+ _tcsncpy(szBuf, lpBuf, 30);
+ szBuf[30] = 0;
+ szLastSpace = _tcsrchr(szBuf, ' ');
+
+ if(szLastSpace == 0)
+ LastSpace = 30;
+ else
+ {
+ LastSpace = (szLastSpace - szBuf);
+ szBuf[LastSpace] = 0;
+ }
+
+ _tcsncpy(szBuf, lpBuf, LastSpace);
+
+ SetDlgItemText(hwnd,
+ uID1,
+ szBuf);
+
+ SetDlgItemText(hwnd,
+ uID2,
+ lpBuf+LastSpace+1);
+
+ /* Return the number of used lines */
+ Ret = 2;
}
else
{
- SetDlgItemText(hwnd,
+ SetDlgItemText(hwnd,
uID1,
lpBuf);
-
- Ret = 1;
+
+ Ret = 1;
}
}
HeapFree(GetProcessHeap(),
0,
lpBuf);
-
- return Ret;
- }
-
- return 0;
+ }
+
+ return Ret;
}
static VOID
@@ -218,12 +219,12 @@
(PVOID)&ppi,
sizeof(ppi)) == STATUS_SUCCESS &&
ppi.CurrentMhz != 0) ||
- RegQueryValueEx(hKey,
- Value,
- NULL,
- &Type,
- (PBYTE)&ppi.CurrentMhz,
- &BufSize) == ERROR_SUCCESS)
+ RegQueryValueEx(hKey,
+ Value,
+ NULL,
+ &Type,
+ (PBYTE)&ppi.CurrentMhz,
+ &BufSize) == ERROR_SUCCESS)
{
if (ppi.CurrentMhz < 1000)
{
@@ -248,7 +249,6 @@
TCHAR ProcKey[] =
_T("HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0");
MEMORYSTATUSEX MemStat;
TCHAR Buf[32];
- INT Ret = 0;
INT CurMachineLine = IDC_MACHINELINE1;
@@ -263,22 +263,21 @@
KEY_READ,
&hKey) == ERROR_SUCCESS)
{
- SetRegTextData(hwnd,
- hKey,
- _T("VendorIdentifier"),
+ SetRegTextData(hwnd,
+ hKey,
+ _T("VendorIdentifier"),
CurMachineLine);
CurMachineLine++;
- Ret = SetProcNameString(hwnd,
- hKey,
- _T("ProcessorNameString"),
- CurMachineLine,
- CurMachineLine+1);
- CurMachineLine += Ret;
+ CurMachineLine += SetProcNameString(hwnd,
+ hKey,
+ _T("ProcessorNameString"),
+ CurMachineLine,
+ CurMachineLine + 1);
- SetProcSpeed(hwnd,
- hKey,
- _T("~MHz"),
+ SetProcSpeed(hwnd,
+ hKey,
+ _T("~MHz"),
CurMachineLine);
CurMachineLine++;
}
@@ -313,7 +312,6 @@
if (MemStat.ullTotalPhys > 1024 * 1024)
{
/* We're dealing with PBs or more */
-
MemStat.ullTotalPhys /= 1024;
i++;
@@ -333,15 +331,13 @@
if (LoadString(hApplet, uStrId[i], szStr, sizeof(szStr) / sizeof(szStr[0])))
{
- Ret = _stprintf(Buf, _T("%.2f %s"), dTotalPhys, szStr);
- }
- }
-
- if (Ret)
- {
- SetDlgItemText(hwnd,
- CurMachineLine,
- Buf);
+ if( _stprintf(Buf, _T("%.2f %s"), dTotalPhys, szStr) )
+ {
+ SetDlgItemText(hwnd,
+ CurMachineLine,
+ Buf);
+ }
+ }
}
}
@@ -434,8 +430,3 @@
return FALSE;
}
-
-
-
-
-
Modified: branches/ros-branch-0_3_3/reactos/dll/cpl/sysdm/hardprof.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-branch-0_3_3/reactos/dll/cp…
==============================================================================
--- branches/ros-branch-0_3_3/reactos/dll/cpl/sysdm/hardprof.c (original)
+++ branches/ros-branch-0_3_3/reactos/dll/cpl/sysdm/hardprof.c Sun Jul 29 19:05:09 2007
@@ -37,8 +37,8 @@
}
}
break;
- }
- return FALSE;
+ }
+ return FALSE;
}
@@ -80,9 +80,8 @@
return TRUE;
}
}
-
}
break;
- }
- return FALSE;
+ }
+ return FALSE;
}
Modified: branches/ros-branch-0_3_3/reactos/dll/cpl/sysdm/hardware.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-branch-0_3_3/reactos/dll/cp…
==============================================================================
--- branches/ros-branch-0_3_3/reactos/dll/cpl/sysdm/hardware.c (original)
+++ branches/ros-branch-0_3_3/reactos/dll/cpl/sysdm/hardware.c Sun Jul 29 19:05:09 2007
@@ -84,4 +84,3 @@
return FALSE;
}
-
Modified: branches/ros-branch-0_3_3/reactos/dll/cpl/sysdm/licence.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-branch-0_3_3/reactos/dll/cp…
==============================================================================
--- branches/ros-branch-0_3_3/reactos/dll/cpl/sysdm/licence.c (original)
+++ branches/ros-branch-0_3_3/reactos/dll/cpl/sysdm/licence.c Sun Jul 29 19:05:09 2007
@@ -55,11 +55,10 @@
IDC_LICENCEEDIT,
LicenseText);
- SendDlgItemMessage(hDlg,
- IDC_LICENCEEDIT,
- EM_SETSEL,
- -1,
- 0);
+ PostMessage(GetDlgItem(hDlg, IDC_LICENCEEDIT),
+ EM_SETSEL,
+ -1,
+ 0);
return TRUE;
}
Modified: branches/ros-branch-0_3_3/reactos/dll/cpl/sysdm/resources/gpl.txt
URL:
http://svn.reactos.org/svn/reactos/branches/ros-branch-0_3_3/reactos/dll/cp…
==============================================================================
Binary files - no diff available.
Modified: branches/ros-branch-0_3_3/reactos/dll/cpl/sysdm/startrec.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-branch-0_3_3/reactos/dll/cp…
==============================================================================
--- branches/ros-branch-0_3_3/reactos/dll/cpl/sysdm/startrec.c (original)
+++ branches/ros-branch-0_3_3/reactos/dll/cpl/sysdm/startrec.c Sun Jul 29 19:05:09 2007
@@ -15,15 +15,15 @@
void SetTimeout(HWND hwndDlg, int Timeout)
{
- if (Timeout == 0)
- {
- EnableWindow(GetDlgItem(hwndDlg, IDC_STRRECLISTUPDWN), FALSE);
- }
- else
- {
- EnableWindow(GetDlgItem(hwndDlg, IDC_STRRECLISTUPDWN), TRUE);
- }
- SendDlgItemMessage(hwndDlg, IDC_STRRECLISTUPDWN, UDM_SETPOS, (WPARAM) 0, (LPARAM)
MAKELONG((short) Timeout, 0));
+ if (Timeout == 0)
+ {
+ EnableWindow(GetDlgItem(hwndDlg, IDC_STRRECLISTUPDWN), FALSE);
+ }
+ else
+ {
+ EnableWindow(GetDlgItem(hwndDlg, IDC_STRRECLISTUPDWN), TRUE);
+ }
+ SendDlgItemMessage(hwndDlg, IDC_STRRECLISTUPDWN, UDM_SETPOS, (WPARAM) 0, (LPARAM)
MAKELONG((short) Timeout, 0));
}
/* Property page dialog callback */
@@ -33,116 +33,116 @@
WPARAM wParam,
LPARAM lParam)
{
- TCHAR *szSystemDrive;
- TCHAR szDefaultOS[MAX_PATH];
- TCHAR szDefaultOSName[MAX_PATH];
- TCHAR szTimeout[10];
- int iTimeout;
+ TCHAR *szSystemDrive;
+ TCHAR szDefaultOS[MAX_PATH];
+ TCHAR szDefaultOSName[MAX_PATH];
+ TCHAR szTimeout[10];
+ int iTimeout;
- UNREFERENCED_PARAMETER(lParam);
-
- switch(uMsg)
- {
- case WM_INITDIALOG:
- {
- DWORD dwBufSize;
+ UNREFERENCED_PARAMETER(lParam);
- /* get Path to freeldr.ini or boot.ini */
- szSystemDrive = HeapAlloc(GetProcessHeap(), 0, MAX_PATH * sizeof(TCHAR));
- if (szSystemDrive != NULL)
- {
- dwBufSize = GetEnvironmentVariable(_T("SystemDrive"), szSystemDrive,
MAX_PATH);
- if (dwBufSize > MAX_PATH)
- {
- TCHAR *szTmp;
- DWORD dwBufSize2;
+ switch(uMsg)
+ {
+ case WM_INITDIALOG:
+ {
+ DWORD dwBufSize;
- szTmp = HeapReAlloc(GetProcessHeap(), 0, szSystemDrive, dwBufSize * sizeof(TCHAR));
- if (szTmp == NULL)
- goto FailGetSysDrive;
+ /* get Path to freeldr.ini or boot.ini */
+ szSystemDrive = HeapAlloc(GetProcessHeap(), 0, MAX_PATH * sizeof(TCHAR));
+ if (szSystemDrive != NULL)
+ {
+ dwBufSize = GetEnvironmentVariable(_T("SystemDrive"),
szSystemDrive, MAX_PATH);
+ if (dwBufSize > MAX_PATH)
+ {
+ TCHAR *szTmp;
+ DWORD dwBufSize2;
- szSystemDrive = szTmp;
+ szTmp = HeapReAlloc(GetProcessHeap(), 0, szSystemDrive, dwBufSize *
sizeof(TCHAR));
+ if (szTmp == NULL)
+ goto FailGetSysDrive;
- dwBufSize2 = GetEnvironmentVariable(_T("SystemDrive"), szSystemDrive,
dwBufSize);
- if (dwBufSize2 > dwBufSize || dwBufSize2 == 0)
- goto FailGetSysDrive;
- }
- else if (dwBufSize == 0)
- {
+ szSystemDrive = szTmp;
+
+ dwBufSize2 = GetEnvironmentVariable(_T("SystemDrive"),
szSystemDrive, dwBufSize);
+ if (dwBufSize2 > dwBufSize || dwBufSize2 == 0)
+ goto FailGetSysDrive;
+ }
+ else if (dwBufSize == 0)
+ {
FailGetSysDrive:
- HeapFree(GetProcessHeap(), 0, szSystemDrive);
- szSystemDrive = NULL;
- }
+ HeapFree(GetProcessHeap(), 0, szSystemDrive);
+ szSystemDrive = NULL;
+ }
- if (szSystemDrive != NULL)
- {
- if (m_szFreeldrIni != NULL)
- {
- _tcscpy(m_szFreeldrIni, szSystemDrive);
- _tcscat(m_szFreeldrIni, _T("\\freeldr.ini"));
- if (!PathFileExists(m_szFreeldrIni))
- {
- _tcscpy(m_szFreeldrIni, szSystemDrive);
- _tcscat(m_szFreeldrIni, _T("\\boot.ini"));
- }
- }
- HeapFree(GetProcessHeap(), 0, szSystemDrive);
- }
- }
-
- SetDlgItemText(hwndDlg, IDC_STRRECDUMPFILE, _T("%SystemRoot%\\MiniDump"));
+ if (szSystemDrive != NULL)
+ {
+ if (m_szFreeldrIni != NULL)
+ {
+ _tcscpy(m_szFreeldrIni, szSystemDrive);
+ _tcscat(m_szFreeldrIni, _T("\\freeldr.ini"));
+ if (!PathFileExists(m_szFreeldrIni))
+ {
+ _tcscpy(m_szFreeldrIni, szSystemDrive);
+ _tcscat(m_szFreeldrIni, _T("\\boot.ini"));
+ }
+ }
+ HeapFree(GetProcessHeap(), 0, szSystemDrive);
+ }
+ }
- /* load settings from freeldr.ini */
- GetPrivateProfileString(_T("boot loader"), _T("default"), NULL,
szDefaultOS, MAX_PATH, m_szFreeldrIni);
- GetPrivateProfileString(_T("operating systems"), szDefaultOS, NULL,
szDefaultOSName, MAX_PATH, m_szFreeldrIni);
- SendDlgItemMessage(hwndDlg, IDC_STRECOSCOMBO, CB_ADDSTRING, (WPARAM)0,
(LPARAM)szDefaultOSName);
- SendDlgItemMessage(hwndDlg, IDC_STRECOSCOMBO, CB_SETCURSEL, (WPARAM)0, (LPARAM)0);
+ SetDlgItemText(hwndDlg, IDC_STRRECDUMPFILE,
_T("%SystemRoot%\\MiniDump"));
- /* timeout */
- iTimeout = GetPrivateProfileInt(_T("boot loader"), _T("timeout"),
0, m_szFreeldrIni);
- SetTimeout(hwndDlg, iTimeout);
- if (iTimeout != 0)
- SendDlgItemMessage(hwndDlg, IDC_STRECLIST, BM_SETCHECK, (WPARAM)BST_CHECKED,
(LPARAM)0);
+ /* load settings from freeldr.ini */
+ GetPrivateProfileString(_T("boot loader"), _T("default"),
NULL, szDefaultOS, MAX_PATH, m_szFreeldrIni);
+ GetPrivateProfileString(_T("operating systems"), szDefaultOS, NULL,
szDefaultOSName, MAX_PATH, m_szFreeldrIni);
+ SendDlgItemMessage(hwndDlg, IDC_STRECOSCOMBO, CB_ADDSTRING, (WPARAM)0,
(LPARAM)szDefaultOSName);
+ SendDlgItemMessage(hwndDlg, IDC_STRECOSCOMBO, CB_SETCURSEL, (WPARAM)0,
(LPARAM)0);
- }
- break;
+ /* timeout */
+ iTimeout = GetPrivateProfileInt(_T("boot loader"),
_T("timeout"), 0, m_szFreeldrIni);
+ SetTimeout(hwndDlg, iTimeout);
+ if (iTimeout != 0)
+ SendDlgItemMessage(hwndDlg, IDC_STRECLIST, BM_SETCHECK,
(WPARAM)BST_CHECKED, (LPARAM)0);
- case WM_COMMAND:
- {
- switch(LOWORD(wParam))
- {
- case IDC_STRRECEDIT:
- {
- ShellExecute(0, _T("open"), _T("notepad"), m_szFreeldrIni, NULL,
SW_SHOWNORMAL);
- 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);
- else
- iTimeout = 0;
- _stprintf(szTimeout, _T("%i"), iTimeout);
- WritePrivateProfileString(_T("boot loader"), _T("timeout"),
szTimeout, m_szFreeldrIni);
- }
- case IDCANCEL:
- {
- EndDialog(hwndDlg,
- LOWORD(wParam));
- return TRUE;
- break;
- }
- case IDC_STRECLIST:
- {
- if (SendDlgItemMessage(hwndDlg, IDC_STRECLIST, BM_GETCHECK, (WPARAM)0, (LPARAM)0) ==
BST_CHECKED)
- SetTimeout(hwndDlg, 30);
- else
- SetTimeout(hwndDlg, 0);
- }
- }
- }
- break;
- }
- return FALSE;
+ }
+ break;
+
+ case WM_COMMAND:
+ {
+ switch(LOWORD(wParam))
+ {
+ case IDC_STRRECEDIT:
+ {
+ ShellExecute(0, _T("open"), _T("notepad"),
m_szFreeldrIni, NULL, SW_SHOWNORMAL);
+ 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);
+ else
+ iTimeout = 0;
+ _stprintf(szTimeout, _T("%i"), iTimeout);
+ WritePrivateProfileString(_T("boot loader"),
_T("timeout"), szTimeout, m_szFreeldrIni);
+ }
+ case IDCANCEL:
+ {
+ EndDialog(hwndDlg,
+ LOWORD(wParam));
+ return TRUE;
+ break;
+ }
+ case IDC_STRECLIST:
+ {
+ if (SendDlgItemMessage(hwndDlg, IDC_STRECLIST, BM_GETCHECK,
(WPARAM)0, (LPARAM)0) == BST_CHECKED)
+ SetTimeout(hwndDlg, 30);
+ else
+ SetTimeout(hwndDlg, 0);
+ }
+ }
+ }
+ break;
+ }
+ return FALSE;
}
Modified: branches/ros-branch-0_3_3/reactos/dll/cpl/sysdm/sysdm.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-branch-0_3_3/reactos/dll/cp…
==============================================================================
--- branches/ros-branch-0_3_3/reactos/dll/cpl/sysdm/sysdm.c (original)
+++ branches/ros-branch-0_3_3/reactos/dll/cpl/sysdm/sysdm.c Sun Jul 29 19:05:09 2007
@@ -15,7 +15,7 @@
/* Applets */
APPLET Applets[NUM_APPLETS] =
{
- {IDI_CPLSYSTEM, IDS_CPLSYSTEMNAME, IDS_CPLSYSTEMDESCRIPTION, SystemApplet}
+ {IDI_CPLSYSTEM, IDS_CPLSYSTEMNAME, IDS_CPLSYSTEMDESCRIPTION, SystemApplet}
};
#define MAX_SYSTEM_PAGES 32
@@ -99,107 +99,106 @@
LONG CALLBACK
SystemApplet(VOID)
{
- HPROPSHEETPAGE hpsp[MAX_SYSTEM_PAGES];
- PROPSHEETHEADER psh;
- HMODULE hNetIdDll;
- HPSXA hpsxa = NULL;
- LONG Ret;
- static INITCOMMONCONTROLSEX icc = {sizeof(INITCOMMONCONTROLSEX), ICC_LINK_CLASS};
-
- if (!InitCommonControlsEx(&icc))
- return 0;
-
- ZeroMemory(&psh, sizeof(PROPSHEETHEADER));
- psh.dwSize = sizeof(PROPSHEETHEADER);
- psh.dwFlags = PSH_PROPTITLE;
- psh.hwndParent = NULL;
- psh.hInstance = hApplet;
- psh.hIcon = LoadIcon(hApplet, MAKEINTRESOURCE(IDI_CPLSYSTEM));
- psh.pszCaption = MAKEINTRESOURCE(IDS_CPLSYSTEMNAME);
- psh.nPages = 0;
- psh.nStartPage = 0;
- psh.phpage = hpsp;
- psh.pfnCallback = NULL;
-
- InitPropSheetPage(&psh, IDD_PROPPAGEGENERAL, (DLGPROC) GeneralPageProc);
- hNetIdDll = AddNetIdPage(&psh);
- InitPropSheetPage(&psh, IDD_PROPPAGEHARDWARE, (DLGPROC) HardwarePageProc);
- InitPropSheetPage(&psh, IDD_PROPPAGEADVANCED, (DLGPROC) AdvancedPageProc);
-
- /* Load additional pages provided by shell extensions */
- hpsxa = SHCreatePropSheetExtArray(HKEY_LOCAL_MACHINE, REGSTR_PATH_CONTROLSFOLDER
TEXT("\\System"), MAX_SYSTEM_PAGES - psh.nPages);
- if (hpsxa != NULL)
- {
- SHAddFromPropSheetExtArray(hpsxa, PropSheetAddPage, (LPARAM)&psh);
- }
-
- Ret = (LONG)(PropertySheet(&psh) != -1);
-
- if (hpsxa != NULL)
- {
- SHDestroyPropSheetExtArray(hpsxa);
- }
-
- if (hNetIdDll != NULL)
- FreeLibrary(hNetIdDll);
-
- return Ret;
+ HPROPSHEETPAGE hpsp[MAX_SYSTEM_PAGES];
+ PROPSHEETHEADER psh;
+ HMODULE hNetIdDll;
+ HPSXA hpsxa = NULL;
+ LONG Ret;
+ static INITCOMMONCONTROLSEX icc = {sizeof(INITCOMMONCONTROLSEX), ICC_LINK_CLASS};
+
+ if (!InitCommonControlsEx(&icc))
+ return 0;
+
+ ZeroMemory(&psh, sizeof(PROPSHEETHEADER));
+ psh.dwSize = sizeof(PROPSHEETHEADER);
+ psh.dwFlags = PSH_PROPTITLE;
+ psh.hwndParent = NULL;
+ psh.hInstance = hApplet;
+ psh.hIcon = LoadIcon(hApplet, MAKEINTRESOURCE(IDI_CPLSYSTEM));
+ psh.pszCaption = MAKEINTRESOURCE(IDS_CPLSYSTEMNAME);
+ psh.nPages = 0;
+ psh.nStartPage = 0;
+ psh.phpage = hpsp;
+ psh.pfnCallback = NULL;
+
+ InitPropSheetPage(&psh, IDD_PROPPAGEGENERAL, (DLGPROC) GeneralPageProc);
+ hNetIdDll = AddNetIdPage(&psh);
+ InitPropSheetPage(&psh, IDD_PROPPAGEHARDWARE, (DLGPROC) HardwarePageProc);
+ InitPropSheetPage(&psh, IDD_PROPPAGEADVANCED, (DLGPROC) AdvancedPageProc);
+
+ /* Load additional pages provided by shell extensions */
+ hpsxa = SHCreatePropSheetExtArray(HKEY_LOCAL_MACHINE, REGSTR_PATH_CONTROLSFOLDER
TEXT("\\System"), MAX_SYSTEM_PAGES - psh.nPages);
+ if (hpsxa != NULL)
+ {
+ SHAddFromPropSheetExtArray(hpsxa, PropSheetAddPage, (LPARAM)&psh);
+ }
+
+ Ret = (LONG)(PropertySheet(&psh) != -1);
+
+ if (hpsxa != NULL)
+ {
+ SHDestroyPropSheetExtArray(hpsxa);
+ }
+
+ if (hNetIdDll != NULL)
+ FreeLibrary(hNetIdDll);
+
+ return Ret;
}
/* Control Panel Callback */
LONG CALLBACK
CPlApplet(
- HWND hwndCPl,
- UINT uMsg,
- LPARAM lParam1,
- LPARAM lParam2)
-{
- int i = (int)lParam1;
- UNREFERENCED_PARAMETER(hwndCPl);
-
- 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;
- break;
- }
- case CPL_DBLCLK:
- {
- Applets[i].AppletProc();
- break;
- }
- }
- return FALSE;
+ HWND hwndCPl,
+ UINT uMsg,
+ LPARAM lParam1,
+ LPARAM lParam2)
+{
+ int i = (int)lParam1;
+ UNREFERENCED_PARAMETER(hwndCPl);
+
+ 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;
+ break;
+ }
+ case CPL_DBLCLK:
+ {
+ Applets[i].AppletProc();
+ break;
+ }
+ }
+ return FALSE;
}
BOOL STDCALL
DllMain(
- HINSTANCE hinstDLL,
- DWORD dwReason,
- LPVOID lpvReserved)
-{
- UNREFERENCED_PARAMETER(lpvReserved);
- switch(dwReason)
- {
- case DLL_PROCESS_ATTACH:
- case DLL_THREAD_ATTACH:
- hApplet = hinstDLL;
- break;
- }
- return TRUE;
-}
-
+ HINSTANCE hinstDLL,
+ DWORD dwReason,
+ LPVOID lpvReserved)
+{
+ UNREFERENCED_PARAMETER(lpvReserved);
+ switch(dwReason)
+ {
+ case DLL_PROCESS_ATTACH:
+ case DLL_THREAD_ATTACH:
+ hApplet = hinstDLL;
+ break;
+ }
+ return TRUE;
+}
Modified: branches/ros-branch-0_3_3/reactos/dll/cpl/sysdm/userprofile.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-branch-0_3_3/reactos/dll/cp…
==============================================================================
--- branches/ros-branch-0_3_3/reactos/dll/cpl/sysdm/userprofile.c (original)
+++ branches/ros-branch-0_3_3/reactos/dll/cpl/sysdm/userprofile.c Sun Jul 29 19:05:09
2007
@@ -55,6 +55,6 @@
}
break;
}
- }
- return FALSE;
+ }
+ return FALSE;
}
Modified: branches/ros-branch-0_3_3/reactos/dll/cpl/sysdm/virtmem.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-branch-0_3_3/reactos/dll/cp…
==============================================================================
--- branches/ros-branch-0_3_3/reactos/dll/cpl/sysdm/virtmem.c (original)
+++ branches/ros-branch-0_3_3/reactos/dll/cpl/sysdm/virtmem.c Sun Jul 29 19:05:09 2007
@@ -53,7 +53,6 @@
bRet = TRUE;
}
}
-
}
}
@@ -559,7 +558,6 @@
LPNMLISTVIEW pnmv = (LPNMLISTVIEW) lParam;
OnSelChange(pVirtMem, pnmv);
-
}
}
}