Passing `NULL` or `INVALID_HANDLE_VALUE` into `IcmpCloseHandle` currently causes a segfault on wine, whereas it returns `FALSE` on windows.
It seems FFXIV occasionally does this.
-- v2: iphlpapi: Return FALSE for bad handles in IcmpCloseHandle
From: Marc-Aurel Zent marc_aurel@me.com
--- dlls/iphlpapi/iphlpapi_main.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/dlls/iphlpapi/iphlpapi_main.c b/dlls/iphlpapi/iphlpapi_main.c index 6286c168277..4afe3470630 100644 --- a/dlls/iphlpapi/iphlpapi_main.c +++ b/dlls/iphlpapi/iphlpapi_main.c @@ -4565,7 +4565,12 @@ struct icmp_handle_data */ BOOL WINAPI IcmpCloseHandle( HANDLE handle ) { - struct icmp_handle_data *data = (struct icmp_handle_data *)handle; + struct icmp_handle_data *data; + + if (handle == NULL || handle == INVALID_HANDLE_VALUE) + return FALSE; + + data = (struct icmp_handle_data *)handle;
CloseHandle( data->nsi_device ); heap_free( data );
This merge request was approved by Huw Davies.