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);