Module: wine Branch: master Commit: 407b01c4c35e07707451d1ae9eb92a9a78be172b URL: https://gitlab.winehq.org/wine/wine/-/commit/407b01c4c35e07707451d1ae9eb92a9...
Author: Piotr Caban piotr@codeweavers.com Date: Tue May 16 13:56:21 2023 +0200
wineps: Implement Wow64 entry points in the Unix library.
---
dlls/wineps.drv/unixlib.c | 52 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+)
diff --git a/dlls/wineps.drv/unixlib.c b/dlls/wineps.drv/unixlib.c index 80331372572..e90d3c31531 100644 --- a/dlls/wineps.drv/unixlib.c +++ b/dlls/wineps.drv/unixlib.c @@ -1742,3 +1742,55 @@ const unixlib_entry_t __wine_unix_call_funcs[] = };
C_ASSERT(ARRAYSIZE(__wine_unix_call_funcs) == unix_funcs_count); + +#ifdef _WIN64 + +typedef ULONG PTR32; + +static NTSTATUS wow64_import_ntf(void *args) +{ + struct + { + PTR32 data; + int size; + } const *params32 = args; + struct import_ntf_params params = { ULongToPtr(params32->data), params32->size }; + + return import_ntf(¶ms); +} + +static NTSTATUS wow64_open_dc(void *args) +{ + struct + { + PTR32 device; + PTR32 devmode; + PTR32 output; + PTR32 def_devmode; + PTR32 hdc; + } *params32 = args; + struct open_dc_params params = + { + ULongToPtr(params32->device), + ULongToPtr(params32->devmode), + ULongToPtr(params32->output), + ULongToPtr(params32->def_devmode), + 0 + }; + NTSTATUS ret; + + ret = open_dc(¶ms); + params32->hdc = PtrToUlong(params.hdc); + return ret; +} + +const unixlib_entry_t __wine_unix_call_wow64_funcs[] = +{ + free_printer_info, + wow64_import_ntf, + wow64_open_dc, +}; + +C_ASSERT(ARRAYSIZE(__wine_unix_call_wow64_funcs) == unix_funcs_count); + +#endif /* _WIN64 */