Commit | Line | Data |
---|---|---|
091e7856 PS |
1 | /* |
2 | * IMAGEHLP library | |
3 | * | |
4 | * Copyright 1998 Patrik Stridvall | |
0799c1a7 AJ |
5 | * |
6 | * This library is free software; you can redistribute it and/or | |
7 | * modify it under the terms of the GNU Lesser General Public | |
8 | * License as published by the Free Software Foundation; either | |
9 | * version 2.1 of the License, or (at your option) any later version. | |
10 | * | |
11 | * This library is distributed in the hope that it will be useful, | |
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
14 | * Lesser General Public License for more details. | |
15 | * | |
16 | * You should have received a copy of the GNU Lesser General Public | |
17 | * License along with this library; if not, write to the Free Software | |
360a3f91 | 18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA |
091e7856 PS |
19 | */ |
20 | ||
e37c6e18 AJ |
21 | #include <stdarg.h> |
22 | ||
23 | #include "windef.h" | |
24 | #include "winbase.h" | |
317af320 | 25 | #include "imagehlp.h" |
0799c1a7 | 26 | #include "wine/debug.h" |
091e7856 PS |
27 | |
28 | /**********************************************************************/ | |
9b0b1e07 | 29 | HANDLE IMAGEHLP_hHeap = NULL; |
091e7856 | 30 | |
091e7856 | 31 | /*********************************************************************** |
1e1313d5 | 32 | * DllMain (IMAGEHLP.init) |
091e7856 | 33 | */ |
1e1313d5 | 34 | BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) |
091e7856 PS |
35 | { |
36 | switch(fdwReason) | |
37 | { | |
38 | case DLL_PROCESS_ATTACH: | |
4e1ef0c1 | 39 | DisableThreadLibraryCalls(hinstDLL); |
a3960292 | 40 | IMAGEHLP_hHeap = HeapCreate(0, 0x10000, 0); |
091e7856 PS |
41 | break; |
42 | case DLL_PROCESS_DETACH: | |
a3960292 | 43 | HeapDestroy(IMAGEHLP_hHeap); |
9b0b1e07 | 44 | IMAGEHLP_hHeap = NULL; |
091e7856 | 45 | break; |
091e7856 PS |
46 | default: |
47 | break; | |
48 | } | |
49 | return TRUE; | |
50 | } | |
51 | ||
091e7856 | 52 | /*********************************************************************** |
2d6457c1 | 53 | * MarkImageAsRunFromSwap (IMAGEHLP.@) |
091e7856 PS |
54 | * FIXME |
55 | * No documentation available. | |
56 | */ | |
57 | ||
091e7856 | 58 | /*********************************************************************** |
2d6457c1 | 59 | * TouchFileTimes (IMAGEHLP.@) |
091e7856 | 60 | */ |
02aa8d50 | 61 | BOOL WINAPI TouchFileTimes(HANDLE FileHandle, LPSYSTEMTIME lpSystemTime) |
091e7856 | 62 | { |
02aa8d50 TW |
63 | FILETIME FileTime; |
64 | SYSTEMTIME SystemTime; | |
65 | ||
66 | if(lpSystemTime == NULL) | |
67 | { | |
68 | GetSystemTime(&SystemTime); | |
69 | lpSystemTime = &SystemTime; | |
70 | } | |
71 | ||
72 | return (SystemTimeToFileTime(lpSystemTime, &FileTime) && | |
73 | SetFileTime(FileHandle, NULL, NULL, &FileTime)); | |
091e7856 | 74 | } |