Sync with trunk r63174.
[reactos.git] / dll / win32 / wtsapi32 / wtsapi32.c
1 /* Copyright 2005 Ulrich Czekalla
2 *
3 * This library is free software; you can redistribute it and/or
4 * modify it under the terms of the GNU Lesser General Public
5 * License as published by the Free Software Foundation; either
6 * version 2.1 of the License, or (at your option) any later version.
7 *
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public
14 * License along with this library; if not, write to the Free Software
15 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
16 */
17
18 #include <config.h>
19 #include <stdarg.h>
20 //#include <stdlib.h>
21 #include <windef.h>
22 #include <winbase.h>
23 #include <wtsapi32.h>
24 #include <wine/debug.h>
25
26 WINE_DEFAULT_DEBUG_CHANNEL(wtsapi);
27
28
29 /************************************************************
30 * WTSCloseServer (WTSAPI32.@)
31 */
32 void WINAPI WTSCloseServer(HANDLE hServer)
33 {
34 FIXME("Stub %p\n", hServer);
35 }
36
37 /************************************************************
38 * WTSConnectSessionA (WTSAPI32.@)
39 */
40 BOOL WINAPI WTSConnectSessionA(ULONG LogonId, ULONG TargetLogonId, PSTR pPassword, BOOL bWait)
41 {
42 FIXME("Stub %d %d (%s) %d\n", LogonId, TargetLogonId, debugstr_a(pPassword), bWait);
43 return TRUE;
44 }
45
46 /************************************************************
47 * WTSConnectSessionW (WTSAPI32.@)
48 */
49 BOOL WINAPI WTSConnectSessionW(ULONG LogonId, ULONG TargetLogonId, PWSTR pPassword, BOOL bWait)
50 {
51 FIXME("Stub %d %d (%s) %d\n", LogonId, TargetLogonId, debugstr_w(pPassword), bWait);
52 return TRUE;
53 }
54
55 /************************************************************
56 * WTSDisconnectSession (WTSAPI32.@)
57 */
58 BOOL WINAPI WTSDisconnectSession(HANDLE hServer, DWORD SessionId, BOOL bWait)
59 {
60 FIXME("Stub %p 0x%08x %d\n", hServer, SessionId, bWait);
61 return TRUE;
62 }
63
64 /************************************************************
65 * WTSEnumerateProcessesA (WTSAPI32.@)
66 */
67 BOOL WINAPI WTSEnumerateProcessesA(HANDLE hServer, DWORD Reserved, DWORD Version,
68 PWTS_PROCESS_INFOA* ppProcessInfo, DWORD* pCount)
69 {
70 FIXME("Stub %p 0x%08x 0x%08x %p %p\n", hServer, Reserved, Version,
71 ppProcessInfo, pCount);
72
73 if (!ppProcessInfo || !pCount) return FALSE;
74
75 *pCount = 0;
76 *ppProcessInfo = NULL;
77
78 return TRUE;
79 }
80
81 /************************************************************
82 * WTSEnumerateProcessesW (WTSAPI32.@)
83 */
84 BOOL WINAPI WTSEnumerateProcessesW(HANDLE hServer, DWORD Reserved, DWORD Version,
85 PWTS_PROCESS_INFOW* ppProcessInfo, DWORD* pCount)
86 {
87 FIXME("Stub %p 0x%08x 0x%08x %p %p\n", hServer, Reserved, Version,
88 ppProcessInfo, pCount);
89
90 if (!ppProcessInfo || !pCount || Reserved != 0 || Version != 1)
91 {
92 SetLastError(ERROR_INVALID_PARAMETER);
93 return FALSE;
94 }
95
96 *pCount = 0;
97 *ppProcessInfo = NULL;
98
99 return TRUE;
100 }
101
102 /************************************************************
103 * WTSEnumerateServersA (WTSAPI32.@)
104 */
105 BOOL WINAPI WTSEnumerateServersA(LPSTR pDomainName, DWORD Reserved, DWORD Version, PWTS_SERVER_INFOA *ppServerInfo, DWORD *pCount)
106 {
107 FIXME("Stub %s 0x%08x 0x%08x %p %p\n", debugstr_a(pDomainName), Reserved, Version, ppServerInfo, pCount);
108 return FALSE;
109 }
110
111 /************************************************************
112 * WTSEnumerateServersW (WTSAPI32.@)
113 */
114 BOOL WINAPI WTSEnumerateServersW(LPWSTR pDomainName, DWORD Reserved, DWORD Version, PWTS_SERVER_INFOW *ppServerInfo, DWORD *pCount)
115 {
116 FIXME("Stub %s 0x%08x 0x%08x %p %p\n", debugstr_w(pDomainName), Reserved, Version, ppServerInfo, pCount);
117 return FALSE;
118 }
119
120
121 /************************************************************
122 * WTSEnumerateEnumerateSessionsA (WTSAPI32.@)
123 */
124 BOOL WINAPI WTSEnumerateSessionsA(HANDLE hServer, DWORD Reserved, DWORD Version,
125 PWTS_SESSION_INFOA* ppSessionInfo, DWORD* pCount)
126 {
127 static int once;
128
129 if (!once++) FIXME("Stub %p 0x%08x 0x%08x %p %p\n", hServer, Reserved, Version,
130 ppSessionInfo, pCount);
131
132 if (!ppSessionInfo || !pCount) return FALSE;
133
134 *pCount = 0;
135 *ppSessionInfo = NULL;
136
137 return TRUE;
138 }
139
140 /************************************************************
141 * WTSEnumerateEnumerateSessionsW (WTSAPI32.@)
142 */
143 BOOL WINAPI WTSEnumerateSessionsW(HANDLE hServer, DWORD Reserved, DWORD Version,
144 PWTS_SESSION_INFOW* ppSessionInfo, DWORD* pCount)
145 {
146 FIXME("Stub %p 0x%08x 0x%08x %p %p\n", hServer, Reserved, Version,
147 ppSessionInfo, pCount);
148
149 if (!ppSessionInfo || !pCount) return FALSE;
150
151 *pCount = 0;
152 *ppSessionInfo = NULL;
153
154 return TRUE;
155 }
156
157 /************************************************************
158 * WTSFreeMemory (WTSAPI32.@)
159 */
160 void WINAPI WTSFreeMemory(PVOID pMemory)
161 {
162 static int once;
163
164 if (!once++) FIXME("Stub %p\n", pMemory);
165 }
166
167 /************************************************************
168 * WTSLogoffSession (WTSAPI32.@)
169 */
170 BOOL WINAPI WTSLogoffSession(HANDLE hserver, DWORD session_id, BOOL bwait)
171 {
172 FIXME("(%p, 0x%x, %d): stub\n", hserver, session_id, bwait);
173 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
174 return FALSE;
175 }
176
177 /************************************************************
178 * WTSOpenServerA (WTSAPI32.@)
179 */
180 HANDLE WINAPI WTSOpenServerA(LPSTR pServerName)
181 {
182 FIXME("(%s) stub\n", debugstr_a(pServerName));
183 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
184 return NULL;
185 }
186
187 /************************************************************
188 * WTSOpenServerW (WTSAPI32.@)
189 */
190 HANDLE WINAPI WTSOpenServerW(LPWSTR pServerName)
191 {
192 FIXME("(%s) stub\n", debugstr_w(pServerName));
193 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
194 return NULL;
195 }
196
197 /************************************************************
198 * WTSQuerySessionInformationA (WTSAPI32.@)
199 */
200 BOOL WINAPI WTSQuerySessionInformationA(
201 HANDLE hServer,
202 DWORD SessionId,
203 WTS_INFO_CLASS WTSInfoClass,
204 LPSTR* Buffer,
205 DWORD* BytesReturned)
206 {
207 /* FIXME: Forward request to winsta.dll::WinStationQueryInformationA */
208 FIXME("Stub %p 0x%08x %d %p %p\n", hServer, SessionId, WTSInfoClass,
209 Buffer, BytesReturned);
210
211 return FALSE;
212 }
213
214 /************************************************************
215 * WTSQuerySessionInformationW (WTSAPI32.@)
216 */
217 BOOL WINAPI WTSQuerySessionInformationW(
218 HANDLE hServer,
219 DWORD SessionId,
220 WTS_INFO_CLASS WTSInfoClass,
221 LPWSTR* Buffer,
222 DWORD* BytesReturned)
223 {
224 /* FIXME: Forward request to winsta.dll::WinStationQueryInformationW */
225 FIXME("Stub %p 0x%08x %d %p %p\n", hServer, SessionId, WTSInfoClass,
226 Buffer, BytesReturned);
227
228 return FALSE;
229 }
230
231 /************************************************************
232 * WTSQueryUserToken (WTSAPI32.@)
233 */
234 BOOL WINAPI WTSQueryUserToken(ULONG session_id, PHANDLE token)
235 {
236 FIXME("%u %p\n", session_id, token);
237 return FALSE;
238 }
239
240 /************************************************************
241 * WTSQueryUserConfigA (WTSAPI32.@)
242 */
243 BOOL WINAPI WTSQueryUserConfigA(LPSTR pServerName, LPSTR pUserName, WTS_CONFIG_CLASS WTSConfigClass, LPSTR *ppBuffer, DWORD *pBytesReturned)
244 {
245 FIXME("Stub (%s) (%s) 0x%08x %p %p\n", debugstr_a(pServerName), debugstr_a(pUserName), WTSConfigClass,
246 ppBuffer, pBytesReturned);
247 return FALSE;
248 }
249
250 /************************************************************
251 * WTSQueryUserConfigW (WTSAPI32.@)
252 */
253 BOOL WINAPI WTSQueryUserConfigW(LPWSTR pServerName, LPWSTR pUserName, WTS_CONFIG_CLASS WTSConfigClass, LPWSTR *ppBuffer, DWORD *pBytesReturned)
254 {
255 FIXME("Stub (%s) (%s) 0x%08x %p %p\n", debugstr_w(pServerName), debugstr_w(pUserName), WTSConfigClass,
256 ppBuffer, pBytesReturned);
257 return FALSE;
258 }
259
260
261 /************************************************************
262 * WTSRegisterSessionNotification (WTSAPI32.@)
263 */
264 BOOL WINAPI WTSRegisterSessionNotification(HWND hWnd, DWORD dwFlags)
265 {
266 FIXME("Stub %p 0x%08x\n", hWnd, dwFlags);
267 return TRUE;
268 }
269
270 /************************************************************
271 * WTSRegisterSessionNotification (WTSAPI32.@)
272 */
273 BOOL WINAPI WTSRegisterSessionNotificationEx(HANDLE hServer, HWND hWnd, DWORD dwFlags)
274 {
275 FIXME("Stub %p %p 0x%08x\n", hServer, hWnd, dwFlags);
276 return FALSE;
277 }
278
279
280 /************************************************************
281 * WTSSendMessageA (WTSAPI32.@)
282 */
283 BOOL WINAPI WTSSendMessageA(HANDLE hServer, DWORD SessionId, LPSTR pTitle, DWORD TitleLength, LPSTR pMessage,
284 DWORD MessageLength, DWORD Style, DWORD Timeout, DWORD *pResponse, BOOL bWait)
285 {
286 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);
287 return FALSE;
288 }
289
290 /************************************************************
291 * WTSSendMessageW (WTSAPI32.@)
292 */
293 BOOL WINAPI WTSSendMessageW(HANDLE hServer, DWORD SessionId, LPWSTR pTitle, DWORD TitleLength, LPWSTR pMessage,
294 DWORD MessageLength, DWORD Style, DWORD Timeout, DWORD *pResponse, BOOL bWait)
295 {
296 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);
297 return FALSE;
298 }
299
300 /************************************************************
301 * WTSSetUserConfigA (WTSAPI32.@)
302 */
303 BOOL WINAPI WTSSetUserConfigA(LPSTR pServerName, LPSTR pUserName, WTS_CONFIG_CLASS WTSConfigClass, LPSTR pBuffer, DWORD DataLength)
304 {
305 FIXME("Stub (%s) (%s) 0x%08x %p %d\n", debugstr_a(pServerName), debugstr_a(pUserName), WTSConfigClass,pBuffer, DataLength);
306 return FALSE;
307 }
308
309 /************************************************************
310 * WTSSetUserConfigW (WTSAPI32.@)
311 */
312 BOOL WINAPI WTSSetUserConfigW(LPWSTR pServerName, LPWSTR pUserName, WTS_CONFIG_CLASS WTSConfigClass, LPWSTR pBuffer, DWORD DataLength)
313 {
314 FIXME("Stub (%s) (%s) 0x%08x %p %d\n", debugstr_w(pServerName), debugstr_w(pUserName), WTSConfigClass,pBuffer, DataLength);
315 return FALSE;
316 }
317
318 /************************************************************
319 * WTSShutdownSystem (WTSAPI32.@)
320 */
321 BOOL WINAPI WTSShutdownSystem(HANDLE hServer, DWORD ShutdownFlag)
322 {
323 FIXME("Stub %p 0x%08x\n", hServer,ShutdownFlag);
324 return FALSE;
325 }
326
327 /************************************************************
328 * WTSStartRemoteControlSessionA (WTSAPI32.@)
329 */
330 BOOL WINAPI WTSStartRemoteControlSessionA(LPSTR pTargetServerName, ULONG TargetLogonId, BYTE HotkeyVk, USHORT HotkeyModifiers)
331 {
332 FIXME("Stub (%s) %d %d %d\n", debugstr_a(pTargetServerName), TargetLogonId, HotkeyVk, HotkeyModifiers);
333 return FALSE;
334 }
335
336 /************************************************************
337 * WTSStartRemoteControlSessionW (WTSAPI32.@)
338 */
339 BOOL WINAPI WTSStartRemoteControlSessionW(LPWSTR pTargetServerName, ULONG TargetLogonId, BYTE HotkeyVk, USHORT HotkeyModifiers)
340 {
341 FIXME("Stub (%s) %d %d %d\n", debugstr_w(pTargetServerName), TargetLogonId, HotkeyVk, HotkeyModifiers);
342 return FALSE;
343 }
344
345 /************************************************************
346 * WTSStopRemoteControlSession (WTSAPI32.@)
347 */
348 BOOL WINAPI WTSStopRemoteControlSession(ULONG LogonId)
349 {
350 FIXME("Stub %d\n", LogonId);
351 return FALSE;
352 }
353
354 /************************************************************
355 * WTSTerminateProcess (WTSAPI32.@)
356 */
357 BOOL WINAPI WTSTerminateProcess(HANDLE hServer, DWORD ProcessId, DWORD ExitCode)
358 {
359 FIXME("Stub %p %d %d\n", hServer, ProcessId, ExitCode);
360 return FALSE;
361 }
362
363 /************************************************************
364 * WTSUnRegisterSessionNotification (WTSAPI32.@)
365 */
366 BOOL WINAPI WTSUnRegisterSessionNotification(HWND hWnd)
367 {
368 FIXME("Stub %p\n", hWnd);
369 return FALSE;
370 }
371
372 /************************************************************
373 * WTSUnRegisterSessionNotification (WTSAPI32.@)
374 */
375 BOOL WINAPI WTSUnRegisterSessionNotificationEx(HANDLE hServer, HWND hWnd)
376 {
377 FIXME("Stub %p %p\n", hServer, hWnd);
378 return FALSE;
379 }
380
381
382 /************************************************************
383 * WTSVirtualChannelClose (WTSAPI32.@)
384 */
385 BOOL WINAPI WTSVirtualChannelClose(HANDLE hChannelHandle)
386 {
387 FIXME("Stub %p\n", hChannelHandle);
388 return FALSE;
389 }
390
391 /************************************************************
392 * WTSVirtualChannelOpen (WTSAPI32.@)
393 */
394 HANDLE WINAPI WTSVirtualChannelOpen(HANDLE hServer, DWORD SessionId, LPSTR pVirtualName)
395 {
396 FIXME("Stub %p %d (%s)\n", hServer, SessionId, debugstr_a(pVirtualName));
397 return NULL;
398 }
399
400 /************************************************************
401 * WTSVirtualChannelOpen (WTSAPI32.@)
402 */
403 HANDLE WINAPI WTSVirtualChannelOpenEx(DWORD SessionId, LPSTR pVirtualName, DWORD flags)
404 {
405 FIXME("Stub %d (%s) %d\n", SessionId, debugstr_a(pVirtualName), flags);
406 return NULL;
407 }
408
409 /************************************************************
410 * WTSVirtualChannelPurgeInput (WTSAPI32.@)
411 */
412 BOOL WINAPI WTSVirtualChannelPurgeInput(HANDLE hChannelHandle)
413 {
414 FIXME("Stub %p\n", hChannelHandle);
415 return FALSE;
416 }
417
418 /************************************************************
419 * WTSVirtualChannelPurgeOutput (WTSAPI32.@)
420 */
421 BOOL WINAPI WTSVirtualChannelPurgeOutput(HANDLE hChannelHandle)
422 {
423 FIXME("Stub %p\n", hChannelHandle);
424 return FALSE;
425 }
426
427
428 /************************************************************
429 * WTSVirtualChannelQuery (WTSAPI32.@)
430 */
431 BOOL WINAPI WTSVirtualChannelQuery(HANDLE hChannelHandle, WTS_VIRTUAL_CLASS WtsVirtualClass, PVOID *ppBuffer, DWORD *pBytesReturned)
432 {
433 FIXME("Stub %p %d %p %p\n", hChannelHandle, WtsVirtualClass, ppBuffer, pBytesReturned);
434 return FALSE;
435 }
436
437 /************************************************************
438 * WTSVirtualChannelRead (WTSAPI32.@)
439 */
440 BOOL WINAPI WTSVirtualChannelRead(HANDLE hChannelHandle, ULONG TimeOut, PCHAR Buffer, ULONG BufferSize, PULONG pBytesRead)
441 {
442 FIXME("Stub %p %d %p %d %p\n", hChannelHandle, TimeOut, Buffer, BufferSize, pBytesRead);
443 return FALSE;
444 }
445
446 /************************************************************
447 * WTSVirtualChannelWrite (WTSAPI32.@)
448 */
449 BOOL WINAPI WTSVirtualChannelWrite(HANDLE hChannelHandle, PCHAR Buffer, ULONG Length, PULONG pBytesWritten)
450 {
451 FIXME("Stub %p %p %d %p\n", hChannelHandle, Buffer, Length, pBytesWritten);
452 return FALSE;
453 }
454
455 /************************************************************
456 * WTSWaitSystemEvent (WTSAPI32.@)
457 */
458 BOOL WINAPI WTSWaitSystemEvent(HANDLE hServer, DWORD Mask, DWORD* Flags)
459 {
460 /* FIXME: Forward request to winsta.dll::WinStationWaitSystemEvent */
461 FIXME("Stub %p 0x%08x %p\n", hServer, Mask, Flags);
462 return FALSE;
463 }