ReactOS  0.4.15-dev-506-ga3ec01c
wtsapi32.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _WTS_PROCESS_INFOA
 
struct  _WTS_PROCESS_INFOW
 
struct  _WTS_SESSION_INFOA
 
struct  _WTS_SESSION_INFOW
 
struct  _WTS_SESSION_INFO_1A
 
struct  _WTS_SESSION_INFO_1W
 
struct  _WTS_SERVER_INFOA
 
struct  _WTS_SERVER_INFOW
 

Macros

#define IDTIMEOUT   32000
 
#define IDASYNC   32001
 
#define WTS_CURRENT_SERVER_HANDLE   ((HANDLE)NULL)
 
#define WTS_CURRENT_SESSION   (~0u)
 
#define WTSConnectSession   WINELIB_NAME_AW(WTSConnectSession)
 
#define WTSEnumerateProcesses   WINELIB_NAME_AW(WTSEnumerateProcesses)
 
#define WTSEnumerateServers   WINELIB_NAME_AW(WTSEnumerateServers)
 
#define WTSEnumerateSessions   WINELIB_NAME_AW(WTSEnumerateSessions)
 
#define WTSOpenServer   WINELIB_NAME_AW(WTSOpenServer)
 
#define WTSQuerySessionInformation   WINELIB_NAME_AW(WTSQuerySessionInformation)
 
#define WTSQueryUserConfig   WINELIB_NAME_AW(WTSQueryUserConfig)
 
#define WTSStartRemoteControlSession   WINELIB_NAME_AW(WTSStartRemoteControlSession)
 

Typedefs

typedef enum _WTS_VIRTUAL_CLASS WTS_VIRTUAL_CLASS
 
typedef enum tagWTS_INFO_CLASS WTS_INFO_CLASS
 
typedef enum _WTS_CONNECTSTATE_CLASS WTS_CONNECTSTATE_CLASS
 
typedef enum _WTS_CONFIG_CLASS WTS_CONFIG_CLASS
 
typedef enum _WTS_TYPE_CLASS WTS_TYPE_CLASS
 
typedef struct _WTS_PROCESS_INFOA WTS_PROCESS_INFOA
 
typedef struct _WTS_PROCESS_INFOAPWTS_PROCESS_INFOA
 
typedef struct _WTS_PROCESS_INFOW WTS_PROCESS_INFOW
 
typedef struct _WTS_PROCESS_INFOWPWTS_PROCESS_INFOW
 
typedef struct _WTS_SESSION_INFOA WTS_SESSION_INFOA
 
typedef struct _WTS_SESSION_INFOAPWTS_SESSION_INFOA
 
typedef struct _WTS_SESSION_INFOW WTS_SESSION_INFOW
 
typedef struct _WTS_SESSION_INFOWPWTS_SESSION_INFOW
 
typedef struct _WTS_SESSION_INFO_1A WTS_SESSION_INFO_1A
 
typedef struct _WTS_SESSION_INFO_1APWTS_SESSION_INFO_1A
 
typedef struct _WTS_SESSION_INFO_1W WTS_SESSION_INFO_1W
 
typedef struct _WTS_SESSION_INFO_1WPWTS_SESSION_INFO_1W
 
typedef struct _WTS_SERVER_INFOA WTS_SERVER_INFOA
 
typedef struct _WTS_SERVER_INFOAPWTS_SERVER_INFOA
 
typedef struct _WTS_SERVER_INFOW WTS_SERVER_INFOW
 
typedef struct _WTS_SERVER_INFOWPWTS_SERVER_INFOW
 

Enumerations

enum  _WTS_VIRTUAL_CLASS { WTSVirtualClientData, WTSVirtualFileHandle }
 
enum  tagWTS_INFO_CLASS {
  WTSInitialProgram, WTSApplicationName, WTSWorkingDirectory, WTSOEMId,
  WTSSessionId, WTSUserName, WTSWinStationName, WTSDomainName,
  WTSConnectState, WTSClientBuildNumber, WTSClientName, WTSClientDirectory,
  WTSClientProductId, WTSClientHardwareId, WTSClientAddress, WTSClientDisplay,
  WTSClientProtocolType, WTSIdleTime, WTSLogonTime, WTSIncomingBytes,
  WTSOutgoingBytes, WTSIncomingFrames, WTSOutgoingFrames, WTSClientInfo,
  WTSSessionInfo, WTSSessionInfoEx, WTSConfigInfo, WTSValidationInfo,
  WTSSessionAddressV4, WTSIsRemoteSession
}
 
enum  _WTS_CONNECTSTATE_CLASS {
  WTSActive, WTSConnected, WTSConnectQuery, WTSShadow,
  WTSDisconnected, WTSIdle, WTSListen, WTSReset,
  WTSDown, WTSInit
}
 
enum  _WTS_CONFIG_CLASS {
  WTSUserConfigInitialProgram, WTSUserConfigWorkingDirectory, WTSUserConfigInheritInitialProgram, WTSUserConfigAllowLogonTerminalServer,
  WTSUserConfigTimeoutSettingsConnections, WTSUserConfigTimeoutSettingsDisconnections, WTSUserConfigTimeoutSettingsIdle, WTSUserConfigDeviceClientDrives,
  WTSUserConfigDeviceClientPrinters, WTSUserConfigDeviceClientDefaultPrinter, WTSUserConfigBrokenTimeoutSettings, WTSUserConfigModemCallbackSettings,
  WTSUserConfigModemCallbackPhoneNumber, WTSUserConfigShadowSettings, WTSUserConfigTerminalServerProfilePath, WTSUserConfigTerminalServerHomeDirectory,
  WTSUserConfigfTerminalServerRemoteHomeDir
}
 
