mirror of
https://github.com/reactos/reactos.git
synced 2025-08-02 09:46:21 +00:00
[USETUP]
Add a default pagefile entry to the registry. svn path=/trunk/; revision=62697
This commit is contained in:
parent
b3d69a19ac
commit
32f9115048
3 changed files with 44 additions and 0 deletions
|
@ -70,6 +70,8 @@ static UNICODE_STRING DestinationPath;
|
||||||
static UNICODE_STRING DestinationArcPath;
|
static UNICODE_STRING DestinationArcPath;
|
||||||
static UNICODE_STRING DestinationRootPath;
|
static UNICODE_STRING DestinationRootPath;
|
||||||
|
|
||||||
|
static WCHAR DestinationDriveLetter;
|
||||||
|
|
||||||
/* Path to the active partition (boot manager) */
|
/* Path to the active partition (boot manager) */
|
||||||
static UNICODE_STRING SystemRootPath;
|
static UNICODE_STRING SystemRootPath;
|
||||||
|
|
||||||
|
@ -1589,6 +1591,8 @@ SelectPartitionPage(PINPUT_RECORD Ir)
|
||||||
TRUE);
|
TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DestinationDriveLetter = (WCHAR)PartitionList->CurrentPartition->DriveLetter[0];
|
||||||
|
|
||||||
return SELECT_FILE_SYSTEM_PAGE;
|
return SELECT_FILE_SYSTEM_PAGE;
|
||||||
}
|
}
|
||||||
else if (Ir->Event.KeyEvent.wVirtualKeyCode == 'C') /* C */
|
else if (Ir->Event.KeyEvent.wVirtualKeyCode == 'C') /* C */
|
||||||
|
@ -3335,6 +3339,9 @@ RegistryPage(PINPUT_RECORD Ir)
|
||||||
return QUIT_PAGE;
|
return QUIT_PAGE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Set the default pagefile entry */
|
||||||
|
SetDefaultPagefile(DestinationDriveLetter);
|
||||||
|
|
||||||
/* Update the mounted devices list */
|
/* Update the mounted devices list */
|
||||||
SetMountedDeviceValues(PartitionList);
|
SetMountedDeviceValues(PartitionList);
|
||||||
|
|
||||||
|
|
|
@ -763,4 +763,38 @@ SetMountedDeviceValue(CHAR Letter, ULONG Signature, LARGE_INTEGER StartingOffset
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
VOID
|
||||||
|
SetDefaultPagefile(WCHAR Drive)
|
||||||
|
{
|
||||||
|
OBJECT_ATTRIBUTES ObjectAttributes;
|
||||||
|
UNICODE_STRING KeyName = RTL_CONSTANT_STRING(L"\\Registry\\Machine\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Memory Management");
|
||||||
|
UNICODE_STRING ValueName = RTL_CONSTANT_STRING(L"PagingFiles");
|
||||||
|
WCHAR ValueBuffer[] = L"?:\\pagefile.sys 0 0\0";
|
||||||
|
HANDLE KeyHandle;
|
||||||
|
NTSTATUS Status;
|
||||||
|
|
||||||
|
InitializeObjectAttributes(&ObjectAttributes,
|
||||||
|
&KeyName,
|
||||||
|
OBJ_CASE_INSENSITIVE,
|
||||||
|
NULL,
|
||||||
|
NULL);
|
||||||
|
Status = NtOpenKey(&KeyHandle,
|
||||||
|
KEY_ALL_ACCESS,
|
||||||
|
&ObjectAttributes);
|
||||||
|
if (!NT_SUCCESS(Status))
|
||||||
|
return;
|
||||||
|
|
||||||
|
ValueBuffer[0] = Drive;
|
||||||
|
|
||||||
|
NtSetValueKey(KeyHandle,
|
||||||
|
&ValueName,
|
||||||
|
0,
|
||||||
|
REG_MULTI_SZ,
|
||||||
|
(PVOID)&ValueBuffer,
|
||||||
|
sizeof(ValueBuffer));
|
||||||
|
|
||||||
|
NtClose(KeyHandle);
|
||||||
|
}
|
||||||
|
|
||||||
/* EOF */
|
/* EOF */
|
||||||
|
|
|
@ -38,4 +38,7 @@ SetInstallPathValue(PUNICODE_STRING InstallPath);
|
||||||
BOOLEAN
|
BOOLEAN
|
||||||
SetMountedDeviceValue(CHAR Letter, ULONG Signature, LARGE_INTEGER StartingOffset);
|
SetMountedDeviceValue(CHAR Letter, ULONG Signature, LARGE_INTEGER StartingOffset);
|
||||||
|
|
||||||
|
VOID
|
||||||
|
SetDefaultPagefile(WCHAR Drive);
|
||||||
|
|
||||||
/* EOF */
|
/* EOF */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue