Alexandre Julliard : ntdll: Implemented LdrAddRefDll.
Alexandre Julliard
julliard at wine.codeweavers.com
Thu May 17 06:42:22 CDT 2007
Module: wine
Branch: master
Commit: 447fda5206cf8df0648f4d694e0d9851b206e6ac
URL: http://source.winehq.org/git/wine.git/?a=commit;h=447fda5206cf8df0648f4d694e0d9851b206e6ac
Author: Alexandre Julliard <julliard at winehq.org>
Date: Wed May 16 16:39:29 2007 +0200
ntdll: Implemented LdrAddRefDll.
---
dlls/ntdll/loader.c | 24 ++++++++++++++++++++++++
dlls/ntdll/ntdll.spec | 2 +-
include/winternl.h | 1 +
3 files changed, 26 insertions(+), 1 deletions(-)
diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c
index 7fee9bc..8d72936 100644
--- a/dlls/ntdll/loader.c
+++ b/dlls/ntdll/loader.c
@@ -1821,6 +1821,30 @@ NTSTATUS WINAPI LdrGetDllHandle( LPCWSTR load_path, ULONG flags, const UNICODE_S
/******************************************************************
+ * LdrAddRefDll (NTDLL.@)
+ */
+NTSTATUS WINAPI LdrAddRefDll( ULONG flags, HMODULE module )
+{
+ NTSTATUS ret = STATUS_SUCCESS;
+ WINE_MODREF *wm;
+
+ if (flags) FIXME( "%p flags %x not implemented\n", module, flags );
+
+ RtlEnterCriticalSection( &loader_section );
+
+ if ((wm = get_modref( module )))
+ {
+ if (wm->ldr.LoadCount != -1) wm->ldr.LoadCount++;
+ TRACE( "(%s) ldr.LoadCount: %d\n", debugstr_w(wm->ldr.BaseDllName.Buffer), wm->ldr.LoadCount );
+ }
+ else ret = STATUS_INVALID_PARAMETER;
+
+ RtlLeaveCriticalSection( &loader_section );
+ return ret;
+}
+
+
+/******************************************************************
* LdrQueryProcessModuleInformation
*
*/
diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec
index eeba2e1..3b26880 100644
--- a/dlls/ntdll/ntdll.spec
+++ b/dlls/ntdll/ntdll.spec
@@ -50,7 +50,7 @@
@ stub KiUserExceptionDispatcher
# @ stub LdrAccessOutOfProcessResource
@ stdcall LdrAccessResource(long ptr ptr ptr)
-# @ stub LdrAddRefDll
+@ stdcall LdrAddRefDll(long ptr)
# @ stub LdrAlternateResourcesEnabled
# @ stub LdrCreateOutOfProcessImage
# @ stub LdrDestroyOutOfProcessImage
diff --git a/include/winternl.h b/include/winternl.h
index b75519e..8b650a9 100644
--- a/include/winternl.h
+++ b/include/winternl.h
@@ -1731,6 +1731,7 @@ NTSTATUS WINAPIV DbgPrint(LPCSTR fmt, ...);
NTSTATUS WINAPIV DbgPrintEx(ULONG iComponentId, ULONG Level, LPCSTR fmt, ...);
NTSTATUS WINAPI LdrAccessResource(HMODULE,const IMAGE_RESOURCE_DATA_ENTRY*,void**,PULONG);
+NTSTATUS WINAPI LdrAddRefDll(ULONG,HMODULE);
NTSTATUS WINAPI LdrFindResourceDirectory_U(HMODULE,const LDR_RESOURCE_INFO*,ULONG,const IMAGE_RESOURCE_DIRECTORY**);
NTSTATUS WINAPI LdrFindResource_U(HMODULE,const LDR_RESOURCE_INFO*,ULONG,const IMAGE_RESOURCE_DATA_ENTRY**);
NTSTATUS WINAPI LdrGetDllHandle(LPCWSTR, ULONG, const UNICODE_STRING*, HMODULE*);
More information about the wine-cvs
mailing list