Author: ekohl
Date: Wed Apr 9 21:49:30 2014
New Revision: 62697
URL:
http://svn.reactos.org/svn/reactos?rev=62697&view=rev
Log:
[USETUP]
Add a default pagefile entry to the registry.
Modified:
trunk/reactos/base/setup/usetup/interface/usetup.c
trunk/reactos/base/setup/usetup/registry.c
trunk/reactos/base/setup/usetup/registry.h
Modified: trunk/reactos/base/setup/usetup/interface/usetup.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/interfac…
==============================================================================
--- trunk/reactos/base/setup/usetup/interface/usetup.c [iso-8859-1] (original)
+++ trunk/reactos/base/setup/usetup/interface/usetup.c [iso-8859-1] Wed Apr 9 21:49:30
2014
@@ -70,6 +70,8 @@
static UNICODE_STRING DestinationArcPath;
static UNICODE_STRING DestinationRootPath;
+static WCHAR DestinationDriveLetter;
+
/* Path to the active partition (boot manager) */
static UNICODE_STRING SystemRootPath;
@@ -1588,6 +1590,8 @@
0ULL,
TRUE);
}
+
+ DestinationDriveLetter =
(WCHAR)PartitionList->CurrentPartition->DriveLetter[0];
return SELECT_FILE_SYSTEM_PAGE;
}
@@ -3335,6 +3339,9 @@
return QUIT_PAGE;
}
+ /* Set the default pagefile entry */
+ SetDefaultPagefile(DestinationDriveLetter);
+
/* Update the mounted devices list */
SetMountedDeviceValues(PartitionList);
Modified: trunk/reactos/base/setup/usetup/registry.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/registry…
==============================================================================
--- trunk/reactos/base/setup/usetup/registry.c [iso-8859-1] (original)
+++ trunk/reactos/base/setup/usetup/registry.c [iso-8859-1] Wed Apr 9 21:49:30 2014
@@ -763,4 +763,38 @@
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 */
Modified: trunk/reactos/base/setup/usetup/registry.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/registry…
==============================================================================
--- trunk/reactos/base/setup/usetup/registry.h [iso-8859-1] (original)
+++ trunk/reactos/base/setup/usetup/registry.h [iso-8859-1] Wed Apr 9 21:49:30 2014
@@ -38,4 +38,7 @@
BOOLEAN
SetMountedDeviceValue(CHAR Letter, ULONG Signature, LARGE_INTEGER StartingOffset);
+VOID
+SetDefaultPagefile(WCHAR Drive);
+
/* EOF */