Fixed header dependencies to be fully compatible with the Windows
[wine/multimedia.git] / dlls / imagehlp / imagehlp_main.c
blob150ca013beb16298b02eb218fd1bb0504ea955b2
1 /*
2 * IMAGEHLP library
4 * Copyright 1998 Patrik Stridvall
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.
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.
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
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 #include <stdarg.h>
23 #include "windef.h"
24 #include "winbase.h"
25 #include "imagehlp.h"
26 #include "winerror.h"
27 #include "wine/debug.h"
29 WINE_DEFAULT_DEBUG_CHANNEL(imagehlp);
31 /**********************************************************************/
33 HANDLE IMAGEHLP_hHeap = NULL;
35 static API_VERSION IMAGEHLP_ApiVersion = { 4, 0, 0, 5 };
37 /***********************************************************************
38 * DllMain (IMAGEHLP.init)
40 BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
42 switch(fdwReason)
44 case DLL_PROCESS_ATTACH:
45 DisableThreadLibraryCalls(hinstDLL);
46 IMAGEHLP_hHeap = HeapCreate(0, 0x10000, 0);
47 break;
48 case DLL_PROCESS_DETACH:
49 HeapDestroy(IMAGEHLP_hHeap);
50 IMAGEHLP_hHeap = NULL;
51 break;
52 default:
53 break;
55 return TRUE;
58 /***********************************************************************
59 * ImagehlpApiVersion (IMAGEHLP.@)
61 PAPI_VERSION WINAPI ImagehlpApiVersion()
63 return &IMAGEHLP_ApiVersion;
66 /***********************************************************************
67 * ImagehlpApiVersionEx (IMAGEHLP.@)
69 PAPI_VERSION WINAPI ImagehlpApiVersionEx(PAPI_VERSION AppVersion)
71 if(!AppVersion)
72 return NULL;
74 AppVersion->MajorVersion = IMAGEHLP_ApiVersion.MajorVersion;
75 AppVersion->MinorVersion = IMAGEHLP_ApiVersion.MinorVersion;
76 AppVersion->Revision = IMAGEHLP_ApiVersion.Revision;
77 AppVersion->Reserved = IMAGEHLP_ApiVersion.Reserved;
79 return AppVersion;
82 /***********************************************************************
83 * MakeSureDirectoryPathExists (IMAGEHLP.@)
85 BOOL WINAPI MakeSureDirectoryPathExists(LPCSTR DirPath)
87 if (CreateDirectoryA(DirPath,NULL))
88 return TRUE;
89 if (GetLastError() == ERROR_ALREADY_EXISTS)
91 SetLastError(ERROR_SUCCESS);
92 return TRUE;
94 return FALSE;
97 /***********************************************************************
98 * MarkImageAsRunFromSwap (IMAGEHLP.@)
99 * FIXME
100 * No documentation available.
103 /***********************************************************************
104 * SearchTreeForFile (IMAGEHLP.@)
106 BOOL WINAPI SearchTreeForFile(
107 LPSTR RootPath, LPSTR InputPathName, LPSTR OutputPathBuffer)
109 FIXME("(%s, %s, %s): stub\n",
110 debugstr_a(RootPath), debugstr_a(InputPathName),
111 debugstr_a(OutputPathBuffer)
113 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
114 return FALSE;
117 /***********************************************************************
118 * TouchFileTimes (IMAGEHLP.@)
120 BOOL WINAPI TouchFileTimes(
121 HANDLE FileHandle, LPSYSTEMTIME lpSystemTime)
123 FIXME("(%p, %p): stub\n",
124 FileHandle, lpSystemTime
126 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
127 return FALSE;