aboutsummaryrefslogtreecommitdiffstats
path: root/src/libstrongswan/utils
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstrongswan/utils')
-rw-r--r--src/libstrongswan/utils/backtrace.c12
-rw-r--r--src/libstrongswan/utils/utils.c2
-rw-r--r--src/libstrongswan/utils/windows.h4
3 files changed, 13 insertions, 5 deletions
diff --git a/src/libstrongswan/utils/backtrace.c b/src/libstrongswan/utils/backtrace.c
index 3bb163545..65e74160b 100644
--- a/src/libstrongswan/utils/backtrace.c
+++ b/src/libstrongswan/utils/backtrace.c
@@ -33,10 +33,18 @@
#ifdef WIN32
# include <psapi.h>
/* missing in MinGW */
+#ifdef WIN64
+#ifndef GetModuleInformation
WINBOOL K32GetModuleInformation(HANDLE hProcess, HMODULE hModule,
LPMODULEINFO lpmodinfo, DWORD cb);
+#define GetModuleInformation K32GetModuleInformation
+#endif /* !GetModuleInformation */
+#ifndef GetModuleFileNameEx
DWORD K32GetModuleFileNameExA(HANDLE hProcess, HMODULE hModule,
LPTSTR lpFilename, DWORD nSize);
+#define GetModuleFileNameEx K32GetModuleFileNameExA
+#endif /* !GetModuleFileNameEx */
+#endif /* WIN64 */
#endif
typedef struct private_backtrace_t private_backtrace_t;
@@ -525,9 +533,9 @@ METHOD(backtrace_t, log_, void,
if (GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS,
this->frames[i], &module) &&
- K32GetModuleInformation(GetCurrentProcess(), module,
+ GetModuleInformation(GetCurrentProcess(), module,
&info, sizeof(info)) &&
- K32GetModuleFileNameExA(GetCurrentProcess(), module,
+ GetModuleFileNameEx(GetCurrentProcess(), module,
filename, sizeof(filename)))
{
println(file, " %s%s%s @ %p [%p]",
diff --git a/src/libstrongswan/utils/utils.c b/src/libstrongswan/utils/utils.c
index 8ef9a1f33..02a720945 100644
--- a/src/libstrongswan/utils/utils.c
+++ b/src/libstrongswan/utils/utils.c
@@ -247,7 +247,7 @@ static mutex_t *sigint_mutex;
/**
* Control handler to catch ^C
*/
-static BOOL handler(DWORD dwCtrlType)
+static BOOL WINAPI handler(DWORD dwCtrlType)
{
switch (dwCtrlType)
{
diff --git a/src/libstrongswan/utils/windows.h b/src/libstrongswan/utils/windows.h
index b66138644..fd4338455 100644
--- a/src/libstrongswan/utils/windows.h
+++ b/src/libstrongswan/utils/windows.h
@@ -116,14 +116,14 @@ char* strndup(const char *s, size_t n);
* Provided via ws2_32
*/
#ifndef InetNtop
-const char *inet_ntop(int af, const void *src, char *dst, socklen_t size);
+const char WINAPI *inet_ntop(int af, const void *src, char *dst, socklen_t size);
#endif
/**
* Provided via ws2_32
*/
#ifndef InetPton
-int inet_pton(int af, const char *src, void *dst);
+int WINAPI inet_pton(int af, const char *src, void *dst);
#endif
/**