3 #include <winpr/error.h>
4 #include <winpr/wtsapi.h>
5 #include <winpr/environment.h>
7 int TestWtsApiWaitSystemEvent(
int argc,
char* argv[])
10 HANDLE hServer = NULL;
18 if (!GetEnvironmentVariableA(
"WTSAPI_LIBRARY", NULL, 0))
20 printf(
"%s: No RDS environment detected, skipping test\n", __func__);
25 hServer = WTS_CURRENT_SERVER_HANDLE;
27 eventMask = WTS_EVENT_ALL;
30 bSuccess = WTSWaitSystemEvent(hServer, eventMask, &eventFlags);
34 printf(
"WTSWaitSystemEvent failed: %" PRIu32
"\n", GetLastError());