enum  _WTS_TYPE_CLASS { WTSTypeProcessInfoLevel0, WTSTypeProcessInfoLevel1, WTSTypeSessionInfoLevel1 }
 

Functions

void WINAPI WTSCloseServer (HANDLE)
 
BOOL WINAPI WTSConnectSessionA (ULONG, ULONG, PSTR, BOOL)
 
BOOL WINAPI WTSConnectSessionW (ULONG, ULONG, PWSTR, BOOL)
 
BOOL WINAPI WTSDisconnectSession (HANDLE, DWORD, BOOL)
 
BOOL WINAPI WTSEnableChildSessions (BOOL)
 
BOOL WINAPI WTSEnumerateProcessesA (HANDLE, DWORD, DWORD, PWTS_PROCESS_INFOA *, DWORD *)
 
BOOL WINAPI WTSEnumerateProcessesW (HANDLE, DWORD, DWORD, PWTS_PROCESS_INFOW *, DWORD *)
 
BOOL WINAPI WTSEnumerateServersA (LPSTR, DWORD, DWORD, PWTS_SERVER_INFOA *, DWORD *)
 
BOOL WINAPI WTSEnumerateServersW (LPWSTR, DWORD, DWORD, PWTS_SERVER_INFOW *, DWORD *)
 
BOOL WINAPI WTSEnumerateSessionsA (HANDLE, DWORD, DWORD, PWTS_SESSION_INFOA *, DWORD *)
 
BOOL WINAPI WTSEnumerateSessionsW (HANDLE, DWORD, DWORD, PWTS_SESSION_INFOW *, DWORD *)
 
void WINAPI WTSFreeMemory (PVOID)
 
HANDLE WINAPI WTSOpenServerA (LPSTR)
 
HANDLE WINAPI WTSOpenServerW (LPWSTR)
 
BOOL WINAPI WTSQuerySessionInformationA (HANDLE, DWORD, WTS_INFO_CLASS, LPSTR *, DWORD *)
 
BOOL WINAPI WTSQuerySessionInformationW (HANDLE, DWORD, WTS_INFO_CLASS, LPWSTR *, DWORD *)
 
BOOL WINAPI WTSQueryUserConfigA (LPSTR, LPSTR, WTS_CONFIG_CLASS, LPSTR *, DWORD *)
 
BOOL WINAPI WTSQueryUserConfigW (LPWSTR, LPWSTR, WTS_CONFIG_CLASS, LPWSTR *, DWORD *)
 
BOOL WINAPI WTSQueryUserToken (ULONG, PHANDLE)
 
BOOL WINAPI WTSRegisterSessionNotification (HWND, DWORD)
 
BOOL WINAPI WTSRegisterSessionNotificationEx (HANDLE, HWND, DWORD)
 
BOOL WINAPI WTSStartRemoteControlSessionA (LPSTR, ULONG, BYTE, USHORT)
 
BOOL WINAPI WTSStartRemoteControlSessionW (LPWSTR, ULONG, BYTE, USHORT)
 
BOOL WINAPI WTSStopRemoteControlSession (ULONG)
 
BOOL WINAPI WTSTerminateProcess (HANDLE, DWORD, DWORD)
 
BOOL WINAPI WTSUnRegisterSessionNotification (HWND)
 
BOOL WINAPI WTSUnRegisterSessionNotificationEx (HANDLE, HWND)
 
BOOL WINAPI WTSWaitSystemEvent (HANDLE, DWORD, DWORD *)
 

Macro Definition Documentation

◆ IDASYNC

#define IDASYNC   32001

Definition at line 34 of file wtsapi32.h.

◆ IDTIMEOUT

#define IDTIMEOUT   32000

Definition at line 31 of file wtsapi32.h.

◆ WTS_CURRENT_SERVER_HANDLE

#define WTS_CURRENT_SERVER_HANDLE   ((HANDLE)NULL)

Definition at line 197 of file wtsapi32.h.

◆ WTS_CURRENT_SESSION

#define WTS_CURRENT_SESSION   (~0u)

Definition at line 198 of file wtsapi32.h.

◆ WTSConnectSession

#define WTSConnectSession   WINELIB_NAME_AW(WTSConnectSession)

Definition at line 203 of file wtsapi32.h.

◆ WTSEnumerateProcesses

#define WTSEnumerateProcesses   WINELIB_NAME_AW(WTSEnumerateProcesses)

Definition at line 208 of file wtsapi32.h.

◆ WTSEnumerateServers

#define WTSEnumerateServers   WINELIB_NAME_AW(WTSEnumerateServers)

Definition at line 211 of file wtsapi32.h.

◆ WTSEnumerateSessions

#define WTSEnumerateSessions   WINELIB_NAME_AW(WTSEnumerateSessions)

Definition at line 214 of file wtsapi32.h.

◆ WTSOpenServer

#define WTSOpenServer   WINELIB_NAME_AW(WTSOpenServer)

Definition at line 218 of file wtsapi32.h.

◆ WTSQuerySessionInformation

#define WTSQuerySessionInformation   WINELIB_NAME_AW(WTSQuerySessionInformation)

Definition at line 221 of file wtsapi32.h.

◆ WTSQueryUserConfig

#define WTSQueryUserConfig   WINELIB_NAME_AW(WTSQueryUserConfig)

Definition at line 224 of file wtsapi32.h.

◆ WTSStartRemoteControlSession

