summaryrefslogtreecommitdiffstats
path: root/Modules/overlapped.c
diff options
context:
space:
mode:
authorZackery Spytz <zspytz@gmail.com>2019-09-09 09:20:39 (GMT)
committerSteve Dower <steve.dower@python.org>2019-09-09 09:20:38 (GMT)
commita6563650c835d50f7302971a5b145e94f9d0dc68 (patch)
tree9633cf07c93d183f095a39314b55e59d26b68bcd /Modules/overlapped.c
parent7669cb8b21c7c9cef758609c44017c09d1ce4658 (diff)
downloadcpython-a6563650c835d50f7302971a5b145e94f9d0dc68.zip
cpython-a6563650c835d50f7302971a5b145e94f9d0dc68.tar.gz
cpython-a6563650c835d50f7302971a5b145e94f9d0dc68.tar.bz2
bpo-37445: Include FORMAT_MESSAGE_IGNORE_INSERTS in FormatMessageW() calls (GH-14462)
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.
Diffstat (limited to 'Modules/overlapped.c')
-rw-r--r--Modules/overlapped.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Modules/overlapped.c b/Modules/overlapped.c
index 44a0a5a..52ed0bc 100644
--- a/Modules/overlapped.c
+++ b/Modules/overlapped.c
@@ -500,7 +500,8 @@ overlapped_FormatMessage(PyObject *ignore, PyObject *args)
return NULL;
n = FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER |
- FORMAT_MESSAGE_FROM_SYSTEM,
+ FORMAT_MESSAGE_FROM_SYSTEM |
+ FORMAT_MESSAGE_IGNORE_INSERTS,
NULL,
code,
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),