ReactOS 0.4.15-dev-8093-g3285f69
wtsapi32.c File Reference
#include <stdarg.h>
#include <stdlib.h>
#include "ntstatus.h"
#include "windef.h"
#include "winbase.h"
#include "wine/winternl.h"
#include "wtsapi32.h"
#include "wine/debug.h"
#include "wine/heap.h"
Include dependency graph for wtsapi32.c:

Go to the source code of this file.

Macros

#define WIN32_NO_STATUS
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (wtsapi)
 
void WINAPI WTSCloseServer (HANDLE hServer)
 
BOOL WINAPI WTSConnectSessionA (ULONG LogonId, ULONG TargetLogonId, PSTR pPassword, BOOL bWait)
 
BOOL WINAPI WTSConnectSessionW (ULONG LogonId, ULONG TargetLogonId, PWSTR pPassword, BOOL bWait)
 
BOOL WINAPI WTSDisconnectSession (HANDLE hServer, DWORD SessionId, BOOL bWait)
 
BOOL WINAPI WTSEnableChildSessions (BOOL enable)
 
BOOL WINAPI WTSEnumerateProcessesExW (HANDLE server, DWORD *level, DWORD session_id, WCHAR **info, DWORD *count)
 
BOOL WINAPI WTSEnumerateProcessesExA (HANDLE server, DWORD *level, DWORD session_id, char **info, DWORD *count)
 
BOOL WINAPI WTSEnumerateProcessesA (HANDLE hServer, DWORD Reserved, DWORD Version, PWTS_PROCESS_INFOA *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 WTSEnumerateSessionsExW (HANDLE server, DWORD *level, DWORD filter, WTS_SESSION_INFO_1W *info, DWORD *count)
 
BOOL WINAPI WTSEnumerateSessionsExA (HANDLE server, DWORD *level, DWORD filter, WTS_SESSION_INFO_1A *info, DWORD *count)
 
BOOL WINAPI WTSEnumerateSessionsA (HANDLE hServer, DWORD Reserved, DWORD Version, PWTS_SESSION_INFOA *ppSessionInfo, DWORD *pCount)
 
BOOL WINAPI WTSEnumerateSessionsW (HANDLE hServer, DWORD Reserved, DWORD Version, PWTS_SESSION_INFOW *ppSessionInfo, DWORD *pCount)
 
void WINAPI WTSFreeMemory (PVOID pMemory)
 
BOOL WINAPI WTSFreeMemoryExA (WTS_TYPE_CLASS type, void *ptr, ULONG nmemb)
 
BOOL WINAPI WTSFreeMemoryExW (WTS_TYPE_CLASS type, void *ptr, ULONG nmemb)
 
BOOL WINAPI WTSLogoffSession (HANDLE hserver, DWORD session_id, BOOL bwait)
 
HANDLE WINAPI WTSOpenServerExW (WCHAR *server_name)
 
HANDLE WINAPI WTSOpenServerExA (char *server_name)
 
HANDLE WINAPI WTSOpenServerA (LPSTR pServerName)
 
HANDLE WINAPI WTSOpenServerW (LPWSTR pServerName)
 
BOOL WINAPI WTSQuerySessionInformationA (HANDLE hServer, DWORD SessionId, WTS_INFO_CLASS WTSInfoClass, LPSTR *Buffer, DWORD *BytesReturned)
 
BOOL WINAPI WTSQuerySessionInformationW (HANDLE hServer, DWORD SessionId, WTS_INFO_CLASS WTSInfoClass, LPWSTR *Buffer, DWORD *BytesReturned)
 
BOOL WINAPI WTSQueryUserToken (ULONG session_id, PHANDLE token)
 
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 WTSRegisterSessionNotification (HWND hWnd, DWORD dwFlags)
 
BOOL WINAPI WTSRegisterSessionNotificationEx (HANDLE hServer, HWND hWnd, DWORD dwFlags)
 
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 WTSSendMessageW (HANDLE hServer, DWORD SessionId, LPWSTR pTitle, DWORD TitleLength, LPWSTR pMessage, DWORD MessageLength, DWORD Style, DWORD Timeout, DWORD *pResponse, BOOL bWait)
 
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)
 
