diff --git a/src/xrt/ipc/shared/ipc_utils_windows.cpp b/src/xrt/ipc/shared/ipc_utils_windows.cpp index 97d754535..fba9d5649 100644 --- a/src/xrt/ipc/shared/ipc_utils_windows.cpp +++ b/src/xrt/ipc/shared/ipc_utils_windows.cpp @@ -13,6 +13,9 @@ #include "xrt/xrt_config_os.h" +#include "util/u_windows.h" +#include "util/u_logging.h" + #include "shared/ipc_utils.h" #include "shared/ipc_protocol.h" @@ -21,10 +24,9 @@ #include #include -#include "util/u_logging.h" - #include + /* * * Logging @@ -41,10 +43,7 @@ const char * ipc_winerror(DWORD err) { static char s_buf[4096]; // N.B. Not thread-safe. If needed, use a thread var - if (!FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM, NULL, err, LANG_SYSTEM_DEFAULT, s_buf, sizeof(s_buf), NULL)) { - s_buf[0] = 0; - } - return s_buf; + return u_winerror(s_buf, sizeof(s_buf), err, false); } void