#define WTSStartRemoteControlSession   WINELIB_NAME_AW(WTSStartRemoteControlSession)

Definition at line 230 of file wtsapi32.h.

Typedef Documentation

◆ PWTS_PROCESS_INFOA

◆ PWTS_PROCESS_INFOW

◆ PWTS_SERVER_INFOA

◆ PWTS_SERVER_INFOW

◆ PWTS_SESSION_INFO_1A

◆ PWTS_SESSION_INFO_1W

◆ PWTS_SESSION_INFOA

◆ PWTS_SESSION_INFOW

◆ WTS_CONFIG_CLASS

◆ WTS_CONNECTSTATE_CLASS

◆ WTS_INFO_CLASS

◆ WTS_PROCESS_INFOA

◆ WTS_PROCESS_INFOW

◆ WTS_SERVER_INFOA

◆ WTS_SERVER_INFOW

◆ WTS_SESSION_INFO_1A

◆ WTS_SESSION_INFO_1W

◆ WTS_SESSION_INFOA

◆ WTS_SESSION_INFOW

◆ WTS_TYPE_CLASS

◆ WTS_VIRTUAL_CLASS

Enumeration Type Documentation

◆ _WTS_CONFIG_CLASS

Enumerator
WTSUserConfigInitialProgram 
WTSUserConfigWorkingDirectory 
WTSUserConfigInheritInitialProgram 
WTSUserConfigAllowLogonTerminalServer 
WTSUserConfigTimeoutSettingsConnections 
WTSUserConfigTimeoutSettingsDisconnections 
WTSUserConfigTimeoutSettingsIdle 
WTSUserConfigDeviceClientDrives 
WTSUserConfigDeviceClientPrinters 
WTSUserConfigDeviceClientDefaultPrinter 
WTSUserConfigBrokenTimeoutSettings 
WTSUserConfigModemCallbackSettings 
WTSUserConfigModemCallbackPhoneNumber 
WTSUserConfigShadowSettings 
WTSUserConfigTerminalServerProfilePath 
WTSUserConfigTerminalServerHomeDirectory 
WTSUserConfigfTerminalServerRemoteHomeDir 

Definition at line 93 of file wtsapi32.h.

