https://git.reactos.org/?p=reactos.git;a=commitdiff;h=2801a8272d1aeccd74b66960ec30849db04099cf

commit 2801a8272d1aeccd74b66960ec30849db04099cf
Author:     Mark Jansen <[email protected]>
AuthorDate: Fri Feb 28 22:24:30 2020 +0100
Commit:     Mark Jansen <[email protected]>
CommitDate: Sun Mar 29 21:02:31 2020 +0200

    [LDR] Include source dll in static snap failure dprint
---
 dll/ntdll/ldr/ldrpe.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/dll/ntdll/ldr/ldrpe.c b/dll/ntdll/ldr/ldrpe.c
index ecba954687b..d632fbd9f56 100644
--- a/dll/ntdll/ldr/ldrpe.c
+++ b/dll/ntdll/ldr/ldrpe.c
@@ -1028,12 +1028,23 @@ FailurePath:
         /* Is this a static snap? */
         if (Static)
         {
+            UNICODE_STRING SnapTarget;
+            PLDR_DATA_TABLE_ENTRY LdrEntry;
+
+            /* What was the module we were searching in */
             RtlInitAnsiString(&TempString, DllName ? DllName : "Unknown");
+
+            /* What was the module we were searching for */
+            if (LdrpCheckForLoadedDllHandle(ImportBase, &LdrEntry))
+                SnapTarget = LdrEntry->BaseDllName;
+            else
+                RtlInitUnicodeString(&SnapTarget, L"Unknown");
+
             /* Inform the debug log */
             if (IsOrdinal)
-                DPRINT1("Failed to snap ordinal %Z!0x%x\n", &TempString, 
OriginalOrdinal);
+                DPRINT1("Failed to snap ordinal %Z!0x%x for %wZ\n", 
&TempString, OriginalOrdinal, &SnapTarget);
             else
-                DPRINT1("Failed to snap %Z!%s\n", &TempString, ImportName);
+                DPRINT1("Failed to snap %Z!%s for %wZ\n", &TempString, 
ImportName, &SnapTarget);
 
             /* These are critical errors. Setup a string for the DLL name */
             RtlAnsiStringToUnicodeString(&HardErrorDllName, &TempString, TRUE);

Reply via email to