iphlpapi: Changed return value of NotifyAddrChange() stub and added test cases. (try 2)

Juan Lang juan.lang at gmail.com
Tue Feb 8 12:06:51 CST 2011

Hi Janne,

+    handle = NULL;
+    ZeroMemory(&overlapped, sizeof(overlapped));
+    overlapped.hEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
+    ret = gNotifyAddrChange(&handle, &overlapped);
+    ok(ret == ERROR_IO_PENDING, "NotifyAddrChange returned %d,
expected ERROR_IO_PENDING\n", ret);
+    ok(handle != INVALID_HANDLE_VALUE, "NotifyAddrChange returned
invalid file handle\n");

This test is safe, but it depends on the caller setting handle to some
value other than INVALID_HANDLE_VALUE.  I think it might be safer to
have NotifyAddrChange set the handle value instead, and to mark the
test todo_wine.  I'm worried that some other app might assume that the
call to NotifyAddrChange succeeded and attempt to do a wait on an
invalid handle value, resulting in a crash.


More information about the wine-devel mailing list