FreeRDP
TestWtsApiExtraDisconnectSession.c
1 
2 #include <winpr/crt.h>
3 #include <winpr/error.h>
4 #include <winpr/wtsapi.h>
5 
6 int TestWtsApiExtraDisconnectSession(int argc, char* argv[])
7 {
8  WINPR_UNUSED(argc);
9  WINPR_UNUSED(argv);
10 
11  HANDLE hServer = WTS_CURRENT_SERVER_HANDLE;
12  BOOL bSuccess = WTSDisconnectSession(hServer, WTS_CURRENT_SESSION, FALSE);
13 
14  if (!bSuccess)
15  {
16  printf("WTSDisconnectSession failed: %" PRIu32 "\n", GetLastError());
17  return -1;
18  }
19 
20  return 0;
21 }