FreeRDP
wtsapi.c File Reference
#include <winpr/crt.h>
#include <winpr/ini.h>
#include <winpr/path.h>
#include <winpr/synch.h>
#include <winpr/library.h>
#include <winpr/environment.h>
#include <winpr/wtsapi.h>
#include "../log.h"

Macros

#define TAG   WINPR_TAG("wtsapi")
 
#define WTSAPI32_LOAD_PROC(_name, _type)   WtsApi32_WtsApiFunctionTable.p ## _name = (## _type) GetProcAddress(g_WtsApi32Module, "WTS" #_name);
 
#define WTSAPI_STUB_CALL_VOID(_name, ...)
 
#define WTSAPI_STUB_CALL_BOOL(_name, ...)
 
#define WTSAPI_STUB_CALL_HANDLE(_name, ...)
 
#define FREERDS_LIBRARY_NAME   "libfreerds-fdsapi.so"
 

Functions

BOOL WtsApi32_InitializeWtsApi (void)
 
static BOOL CALLBACK InitializeWtsApiStubs (PINIT_ONCE once, PVOID param, PVOID *context)
 
BOOL WINAPI WTSStartRemoteControlSessionW (LPWSTR pTargetServerName, ULONG TargetLogonId, BYTE HotkeyVk, USHORT HotkeyModifiers)
 
BOOL WINAPI WTSStartRemoteControlSessionA (LPSTR pTargetServerName, ULONG TargetLogonId, BYTE HotkeyVk, USHORT HotkeyModifiers)
 
BOOL WINAPI WTSStartRemoteControlSessionExW (LPWSTR pTargetServerName, ULONG TargetLogonId, BYTE HotkeyVk, USHORT HotkeyModifiers, DWORD flags)
 
BOOL WINAPI WTSStartRemoteControlSessionExA (LPSTR pTargetServerName, ULONG TargetLogonId, BYTE HotkeyVk, USHORT HotkeyModifiers, DWORD flags)
 
BOOL WINAPI WTSStopRemoteControlSession (ULONG LogonId)
 
BOOL WINAPI WTSConnectSessionW (ULONG LogonId, ULONG TargetLogonId, PWSTR pPassword, BOOL bWait)
 
BOOL WINAPI WTSConnectSessionA (ULONG LogonId, ULONG TargetLogonId, PSTR pPassword, BOOL bWait)
 
BOOL WINAPI WTSEnumerateServersW (LPWSTR pDomainName, DWORD Reserved, DWORD Version, PWTS_SERVER_INFOW *ppServerInfo, DWORD *pCount)
 
BOOL WINAPI WTSEnumerateServersA (LPSTR pDomainName, DWORD Reserved, DWORD Version, PWTS_SERVER_INFOA *ppServerInfo, DWORD *pCount)
 
HANDLE WINAPI WTSOpenServerW (LPWSTR pServerName)
 
HANDLE WINAPI WTSOpenServerA (LPSTR pServerName)
 
HANDLE WINAPI WTSOpenServerExW (LPWSTR pServerName)
 
HANDLE WINAPI WTSOpenServerExA (LPSTR pServerName)
 
VOID WINAPI WTSCloseServer (HANDLE hServer)
 
BOOL WINAPI WTSEnumerateSessionsW (HANDLE hServer, DWORD Reserved, DWORD Version, PWTS_SESSION_INFOW *ppSessionInfo, DWORD *pCount)
 
BOOL WINAPI WTSEnumerateSessionsA (HANDLE hServer, DWORD Reserved, DWORD Version, PWTS_SESSION_INFOA *ppSessionInfo, DWORD *pCount)
 
BOOL WINAPI WTSEnumerateSessionsExW (HANDLE hServer, DWORD *pLevel, DWORD Filter, PWTS_SESSION_INFO_1W *ppSessionInfo, DWORD *pCount)
 
BOOL WINAPI WTSEnumerateSessionsExA (HANDLE hServer, DWORD *pLevel, DWORD Filter, PWTS_SESSION_INFO_1A *ppSessionInfo, DWORD *pCount)
 
BOOL WINAPI WTSEnumerateProcessesW (HANDLE hServer, DWORD Reserved, DWORD Version, PWTS_PROCESS_INFOW *ppProcessInfo, DWORD *pCount)
 
BOOL WINAPI WTSEnumerateProcessesA (HANDLE hServer, DWORD Reserved, DWORD Version, PWTS_PROCESS_INFOA *ppProcessInfo, DWORD *pCount)
 
BOOL WINAPI WTSTerminateProcess (HANDLE hServer, DWORD ProcessId, DWORD ExitCode)
 
BOOL WINAPI WTSQuerySessionInformationW (HANDLE hServer, DWORD SessionId, WTS_INFO_CLASS WTSInfoClass, LPWSTR *ppBuffer, DWORD *pBytesReturned)
 
BOOL WINAPI WTSQuerySessionInformationA (HANDLE hServer, DWORD SessionId, WTS_INFO_CLASS WTSInfoClass, LPSTR *ppBuffer, DWORD *pBytesReturned)
 
BOOL WINAPI WTSQueryUserConfigW (LPWSTR pServerName, LPWSTR pUserName, WTS_CONFIG_CLASS WTSConfigClass, LPWSTR *ppBuffer, DWORD *pBytesReturned)
 
BOOL WINAPI WTSQueryUserConfigA (LPSTR pServerName, LPSTR pUserName, WTS_CONFIG_CLASS WTSConfigClass, LPSTR *ppBuffer, DWORD *pBytesReturned)
 
BOOL WINAPI WTSSetUserConfigW (LPWSTR pServerName, LPWSTR pUserName, WTS_CONFIG_CLASS WTSConfigClass, LPWSTR pBuffer, DWORD DataLength)
 
BOOL WINAPI WTSSetUserConfigA (LPSTR pServerName, LPSTR pUserName, WTS_CONFIG_CLASS WTSConfigClass, LPSTR pBuffer, DWORD DataLength)
 
BOOL WINAPI WTSSendMessageW (HANDLE hServer, DWORD SessionId, LPWSTR pTitle, DWORD TitleLength, LPWSTR pMessage, DWORD MessageLength, DWORD Style, DWORD Timeout, DWORD *pResponse, BOOL bWait)
 
BOOL WINAPI WTSSendMessageA (HANDLE hServer, DWORD SessionId, LPSTR pTitle, DWORD TitleLength, LPSTR pMessage, DWORD MessageLength, DWORD Style, DWORD Timeout, DWORD *pResponse, BOOL bWait)
 
BOOL WINAPI WTSDisconnectSession (HANDLE hServer, DWORD SessionId, BOOL bWait)
 
BOOL WINAPI WTSLogoffSession (HANDLE hServer, DWORD SessionId, BOOL bWait)
 
BOOL WINAPI WTSShutdownSystem (HANDLE hServer, DWORD ShutdownFlag)
 
BOOL WINAPI WTSWaitSystemEvent (HANDLE hServer, DWORD EventMask, DWORD *pEventFlags)
 
HANDLE WINAPI WTSVirtualChannelOpen (HANDLE hServer, DWORD SessionId, LPSTR pVirtualName)
 
HANDLE WINAPI WTSVirtualChannelOpenEx (DWORD SessionId, LPSTR pVirtualName, DWORD flags)
 
BOOL WINAPI WTSVirtualChannelClose (HANDLE hChannelHandle)
 
BOOL WINAPI WTSVirtualChannelRead (HANDLE hChannelHandle, ULONG TimeOut, PCHAR Buffer, ULONG BufferSize, PULONG pBytesRead)
 
BOOL WINAPI WTSVirtualChannelWrite (HANDLE hChannelHandle, PCHAR Buffer, ULONG Length, PULONG pBytesWritten)
 
BOOL WINAPI WTSVirtualChannelPurgeInput (HANDLE hChannelHandle)
 
BOOL WINAPI WTSVirtualChannelPurgeOutput (HANDLE hChannelHandle)
 
BOOL WINAPI WTSVirtualChannelQuery (HANDLE hChannelHandle, WTS_VIRTUAL_CLASS WtsVirtualClass, PVOID *ppBuffer, DWORD *pBytesReturned)
 
