https://git.reactos.org/?p=reactos.git;a=commitdiff;h=53b30e3f3bf454356dad537c782543cba35e0f1a

commit 53b30e3f3bf454356dad537c782543cba35e0f1a
Author:     Joachim Henze <joachim.he...@reactos.org>
AuthorDate: Tue Aug 1 22:31:36 2023 +0200
Commit:     Joachim Henze <joachim.he...@reactos.org>
CommitDate: Tue Aug 1 22:32:25 2023 +0200

    [NTOSKRNL][NTGDI] Formatting addendum, no functional change
    
    I intend to port back the combined work of Thomas Faber and Serge Gautherie 
in context of CORE 14271.
    Both developers fixed wrong retval evaluations for SeSinglePrivilegeCheck() 
and RtlCreateUnicodeString().
    Both functions do return a BOOLEAN, and therefore using NTSTATUS() on them 
is wrong.
    Those bugs have been fixed at multiple places. That is long gone.
    
    But Serge fixed his locations a bit more elegantly, without the need for 
additional variables.
    Therefore this addendum adapts a few of Thomas locations to the improved 
Serge-ified style.
    
    Yes: I intentionally used a space instead of a minus after the mentioned 
CORE 14271,
    as I don't want that pure stylistic addendum to be linked with the initial 
ticket anymore.
    That would be overkill.
---
 ntoskrnl/config/cmsysini.c   |  8 +-------
 win32ss/gdi/ntgdi/freetype.c | 12 +++---------
 2 files changed, 4 insertions(+), 16 deletions(-)

diff --git a/ntoskrnl/config/cmsysini.c b/ntoskrnl/config/cmsysini.c
index 572f8a342f8..282e422b759 100644
--- a/ntoskrnl/config/cmsysini.c
+++ b/ntoskrnl/config/cmsysini.c
@@ -1,7 +1,6 @@
 /*
  * PROJECT:         ReactOS Kernel
  * LICENSE:         BSD - See COPYING.ARM in the top level directory
- * FILE:            ntoskrnl/config/cmsysini.c
  * PURPOSE:         Configuration Manager - System Initialization Code
  * PROGRAMMERS:     ReactOS Portable Systems Group
  *                  Alex Ionescu (alex.ione...@reactos.org)
@@ -873,7 +872,6 @@ CmpInitializeSystemHive(IN PLOADER_PARAMETER_BLOCK 
LoaderBlock)
     UNICODE_STRING KeyName;
     PCMHIVE SystemHive = NULL;
     PSECURITY_DESCRIPTOR SecurityDescriptor;
-    BOOLEAN Success;
 
     PAGED_CODE();
 
@@ -921,12 +919,8 @@ CmpInitializeSystemHive(IN PLOADER_PARAMETER_BLOCK 
LoaderBlock)
     }
 
     /* Set the hive filename */
-    Success = RtlCreateUnicodeString(&SystemHive->FileFullPath,
-                                     
L"\\SystemRoot\\System32\\Config\\SYSTEM");
-    if (!Success)
-    {
+    if (!RtlCreateUnicodeString(&SystemHive->FileFullPath, 
L"\\SystemRoot\\System32\\Config\\SYSTEM"))
         return FALSE;
-    }
 
     /* Manually set the hive as volatile, if in Live CD mode */
     if (HiveBase && CmpShareSystemHives)
diff --git a/win32ss/gdi/ntgdi/freetype.c b/win32ss/gdi/ntgdi/freetype.c
index fcf6f2dfcc7..c8bdd59f773 100644
--- a/win32ss/gdi/ntgdi/freetype.c
+++ b/win32ss/gdi/ntgdi/freetype.c
@@ -1,7 +1,6 @@
 /*
  * PROJECT:         ReactOS win32 kernel mode subsystem
  * LICENSE:         GPL - See COPYING in the top level directory
- * FILE:            win32ss/gdi/ntgdi/freetype.c
  * PURPOSE:         FreeType font engine interface
  * PROGRAMMERS:     Copyright 2001 Huw D M Davies for CodeWeavers.
  *                  Copyright 2006 Dmitry Timoshkov for CodeWeavers.
@@ -521,7 +520,6 @@ IntLoadFontSubstList(PLIST_ENTRY pHead)
     BYTE                            CharSets[FONTSUBST_FROM_AND_TO];
     LPWSTR                          pch;
     PFONTSUBST_ENTRY                pEntry;
-    BOOLEAN                         Success;
 
     /* the FontSubstitutes registry key */
     static UNICODE_STRING FontSubstKey =
@@ -566,8 +564,7 @@ IntLoadFontSubstList(PLIST_ENTRY pHead)
         pInfo = (PKEY_VALUE_FULL_INFORMATION)InfoBuffer;
         Length = pInfo->NameLength / sizeof(WCHAR);
         pInfo->Name[Length] = UNICODE_NULL;   /* truncate */
-        Success = RtlCreateUnicodeString(&FromW, pInfo->Name);
-        if (!Success)
+        if (!RtlCreateUnicodeString(&FromW, pInfo->Name))
         {
             Status = STATUS_INSUFFICIENT_RESOURCES;
             DPRINT("RtlCreateUnicodeString failed\n");
@@ -589,8 +586,7 @@ IntLoadFontSubstList(PLIST_ENTRY pHead)
         pch = (LPWSTR)((PUCHAR)pInfo + pInfo->DataOffset);
         Length = pInfo->DataLength / sizeof(WCHAR);
         pch[Length] = UNICODE_NULL; /* truncate */
-        Success = RtlCreateUnicodeString(&ToW, pch);
-        if (!Success)
+        if (!RtlCreateUnicodeString(&ToW, pch))
         {
             Status = STATUS_INSUFFICIENT_RESOURCES;
             DPRINT("RtlCreateUnicodeString failed\n");
@@ -1650,7 +1646,6 @@ IntLoadFontsInRegistry(VOID)
     LPBYTE                          InfoBuffer;
     PKEY_VALUE_FULL_INFORMATION     pInfo;
     LPWSTR                          pchPath;
-    BOOLEAN                         Success;
     WCHAR                           szPath[MAX_PATH];
     INT                             nFontCount = 0;
     DWORD                           dwFlags;
@@ -1717,8 +1712,7 @@ IntLoadFontsInRegistry(VOID)
         pInfo = (PKEY_VALUE_FULL_INFORMATION)InfoBuffer;
         Length = pInfo->NameLength / sizeof(WCHAR);
         pInfo->Name[Length] = UNICODE_NULL;   /* truncate */
-        Success = RtlCreateUnicodeString(&FontTitleW, pInfo->Name);
-        if (!Success)
+        if (!RtlCreateUnicodeString(&FontTitleW, pInfo->Name))
         {
             Status = STATUS_INSUFFICIENT_RESOURCES;
             DPRINT1("RtlCreateUnicodeString failed\n");

Reply via email to