ReactOS 0.4.15-dev-7693-gd0e2924
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{
@ WTSUserConfigAllowLogonTerminalServer
Definition: wtsapi32.h:98
@ WTSUserConfigModemCallbackPhoneNumber
Definition: wtsapi32.h:107
@ WTSUserConfigTerminalServerProfilePath
Definition: wtsapi32.h:109
@ WTSUserConfigTimeoutSettingsIdle
Definition: wtsapi32.h:101
@ WTSUserConfigModemCallbackSettings
Definition: wtsapi32.h:106
@ WTSUserConfigTimeoutSettingsDisconnections
Definition: wtsapi32.h:100
@ WTSUserConfigTerminalServerHomeDirectory
Definition: wtsapi32.h:110
@ WTSUserConfigTimeoutSettingsConnections
Definition: wtsapi32.h:99
@ WTSUserConfigDeviceClientPrinters
Definition: wtsapi32.h:103
@ WTSUserConfigDeviceClientDefaultPrinter
Definition: wtsapi32.h:104
@ WTSUserConfigInitialProgram
Definition: wtsapi32.h:95
@ WTSUserConfigBrokenTimeoutSettings
Definition: wtsapi32.h:105
@ WTSUserConfigWorkingDirectory
Definition: wtsapi32.h:96
@ WTSUserConfigShadowSettings
Definition: wtsapi32.h:108
@ WTSUserConfigInheritInitialProgram
Definition: wtsapi32.h:97
@ WTSUserConfigDeviceClientDrives
Definition: wtsapi32.h:102
@ WTSUserConfigfTerminalServerRemoteHomeDir
Definition: wtsapi32.h:111
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{
86 WTSIdle,
89 WTSDown,
enum _WTS_CONNECTSTATE_CLASS WTS_CONNECTSTATE_CLASS
@ WTSDisconnected
Definition: wtsapi32.h:85
@ WTSDown
Definition: wtsapi32.h:89
@ WTSActive
Definition: wtsapi32.h:81
@ WTSConnected
Definition: wtsapi32.h:82
@ WTSInit
Definition: wtsapi32.h:90
@ WTSConnectQuery
Definition: wtsapi32.h:83
@ WTSIdle
Definition: wtsapi32.h:86
@ WTSReset
Definition: wtsapi32.h:88
@ WTSListen
Definition: wtsapi32.h:87
@ WTSShadow
Definition: wtsapi32.h:84

◆ _WTS_TYPE_CLASS

Enumerator
WTSTypeProcessInfoLevel0 
WTSTypeProcessInfoLevel1 
WTSTypeSessionInfoLevel1 

Definition at line 114 of file wtsapi32.h.

115{
@ WTSTypeProcessInfoLevel0
Definition: wtsapi32.h:116
@ WTSTypeProcessInfoLevel1
Definition: wtsapi32.h:117
@ WTSTypeSessionInfoLevel1
Definition: wtsapi32.h:118
enum _WTS_TYPE_CLASS WTS_TYPE_CLASS

◆ _WTS_VIRTUAL_CLASS

Enumerator
WTSVirtualClientData 
WTSVirtualFileHandle 

Definition at line 37 of file wtsapi32.h.

38{
enum _WTS_VIRTUAL_CLASS WTS_VIRTUAL_CLASS
@ WTSVirtualClientData
Definition: wtsapi32.h:39
@ WTSVirtualFileHandle
Definition: wtsapi32.h:40

◆ 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{
62#if (NTDDI_VERSION >= NTDDI_WS08)
76#endif /* (NTDDI_VERSION >= NTDDI_WS08) */
enum tagWTS_INFO_CLASS WTS_INFO_CLASS
@ WTSWorkingDirectory
Definition: wtsapi32.h:47
@ WTSWinStationName
Definition: wtsapi32.h:51
@ WTSApplicationName
Definition: wtsapi32.h:46
@ WTSClientProtocolType
Definition: wtsapi32.h:61
@ WTSIncomingBytes
Definition: wtsapi32.h:65
@ WTSOEMId
Definition: wtsapi32.h:48
@ WTSClientDisplay
Definition: wtsapi32.h:60
@ WTSConfigInfo
Definition: wtsapi32.h:72
@ WTSOutgoingBytes
Definition: wtsapi32.h:66
@ WTSClientBuildNumber
Definition: wtsapi32.h:54
@ WTSClientInfo
Definition: wtsapi32.h:69
@ WTSDomainName
Definition: wtsapi32.h:52
@ WTSOutgoingFrames
Definition: wtsapi32.h:68
@ WTSInitialProgram
Definition: wtsapi32.h:45
@ WTSSessionInfoEx
Definition: wtsapi32.h:71
@ WTSLogonTime
Definition: wtsapi32.h:64
@ WTSSessionAddressV4
Definition: wtsapi32.h:74
@ WTSSessionInfo
Definition: wtsapi32.h:70
@ WTSValidationInfo
Definition: wtsapi32.h:73
@ WTSUserName
Definition: wtsapi32.h:50
@ WTSConnectState
Definition: wtsapi32.h:53
@ WTSClientProductId
Definition: wtsapi32.h:57
@ WTSIncomingFrames
Definition: wtsapi32.h:67
@ WTSClientHardwareId
Definition: wtsapi32.h:58
@ WTSClientDirectory
Definition: wtsapi32.h:56
@ WTSIdleTime
Definition: wtsapi32.h:63
@ WTSClientAddress
Definition: wtsapi32.h:59
@ WTSSessionId
Definition: wtsapi32.h:49
@ WTSClientName
Definition: wtsapi32.h:55
@ WTSIsRemoteSession
Definition: wtsapi32.h:75

Function Documentation

◆ 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:111

◆ 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

◆ 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
GLuint GLuint GLsizei count
Definition: gl.h:1545
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}

◆ 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().

◆ 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}

◆ 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
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

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}

◆ 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}

◆ 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