Module: wine Branch: master Commit: c80f806e868bee642d4d3dea326409ee911fdbc8 URL: https://gitlab.winehq.org/wine/wine/-/commit/c80f806e868bee642d4d3dea326409e...
Author: Zebediah Figura zfigura@codeweavers.com Date: Wed Nov 8 18:48:54 2023 -0600
ntdll: Print a warning when LdrGetProcedureAddress() fails.
---
dlls/ntdll/loader.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index a3de8791498..59624bc70f8 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -2006,13 +2006,14 @@ NTSTATUS WINAPI LdrGetProcedureAddress(HMODULE module, const ANSI_STRING *name, ULONG ord, PVOID *address) { IMAGE_EXPORT_DIRECTORY *exports; + WINE_MODREF *wm; DWORD exp_size; NTSTATUS ret = STATUS_PROCEDURE_NOT_FOUND;
RtlEnterCriticalSection( &loader_section );
/* check if the module itself is invalid to return the proper error */ - if (!get_modref( module )) ret = STATUS_DLL_NOT_FOUND; + if (!(wm = get_modref( module ))) ret = STATUS_DLL_NOT_FOUND; else if ((exports = RtlImageDirectoryEntryToData( module, TRUE, IMAGE_DIRECTORY_ENTRY_EXPORT, &exp_size ))) { @@ -2023,6 +2024,11 @@ NTSTATUS WINAPI LdrGetProcedureAddress(HMODULE module, const ANSI_STRING *name, *address = proc; ret = STATUS_SUCCESS; } + else + { + WARN( "%s (ordinal %lu) not found in %s\n", debugstr_a(name ? name->Buffer : NULL), + ord, debugstr_us(&wm->ldr.FullDllName) ); + } }
RtlLeaveCriticalSection( &loader_section );