FreeRDP
wtsapi.c File Reference
#include <winpr/config.h>
#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 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

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 (const WtsApiFunctionTable *table)
 
static BOOL LoadAndInitialize (char *library)
 
static void InitializeWtsApiStubs_Env (void)
 
static void InitializeWtsApiStubs_FreeRDS (void)
 

Variables

static HMODULE g_WtsApiModule = NULL
 
static const WtsApiFunctionTableg_WtsApi = NULL
 
static INIT_ONCE wtsapiInitOnce = INIT_ONCE_STATIC_INIT
 

Macro Definition Documentation

◆ FREERDS_LIBRARY_NAME

#define FREERDS_LIBRARY_NAME   "libfreerds-fdsapi.so"

◆ TAG

#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.

◆ WTSAPI_STUB_CALL_BOOL

#define WTSAPI_STUB_CALL_BOOL (   _name,
  ... 
)
Value:
if (!g_WtsApi || !g_WtsApi->p##_name) \
return FALSE; \
return g_WtsApi->p##_name(__VA_ARGS__)
if availableBytes return NULL
Definition: TPCircularBuffer.h:109
#define InitOnceExecuteOnce
Definition: include/winpr/synch.h:388
static INIT_ONCE wtsapiInitOnce
Definition: wtsapi.c:143
static BOOL CALLBACK InitializeWtsApiStubs(PINIT_ONCE once, PVOID param, PVOID *context)
Definition: wtsapi.c:782
static const WtsApiFunctionTable * g_WtsApi
Definition: wtsapi.c:47

◆ WTSAPI_STUB_CALL_HANDLE

#define WTSAPI_STUB_CALL_HANDLE (   _name,
  ... 
)
Value:
if (!g_WtsApi || !g_WtsApi->p##_name) \
return NULL; \
return g_WtsApi->p##_name(__VA_ARGS__)

◆ WTSAPI_STUB_CALL_VOID

#define WTSAPI_STUB_CALL_VOID (   _name,
  ... 
)
Value:
if (!g_WtsApi || !g_WtsApi->p##_name) \
return; \
g_WtsApi->p##_name(__VA_ARGS__)

Function Documentation

◆ InitializeWtsApiStubs()

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:

◆ InitializeWtsApiStubs_Env()

static void InitializeWtsApiStubs_Env ( void  )
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ InitializeWtsApiStubs_FreeRDS()

static void InitializeWtsApiStubs_FreeRDS ( void  )
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ LoadAndInitialize()

static BOOL LoadAndInitialize ( char *  library)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ WTSCloseServer()

VOID WINAPI WTSCloseServer ( HANDLE  hServer)
Here is the caller graph for this function:

◆ WTSConnectSessionA()

BOOL WINAPI WTSConnectSessionA ( ULONG  LogonId,
ULONG  TargetLogonId,
PSTR  pPassword,
BOOL  bWait 
)

◆ WTSConnectSessionW()

BOOL WINAPI WTSConnectSessionW ( ULONG  LogonId,
ULONG  TargetLogonId,
PWSTR  pPassword,
BOOL  bWait 
)

◆ WTSCreateListenerA()

BOOL WINAPI WTSCreateListenerA ( HANDLE  hServer,
PVOID  pReserved,
DWORD  Reserved,
LPSTR  pListenerName,
PWTSLISTENERCONFIGA  pBuffer,
DWORD  flag 
)

◆ WTSCreateListenerW()

BOOL WINAPI WTSCreateListenerW ( HANDLE  hServer,
PVOID  pReserved,
DWORD  Reserved,
LPWSTR  pListenerName,
PWTSLISTENERCONFIGW  pBuffer,
DWORD  flag 
)

◆ WTSDisconnectSession()

BOOL WINAPI WTSDisconnectSession ( HANDLE  hServer,
DWORD  SessionId,
BOOL  bWait 
)
Here is the caller graph for this function:

◆ WTSEnableChildSessions()

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.

Here is the caller graph for this function:

◆ WTSEnumerateListenersA()

BOOL WINAPI WTSEnumerateListenersA ( HANDLE  hServer,
PVOID  pReserved,
DWORD  Reserved,
PWTSLISTENERNAMEA  pListeners,
DWORD *  pCount 
)

◆ WTSEnumerateListenersW()

BOOL WINAPI WTSEnumerateListenersW ( HANDLE  hServer,
PVOID  pReserved,
DWORD  Reserved,
PWTSLISTENERNAMEW  pListeners,
DWORD *  pCount 
)

◆ WTSEnumerateProcessesA()

BOOL WINAPI WTSEnumerateProcessesA ( HANDLE  hServer,
DWORD  Reserved,
DWORD  Version,
PWTS_PROCESS_INFOA ppProcessInfo,
DWORD *  pCount 
)
Here is the caller graph for this function:

◆ WTSEnumerateProcessesExA()

BOOL WINAPI WTSEnumerateProcessesExA ( HANDLE  hServer,
DWORD *  pLevel,
DWORD  SessionId,
LPSTR *  ppProcessInfo,
DWORD *  pCount 
)

◆ WTSEnumerateProcessesExW()

BOOL WINAPI WTSEnumerateProcessesExW ( HANDLE  hServer,
DWORD *  pLevel,
DWORD  SessionId,
LPWSTR *  ppProcessInfo,
DWORD *  pCount 
)

◆ WTSEnumerateProcessesW()

BOOL WINAPI WTSEnumerateProcessesW ( HANDLE  hServer,
DWORD  Reserved,
DWORD  Version,
PWTS_PROCESS_INFOW ppProcessInfo,
DWORD *  pCount 
)

◆ WTSEnumerateServersA()

BOOL WINAPI WTSEnumerateServersA ( LPSTR  pDomainName,
DWORD  Reserved,
DWORD  Version,
PWTS_SERVER_INFOA ppServerInfo,
DWORD *  pCount 
)

◆ WTSEnumerateServersW()

BOOL WINAPI WTSEnumerateServersW ( LPWSTR  pDomainName,
DWORD  Reserved,
DWORD  Version,
PWTS_SERVER_INFOW ppServerInfo,
DWORD *  pCount 
)

◆ WTSEnumerateSessionsA()

BOOL WINAPI WTSEnumerateSessionsA ( HANDLE  hServer,
DWORD  Reserved,
DWORD  Version,
PWTS_SESSION_INFOA ppSessionInfo,
DWORD *  pCount 
)
Here is the caller graph for this function:

◆ WTSEnumerateSessionsExA()

BOOL WINAPI WTSEnumerateSessionsExA ( HANDLE  hServer,
DWORD *  pLevel,
DWORD  Filter,
PWTS_SESSION_INFO_1A ppSessionInfo,
DWORD *  pCount 
)

◆ WTSEnumerateSessionsExW()

BOOL WINAPI WTSEnumerateSessionsExW ( HANDLE  hServer,
DWORD *  pLevel,
DWORD  Filter,
PWTS_SESSION_INFO_1W ppSessionInfo,
DWORD *  pCount 
)

◆ WTSEnumerateSessionsW()

BOOL WINAPI WTSEnumerateSessionsW ( HANDLE  hServer,
DWORD  Reserved,
DWORD  Version,
PWTS_SESSION_INFOW ppSessionInfo,
DWORD *  pCount 
)

◆ WTSErrorToString()

const CHAR* WTSErrorToString ( UINT  error)
Here is the caller graph for this function:

◆ WTSFreeMemory()

VOID WINAPI WTSFreeMemory ( PVOID  pMemory)
Here is the caller graph for this function:

◆ WTSFreeMemoryExA()

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

◆ WTSFreeMemoryExW()

BOOL WINAPI WTSFreeMemoryExW ( WTS_TYPE_CLASS  WTSTypeClass,
PVOID  pMemory,
ULONG  NumberOfEntries 
)
Here is the caller graph for this function:

◆ WTSGetActiveConsoleSessionId()

DWORD WINAPI WTSGetActiveConsoleSessionId ( void  )

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

Here is the call graph for this function:

◆ WTSGetChildSessionId()

BOOL CDECL WTSGetChildSessionId ( PULONG  pSessionId)

◆ WTSGetListenerSecurityA()

BOOL WINAPI WTSGetListenerSecurityA ( HANDLE  hServer,
PVOID  pReserved,
DWORD  Reserved,
LPSTR  pListenerName,
SECURITY_INFORMATION  SecurityInformation,
PSECURITY_DESCRIPTOR  pSecurityDescriptor,
DWORD  nLength,
LPDWORD  lpnLengthNeeded 
)

◆ WTSGetListenerSecurityW()

BOOL WINAPI WTSGetListenerSecurityW ( HANDLE  hServer,
PVOID  pReserved,
DWORD  Reserved,
LPWSTR  pListenerName,
SECURITY_INFORMATION  SecurityInformation,
PSECURITY_DESCRIPTOR  pSecurityDescriptor,
DWORD  nLength,
LPDWORD  lpnLengthNeeded 
)

◆ WTSIsChildSessionsEnabled()

BOOL CDECL WTSIsChildSessionsEnabled ( PBOOL  pbEnabled)
Here is the caller graph for this function:

◆ WTSLogoffSession()

BOOL WINAPI WTSLogoffSession ( HANDLE  hServer,
DWORD  SessionId,
BOOL  bWait 
)
Here is the caller graph for this function:

◆ WTSLogoffUser()

BOOL CDECL WTSLogoffUser ( HANDLE  hServer)

◆ WTSLogonUser()

BOOL CDECL WTSLogonUser ( HANDLE  hServer,
LPCSTR  username,
LPCSTR  password,
LPCSTR  domain 
)

◆ WTSOpenServerA()

HANDLE WINAPI WTSOpenServerA ( LPSTR  pServerName)
Here is the caller graph for this function:

◆ WTSOpenServerExA()

HANDLE WINAPI WTSOpenServerExA ( LPSTR  pServerName)

◆ WTSOpenServerExW()

HANDLE WINAPI WTSOpenServerExW ( LPWSTR  pServerName)

◆ WTSOpenServerW()

HANDLE WINAPI WTSOpenServerW ( LPWSTR  pServerName)

◆ WTSQueryListenerConfigA()

BOOL WINAPI WTSQueryListenerConfigA ( HANDLE  hServer,
PVOID  pReserved,
DWORD  Reserved,
LPSTR  pListenerName,
PWTSLISTENERCONFIGA  pBuffer 
)

◆ WTSQueryListenerConfigW()

BOOL WINAPI WTSQueryListenerConfigW ( HANDLE  hServer,
PVOID  pReserved,
DWORD  Reserved,
LPWSTR  pListenerName,
PWTSLISTENERCONFIGW  pBuffer 
)

◆ WTSQuerySessionInformationA()

BOOL WINAPI WTSQuerySessionInformationA ( HANDLE  hServer,
DWORD  SessionId,
WTS_INFO_CLASS  WTSInfoClass,
LPSTR *  ppBuffer,
DWORD *  pBytesReturned 
)
Here is the caller graph for this function:

◆ WTSQuerySessionInformationW()

BOOL WINAPI WTSQuerySessionInformationW ( HANDLE  hServer,
DWORD  SessionId,
WTS_INFO_CLASS  WTSInfoClass,
LPWSTR *  ppBuffer,
DWORD *  pBytesReturned 
)

◆ WTSQueryUserConfigA()

BOOL WINAPI WTSQueryUserConfigA ( LPSTR  pServerName,
LPSTR  pUserName,
WTS_CONFIG_CLASS  WTSConfigClass,
LPSTR *  ppBuffer,
DWORD *  pBytesReturned 
)

◆ WTSQueryUserConfigW()

BOOL WINAPI WTSQueryUserConfigW ( LPWSTR  pServerName,
LPWSTR  pUserName,
WTS_CONFIG_CLASS  WTSConfigClass,
LPWSTR *  ppBuffer,
DWORD *  pBytesReturned 
)

◆ WTSQueryUserToken()

BOOL WINAPI WTSQueryUserToken ( ULONG  SessionId,
PHANDLE  phToken 
)

◆ WTSRegisterSessionNotification()

BOOL WINAPI WTSRegisterSessionNotification ( HWND  hWnd,
DWORD  dwFlags 
)
Here is the caller graph for this function:

◆ WTSRegisterSessionNotificationEx()

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

◆ WTSRegisterWtsApiFunctionTable()

BOOL WTSRegisterWtsApiFunctionTable ( const WtsApiFunctionTable table)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ WTSSendMessageA()

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 caller graph for this function:

◆ WTSSendMessageW()

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

◆ WTSSessionStateToString()

const CHAR* WTSSessionStateToString ( WTS_CONNECTSTATE_CLASS  state)
Here is the caller graph for this function:

◆ WTSSetListenerSecurityA()

BOOL WINAPI WTSSetListenerSecurityA ( HANDLE  hServer,
PVOID  pReserved,
DWORD  Reserved,
LPSTR  pListenerName,
SECURITY_INFORMATION  SecurityInformation,
PSECURITY_DESCRIPTOR  pSecurityDescriptor 
)

◆ WTSSetListenerSecurityW()

BOOL WINAPI WTSSetListenerSecurityW ( HANDLE  hServer,
PVOID  pReserved,
DWORD  Reserved,
LPWSTR  pListenerName,
SECURITY_INFORMATION  SecurityInformation,
PSECURITY_DESCRIPTOR  pSecurityDescriptor 
)

◆ WTSSetUserConfigA()

BOOL WINAPI WTSSetUserConfigA ( LPSTR  pServerName,
LPSTR  pUserName,
WTS_CONFIG_CLASS  WTSConfigClass,
LPSTR  pBuffer,
DWORD  DataLength 
)

◆ WTSSetUserConfigW()

BOOL WINAPI WTSSetUserConfigW ( LPWSTR  pServerName,
LPWSTR  pUserName,
WTS_CONFIG_CLASS  WTSConfigClass,
LPWSTR  pBuffer,
DWORD  DataLength 
)

◆ WTSShutdownSystem()

BOOL WINAPI WTSShutdownSystem ( HANDLE  hServer,
DWORD  ShutdownFlag 
)
Here is the caller graph for this function:

◆ WTSStartRemoteControlSessionA()

BOOL WINAPI WTSStartRemoteControlSessionA ( LPSTR  pTargetServerName,
ULONG  TargetLogonId,
BYTE  HotkeyVk,
USHORT  HotkeyModifiers 
)

◆ WTSStartRemoteControlSessionExA()

BOOL WINAPI WTSStartRemoteControlSessionExA ( LPSTR  pTargetServerName,
ULONG  TargetLogonId,
BYTE  HotkeyVk,
USHORT  HotkeyModifiers,
DWORD  flags 
)

◆ WTSStartRemoteControlSessionExW()

BOOL WINAPI WTSStartRemoteControlSessionExW ( LPWSTR  pTargetServerName,
ULONG  TargetLogonId,
BYTE  HotkeyVk,
USHORT  HotkeyModifiers,
DWORD  flags 
)

◆ WTSStartRemoteControlSessionW()

BOOL WINAPI WTSStartRemoteControlSessionW ( LPWSTR  pTargetServerName,
ULONG  TargetLogonId,
BYTE  HotkeyVk,
USHORT  HotkeyModifiers 
)

◆ WTSStopRemoteControlSession()

BOOL WINAPI WTSStopRemoteControlSession ( ULONG  LogonId)

◆ WTSTerminateProcess()

BOOL WINAPI WTSTerminateProcess ( HANDLE  hServer,
DWORD  ProcessId,
DWORD  ExitCode 
)
Here is the call graph for this function:

◆ WTSUnRegisterSessionNotification()

BOOL WINAPI WTSUnRegisterSessionNotification ( HWND  hWnd)
Here is the caller graph for this function:

◆ WTSUnRegisterSessionNotificationEx()

BOOL WINAPI WTSUnRegisterSessionNotificationEx ( HANDLE  hServer,
HWND  hWnd 
)

◆ WTSVirtualChannelClose()

BOOL WINAPI WTSVirtualChannelClose ( HANDLE  hChannelHandle)
Here is the caller graph for this function:

◆ WTSVirtualChannelOpen()

HANDLE WINAPI WTSVirtualChannelOpen ( HANDLE  hServer,
DWORD  SessionId,
LPSTR  pVirtualName 
)
Here is the caller graph for this function:

◆ WTSVirtualChannelOpenEx()

HANDLE WINAPI WTSVirtualChannelOpenEx ( DWORD  SessionId,
LPSTR  pVirtualName,
DWORD  flags 
)
Here is the caller graph for this function:

◆ WTSVirtualChannelPurgeInput()

BOOL WINAPI WTSVirtualChannelPurgeInput ( HANDLE  hChannelHandle)

◆ WTSVirtualChannelPurgeOutput()

BOOL WINAPI WTSVirtualChannelPurgeOutput ( HANDLE  hChannelHandle)

◆ WTSVirtualChannelQuery()

BOOL WINAPI WTSVirtualChannelQuery ( HANDLE  hChannelHandle,
WTS_VIRTUAL_CLASS  WtsVirtualClass,
PVOID *  ppBuffer,
DWORD *  pBytesReturned 
)
Here is the caller graph for this function:

◆ WTSVirtualChannelRead()

BOOL WINAPI WTSVirtualChannelRead ( HANDLE  hChannelHandle,
ULONG  TimeOut,
PCHAR  Buffer,
ULONG  BufferSize,
PULONG  pBytesRead 
)
Here is the caller graph for this function:

◆ WTSVirtualChannelWrite()

BOOL WINAPI WTSVirtualChannelWrite ( HANDLE  hChannelHandle,
PCHAR  Buffer,
ULONG  Length,
PULONG  pBytesWritten 
)
Here is the caller graph for this function:

◆ WTSWaitSystemEvent()

BOOL WINAPI WTSWaitSystemEvent ( HANDLE  hServer,
DWORD  EventMask,
DWORD *  pEventFlags 
)
Here is the caller graph for this function:

Variable Documentation

◆ g_WtsApi

const WtsApiFunctionTable* g_WtsApi = NULL
static

◆ g_WtsApiModule

HMODULE g_WtsApiModule = NULL
static

◆ wtsapiInitOnce

INIT_ONCE wtsapiInitOnce = INIT_ONCE_STATIC_INIT
static