From 06671a3cbda8b74b350eb14c0fbc23c0a63a7c64 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 1 Apr 2015 16:04:14 +0200 Subject: [PATCH] Windows: Use FORMAT_MESSAGE_IGNORE_INSERTS for qt_error_string(). This will cause FormatMessage() to return messages with placeholders as well even though we do not pass the message parameters (for example: "The operating system cannot run %1." for ERROR_INVALID_ORDINAL). Task-number: QTBUG-43164 Change-Id: Ib95c1c0fabb543bbe4e8ab2bd8f244f73dff5fa4 Reviewed-by: Joerg Bornemann --- src/corelib/global/qglobal.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp index d69b1d346f..eb8dd73727 100644 --- a/src/corelib/global/qglobal.cpp +++ b/src/corelib/global/qglobal.cpp @@ -2988,7 +2988,7 @@ QString qt_error_string(int errorCode) // Retrieve the system error message for the last-error code. # ifndef Q_OS_WINRT wchar_t *string = 0; - FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_FROM_SYSTEM, + FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESSAGE_ALLOCATE_BUFFER, NULL, errorCode, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),