94 {
enum _WTS_CONFIG_CLASS WTS_CONFIG_CLASS

◆ _WTS_CONNECTSTATE_CLASS

Enumerator
WTSActive 
WTSConnected 
WTSConnectQuery 
WTSShadow 
WTSDisconnected 
WTSIdle 
WTSListen 
WTSReset 
WTSDown 
WTSInit 

Definition at line 79 of file wtsapi32.h.

80 {
81  WTSActive,
84  WTSShadow,
86  WTSIdle,
87  WTSListen,
88  WTSReset,
89  WTSDown,
90  WTSInit
enum _WTS_CONNECTSTATE_CLASS WTS_CONNECTSTATE_CLASS

◆ _WTS_TYPE_CLASS

Enumerator
WTSTypeProcessInfoLevel0 
WTSTypeProcessInfoLevel1 
WTSTypeSessionInfoLevel1 

Definition at line 114 of file wtsapi32.h.

◆ _WTS_VIRTUAL_CLASS

Enumerator
WTSVirtualClientData 
WTSVirtualFileHandle 

Definition at line 37 of file wtsapi32.h.

38 {
enum _WTS_VIRTUAL_CLASS WTS_VIRTUAL_CLASS

◆ tagWTS_INFO_CLASS

Enumerator
WTSInitialProgram 
WTSApplicationName 
WTSWorkingDirectory 
WTSOEMId 
WTSSessionId 
WTSUserName 
WTSWinStationName 
WTSDomainName 
WTSConnectState 
WTSClientBuildNumber 
WTSClientName 
WTSClientDirectory 
WTSClientProductId 
WTSClientHardwareId 
WTSClientAddress 
WTSClientDisplay 
WTSClientProtocolType 
WTSIdleTime 
WTSLogonTime 
WTSIncomingBytes 
WTSOutgoingBytes 
WTSIncomingFrames 
WTSOutgoingFrames 
WTSClientInfo 
WTSSessionInfo 
WTSSessionInfoEx 
WTSConfigInfo 
WTSValidationInfo 
WTSSessionAddressV4 
WTSIsRemoteSession 

Definition at line 43 of file wtsapi32.h.

44 {
48  WTSOEMId,
62 #if (NTDDI_VERSION >= NTDDI_WS08)
76 #endif /* (NTDDI_VERSION >= NTDDI_WS08) */
enum tagWTS_INFO_CLASS WTS_INFO_CLASS

Function Documentation

◆ WTSCloseServer()

void WINAPI WTSCloseServer ( HANDLE  )

Definition at line 38 of file wtsapi32.c.

39 {
40  FIXME("Stub %p\n", hServer);
41 }
#define FIXME(fmt,...)
Definition: debug.h:111

◆ WTSConnectSessionA()

BOOL WINAPI WTSConnectSessionA ( ULONG  ,
ULONG  ,
PSTR  ,
BOOL   
)

Definition at line 46 of file wtsapi32.c.

47 {
48  FIXME("Stub %d %d (%s) %d\n", LogonId, TargetLogonId, debugstr_a(pPassword), bWait);
49  return TRUE;
50 }
#define TRUE
Definition: types.h:120
#define FIXME(fmt,...)
Definition: debug.h:111
#define debugstr_a
Definition: kernel32.h:31
_IRQL_requires_same_ _In_ PLSA_STRING _In_ SECURITY_LOGON_TYPE _In_ ULONG _In_ ULONG _In_opt_ PTOKEN_GROUPS _In_ PTOKEN_SOURCE _Out_ PVOID _Out_ PULONG _Inout_ PLUID LogonId

◆ WTSConnectSessionW()

BOOL WINAPI WTSConnectSessionW ( ULONG  ,
ULONG  ,
PWSTR  ,
BOOL   
)

Definition at line 55 of file wtsapi32.c.

56 {
57  FIXME("Stub %d %d (%s) %d\n", LogonId, TargetLogonId, debugstr_w(pPassword), bWait);
58  return TRUE;
59 }
#define TRUE
Definition: types.h:120
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:111
_IRQL_requires_same_ _In_ PLSA_STRING _In_ SECURITY_LOGON_TYPE _In_ ULONG _In_ ULONG _In_opt_ PTOKEN_GROUPS _In_ PTOKEN_SOURCE _Out_ PVOID _Out_ PULONG _Inout_ PLUID LogonId

◆ WTSDisconnectSession()

BOOL WINAPI WTSDisconnectSession ( HANDLE  ,
DWORD  ,
BOOL   
)

Definition at line 64 of file wtsapi32.c.

65 {
66  FIXME("Stub %p 0x%08x %d\n", hServer, SessionId, bWait);
67  return TRUE;
68 }
#define TRUE
Definition: types.h:120
ULONG SessionId
Definition: dllmain.c:28
#define FIXME(fmt,...)
Definition: debug.h:111

◆ WTSEnableChildSessions()

BOOL WINAPI WTSEnableChildSessions ( BOOL  )

Definition at line 73 of file wtsapi32.c.

74 {
75  FIXME("Stub %d\n", enable);
76  return TRUE;
77 }
#define TRUE
Definition: types.h:120
#define FIXME(fmt,...)
Definition: debug.h:111
GLboolean enable
Definition: glext.h:11120

◆ WTSEnumerateProcessesA()

BOOL WINAPI WTSEnumerateProcessesA ( HANDLE  ,
DWORD  ,
DWORD  ,
PWTS_PROCESS_INFOA ,
DWORD  
)

Definition at line 103 of file wtsapi32.c.

105 {
106  FIXME("Stub %p 0x%08x 0x%08x %p %p\n", hServer, Reserved, Version,
107  ppProcessInfo, pCount);
108 
109  if (!ppProcessInfo || !pCount) return FALSE;
110 
111  *pCount = 0;
112  *ppProcessInfo = NULL;
113 
114  return TRUE;
115 }
#define TRUE
Definition: types.h:120
IN PVOID IN PVOID IN USHORT Version
Definition: pci.h:361
#define FIXME(fmt,...)
Definition: debug.h:111
smooth NULL
Definition: ftsmooth.c:416
_Reserved_ PVOID Reserved
Definition: winddi.h:3974

◆ WTSEnumerateProcessesW()

BOOL WINAPI WTSEnumerateProcessesW ( HANDLE  ,
DWORD  ,
DWORD  ,
PWTS_PROCESS_INFOW ,
DWORD  
)

Definition at line 120 of file wtsapi32.c.

122 {
123  WTS_PROCESS_INFOW *processInfo;
125  ULONG size = 0x4000;
126  void *buf = NULL;
128  DWORD count;
129  WCHAR *name;
130 
131  if (!ppProcessInfo || !pCount || Reserved != 0 || Version != 1)
132  {
134  return FALSE;
135  }
136 
137  if (hServer != WTS_CURRENT_SERVER_HANDLE)
138  {
140  return FALSE;
141  }
142 
143  do
144  {
145  size *= 2;
146  HeapFree(GetProcessHeap(), 0, buf);
147  buf = HeapAlloc(GetProcessHeap(), 0, size);
148  if (!buf)
149  {
151  return FALSE;
152  }
154  }
156 
157  if (status != STATUS_SUCCESS)
158  {
159  HeapFree(GetProcessHeap(), 0, buf);
161  return FALSE;
162  }
163 
164  spi = buf;
165  count = size = 0;
166  for (;;)
167  {
168  size += sizeof(WTS_PROCESS_INFOW) + spi->ProcessName.Length + sizeof(WCHAR);
169  count++;
170  if (spi->NextEntryOffset == 0) break;
171  spi = (SYSTEM_PROCESS_INFORMATION *)(((PCHAR)spi) + spi->NextEntryOffset);
172  }
173 
174  processInfo = HeapAlloc(GetProcessHeap(), 0, size);
175  if (!processInfo)
176  {
177  HeapFree(GetProcessHeap(), 0, buf);
179  return FALSE;
180  }
181  name = (WCHAR *)&processInfo[count];
182 
183  *ppProcessInfo = processInfo;
184  *pCount = count;
185 
186  spi = buf;
187  while (count--)
188  {
189  processInfo->SessionId = 0;
190  processInfo->ProcessId = HandleToUlong(spi->UniqueProcessId);
191  processInfo->pProcessName = name;
192  processInfo->pUserSid = NULL;
193  memcpy( name, spi->ProcessName.Buffer, spi->ProcessName.Length );
194  name[ spi->ProcessName.Length/sizeof(WCHAR) ] = 0;
195 
196  processInfo++;
197  name += (spi->ProcessName.Length + sizeof(WCHAR))/sizeof(WCHAR);
198  spi = (SYSTEM_PROCESS_INFORMATION *)(((PCHAR)spi) + spi->NextEntryOffset);
199  }
200 
201  HeapFree(GetProcessHeap(), 0, buf);
202  return TRUE;
203 }
signed char * PCHAR
Definition: retypes.h:7
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
#define TRUE
Definition: types.h:120
NTSYSAPI NTSTATUS NTAPI NtQuerySystemInformation(IN SYSTEM_INFORMATION_CLASS SystemInfoClass, OUT PVOID SystemInfoBuffer, IN ULONG SystemInfoBufferSize, OUT PULONG BytesReturned OPTIONAL)
IN PVOID IN PVOID IN USHORT Version
Definition: pci.h:361
#define STATUS_INFO_LENGTH_MISMATCH
Definition: udferr_usr.h:133
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
GLuint GLuint GLsizei count
Definition: gl.h:1545
LONG NTSTATUS
Definition: precomp.h:26
#define HandleToUlong(h)
Definition: basetsd.h:79
LPWSTR pProcessName
Definition: wtsapi32.h:133
NTSYSAPI ULONG WINAPI RtlNtStatusToDosError(NTSTATUS)
smooth NULL
Definition: ftsmooth.c:416
_Reserved_ PVOID Reserved
Definition: winddi.h:3974
#define WTS_CURRENT_SERVER_HANDLE
Definition: wtsapi32.h:197
GLsizeiptr size
Definition: glext.h:5919
#define GetProcessHeap()
Definition: compat.h:404
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
#define SetLastError(x)
Definition: compat.h:418
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
struct _WTS_PROCESS_INFOW WTS_PROCESS_INFOW
Definition: name.c:38
unsigned int ULONG
Definition: retypes.h:1
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:92
return STATUS_SUCCESS
Definition: btrfs.c:3014
static SERVICE_STATUS status
Definition: service.c:31
#define HeapFree(x, y, z)
Definition: compat.h:403
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13
Definition: ps.c:97
GLuint const GLchar * name
Definition: glext.h:6031

Referenced by test_WTSEnumerateProcessesW().

◆ WTSEnumerateServersA()

BOOL WINAPI WTSEnumerateServersA ( LPSTR  ,
DWORD  ,
DWORD  ,
PWTS_SERVER_INFOA ,
DWORD  
)

Definition at line 208 of file wtsapi32.c.

209 {
210  FIXME("Stub %s 0x%08x 0x%08x %p %p\n", debugstr_a(pDomainName), Reserved, Version, ppServerInfo, pCount);
211  return FALSE;
212 }
IN PVOID IN PVOID IN USHORT Version
Definition: pci.h:361
#define FIXME(fmt,...)
Definition: debug.h:111
_Reserved_ PVOID Reserved
Definition: winddi.h:3974
#define debugstr_a
Definition: kernel32.h:31

◆ WTSEnumerateServersW()

BOOL WINAPI WTSEnumerateServersW ( LPWSTR  ,
DWORD  ,
DWORD  ,
PWTS_SERVER_INFOW ,
DWORD  
)

Definition at line 217 of file wtsapi32.c.

218 {
219  FIXME("Stub %s 0x%08x 0x%08x %p %p\n", debugstr_w(pDomainName), Reserved, Version, ppServerInfo, pCount);
220  return FALSE;
221 }
IN PVOID IN PVOID IN USHORT Version
Definition: pci.h:361
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:111
_Reserved_ PVOID Reserved
Definition: winddi.h:3974

◆ WTSEnumerateSessionsA()

BOOL WINAPI WTSEnumerateSessionsA ( HANDLE  ,
DWORD  ,
DWORD  ,
PWTS_SESSION_INFOA ,
DWORD  
)

Definition at line 247 of file wtsapi32.c.

249 {
250  static int once;
251 
252  if (!once++) FIXME("Stub %p 0x%08x 0x%08x %p %p\n", hServer, Reserved, Version,
253  ppSessionInfo, pCount);
254 
255  if (!ppSessionInfo || !pCount) return FALSE;
256 
257  *pCount = 0;
258  *ppSessionInfo = NULL;
259 
260  return TRUE;
261 }
#define TRUE
Definition: types.h:120
IN PVOID IN PVOID IN USHORT Version
Definition: pci.h:361
#define FIXME(fmt,...)
Definition: debug.h:111
smooth NULL
Definition: ftsmooth.c:416
_Reserved_ PVOID Reserved
Definition: winddi.h:3974

◆ WTSEnumerateSessionsW()

BOOL WINAPI WTSEnumerateSessionsW ( HANDLE  ,
DWORD  ,
DWORD  ,
PWTS_SESSION_INFOW ,
DWORD  
)

Definition at line 266 of file wtsapi32.c.

268 {
269  FIXME("Stub %p 0x%08x 0x%08x %p %p\n", hServer, Reserved, Version,
270  ppSessionInfo, pCount);
271 
272  if (!ppSessionInfo || !pCount) return FALSE;
273 
274  *pCount = 0;
275  *ppSessionInfo = NULL;
276 
277  return TRUE;
278 }
#define TRUE
Definition: types.h:120
IN PVOID IN PVOID IN USHORT Version
Definition: pci.h:361
#define FIXME(fmt,...)
Definition: debug.h:111
smooth NULL
Definition: ftsmooth.c:416
_Reserved_ PVOID Reserved
Definition: winddi.h:3974

◆ WTSFreeMemory()

void WINAPI WTSFreeMemory ( PVOID  )

Definition at line 283 of file wtsapi32.c.

284 {
285  heap_free(pMemory);
286 }
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by test_WTSEnumerateProcessesW(), test_WTSQuerySessionInformationW(), and WTSQuerySessionInformationA().

◆ WTSOpenServerA()

HANDLE WINAPI WTSOpenServerA ( LPSTR  )

Definition at line 343 of file wtsapi32.c.

344 {
345  FIXME("(%s) stub\n", debugstr_a(pServerName));
347  return NULL;
348 }
#define FIXME(fmt,...)
Definition: debug.h:111
smooth NULL
Definition: ftsmooth.c:416
#define debugstr_a
Definition: kernel32.h:31
#define SetLastError(x)
Definition: compat.h:418
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:92

◆ WTSOpenServerW()

HANDLE WINAPI WTSOpenServerW ( LPWSTR  )

Definition at line 353 of file wtsapi32.c.

354 {
355  FIXME("(%s) stub\n", debugstr_w(pServerName));
357  return NULL;
358 }
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:111
smooth NULL
Definition: ftsmooth.c:416
#define SetLastError(x)
Definition: compat.h:418
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:92

◆ WTSQuerySessionInformationA()

BOOL WINAPI WTSQuerySessionInformationA ( HANDLE  ,
DWORD  ,
WTS_INFO_CLASS  ,
LPSTR ,
DWORD  
)

Definition at line 363 of file wtsapi32.c.

369 {
370 #ifdef __REACTOS__
371  const size_t wcsErrorCode = -1;
372  LPWSTR buffer = NULL;
373  LPSTR ansiBuffer = NULL;
374  DWORD bytesReturned = 0;
375  BOOL result = FALSE;
376  size_t len;
377 
378  if (!BytesReturned || !Buffer)
379  {
381  return FALSE;
382  }
383 
384  if (!WTSQuerySessionInformationW(hServer, SessionId, WTSInfoClass, &buffer, &bytesReturned))
385  {
386  ansiBuffer = (LPSTR)buffer;
387  *Buffer = ansiBuffer;
388  *BytesReturned = bytesReturned;
389  return FALSE;
390  }
391 
392  switch (WTSInfoClass)
393  {
394  case WTSInitialProgram:
395  case WTSApplicationName:
396  case WTSWorkingDirectory:
397  case WTSOEMId:
398  case WTSUserName:
399  case WTSWinStationName:
400  case WTSDomainName:
401  case WTSClientName:
402  case WTSClientDirectory:
403  {
404  len = wcstombs(NULL, buffer, 0);
405  if (len != wcsErrorCode)
406  {
407  len++;
408  ansiBuffer = heap_alloc_zero(len);
409  if (ansiBuffer && (wcstombs(ansiBuffer, buffer, len) != wcsErrorCode))
410  {
411  result = TRUE;
412  bytesReturned = len;
413  }
414  }
416  break;
417  }
418 
419  default:
420  {
421  result = TRUE;
422  ansiBuffer = (LPSTR)buffer;
423  break;
424  }
425  }
426 
427  *Buffer = ansiBuffer;
428  *BytesReturned = bytesReturned;
429 
430  return result;
431 #else
432  /* FIXME: Forward request to winsta.dll::WinStationQueryInformationA */
433  FIXME("Stub %p 0x%08x %d %p %p\n", hServer, SessionId, WTSInfoClass,
435 
436  return FALSE;
437 #endif
438 }
#define TRUE
Definition: types.h:120
ULONG SessionId
Definition: dllmain.c:28
GLuint buffer
Definition: glext.h:5915
char * LPSTR
Definition: xmlstorage.h:182
#define ERROR_INVALID_USER_BUFFER
Definition: winerror.h:1091
unsigned int BOOL
Definition: ntddk_ex.h:94
#define FIXME(fmt,...)
Definition: debug.h:111
smooth NULL
Definition: ftsmooth.c:416
Definition: bufpool.h:45
unsigned long DWORD
Definition: ntddk_ex.h:95
#define SetLastError(x)
Definition: compat.h:418
GLenum GLsizei len
Definition: glext.h:6722
void WINAPI WTSFreeMemory(PVOID pMemory)
Definition: wtsapi32.c:283
_In_ FILTER_INFORMATION_CLASS _In_ ULONG _Out_ PULONG BytesReturned
Definition: fltkernel.h:1716
BOOL WINAPI WTSQuerySessionInformationW(HANDLE hServer, DWORD SessionId, WTS_INFO_CLASS WTSInfoClass, LPWSTR *Buffer, DWORD *BytesReturned)
Definition: wtsapi32.c:443
WCHAR * LPWSTR
Definition: xmlstorage.h:184
size_t __cdecl wcstombs(_Out_writes_opt_z_(_MaxCount) char *_Dest, _In_z_ const wchar_t *_Source, _In_ size_t _MaxCount)
GLuint64EXT * result
Definition: glext.h:11304

◆ WTSQuerySessionInformationW()

BOOL WINAPI WTSQuerySessionInformationW ( HANDLE  ,
DWORD  ,
WTS_INFO_CLASS  ,
LPWSTR ,
DWORD  
)

Definition at line 443 of file wtsapi32.c.

449 {
450 #ifdef __REACTOS__
451  if (!BytesReturned || !Buffer)
452  {
454  return FALSE;
455  }
456 
457 #if (NTDDI_VERSION >= NTDDI_WS08)
458  if (WTSInfoClass > WTSIsRemoteSession)
459 #else
460  if (WTSInfoClass > WTSClientProtocolType)
461 #endif
462  {
464  return FALSE;
465  }
466 
467  switch (WTSInfoClass)
468  {
469  case WTSSessionId:
470  {
471  const DWORD size = sizeof(ULONG);
472  ULONG* output = heap_alloc_zero(size);
473  if (!output)
474  {
476  return FALSE;
477  }
478 
479  *output = NtCurrentTeb()->Peb->SessionId;
480  *Buffer = (LPWSTR)output;
481  *BytesReturned = size;
482  return TRUE;
483  }
484 
485  case WTSUserName:
486  {
487  WCHAR* username;
488  DWORD count = 0;
489 
492  return FALSE;
493  username = heap_alloc(count * sizeof(WCHAR));
494  if (!username)
495  {
497  return FALSE;
498  }
499 
501  *Buffer = username;
502  *BytesReturned = count * sizeof(WCHAR);
503  return TRUE;
504  }
505 
506  case WTSConnectState:
507  {
508  const DWORD size = sizeof(DWORD);
509  WCHAR* output = heap_alloc_zero(size);
510  if (!output)
511  {
513  return FALSE;
514  }
515 
516  *Buffer = output;
517  *BytesReturned = size;
518  return TRUE;
519  }
520 
522  {
523  const DWORD size = sizeof(WORD);
524  WCHAR* output = heap_alloc_zero(size);
525  if (!output)
526  {
528  return FALSE;
529  }
530 
531  *Buffer = output;
532  *BytesReturned = size;
533  return TRUE;
534  }
535 
536 #if (NTDDI_VERSION >= NTDDI_WS08)
537  case WTSIdleTime:
538  case WTSLogonTime:
539  case WTSIncomingBytes:
540  case WTSOutgoingBytes:
541  case WTSIncomingFrames:
542  case WTSOutgoingFrames:
543  {
545  return FALSE;
546  }
547 #endif /* (NTDDI_VERSION >= NTDDI_WS08) */
548 
549  default:
550  {
551  if (BytesReturned)
552  *BytesReturned = 0;
553 
554  break;
555  }
556  }
557 
558  /* FIXME: Forward request to winsta.dll::WinStationQueryInformationW */
559  FIXME("Stub %p 0x%08x %d %p %p\n", hServer, SessionId, WTSInfoClass,
561 
562  return FALSE;
563 #else
564  /* FIXME: Forward request to winsta.dll::WinStationQueryInformationW */
565  FIXME("Stub %p 0x%08x %d %p %p\n", hServer, SessionId, WTSInfoClass,
567 
568  if (WTSInfoClass == WTSUserName)
569  {
570  WCHAR *username;
571  DWORD count = 0;
572 
575  if (!(username = heap_alloc(count * sizeof(WCHAR)))) return FALSE;
577  *Buffer = username;
578  *BytesReturned = count * sizeof(WCHAR);
579  return TRUE;
580  }
581  return FALSE;
582 #endif
583 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
#define TRUE
Definition: types.h:120
static UCHAR ULONG UCHAR ULONG UCHAR * output
Definition: bcrypt.c:29
GLuint GLuint GLsizei count
Definition: gl.h:1545
ULONG SessionId
Definition: dllmain.c:28
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
#define DWORD
Definition: nt_native.h:44
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
#define ERROR_INVALID_USER_BUFFER
Definition: winerror.h:1091
#define FIXME(fmt,...)
Definition: debug.h:111
smooth NULL
Definition: ftsmooth.c:416
Definition: bufpool.h:45
static WCHAR username[]
Definition: url.c:32
BOOL WINAPI GetUserNameW(LPWSTR lpszName, LPDWORD lpSize)
Definition: misc.c:291
GLsizeiptr size
Definition: glext.h:5919
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned long DWORD
Definition: ntddk_ex.h:95
#define SetLastError(x)
Definition: compat.h:418
FORCEINLINE struct _TEB * NtCurrentTeb(VOID)
Definition: psfuncs.h:420
_In_ FILTER_INFORMATION_CLASS _In_ ULONG _Out_ PULONG BytesReturned
Definition: fltkernel.h:1716
#define ERROR_NOT_SUPPORTED
Definition: compat.h:90
unsigned int ULONG
Definition: retypes.h:1
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define ERROR_INSUFFICIENT_BUFFER
Definition: dderror.h:10

Referenced by test_WTSQuerySessionInformationW(), and WTSQuerySessionInformationA().

◆ WTSQueryUserConfigA()

BOOL WINAPI WTSQueryUserConfigA ( LPSTR  ,
LPSTR  ,
WTS_CONFIG_CLASS  ,
LPSTR ,
DWORD  
)

Definition at line 606 of file wtsapi32.c.

607 {
608  FIXME("Stub (%s) (%s) 0x%08x %p %p\n", debugstr_a(pServerName), debugstr_a(pUserName), WTSConfigClass,
609  ppBuffer, pBytesReturned);
610  return FALSE;
611 }
#define FIXME(fmt,...)
Definition: debug.h:111
static LPWSTR pUserName
#define debugstr_a
Definition: kernel32.h:31

◆ WTSQueryUserConfigW()

BOOL WINAPI WTSQueryUserConfigW ( LPWSTR  ,
LPWSTR  ,
WTS_CONFIG_CLASS  ,
LPWSTR ,
DWORD  
)

Definition at line 616 of file wtsapi32.c.

617 {
618  FIXME("Stub (%s) (%s) 0x%08x %p %p\n", debugstr_w(pServerName), debugstr_w(pUserName), WTSConfigClass,
619  ppBuffer, pBytesReturned);
620  return FALSE;
621 }
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:111
static LPWSTR pUserName

◆ WTSQueryUserToken()

BOOL WINAPI WTSQueryUserToken ( ULONG  ,
PHANDLE   
)

Definition at line 588 of file wtsapi32.c.

589 {
590  FIXME("%u %p semi-stub!\n", session_id, token);
591 
592  if (!token)
593  {
595  return FALSE;
596  }
597 
601 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
#define DUPLICATE_SAME_ACCESS
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat token
Definition: glfuncs.h:210
#define FIXME(fmt,...)
Definition: debug.h:111
#define GetCurrentProcessToken()
Definition: security.c:40
HANDLE WINAPI GetCurrentProcess(VOID)
Definition: proc.c:1138
#define SetLastError(x)
Definition: compat.h:418
BOOL WINAPI DuplicateHandle(IN HANDLE hSourceProcessHandle, IN HANDLE hSourceHandle, IN HANDLE hTargetProcessHandle, OUT LPHANDLE lpTargetHandle, IN DWORD dwDesiredAccess, IN BOOL bInheritHandle, IN DWORD dwOptions)
Definition: handle.c:149

Referenced by test_WTSQueryUserToken().

◆ WTSRegisterSessionNotification()

BOOL WINAPI WTSRegisterSessionNotification ( HWND  ,
DWORD   
)

Definition at line 627 of file wtsapi32.c.

628 {
629  FIXME("Stub %p 0x%08x\n", hWnd, dwFlags);
630  return TRUE;
631 }
#define TRUE
Definition: types.h:120
HWND hWnd
Definition: settings.c:17
#define FIXME(fmt,...)
Definition: debug.h:111
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175

◆ WTSRegisterSessionNotificationEx()

BOOL WINAPI WTSRegisterSessionNotificationEx ( HANDLE  ,
HWND  ,
DWORD   
)

Definition at line 636 of file wtsapi32.c.

637 {
638  FIXME("Stub %p %p 0x%08x\n", hServer, hWnd, dwFlags);
639  return FALSE;
640 }
HWND hWnd
Definition: settings.c:17
#define FIXME(fmt,...)
Definition: debug.h:111
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175

◆ WTSStartRemoteControlSessionA()

BOOL WINAPI WTSStartRemoteControlSessionA ( LPSTR  ,
ULONG  ,
BYTE  ,
USHORT   
)

Definition at line 693 of file wtsapi32.c.

694 {
695  FIXME("Stub (%s) %d %d %d\n", debugstr_a(pTargetServerName), TargetLogonId, HotkeyVk, HotkeyModifiers);
696  return FALSE;
697 }
#define FIXME(fmt,...)
Definition: debug.h:111
#define debugstr_a
Definition: kernel32.h:31

◆ WTSStartRemoteControlSessionW()

BOOL WINAPI WTSStartRemoteControlSessionW ( LPWSTR  ,
ULONG  ,
BYTE  ,
USHORT   
)

Definition at line 702 of file wtsapi32.c.

703 {
704  FIXME("Stub (%s) %d %d %d\n", debugstr_w(pTargetServerName), TargetLogonId, HotkeyVk, HotkeyModifiers);
705  return FALSE;
706 }
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:111

◆ WTSStopRemoteControlSession()

BOOL WINAPI WTSStopRemoteControlSession ( ULONG  )

Definition at line 711 of file wtsapi32.c.

712 {
713  FIXME("Stub %d\n", LogonId);
714  return FALSE;
715 }
#define FIXME(fmt,...)
Definition: debug.h:111
_IRQL_requires_same_ _In_ PLSA_STRING _In_ SECURITY_LOGON_TYPE _In_ ULONG _In_ ULONG _In_opt_ PTOKEN_GROUPS _In_ PTOKEN_SOURCE _Out_ PVOID _Out_ PULONG _Inout_ PLUID LogonId

◆ WTSTerminateProcess()

BOOL WINAPI WTSTerminateProcess ( HANDLE  ,
DWORD  ,
DWORD   
)

Definition at line 720 of file wtsapi32.c.

721 {
722  FIXME("Stub %p %d %d\n", hServer, ProcessId, ExitCode);
723  return FALSE;
724 }
IN PLARGE_INTEGER IN PLARGE_INTEGER PEPROCESS ProcessId
Definition: fatprocs.h:2706
#define FIXME(fmt,...)
Definition: debug.h:111

◆ WTSUnRegisterSessionNotification()

BOOL WINAPI WTSUnRegisterSessionNotification ( HWND  )

Definition at line 729 of file wtsapi32.c.

730 {
731  FIXME("Stub %p\n", hWnd);
732  return FALSE;
733 }
HWND hWnd
Definition: settings.c:17
#define FIXME(fmt,...)
Definition: debug.h:111

◆ WTSUnRegisterSessionNotificationEx()

BOOL WINAPI WTSUnRegisterSessionNotificationEx ( HANDLE  ,
HWND   
)

Definition at line 738 of file wtsapi32.c.

739 {
740  FIXME("Stub %p %p\n", hServer, hWnd);
741  return FALSE;
742 }
HWND hWnd
Definition: settings.c:17
#define FIXME(fmt,...)
Definition: debug.h:111

◆ WTSWaitSystemEvent()

BOOL WINAPI WTSWaitSystemEvent ( HANDLE  ,
DWORD  ,
DWORD  
)

Definition at line 821 of file wtsapi32.c.

822 {
823  /* FIXME: Forward request to winsta.dll::WinStationWaitSystemEvent */
824  FIXME("Stub %p 0x%08x %p\n", hServer, Mask, Flags);
825  return FALSE;
826 }
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
#define FIXME(fmt,...)
Definition: debug.h:111