Alexandre Julliard : ntdll: Implemented RtlPcToFileHeader.

Alexandre Julliard julliard at wine.codeweavers.com
Sat May 27 06:34:08 CDT 2006


Module: wine
Branch: refs/heads/master
Commit: 9769806c3a112dce4bd086b4ea7132160f4fc9ca
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=9769806c3a112dce4bd086b4ea7132160f4fc9ca

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Sat May 27 10:55:48 2006 +0200

ntdll: Implemented RtlPcToFileHeader.

---

 dlls/ntdll/loader.c   |   16 ++++++++++++++++
 dlls/ntdll/ntdll.spec |    2 +-
 include/winternl.h    |    1 +
 3 files changed, 18 insertions(+), 1 deletions(-)

diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c
index aac48dc..eaf7cfa 100644
--- a/dlls/ntdll/loader.c
+++ b/dlls/ntdll/loader.c
@@ -2225,6 +2225,22 @@ PVOID WINAPI RtlImageRvaToVa( const IMAG
 
 
 /***********************************************************************
+ *           RtlPcToFileHeader   (NTDLL.@)
+ */
+PVOID WINAPI RtlPcToFileHeader( PVOID pc, PVOID *address )
+{
+    LDR_MODULE *module;
+    PVOID ret = NULL;
+
+    RtlEnterCriticalSection( &loader_section );
+    if (!LdrFindEntryForAddress( pc, &module )) ret = module->BaseAddress;
+    RtlLeaveCriticalSection( &loader_section );
+    *address = ret;
+    return ret;
+}
+
+
+/***********************************************************************
  *           NtLoadDriver   (NTDLL.@)
  *           ZwLoadDriver   (NTDLL.@)
  */
diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec
index 90afeb2..2950453 100644
--- a/dlls/ntdll/ntdll.spec
+++ b/dlls/ntdll/ntdll.spec
@@ -753,7 +753,7 @@ # @ stub RtlNumberGenericTableElementsAv
 @ stdcall RtlOemStringToUnicodeString(ptr ptr long)
 @ stdcall RtlOemToUnicodeN(ptr long ptr ptr long)
 @ stdcall RtlOpenCurrentUser(long ptr)
-@ stub RtlPcToFileHeader
+@ stdcall RtlPcToFileHeader(ptr ptr)
 @ stdcall RtlPinAtomInAtomTable(ptr long)
 # @ stub RtlPopFrame
 @ stdcall RtlPrefixString(ptr ptr long)
diff --git a/include/winternl.h b/include/winternl.h
index 38d13c6..9eb270a 100644
--- a/include/winternl.h
+++ b/include/winternl.h
@@ -2120,6 +2120,7 @@ NTSTATUS  WINAPI RtlOemStringToUnicodeSt
 NTSTATUS  WINAPI RtlOemToUnicodeN(LPWSTR,DWORD,LPDWORD,LPCSTR,DWORD);
 NTSTATUS  WINAPI RtlOpenCurrentUser(ACCESS_MASK,PHANDLE);
 
+PVOID     WINAPI RtlPcToFileHeader(PVOID,PVOID*);
 NTSTATUS  WINAPI RtlPinAtomInAtomTable(RTL_ATOM_TABLE,RTL_ATOM);
 BOOLEAN   WINAPI RtlPrefixString(const STRING*,const STRING*,BOOLEAN);
 BOOLEAN   WINAPI RtlPrefixUnicodeString(const UNICODE_STRING*,const UNICODE_STRING*,BOOLEAN);




More information about the wine-cvs mailing list