Commit 9650db49 authored by Christian Costa's avatar Christian Costa Committed by Alexandre Julliard

Allocate space to contain the IMAGE_NT_HEADERS structure (ImageLoad

function). Add some more traces.
parent 3db30e37
...@@ -123,8 +123,14 @@ PVOID WINAPI ImageDirectoryEntryToData( ...@@ -123,8 +123,14 @@ PVOID WINAPI ImageDirectoryEntryToData(
*/ */
PLOADED_IMAGE WINAPI ImageLoad(LPSTR DllName, LPSTR DllPath) PLOADED_IMAGE WINAPI ImageLoad(LPSTR DllName, LPSTR DllPath)
{ {
PLOADED_IMAGE pLoadedImage = PLOADED_IMAGE pLoadedImage;
HeapAlloc(IMAGEHLP_hHeap, 0, sizeof(LOADED_IMAGE));
FIXME("(%s, %s): stub\n", DllName, DllPath);
pLoadedImage = HeapAlloc(IMAGEHLP_hHeap, 0, sizeof(LOADED_IMAGE));
if (pLoadedImage)
pLoadedImage->FileHeader = HeapAlloc(IMAGEHLP_hHeap, 0, sizeof(IMAGE_NT_HEADERS));
return pLoadedImage; return pLoadedImage;
} }
...@@ -133,6 +139,7 @@ PLOADED_IMAGE WINAPI ImageLoad(LPSTR DllName, LPSTR DllPath) ...@@ -133,6 +139,7 @@ PLOADED_IMAGE WINAPI ImageLoad(LPSTR DllName, LPSTR DllPath)
*/ */
PIMAGE_NT_HEADERS WINAPI ImageNtHeader(PVOID Base) PIMAGE_NT_HEADERS WINAPI ImageNtHeader(PVOID Base)
{ {
TRACE("(%p)\n", Base);
return (PIMAGE_NT_HEADERS) return (PIMAGE_NT_HEADERS)
((LPBYTE) Base + ((PIMAGE_DOS_HEADER) Base)->e_lfanew); ((LPBYTE) Base + ((PIMAGE_DOS_HEADER) Base)->e_lfanew);
} }
...@@ -168,6 +175,9 @@ PVOID WINAPI ImageRvaToVa( ...@@ -168,6 +175,9 @@ PVOID WINAPI ImageRvaToVa(
BOOL WINAPI ImageUnload(PLOADED_IMAGE pLoadedImage) BOOL WINAPI ImageUnload(PLOADED_IMAGE pLoadedImage)
{ {
LIST_ENTRY *pCurrent, *pFind; LIST_ENTRY *pCurrent, *pFind;
TRACE("(%p)\n", pLoadedImage);
if(!IMAGEHLP_pFirstLoadedImage || !pLoadedImage) if(!IMAGEHLP_pFirstLoadedImage || !pLoadedImage)
{ {
/* No image loaded or null pointer */ /* No image loaded or null pointer */
...@@ -215,6 +225,9 @@ BOOL WINAPI MapAndLoad( ...@@ -215,6 +225,9 @@ BOOL WINAPI MapAndLoad(
HMODULE hModule = NULL; HMODULE hModule = NULL;
PIMAGE_NT_HEADERS pNtHeader = NULL; PIMAGE_NT_HEADERS pNtHeader = NULL;
TRACE("(%s, %s, %p, %d, %d)\n", pszImageName, pszDllPath, pLoadedImage,
bDotDll, bReadOnly);
/* PathCombine(&szFileName, pszDllPath, pszImageName); */ /* PathCombine(&szFileName, pszDllPath, pszImageName); */
/* PathRenameExtension(&szFileName, bDotDll?:"dll":"exe"); */ /* PathRenameExtension(&szFileName, bDotDll?:"dll":"exe"); */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment