From acd7da679a10ee337856b34ca4da6532814237d9 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Sat, 7 Nov 2020 21:02:14 +0100 Subject: [PATCH] Fix DEBUG_OUTPUT Signed-off-by: Simon Rozman --- MemoryModule.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/MemoryModule.c b/MemoryModule.c index 0c5d209..96a0fcb 100644 --- a/MemoryModule.c +++ b/MemoryModule.c @@ -141,13 +141,12 @@ OutputLastError(const char *msg) #ifndef DEBUG_OUTPUT UNREFERENCED_PARAMETER(msg); #else - LPVOID tmp; - char *tmpmsg; - FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, - NULL, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR)&tmp, 0, NULL); + char *tmp, *tmpmsg; + FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, + NULL, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPSTR)&tmp, 0, NULL); tmpmsg = (char *)LocalAlloc(LPTR, strlen(msg) + strlen(tmp) + 3); sprintf(tmpmsg, "%s: %s", msg, tmp); - OutputDebugString(tmpmsg); + OutputDebugStringA(tmpmsg); LocalFree(tmpmsg); LocalFree(tmp); #endif