FreeRDP/winpr/libwinpr/wtsapi/test/TestWtsApiExtraStartRemoteSessionEx.c
Bernhard Miklautz 0b902eeb5d wtsapi: add WTSStartRemoteControlSessionEx
WTSStartRemoteControlSession doesn't allow to specify additional flags
therefore add a new extended version WTSStartRemoteControlSessionEx
with an additional "flags" parameter.

The following flags are defined:

REMOTECONTROL_FLAG_DISABLE_KEYBOARD - disable keyboard input
REMOTECONTROL_FLAG_DISABLE_MOUSE    - disable mouse input
REMOTECONTROL_FLAG_DISABLE_INPUT    - disable input (keyboard and mouse)
2015-02-16 12:16:54 +01:00

30 lines
685 B
C

#include <winpr/crt.h>
#include <winpr/error.h>
#include <winpr/wtsapi.h>
#include <winpr/input.h>
#include <winpr/environment.h>
int TestWtsApiExtraStartRemoteSessionEx(int argc, char* argv[])
{
BOOL bSuccess;
ULONG logonId = 0;
char logonIdStr[10];
bSuccess = GetEnvironmentVariable("TEST_SESSION_LOGON_ID", logonIdStr, 10);
if(bSuccess)
{
sscanf(logonIdStr, "%u\n", &logonId);
}
bSuccess = WTSStartRemoteControlSessionEx(NULL, logonId, VK_F10, REMOTECONTROL_KBDSHIFT_HOTKEY|REMOTECONTROL_KBDCTRL_HOTKEY, REMOTECONTROL_FLAG_DISABLE_INPUT);
if (!bSuccess)
{
printf("WTSStartRemoteControlSessionEx failed: %d\n", (int) GetLastError());
return -1;
}
return 0;
}