From b8292666fe2d1f1f8d560574a022a9a3ef2399b5 Mon Sep 17 00:00:00 2001 From: Andrew Eikum Date: Mon, 29 Jan 2018 13:58:39 -0600 Subject: [PATCH] lsteamclient: Fix ISteamHTMLSurface vtable --- lsteamclient/gen_wrapper.py | 7 +++++++ lsteamclient/winISteamHTMLSurface.c | 15 +++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/lsteamclient/gen_wrapper.py b/lsteamclient/gen_wrapper.py index ce2be488..1e3147c1 100755 --- a/lsteamclient/gen_wrapper.py +++ b/lsteamclient/gen_wrapper.py @@ -146,6 +146,11 @@ print_sizes = [] class_versions = {} +def handle_destructor(cfile, classname, winclassname, method): + cfile.write("DEFINE_THISCALL_WRAPPER(%s_destructor, 4)\n" % winclassname) + cfile.write("void __thiscall %s_destructor(%s *_this)\n{/* never called */}\n\n" % (winclassname, winclassname)) + return "destructor" + def handle_method(cfile, classname, winclassname, cppname, method, cpp, cpp_h, existing_methods): used_name = method.spelling idx = '2' @@ -334,6 +339,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(steamclient); for child in children: if child.kind == clang.cindex.CursorKind.CXX_METHOD: methods.append(handle_method(cfile, classnode.spelling, winclassname, cppname, child, cpp, cpp_h, methods)) + elif child.kind == clang.cindex.CursorKind.DESTRUCTOR: + methods.append(handle_destructor(cfile, classnode.spelling, winclassname, child)) cfile.write("extern vtable_ptr %s_vtable;\n\n" % winclassname) cfile.write("#ifndef __GNUC__\n") diff --git a/lsteamclient/winISteamHTMLSurface.c b/lsteamclient/winISteamHTMLSurface.c index baa7c1d4..fd078739 100644 --- a/lsteamclient/winISteamHTMLSurface.c +++ b/lsteamclient/winISteamHTMLSurface.c @@ -20,6 +20,10 @@ typedef struct __winISteamHTMLSurface_STEAMHTMLSURFACE_INTERFACE_VERSION_004 { void *linux_side; } winISteamHTMLSurface_STEAMHTMLSURFACE_INTERFACE_VERSION_004; +DEFINE_THISCALL_WRAPPER(winISteamHTMLSurface_STEAMHTMLSURFACE_INTERFACE_VERSION_004_destructor, 4) +void __thiscall winISteamHTMLSurface_STEAMHTMLSURFACE_INTERFACE_VERSION_004_destructor(winISteamHTMLSurface_STEAMHTMLSURFACE_INTERFACE_VERSION_004 *_this) +{/* never called */} + DEFINE_THISCALL_WRAPPER(winISteamHTMLSurface_STEAMHTMLSURFACE_INTERFACE_VERSION_004_Init, 4) bool __thiscall winISteamHTMLSurface_STEAMHTMLSURFACE_INTERFACE_VERSION_004_Init(winISteamHTMLSurface_STEAMHTMLSURFACE_INTERFACE_VERSION_004 *_this) { @@ -278,6 +282,7 @@ extern vtable_ptr winISteamHTMLSurface_STEAMHTMLSURFACE_INTERFACE_VERSION_004_vt void __asm_dummy_vtables(void) { #endif __ASM_VTABLE(winISteamHTMLSurface_STEAMHTMLSURFACE_INTERFACE_VERSION_004, + VTABLE_ADD_FUNC(winISteamHTMLSurface_STEAMHTMLSURFACE_INTERFACE_VERSION_004_destructor) VTABLE_ADD_FUNC(winISteamHTMLSurface_STEAMHTMLSURFACE_INTERFACE_VERSION_004_Init) VTABLE_ADD_FUNC(winISteamHTMLSurface_STEAMHTMLSURFACE_INTERFACE_VERSION_004_Shutdown) VTABLE_ADD_FUNC(winISteamHTMLSurface_STEAMHTMLSURFACE_INTERFACE_VERSION_004_CreateBrowser) @@ -335,6 +340,10 @@ typedef struct __winISteamHTMLSurface_STEAMHTMLSURFACE_INTERFACE_VERSION_003 { void *linux_side; } winISteamHTMLSurface_STEAMHTMLSURFACE_INTERFACE_VERSION_003; +DEFINE_THISCALL_WRAPPER(winISteamHTMLSurface_STEAMHTMLSURFACE_INTERFACE_VERSION_003_destructor, 4) +void __thiscall winISteamHTMLSurface_STEAMHTMLSURFACE_INTERFACE_VERSION_003_destructor(winISteamHTMLSurface_STEAMHTMLSURFACE_INTERFACE_VERSION_003 *_this) +{/* never called */} + DEFINE_THISCALL_WRAPPER(winISteamHTMLSurface_STEAMHTMLSURFACE_INTERFACE_VERSION_003_Init, 4) bool __thiscall winISteamHTMLSurface_STEAMHTMLSURFACE_INTERFACE_VERSION_003_Init(winISteamHTMLSurface_STEAMHTMLSURFACE_INTERFACE_VERSION_003 *_this) { @@ -586,6 +595,7 @@ extern vtable_ptr winISteamHTMLSurface_STEAMHTMLSURFACE_INTERFACE_VERSION_003_vt void __asm_dummy_vtables(void) { #endif __ASM_VTABLE(winISteamHTMLSurface_STEAMHTMLSURFACE_INTERFACE_VERSION_003, + VTABLE_ADD_FUNC(winISteamHTMLSurface_STEAMHTMLSURFACE_INTERFACE_VERSION_003_destructor) VTABLE_ADD_FUNC(winISteamHTMLSurface_STEAMHTMLSURFACE_INTERFACE_VERSION_003_Init) VTABLE_ADD_FUNC(winISteamHTMLSurface_STEAMHTMLSURFACE_INTERFACE_VERSION_003_Shutdown) VTABLE_ADD_FUNC(winISteamHTMLSurface_STEAMHTMLSURFACE_INTERFACE_VERSION_003_CreateBrowser) @@ -642,6 +652,10 @@ typedef struct __winISteamHTMLSurface_STEAMHTMLSURFACE_INTERFACE_VERSION_002 { void *linux_side; } winISteamHTMLSurface_STEAMHTMLSURFACE_INTERFACE_VERSION_002; +DEFINE_THISCALL_WRAPPER(winISteamHTMLSurface_STEAMHTMLSURFACE_INTERFACE_VERSION_002_destructor, 4) +void __thiscall winISteamHTMLSurface_STEAMHTMLSURFACE_INTERFACE_VERSION_002_destructor(winISteamHTMLSurface_STEAMHTMLSURFACE_INTERFACE_VERSION_002 *_this) +{/* never called */} + DEFINE_THISCALL_WRAPPER(winISteamHTMLSurface_STEAMHTMLSURFACE_INTERFACE_VERSION_002_Init, 4) bool __thiscall winISteamHTMLSurface_STEAMHTMLSURFACE_INTERFACE_VERSION_002_Init(winISteamHTMLSurface_STEAMHTMLSURFACE_INTERFACE_VERSION_002 *_this) { @@ -886,6 +900,7 @@ extern vtable_ptr winISteamHTMLSurface_STEAMHTMLSURFACE_INTERFACE_VERSION_002_vt void __asm_dummy_vtables(void) { #endif __ASM_VTABLE(winISteamHTMLSurface_STEAMHTMLSURFACE_INTERFACE_VERSION_002, + VTABLE_ADD_FUNC(winISteamHTMLSurface_STEAMHTMLSURFACE_INTERFACE_VERSION_002_destructor) VTABLE_ADD_FUNC(winISteamHTMLSurface_STEAMHTMLSURFACE_INTERFACE_VERSION_002_Init) VTABLE_ADD_FUNC(winISteamHTMLSurface_STEAMHTMLSURFACE_INTERFACE_VERSION_002_Shutdown) VTABLE_ADD_FUNC(winISteamHTMLSurface_STEAMHTMLSURFACE_INTERFACE_VERSION_002_CreateBrowser)