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.
Thanks, --Juan