https://git.reactos.org/?p=reactos.git;a=commitdiff;h=7d0f6f02abac6b2d41630de5beafa0c03498c0e2

commit 7d0f6f02abac6b2d41630de5beafa0c03498c0e2
Author:     Hermès Bélusca-Maïto <[email protected]>
AuthorDate: Fri Jun 30 22:46:15 2017 +0000
Commit:     Hermès Bélusca-Maïto <[email protected]>
CommitDate: Sat Oct 27 03:17:41 2018 +0200

    [USETUP] Move SetDefaultPagefile() into settings.c and remove the now-empty 
registry.c/.h files.
    
    svn path=/branches/setup_improvements/; revision=75250
---
 base/setup/usetup/CMakeLists.txt |  1 -
 base/setup/usetup/registry.c     | 70 ----------------------------------------
 base/setup/usetup/registry.h     | 33 -------------------
 base/setup/usetup/settings.c     | 46 ++++++++++++++++++++------
 base/setup/usetup/settings.h     |  6 +++-
 base/setup/usetup/usetup.h       |  1 -
 6 files changed, 41 insertions(+), 116 deletions(-)

diff --git a/base/setup/usetup/CMakeLists.txt b/base/setup/usetup/CMakeLists.txt
index 21d15544f4..66a22fcbb5 100644
--- a/base/setup/usetup/CMakeLists.txt
+++ b/base/setup/usetup/CMakeLists.txt
@@ -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
index f8e1d72fc8..0000000000
--- a/base/setup/usetup/registry.c
+++ /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
index ef53b708ff..0000000000
--- a/base/setup/usetup/registry.h
+++ /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 */
diff --git a/base/setup/usetup/settings.c b/base/setup/usetup/settings.c
index d358f85e39..8aaa528b0e 100644
--- a/base/setup/usetup/settings.c
+++ b/base/setup/usetup/settings.c
@@ -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 */
diff --git a/base/setup/usetup/settings.h b/base/setup/usetup/settings.h
index 1fce8f7735..3ecabd8e52 100644
--- a/base/setup/usetup/settings.h
+++ b/base/setup/usetup/settings.h
@@ -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 */
diff --git a/base/setup/usetup/usetup.h b/base/setup/usetup/usetup.h
index ca7fed0671..2134fcdb8c 100644
--- a/base/setup/usetup/usetup.h
+++ b/base/setup/usetup/usetup.h
@@ -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"

Reply via email to