BOOL WINAPI WTSStartRemoteControlSessionA (LPSTR pTargetServerName, ULONG TargetLogonId, BYTE HotkeyVk, USHORT HotkeyModifiers)
 
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)
 
BOOL WINAPI WTSUnRegisterSessionNotification (HWND hWnd)
 
BOOL WINAPI WTSUnRegisterSessionNotificationEx (HANDLE hServer, HWND hWnd)
 
BOOL WINAPI WTSVirtualChannelClose (HANDLE hChannelHandle)
 
HANDLE WINAPI WTSVirtualChannelOpen (HANDLE hServer, DWORD SessionId, LPSTR pVirtualName)
 
HANDLE WINAPI WTSVirtualChannelOpenEx (DWORD SessionId, LPSTR pVirtualName, DWORD flags)
 
BOOL WINAPI WTSVirtualChannelPurgeInput (HANDLE hChannelHandle)
 
BOOL WINAPI WTSVirtualChannelPurgeOutput (HANDLE hChannelHandle)
 
BOOL WINAPI WTSVirtualChannelQuery (HANDLE hChannelHandle, WTS_VIRTUAL_CLASS WtsVirtualClass, PVOID *ppBuffer, DWORD *pBytesReturned)
 
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 WTSWaitSystemEvent (HANDLE hServer, DWORD Mask, DWORD *Flags)
 

Macro Definition Documentation

◆ WIN32_NO_STATUS

#define WIN32_NO_STATUS

Definition at line 21 of file wtsapi32.c.

Function Documentation

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( wtsapi  )

◆ WTSCloseServer()

void WINAPI WTSCloseServer ( HANDLE  hServer)

Definition at line 38 of file wtsapi32.c.

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

◆ WTSConnectSessionA()

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

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 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  LogonId,
ULONG  TargetLogonId,
PWSTR  pPassword,
BOOL  bWait 
)

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 debugstr_w
Definition: kernel32.h:32

◆ WTSDisconnectSession()

BOOL WINAPI WTSDisconnectSession ( HANDLE  hServer,
DWORD  SessionId,
BOOL  bWait 
)

Definition at line 64 of file wtsapi32.c.

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

◆ WTSEnableChildSessions()

BOOL WINAPI WTSEnableChildSessions ( BOOL  enable)

Definition at line 73 of file wtsapi32.c.

74{
75 FIXME("Stub %d\n", enable);
76 return TRUE;
77}
GLboolean enable
Definition: glext.h:11120

◆ WTSEnumerateProcessesA()

BOOL WINAPI WTSEnumerateProcessesA ( HANDLE  hServer,
DWORD  Reserved,
DWORD  Version,
PWTS_PROCESS_INFOA ppProcessInfo,
DWORD pCount 
)

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 NULL
Definition: types.h:112
#define FALSE
Definition: types.h:117
_Must_inspect_result_ _In_ WDFDEVICE _In_ LPCGUID _Out_ PINTERFACE _In_ USHORT _In_ USHORT Version
Definition: wdffdo.h:469
_Reserved_ PVOID Reserved
Definition: winddi.h:3974

◆ WTSEnumerateProcessesExA()

BOOL WINAPI WTSEnumerateProcessesExA ( HANDLE  server,
DWORD level,
DWORD  session_id,
char **  info,
DWORD count 
)

Definition at line 93 of file wtsapi32.c.

94{
95 FIXME("Stub %p %p %d %p %p\n", server, level, session_id, info, count);
96 if (count) *count = 0;
97 return FALSE;
98}
GLint level
Definition: gl.h:1546
GLuint GLuint GLsizei count
Definition: gl.h:1545
static rfbScreenInfoPtr server
Definition: vnc.c:74

◆ WTSEnumerateProcessesExW()

BOOL WINAPI WTSEnumerateProcessesExW ( HANDLE  server,
DWORD level,
DWORD  session_id,
WCHAR **  info,
DWORD count 
)

Definition at line 83 of file wtsapi32.c.

84{
85 FIXME("Stub %p %p %d %p %p\n", server, level, session_id, info, count);
86 if (count) *count = 0;
87 return FALSE;
88}

