summaryrefslogtreecommitdiffstats
path: root/winpr/libwinpr/wtsapi/test/TestWtsApiExtraStartRemoteSessionEx.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 01:24:41 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 01:24:41 +0000
commita9bcc81f821d7c66f623779fa5147e728eb3c388 (patch)
tree98676963bcdd537ae5908a067a8eb110b93486a6 /winpr/libwinpr/wtsapi/test/TestWtsApiExtraStartRemoteSessionEx.c
parentInitial commit. (diff)
downloadfreerdp3-a9bcc81f821d7c66f623779fa5147e728eb3c388.tar.xz
freerdp3-a9bcc81f821d7c66f623779fa5147e728eb3c388.zip
Adding upstream version 3.3.0+dfsg1.upstream/3.3.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--winpr/libwinpr/wtsapi/test/TestWtsApiExtraStartRemoteSessionEx.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/winpr/libwinpr/wtsapi/test/TestWtsApiExtraStartRemoteSessionEx.c b/winpr/libwinpr/wtsapi/test/TestWtsApiExtraStartRemoteSessionEx.c
new file mode 100644
index 0000000..179d33b
--- /dev/null
+++ b/winpr/libwinpr/wtsapi/test/TestWtsApiExtraStartRemoteSessionEx.c
@@ -0,0 +1,31 @@
+
+#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 = GetEnvironmentVariableA("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: %" PRIu32 "\n", GetLastError());
+ return -1;
+ }
+
+ return 0;
+}