FreeRDP/winpr/libwinpr/wtsapi/test/TestWtsApiExtraStartRemoteSessionEx.c
Norbert Federa f71b6b46e8 fix string format specifiers
- fixed invalid, missing or additional arguments
- removed all type casts from arguments
- added missing (void*) typecasts for %p arguments
- use inttypes defines where appropriate
2016-12-16 13:48:43 +01:00

30 lines
687 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 = 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;
}