VOID WINAPI WTSFreeMemory (PVOID pMemory)
 
BOOL WINAPI WTSFreeMemoryExW (WTS_TYPE_CLASS WTSTypeClass, PVOID pMemory, ULONG NumberOfEntries)
 
BOOL WINAPI WTSFreeMemoryExA (WTS_TYPE_CLASS WTSTypeClass, PVOID pMemory, ULONG NumberOfEntries)
 
BOOL WINAPI WTSRegisterSessionNotification (HWND hWnd, DWORD dwFlags)
 
BOOL WINAPI WTSUnRegisterSessionNotification (HWND hWnd)
 
BOOL WINAPI WTSRegisterSessionNotificationEx (HANDLE hServer, HWND hWnd, DWORD dwFlags)
 
BOOL WINAPI WTSUnRegisterSessionNotificationEx (HANDLE hServer, HWND hWnd)
 
BOOL WINAPI WTSQueryUserToken (ULONG SessionId, PHANDLE phToken)
 
BOOL WINAPI WTSEnumerateProcessesExW (HANDLE hServer, DWORD *pLevel, DWORD SessionId, LPWSTR *ppProcessInfo, DWORD *pCount)
 
BOOL WINAPI WTSEnumerateProcessesExA (HANDLE hServer, DWORD *pLevel, DWORD SessionId, LPSTR *ppProcessInfo, DWORD *pCount)
 
BOOL WINAPI WTSEnumerateListenersW (HANDLE hServer, PVOID pReserved, DWORD Reserved, PWTSLISTENERNAMEW pListeners, DWORD *pCount)
 
BOOL WINAPI WTSEnumerateListenersA (HANDLE hServer, PVOID pReserved, DWORD Reserved, PWTSLISTENERNAMEA pListeners, DWORD *pCount)
 
BOOL WINAPI WTSQueryListenerConfigW (HANDLE hServer, PVOID pReserved, DWORD Reserved, LPWSTR pListenerName, PWTSLISTENERCONFIGW pBuffer)
 
BOOL WINAPI WTSQueryListenerConfigA (HANDLE hServer, PVOID pReserved, DWORD Reserved, LPSTR pListenerName, PWTSLISTENERCONFIGA pBuffer)
 
BOOL WINAPI WTSCreateListenerW (HANDLE hServer, PVOID pReserved, DWORD Reserved, LPWSTR pListenerName, PWTSLISTENERCONFIGW pBuffer, DWORD flag)
 
BOOL WINAPI WTSCreateListenerA (HANDLE hServer, PVOID pReserved, DWORD Reserved, LPSTR pListenerName, PWTSLISTENERCONFIGA pBuffer, DWORD flag)
 
BOOL WINAPI WTSSetListenerSecurityW (HANDLE hServer, PVOID pReserved, DWORD Reserved, LPWSTR pListenerName, SECURITY_INFORMATION SecurityInformation, PSECURITY_DESCRIPTOR pSecurityDescriptor)
 
BOOL WINAPI WTSSetListenerSecurityA (HANDLE hServer, PVOID pReserved, DWORD Reserved, LPSTR pListenerName, SECURITY_INFORMATION SecurityInformation, PSECURITY_DESCRIPTOR pSecurityDescriptor)
 
BOOL WINAPI WTSGetListenerSecurityW (HANDLE hServer, PVOID pReserved, DWORD Reserved, LPWSTR pListenerName, SECURITY_INFORMATION SecurityInformation, PSECURITY_DESCRIPTOR pSecurityDescriptor, DWORD nLength, LPDWORD lpnLengthNeeded)
 
BOOL WINAPI WTSGetListenerSecurityA (HANDLE hServer, PVOID pReserved, DWORD Reserved, LPSTR pListenerName, SECURITY_INFORMATION SecurityInformation, PSECURITY_DESCRIPTOR pSecurityDescriptor, DWORD nLength, LPDWORD lpnLengthNeeded)
 
BOOL CDECL WTSEnableChildSessions (BOOL bEnable)
 
