[PATCH] iphlpapi: call WSASetLastError in NotifyAddrChange/NotifyRouteChange

Hao Peng penghao at linuxdeepin.com
Mon Nov 3 01:27:19 CST 2014


call WSASetLastError in NotifyAddrChange/NotifyRouteChange to make following DEMO code working.

void main()
{
  OVERLAPPED overlap;
  DWORD ret;
    
  HANDLE hand = NULL;
  overlap.hEvent = WSACreateEvent();

  ret = NotifyAddrChange(&hand, &overlap);

  if (ret != NO_ERROR)
  {
    if (WSAGetLastError() != WSA_IO_PENDING)
    {
      printf("NotifyAddrChange error...%d\n", WSAGetLastError());            
      return;
    }
  }

  if ( WaitForSingleObject(overlap.hEvent, INFINITE) == WAIT_OBJECT_0 )
    printf("IP Address table changed..\n");
}

---
 dlls/iphlpapi/iphlpapi_main.c | 57 ++++++++++++++++++++++++++++++++++---------
 1 file changed, 45 insertions(+), 12 deletions(-)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20141103/ee043eff/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-iphlpapi-call-WSASetLastError-in-NotifyAddrChange-Noti.txt
Type: application/octet-stream
Size: 6062 bytes
Desc: not available
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20141103/ee043eff/attachment.obj>


More information about the wine-devel mailing list