Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/user32/tests/winstation.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/dlls/user32/tests/winstation.c b/dlls/user32/tests/winstation.c index aaa51d560ac..233ce966355 100644 --- a/dlls/user32/tests/winstation.c +++ b/dlls/user32/tests/winstation.c @@ -68,7 +68,10 @@ static HDESK initial_desktop; static DWORD CALLBACK thread( LPVOID arg ) { HDESK d1, d2; - HWND hwnd = CreateWindowExA(0,"WinStationClass","test",WS_POPUP,0,0,100,100,GetDesktopWindow(),0,0,0); + HWND hwnd; + BOOL ret; + + hwnd = CreateWindowExA(0,"WinStationClass","test",WS_POPUP,0,0,100,100,GetDesktopWindow(),0,0,0); ok( hwnd != 0, "CreateWindow failed\n" ); d1 = GetThreadDesktop(GetCurrentThreadId()); trace( "thread %p desktop: %p\n", arg, d1 ); @@ -92,9 +95,13 @@ static DWORD CALLBACK thread( LPVOID arg ) "bad last error %d\n", GetLastError() );
DestroyWindow( hwnd ); - ok( SetThreadDesktop( d2 ), "set thread desktop failed\n" ); - d1 = GetThreadDesktop(GetCurrentThreadId()); - ok( d1 == d2, "GetThreadDesktop did not return set desktop %p/%p\n", d1, d2 ); + ret = SetThreadDesktop( d2 ); + ok(ret || broken(!ret) /* < Vista */, "failed to set desktop, error %u\n", GetLastError()); + if (ret) + { + d1 = GetThreadDesktop(GetCurrentThreadId()); + ok( d1 == d2, "GetThreadDesktop did not return set desktop %p/%p\n", d1, d2 ); + } print_object( d2 ); if (arg < (LPVOID)5) {