- Notify the system of changes to the environment variables.
authorEric Kohl <eric.kohl@reactos.org>
Sat, 10 Nov 2007 16:50:22 +0000 (16:50 +0000)
committerEric Kohl <eric.kohl@reactos.org>
Sat, 10 Nov 2007 16:50:22 +0000 (16:50 +0000)
- Parse pagefile sizes properly.
- Make pagefile sizes fully readable.

svn path=/trunk/; revision=30335

reactos/dll/cpl/sysdm/environment.c
reactos/dll/cpl/sysdm/virtmem.c

index 83047d4..a6f8b46 100644 (file)
@@ -723,6 +723,8 @@ EnvironmentDlgProc(HWND hwndDlg,
                 case IDOK:
                     SetAllVars(hwndDlg, IDC_USER_VARIABLE_LIST);
                     SetAllVars(hwndDlg, IDC_SYSTEM_VARIABLE_LIST);
+                    SendMessage(HWND_BROADCAST, WM_WININICHANGE,
+                                0, (LPARAM)_T("Environment"));
                     EndDialog(hwndDlg, 0);
                     return TRUE;
 
index 18e364f..6ffb898 100644 (file)
@@ -67,21 +67,37 @@ ReadPageFileSettings(PVIRTMEM pVirtMem)
 }
 
 
-static INT
-GetPageFileSizes(LPTSTR lpPageFiles)
+static VOID
+GetPageFileSizes(LPTSTR lpPageFiles,
+                 LPINT lpInitialSize,
+                 LPINT lpMaximumSize)
 {
+    INT i = 0;
+
+    *lpInitialSize = -1;
+    *lpMaximumSize = -1;
+
     while (*lpPageFiles != _T('\0'))
     {
         if (*lpPageFiles == _T(' '))
         {
             lpPageFiles++;
-            return (INT)_ttoi(lpPageFiles);
+
+            switch (i)
+            {
+                case 0:
+                    *lpInitialSize = (INT)_ttoi(lpPageFiles);
+                    i = 1;
+                    break;
+
+                case 1:
+                    *lpMaximumSize = (INT)_ttoi(lpPageFiles);
+                    return;
+            }
         }
 
         lpPageFiles++;
     }
-
-    return -1;
 }
 
 
@@ -123,8 +139,9 @@ ParseMemSettings(PVIRTMEM pVirtMem)
             if (!_tcsncmp(pVirtMem->szPagingFiles, szDrive, 2))
             {
                 /* FIXME: we only check the first available pagefile in the reg */
-                InitialSize = GetPageFileSizes(pVirtMem->szPagingFiles);
-                MaxSize = GetPageFileSizes(pVirtMem->szPagingFiles);
+                GetPageFileSizes(pVirtMem->szPagingFiles,
+                                 &InitialSize,
+                                 &MaxSize);
 
                 pVirtMem->Pagefile[PgCnt].InitialValue = InitialSize;
                 pVirtMem->Pagefile[PgCnt].MaxValue = MaxSize;
@@ -245,7 +262,7 @@ WritePageFileSettings(PVIRTMEM pVirtMem)
 static VOID
 SetListBoxColumns(HWND hwndListBox)
 {
-    const INT tabs[2] = {30, 170};
+    const INT tabs[2] = {30, 120};
 
     SendMessage(hwndListBox, LB_SETTABSTOPS, (WPARAM)2, (LPARAM)&tabs[0]);
 }