Reactos
1/*
2 * Copyright 2005 Ulrich Czekalla (For CodeWeavers)
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
17 */
18
19#ifndef __WINE_WTSAPI32_H
20#define __WINE_WTSAPI32_H
21
22#ifdef __cplusplus
23extern "C" {
24#endif
25
26/*
27 * pResponse values from WTSSendMessage(), in addition
28 * to those from the standard MessageBox() API.
29 */
30#ifndef IDTIMEOUT
31#define IDTIMEOUT 32000
32#endif
33#ifndef IDASYNC
34#define IDASYNC 32001
35#endif
36
37typedef enum _WTS_VIRTUAL_CLASS
38{
39 WTSVirtualClientData,
40 WTSVirtualFileHandle
41} WTS_VIRTUAL_CLASS;
42
43typedef enum tagWTS_INFO_CLASS
44{
45 WTSInitialProgram,
46 WTSApplicationName,
47 WTSWorkingDirectory,
48 WTSOEMId,
49 WTSSessionId,
50 WTSUserName,
51 WTSWinStationName,
52 WTSDomainName,
53 WTSConnectState,
54 WTSClientBuildNumber,
55 WTSClientName,
56 WTSClientDirectory,
57 WTSClientProductId,
58 WTSClientHardwareId,
59 WTSClientAddress,
60 WTSClientDisplay,
61 WTSClientProtocolType,
62#if (NTDDI_VERSION >= NTDDI_WS08)
63 WTSIdleTime,
64 WTSLogonTime,
65 WTSIncomingBytes,
66 WTSOutgoingBytes,
67 WTSIncomingFrames,
68 WTSOutgoingFrames,
69 WTSClientInfo,
70 WTSSessionInfo,
71 WTSSessionInfoEx,
72 WTSConfigInfo,
73 WTSValidationInfo,
74 WTSSessionAddressV4,
75 WTSIsRemoteSession
76#endif /* (NTDDI_VERSION >= NTDDI_WS08) */
77} WTS_INFO_CLASS;
78
79typedef enum _WTS_CONNECTSTATE_CLASS
80{
81 WTSActive,
82 WTSConnected,
83 WTSConnectQuery,
84 WTSShadow,
85 WTSDisconnected,
86 WTSIdle,
87 WTSListen,
88 WTSReset,
89 WTSDown,
90 WTSInit
91} WTS_CONNECTSTATE_CLASS;
92
93typedef enum _WTS_CONFIG_CLASS
94{
95 WTSUserConfigInitialProgram,
96 WTSUserConfigWorkingDirectory,
97 WTSUserConfigInheritInitialProgram,
98 WTSUserConfigAllowLogonTerminalServer,
99 WTSUserConfigTimeoutSettingsConnections,
100 WTSUserConfigTimeoutSettingsDisconnections,
101 WTSUserConfigTimeoutSettingsIdle,
102 WTSUserConfigDeviceClientDrives,
103 WTSUserConfigDeviceClientPrinters,
104 WTSUserConfigDeviceClientDefaultPrinter,
105 WTSUserConfigBrokenTimeoutSettings,
106 WTSUserConfigModemCallbackSettings,
107 WTSUserConfigModemCallbackPhoneNumber,
108 WTSUserConfigShadowSettings,
109 WTSUserConfigTerminalServerProfilePath,
110 WTSUserConfigTerminalServerHomeDirectory,
111 WTSUserConfigfTerminalServerRemoteHomeDir
112} WTS_CONFIG_CLASS;
113
114typedef enum _WTS_TYPE_CLASS
115{
116 WTSTypeProcessInfoLevel0,
117 WTSTypeProcessInfoLevel1,
118 WTSTypeSessionInfoLevel1
119} WTS_TYPE_CLASS;
120
121typedef struct _WTS_PROCESS_INFOA
122{
123 DWORD SessionId;
124 DWORD ProcessId;
125 LPSTR pProcessName;
126 PSID pUserSid;
127} WTS_PROCESS_INFOA, *PWTS_PROCESS_INFOA;
128
129typedef struct _WTS_PROCESS_INFOW
130{
131 DWORD SessionId;
132 DWORD ProcessId;
133 LPWSTR pProcessName;
134 PSID pUserSid;
135} WTS_PROCESS_INFOW, *PWTS_PROCESS_INFOW;
136
137DECL_WINELIB_TYPE_AW(WTS_PROCESS_INFO)
138DECL_WINELIB_TYPE_AW(PWTS_PROCESS_INFO)
139
140typedef struct _WTS_SESSION_INFOA
141{
142 DWORD SessionId;
143 LPSTR pWinStationName;
144 WTS_CONNECTSTATE_CLASS State;
145} WTS_SESSION_INFOA, *PWTS_SESSION_INFOA;
146
147typedef struct _WTS_SESSION_INFOW
148{
149 DWORD SessionId;
150 LPWSTR pWinStationName;
151 WTS_CONNECTSTATE_CLASS State;
152} WTS_SESSION_INFOW, *PWTS_SESSION_INFOW;
153
154DECL_WINELIB_TYPE_AW(WTS_SESSION_INFO)
155DECL_WINELIB_TYPE_AW(PWTS_SESSION_INFO)
156
157typedef struct _WTS_SESSION_INFO_1A
158{
159 DWORD ExecEnvId;
160 WTS_CONNECTSTATE_CLASS State;
161 DWORD SessionId;
162 char *pSessionName;
163 char *pHostName;
164 char *pUserName;
165 char *pDomainName;
166 char *pFarmName;
167} WTS_SESSION_INFO_1A, *PWTS_SESSION_INFO_1A;
168
169typedef struct _WTS_SESSION_INFO_1W
170{
171 DWORD ExecEnvId;
172 WTS_CONNECTSTATE_CLASS State;
173 DWORD SessionId;
174 WCHAR *pSessionName;
175 WCHAR *pHostName;
176 WCHAR *pUserName;
177 WCHAR *pDomainName;
178 WCHAR *pFarmName;
179} WTS_SESSION_INFO_1W, *PWTS_SESSION_INFO_1W;
180
181DECL_WINELIB_TYPE_AW(WTS_SESSION_INFO_1)
182DECL_WINELIB_TYPE_AW(PWTS_SESSION_INFO_1)
183
184typedef struct _WTS_SERVER_INFOA
185{
186 LPSTR pServerName;
187} WTS_SERVER_INFOA, *PWTS_SERVER_INFOA;
188
189typedef struct _WTS_SERVER_INFOW
190{
191 LPWSTR pServerName;
192} WTS_SERVER_INFOW, *PWTS_SERVER_INFOW;
193
194DECL_WINELIB_TYPE_AW(WTS_SERVER_INFO)
195DECL_WINELIB_TYPE_AW(PWTS_SERVER_INFO)
196
197#define WTS_CURRENT_SERVER_HANDLE ((HANDLE)NULL)
198#define WTS_CURRENT_SESSION (~0u)
199
200void WINAPI WTSCloseServer(HANDLE);
201BOOL WINAPI WTSConnectSessionA(ULONG, ULONG, PSTR, BOOL);
202BOOL WINAPI WTSConnectSessionW(ULONG, ULONG, PWSTR, BOOL);
203#define WTSConnectSession WINELIB_NAME_AW(WTSConnectSession)
204BOOL WINAPI WTSDisconnectSession(HANDLE, DWORD, BOOL);
205BOOL WINAPI WTSEnableChildSessions(BOOL);
206BOOL WINAPI WTSEnumerateProcessesA(HANDLE, DWORD, DWORD, PWTS_PROCESS_INFOA *, DWORD *);
207BOOL WINAPI WTSEnumerateProcessesW(HANDLE, DWORD, DWORD, PWTS_PROCESS_INFOW *, DWORD *);
208#define WTSEnumerateProcesses WINELIB_NAME_AW(WTSEnumerateProcesses)
209BOOL WINAPI WTSEnumerateServersA( LPSTR, DWORD, DWORD, PWTS_SERVER_INFOA*, DWORD*);
210BOOL WINAPI WTSEnumerateServersW( LPWSTR, DWORD, DWORD, PWTS_SERVER_INFOW*, DWORD*);
211#define WTSEnumerateServers WINELIB_NAME_AW(WTSEnumerateServers)
212BOOL WINAPI WTSEnumerateSessionsA(HANDLE, DWORD, DWORD, PWTS_SESSION_INFOA *, DWORD *);
213BOOL WINAPI WTSEnumerateSessionsW(HANDLE, DWORD, DWORD, PWTS_SESSION_INFOW *, DWORD *);
214#define WTSEnumerateSessions WINELIB_NAME_AW(WTSEnumerateSessions)
215void WINAPI WTSFreeMemory(PVOID);
216HANDLE WINAPI WTSOpenServerA(LPSTR);
217HANDLE WINAPI WTSOpenServerW(LPWSTR);
218#define WTSOpenServer WINELIB_NAME_AW(WTSOpenServer)
219BOOL WINAPI WTSQuerySessionInformationA(HANDLE, DWORD, WTS_INFO_CLASS, LPSTR *, DWORD *);
220BOOL WINAPI WTSQuerySessionInformationW(HANDLE, DWORD, WTS_INFO_CLASS, LPWSTR *, DWORD *);
221#define WTSQuerySessionInformation WINELIB_NAME_AW(WTSQuerySessionInformation)
222BOOL WINAPI WTSQueryUserConfigA(LPSTR,LPSTR,WTS_CONFIG_CLASS,LPSTR*,DWORD*);
223BOOL WINAPI WTSQueryUserConfigW(LPWSTR,LPWSTR,WTS_CONFIG_CLASS,LPWSTR*,DWORD*);
224#define WTSQueryUserConfig WINELIB_NAME_AW(WTSQueryUserConfig)
225BOOL WINAPI WTSQueryUserToken(ULONG, PHANDLE);
226BOOL WINAPI WTSRegisterSessionNotification(HWND, DWORD);
227BOOL WINAPI WTSRegisterSessionNotificationEx(HANDLE, HWND, DWORD);
228BOOL WINAPI WTSStartRemoteControlSessionA(LPSTR, ULONG, BYTE, USHORT);
229BOOL WINAPI WTSStartRemoteControlSessionW(LPWSTR, ULONG, BYTE, USHORT);
230#define WTSStartRemoteControlSession WINELIB_NAME_AW(WTSStartRemoteControlSession)
231BOOL WINAPI WTSStopRemoteControlSession(ULONG);
232BOOL WINAPI WTSTerminateProcess(HANDLE, DWORD, DWORD);
233BOOL WINAPI WTSUnRegisterSessionNotification(HWND);
234BOOL WINAPI WTSUnRegisterSessionNotificationEx(HANDLE, HWND);
235BOOL WINAPI WTSWaitSystemEvent(HANDLE, DWORD, DWORD*);
236
237#ifdef __cplusplus
238}
239#endif
240
241#endif