user32/tests: Skip more winstation tests when no enough privileges.

This commit is contained in:
Qian Hong 2014-03-10 11:09:11 +08:00 committed by Alexandre Julliard
parent 4c062b3702
commit 298e050b43
1 changed files with 11 additions and 1 deletions

View File

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