https://git.reactos.org/?p=reactos.git;a=commitdiff;h=5472c3e85356b3b37a0b9…
commit 5472c3e85356b3b37a0b9023b2db3c9f45a05c5f
Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
AuthorDate: Sat Aug 19 19:06:20 2023 +0200
Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
CommitDate: Sat Aug 19 19:06:20 2023 +0200
[NTOS:MM] MiResolveImageReferences: Use boolean values for GdiLink and NormalLink.
---
ntoskrnl/mm/ARM3/sysldr.c | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/ntoskrnl/mm/ARM3/sysldr.c b/ntoskrnl/mm/ARM3/sysldr.c
index 3ea6662cc28..22aef1d7110 100644
--- a/ntoskrnl/mm/ARM3/sysldr.c
+++ b/ntoskrnl/mm/ARM3/sysldr.c
@@ -996,7 +996,8 @@ MiResolveImageReferences(IN PVOID ImageBase,
PIMAGE_IMPORT_DESCRIPTOR ImportDescriptor, CurrentImport;
ULONG ImportSize, ImportCount = 0, LoadedImportsSize, ExportSize;
PLOAD_IMPORTS LoadedImports, NewImports;
- ULONG GdiLink, NormalLink, i;
+ ULONG i;
+ BOOLEAN GdiLink, NormalLink;
BOOLEAN ReferenceNeeded, Loaded;
ANSI_STRING TempString;
UNICODE_STRING NameString, DllName;
@@ -1006,7 +1007,9 @@ MiResolveImageReferences(IN PVOID ImageBase,
PIMAGE_EXPORT_DIRECTORY ExportDirectory;
NTSTATUS Status;
PIMAGE_THUNK_DATA OrigThunk, FirstThunk;
+
PAGED_CODE();
+
DPRINT("%s - ImageBase: %p. ImageFileDirectory: %wZ\n",
__FUNCTION__, ImageBase, ImageFileDirectory);
@@ -1054,25 +1057,26 @@ MiResolveImageReferences(IN PVOID ImageBase,
}
/* Reset the import count and loop descriptors again */
- ImportCount = GdiLink = NormalLink = 0;
+ GdiLink = NormalLink = FALSE;
+ ImportCount = 0;
while ((ImportDescriptor->Name) &&
(ImportDescriptor->OriginalFirstThunk))
{
/* Get the name */
ImportName = (PCHAR)((ULONG_PTR)ImageBase + ImportDescriptor->Name);
/* Check if this is a GDI driver */
- GdiLink = GdiLink |
+ GdiLink = GdiLink ||
!(_strnicmp(ImportName, "win32k", sizeof("win32k")
- 1));
/* We can also allow dxapi (for Windows compat, allow IRT and coverage) */
- NormalLink = NormalLink |
+ NormalLink = NormalLink ||
((_strnicmp(ImportName, "win32k",
sizeof("win32k") - 1)) &&
(_strnicmp(ImportName, "dxapi", sizeof("dxapi")
- 1)) &&
(_strnicmp(ImportName, "coverage",
sizeof("coverage") - 1)) &&
(_strnicmp(ImportName, "irt", sizeof("irt") -
1)));
/* Check if this is a valid GDI driver */
- if ((GdiLink) && (NormalLink))
+ if (GdiLink && NormalLink)
{
/* It's not, it's importing stuff it shouldn't be! */
Status = STATUS_PROCEDURE_NOT_FOUND;