xref: /reactos/sdk/include/psdk/wtsapi32.h (revision d6d1efe7)
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
23 extern "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 
37 typedef enum _WTS_VIRTUAL_CLASS
38 {
39     WTSVirtualClientData,
40     WTSVirtualFileHandle
41 } WTS_VIRTUAL_CLASS;
42 
43 typedef 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 
79 typedef 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 
93 typedef 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 
114 typedef struct _WTS_PROCESS_INFOA
115 {
116     DWORD SessionId;
117     DWORD ProcessId;
118     LPSTR pProcessName;
119     PSID pUserSid;
120 } WTS_PROCESS_INFOA, *PWTS_PROCESS_INFOA;
121 
122 typedef struct _WTS_PROCESS_INFOW
123 {
124     DWORD SessionId;
125     DWORD ProcessId;
126     LPWSTR pProcessName;
127     PSID pUserSid;
128 } WTS_PROCESS_INFOW, *PWTS_PROCESS_INFOW;
129 
130 DECL_WINELIB_TYPE_AW(WTS_PROCESS_INFO)
131 DECL_WINELIB_TYPE_AW(PWTS_PROCESS_INFO)
132 
133 typedef struct _WTS_SESSION_INFOA
134 {
135     DWORD SessionId;
136     LPSTR pWinStationName;
137     WTS_CONNECTSTATE_CLASS State;
138 } WTS_SESSION_INFOA, *PWTS_SESSION_INFOA;
139 
140 typedef struct _WTS_SESSION_INFOW
141 {
142     DWORD SessionId;
143     LPWSTR pWinStationName;
144     WTS_CONNECTSTATE_CLASS State;
145 } WTS_SESSION_INFOW, *PWTS_SESSION_INFOW;
146 
147 DECL_WINELIB_TYPE_AW(WTS_SESSION_INFO)
148 DECL_WINELIB_TYPE_AW(PWTS_SESSION_INFO)
149 
150 typedef struct _WTS_SERVER_INFOA
151 {
152     LPSTR pServerName;
153 } WTS_SERVER_INFOA, *PWTS_SERVER_INFOA;
154 
155 typedef struct _WTS_SERVER_INFOW
156 {
157     LPWSTR pServerName;
158 } WTS_SERVER_INFOW, *PWTS_SERVER_INFOW;
159 
160 DECL_WINELIB_TYPE_AW(WTS_SERVER_INFO)
161 DECL_WINELIB_TYPE_AW(PWTS_SERVER_INFO)
162 
163 #define WTS_CURRENT_SERVER_HANDLE ((HANDLE)NULL)
164 
165 void WINAPI WTSCloseServer(HANDLE);
166 BOOL WINAPI WTSConnectSessionA(ULONG, ULONG, PSTR, BOOL);
167 BOOL WINAPI WTSConnectSessionW(ULONG, ULONG, PWSTR, BOOL);
168 #define     WTSConnectSession WINELIB_NAME_AW(WTSConnectSession)
169 BOOL WINAPI WTSDisconnectSession(HANDLE, DWORD, BOOL);
170 BOOL WINAPI WTSEnumerateProcessesA(HANDLE, DWORD, DWORD, PWTS_PROCESS_INFOA *, DWORD *);
171 BOOL WINAPI WTSEnumerateProcessesW(HANDLE, DWORD, DWORD, PWTS_PROCESS_INFOW *, DWORD *);
172 #define     WTSEnumerateProcesses WINELIB_NAME_AW(WTSEnumerateProcesses)
173 BOOL WINAPI WTSEnumerateServersA( LPSTR, DWORD, DWORD, PWTS_SERVER_INFOA*, DWORD*);
174 BOOL WINAPI WTSEnumerateServersW( LPWSTR, DWORD, DWORD, PWTS_SERVER_INFOW*, DWORD*);
175 #define     WTSEnumerateServers WINELIB_NAME_AW(WTSEnumerateServers)
176 BOOL WINAPI WTSEnumerateSessionsA(HANDLE, DWORD, DWORD, PWTS_SESSION_INFOA *, DWORD *);
177 BOOL WINAPI WTSEnumerateSessionsW(HANDLE, DWORD, DWORD, PWTS_SESSION_INFOW *, DWORD *);
178 #define     WTSEnumerateSessions WINELIB_NAME_AW(WTSEnumerateSessions)
179 void WINAPI WTSFreeMemory(PVOID);
180 HANDLE WINAPI WTSOpenServerA(LPSTR);
181 HANDLE WINAPI WTSOpenServerW(LPWSTR);
182 #define     WTSOpenServer WINELIB_NAME_AW(WTSOpenServer)
183 BOOL WINAPI WTSQuerySessionInformationA(HANDLE, DWORD, WTS_INFO_CLASS, LPSTR *, DWORD *);
184 BOOL WINAPI WTSQuerySessionInformationW(HANDLE, DWORD, WTS_INFO_CLASS, LPWSTR *, DWORD *);
185 #define     WTSQuerySessionInformation WINELIB_NAME_AW(WTSQuerySessionInformation)
186 BOOL WINAPI WTSQueryUserConfigA(LPSTR,LPSTR,WTS_CONFIG_CLASS,LPSTR*,DWORD*);
187 BOOL WINAPI WTSQueryUserConfigW(LPWSTR,LPWSTR,WTS_CONFIG_CLASS,LPWSTR*,DWORD*);
188 #define     WTSQueryUserConfig WINELIB_NAME_AW(WTSQueryUserConfig)
189 BOOL WINAPI WTSQueryUserToken(ULONG, PHANDLE);
190 BOOL WINAPI WTSRegisterSessionNotification(HWND, DWORD);
191 BOOL WINAPI WTSRegisterSessionNotificationEx(HANDLE, HWND, DWORD);
192 BOOL WINAPI WTSStartRemoteControlSessionA(LPSTR, ULONG, BYTE, USHORT);
193 BOOL WINAPI WTSStartRemoteControlSessionW(LPWSTR, ULONG, BYTE, USHORT);
194 #define     WTSStartRemoteControlSession WINELIB_NAME_AW(WTSStartRemoteControlSession)
195 BOOL WINAPI WTSStopRemoteControlSession(ULONG);
196 BOOL WINAPI WTSTerminateProcess(HANDLE, DWORD, DWORD);
197 BOOL WINAPI WTSUnRegisterSessionNotification(HWND);
198 BOOL WINAPI WTSUnRegisterSessionNotificationEx(HANDLE, HWND);
199 BOOL WINAPI WTSWaitSystemEvent(HANDLE, DWORD, DWORD*);
200 
201 #ifdef __cplusplus
202 }
203 #endif
204 
205 #endif
206