◆ WTSEnumerateProcessesW()

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

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;
148 if (!buf)
149 {
151 return FALSE;
152 }
154 }
156
157 if (status != STATUS_SUCCESS)
158 {
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 {
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
202 return TRUE;
203}
LONG NTSTATUS
Definition: precomp.h:26
#define HandleToUlong(h)
Definition: basetsd.h:79
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13
#define GetProcessHeap()
Definition: compat.h:736
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:102
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define SetLastError(x)
Definition: compat.h:752
#define HeapAlloc
Definition: compat.h:733
#define HeapFree(x, y, z)
Definition: compat.h:735
unsigned long DWORD
Definition: ntddk_ex.h:95
@ SystemProcessInformation
Definition: ntddk_ex.h:16
GLsizeiptr size
Definition: glext.h:5919
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
NTSYSAPI ULONG WINAPI RtlNtStatusToDosError(NTSTATUS)
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define STATUS_SUCCESS
Definition: shellext.h:65
NTSYSAPI NTSTATUS NTAPI NtQuerySystemInformation(IN SYSTEM_INFORMATION_CLASS SystemInfoClass, OUT PVOID SystemInfoBuffer, IN ULONG SystemInfoBufferSize, OUT PULONG BytesReturned OPTIONAL)
LPWSTR pProcessName
Definition: wtsapi32.h:133
Definition: name.c:39
Definition: ps.c:97
uint32_t ULONG
Definition: typedefs.h:59
char * PCHAR
Definition: typedefs.h:51
#define STATUS_INFO_LENGTH_MISMATCH
Definition: udferr_usr.h:133
#define WTS_CURRENT_SERVER_HANDLE
Definition: wtsapi32.h:197
struct _WTS_PROCESS_INFOW WTS_PROCESS_INFOW
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by test_WTSEnumerateProcessesW().

◆ WTSEnumerateServersA()

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

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}

◆ WTSEnumerateServersW()

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

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}

◆ WTSEnumerateSessionsA()

BOOL WINAPI WTSEnumerateSessionsA ( HANDLE  hServer,
DWORD  Reserved,
DWORD  Version,
PWTS_SESSION_INFOA ppSessionInfo,
DWORD pCount 
)

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}

◆ WTSEnumerateSessionsExA()

BOOL WINAPI WTSEnumerateSessionsExA ( HANDLE  server,
DWORD level,
DWORD  filter,
WTS_SESSION_INFO_1A info,
DWORD count 
)

Definition at line 237 of file wtsapi32.c.

238{
239 FIXME("Stub %p %p %d %p %p\n", server, level, filter, info, count);
240 if (count) *count = 0;
241 return FALSE;
242}
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
Definition: glext.h:7005

◆ WTSEnumerateSessionsExW()

BOOL WINAPI WTSEnumerateSessionsExW ( HANDLE  server,
DWORD level,
DWORD  filter,
WTS_SESSION_INFO_1W info,
DWORD count 
)

Definition at line 227 of file wtsapi32.c.

228{
229 FIXME("Stub %p %p %d %p %p\n", server, level, filter, info, count);
230 if (count) *count = 0;
231 return FALSE;
232}

◆ WTSEnumerateSessionsW()

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

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}

◆ WTSFreeMemory()

void WINAPI WTSFreeMemory ( PVOID  pMemory)

Definition at line 283 of file wtsapi32.c.

284{
286}
static BOOL heap_free(void *mem)
Definition: appwiz.h:76
FxMemoryObject * pMemory

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

◆ WTSFreeMemoryExA()

BOOL WINAPI WTSFreeMemoryExA ( WTS_TYPE_CLASS  type,
void ptr,
ULONG  nmemb 
)

Definition at line 291 of file wtsapi32.c.

292{
293 TRACE("%d %p %d\n", type, ptr, nmemb);
294 heap_free(ptr);
295 return TRUE;
296}
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
static PVOID ptr
Definition: dispmode.c:27
#define TRACE(s)
Definition: solgame.cpp:4

◆ WTSFreeMemoryExW()

BOOL WINAPI WTSFreeMemoryExW ( WTS_TYPE_CLASS  type,
void ptr,
ULONG  nmemb 
)

Definition at line 301 of file wtsapi32.c.

302{
303 TRACE("%d %p %d\n", type, ptr, nmemb);
304 heap_free(ptr);
305 return TRUE;
306}

◆ WTSLogoffSession()

BOOL WINAPI WTSLogoffSession ( HANDLE  hserver,
DWORD  session_id,
BOOL  bwait 
)

