2014-03-01 09:32:23 +04:00
|
|
|
|
|
|
|
#include <winpr/crt.h>
|
|
|
|
#include <winpr/error.h>
|
|
|
|
#include <winpr/wtsapi.h>
|
|
|
|
|
2015-02-10 20:05:40 +03:00
|
|
|
int TestWtsApiExtraLogoffSession(int argc, char* argv[])
|
2014-03-01 09:32:23 +04:00
|
|
|
{
|
|
|
|
BOOL bSuccess;
|
|
|
|
HANDLE hServer;
|
|
|
|
DWORD sessionId;
|
|
|
|
|
|
|
|
sessionId = 123;
|
|
|
|
hServer = WTS_CURRENT_SERVER_HANDLE;
|
|
|
|
|
2015-02-10 20:05:40 +03:00
|
|
|
bSuccess = WTSLogoffSession(hServer, WTS_CURRENT_SESSION, FALSE);
|
2014-03-01 09:32:23 +04:00
|
|
|
|
|
|
|
if (!bSuccess)
|
|
|
|
{
|
2016-12-14 00:47:08 +03:00
|
|
|
printf("WTSLogoffSession failed: %"PRIu32"\n", GetLastError());
|
2015-02-10 20:05:40 +03:00
|
|
|
return -1;
|
2014-03-01 09:32:23 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|