[PATCH 3/3] iphlpapi: Implement CancelIPChangeNotify.

Hans Leidekker hans at codeweavers.com
Tue May 7 04:14:22 CDT 2013


On Mon, 2013-05-06 at 19:23 -0600, Erich E. Hoover wrote:
> --- a/dlls/iphlpapi/iphlpapi_main.c
> +++ b/dlls/iphlpapi/iphlpapi_main.c
> @@ -210,8 +210,14 @@ DWORD WINAPI AllocateAndGetIpAddrTableFromStack(PMIB_IPADDRTABLE *ppIpAddrTable,
>   */
>  BOOL WINAPI CancelIPChangeNotify(LPOVERLAPPED overlapped)
>  {
> -  FIXME("(overlapped %p): stub\n", overlapped);
> -  return FALSE;
> +    HANDLE handle;
> +
> +    TRACE("(overlapped %p)\n", overlapped);
> +
> +    if (!overlapped)
> +        return FALSE;
> +    handle = (HANDLE) overlapped->u.Pointer;
> +    return TerminateThread(handle, STATUS_CANCELLED);
>  } 

TerminateThread is not the right tool here. If the thread is blocked on the
recv call while being terminated it will leak the netlink socket.

You'd need a way to synchronize the threads, but an overhead of one thread per
caller is rather costly in the first place. This suggests that the server should
poll the socket.





More information about the wine-devel mailing list