5838f1ac09b2344a985a85cf52f97f1ee15c77ce
[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 "ntstatus.h"
22 #define WIN32_NO_STATUS
23 #include "windef.h"
24 #include "winbase.h"
25 #include "wine/winternl.h"
26 #include "wtsapi32.h"
27 #include "wine/debug.h"
28 #include "wine/heap.h"
29
30 WINE_DEFAULT_DEBUG_CHANNEL(wtsapi);
31
32 #ifdef __REACTOS__ /* FIXME: Inspect */
33 #define GetCurrentProcessToken() ((HANDLE)~(ULONG_PTR)3)
34 #endif
35
36 /************************************************************
37 * WTSCloseServer (WTSAPI32.@)
38 */
39 void WINAPI WTSCloseServer(HANDLE hServer)
40 {
41 FIXME("Stub %p\n", hServer);
42 }
43
44 /************************************************************
45 * WTSConnectSessionA (WTSAPI32.@)
46 */
47 BOOL WINAPI WTSConnectSessionA(ULONG LogonId, ULONG TargetLogonId, PSTR pPassword, BOOL bWait)
48 {
49 FIXME("Stub %d %d (%s) %d\n", LogonId, TargetLogonId, debugstr_a(pPassword), bWait);
50 return TRUE;
51 }
52
53 /************************************************************
54 * WTSConnectSessionW (WTSAPI32.@)
55 */
56 BOOL WINAPI WTSConnectSessionW(ULONG LogonId, ULONG TargetLogonId, PWSTR pPassword, BOOL bWait)
57 {
58 FIXME("Stub %d %d (%s) %d\n", LogonId, TargetLogonId, debugstr_w(pPassword), bWait);
59 return TRUE;
60 }
61
62 /************************************************************
63 * WTSDisconnectSession (WTSAPI32.@)
64 */
65 BOOL WINAPI WTSDisconnectSession(HANDLE hServer, DWORD SessionId, BOOL bWait)
66 {
67 FIXME("Stub %p 0x%08x %d\n", hServer, SessionId, bWait);
68 return TRUE;
69 }
70
71 /************************************************************
72 * WTSEnableChildSessions (WTSAPI32.@)
73 */
74 BOOL WINAPI WTSEnableChildSessions(BOOL enable)
75 {
76 FIXME("Stub %d\n", enable);
77 return TRUE;
78 }
79
80 /************************************************************
81 * WTSEnumerateProcessesA (WTSAPI32.@)
82 */
83 BOOL WINAPI WTSEnumerateProcessesA(HANDLE hServer, DWORD Reserved, DWORD Version,
84 PWTS_PROCESS_INFOA* ppProcessInfo, DWORD* pCount)
85 {
86 FIXME("Stub %p 0x%08x 0x%08x %p %p\n", hServer, Reserved, Version,
87 ppProcessInfo, pCount);
88
89 if (!ppProcessInfo || !pCount) return FALSE;
90
91 *pCount = 0;
92 *ppProcessInfo = NULL;
93
94 return TRUE;
95 }
96
97 /************************************************************
98 * WTSEnumerateProcessesW (WTSAPI32.@)
99 */
100 BOOL WINAPI WTSEnumerateProcessesW(HANDLE hServer, DWORD Reserved, DWORD Version,
101 PWTS_PROCESS_INFOW* ppProcessInfo, DWORD* pCount)
102 {
103 WTS_PROCESS_INFOW *processInfo;
104 SYSTEM_PROCESS_INFORMATION *spi;
105 ULONG size = 0x4000;
106 void *buf = NULL;
107 NTSTATUS status;
108 DWORD count;
109 WCHAR *name;
110
111 if (!ppProcessInfo || !pCount || Reserved != 0 || Version != 1)
112 {
113 SetLastError(ERROR_INVALID_PARAMETER);
114 return FALSE;
115 }
116
117 if (hServer != WTS_CURRENT_SERVER_HANDLE)
118 {
119 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
120 return FALSE;
121 }
122
123 do
124 {
125 size *= 2;
126 HeapFree(GetProcessHeap(), 0, buf);
127 buf = HeapAlloc(GetProcessHeap(), 0, size);
128 if (!buf)
129 {
130 SetLastError(ERROR_OUTOFMEMORY);
131 return FALSE;
132 }
133 status = NtQuerySystemInformation(SystemProcessInformation, buf, size, NULL);
134 }
135 while (status == STATUS_INFO_LENGTH_MISMATCH);
136
137 if (status != STATUS_SUCCESS)
138 {
139 HeapFree(GetProcessHeap(), 0, buf);
140 SetLastError(RtlNtStatusToDosError(status));
141 return FALSE;
142 }
143
144 spi = buf;
145 count = size = 0;
146 for (;;)
147 {
148 size += sizeof(WTS_PROCESS_INFOW) + spi->ProcessName.Length + sizeof(WCHAR);
149 count++;
150 if (spi->NextEntryOffset == 0) break;
151 spi = (SYSTEM_PROCESS_INFORMATION *)(((PCHAR)spi) + spi->NextEntryOffset);
152 }
153
154 processInfo = HeapAlloc(GetProcessHeap(), 0, size);
155 if (!processInfo)
156 {
157 HeapFree(GetProcessHeap(), 0, buf);
158 SetLastError(ERROR_OUTOFMEMORY);
159 return FALSE;
160 }
161 name = (WCHAR *)&processInfo[count];
162
163 *ppProcessInfo = processInfo;
164 *pCount = count;
165
166 spi = buf;
167 while (count--)
168 {
169 processInfo->SessionId = 0;
170 processInfo->ProcessId = HandleToUlong(spi->UniqueProcessId);
171 processInfo->pProcessName = name;
172 processInfo->pUserSid = NULL;
173 memcpy( name, spi->ProcessName.Buffer, spi->ProcessName.Length );
174 name[ spi->ProcessName.Length/sizeof(WCHAR) ] = 0;
175
176 processInfo++;
177 name += (spi->ProcessName.Length + sizeof(WCHAR))/sizeof(WCHAR);
178 spi = (SYSTEM_PROCESS_INFORMATION *)(((PCHAR)spi) + spi->NextEntryOffset);
179 }
180
181 HeapFree(GetProcessHeap(), 0, buf);
182 return TRUE;
183 }
184
185 /************************************************************
186 * WTSEnumerateServersA (WTSAPI32.@)
187 */
188 BOOL WINAPI WTSEnumerateServersA(LPSTR pDomainName, DWORD Reserved, DWORD Version, PWTS_SERVER_INFOA *ppServerInfo, DWORD *pCount)
189 {
190 FIXME("Stub %s 0x%08x 0x%08x %p %p\n", debugstr_a(pDomainName), Reserved, Version, ppServerInfo, pCount);
191 return FALSE;
192 }
193
194 /************************************************************
195 * WTSEnumerateServersW (WTSAPI32.@)
196 */
197 BOOL WINAPI WTSEnumerateServersW(LPWSTR pDomainName, DWORD Reserved, DWORD Version, PWTS_SERVER_INFOW *ppServerInfo, DWORD *pCount)
198 {
199 FIXME("Stub %s 0x%08x 0x%08x %p %p\n", debugstr_w(pDomainName), Reserved, Version, ppServerInfo, pCount);
200 return FALSE;
201 }
202
203
204 /************************************************************
205 * WTSEnumerateEnumerateSessionsA (WTSAPI32.@)
206 */
207 BOOL WINAPI WTSEnumerateSessionsA(HANDLE hServer, DWORD Reserved, DWORD Version,
208 PWTS_SESSION_INFOA* ppSessionInfo, DWORD* pCount)
209 {
210 static int once;
211
212 if (!once++) FIXME("Stub %p 0x%08x 0x%08x %p %p\n", hServer, Reserved, Version,
213 ppSessionInfo, pCount);
214
215 if (!ppSessionInfo || !pCount) return FALSE;
216
217 *pCount = 0;
218 *ppSessionInfo = NULL;
219
220 return TRUE;
221 }
222
223 /************************************************************
224 * WTSEnumerateEnumerateSessionsW (WTSAPI32.@)
225 */
226 BOOL WINAPI WTSEnumerateSessionsW(HANDLE hServer, DWORD Reserved, DWORD Version,
227 PWTS_SESSION_INFOW* ppSessionInfo, DWORD* pCount)
228 {
229 FIXME("Stub %p 0x%08x 0x%08x %p %p\n", hServer, Reserved, Version,
230 ppSessionInfo, pCount);
231
232 if (!ppSessionInfo || !pCount) return FALSE;
233
234 *pCount = 0;
235 *ppSessionInfo = NULL;
236
237 return TRUE;
238 }
239
240 /************************************************************
241 * WTSFreeMemory (WTSAPI32.@)
242 */
243 void WINAPI WTSFreeMemory(PVOID pMemory)
244 {
245 heap_free(pMemory);
246 }
247
248 /************************************************************
249 * WTSLogoffSession (WTSAPI32.@)
250 */
251 BOOL WINAPI WTSLogoffSession(HANDLE hserver, DWORD session_id, BOOL bwait)
252 {
253 FIXME("(%p, 0x%x, %d): stub\n", hserver, session_id, bwait);
254 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
255 return FALSE;
256 }
257
258 /************************************************************
259 * WTSOpenServerA (WTSAPI32.@)
260 */
261 HANDLE WINAPI WTSOpenServerA(LPSTR pServerName)
262 {
263 FIXME("(%s) stub\n", debugstr_a(pServerName));
264 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
265 return NULL;
266 }
267
268 /************************************************************
269 * WTSOpenServerW (WTSAPI32.@)
270 */
271 HANDLE WINAPI WTSOpenServerW(LPWSTR pServerName)
272 {
273 FIXME("(%s) stub\n", debugstr_w(pServerName));
274 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
275 return NULL;
276 }
277
278 /************************************************************
279 * WTSQuerySessionInformationA (WTSAPI32.@)
280 */
281 BOOL WINAPI WTSQuerySessionInformationA(
282 HANDLE hServer,
283 DWORD SessionId,
284 WTS_INFO_CLASS WTSInfoClass,
285 LPSTR* Buffer,
286 DWORD* BytesReturned)
287 {
288 #ifdef __REACTOS__
289 const size_t wcsErrorCode = -1;
290 LPWSTR buffer = NULL;
291 LPSTR ansiBuffer = NULL;
292 DWORD bytesReturned = 0;
293 BOOL result = FALSE;
294 size_t len;
295
296 if (!BytesReturned || !Buffer)
297 {
298 SetLastError(ERROR_INVALID_USER_BUFFER);
299 return FALSE;
300 }
301
302 if (!WTSQuerySessionInformationW(hServer, SessionId, WTSInfoClass, &buffer, &bytesReturned))
303 {
304 ansiBuffer = (LPSTR)buffer;
305 *Buffer = ansiBuffer;
306 *BytesReturned = bytesReturned;
307 return FALSE;
308 }
309
310 switch (WTSInfoClass)
311 {
312 case WTSInitialProgram:
313 case WTSApplicationName:
314 case WTSWorkingDirectory:
315 case WTSOEMId:
316 case WTSUserName:
317 case WTSWinStationName:
318 case WTSDomainName:
319 case WTSClientName:
320 case WTSClientDirectory:
321 {
322 len = wcstombs(NULL, buffer, 0);
323 if (len != wcsErrorCode)
324 {
325 len++;
326 ansiBuffer = heap_alloc_zero(len);
327 if (ansiBuffer && (wcstombs(ansiBuffer, buffer, len) != wcsErrorCode))
328 {
329 result = TRUE;
330 bytesReturned = len;
331 }
332 }
333 WTSFreeMemory(buffer);
334 break;
335 }
336
337 default:
338 {
339 result = TRUE;
340 ansiBuffer = (LPSTR)buffer;
341 break;
342 }
343 }
344
345 *Buffer = ansiBuffer;
346 *BytesReturned = bytesReturned;
347
348 return result;
349 #else
350 /* FIXME: Forward request to winsta.dll::WinStationQueryInformationA */
351 FIXME("Stub %p 0x%08x %d %p %p\n", hServer, SessionId, WTSInfoClass,
352 Buffer, BytesReturned);
353
354 return FALSE;
355 #endif
356 }
357
358 /************************************************************
359 * WTSQuerySessionInformationW (WTSAPI32.@)
360 */
361 BOOL WINAPI WTSQuerySessionInformationW(
362 HANDLE hServer,
363 DWORD SessionId,
364 WTS_INFO_CLASS WTSInfoClass,
365 LPWSTR* Buffer,
366 DWORD* BytesReturned)
367 {
368 #ifdef __REACTOS__
369 if (!BytesReturned || !Buffer)
370 {
371 SetLastError(ERROR_INVALID_USER_BUFFER);
372 return FALSE;
373 }
374
375 if (WTSInfoClass > WTSIsRemoteSession)
376 {
377 SetLastError(ERROR_INVALID_PARAMETER);
378 return FALSE;
379 }
380
381 switch (WTSInfoClass)
382 {
383 case WTSSessionId:
384 {
385 const DWORD size = sizeof(ULONG);
386 ULONG* output = heap_alloc_zero(size);
387 if (!output)
388 {
389 SetLastError(ERROR_NOT_ENOUGH_MEMORY);
390 return FALSE;
391 }
392
393 *output = NtCurrentTeb()->Peb->SessionId;
394 *Buffer = (LPWSTR)output;
395 *BytesReturned = size;
396 return TRUE;
397 }
398
399 case WTSUserName:
400 {
401 WCHAR* username;
402 DWORD count = 0;
403
404 GetUserNameW(NULL, &count);
405 if (GetLastError() != ERROR_INSUFFICIENT_BUFFER)
406 return FALSE;
407 username = heap_alloc(count * sizeof(WCHAR));
408 if (!username)
409 {
410 SetLastError(ERROR_NOT_ENOUGH_MEMORY);
411 return FALSE;
412 }
413
414 GetUserNameW(username, &count);
415 *Buffer = username;
416 *BytesReturned = count * sizeof(WCHAR);
417 return TRUE;
418 }
419
420 case WTSConnectState:
421 {
422 const DWORD size = sizeof(DWORD);
423 WCHAR* output = heap_alloc_zero(size);
424 if (!output)
425 {
426 SetLastError(ERROR_NOT_ENOUGH_MEMORY);
427 return FALSE;
428 }
429
430 *Buffer = output;
431 *BytesReturned = size;
432 return TRUE;
433 }
434
435 case WTSClientProtocolType:
436 {
437 const DWORD size = sizeof(WORD);
438 WCHAR* output = heap_alloc_zero(size);
439 if (!output)
440 {
441 SetLastError(ERROR_NOT_ENOUGH_MEMORY);
442 return FALSE;
443 }
444
445 *Buffer = output;
446 *BytesReturned = size;
447 return TRUE;
448 }
449
450 case WTSIdleTime:
451 case WTSLogonTime:
452 case WTSIncomingBytes:
453 case WTSOutgoingBytes:
454 case WTSIncomingFrames:
455 case WTSOutgoingFrames:
456 {
457 SetLastError(ERROR_NOT_SUPPORTED);
458 return FALSE;
459 }
460
461 default:
462 {
463 if (BytesReturned)
464 *BytesReturned = 0;
465
466 break;
467 }
468 }
469
470 /* FIXME: Forward request to winsta.dll::WinStationQueryInformationW */
471 FIXME("Stub %p 0x%08x %d %p %p\n", hServer, SessionId, WTSInfoClass,
472 Buffer, BytesReturned);
473
474 return FALSE;
475 #else
476 /* FIXME: Forward request to winsta.dll::WinStationQueryInformationW */
477 FIXME("Stub %p 0x%08x %d %p %p\n", hServer, SessionId, WTSInfoClass,
478 Buffer, BytesReturned);
479
480 if (WTSInfoClass == WTSUserName)
481 {
482 WCHAR *username;
483 DWORD count = 0;
484
485 GetUserNameW(NULL, &count);
486 if (GetLastError() != ERROR_INSUFFICIENT_BUFFER) return FALSE;
487 if (!(username = heap_alloc(count * sizeof(WCHAR)))) return FALSE;
488 GetUserNameW(username, &count);
489 *Buffer = username;
490 *BytesReturned = count * sizeof(WCHAR);
491 return TRUE;
492 }
493 return FALSE;
494 #endif
495 }
496
497 /************************************************************
498 * WTSQueryUserToken (WTSAPI32.@)
499 */
500 BOOL WINAPI WTSQueryUserToken(ULONG session_id, PHANDLE token)
501 {
502 FIXME("%u %p\n", session_id, token);
503
504 if (!token)
505 {
506 SetLastError(ERROR_INVALID_PARAMETER);
507 return FALSE;
508 }
509
510 return DuplicateHandle(GetCurrentProcess(), GetCurrentProcessToken(),
511 GetCurrentProcess(), token,
512 0, FALSE, DUPLICATE_SAME_ACCESS);
513 }
514
515 /************************************************************
516 * WTSQueryUserConfigA (WTSAPI32.@)
517 */
518 BOOL WINAPI WTSQueryUserConfigA(LPSTR pServerName, LPSTR pUserName, WTS_CONFIG_CLASS WTSConfigClass, LPSTR *ppBuffer, DWORD *pBytesReturned)
519 {
520 FIXME("Stub (%s) (%s) 0x%08x %p %p\n", debugstr_a(pServerName), debugstr_a(pUserName), WTSConfigClass,
521 ppBuffer, pBytesReturned);
522 return FALSE;
523 }
524
525 /************************************************************
526 * WTSQueryUserConfigW (WTSAPI32.@)
527 */
528 BOOL WINAPI WTSQueryUserConfigW(LPWSTR pServerName, LPWSTR pUserName, WTS_CONFIG_CLASS WTSConfigClass, LPWSTR *ppBuffer, DWORD *pBytesReturned)
529 {
530 FIXME("Stub (%s) (%s) 0x%08x %p %p\n", debugstr_w(pServerName), debugstr_w(pUserName), WTSConfigClass,
531 ppBuffer, pBytesReturned);
532 return FALSE;
533 }
534
535
536 /************************************************************
537 * WTSRegisterSessionNotification (WTSAPI32.@)
538 */
539 BOOL WINAPI WTSRegisterSessionNotification(HWND hWnd, DWORD dwFlags)
540 {
541 FIXME("Stub %p 0x%08x\n", hWnd, dwFlags);
542 return TRUE;
543 }
544
545 /************************************************************
546 * WTSRegisterSessionNotificationEx (WTSAPI32.@)
547 */
548 BOOL WINAPI WTSRegisterSessionNotificationEx(HANDLE hServer, HWND hWnd, DWORD dwFlags)
549 {
550 FIXME("Stub %p %p 0x%08x\n", hServer, hWnd, dwFlags);
551 return FALSE;
552 }
553
554
555 /************************************************************
556 * WTSSendMessageA (WTSAPI32.@)
557 */
558 BOOL WINAPI WTSSendMessageA(HANDLE hServer, DWORD SessionId, LPSTR pTitle, DWORD TitleLength, LPSTR pMessage,
559 DWORD MessageLength, DWORD Style, DWORD Timeout, DWORD *pResponse, BOOL bWait)
560 {
561 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);
562 return FALSE;
563 }
564
565 /************************************************************
566 * WTSSendMessageW (WTSAPI32.@)
567 */
568 BOOL WINAPI WTSSendMessageW(HANDLE hServer, DWORD SessionId, LPWSTR pTitle, DWORD TitleLength, LPWSTR pMessage,
569 DWORD MessageLength, DWORD Style, DWORD Timeout, DWORD *pResponse, BOOL bWait)
570 {
571 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);
572 return FALSE;
573 }
574
575 /************************************************************
576 * WTSSetUserConfigA (WTSAPI32.@)
577 */
578 BOOL WINAPI WTSSetUserConfigA(LPSTR pServerName, LPSTR pUserName, WTS_CONFIG_CLASS WTSConfigClass, LPSTR pBuffer, DWORD DataLength)
579 {
580 FIXME("Stub (%s) (%s) 0x%08x %p %d\n", debugstr_a(pServerName), debugstr_a(pUserName), WTSConfigClass,pBuffer, DataLength);
581 return FALSE;
582 }
583
584 /************************************************************
585 * WTSSetUserConfigW (WTSAPI32.@)
586 */
587 BOOL WINAPI WTSSetUserConfigW(LPWSTR pServerName, LPWSTR pUserName, WTS_CONFIG_CLASS WTSConfigClass, LPWSTR pBuffer, DWORD DataLength)
588 {
589 FIXME("Stub (%s) (%s) 0x%08x %p %d\n", debugstr_w(pServerName), debugstr_w(pUserName), WTSConfigClass,pBuffer, DataLength);
590 return FALSE;
591 }
592
593 /************************************************************
594 * WTSShutdownSystem (WTSAPI32.@)
595 */
596 BOOL WINAPI WTSShutdownSystem(HANDLE hServer, DWORD ShutdownFlag)
597 {
598 FIXME("Stub %p 0x%08x\n", hServer,ShutdownFlag);
599 return FALSE;
600 }
601
602 /************************************************************
603 * WTSStartRemoteControlSessionA (WTSAPI32.@)
604 */
605 BOOL WINAPI WTSStartRemoteControlSessionA(LPSTR pTargetServerName, ULONG TargetLogonId, BYTE HotkeyVk, USHORT HotkeyModifiers)
606 {
607 FIXME("Stub (%s) %d %d %d\n", debugstr_a(pTargetServerName), TargetLogonId, HotkeyVk, HotkeyModifiers);
608 return FALSE;
609 }
610
611 /************************************************************
612 * WTSStartRemoteControlSessionW (WTSAPI32.@)
613 */
614 BOOL WINAPI WTSStartRemoteControlSessionW(LPWSTR pTargetServerName, ULONG TargetLogonId, BYTE HotkeyVk, USHORT HotkeyModifiers)
615 {
616 FIXME("Stub (%s) %d %d %d\n", debugstr_w(pTargetServerName), TargetLogonId, HotkeyVk, HotkeyModifiers);
617 return FALSE;
618 }
619
620 /************************************************************
621 * WTSStopRemoteControlSession (WTSAPI32.@)
622 */
623 BOOL WINAPI WTSStopRemoteControlSession(ULONG LogonId)
624 {
625 FIXME("Stub %d\n", LogonId);
626 return FALSE;
627 }
628
629 /************************************************************
630 * WTSTerminateProcess (WTSAPI32.@)
631 */
632 BOOL WINAPI WTSTerminateProcess(HANDLE hServer, DWORD ProcessId, DWORD ExitCode)
633 {
634 FIXME("Stub %p %d %d\n", hServer, ProcessId, ExitCode);
635 return FALSE;
636 }
637
638 /************************************************************
639 * WTSUnRegisterSessionNotification (WTSAPI32.@)
640 */
641 BOOL WINAPI WTSUnRegisterSessionNotification(HWND hWnd)
642 {
643 FIXME("Stub %p\n", hWnd);
644 return FALSE;
645 }
646
647 /************************************************************
648 * WTSUnRegisterSessionNotification (WTSAPI32.@)
649 */
650 BOOL WINAPI WTSUnRegisterSessionNotificationEx(HANDLE hServer, HWND hWnd)
651 {
652 FIXME("Stub %p %p\n", hServer, hWnd);
653 return FALSE;
654 }
655
656
657 /************************************************************
658 * WTSVirtualChannelClose (WTSAPI32.@)
659 */
660 BOOL WINAPI WTSVirtualChannelClose(HANDLE hChannelHandle)
661 {
662 FIXME("Stub %p\n", hChannelHandle);
663 return FALSE;
664 }
665
666 /************************************************************
667 * WTSVirtualChannelOpen (WTSAPI32.@)
668 */
669 HANDLE WINAPI WTSVirtualChannelOpen(HANDLE hServer, DWORD SessionId, LPSTR pVirtualName)
670 {
671 FIXME("Stub %p %d (%s)\n", hServer, SessionId, debugstr_a(pVirtualName));
672 return NULL;
673 }
674
675 /************************************************************
676 * WTSVirtualChannelOpen (WTSAPI32.@)
677 */
678 HANDLE WINAPI WTSVirtualChannelOpenEx(DWORD SessionId, LPSTR pVirtualName, DWORD flags)
679 {
680 FIXME("Stub %d (%s) %d\n", SessionId, debugstr_a(pVirtualName), flags);
681 return NULL;
682 }
683
684 /************************************************************
685 * WTSVirtualChannelPurgeInput (WTSAPI32.@)
686 */
687 BOOL WINAPI WTSVirtualChannelPurgeInput(HANDLE hChannelHandle)
688 {
689 FIXME("Stub %p\n", hChannelHandle);
690 return FALSE;
691 }
692
693 /************************************************************
694 * WTSVirtualChannelPurgeOutput (WTSAPI32.@)
695 */
696 BOOL WINAPI WTSVirtualChannelPurgeOutput(HANDLE hChannelHandle)
697 {
698 FIXME("Stub %p\n", hChannelHandle);
699 return FALSE;
700 }
701
702
703 /************************************************************
704 * WTSVirtualChannelQuery (WTSAPI32.@)
705 */
706 BOOL WINAPI WTSVirtualChannelQuery(HANDLE hChannelHandle, WTS_VIRTUAL_CLASS WtsVirtualClass, PVOID *ppBuffer, DWORD *pBytesReturned)
707 {
708 FIXME("Stub %p %d %p %p\n", hChannelHandle, WtsVirtualClass, ppBuffer, pBytesReturned);
709 return FALSE;
710 }
711
712 /************************************************************
713 * WTSVirtualChannelRead (WTSAPI32.@)
714 */
715 BOOL WINAPI WTSVirtualChannelRead(HANDLE hChannelHandle, ULONG TimeOut, PCHAR Buffer, ULONG BufferSize, PULONG pBytesRead)
716 {
717 FIXME("Stub %p %d %p %d %p\n", hChannelHandle, TimeOut, Buffer, BufferSize, pBytesRead);
718 return FALSE;
719 }
720
721 /************************************************************
722 * WTSVirtualChannelWrite (WTSAPI32.@)
723 */
724 BOOL WINAPI WTSVirtualChannelWrite(HANDLE hChannelHandle, PCHAR Buffer, ULONG Length, PULONG pBytesWritten)
725 {
726 FIXME("Stub %p %p %d %p\n", hChannelHandle, Buffer, Length, pBytesWritten);
727 return FALSE;
728 }
729
730 /************************************************************
731 * WTSWaitSystemEvent (WTSAPI32.@)
732 */
733 BOOL WINAPI WTSWaitSystemEvent(HANDLE hServer, DWORD Mask, DWORD* Flags)
734 {
735 /* FIXME: Forward request to winsta.dll::WinStationWaitSystemEvent */
736 FIXME("Stub %p 0x%08x %p\n", hServer, Mask, Flags);
737 return FALSE;
738 }