ok(hThread!=NULL,"CreateThread failed with error %d\n",GetLastError());
SetLastError(0xdeadbeef);
ret=ImpersonateNamedPipeClient(hPipeServer);
error=GetLastError();
todo_wine
ok(!ret&&(error==ERROR_CANNOT_IMPERSONATE),"ImpersonateNamedPipeClient should have failed with ERROR_CANNOT_IMPERSONATE instead of %d\n",GetLastError());
ret=ConnectNamedPipe(hPipeServer,NULL);
ok(ret||(GetLastError()==ERROR_PIPE_CONNECTED),"ConnectNamedPipe failed with error %d\n",GetLastError());