Definition at line 312 of file wtsapi32.c.

313{
314 FIXME("(%p, 0x%x, %d): stub\n", hserver, session_id, bwait);
316 return FALSE;
317}

◆ WTSOpenServerA()

HANDLE WINAPI WTSOpenServerA ( LPSTR  pServerName)

Definition at line 343 of file wtsapi32.c.

344{
345 FIXME("(%s) stub\n", debugstr_a(pServerName));
347 return NULL;
348}

◆ WTSOpenServerExA()

HANDLE WINAPI WTSOpenServerExA ( char server_name)

Definition at line 333 of file wtsapi32.c.

334{
335 FIXME("(%s) stub\n", debugstr_a(server_name));
337 return NULL;
338}
char * server_name
Definition: widl.c:145

◆ WTSOpenServerExW()

HANDLE WINAPI WTSOpenServerExW ( WCHAR server_name)

Definition at line 323 of file wtsapi32.c.

324{
325 FIXME("(%s) stub\n", debugstr_w(server_name));
327 return NULL;
328}

◆ WTSOpenServerW()

HANDLE WINAPI WTSOpenServerW ( LPWSTR  pServerName)

Definition at line 353 of file wtsapi32.c.

354{
355 FIXME("(%s) stub\n", debugstr_w(pServerName));
357 return NULL;
358}

◆ WTSQuerySessionInformationA()

BOOL WINAPI WTSQuerySessionInformationA ( HANDLE  hServer,
DWORD  SessionId,
WTS_INFO_CLASS  WTSInfoClass,
LPSTR Buffer,
DWORD BytesReturned 
)

Definition at line 363 of file wtsapi32.c.

369{
370#ifdef __REACTOS__
371 const size_t wcsErrorCode = -1;
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 {
397 case WTSOEMId:
398 case WTSUserName:
400 case WTSDomainName:
401 case WTSClientName:
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}
Definition: bufpool.h:45
unsigned int BOOL
Definition: ntddk_ex.h:94
GLuint buffer
Definition: glext.h:5915
GLenum GLsizei len
Definition: glext.h:6722
GLuint64EXT * result
Definition: glext.h:11304
size_t __cdecl wcstombs(_Out_writes_opt_z_(_MaxCount) char *_Dest, _In_z_ const wchar_t *_Source, _In_ size_t _MaxCount)
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_ ULONG _In_opt_ PWDF_MEMORY_DESCRIPTOR _In_opt_ PWDF_MEMORY_DESCRIPTOR _In_opt_ PWDF_REQUEST_SEND_OPTIONS _Out_opt_ PULONG_PTR BytesReturned
Definition: wdfiotarget.h:1052
#define ERROR_INVALID_USER_BUFFER
Definition: winerror.h:1091
void WINAPI WTSFreeMemory(PVOID pMemory)
Definition: wtsapi32.c:283
BOOL WINAPI WTSQuerySessionInformationW(HANDLE hServer, DWORD SessionId, WTS_INFO_CLASS WTSInfoClass, LPWSTR *Buffer, DWORD *BytesReturned)
Definition: wtsapi32.c:443
@ WTSWorkingDirectory
Definition: wtsapi32.h:47
@ WTSWinStationName
Definition: wtsapi32.h:51
@ WTSApplicationName
Definition: wtsapi32.h:46
@ WTSOEMId
Definition: wtsapi32.h:48
@ WTSDomainName
Definition: wtsapi32.h:52
@ WTSInitialProgram
Definition: wtsapi32.h:45
@ WTSUserName
Definition: wtsapi32.h:50
@ WTSClientDirectory
Definition: wtsapi32.h:56
@ WTSClientName
Definition: wtsapi32.h:55
char * LPSTR
Definition: xmlstorage.h:182
WCHAR * LPWSTR
Definition: xmlstorage.h:184

◆ WTSQuerySessionInformationW()

BOOL WINAPI WTSQuerySessionInformationW ( HANDLE  hServer,
DWORD  SessionId,
WTS_INFO_CLASS  WTSInfoClass,
LPWSTR Buffer,
DWORD BytesReturned 
)

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;
482 return TRUE;
483 }
484
485 case WTSUserName:
486 {
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;
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;
533 return TRUE;
534 }
535
536#if (NTDDI_VERSION >= NTDDI_WS08)
537 case WTSIdleTime:
538 case WTSLogonTime:
539 case WTSIncomingBytes:
540 case WTSOutgoingBytes:
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 {
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}
static void * heap_alloc(size_t len)
Definition: appwiz.h:66
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
#define ERROR_INSUFFICIENT_BUFFER
Definition: dderror.h:10
BOOL WINAPI GetUserNameW(LPWSTR lpszName, LPDWORD lpSize)
Definition: misc.c:291
#define ERROR_NOT_SUPPORTED
Definition: compat.h:100
unsigned short WORD
Definition: ntddk_ex.h:93
#define NtCurrentTeb
static WCHAR username[]
Definition: url.c:32
#define DWORD
Definition: nt_native.h:44
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
@ WTSClientProtocolType
Definition: wtsapi32.h:61
@ WTSIncomingBytes
Definition: wtsapi32.h:65
@ WTSOutgoingBytes
Definition: wtsapi32.h:66
@ WTSOutgoingFrames
Definition: wtsapi32.h:68
@ WTSLogonTime
Definition: wtsapi32.h:64
@ WTSConnectState
Definition: wtsapi32.h:53
@ WTSIncomingFrames
Definition: wtsapi32.h:67
@ WTSIdleTime
Definition: wtsapi32.h:63
@ WTSSessionId
Definition: wtsapi32.h:49
@ WTSIsRemoteSession
Definition: wtsapi32.h:75

