From: Huw Davies huw@codeweavers.com
Signed-off-by: Huw Davies huw@codeweavers.com --- dlls/nsiproxy.sys/icmp_echo.c | 53 ++++++++++++++++++++++++++++++++ dlls/nsiproxy.sys/nsi.c | 4 +-- dlls/nsiproxy.sys/unix_private.h | 5 +++ 3 files changed, 60 insertions(+), 2 deletions(-)
diff --git a/dlls/nsiproxy.sys/icmp_echo.c b/dlls/nsiproxy.sys/icmp_echo.c index e92fa4394c1..8686abd70ea 100644 --- a/dlls/nsiproxy.sys/icmp_echo.c +++ b/dlls/nsiproxy.sys/icmp_echo.c @@ -794,3 +794,56 @@ NTSTATUS icmp_close( void *args ) handle_free( params->handle ); return STATUS_SUCCESS; } + +#ifdef _WIN64 + +typedef UINT PTR32; + +NTSTATUS wow64_icmp_listen( void *args ) +{ + struct + { + icmp_handle handle; + PTR32 reply; + ULONGLONG user_reply_ptr; + unsigned int bits, reply_len; + int timeout; + } const *params32 = args; + struct icmp_listen_params params = + { + .handle = params32->handle, + .reply = ULongToPtr( params32->reply ), + .user_reply_ptr = params32->user_reply_ptr, + .bits = params32->bits, + .reply_len = params32->reply_len, + .timeout = params32->timeout + }; + return icmp_listen( ¶ms ); +} + +NTSTATUS wow64_icmp_send_echo( void *args ) +{ + struct + { + PTR32 dst; + PTR32 request, reply; + UINT request_size, reply_len; + BYTE bits, ttl, tos; + PTR32 handle; + } const *params32 = args; + struct icmp_send_echo_params params = + { + .dst = ULongToPtr( params32->dst ), + .request = ULongToPtr( params32->request ), + .reply = ULongToPtr( params32->reply ), + .request_size = params32->request_size, + .reply_len = params32->reply_len, + .bits = params32->bits, + .ttl = params32->ttl, + .tos = params32->tos, + .handle = ULongToPtr( params32->handle ) + }; + return icmp_send_echo( ¶ms ); +} + +#endif /* _WIN64 */ diff --git a/dlls/nsiproxy.sys/nsi.c b/dlls/nsiproxy.sys/nsi.c index 84fbf268254..b36d5b607e3 100644 --- a/dlls/nsiproxy.sys/nsi.c +++ b/dlls/nsiproxy.sys/nsi.c @@ -278,8 +278,8 @@ const unixlib_entry_t __wine_unix_call_wow64_funcs[] = { icmp_cancel_listen, icmp_close, - icmp_listen, - icmp_send_echo, + wow64_icmp_listen, + wow64_icmp_send_echo, wow64_nsi_enumerate_all_ex, wow64_nsi_get_all_parameters_ex, wow64_nsi_get_parameter_ex diff --git a/dlls/nsiproxy.sys/unix_private.h b/dlls/nsiproxy.sys/unix_private.h index 8ab56f6d9a3..8595dbf1622 100644 --- a/dlls/nsiproxy.sys/unix_private.h +++ b/dlls/nsiproxy.sys/unix_private.h @@ -161,3 +161,8 @@ NTSTATUS icmp_cancel_listen( void *args ) DECLSPEC_HIDDEN; NTSTATUS icmp_close( void *args ) DECLSPEC_HIDDEN; NTSTATUS icmp_listen( void *args ) DECLSPEC_HIDDEN; NTSTATUS icmp_send_echo( void *args ) DECLSPEC_HIDDEN; + +#ifdef _WIN64 +NTSTATUS wow64_icmp_listen( void *args ) DECLSPEC_HIDDEN; +NTSTATUS wow64_icmp_send_echo( void *args ) DECLSPEC_HIDDEN; +#endif /* _WIN64 */