2 #include <winpr/error.h>
3 #include <winpr/wtsapi.h>
4 #include <winpr/environment.h>
6 int TestWtsApiShutdownSystem(
int argc,
char* argv[])
10 DWORD ShutdownFlag = 0;
16 if (!GetEnvironmentVariableA(
"WTSAPI_LIBRARY", NULL, 0))
18 printf(
"%s: No RDS environment detected, skipping test\n", __func__);
23 hServer = WTS_CURRENT_SERVER_HANDLE;
24 ShutdownFlag = WTS_WSD_SHUTDOWN;
26 bSuccess = WTSShutdownSystem(hServer, ShutdownFlag);
30 printf(
"WTSShutdownSystem failed: %" PRIu32
"\n", GetLastError());