1998-10-11 19:04:17 +02:00
|
|
|
/*
|
|
|
|
* IMAGEHLP library
|
|
|
|
*
|
|
|
|
* Copyright 1998 Patrik Stridvall
|
2002-03-10 00:29:33 +01:00
|
|
|
*
|
|
|
|
* 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-05-18 14:49:52 +02:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
1998-10-11 19:04:17 +02:00
|
|
|
*/
|
|
|
|
|
2003-09-06 01:08:26 +02:00
|
|
|
#include <stdarg.h>
|
|
|
|
|
|
|
|
#include "windef.h"
|
|
|
|
#include "winbase.h"
|
1999-02-17 14:51:06 +01:00
|
|
|
#include "imagehlp.h"
|
1998-10-11 19:04:17 +02:00
|
|
|
#include "winerror.h"
|
2002-03-10 00:29:33 +01:00
|
|
|
#include "wine/debug.h"
|
1998-10-11 19:04:17 +02:00
|
|
|
|
2002-03-10 00:29:33 +01:00
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(imagehlp);
|
1999-04-19 16:56:29 +02:00
|
|
|
|
1998-10-11 19:04:17 +02:00
|
|
|
/**********************************************************************/
|
2003-01-15 00:43:41 +01:00
|
|
|
HANDLE IMAGEHLP_hHeap = NULL;
|
1998-10-11 19:04:17 +02:00
|
|
|
|
|
|
|
/***********************************************************************
|
2002-11-05 00:53:41 +01:00
|
|
|
* DllMain (IMAGEHLP.init)
|
1998-10-11 19:04:17 +02:00
|
|
|
*/
|
2002-11-05 00:53:41 +01:00
|
|
|
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
|
1998-10-11 19:04:17 +02:00
|
|
|
{
|
|
|
|
switch(fdwReason)
|
|
|
|
{
|
|
|
|
case DLL_PROCESS_ATTACH:
|
2003-06-30 22:53:48 +02:00
|
|
|
DisableThreadLibraryCalls(hinstDLL);
|
1999-02-26 12:11:13 +01:00
|
|
|
IMAGEHLP_hHeap = HeapCreate(0, 0x10000, 0);
|
1998-10-11 19:04:17 +02:00
|
|
|
break;
|
|
|
|
case DLL_PROCESS_DETACH:
|
1999-02-26 12:11:13 +01:00
|
|
|
HeapDestroy(IMAGEHLP_hHeap);
|
2003-01-15 00:43:41 +01:00
|
|
|
IMAGEHLP_hHeap = NULL;
|
1998-10-11 19:04:17 +02:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
2000-03-28 22:22:59 +02:00
|
|
|
* MarkImageAsRunFromSwap (IMAGEHLP.@)
|
1998-10-11 19:04:17 +02:00
|
|
|
* FIXME
|
|
|
|
* No documentation available.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/***********************************************************************
|
2000-03-28 22:22:59 +02:00
|
|
|
* TouchFileTimes (IMAGEHLP.@)
|
1998-10-11 19:04:17 +02:00
|
|
|
*/
|
2004-07-30 06:22:44 +02:00
|
|
|
BOOL WINAPI TouchFileTimes(HANDLE FileHandle, LPSYSTEMTIME lpSystemTime)
|
1998-10-11 19:04:17 +02:00
|
|
|
{
|
2004-07-30 06:22:44 +02:00
|
|
|
FILETIME FileTime;
|
|
|
|
SYSTEMTIME SystemTime;
|
|
|
|
|
|
|
|
if(lpSystemTime == NULL)
|
|
|
|
{
|
|
|
|
GetSystemTime(&SystemTime);
|
|
|
|
lpSystemTime = &SystemTime;
|
|
|
|
}
|
|
|
|
|
|
|
|
return (SystemTimeToFileTime(lpSystemTime, &FileTime) &&
|
|
|
|
SetFileTime(FileHandle, NULL, NULL, &FileTime));
|
1998-10-11 19:04:17 +02:00
|
|
|
}
|