Referenced by test_WTSQuerySessionInformationW(), and WTSQuerySessionInformationA().

◆ WTSQueryUserConfigA()

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

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}
static LPWSTR pUserName

◆ WTSQueryUserConfigW()

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

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}

◆ WTSQueryUserToken()

BOOL WINAPI WTSQueryUserToken ( ULONG  session_id,
PHANDLE  token 
)

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 GetCurrentProcess()
Definition: compat.h:759
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
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 GetCurrentProcessToken()
Definition: security.c:40
#define DUPLICATE_SAME_ACCESS

Referenced by test_WTSQueryUserToken().

◆ WTSRegisterSessionNotification()

BOOL WINAPI WTSRegisterSessionNotification ( HWND  hWnd,
DWORD  dwFlags 
)

Definition at line 627 of file wtsapi32.c.

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

◆ WTSRegisterSessionNotificationEx()

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

Definition at line 636 of file wtsapi32.c.

637{
638 FIXME("Stub %p %p 0x%08x\n", hServer, hWnd, dwFlags);
639 return FALSE;
640}

◆ WTSSendMessageA()

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

Definition at line 646 of file wtsapi32.c.

648{
649 FIXME("Stub %p 0x%08x (%s) %d (%s) %d 0x%08x %d %p %d\n", hServer, SessionId, debugstr_a(pTitle), TitleLength, debugstr_a(pMessage), MessageLength, Style, Timeout, pResponse, bWait);
650 return FALSE;
651}
const DWORD Style
Definition: appswitch.c:71
static ULONG Timeout
Definition: ping.c:61

◆ WTSSendMessageW()

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

Definition at line 656 of file wtsapi32.c.

658{
659 FIXME("Stub %p 0x%08x (%s) %d (%s) %d 0x%08x %d %p %d\n", hServer, SessionId, debugstr_w(pTitle), TitleLength, debugstr_w(pMessage), MessageLength, Style, Timeout, pResponse, bWait);
660 return FALSE;
661}

◆ WTSSetUserConfigA()

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

Definition at line 666 of file wtsapi32.c.

667{
668 FIXME("Stub (%s) (%s) 0x%08x %p %d\n", debugstr_a(pServerName), debugstr_a(pUserName), WTSConfigClass,pBuffer, DataLength);
669 return FALSE;
670}
_In_ ULONG _In_opt_ WDFREQUEST _In_opt_ PVOID _In_ size_t _In_ PVOID _In_ size_t _Out_ size_t * DataLength
Definition: cdrom.h:1444
PVOID pBuffer

◆ WTSSetUserConfigW()

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

Definition at line 675 of file wtsapi32.c.

676{
677 FIXME("Stub (%s) (%s) 0x%08x %p %d\n", debugstr_w(pServerName), debugstr_w(pUserName), WTSConfigClass,pBuffer, DataLength);
678 return FALSE;
679}