BOOL CDECL WTSIsChildSessionsEnabled (PBOOL pbEnabled)
 
BOOL CDECL WTSGetChildSessionId (PULONG pSessionId)
 
BOOL CDECL WTSLogonUser (HANDLE hServer, LPCSTR username, LPCSTR password, LPCSTR domain)
 
BOOL CDECL WTSLogoffUser (HANDLE hServer)
 
DWORD WINAPI WTSGetActiveConsoleSessionId (void)
 
const CHAR * WTSErrorToString (UINT error)
 
const CHAR * WTSSessionStateToString (WTS_CONNECTSTATE_CLASS state)
 
BOOL WTSRegisterWtsApiFunctionTable (PWtsApiFunctionTable table)
 
static BOOL LoadAndInitialize (char *library)
 
static void InitializeWtsApiStubs_Env ()
 
static void InitializeWtsApiStubs_FreeRDS ()
 

Variables

static HMODULE g_WtsApiModule = NULL
 
static PWtsApiFunctionTable g_WtsApi = NULL
 
static HMODULE g_WtsApi32Module = NULL
 
static WtsApiFunctionTable WtsApi32_WtsApiFunctionTable = { 0 }
 
static INIT_ONCE wtsapiInitOnce = INIT_ONCE_STATIC_INIT
 

Macro Definition Documentation

#define FREERDS_LIBRARY_NAME   "libfreerds-fdsapi.so"
#define TAG   WINPR_TAG("wtsapi")

WinPR: Windows Portable Runtime Windows Terminal Services API

Copyright 2013 Marc-Andre Moreau marca.nosp@m.ndre.nosp@m..more.nosp@m.au@g.nosp@m.mail..nosp@m.com Copyright 2015 DI (FH) Martin Haimberger marti.nosp@m.n.ha.nosp@m.imber.nosp@m.ger@.nosp@m.thinc.nosp@m.ast..nosp@m.com Copyright 2015 Copyright 2015 Thincast Technologies GmbH

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

