diff --git a/inc/debug.h b/inc/debug.h
index 1d3e6c4..f7c81d1 100644
--- a/inc/debug.h
+++ b/inc/debug.h
@@ -4,7 +4,7 @@
 #define WIN32_LEAN_AND_MEAN
 #include <windows.h>
 
-int dbg_exception_handler(EXCEPTION_POINTERS* exception);
+LONG WINAPI dbg_exception_handler(EXCEPTION_POINTERS* exception);
 void dbg_counter_start();
 double dbg_counter_stop();
 void dbg_debug_string(const char* format, ...);
diff --git a/src/debug.c b/src/debug.c
index eb5a875..b63c88e 100644
--- a/src/debug.c
+++ b/src/debug.c
@@ -22,7 +22,7 @@ static BOOL g_dbg_log_rotate;
 #ifdef _DEBUG 
 static int g_dbg_crash_count = 0;
 
-int dbg_exception_handler(EXCEPTION_POINTERS* exception)
+LONG WINAPI dbg_exception_handler(EXCEPTION_POINTERS* exception)
 {
     g_dbg_crash_count++;