Commit 298e050b authored by Qian Hong's avatar Qian Hong Committed by Alexandre Julliard

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

parent 4c062b37
...@@ -297,7 +297,8 @@ static BOOL CALLBACK open_window_station_callbackA(LPSTR winsta, LPARAM lp) ...@@ -297,7 +297,8 @@ static BOOL CALLBACK open_window_station_callbackA(LPSTR winsta, LPARAM lp)
static void test_enumstations(void) static void test_enumstations(void)
{ {
BOOL ret; DWORD ret;
HWINSTA hwinsta;
if (0) /* Crashes instead */ if (0) /* Crashes instead */
{ {
...@@ -307,6 +308,15 @@ static void test_enumstations(void) ...@@ -307,6 +308,15 @@ static void test_enumstations(void)
ok(GetLastError() == ERROR_INVALID_PARAMETER, "LastError is set to %08x\n", GetLastError()); 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); SetLastError(0xdeadbeef);
ret = EnumWindowStationsA(open_window_station_callbackA, 0x12345); ret = EnumWindowStationsA(open_window_station_callbackA, 0x12345);
ok(ret == 0x12345, "EnumWindowStationsA returned %x\n", ret); ok(ret == 0x12345, "EnumWindowStationsA returned %x\n", ret);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment