[SYSDM] Rename some functions. #179
[reactos.git] / dll / cpl / sysdm / virtmem.c
index af9ce05..e80b33c 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * PROJECT:     ReactOS system properties, control panel applet
  * LICENSE:     GPL - See COPYING in the top level directory
- * FILE:        dll/cpl/sysdm/virtual.c
+ * FILE:        dll/cpl/sysdm/virtmem.c
  * PURPOSE:     Virtual memory control dialog
  * COPYRIGHT:   Copyright 2006 Ged Murphy <gedmurphy@gmail.com>
  *
@@ -406,7 +406,7 @@ OnSet(PVIRTMEM pVirtMem)
         DriveIndex = SendDlgItemMessage(pVirtMem->hSelf,
                                         IDC_PAGEFILELIST,
                                         LB_GETITEMDATA,
-                                        0,
+                                        (WPARAM)Index,
                                         0);
 
         /* Check if custom settings are checked */
@@ -442,7 +442,7 @@ OnSet(PVIRTMEM pVirtMem)
             }
 
             /* Check the valid range of the minimum size */
-            if (MinSize < 2 ||
+            if (MinSize < 16 ||
                 MinSize > pVirtMem->Pagefile[DriveIndex].FreeSize)
             {
                 ResourceMessageBox(hApplet,
@@ -455,7 +455,8 @@ OnSet(PVIRTMEM pVirtMem)
 
             /* Check the valid range of the maximum size */
             if (MaxSize < MinSize ||
-                MaxSize > pVirtMem->Pagefile[DriveIndex].FreeSize)
+                MaxSize > pVirtMem->Pagefile[DriveIndex].FreeSize ||
+                MaxSize > 4095)
             {
                 ResourceMessageBox(hApplet,
                                    NULL,
@@ -568,7 +569,7 @@ OnSelChange(HWND hwndDlg, PVIRTMEM pVirtMem)
         }
 
         /* Set minimum pagefile size */
-        SetDlgItemText(hwndDlg, IDC_MINIMUM, _T("2 MB"));
+        SetDlgItemText(hwndDlg, IDC_MINIMUM, _T("16 MB"));
 
         /* Set recommended pagefile size */
         MemoryStatus.dwLength = sizeof(MEMORYSTATUSEX);
@@ -596,9 +597,9 @@ OnSelChange(HWND hwndDlg, PVIRTMEM pVirtMem)
 
 
 static VOID
-OnOk(PVIRTMEM pVirtMem)
+OnVirtMemDialogOk(PVIRTMEM pVirtMem)
 {
-    if (pVirtMem->bModified == TRUE)
+    if (pVirtMem->bModified != FALSE)
     {
         ResourceMessageBox(hApplet,
                            NULL,
@@ -612,7 +613,7 @@ OnOk(PVIRTMEM pVirtMem)
 
 
 static VOID
-OnInitDialog(HWND hwnd, PVIRTMEM pVirtMem)
+OnInitVirtMemDialog(HWND hwnd, PVIRTMEM pVirtMem)
 {
     INT i;
 
@@ -683,7 +684,7 @@ VirtMemDlgProc(HWND hwndDlg,
 
             SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pVirtMem);
 
-            OnInitDialog(hwndDlg, pVirtMem);
+            OnInitVirtMemDialog(hwndDlg, pVirtMem);
             break;
 
         case WM_DESTROY:
@@ -698,7 +699,7 @@ VirtMemDlgProc(HWND hwndDlg,
                     return TRUE;
 
                 case IDOK:
-                    OnOk(pVirtMem);
+                    OnVirtMemDialogOk(pVirtMem);
                     EndDialog(hwndDlg, pVirtMem->bModified);
                     return TRUE;