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;
|
|
|
|
|
|
|
|
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)
|
|
|
|
{
|
2019-11-06 17:24:51 +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;
|
|
|
|
}
|