From 14fe274b1c73089ea7453e97ec4209be77abaa78 Mon Sep 17 00:00:00 2001 From: Aleksey Bragin Date: Fri, 26 Feb 2010 22:52:55 +0000 Subject: [PATCH] [NTDLL] - LdrpProcessImportDirectoryEntry: Don't try to fixup functions if an import address table is empty. Fixes Panzer General 2. Most of the work of discovering, fixing and testing this problem was performed by Olaf Siejka. svn path=/trunk/; revision=45690 --- reactos/dll/ntdll/ldr/utils.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/reactos/dll/ntdll/ldr/utils.c b/reactos/dll/ntdll/ldr/utils.c index ab129e9ca6e..1fc0adfc066 100644 --- a/reactos/dll/ntdll/ldr/utils.c +++ b/reactos/dll/ntdll/ldr/utils.c @@ -1600,6 +1600,9 @@ LdrpProcessImportDirectoryEntry(PLDR_DATA_TABLE_ENTRY Module, IATSize++; } + /* No need to fixup anything if IAT is empty */ + if (IATSize == 0) return STATUS_SUCCESS; + /* Unprotect the region we are about to write into. */ IATBase = (PVOID)ImportAddressList; IATSize *= sizeof(PVOID*);