summaryrefslogtreecommitdiffstats
path: root/Modules/overlapped.c
diff options
context:
space:
mode:
authorOleg Iarygin <oleg@arhadthedev.net>2022-07-28 22:09:46 (GMT)
committerGitHub <noreply@github.com>2022-07-28 22:09:46 (GMT)
commit26d4af0ba538ea58d7a7fdbcc4471d9b32689b28 (patch)
tree158d7868cdb4987215d3524a3f8a2fdf4fc4ed62 /Modules/overlapped.c
parent38bb2068fe1f51a74b36c46e820abc5f6422cded (diff)
downloadcpython-26d4af0ba538ea58d7a7fdbcc4471d9b32689b28.zip
cpython-26d4af0ba538ea58d7a7fdbcc4471d9b32689b28.tar.gz
cpython-26d4af0ba538ea58d7a7fdbcc4471d9b32689b28.tar.bz2
gh-94512: Fix forced arg format in AC-processed overlapped (GH-94516)
Diffstat (limited to 'Modules/overlapped.c')
-rw-r--r--Modules/overlapped.c28
1 files changed, 17 insertions, 11 deletions
diff --git a/Modules/overlapped.c b/Modules/overlapped.c
index 19d25a5..0cec9ee 100644
--- a/Modules/overlapped.c
+++ b/Modules/overlapped.c
@@ -32,27 +32,33 @@
#define T_HANDLE T_POINTER
/*[python input]
-class OVERLAPPED_converter(CConverter):
- type = 'OVERLAPPED *'
+class pointer_converter(CConverter):
format_unit = '"F_POINTER"'
-class HANDLE_converter(CConverter):
+ def parse_arg(self, argname, displayname):
+ return """
+ {paramname} = PyLong_AsVoidPtr({argname});
+ if (!{paramname} && PyErr_Occurred()) {{{{
+ goto exit;
+ }}}}
+ """.format(argname=argname, paramname=self.parser_name)
+
+class OVERLAPPED_converter(pointer_converter):
+ type = 'OVERLAPPED *'
+
+class HANDLE_converter(pointer_converter):
type = 'HANDLE'
- format_unit = '"F_HANDLE"'
-class ULONG_PTR_converter(CConverter):
+class ULONG_PTR_converter(pointer_converter):
type = 'ULONG_PTR'
- format_unit = '"F_ULONG_PTR"'
-class DWORD_converter(CConverter):
+class DWORD_converter(unsigned_long_converter):
type = 'DWORD'
- format_unit = 'k'
-class BOOL_converter(CConverter):
+class BOOL_converter(int_converter):
type = 'BOOL'
- format_unit = 'i'
[python start generated code]*/
-/*[python end generated code: output=da39a3ee5e6b4b0d input=83bb8c2c2514f2a8]*/
+/*[python end generated code: output=da39a3ee5e6b4b0d input=a19133a9e14fae9c]*/
/*[clinic input]
module _overlapped