#define WTSAPI32_LOAD_PROC (   _name,
  _type 
)    WtsApi32_WtsApiFunctionTable.p ## _name = (## _type) GetProcAddress(g_WtsApi32Module, "WTS" #_name);
#define WTSAPI_STUB_CALL_BOOL (   _name,
  ... 
)
Value:
if (!g_WtsApi || !g_WtsApi->p ## _name) \
return g_WtsApi->p ## _name ( __VA_ARGS__ )
static PWtsApiFunctionTable g_WtsApi
Definition: wtsapi.c:49
return(void *)((char *) buffer-> buffer+buffer->tail)
static INIT_ONCE wtsapiInitOnce
Definition: wtsapi.c:141
#define InitOnceExecuteOnce
Definition: include/winpr/synch.h:322
if availableBytes return NULL
Definition: TPCircularBuffer.h:104
static BOOL CALLBACK InitializeWtsApiStubs(PINIT_ONCE once, PVOID param, PVOID *context)
Definition: wtsapi.c:726
winpr freerdp if(WITH_DEBUG_SYMBOLS AND MSVC AND NOT BUILTIN_CHANNELS AND BUILD_SHARED_LIBS) install(FILES $
Definition: channels/drive/client/CMakeLists.txt:32
#define FALSE
Definition: trio.c:209
#define WTSAPI_STUB_CALL_HANDLE (   _name,
  ... 
)
Value:
if (!g_WtsApi || !g_WtsApi->p ## _name) \
return g_WtsApi->p ## _name ( __VA_ARGS__ )
static PWtsApiFunctionTable g_WtsApi
Definition: wtsapi.c:49
return(void *)((char *) buffer-> buffer+buffer->tail)
static INIT_ONCE wtsapiInitOnce
Definition: wtsapi.c:141
#define InitOnceExecuteOnce
Definition: include/winpr/synch.h:322
if availableBytes return NULL
Definition: TPCircularBuffer.h:104
static BOOL CALLBACK InitializeWtsApiStubs(PINIT_ONCE once, PVOID param, PVOID *context)
Definition: wtsapi.c:726
winpr freerdp if(WITH_DEBUG_SYMBOLS AND MSVC AND NOT BUILTIN_CHANNELS AND BUILD_SHARED_LIBS) install(FILES $
Definition: channels/drive/client/CMakeLists.txt:32
#define WTSAPI_STUB_CALL_VOID (   _name,
  ... 
)
Value:
if (!g_WtsApi || !g_WtsApi->p ## _name) \
g_WtsApi->p ## _name ( __VA_ARGS__ )
static PWtsApiFunctionTable g_WtsApi
Definition: wtsapi.c:49
return(void *)((char *) buffer-> buffer+buffer->tail)
static INIT_ONCE wtsapiInitOnce
Definition: wtsapi.c:141
#define InitOnceExecuteOnce
Definition: include/winpr/synch.h:322
if availableBytes return NULL
Definition: TPCircularBuffer.h:104
static BOOL CALLBACK InitializeWtsApiStubs(PINIT_ONCE once, PVOID param, PVOID *context)
Definition: wtsapi.c:726
winpr freerdp if(WITH_DEBUG_SYMBOLS AND MSVC AND NOT BUILTIN_CHANNELS AND BUILD_SHARED_LIBS) install(FILES $
Definition: channels/drive/client/CMakeLists.txt:32

Function Documentation

static BOOL CALLBACK InitializeWtsApiStubs ( PINIT_ONCE  once,
PVOID  param,
PVOID *  context 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static void InitializeWtsApiStubs_Env ( )
static

Here is the call graph for this function:

Here is the caller graph for this function:

static void InitializeWtsApiStubs_FreeRDS ( )
static

Here is the call graph for this function:

Here is the caller graph for this function:

static BOOL LoadAndInitialize ( char *  library)
static

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL WtsApi32_InitializeWtsApi ( void  )

Here is the call graph for this function:

Here is the caller graph for this function:

VOID WINAPI WTSCloseServer ( HANDLE  hServer)

Here is the caller graph for this function:

BOOL WINAPI WTSConnectSessionA ( ULONG  LogonId,
ULONG  TargetLogonId,
PSTR  pPassword,
BOOL  bWait 
)
BOOL WINAPI WTSConnectSessionW ( ULONG  LogonId,
ULONG  TargetLogonId,
PWSTR  pPassword,
BOOL  bWait 
)
BOOL WINAPI WTSCreateListenerA ( HANDLE  hServer,
PVOID  pReserved,
DWORD  Reserved,
LPSTR  pListenerName,
PWTSLISTENERCONFIGA  pBuffer,
DWORD  flag 
)
BOOL WINAPI WTSCreateListenerW ( HANDLE  hServer,
PVOID  pReserved,
DWORD  Reserved,
LPWSTR  pListenerName,
PWTSLISTENERCONFIGW  pBuffer,
DWORD  flag 
)
BOOL WINAPI WTSDisconnectSession ( HANDLE  hServer,
DWORD  SessionId,
BOOL  bWait 
)

Here is the caller graph for this function:

BOOL CDECL WTSEnableChildSessions ( BOOL  bEnable)

WTSEnableChildSessions, WTSIsChildSessionsEnabled and WTSGetChildSessionId are not explicitly declared as WINAPI like other WTSAPI functions. Since they are declared as extern "C", we explicitly declare them as CDECL.

BOOL WINAPI WTSEnumerateListenersA ( HANDLE  hServer,
PVOID  pReserved,
DWORD  Reserved,
PWTSLISTENERNAMEA  pListeners,
DWORD *  pCount 
)
BOOL WINAPI WTSEnumerateListenersW ( HANDLE  hServer,
PVOID  pReserved,
DWORD  Reserved,
PWTSLISTENERNAMEW  pListeners,
DWORD *  pCount 
)
BOOL WINAPI WTSEnumerateProcessesA ( HANDLE  hServer,
DWORD  Reserved,
DWORD  Version,
PWTS_PROCESS_INFOA *  ppProcessInfo,
DWORD *  pCount 
)

Here is the caller graph for this function:

BOOL WINAPI WTSEnumerateProcessesExA ( HANDLE  hServer,
DWORD *  pLevel,
DWORD  SessionId,
LPSTR *  ppProcessInfo,
DWORD *  pCount 
)
BOOL WINAPI WTSEnumerateProcessesExW ( HANDLE  hServer,
DWORD *  pLevel,
DWORD  SessionId,
LPWSTR *  ppProcessInfo,
DWORD *  pCount 
)
BOOL WINAPI WTSEnumerateProcessesW ( HANDLE  hServer,
DWORD  Reserved,
DWORD  Version,
PWTS_PROCESS_INFOW *  ppProcessInfo,
DWORD *  pCount 
)
BOOL WINAPI WTSEnumerateServersA ( LPSTR  pDomainName,
DWORD  Reserved,
DWORD  Version,
PWTS_SERVER_INFOA *  ppServerInfo,
DWORD *  pCount 
)
BOOL WINAPI WTSEnumerateServersW ( LPWSTR  pDomainName,
DWORD  Reserved,
DWORD  Version,
PWTS_SERVER_INFOW *  ppServerInfo,
DWORD *  pCount 
)
BOOL WINAPI WTSEnumerateSessionsA ( HANDLE  hServer,
DWORD  Reserved,
DWORD  Version,
PWTS_SESSION_INFOA *  ppSessionInfo,
DWORD *  pCount 
)

Here is the caller graph for this function:

BOOL WINAPI WTSEnumerateSessionsExA ( HANDLE  hServer,
DWORD *  pLevel,
DWORD  Filter,
PWTS_SESSION_INFO_1A *  ppSessionInfo,
DWORD *  pCount 
)
BOOL WINAPI WTSEnumerateSessionsExW ( HANDLE  hServer,
DWORD *  pLevel,
DWORD  Filter,
PWTS_SESSION_INFO_1W *  ppSessionInfo,
DWORD *  pCount 
)
BOOL WINAPI WTSEnumerateSessionsW ( HANDLE  hServer,
DWORD  Reserved,
DWORD  Version,
PWTS_SESSION_INFOW *  ppSessionInfo,
DWORD *  pCount 
)
const CHAR* WTSErrorToString ( UINT  error)

Here is the caller graph for this function:

VOID WINAPI WTSFreeMemory ( PVOID  pMemory)

Here is the caller graph for this function:

BOOL WINAPI WTSFreeMemoryExA ( WTS_TYPE_CLASS  WTSTypeClass,
PVOID  pMemory,
ULONG  NumberOfEntries 
)
BOOL WINAPI WTSFreeMemoryExW ( WTS_TYPE_CLASS  WTSTypeClass,
PVOID  pMemory,
ULONG  NumberOfEntries 
)

Here is the caller graph for this function:

DWORD WINAPI WTSGetActiveConsoleSessionId ( void  )

WTSGetActiveConsoleSessionId is declared in WinBase.h and exported by kernel32.dll

Here is the call graph for this function:

BOOL CDECL WTSGetChildSessionId ( PULONG  pSessionId)
BOOL WINAPI WTSGetListenerSecurityA ( HANDLE  hServer,
PVOID  pReserved,
DWORD  Reserved,
LPSTR  pListenerName,
SECURITY_INFORMATION  SecurityInformation,
PSECURITY_DESCRIPTOR  pSecurityDescriptor,
DWORD  nLength,
LPDWORD  lpnLengthNeeded 
)
BOOL WINAPI WTSGetListenerSecurityW ( HANDLE  hServer,
PVOID  pReserved,
DWORD  Reserved,
LPWSTR  pListenerName,
SECURITY_INFORMATION  SecurityInformation,
PSECURITY_DESCRIPTOR  pSecurityDescriptor,
DWORD  nLength,
LPDWORD  lpnLengthNeeded 
)
BOOL CDECL WTSIsChildSessionsEnabled ( PBOOL  pbEnabled)
BOOL WINAPI WTSLogoffSession ( HANDLE  hServer,
DWORD  SessionId,
BOOL  bWait 
)

Here is the caller graph for this function:

BOOL CDECL WTSLogoffUser ( HANDLE  hServer)
BOOL CDECL WTSLogonUser ( HANDLE  hServer,
LPCSTR  username,
LPCSTR  password,
LPCSTR  domain 
)
HANDLE WINAPI WTSOpenServerA ( LPSTR  pServerName)

Here is the caller graph for this function:

HANDLE WINAPI WTSOpenServerExA ( LPSTR  pServerName)
HANDLE WINAPI WTSOpenServerExW ( LPWSTR  pServerName)
HANDLE WINAPI WTSOpenServerW ( LPWSTR  pServerName)
BOOL WINAPI WTSQueryListenerConfigA ( HANDLE  hServer,
PVOID  pReserved,
DWORD  Reserved,
LPSTR  pListenerName,
PWTSLISTENERCONFIGA  pBuffer 
)
BOOL WINAPI WTSQueryListenerConfigW ( HANDLE  hServer,
PVOID  pReserved,
DWORD  Reserved,
LPWSTR  pListenerName,
PWTSLISTENERCONFIGW  pBuffer 
)
BOOL WINAPI WTSQuerySessionInformationA ( HANDLE  hServer,
DWORD  SessionId,
WTS_INFO_CLASS  WTSInfoClass,
LPSTR *  ppBuffer,
DWORD *  pBytesReturned 
)

Here is the caller graph for this function:

BOOL WINAPI WTSQuerySessionInformationW ( HANDLE  hServer,
DWORD  SessionId,
WTS_INFO_CLASS  WTSInfoClass,
LPWSTR *  ppBuffer,
DWORD *  pBytesReturned 
)
BOOL WINAPI WTSQueryUserConfigA ( LPSTR  pServerName,
LPSTR  pUserName,
WTS_CONFIG_CLASS  WTSConfigClass,
LPSTR *  ppBuffer,
DWORD *  pBytesReturned 
)
BOOL WINAPI WTSQueryUserConfigW ( LPWSTR  pServerName,
LPWSTR  pUserName,
WTS_CONFIG_CLASS  WTSConfigClass,
LPWSTR *  ppBuffer,
DWORD *  pBytesReturned 
)
BOOL WINAPI WTSQueryUserToken ( ULONG  SessionId,
PHANDLE  phToken 
)
BOOL WINAPI WTSRegisterSessionNotification ( HWND  hWnd,
DWORD  dwFlags 
)

Here is the caller graph for this function:

BOOL WINAPI WTSRegisterSessionNotificationEx ( HANDLE  hServer,
HWND  hWnd,
DWORD  dwFlags 
)
BOOL WTSRegisterWtsApiFunctionTable ( PWtsApiFunctionTable  table)

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL WINAPI WTSSendMessageA ( HANDLE  hServer,
DWORD  SessionId,
LPSTR  pTitle,
DWORD  TitleLength,
LPSTR  pMessage,
DWORD  MessageLength,
DWORD  Style,
DWORD  Timeout,
DWORD *  pResponse,
BOOL  bWait 
)

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL WINAPI WTSSendMessageW ( HANDLE  hServer,
DWORD  SessionId,
LPWSTR  pTitle,
DWORD  TitleLength,
LPWSTR  pMessage,
DWORD  MessageLength,
DWORD  Style,
DWORD  Timeout,
DWORD *  pResponse,
BOOL  bWait 
)

Here is the call graph for this function:

const CHAR* WTSSessionStateToString ( WTS_CONNECTSTATE_CLASS  state)

Here is the caller graph for this function:

BOOL WINAPI WTSSetListenerSecurityA ( HANDLE  hServer,
PVOID  pReserved,
DWORD  Reserved,
LPSTR  pListenerName,
SECURITY_INFORMATION  SecurityInformation,
PSECURITY_DESCRIPTOR  pSecurityDescriptor 
)
BOOL WINAPI WTSSetListenerSecurityW ( HANDLE  hServer,
PVOID  pReserved,
DWORD  Reserved,
LPWSTR  pListenerName,
SECURITY_INFORMATION  SecurityInformation,
PSECURITY_DESCRIPTOR  pSecurityDescriptor 
)
BOOL WINAPI WTSSetUserConfigA ( LPSTR  pServerName,
LPSTR  pUserName,
WTS_CONFIG_CLASS  WTSConfigClass,
LPSTR  pBuffer,
DWORD  DataLength 
)
BOOL WINAPI WTSSetUserConfigW ( LPWSTR  pServerName,
LPWSTR  pUserName,
WTS_CONFIG_CLASS  WTSConfigClass,
LPWSTR  pBuffer,
DWORD  DataLength 
)
BOOL WINAPI WTSShutdownSystem ( HANDLE  hServer,
DWORD  ShutdownFlag 
)

Here is the caller graph for this function:

BOOL WINAPI WTSStartRemoteControlSessionA ( LPSTR  pTargetServerName,
ULONG  TargetLogonId,
BYTE  HotkeyVk,
USHORT  HotkeyModifiers 
)
BOOL WINAPI WTSStartRemoteControlSessionExA ( LPSTR  pTargetServerName,
ULONG  TargetLogonId,
BYTE  HotkeyVk,
USHORT  HotkeyModifiers,
DWORD  flags 
)
BOOL WINAPI WTSStartRemoteControlSessionExW ( LPWSTR  pTargetServerName,
ULONG  TargetLogonId,
BYTE  HotkeyVk,
USHORT  HotkeyModifiers,
DWORD  flags 
)
BOOL WINAPI WTSStartRemoteControlSessionW ( LPWSTR  pTargetServerName,
ULONG  TargetLogonId,
BYTE  HotkeyVk,
USHORT  HotkeyModifiers 
)
BOOL WINAPI WTSStopRemoteControlSession ( ULONG  LogonId)
BOOL WINAPI WTSTerminateProcess ( HANDLE  hServer,
DWORD  ProcessId,
DWORD  ExitCode 
)

Here is the call graph for this function:

BOOL WINAPI WTSUnRegisterSessionNotification ( HWND  hWnd)

Here is the caller graph for this function:

BOOL WINAPI WTSUnRegisterSessionNotificationEx ( HANDLE  hServer,
HWND  hWnd 
)
BOOL WINAPI WTSVirtualChannelClose ( HANDLE  hChannelHandle)

Here is the caller graph for this function:

HANDLE WINAPI WTSVirtualChannelOpen ( HANDLE  hServer,
DWORD  SessionId,
LPSTR  pVirtualName 
)

Here is the caller graph for this function:

HANDLE WINAPI WTSVirtualChannelOpenEx ( DWORD  SessionId,
LPSTR  pVirtualName,
DWORD  flags 
)

Here is the caller graph for this function:

BOOL WINAPI WTSVirtualChannelPurgeInput ( HANDLE  hChannelHandle)
BOOL WINAPI WTSVirtualChannelPurgeOutput ( HANDLE  hChannelHandle)
BOOL WINAPI WTSVirtualChannelQuery ( HANDLE  hChannelHandle,
WTS_VIRTUAL_CLASS  WtsVirtualClass,
PVOID *  ppBuffer,
DWORD *  pBytesReturned 
)

Here is the caller graph for this function:

BOOL WINAPI WTSVirtualChannelRead ( HANDLE  hChannelHandle,
ULONG  TimeOut,
PCHAR  Buffer,
ULONG  BufferSize,
PULONG  pBytesRead 
)

Here is the caller graph for this function:

BOOL WINAPI WTSVirtualChannelWrite ( HANDLE  hChannelHandle,
PCHAR  Buffer,
ULONG  Length,
PULONG  pBytesWritten 
)

Here is the caller graph for this function:

BOOL WINAPI WTSWaitSystemEvent ( HANDLE  hServer,
DWORD  EventMask,
DWORD *  pEventFlags 
)

Here is the caller graph for this function:

Variable Documentation

PWtsApiFunctionTable g_WtsApi = NULL
static
HMODULE g_WtsApi32Module = NULL
static
HMODULE g_WtsApiModule = NULL
static
WtsApiFunctionTable WtsApi32_WtsApiFunctionTable = { 0 }
static
INIT_ONCE wtsapiInitOnce = INIT_ONCE_STATIC_INIT
static