[USETUP] Move SetDefaultPagefile() into settings.c and remove the now-empty registry...
authorHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Fri, 30 Jun 2017 22:46:15 +0000 (22:46 +0000)
committerHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Sat, 27 Oct 2018 01:17:41 +0000 (03:17 +0200)
svn path=/branches/setup_improvements/; revision=75250

base/setup/usetup/CMakeLists.txt
base/setup/usetup/registry.c [deleted file]
base/setup/usetup/registry.h [deleted file]
base/setup/usetup/settings.c
base/setup/usetup/settings.h
base/setup/usetup/usetup.h

index 21d1554..66a22fc 100644 (file)
@@ -27,7 +27,6 @@ list(APPEND SOURCE
     mui.c
     partlist.c
     progress.c
-    registry.c
     settings.c
     usetup.c
     usetup.h)
diff --git a/base/setup/usetup/registry.c b/base/setup/usetup/registry.c
deleted file mode 100644 (file)
index f8e1d72..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- *  ReactOS kernel
- *  Copyright (C) 2003 ReactOS Team
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License along
- *  with this program; if not, write to the Free Software Foundation, Inc.,
- *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-/*
- * COPYRIGHT:       See COPYING in the top level directory
- * PROJECT:         ReactOS text-mode setup
- * FILE:            base/setup/usetup/registry.c
- * PURPOSE:         Registry creation functions
- * PROGRAMMER:
- */
-
-/* INCLUDES *****************************************************************/
-
-#include "usetup.h"
-
-#define NDEBUG
-#include <debug.h>
-
-/* FUNCTIONS ****************************************************************/
-
-VOID
-SetDefaultPagefile(
-    WCHAR Drive)
-{
-    OBJECT_ATTRIBUTES ObjectAttributes;
-    UNICODE_STRING KeyName = RTL_CONSTANT_STRING(L"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,
-                               GetRootKeyByPredefKey(HKEY_LOCAL_MACHINE, 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 */
diff --git a/base/setup/usetup/registry.h b/base/setup/usetup/registry.h
deleted file mode 100644 (file)
index ef53b70..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- *  ReactOS kernel
- *  Copyright (C) 2003 ReactOS Team
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License along
- *  with this program; if not, write to the Free Software Foundation, Inc.,
- *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-/*
- * COPYRIGHT:       See COPYING in the top level directory
- * PROJECT:         ReactOS text-mode setup
- * FILE:            base/setup/usetup/registry.h
- * PURPOSE:         Registry creation functions
- * PROGRAMMER:
- */
-
-#pragma once
-
-VOID
-SetDefaultPagefile(
-    WCHAR Drive);
-
-/* EOF */
index d358f85..8aaa528 100644 (file)
@@ -179,7 +179,6 @@ cleanup:
    return ret;
 }
 
-
 static
 BOOLEAN
 GetComputerIdentifier(
@@ -374,7 +373,6 @@ CreateComputerTypeList(
     return List;
 }
 
-
 static
 BOOLEAN
 GetDisplayIdentifier(
@@ -541,7 +539,6 @@ GetDisplayIdentifier(
     return FALSE;
 }
 
-
 PGENERIC_LIST
 CreateDisplayDriverList(
     HINF InfFile)
@@ -670,7 +667,6 @@ ProcessComputerFiles(
     return TRUE;
 }
 
-
 BOOLEAN
 ProcessDisplayRegistry(
     HINF InfFile,
@@ -829,7 +825,6 @@ ProcessDisplayRegistry(
     return TRUE;
 }
 
-
 BOOLEAN
 ProcessLocaleRegistry(
     PGENERIC_LIST List)
@@ -991,14 +986,12 @@ CreateKeyboardDriverList(
     return List;
 }
 
-
 ULONG
 GetDefaultLanguageIndex(VOID)
 {
     return DefaultLanguageIndex;
 }
 
-
 PGENERIC_LIST
 CreateLanguageList(
     HINF InfFile,
@@ -1077,7 +1070,6 @@ CreateLanguageList(
     return List;
 }
 
-
 PGENERIC_LIST
 CreateKeyboardLayoutList(
     HINF InfFile,
@@ -1214,7 +1206,6 @@ ProcessKeyboardLayoutRegistry(
     return TRUE;
 }
 
-
 #if 0
 BOOLEAN
 ProcessKeyboardLayoutFiles(
@@ -1224,7 +1215,6 @@ ProcessKeyboardLayoutFiles(
 }
 #endif
 
-
 BOOLEAN
 SetGeoID(
     PWCHAR Id)
@@ -1267,4 +1257,40 @@ SetGeoID(
     return TRUE;
 }
 
+
+BOOLEAN
+SetDefaultPagefile(
+    WCHAR Drive)
+{
+    NTSTATUS Status;
+    HANDLE KeyHandle;
+    OBJECT_ATTRIBUTES ObjectAttributes;
+    UNICODE_STRING KeyName = RTL_CONSTANT_STRING(L"SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Memory Management");
+    UNICODE_STRING ValueName = RTL_CONSTANT_STRING(L"PagingFiles");
+    WCHAR ValueBuffer[] = L"?:\\pagefile.sys 0 0\0";
+
+    InitializeObjectAttributes(&ObjectAttributes,
+                               &KeyName,
+                               OBJ_CASE_INSENSITIVE,
+                               GetRootKeyByPredefKey(HKEY_LOCAL_MACHINE, NULL),
+                               NULL);
+    Status = NtOpenKey(&KeyHandle,
+                       KEY_ALL_ACCESS,
+                       &ObjectAttributes);
+    if (!NT_SUCCESS(Status))
+        return FALSE;
+
+    ValueBuffer[0] = Drive;
+
+    NtSetValueKey(KeyHandle,
+                  &ValueName,
+                  0,
+                  REG_MULTI_SZ,
+                  (PVOID)&ValueBuffer,
+                  sizeof(ValueBuffer));
+
+    NtClose(KeyHandle);
+    return TRUE;
+}
+
 /* EOF */
index 1fce8f7..3ecabd8 100644 (file)
@@ -21,7 +21,7 @@
  * PROJECT:         ReactOS text-mode setup
  * FILE:            base/setup/usetup/settings.h
  * PURPOSE:         Device settings support functions
- * PROGRAMMER:
+ * PROGRAMMERS:     Colin Finck
  */
 
 #pragma once
@@ -78,4 +78,8 @@ BOOLEAN
 SetGeoID(
     PWCHAR Id);
 
+BOOLEAN
+SetDefaultPagefile(
+    WCHAR Drive);
+
 /* EOF */
index ca7fed0..2134fcd 100644 (file)
@@ -62,7 +62,6 @@
 #include "inffile.h"
 #include "progress.h"
 #include "filequeue.h"
-#include "registry.h"
 #include "fslist.h"
 #include "partlist.h"
 #include "cabinet.h"