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
|
|
|
*/
|
|
|
|
|
2018-03-15 11:28:19 +00:00
|
|
|
#include <stdarg.h>
|
|
|
|
|
|
|
|
#include "windef.h"
|
|
|
|
#include "winbase.h"
|
|
|
|
#include "imagehlp.h"
|
|
|
|
#include "wine/debug.h"
|
2003-11-09 19:19:02 +00:00
|
|
|
|
2006-08-06 18:37:39 +00:00
|
|
|
/**********************************************************************/
|
2012-03-16 19:48:57 +00:00
|
|
|
DECLSPEC_HIDDEN HANDLE IMAGEHLP_hHeap = NULL;
|
2003-11-09 19:19:02 +00:00
|
|
|
|
2006-08-06 18:37:39 +00:00
|
|
|
/***********************************************************************
|
|
|
|
* DllMain (IMAGEHLP.init)
|
|
|
|
*/
|
2010-07-26 22:33:59 +00:00
|
|
|
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
|
2003-11-09 19:19:02 +00:00
|
|
|
{
|
2006-08-06 18:37:39 +00:00
|
|
|
switch(fdwReason)
|
2003-11-09 19:19:02 +00:00
|
|
|
{
|
2006-08-06 18:37:39 +00:00
|
|
|
case DLL_PROCESS_ATTACH:
|
|
|
|
DisableThreadLibraryCalls(hinstDLL);
|
|
|
|
IMAGEHLP_hHeap = HeapCreate(0, 0x10000, 0);
|
|
|
|
break;
|
|
|
|
case DLL_PROCESS_DETACH:
|
2013-09-19 19:39:32 +00:00
|
|
|
if (lpvReserved) break;
|
2006-08-06 18:37:39 +00:00
|
|
|
HeapDestroy(IMAGEHLP_hHeap);
|
|
|
|
break;
|
2003-11-09 19:19:02 +00:00
|
|
|
}
|
2006-08-06 18:37:39 +00:00
|
|
|
return TRUE;
|
2003-11-09 19:19:02 +00:00
|
|
|
}
|
2010-07-26 22:33:59 +00:00
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* MarkImageAsRunFromSwap (IMAGEHLP.@)
|
|
|
|
* FIXME
|
|
|
|
* No documentation available.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* TouchFileTimes (IMAGEHLP.@)
|
|
|
|
*/
|
|
|
|
BOOL WINAPI TouchFileTimes(HANDLE FileHandle, LPSYSTEMTIME lpSystemTime)
|
|
|
|
{
|
|
|
|
FILETIME FileTime;
|
|
|
|
SYSTEMTIME SystemTime;
|
|
|
|
|
|
|
|
if(lpSystemTime == NULL)
|
|
|
|
{
|
|
|
|
GetSystemTime(&SystemTime);
|
|
|
|
lpSystemTime = &SystemTime;
|
|
|
|
}
|
|
|
|
|
|
|
|
return (SystemTimeToFileTime(lpSystemTime, &FileTime) &&
|
|
|
|
SetFileTime(FileHandle, NULL, NULL, &FileTime));
|
|
|
|
}
|