static void test_enumstations(void) { DWORD ret; HWINSTA hwinsta; if (0) /* Crashes instead */ { SetLastError(0xbabefeed); ret = EnumWindowStationsA(NULL, 0); ok(!ret, "EnumWindowStationsA returned successfully!\n"); 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); ok(GetLastError() == 0xdeadbeef, "LastError is set to %08x\n", GetLastError()); SetLastError(0xdeadbeef); ret = EnumWindowStationsA(window_station_callbackA, 0); ok(!ret, "EnumWindowStationsA returned %x\n", ret); ok(GetLastError() == 0xdeadbeef, "LastError is set to %08x\n", GetLastError()); }
static void test_enumstations(void) { BOOL ret; if (0) /* Crashes instead */ { SetLastError(0xbabefeed); ret = EnumWindowStationsA(NULL, 0); ok(!ret, "EnumWindowStationsA returned successfully!\n"); ok(GetLastError() == ERROR_INVALID_PARAMETER, "LastError is set to %08x\n", GetLastError()); } SetLastError(0xdeadbeef); ret = EnumWindowStationsA(open_window_station_callbackA, 0x12345); ok(ret == 0x12345, "EnumWindowStationsA returned %x\n", ret); ok(GetLastError() == 0xdeadbeef, "LastError is set to %08x\n", GetLastError()); SetLastError(0xdeadbeef); ret = EnumWindowStationsA(window_station_callbackA, 0); ok(!ret, "EnumWindowStationsA returned %x\n", ret); ok(GetLastError() == 0xdeadbeef, "LastError is set to %08x\n", GetLastError()); }