Fix occassionally failing FormatMessage call
Call FormatMessage with the IGNORE_INSERTS flag. Without the flag, the FormatMessage() call will fail when the error message contains inserts (such as %1), as we are not providing any arguments. Various Windows system error messages contain inserts; e.g. error 193. See also: https://devblogs.microsoft.com/oldnewthing/20071128-00/?p=24353
This commit is contained in:
@@ -1066,7 +1066,8 @@ static const wxChar* GetSysErrorMsg(wxChar* szBuf, size_t sizeBuf, unsigned long
|
||||
LPVOID lpMsgBuf;
|
||||
if ( ::FormatMessage
|
||||
(
|
||||
FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
|
||||
FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM |
|
||||
FORMAT_MESSAGE_IGNORE_INSERTS,
|
||||
NULL,
|
||||
nErrCode,
|
||||
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
|
||||
|
Reference in New Issue
Block a user