◆ WTSShutdownSystem()

BOOL WINAPI WTSShutdownSystem ( HANDLE  hServer,
DWORD  ShutdownFlag 
)

Definition at line 684 of file wtsapi32.c.

685{
686 FIXME("Stub %p 0x%08x\n", hServer,ShutdownFlag);
687 return FALSE;
688}

◆ WTSStartRemoteControlSessionA()

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

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}

◆ WTSStartRemoteControlSessionW()

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

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}

◆ WTSStopRemoteControlSession()

BOOL WINAPI WTSStopRemoteControlSession ( ULONG  LogonId)

Definition at line 711 of file wtsapi32.c.

712{
713 FIXME("Stub %d\n", LogonId);
714 return FALSE;
715}

◆ WTSTerminateProcess()

BOOL WINAPI WTSTerminateProcess ( HANDLE  hServer,
DWORD  ProcessId,
DWORD  ExitCode 
)

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:2711

◆ WTSUnRegisterSessionNotification()

BOOL WINAPI WTSUnRegisterSessionNotification ( HWND  hWnd)

Definition at line 729 of file wtsapi32.c.

730{
731 FIXME("Stub %p\n", hWnd);
732 return FALSE;
733}

◆ WTSUnRegisterSessionNotificationEx()

BOOL WINAPI WTSUnRegisterSessionNotificationEx ( HANDLE  hServer,
HWND  hWnd 
)

Definition at line 738 of file wtsapi32.c.

739{
740 FIXME("Stub %p %p\n", hServer, hWnd);
741 return FALSE;
742}

◆ WTSVirtualChannelClose()

BOOL WINAPI WTSVirtualChannelClose ( HANDLE  hChannelHandle)

Definition at line 748 of file wtsapi32.c.

749{
750 FIXME("Stub %p\n", hChannelHandle);
751 return FALSE;
752}

◆ WTSVirtualChannelOpen()

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

Definition at line 757 of file wtsapi32.c.

758{
759 FIXME("Stub %p %d (%s)\n", hServer, SessionId, debugstr_a(pVirtualName));
760 return NULL;
761}

◆ WTSVirtualChannelOpenEx()

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

Definition at line 766 of file wtsapi32.c.

767{
768 FIXME("Stub %d (%s) %d\n", SessionId, debugstr_a(pVirtualName), flags);
769 return NULL;
770}
GLbitfield flags
Definition: glext.h:7161

◆ WTSVirtualChannelPurgeInput()

BOOL WINAPI WTSVirtualChannelPurgeInput ( HANDLE  hChannelHandle)

Definition at line 775 of file wtsapi32.c.

776{
777 FIXME("Stub %p\n", hChannelHandle);
778 return FALSE;
779}

◆ WTSVirtualChannelPurgeOutput()

BOOL WINAPI WTSVirtualChannelPurgeOutput ( HANDLE  hChannelHandle)

Definition at line 784 of file wtsapi32.c.

785{
786 FIXME("Stub %p\n", hChannelHandle);
787 return FALSE;
788}

◆ WTSVirtualChannelQuery()

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

Definition at line 794 of file wtsapi32.c.

795{
796 FIXME("Stub %p %d %p %p\n", hChannelHandle, WtsVirtualClass, ppBuffer, pBytesReturned);
797 return FALSE;
798}

◆ WTSVirtualChannelRead()

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

Definition at line 803 of file wtsapi32.c.

804{
805 FIXME("Stub %p %d %p %d %p\n", hChannelHandle, TimeOut, Buffer, BufferSize, pBytesRead);
806 return FALSE;
807}
_In_ WDFMEMORY _Out_opt_ size_t * BufferSize
Definition: wdfmemory.h:254

◆ WTSVirtualChannelWrite()

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

Definition at line 812 of file wtsapi32.c.

813{
814 FIXME("Stub %p %p %d %p\n", hChannelHandle, Buffer, Length, pBytesWritten);
815 return FALSE;
816}
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102

◆ WTSWaitSystemEvent()

BOOL WINAPI WTSWaitSystemEvent ( HANDLE  hServer,
DWORD  Mask,
DWORD Flags 
)

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}
unsigned int Mask
Definition: fpcontrol.c:82
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170