mirror of
https://git.suyu.dev/suyu/Yucom.git
synced 2025-12-21 21:26:03 +01:00
lsteamclient: Use manual methods instead of codegen for callbacks.
CW-Bug-Id: #22729
This commit is contained in:
parent
9183543836
commit
537b4096a5
14 changed files with 208 additions and 146 deletions
|
|
@ -231,6 +231,8 @@ MANUAL_METHODS = {
|
|||
"ISteamClient_BShutdownIfAllPipesClosed": lambda ver, abi: abi == 'w',
|
||||
"ISteamClient_CreateSteamPipe": lambda ver, abi: abi == 'w',
|
||||
"ISteamClient_Set_SteamAPI_CCheckCallbackRegisteredInProcess": lambda ver, abi: abi == 'u' and ver >= 20,
|
||||
|
||||
"ISteamUtils_GetAPICallResult": lambda ver, abi: abi == 'u',
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -995,11 +997,6 @@ def handle_method_c(klass, method, winclassname, cppname, out):
|
|||
for name in names[1:]: out(f' .{name} = {name},\n')
|
||||
out(u' };\n')
|
||||
|
||||
should_gen_callback = "GetAPICallResult" in method.name
|
||||
if should_gen_callback:
|
||||
out(u' int w_callback_len = cubCallback;\n')
|
||||
out(u' void *w_callback = pCallback;\n')
|
||||
|
||||
path_conv_utow = PATH_CONV_METHODS_UTOW.get(f'{klass.name}_{method.spelling}', {})
|
||||
path_conv_wtou = PATH_CONV_METHODS_WTOU.get(f'{klass.name}_{method.spelling}', {})
|
||||
|
||||
|
|
@ -1011,9 +1008,6 @@ def handle_method_c(klass, method, winclassname, cppname, out):
|
|||
|
||||
out(u' TRACE("%p\\n", _this);\n')
|
||||
|
||||
if should_gen_callback:
|
||||
out(u' if (!(params.pCallback = alloc_callback_wtou(iCallbackExpected, w_callback, ¶ms.cubCallback))) return FALSE;\n')
|
||||
|
||||
out(f' {cppname}_{method.name}( ¶ms );\n')
|
||||
|
||||
should_gen_wrapper = not is_manual_method(klass, method, "u") and \
|
||||
|
|
@ -1022,13 +1016,6 @@ def handle_method_c(klass, method, winclassname, cppname, out):
|
|||
if should_gen_wrapper:
|
||||
out(u' params._ret = create_win_interface( pchVersion, params._ret );\n')
|
||||
|
||||
if should_gen_callback:
|
||||
out(u' if (params._ret && params.pCallback != w_callback)\n')
|
||||
out(u' {\n')
|
||||
out(u' convert_callback_utow(iCallbackExpected, params.pCallback, params.cubCallback, w_callback, w_callback_len);\n')
|
||||
out(u' HeapFree(GetProcessHeap(), 0, params.pCallback);\n')
|
||||
out(u' }\n\n')
|
||||
|
||||
for name, conv in filter(lambda x: x[0] in names, path_conv_utow.items()):
|
||||
out(u' ')
|
||||
if "ret_size" in path_conv_utow:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue