Add an empty hook function for WSASetBlockingHook to return.
[wine] / dlls / imagehlp / imagehlp_main.c
1 /*
2  *      IMAGEHLP library
3  *
4  *      Copyright 1998  Patrik Stridvall
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
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  */
20
21 #include "imagehlp.h"
22 #include "winerror.h"
23 #include "winbase.h"
24 #include "windef.h"
25 #include "wine/debug.h"
26
27 WINE_DEFAULT_DEBUG_CHANNEL(imagehlp);
28
29 /**********************************************************************/
30
31 HANDLE IMAGEHLP_hHeap = NULL;
32
33 static API_VERSION IMAGEHLP_ApiVersion = { 4, 0, 0, 5 };
34
35 /***********************************************************************
36  *           DllMain (IMAGEHLP.init)
37  */
38 BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
39 {
40   switch(fdwReason)
41     {
42     case DLL_PROCESS_ATTACH:
43       DisableThreadLibraryCalls(hinstDLL);
44       IMAGEHLP_hHeap = HeapCreate(0, 0x10000, 0);
45       break;
46     case DLL_PROCESS_DETACH:
47       HeapDestroy(IMAGEHLP_hHeap);
48       IMAGEHLP_hHeap = NULL;
49       break;
50     default:
51       break;
52     }
53   return TRUE;
54 }
55
56 /***********************************************************************
57  *           ImagehlpApiVersion (IMAGEHLP.@)
58  */
59 PAPI_VERSION WINAPI ImagehlpApiVersion()
60 {
61   return &IMAGEHLP_ApiVersion;
62 }
63
64 /***********************************************************************
65  *           ImagehlpApiVersionEx (IMAGEHLP.@)
66  */
67 PAPI_VERSION WINAPI ImagehlpApiVersionEx(PAPI_VERSION AppVersion)
68 {
69   if(!AppVersion)
70     return NULL;
71
72   AppVersion->MajorVersion = IMAGEHLP_ApiVersion.MajorVersion;
73   AppVersion->MinorVersion = IMAGEHLP_ApiVersion.MinorVersion;
74   AppVersion->Revision = IMAGEHLP_ApiVersion.Revision;
75   AppVersion->Reserved = IMAGEHLP_ApiVersion.Reserved;
76
77   return AppVersion;
78 }
79
80 /***********************************************************************
81  *           MakeSureDirectoryPathExists (IMAGEHLP.@)
82  */
83 BOOL WINAPI MakeSureDirectoryPathExists(LPCSTR DirPath)
84 {
85     if (CreateDirectoryA(DirPath,NULL))
86         return TRUE;
87     if (GetLastError() == ERROR_ALREADY_EXISTS)
88     {
89         SetLastError(ERROR_SUCCESS);
90         return TRUE;
91     }
92     return FALSE;
93 }
94
95 /***********************************************************************
96  *           MarkImageAsRunFromSwap (IMAGEHLP.@)
97  * FIXME
98  *   No documentation available.
99  */
100
101 /***********************************************************************
102  *           SearchTreeForFile (IMAGEHLP.@)
103  */
104 BOOL WINAPI SearchTreeForFile(
105   LPSTR RootPath, LPSTR InputPathName, LPSTR OutputPathBuffer)
106 {
107   FIXME("(%s, %s, %s): stub\n",
108     debugstr_a(RootPath), debugstr_a(InputPathName),
109     debugstr_a(OutputPathBuffer)
110   );
111   SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
112   return FALSE;
113 }
114
115 /***********************************************************************
116  *           TouchFileTimes (IMAGEHLP.@)
117  */
118 BOOL WINAPI TouchFileTimes(
119   HANDLE FileHandle, LPSYSTEMTIME lpSystemTime)
120 {
121   FIXME("(%p, %p): stub\n",
122     FileHandle, lpSystemTime
123   );
124   SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
125   return FALSE;
126 }