2003-11-09 19:19:02 +00:00
|
|
|
/*
|
2005-11-10 17:43:55 +00:00
|
|
|
* IMAGEHLP library
|
|
|
|
*
|
|
|
|
* Copyright 1998 Patrik Stridvall
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
2006-08-06 18:37:39 +00:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
2003-11-09 19:19:02 +00:00
|
|
|
*/
|
|
|
|
|
2013-12-24 21:02:32 +00:00
|
|
|
#include "precomp.h"
|
2003-11-09 19:19:02 +00:00
|
|
|
|
2014-01-23 17:42:15 +00:00
|
|
|
#include <winternl.h>
|
|
|
|
|
2006-08-06 18:37:39 +00:00
|
|
|
/***********************************************************************
|
|
|
|
* Data
|
|
|
|
*/
|
2018-01-18 23:37:52 +00:00
|
|
|
|
|
|
|
static PLOADED_IMAGE IMAGEHLP_pFirstLoadedImage=NULL;
|
2010-07-26 22:33:59 +00:00
|
|
|
|
2012-03-16 19:48:57 +00:00
|
|
|
DECLSPEC_HIDDEN extern HANDLE IMAGEHLP_hHeap;
|
2003-11-09 19:19:02 +00:00
|
|
|
|
2006-08-06 18:37:39 +00:00
|
|
|
/***********************************************************************
|
|
|
|
* GetImageConfigInformation (IMAGEHLP.@)
|
2003-11-09 19:19:02 +00:00
|
|
|
*/
|
2010-07-26 22:33:59 +00:00
|
|
|
BOOL WINAPI GetImageConfigInformation(
|
2006-08-06 18:37:39 +00:00
|
|
|
PLOADED_IMAGE LoadedImage,
|
|
|
|
PIMAGE_LOAD_CONFIG_DIRECTORY ImageConfigInformation)
|
2003-11-09 19:19:02 +00:00
|
|
|
{
|
2006-08-06 18:37:39 +00:00
|
|
|
FIXME("(%p, %p): stub\n",
|
|
|
|
LoadedImage, ImageConfigInformation
|
|
|
|
);
|
|
|
|
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
|
|
|
return FALSE;
|
2003-11-09 19:19:02 +00:00
|
|
|
}
|
|
|
|
|
2006-08-06 18:37:39 +00:00
|
|
|
/***********************************************************************
|
|
|
|
* GetImageUnusedHeaderBytes (IMAGEHLP.@)
|
2003-11-09 19:19:02 +00:00
|
|
|
*/
|
2010-07-26 22:33:59 +00:00
|
|
|
DWORD WINAPI GetImageUnusedHeaderBytes(
|
2006-08-06 18:37:39 +00:00
|
|
|
PLOADED_IMAGE LoadedImage,
|
|
|
|
LPDWORD SizeUnusedHeaderBytes)
|
2003-11-09 19:19:02 +00:00
|
|
|
{
|
2010-07-26 22:33:59 +00:00
|
|
|
FIXME("(%p, %p): stub\n",
|
|
|
|
LoadedImage, SizeUnusedHeaderBytes
|
|
|
|
);
|
|
|
|
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
|
|
|
return 0;
|
2003-11-09 19:19:02 +00:00
|
|
|
}
|
|
|
|
|
2006-08-06 18:37:39 +00:00
|
|
|
/***********************************************************************
|
|
|
|
* ImageLoad (IMAGEHLP.@)
|
2003-11-09 19:19:02 +00:00
|
|
|
*/
|
2018-01-18 23:37:52 +00:00
|
|
|
PLOADED_IMAGE WINAPI ImageLoad(PCSTR DllName, PCSTR DllPath)
|
2003-11-09 19:19:02 +00:00
|
|
|
{
|
2018-01-18 23:37:52 +00:00
|
|
|
PLOADED_IMAGE pLoadedImage;
|
|
|
|
|
|
|
|
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;
|
2010-07-26 22:33:59 +00:00
|
|
|
}
|
2004-07-20 16:48:18 +00:00
|
|
|
|
2010-07-26 22:33:59 +00:00
|
|
|
/***********************************************************************
|
|
|
|
* ImageUnload (IMAGEHLP.@)
|
|
|
|
*/
|
2018-01-18 23:37:52 +00:00
|
|
|
BOOL WINAPI ImageUnload(PLOADED_IMAGE pLoadedImage)
|
2010-07-26 22:33:59 +00:00
|
|
|
{
|
2018-01-18 23:37:52 +00:00
|
|
|
LIST_ENTRY *pCurrent, *pFind;
|
2004-07-20 16:48:18 +00:00
|
|
|
|
2018-01-18 23:37:52 +00:00
|
|
|
TRACE("(%p)\n", pLoadedImage);
|
|
|
|
|
|
|
|
if(!IMAGEHLP_pFirstLoadedImage || !pLoadedImage)
|
This one is for Steven... 18 months later, I kept my promise ;)
- BindImage & friends refactoring of my original code. Fixed two or three dozen bugs, stopped making assumptions about everything, actually checked for failure, used dynamic allocation instead of 32 static structures, fixed a lot of broken code, fixed some helper functions, made the code as 64-bit compatible as I could (checked with msvc WP64 + prefast).
- Remove internal.c and use NDK instead
- Remove debug.c and symbol.c like WINE have done
- Rewrite the entire exports file to update it for XP. Forward almost all the functions to dbghelp, like WINE have done (note: windows DLL used delayed imports instead).
- Cleanup source to add implemented/unimplemented tags, source header, and precompiled header.
- Sync with latest code from WINE.
Tested with Quicken 2004 & its patches (which make extensive use of BindImage) as well as random bindings of some applications on my disk. Worked perfectly in Windows.
svn path=/trunk/; revision=19025
2005-11-06 10:48:14 +00:00
|
|
|
{
|
2018-01-18 23:37:52 +00:00
|
|
|
/* No image loaded or null pointer */
|
|
|
|
SetLastError(ERROR_INVALID_PARAMETER);
|
|
|
|
return FALSE;
|
2004-07-20 16:48:18 +00:00
|
|
|
}
|
|
|
|
|
2018-01-18 23:37:52 +00:00
|
|
|
pFind=&pLoadedImage->Links;
|
|
|
|
pCurrent=&IMAGEHLP_pFirstLoadedImage->Links;
|
|
|
|
while((pCurrent != pFind) &&
|
|
|
|
(pCurrent != NULL))
|
|
|
|
pCurrent = pCurrent->Flink;
|
|
|
|
if(!pCurrent)
|
This one is for Steven... 18 months later, I kept my promise ;)
- BindImage & friends refactoring of my original code. Fixed two or three dozen bugs, stopped making assumptions about everything, actually checked for failure, used dynamic allocation instead of 32 static structures, fixed a lot of broken code, fixed some helper functions, made the code as 64-bit compatible as I could (checked with msvc WP64 + prefast).
- Remove internal.c and use NDK instead
- Remove debug.c and symbol.c like WINE have done
- Rewrite the entire exports file to update it for XP. Forward almost all the functions to dbghelp, like WINE have done (note: windows DLL used delayed imports instead).
- Cleanup source to add implemented/unimplemented tags, source header, and precompiled header.
- Sync with latest code from WINE.
Tested with Quicken 2004 & its patches (which make extensive use of BindImage) as well as random bindings of some applications on my disk. Worked perfectly in Windows.
svn path=/trunk/; revision=19025
2005-11-06 10:48:14 +00:00
|
|
|
{
|
2018-01-18 23:37:52 +00:00
|
|
|
/* Not found */
|
|
|
|
SetLastError(ERROR_INVALID_PARAMETER);
|
|
|
|
return FALSE;
|
2004-07-20 16:48:18 +00:00
|
|
|
}
|
2003-11-09 19:19:02 +00:00
|
|
|
|
2018-01-18 23:37:52 +00:00
|
|
|
if(pCurrent->Blink)
|
|
|
|
pCurrent->Blink->Flink = pCurrent->Flink;
|
|
|
|
else
|
|
|
|
IMAGEHLP_pFirstLoadedImage = pCurrent->Flink?CONTAINING_RECORD(
|
|
|
|
pCurrent->Flink, LOADED_IMAGE, Links):NULL;
|
2003-11-09 19:19:02 +00:00
|
|
|
|
2018-01-18 23:37:52 +00:00
|
|
|
if(pCurrent->Flink)
|
|
|
|
pCurrent->Flink->Blink = pCurrent->Blink;
|
2003-11-09 19:19:02 +00:00
|
|
|
|
2018-01-18 23:37:52 +00:00
|
|
|
return FALSE;
|
2003-11-09 19:19:02 +00:00
|
|
|
}
|
|
|
|
|
2006-08-06 18:37:39 +00:00
|
|
|
/***********************************************************************
|
|
|
|
* MapAndLoad (IMAGEHLP.@)
|
2003-11-09 19:19:02 +00:00
|
|
|
*/
|
2012-03-16 19:48:57 +00:00
|
|
|
BOOL WINAPI MapAndLoad(PCSTR pszImageName, PCSTR pszDllPath, PLOADED_IMAGE pLoadedImage,
|
2010-07-26 22:33:59 +00:00
|
|
|
BOOL bDotDll, BOOL bReadOnly)
|
2003-11-09 19:19:02 +00:00
|
|
|
{
|
2010-07-26 22:33:59 +00:00
|
|
|
CHAR szFileName[MAX_PATH];
|
|
|
|
HANDLE hFile = INVALID_HANDLE_VALUE;
|
|
|
|
HANDLE hFileMapping = NULL;
|
|
|
|
PVOID mapping = NULL;
|
|
|
|
PIMAGE_NT_HEADERS pNtHeader = NULL;
|
This one is for Steven... 18 months later, I kept my promise ;)
- BindImage & friends refactoring of my original code. Fixed two or three dozen bugs, stopped making assumptions about everything, actually checked for failure, used dynamic allocation instead of 32 static structures, fixed a lot of broken code, fixed some helper functions, made the code as 64-bit compatible as I could (checked with msvc WP64 + prefast).
- Remove internal.c and use NDK instead
- Remove debug.c and symbol.c like WINE have done
- Rewrite the entire exports file to update it for XP. Forward almost all the functions to dbghelp, like WINE have done (note: windows DLL used delayed imports instead).
- Cleanup source to add implemented/unimplemented tags, source header, and precompiled header.
- Sync with latest code from WINE.
Tested with Quicken 2004 & its patches (which make extensive use of BindImage) as well as random bindings of some applications on my disk. Worked perfectly in Windows.
svn path=/trunk/; revision=19025
2005-11-06 10:48:14 +00:00
|
|
|
|
2010-07-26 22:33:59 +00:00
|
|
|
TRACE("(%s, %s, %p, %d, %d)\n",
|
|
|
|
pszImageName, pszDllPath, pLoadedImage, bDotDll, bReadOnly);
|
2007-10-19 23:21:45 +00:00
|
|
|
|
2010-07-26 22:33:59 +00:00
|
|
|
if (!SearchPathA(pszDllPath, pszImageName, bDotDll ? ".DLL" : ".EXE",
|
|
|
|
sizeof(szFileName), szFileName, NULL))
|
2003-11-09 19:19:02 +00:00
|
|
|
{
|
2010-07-26 22:33:59 +00:00
|
|
|
SetLastError(ERROR_FILE_NOT_FOUND);
|
|
|
|
goto Error;
|
|
|
|
}
|
This one is for Steven... 18 months later, I kept my promise ;)
- BindImage & friends refactoring of my original code. Fixed two or three dozen bugs, stopped making assumptions about everything, actually checked for failure, used dynamic allocation instead of 32 static structures, fixed a lot of broken code, fixed some helper functions, made the code as 64-bit compatible as I could (checked with msvc WP64 + prefast).
- Remove internal.c and use NDK instead
- Remove debug.c and symbol.c like WINE have done
- Rewrite the entire exports file to update it for XP. Forward almost all the functions to dbghelp, like WINE have done (note: windows DLL used delayed imports instead).
- Cleanup source to add implemented/unimplemented tags, source header, and precompiled header.
- Sync with latest code from WINE.
Tested with Quicken 2004 & its patches (which make extensive use of BindImage) as well as random bindings of some applications on my disk. Worked perfectly in Windows.
svn path=/trunk/; revision=19025
2005-11-06 10:48:14 +00:00
|
|
|
|
2010-07-26 22:33:59 +00:00
|
|
|
hFile = CreateFileA(szFileName,
|
|
|
|
GENERIC_READ | (bReadOnly ? 0 : GENERIC_WRITE),
|
|
|
|
FILE_SHARE_READ,
|
|
|
|
NULL, OPEN_EXISTING, 0, NULL);
|
|
|
|
if (hFile == INVALID_HANDLE_VALUE)
|
|
|
|
{
|
|
|
|
WARN("CreateFile: Error = %d\n", GetLastError());
|
|
|
|
goto Error;
|
2003-11-09 19:19:02 +00:00
|
|
|
}
|
|
|
|
|
2010-07-26 22:33:59 +00:00
|
|
|
hFileMapping = CreateFileMappingA(hFile, NULL,
|
|
|
|
(bReadOnly ? PAGE_READONLY : PAGE_READWRITE) | SEC_COMMIT,
|
|
|
|
0, 0, NULL);
|
This one is for Steven... 18 months later, I kept my promise ;)
- BindImage & friends refactoring of my original code. Fixed two or three dozen bugs, stopped making assumptions about everything, actually checked for failure, used dynamic allocation instead of 32 static structures, fixed a lot of broken code, fixed some helper functions, made the code as 64-bit compatible as I could (checked with msvc WP64 + prefast).
- Remove internal.c and use NDK instead
- Remove debug.c and symbol.c like WINE have done
- Rewrite the entire exports file to update it for XP. Forward almost all the functions to dbghelp, like WINE have done (note: windows DLL used delayed imports instead).
- Cleanup source to add implemented/unimplemented tags, source header, and precompiled header.
- Sync with latest code from WINE.
Tested with Quicken 2004 & its patches (which make extensive use of BindImage) as well as random bindings of some applications on my disk. Worked perfectly in Windows.
svn path=/trunk/; revision=19025
2005-11-06 10:48:14 +00:00
|
|
|
if (!hFileMapping)
|
2003-11-09 19:19:02 +00:00
|
|
|
{
|
2010-07-26 22:33:59 +00:00
|
|
|
WARN("CreateFileMapping: Error = %d\n", GetLastError());
|
|
|
|
goto Error;
|
2003-11-09 19:19:02 +00:00
|
|
|
}
|
|
|
|
|
2010-07-26 22:33:59 +00:00
|
|
|
mapping = MapViewOfFile(hFileMapping, bReadOnly ? FILE_MAP_READ : FILE_MAP_WRITE, 0, 0, 0);
|
This one is for Steven... 18 months later, I kept my promise ;)
- BindImage & friends refactoring of my original code. Fixed two or three dozen bugs, stopped making assumptions about everything, actually checked for failure, used dynamic allocation instead of 32 static structures, fixed a lot of broken code, fixed some helper functions, made the code as 64-bit compatible as I could (checked with msvc WP64 + prefast).
- Remove internal.c and use NDK instead
- Remove debug.c and symbol.c like WINE have done
- Rewrite the entire exports file to update it for XP. Forward almost all the functions to dbghelp, like WINE have done (note: windows DLL used delayed imports instead).
- Cleanup source to add implemented/unimplemented tags, source header, and precompiled header.
- Sync with latest code from WINE.
Tested with Quicken 2004 & its patches (which make extensive use of BindImage) as well as random bindings of some applications on my disk. Worked perfectly in Windows.
svn path=/trunk/; revision=19025
2005-11-06 10:48:14 +00:00
|
|
|
CloseHandle(hFileMapping);
|
2010-07-26 22:33:59 +00:00
|
|
|
if (!mapping)
|
This one is for Steven... 18 months later, I kept my promise ;)
- BindImage & friends refactoring of my original code. Fixed two or three dozen bugs, stopped making assumptions about everything, actually checked for failure, used dynamic allocation instead of 32 static structures, fixed a lot of broken code, fixed some helper functions, made the code as 64-bit compatible as I could (checked with msvc WP64 + prefast).
- Remove internal.c and use NDK instead
- Remove debug.c and symbol.c like WINE have done
- Rewrite the entire exports file to update it for XP. Forward almost all the functions to dbghelp, like WINE have done (note: windows DLL used delayed imports instead).
- Cleanup source to add implemented/unimplemented tags, source header, and precompiled header.
- Sync with latest code from WINE.
Tested with Quicken 2004 & its patches (which make extensive use of BindImage) as well as random bindings of some applications on my disk. Worked perfectly in Windows.
svn path=/trunk/; revision=19025
2005-11-06 10:48:14 +00:00
|
|
|
{
|
2010-07-26 22:33:59 +00:00
|
|
|
WARN("MapViewOfFile: Error = %d\n", GetLastError());
|
|
|
|
goto Error;
|
This one is for Steven... 18 months later, I kept my promise ;)
- BindImage & friends refactoring of my original code. Fixed two or three dozen bugs, stopped making assumptions about everything, actually checked for failure, used dynamic allocation instead of 32 static structures, fixed a lot of broken code, fixed some helper functions, made the code as 64-bit compatible as I could (checked with msvc WP64 + prefast).
- Remove internal.c and use NDK instead
- Remove debug.c and symbol.c like WINE have done
- Rewrite the entire exports file to update it for XP. Forward almost all the functions to dbghelp, like WINE have done (note: windows DLL used delayed imports instead).
- Cleanup source to add implemented/unimplemented tags, source header, and precompiled header.
- Sync with latest code from WINE.
Tested with Quicken 2004 & its patches (which make extensive use of BindImage) as well as random bindings of some applications on my disk. Worked perfectly in Windows.
svn path=/trunk/; revision=19025
2005-11-06 10:48:14 +00:00
|
|
|
}
|
2010-07-26 22:33:59 +00:00
|
|
|
|
|
|
|
if (!(pNtHeader = RtlImageNtHeader(mapping)))
|
2003-11-09 19:19:02 +00:00
|
|
|
{
|
2010-07-26 22:33:59 +00:00
|
|
|
WARN("Not an NT header\n");
|
|
|
|
UnmapViewOfFile(mapping);
|
|
|
|
goto Error;
|
2003-11-09 19:19:02 +00:00
|
|
|
}
|
|
|
|
|
2010-07-26 22:33:59 +00:00
|
|
|
pLoadedImage->ModuleName = HeapAlloc(GetProcessHeap(), 0,
|
|
|
|
strlen(szFileName) + 1);
|
|
|
|
if (pLoadedImage->ModuleName) strcpy(pLoadedImage->ModuleName, szFileName);
|
|
|
|
pLoadedImage->hFile = hFile;
|
|
|
|
pLoadedImage->MappedAddress = mapping;
|
|
|
|
pLoadedImage->FileHeader = pNtHeader;
|
|
|
|
pLoadedImage->Sections = (PIMAGE_SECTION_HEADER)
|
|
|
|
((LPBYTE) &pNtHeader->OptionalHeader +
|
|
|
|
pNtHeader->FileHeader.SizeOfOptionalHeader);
|
|
|
|
pLoadedImage->NumberOfSections = pNtHeader->FileHeader.NumberOfSections;
|
|
|
|
pLoadedImage->SizeOfImage = GetFileSize(hFile, NULL);
|
|
|
|
pLoadedImage->Characteristics = pNtHeader->FileHeader.Characteristics;
|
|
|
|
pLoadedImage->LastRvaSection = pLoadedImage->Sections;
|
|
|
|
|
|
|
|
pLoadedImage->fSystemImage = FALSE; /* FIXME */
|
|
|
|
pLoadedImage->fDOSImage = FALSE; /* FIXME */
|
|
|
|
|
|
|
|
pLoadedImage->Links.Flink = &pLoadedImage->Links;
|
|
|
|
pLoadedImage->Links.Blink = &pLoadedImage->Links;
|
|
|
|
|
This one is for Steven... 18 months later, I kept my promise ;)
- BindImage & friends refactoring of my original code. Fixed two or three dozen bugs, stopped making assumptions about everything, actually checked for failure, used dynamic allocation instead of 32 static structures, fixed a lot of broken code, fixed some helper functions, made the code as 64-bit compatible as I could (checked with msvc WP64 + prefast).
- Remove internal.c and use NDK instead
- Remove debug.c and symbol.c like WINE have done
- Rewrite the entire exports file to update it for XP. Forward almost all the functions to dbghelp, like WINE have done (note: windows DLL used delayed imports instead).
- Cleanup source to add implemented/unimplemented tags, source header, and precompiled header.
- Sync with latest code from WINE.
Tested with Quicken 2004 & its patches (which make extensive use of BindImage) as well as random bindings of some applications on my disk. Worked perfectly in Windows.
svn path=/trunk/; revision=19025
2005-11-06 10:48:14 +00:00
|
|
|
return TRUE;
|
2010-07-26 22:33:59 +00:00
|
|
|
|
|
|
|
Error:
|
|
|
|
if (hFile != INVALID_HANDLE_VALUE) CloseHandle(hFile);
|
|
|
|
return FALSE;
|
2003-11-09 19:19:02 +00:00
|
|
|
}
|
|
|
|
|
2006-08-06 18:37:39 +00:00
|
|
|
/***********************************************************************
|
|
|
|
* SetImageConfigInformation (IMAGEHLP.@)
|
2003-11-09 19:19:02 +00:00
|
|
|
*/
|
2010-07-26 22:33:59 +00:00
|
|
|
BOOL WINAPI SetImageConfigInformation(
|
2006-08-06 18:37:39 +00:00
|
|
|
PLOADED_IMAGE LoadedImage,
|
|
|
|
PIMAGE_LOAD_CONFIG_DIRECTORY ImageConfigInformation)
|
2003-11-09 19:19:02 +00:00
|
|
|
{
|
2006-08-06 18:37:39 +00:00
|
|
|
FIXME("(%p, %p): stub\n",
|
|
|
|
LoadedImage, ImageConfigInformation
|
|
|
|
);
|
|
|
|
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
|
|
|
return FALSE;
|
2003-11-09 19:19:02 +00:00
|
|
|
}
|
|
|
|
|
2006-08-06 18:37:39 +00:00
|
|
|
/***********************************************************************
|
|
|
|
* UnMapAndLoad (IMAGEHLP.@)
|
2003-11-09 19:19:02 +00:00
|
|
|
*/
|
2010-07-26 22:33:59 +00:00
|
|
|
BOOL WINAPI UnMapAndLoad(PLOADED_IMAGE pLoadedImage)
|
This one is for Steven... 18 months later, I kept my promise ;)
- BindImage & friends refactoring of my original code. Fixed two or three dozen bugs, stopped making assumptions about everything, actually checked for failure, used dynamic allocation instead of 32 static structures, fixed a lot of broken code, fixed some helper functions, made the code as 64-bit compatible as I could (checked with msvc WP64 + prefast).
- Remove internal.c and use NDK instead
- Remove debug.c and symbol.c like WINE have done
- Rewrite the entire exports file to update it for XP. Forward almost all the functions to dbghelp, like WINE have done (note: windows DLL used delayed imports instead).
- Cleanup source to add implemented/unimplemented tags, source header, and precompiled header.
- Sync with latest code from WINE.
Tested with Quicken 2004 & its patches (which make extensive use of BindImage) as well as random bindings of some applications on my disk. Worked perfectly in Windows.
svn path=/trunk/; revision=19025
2005-11-06 10:48:14 +00:00
|
|
|
{
|
2010-07-26 22:33:59 +00:00
|
|
|
HeapFree(GetProcessHeap(), 0, pLoadedImage->ModuleName);
|
|
|
|
/* FIXME: MSDN states that a new checksum is computed and stored into the file */
|
|
|
|
if (pLoadedImage->MappedAddress) UnmapViewOfFile(pLoadedImage->MappedAddress);
|
|
|
|
if (pLoadedImage->hFile != INVALID_HANDLE_VALUE) CloseHandle(pLoadedImage->hFile);
|
This one is for Steven... 18 months later, I kept my promise ;)
- BindImage & friends refactoring of my original code. Fixed two or three dozen bugs, stopped making assumptions about everything, actually checked for failure, used dynamic allocation instead of 32 static structures, fixed a lot of broken code, fixed some helper functions, made the code as 64-bit compatible as I could (checked with msvc WP64 + prefast).
- Remove internal.c and use NDK instead
- Remove debug.c and symbol.c like WINE have done
- Rewrite the entire exports file to update it for XP. Forward almost all the functions to dbghelp, like WINE have done (note: windows DLL used delayed imports instead).
- Cleanup source to add implemented/unimplemented tags, source header, and precompiled header.
- Sync with latest code from WINE.
Tested with Quicken 2004 & its patches (which make extensive use of BindImage) as well as random bindings of some applications on my disk. Worked perfectly in Windows.
svn path=/trunk/; revision=19025
2005-11-06 10:48:14 +00:00
|
|
|
return TRUE;
|
2003-11-09 19:19:02 +00:00
|
|
|
}
|