mirror of
https://github.com/reactos/reactos.git
synced 2025-04-05 21:21:33 +00:00
[SYSDM] Virtual Memory panel : improve settings for pagefile + fr-fr translation
* Fix for CORE-12486 Co-Authored-By: Katayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com> Co-authored-by: Sylvain Deverre <deverre.sylv@gmail.com>
This commit is contained in:
parent
216b702fb6
commit
4d2d2dbb25
2 changed files with 55 additions and 29 deletions
|
@ -122,15 +122,15 @@ END
|
||||||
|
|
||||||
IDD_COPYPROFILE DIALOGEX 12, 26, 256, 52
|
IDD_COPYPROFILE DIALOGEX 12, 26, 256, 52
|
||||||
STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
|
STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
|
||||||
CAPTION "Copy Profile"
|
CAPTION "Copier le profil"
|
||||||
FONT 8, "MS Shell Dlg"
|
FONT 8, "MS Shell Dlg"
|
||||||
BEGIN
|
BEGIN
|
||||||
LTEXT "From:", IDC_STATIC, 5, 10, 20, 8
|
LTEXT "De :", IDC_STATIC, 5, 10, 20, 8
|
||||||
LTEXT "", IDC_COPYPROFILEFROM, 30, 10, 160, 10
|
LTEXT "", IDC_COPYPROFILEFROM, 30, 10, 160, 10
|
||||||
LTEXT "To:", IDC_STATIC, 5, 30, 20, 8
|
LTEXT "Vers :", IDC_STATIC, 5, 30, 20, 8
|
||||||
EDITTEXT IDC_COPYPROFILETO, 30, 30, 160, 12
|
EDITTEXT IDC_COPYPROFILETO, 30, 30, 160, 12
|
||||||
DEFPUSHBUTTON "OK", IDOK, 199, 9, 50, 14
|
DEFPUSHBUTTON "OK", IDOK, 199, 9, 50, 14
|
||||||
PUSHBUTTON "Cancel", IDCANCEL, 199, 30, 50, 14
|
PUSHBUTTON "Annuler", IDCANCEL, 199, 30, 50, 14
|
||||||
END
|
END
|
||||||
|
|
||||||
IDD_RENAMEPROFILE DIALOGEX 12, 26, 256, 52
|
IDD_RENAMEPROFILE DIALOGEX 12, 26, 256, 52
|
||||||
|
@ -227,32 +227,32 @@ END
|
||||||
|
|
||||||
IDD_VIRTMEM DIALOGEX 6, 6, 223, 248
|
IDD_VIRTMEM DIALOGEX 6, 6, 223, 248
|
||||||
STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
|
STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
|
||||||
CAPTION "Mémoire Virtuelle"
|
CAPTION "Mémoire virtuelle"
|
||||||
FONT 8, "MS Shell Dlg", 0, 0, 0x0
|
FONT 8, "MS Shell Dlg", 0, 0, 0x0
|
||||||
BEGIN
|
BEGIN
|
||||||
LTEXT "Lecteur [Nom de Volume]", IDC_STATIC, 12, 5, 96, 9
|
LTEXT "Lecteur [Nom de Volume]", IDC_STATIC, 12, 5, 96, 9
|
||||||
LTEXT "Taille du fichier d'échange (Mo)", IDC_STATIC, 115, 5, 96, 9
|
LTEXT "Taille du fichier d'échange (Mo)", IDC_STATIC, 115, 5, 99, 9
|
||||||
LISTBOX IDC_PAGEFILELIST, 10, 16, 204, 52, LBS_NOTIFY | LBS_USETABSTOPS
|
LISTBOX IDC_PAGEFILELIST, 10, 16, 204, 52, LBS_NOTIFY | LBS_USETABSTOPS
|
||||||
GROUPBOX "Taille du fichier d'échange pour le disque sélectionné", IDC_DRIVEGROUP, 10, 70, 204, 104
|
GROUPBOX "Taille du fichier d'échange pour le disque sélectionné", IDC_DRIVEGROUP, 10, 70, 204, 104
|
||||||
LTEXT "Lecteur :", IDC_STATIC, 20, 80, 30, 8
|
LTEXT "Lecteur :", IDC_STATIC, 20, 80, 30, 8
|
||||||
LTEXT "", IDC_DRIVE, 88, 81, 100, 9
|
LTEXT "", IDC_DRIVE, 88, 81, 100, 9
|
||||||
LTEXT "Espace disponible :", IDC_STATIC, 20, 92, 66, 9
|
LTEXT "Espace disponible :", IDC_STATIC, 20, 92, 66, 9
|
||||||
LTEXT "", IDC_SPACEAVAIL, 88, 92, 104, 9
|
LTEXT "", IDC_SPACEAVAIL, 88, 92, 104, 9
|
||||||
LTEXT "Taille &Initiale (Mo) :", -1, 22, 118, 72, 9
|
LTEXT "Taille initiale (Mo) :", -1, 22, 118, 72, 9
|
||||||
LTEXT "Taille Ma&ximum (Mo) :", -1, 22, 131, 72, 9
|
LTEXT "Taille maximale (Mo) :", -1, 22, 131, 72, 9
|
||||||
AUTORADIOBUTTON "&Taille personnalisée", IDC_CUSTOM, 20, 105, 75, 9, WS_GROUP
|
AUTORADIOBUTTON "&Taille personnalisée", IDC_CUSTOM, 20, 105, 75, 9, WS_GROUP
|
||||||
AUTORADIOBUTTON "&Taille &gérée par le système", IDC_SYSMANSIZE, 20, 145, 100, 9
|
AUTORADIOBUTTON "&Taille &gérée par le système", IDC_SYSMANSIZE, 20, 145, 100, 9
|
||||||
AUTORADIOBUTTON "&Pas de mémoire virtuelle", IDC_NOPAGEFILE, 20, 158, 100,9
|
AUTORADIOBUTTON "Aucun fichier d'échange", IDC_NOPAGEFILE, 20, 158, 100,9
|
||||||
EDITTEXT IDC_INITIALSIZE, 100, 114, 44, 13, NOT WS_BORDER, WS_EX_CLIENTEDGE
|
EDITTEXT IDC_INITIALSIZE, 100, 114, 44, 13, NOT WS_BORDER, WS_EX_CLIENTEDGE
|
||||||
EDITTEXT IDC_MAXSIZE, 100, 129, 44, 13, NOT WS_BORDER, WS_EX_CLIENTEDGE
|
EDITTEXT IDC_MAXSIZE, 100, 129, 44, 13, NOT WS_BORDER, WS_EX_CLIENTEDGE
|
||||||
PUSHBUTTON "Régler", IDC_SET, 158, 154, 50, 15
|
PUSHBUTTON "Définir", IDC_SET, 158, 154, 50, 15
|
||||||
GROUPBOX "Mémoire virtuelle totale pour tous les lecteurs", IDC_TOTALGROUP, 10, 177, 204, 46
|
GROUPBOX "Taille totale du fichier d'échange pour tous les lecteurs", IDC_TOTALGROUP, 10, 177, 204, 46
|
||||||
LTEXT "Minimum alloué :", IDC_STATIC, 18, 188, 58, 9
|
LTEXT "Minimum alloué :", IDC_STATIC, 18, 188, 58, 9
|
||||||
LTEXT "", IDC_MINIMUM, 88, 188, 100, 9
|
LTEXT "", IDC_MINIMUM, 88, 188, 100, 9
|
||||||
LTEXT "Recommandé :", IDC_STATIC, 18, 199, 52, 9
|
LTEXT "Recommandée :", IDC_STATIC, 18, 199, 52, 9
|
||||||
LTEXT "", IDC_RECOMMENDED, 88, 197, 100, 9
|
LTEXT "", IDC_RECOMMENDED, 88, 199, 100, 9
|
||||||
LTEXT "Alloué actuellement :", IDC_STATIC, 18, 210, 66, 9
|
LTEXT "Allouée actuellement :", IDC_STATIC, 18, 210, 70, 9
|
||||||
LTEXT "", IDC_CURRENT, 88, 208, 100, 9
|
LTEXT "", IDC_CURRENT, 88, 210, 100, 9
|
||||||
DEFPUSHBUTTON "OK", IDOK, 114, 230, 48, 15
|
DEFPUSHBUTTON "OK", IDOK, 114, 230, 48, 15
|
||||||
PUSHBUTTON "Annuler", IDCANCEL, 168, 230, 48, 15
|
PUSHBUTTON "Annuler", IDCANCEL, 168, 230, 48, 15
|
||||||
END
|
END
|
||||||
|
@ -330,11 +330,11 @@ BEGIN
|
||||||
IDS_USERPROFILE_ACCOUNT_UNKNOWN "Account Unknown"
|
IDS_USERPROFILE_ACCOUNT_UNKNOWN "Account Unknown"
|
||||||
IDS_USERPROFILE_ACCOUNT_DELETED "Account Deleted"
|
IDS_USERPROFILE_ACCOUNT_DELETED "Account Deleted"
|
||||||
IDS_USERPROFILE_TYPE_TEXT "When %s logs onto this computer, should the operating system use the roaming profile or just the locally cached copy of the roaming profile."
|
IDS_USERPROFILE_TYPE_TEXT "When %s logs onto this computer, should the operating system use the roaming profile or just the locally cached copy of the roaming profile."
|
||||||
IDS_MESSAGEBOXTITLE "System control panel applet"
|
IDS_MESSAGEBOXTITLE "Application Système du Panneau de configuration"
|
||||||
IDS_WARNINITIALSIZE "Entrez une valeur numérique pour la taille initiale du fichier d'échange."
|
IDS_WARNINITIALSIZE "Entrez une valeur numérique pour la taille initiale du fichier d'échange."
|
||||||
IDS_WARNMAXIMUMSIZE "Entrez une valeur numérique pour la taille maximale du fichier d'échange."
|
IDS_WARNMAXIMUMSIZE "Entrez une valeur numérique pour la taille maximale du fichier d'échange."
|
||||||
IDS_WARNINITIALRANGE "La taille initiale du fichier d'échange ne peut pas être inférieure à 16 Mo and ne doit pas dépasser l'espace libre total du disque."
|
IDS_WARNINITIALRANGE "La taille initiale du fichier d'échange doit être comprise entre 2 Mo et 4096 Mo, et ne peut pas excéder la quantité d'espace libre sur le lecteur que vous avez sélectionné."
|
||||||
IDS_WARNMAXIMUMRANGE "La taille maximale du fichier d'échange ne peut pas être inférieure à sa taille initiale, et ne peut pas être supérieure à 4095 Mo et ne peut pas dépasser l'espace libre total du disque."
|
IDS_WARNMAXIMUMRANGE "Entrez une valeur pour la taille maximale du fichier d'échange qui soit supérieure ou égale à la taille initiale du fichier d'échange, et inférieure à 4096 Mo."
|
||||||
IDS_PAGEFILE_NONE "Aucun"
|
IDS_PAGEFILE_NONE "Aucun"
|
||||||
IDS_PAGEFILE_SYSTEM "Géré par le système"
|
IDS_PAGEFILE_SYSTEM "Géré par le système"
|
||||||
IDS_INFOREBOOT "Vous devez redémarrer le système pour appliquer les changements."
|
IDS_INFOREBOOT "Vous devez redémarrer le système pour appliquer les changements."
|
||||||
|
|
|
@ -9,6 +9,9 @@
|
||||||
|
|
||||||
#include "precomp.h"
|
#include "precomp.h"
|
||||||
|
|
||||||
|
#define NDEBUG
|
||||||
|
#include <debug.h>
|
||||||
|
|
||||||
static BOOL OnSelChange(HWND hwndDlg, PVIRTMEM pVirtMem);
|
static BOOL OnSelChange(HWND hwndDlg, PVIRTMEM pVirtMem);
|
||||||
static LPCTSTR lpKey = _T("SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Memory Management");
|
static LPCTSTR lpKey = _T("SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Memory Management");
|
||||||
|
|
||||||
|
@ -442,8 +445,9 @@ OnSet(PVIRTMEM pVirtMem)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check the valid range of the minimum size */
|
/* Check the valid range of the minimum size */
|
||||||
if (MinSize < 16 ||
|
if (MinSize < 2 ||
|
||||||
MinSize > pVirtMem->Pagefile[DriveIndex].FreeSize)
|
MinSize > pVirtMem->Pagefile[DriveIndex].FreeSize ||
|
||||||
|
MinSize > 4096)
|
||||||
{
|
{
|
||||||
ResourceMessageBox(hApplet,
|
ResourceMessageBox(hApplet,
|
||||||
NULL,
|
NULL,
|
||||||
|
@ -456,7 +460,7 @@ OnSet(PVIRTMEM pVirtMem)
|
||||||
/* Check the valid range of the maximum size */
|
/* Check the valid range of the maximum size */
|
||||||
if (MaxSize < MinSize ||
|
if (MaxSize < MinSize ||
|
||||||
MaxSize > pVirtMem->Pagefile[DriveIndex].FreeSize ||
|
MaxSize > pVirtMem->Pagefile[DriveIndex].FreeSize ||
|
||||||
MaxSize > 4095)
|
MaxSize > 4096)
|
||||||
{
|
{
|
||||||
ResourceMessageBox(hApplet,
|
ResourceMessageBox(hApplet,
|
||||||
NULL,
|
NULL,
|
||||||
|
@ -502,8 +506,12 @@ OnSelChange(HWND hwndDlg, PVIRTMEM pVirtMem)
|
||||||
TCHAR szBuffer[64];
|
TCHAR szBuffer[64];
|
||||||
MEMORYSTATUSEX MemoryStatus;
|
MEMORYSTATUSEX MemoryStatus;
|
||||||
ULARGE_INTEGER FreeDiskSpace;
|
ULARGE_INTEGER FreeDiskSpace;
|
||||||
UINT /*i,*/ FreeMemMb /*, PageFileSizeMb*/;
|
UINT i, FreeMemMb, RecoMemMb, PageFileSizeMb;
|
||||||
INT Index;
|
INT Index;
|
||||||
|
TCHAR szText[MAX_PATH];
|
||||||
|
WIN32_FIND_DATAW fdata = {0};
|
||||||
|
HANDLE hFind;
|
||||||
|
ULARGE_INTEGER pfSize;
|
||||||
|
|
||||||
Index = (INT)SendDlgItemMessage(hwndDlg,
|
Index = (INT)SendDlgItemMessage(hwndDlg,
|
||||||
IDC_PAGEFILELIST,
|
IDC_PAGEFILELIST,
|
||||||
|
@ -569,27 +577,45 @@ OnSelChange(HWND hwndDlg, PVIRTMEM pVirtMem)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set minimum pagefile size */
|
/* Set minimum pagefile size */
|
||||||
SetDlgItemText(hwndDlg, IDC_MINIMUM, _T("16 MB"));
|
SetDlgItemText(hwndDlg, IDC_MINIMUM, _T("2 MB"));
|
||||||
|
|
||||||
/* Set recommended pagefile size */
|
/* Set recommended pagefile size */
|
||||||
MemoryStatus.dwLength = sizeof(MEMORYSTATUSEX);
|
MemoryStatus.dwLength = sizeof(MEMORYSTATUSEX);
|
||||||
if (GlobalMemoryStatusEx(&MemoryStatus))
|
if (GlobalMemoryStatusEx(&MemoryStatus))
|
||||||
{
|
{
|
||||||
FreeMemMb = (UINT)(MemoryStatus.ullTotalPhys / (1024 * 1024));
|
FreeMemMb = (UINT)(MemoryStatus.ullTotalPhys / (1024 * 1024));
|
||||||
_stprintf(szBuffer, _T("%u MB"), FreeMemMb + (FreeMemMb / 2));
|
RecoMemMb = FreeMemMb + (FreeMemMb / 2); /* The recommended VM size is 150% of free memory. */
|
||||||
|
if (RecoMemMb > 4096)
|
||||||
|
RecoMemMb = 4096;
|
||||||
|
_stprintf(szBuffer, _T("%u MB"), RecoMemMb);
|
||||||
SetDlgItemText(hwndDlg, IDC_RECOMMENDED, szBuffer);
|
SetDlgItemText(hwndDlg, IDC_RECOMMENDED, szBuffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set current pagefile size */
|
/* Set current pagefile size */
|
||||||
#if 0
|
|
||||||
PageFileSizeMb = 0;
|
PageFileSizeMb = 0;
|
||||||
for (i = 0; i < 26; i++)
|
|
||||||
|
for (i = 0; i < pVirtMem->Count; i++)
|
||||||
{
|
{
|
||||||
PageFileSizeMb += pVirtMem->Pagefile[i].InitialSize;
|
_stprintf(szText,
|
||||||
|
_T("%c:\\pagefile.sys"),
|
||||||
|
pVirtMem->Pagefile[i].szDrive[0]);
|
||||||
|
|
||||||
|
hFind = FindFirstFileW(szText, &fdata);
|
||||||
|
if (hFind == INVALID_HANDLE_VALUE)
|
||||||
|
{
|
||||||
|
DPRINT1("Unable to read PageFile size : %ls due to error %d\n", szText,GetLastError());
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
pfSize.LowPart = fdata.nFileSizeLow;
|
||||||
|
pfSize.HighPart = fdata.nFileSizeHigh;
|
||||||
|
PageFileSizeMb += pfSize.QuadPart / (1024*1024);
|
||||||
|
FindClose(hFind);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
_stprintf(szBuffer, _T("%u MB"), PageFileSizeMb);
|
_stprintf(szBuffer, _T("%u MB"), PageFileSizeMb);
|
||||||
SetDlgItemText(hwndDlg, IDC_CURRENT, szBuffer);
|
SetDlgItemText(hwndDlg, IDC_CURRENT, szBuffer);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
Loading…
Reference in a new issue