From b8788058e5eb87182a013c700cd20c236a144c41 Mon Sep 17 00:00:00 2001 From: clement rouault Date: Mon, 9 May 2022 17:12:26 +0200 Subject: [PATCH] Func parser try to not really on presence of WINAPI to search for io_info prefix on parameters --- ctypes_generation/func_parser.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ctypes_generation/func_parser.py b/ctypes_generation/func_parser.py index c8f665b..8b9385c 100644 --- a/ctypes_generation/func_parser.py +++ b/ctypes_generation/func_parser.py @@ -74,7 +74,12 @@ class WinFuncParser(Parser): def parse_func_arg(self, has_winapi): type_ptr = False - if has_winapi: + next_token = self.peek() + # Try to guess if IO type info are present + # New MSDN format that [in, out] info without any WINAPI indicator + if (has_winapi or + type(next_token) == OpenSquareBracketToken or + type(next_token) == NameToken and (next_token.value in self.known_io_info_type + self.known_io_info_with_param)): self.assert_argument_io_info() arg_type = self.assert_token_type(NameToken) if arg_type.value.upper() == "CONST":