From 298e050b438733d61a86cb8de7b2835c48820710 Mon Sep 17 00:00:00 2001 From: Qian Hong Date: Mon, 10 Mar 2014 11:09:11 +0800 Subject: [PATCH] user32/tests: Skip more winstation tests when no enough privileges. --- dlls/user32/tests/winstation.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/dlls/user32/tests/winstation.c b/dlls/user32/tests/winstation.c index 4f664dd5476..7f91b8b2798 100644 --- a/dlls/user32/tests/winstation.c +++ b/dlls/user32/tests/winstation.c @@ -297,7 +297,8 @@ static BOOL CALLBACK open_window_station_callbackA(LPSTR winsta, LPARAM lp) static void test_enumstations(void) { - BOOL ret; + DWORD ret; + HWINSTA hwinsta; if (0) /* Crashes instead */ { @@ -307,6 +308,15 @@ static void test_enumstations(void) ok(GetLastError() == ERROR_INVALID_PARAMETER, "LastError is set to %08x\n", GetLastError()); } + hwinsta = CreateWindowStationA("winsta_test", 0, WINSTA_ALL_ACCESS, NULL); + ret = GetLastError(); + ok(hwinsta != NULL || ret == ERROR_ACCESS_DENIED, "CreateWindowStation failed (%u)\n", ret); + if (!hwinsta) + { + win_skip("Not enough privileges for CreateWindowStation\n"); + return; + } + SetLastError(0xdeadbeef); ret = EnumWindowStationsA(open_window_station_callbackA, 0x12345); ok(ret == 0x12345, "EnumWindowStationsA returned %x\n", ret);