diff options
author | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2015-04-01 16:04:14 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2015-04-01 14:26:43 +0000 |
commit | 06671a3cbda8b74b350eb14c0fbc23c0a63a7c64 (patch) | |
tree | 7d0f4d3240441a48da6a49e27028075dfb64d444 | |
parent | 5322200076c95ca3db32481e1f035d7785ce88ae (diff) |
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 <joerg.bornemann@theqtcompany.com>
-rw-r--r-- | src/corelib/global/qglobal.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
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), |