xref: /reactos/sdk/include/psdk/wtsapi32.h (revision 431643b9)
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 } WTS_INFO_CLASS;
63 
64 typedef enum _WTS_CONNECTSTATE_CLASS
65 {
66     WTSActive,
67     WTSConnected,
68     WTSConnectQuery,
69     WTSShadow,
70     WTSDisconnected,
71     WTSIdle,
72     WTSListen,
73     WTSReset,
74     WTSDown,
75     WTSInit
76 } WTS_CONNECTSTATE_CLASS;
77 
78 typedef enum _WTS_CONFIG_CLASS
79 {
80     WTSUserConfigInitialProgram,
81     WTSUserConfigWorkingDirectory,
82     WTSUserConfigInheritInitialProgram,
83     WTSUserConfigAllowLogonTerminalServer,
84     WTSUserConfigTimeoutSettingsConnections,
85     WTSUserConfigTimeoutSettingsDisconnections,
86     WTSUserConfigTimeoutSettingsIdle,
87     WTSUserConfigDeviceClientDrives,
88     WTSUserConfigDeviceClientPrinters,
89     WTSUserConfigDeviceClientDefaultPrinter,
90     WTSUserConfigBrokenTimeoutSettings,
91     WTSUserConfigModemCallbackSettings,
92     WTSUserConfigModemCallbackPhoneNumber,
93     WTSUserConfigShadowSettings,
94     WTSUserConfigTerminalServerProfilePath,
95     WTSUserConfigTerminalServerHomeDirectory,
96     WTSUserConfigfTerminalServerRemoteHomeDir
97 } WTS_CONFIG_CLASS;
98 
99 typedef struct _WTS_PROCESS_INFOA
100 {
101     DWORD SessionId;
102     DWORD ProcessId;
103     LPSTR pProcessName;
104     PSID pUserSid;
105 } WTS_PROCESS_INFOA, *PWTS_PROCESS_INFOA;
106 
107 typedef struct _WTS_PROCESS_INFOW
108 {
109     DWORD SessionId;
110     DWORD ProcessId;
111     LPWSTR pProcessName;
112     PSID pUserSid;
113 } WTS_PROCESS_INFOW, *PWTS_PROCESS_INFOW;
114 
115 DECL_WINELIB_TYPE_AW(WTS_PROCESS_INFO)
116 DECL_WINELIB_TYPE_AW(PWTS_PROCESS_INFO)
117 
118 typedef struct _WTS_SESSION_INFOA
119 {
120     DWORD SessionId;
121     LPSTR pWinStationName;
122     WTS_CONNECTSTATE_CLASS State;
123 } WTS_SESSION_INFOA, *PWTS_SESSION_INFOA;
124 
125 typedef struct _WTS_SESSION_INFOW
126 {
127     DWORD SessionId;
128     LPWSTR pWinStationName;
129     WTS_CONNECTSTATE_CLASS State;
130 } WTS_SESSION_INFOW, *PWTS_SESSION_INFOW;
131 
132 DECL_WINELIB_TYPE_AW(WTS_SESSION_INFO)
133 DECL_WINELIB_TYPE_AW(PWTS_SESSION_INFO)
134 
135 typedef struct _WTS_SERVER_INFOA
136 {
137     LPSTR pServerName;
138 } WTS_SERVER_INFOA, *PWTS_SERVER_INFOA;
139 
140 typedef struct _WTS_SERVER_INFOW
141 {
142     LPWSTR pServerName;
143 } WTS_SERVER_INFOW, *PWTS_SERVER_INFOW;
144 
145 DECL_WINELIB_TYPE_AW(WTS_SERVER_INFO)
146 DECL_WINELIB_TYPE_AW(PWTS_SERVER_INFO)
147 
148 #define WTS_CURRENT_SERVER_HANDLE ((HANDLE)NULL)
149 
150 void WINAPI WTSCloseServer(HANDLE);
151 BOOL WINAPI WTSConnectSessionA(ULONG, ULONG, PSTR, BOOL);
152 BOOL WINAPI WTSConnectSessionW(ULONG, ULONG, PWSTR, BOOL);
153 #define     WTSConnectSession WINELIB_NAME_AW(WTSConnectSession)
154 BOOL WINAPI WTSDisconnectSession(HANDLE, DWORD, BOOL);
155 BOOL WINAPI WTSEnumerateProcessesA(HANDLE, DWORD, DWORD, PWTS_PROCESS_INFOA *, DWORD *);
156 BOOL WINAPI WTSEnumerateProcessesW(HANDLE, DWORD, DWORD, PWTS_PROCESS_INFOW *, DWORD *);
157 #define     WTSEnumerateProcesses WINELIB_NAME_AW(WTSEnumerateProcesses)
158 BOOL WINAPI WTSEnumerateServersA( LPSTR, DWORD, DWORD, PWTS_SERVER_INFOA*, DWORD*);
159 BOOL WINAPI WTSEnumerateServersW( LPWSTR, DWORD, DWORD, PWTS_SERVER_INFOW*, DWORD*);
160 #define     WTSEnumerateServers WINELIB_NAME_AW(WTSEnumerateServers)
161 BOOL WINAPI WTSEnumerateSessionsA(HANDLE, DWORD, DWORD, PWTS_SESSION_INFOA *, DWORD *);
162 BOOL WINAPI WTSEnumerateSessionsW(HANDLE, DWORD, DWORD, PWTS_SESSION_INFOW *, DWORD *);
163 #define     WTSEnumerateSessions WINELIB_NAME_AW(WTSEnumerateSessions)
164 void WINAPI WTSFreeMemory(PVOID);
165 HANDLE WINAPI WTSOpenServerA(LPSTR);
166 HANDLE WINAPI WTSOpenServerW(LPWSTR);
167 #define     WTSOpenServer WINELIB_NAME_AW(WTSOpenServer)
168 BOOL WINAPI WTSQuerySessionInformationA(HANDLE, DWORD, WTS_INFO_CLASS, LPSTR *, DWORD *);
169 BOOL WINAPI WTSQuerySessionInformationW(HANDLE, DWORD, WTS_INFO_CLASS, LPWSTR *, DWORD *);
170 #define     WTSQuerySessionInformation WINELIB_NAME_AW(WTSQuerySessionInformation)
171 BOOL WINAPI WTSQueryUserConfigA(LPSTR,LPSTR,WTS_CONFIG_CLASS,LPSTR*,DWORD*);
172 BOOL WINAPI WTSQueryUserConfigW(LPWSTR,LPWSTR,WTS_CONFIG_CLASS,LPWSTR*,DWORD*);
173 #define     WTSQueryUserConfig WINELIB_NAME_AW(WTSQueryUserConfig)
174 BOOL WINAPI WTSQueryUserToken(ULONG, PHANDLE);
175 BOOL WINAPI WTSRegisterSessionNotification(HWND, DWORD);
176 BOOL WINAPI WTSRegisterSessionNotificationEx(HANDLE, HWND, DWORD);
177 BOOL WINAPI WTSStartRemoteControlSessionA(LPSTR, ULONG, BYTE, USHORT);
178 BOOL WINAPI WTSStartRemoteControlSessionW(LPWSTR, ULONG, BYTE, USHORT);
179 #define     WTSStartRemoteControlSession WINELIB_NAME_AW(WTSStartRemoteControlSession)
180 BOOL WINAPI WTSStopRemoteControlSession(ULONG);
181 BOOL WINAPI WTSTerminateProcess(HANDLE, DWORD, DWORD);
182 BOOL WINAPI WTSUnRegisterSessionNotification(HWND);
183 BOOL WINAPI WTSUnRegisterSessionNotificationEx(HANDLE, HWND);
184 BOOL WINAPI WTSWaitSystemEvent(HANDLE, DWORD, DWORD*);
185 
186 #ifdef __cplusplus
187 }
188 #endif
189 
190 #endif
191