summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorZackery Spytz <zspytz@gmail.com>2019-09-11 09:39:34 (GMT)
committerSteve Dower <steve.dower@python.org>2019-09-11 09:39:34 (GMT)
commit289c5ea7737e44e3b150532b3498e3d3d4c70d99 (patch)
tree5a4a64123fa06f5b2f7b0e1ae6ad548a95a74e8b /Modules
parent58d61efd4cdece3b026868a66d829001198d29b1 (diff)
downloadcpython-289c5ea7737e44e3b150532b3498e3d3d4c70d99.zip
cpython-289c5ea7737e44e3b150532b3498e3d3d4c70d99.tar.gz
cpython-289c5ea7737e44e3b150532b3498e3d3d4c70d99.tar.bz2
bpo-37445: Include FORMAT_MESSAGE_IGNORE_INSERTS in FormatMessageW() calls (GH-15822)
If FormatMessageW() is passed the FORMAT_MESSAGE_FROM_SYSTEM flag without FORMAT_MESSAGE_IGNORE_INSERTS, it will fail if there are insert sequences in the message definition. (cherry picked from commit a656365)
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_ctypes/callproc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Modules/_ctypes/callproc.c b/Modules/_ctypes/callproc.c
index defcde1..066fefc 100644
--- a/Modules/_ctypes/callproc.c
+++ b/Modules/_ctypes/callproc.c
@@ -242,7 +242,9 @@ static TCHAR *FormatError(DWORD code)
{
TCHAR *lpMsgBuf;
DWORD n;
- n = FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
+ n = FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
+ FORMAT_MESSAGE_FROM_SYSTEM |
+ FORMAT_MESSAGE_IGNORE_INSERTS,
NULL,
code,
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), /* Default language */