Rev 462 | Rev 479 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 462 | Rev 463 | ||
---|---|---|---|
Line 16... | Line 16... | ||
16 | along with this program; if not, write to the Free Software |
16 | along with this program; if not, write to the Free Software |
17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
18 | */ |
18 | */ |
19 | 19 | ||
20 | #include <windows.h> |
20 | #include <windows.h> |
- | 21 | #include <stdio.h> |
|
21 | 22 | ||
22 | #include "compat_win.h" |
23 | #include "compat_win.h" |
23 | #include "compat_win_resource.h" |
24 | #include "compat_win_resource.h" |
24 | 25 | ||
25 | typedef BOOL(__stdcall* f_GetVersionEx)(LPOSVERSIONINFOA lpVersionInformation); |
26 | typedef BOOL(__stdcall* f_GetVersionEx)(LPOSVERSIONINFOA lpVersionInformation); |
Line 153... | Line 154... | ||
153 | f_ImageRemoveCertificate fImageRemoveCertificate; |
154 | f_ImageRemoveCertificate fImageRemoveCertificate; |
154 | BOOL res = FALSE; |
155 | BOOL res = FALSE; |
155 | 156 | ||
156 | #ifndef _WIN64 |
157 | #ifndef _WIN64 |
157 | // Win32s (Windows 3.11) compatibility: LoadLibrary() will output a visual message if IMAGEHLP.DLL is not existing! |
158 | // Win32s (Windows 3.11) compatibility: LoadLibrary() will output a visual message if IMAGEHLP.DLL is not existing! |
- | 159 | char* sys_path; |
|
158 | char sys_path[MAX_PATH], dllfile[MAX_PATH]; |
160 | sys_path = (char*)malloc(MAX_PATH); |
159 | if (GetSystemDirectoryA(sys_path, MAX_PATH)) { |
161 | if (GetSystemDirectoryA(sys_path, MAX_PATH)) { |
- | 162 | char* dllfile; |
|
- | 163 | dllfile = (char*)malloc(MAX_PATH); |
|
- | 164 | if (dllfile) { |
|
160 | sprintf(dllfile, "%s\\IMAGEHLP.DLL", sys_path); |
165 | sprintf(dllfile, "%s\\IMAGEHLP.DLL", sys_path); |
161 | if (GetFileAttributesA(dllfile) == INVALID_FILE_ATTRIBUTES) { |
166 | if (GetFileAttributesA(dllfile) == INVALID_FILE_ATTRIBUTES) { |
162 | // File does not exist |
167 | // File does not exist |
- | 168 | free(dllfile); |
|
163 | return true; |
169 | return true; |
164 | } |
170 | } |
- | 171 | else { |
|
- | 172 | free(dllfile); |
|
- | 173 | } |
|
- | 174 | } |
|
165 | } |
175 | } |
- | 176 | free(sys_path); |
|
166 | #endif |
177 | #endif |
167 | 178 | ||
168 | hLib = LoadLibrary(TEXT("IMAGEHLP.DLL")); |
179 | hLib = LoadLibrary(TEXT("IMAGEHLP.DLL")); |
169 | if (!hLib) return FALSE; |
180 | if (!hLib) return FALSE; |
170 | fImageRemoveCertificate = (f_ImageRemoveCertificate)(void*)GetProcAddress(hLib, "ImageRemoveCertificate"); |
181 | fImageRemoveCertificate = (f_ImageRemoveCertificate)(void*)GetProcAddress(hLib, "ImageRemoveCertificate"); |