Signed-off-by: Alex Henrie alexhenrie24@gmail.com --- Fixes https://bugs.winehq.org/show_bug.cgi?id=45205
Based on a Wine Staging patch by Michael Müller.
v2: Replaced some Hungarian notation in winternl.h.
dlls/ntdll/loader.c | 10 ++++++++++ dlls/ntdll/ntdll.spec | 1 + include/winternl.h | 26 ++++++++++++++++++++++++++ 3 files changed, 37 insertions(+)
diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index 1a3dd801a1..01d7db7c0c 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -1461,6 +1461,16 @@ NTSTATUS WINAPI LdrEnumerateLoadedModules( void *unknown, LDRENUMPROC callback, return STATUS_SUCCESS; }
+/****************************************************************** + * LdrRegisterDllNotification (NTDLL.@) + */ +NTSTATUS WINAPI LdrRegisterDllNotification(ULONG flags, PLDR_DLL_NOTIFICATION_FUNCTION callback, + void *context, void **cookie) +{ + FIXME( "(%04x, %p, %p, %p) stub!\n", flags, callback, context, cookie ); + return STATUS_NOT_IMPLEMENTED; +} + /****************************************************************** * LdrLockLoaderLock (NTDLL.@) * diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec index 7a58d7e37d..73b3103ba1 100644 --- a/dlls/ntdll/ntdll.spec +++ b/dlls/ntdll/ntdll.spec @@ -83,6 +83,7 @@ @ stdcall LdrProcessRelocationBlock(ptr long ptr long) @ stdcall LdrQueryImageFileExecutionOptions(ptr wstr long ptr long ptr) @ stdcall LdrQueryProcessModuleInformation(ptr long ptr) +@ stdcall LdrRegisterDllNotification(long ptr ptr ptr) @ stdcall LdrResolveDelayLoadedAPI(ptr ptr ptr ptr ptr long) @ stub LdrSetAppCompatDllRedirectionCallback @ stub LdrSetDllManifestProber diff --git a/include/winternl.h b/include/winternl.h index c84e6d7f88..07f42cf00d 100644 --- a/include/winternl.h +++ b/include/winternl.h @@ -2169,6 +2169,32 @@ typedef struct _LDR_MODULE HANDLE ActivationContext; } LDR_MODULE, *PLDR_MODULE;
+typedef struct _LDR_DLL_LOADED_NOTIFICATION_DATA +{ + ULONG Flags; + const UNICODE_STRING *FullDllName; + const UNICODE_STRING *BaseDllName; + void *DllBase; + ULONG SizeOfImage; +} LDR_DLL_LOADED_NOTIFICATION_DATA, *PLDR_DLL_LOADED_NOTIFICATION_DATA; + +typedef struct _LDR_DLL_UNLOADED_NOTIFICATION_DATA +{ + ULONG Flags; + const UNICODE_STRING *FullDllName; + const UNICODE_STRING *BaseDllName; + void *DllBase; + ULONG SizeOfImage; +} LDR_DLL_UNLOADED_NOTIFICATION_DATA, *PLDR_DLL_UNLOADED_NOTIFICATION_DATA; + +typedef union _LDR_DLL_NOTIFICATION_DATA +{ + LDR_DLL_LOADED_NOTIFICATION_DATA Loaded; + LDR_DLL_UNLOADED_NOTIFICATION_DATA Unloaded; +} LDR_DLL_NOTIFICATION_DATA, *PLDR_DLL_NOTIFICATION_DATA; + +typedef void (CALLBACK *PLDR_DLL_NOTIFICATION_FUNCTION)(ULONG, LDR_DLL_NOTIFICATION_DATA*, void*); + /* those defines are (some of the) regular LDR_MODULE.Flags values */ #define LDR_IMAGE_IS_DLL 0x00000004 #define LDR_LOAD_IN_PROGRESS 0x00001000