ReactOS  0.4.14-dev-1036-g3c5b10f
wtsapi32.c
Go to the documentation of this file.
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 <stdarg.h>
19 #include <stdlib.h>
20 #include "ntstatus.h"
21 #define WIN32_NO_STATUS
22 #include "windef.h"
23 #include "winbase.h"
24 #include "wine/winternl.h"
25 #include "wtsapi32.h"
26 #include "wine/debug.h"
27 #include "wine/heap.h"
28 
30 
31 #ifdef __REACTOS__ /* FIXME: Inspect */
32 #define GetCurrentProcessToken() ((HANDLE)~(ULONG_PTR)3)
33 #endif
34 
35 /************************************************************
36  * WTSCloseServer (WTSAPI32.@)
37  */
39 {
40  FIXME("Stub %p\n", hServer);
41 }
42 
43 /************************************************************
44  * WTSConnectSessionA (WTSAPI32.@)
45  */
46 BOOL WINAPI WTSConnectSessionA(ULONG LogonId, ULONG TargetLogonId, PSTR pPassword, BOOL bWait)
47 {
48  FIXME("Stub %d %d (%s) %d\n", LogonId, TargetLogonId, debugstr_a(pPassword), bWait);
49  return TRUE;
50 }
51 
52 /************************************************************
53  * WTSConnectSessionW (WTSAPI32.@)
54  */
55 BOOL WINAPI WTSConnectSessionW(ULONG LogonId, ULONG TargetLogonId, PWSTR pPassword, BOOL bWait)
56 {
57  FIXME("Stub %d %d (%s) %d\n", LogonId, TargetLogonId, debugstr_w(pPassword), bWait);
58  return TRUE;
59 }
60 
61 /************************************************************
62  * WTSDisconnectSession (WTSAPI32.@)
63  */
65 {
66  FIXME("Stub %p 0x%08x %d\n", hServer, SessionId, bWait);
67  return TRUE;
68 }
69 
70 /************************************************************
71  * WTSEnableChildSessions (WTSAPI32.@)
72  */
74 {
75  FIXME("Stub %d\n", enable);
76  return TRUE;
77 }
78 
79 
80 /************************************************************
81  * WTSEnumerateProcessesExW (WTSAPI32.@)
82  */
84 {
85  FIXME("Stub %p %p %d %p %p\n", server, level, session_id, info, count);
86  if (count) *count = 0;
87  return FALSE;
88 }
89 
90 /************************************************************
91  * WTSEnumerateProcessesExA (WTSAPI32.@)
92  */
94 {
95  FIXME("Stub %p %p %d %p %p\n", server, level, session_id, info, count);
96  if (count) *count = 0;
97  return FALSE;
98 }
99 
100 /************************************************************
101  * WTSEnumerateProcessesA (WTSAPI32.@)
102  */
104  PWTS_PROCESS_INFOA* ppProcessInfo, DWORD* pCount)
105 {
106  FIXME("Stub %p 0x%08x 0x%08x %p %p\n", hServer, Reserved, Version,
107  ppProcessInfo, pCount);
108 
109  if (!ppProcessInfo || !pCount) return FALSE;
110 
111  *pCount = 0;
112  *ppProcessInfo = NULL;
113 
114  return TRUE;
115 }
116 
117 /************************************************************
118  * WTSEnumerateProcessesW (WTSAPI32.@)
119  */
121  PWTS_PROCESS_INFOW* ppProcessInfo, DWORD* pCount)
122 {
123  WTS_PROCESS_INFOW *processInfo;
125  ULONG size = 0x4000;
126  void *buf = NULL;
128  DWORD count;
129  WCHAR *name;
130 
131  if (!ppProcessInfo || !pCount || Reserved != 0 || Version != 1)
132  {
134  return FALSE;
135  }
136 
137  if (hServer != WTS_CURRENT_SERVER_HANDLE)
138  {
140  return FALSE;
141  }
142 
143  do
144  {
145  size *= 2;
146  HeapFree(GetProcessHeap(), 0, buf);
147  buf = HeapAlloc(GetProcessHeap(), 0, size);
148  if (!buf)
149  {
151  return FALSE;
152  }
154  }
156 
157  if (status != STATUS_SUCCESS)
158  {
159  HeapFree(GetProcessHeap(), 0, buf);
161  return FALSE;
162  }
163 
164  spi = buf;
165  count = size = 0;
166  for (;;)
167  {
168  size += sizeof(WTS_PROCESS_INFOW) + spi->ProcessName.Length + sizeof(WCHAR);
169  count++;
170  if (spi->NextEntryOffset == 0) break;
171  spi = (SYSTEM_PROCESS_INFORMATION *)(((PCHAR)spi) + spi->NextEntryOffset);
172  }
173 
174  processInfo = HeapAlloc(GetProcessHeap(), 0, size);
175  if (!processInfo)
176  {
177  HeapFree(GetProcessHeap(), 0, buf);
179  return FALSE;
180  }
181  name = (WCHAR *)&processInfo[count];
182 
183  *ppProcessInfo = processInfo;
184  *pCount = count;
185 
186  spi = buf;
187  while (count--)
188  {
189  processInfo->SessionId = 0;
190  processInfo->ProcessId = HandleToUlong(spi->UniqueProcessId);
191  processInfo->pProcessName = name;
192  processInfo->pUserSid = NULL;
193  memcpy( name, spi->ProcessName.Buffer, spi->ProcessName.Length );
194  name[ spi->ProcessName.Length/sizeof(WCHAR) ] = 0;
195 
196  processInfo++;
197  name += (spi->ProcessName.Length + sizeof(WCHAR))/sizeof(WCHAR);
198  spi = (SYSTEM_PROCESS_INFORMATION *)(((PCHAR)spi) + spi->NextEntryOffset);
199  }
200 
201  HeapFree(GetProcessHeap(), 0, buf);
202  return TRUE;
203 }
204 
205 /************************************************************
206  * WTSEnumerateServersA (WTSAPI32.@)
207  */
209 {
210  FIXME("Stub %s 0x%08x 0x%08x %p %p\n", debugstr_a(pDomainName), Reserved, Version, ppServerInfo, pCount);
211  return FALSE;
212 }
213 
214 /************************************************************
215  * WTSEnumerateServersW (WTSAPI32.@)
216  */
218 {
219  FIXME("Stub %s 0x%08x 0x%08x %p %p\n", debugstr_w(pDomainName), Reserved, Version, ppServerInfo, pCount);
220  return FALSE;
221 }
222 
223 
224 /************************************************************
225  * WTSEnumerateEnumerateSessionsExW (WTSAPI32.@)
226  */
228 {
229  FIXME("Stub %p %p %d %p %p\n", server, level, filter, info, count);
230  if (count) *count = 0;
231  return FALSE;
232 }
233 
234 /************************************************************
235  * WTSEnumerateEnumerateSessionsExA (WTSAPI32.@)
236  */
238 {
239  FIXME("Stub %p %p %d %p %p\n", server, level, filter, info, count);
240  if (count) *count = 0;
241  return FALSE;
242 }
243 
244 /************************************************************
245  * WTSEnumerateEnumerateSessionsA (WTSAPI32.@)
246  */
248  PWTS_SESSION_INFOA* ppSessionInfo, DWORD* pCount)
249 {
250  static int once;
251 
252  if (!once++) FIXME("Stub %p 0x%08x 0x%08x %p %p\n", hServer, Reserved, Version,
253  ppSessionInfo, pCount);
254 
255  if (!ppSessionInfo || !pCount) return FALSE;
256 
257  *pCount = 0;
258  *ppSessionInfo = NULL;
259 
260  return TRUE;
261 }
262 
263 /************************************************************
264  * WTSEnumerateEnumerateSessionsW (WTSAPI32.@)
265  */
267  PWTS_SESSION_INFOW* ppSessionInfo, DWORD* pCount)
268 {
269  FIXME("Stub %p 0x%08x 0x%08x %p %p\n", hServer, Reserved, Version,
270  ppSessionInfo, pCount);
271 
272  if (!ppSessionInfo || !pCount) return FALSE;
273 
274  *pCount = 0;
275  *ppSessionInfo = NULL;
276 
277  return TRUE;
278 }
279 
280 /************************************************************
281  * WTSFreeMemory (WTSAPI32.@)
282  */
284 {
285  heap_free(pMemory);
286 }
287 
288 /************************************************************
289  * WTSFreeMemoryExA (WTSAPI32.@)
290  */
292 {
293  TRACE("%d %p %d\n", type, ptr, nmemb);
294  heap_free(ptr);
295  return TRUE;
296 }
297 
298 /************************************************************
299  * WTSFreeMemoryExW (WTSAPI32.@)
300  */
302 {
303  TRACE("%d %p %d\n", type, ptr, nmemb);
304  heap_free(ptr);
305  return TRUE;
306 }
307 
308 
309 /************************************************************
310  * WTSLogoffSession (WTSAPI32.@)
311  */
312 BOOL WINAPI WTSLogoffSession(HANDLE hserver, DWORD session_id, BOOL bwait)
313 {
314  FIXME("(%p, 0x%x, %d): stub\n", hserver, session_id, bwait);
316  return FALSE;
317 }
318 
319 
320 /************************************************************
321  * WTSOpenServerExW (WTSAPI32.@)
322  */
324 {
325  FIXME("(%s) stub\n", debugstr_w(server_name));
327  return NULL;
328 }
329 
330 /************************************************************
331  * WTSOpenServerExA (WTSAPI32.@)
332  */
334 {
335  FIXME("(%s) stub\n", debugstr_a(server_name));
337  return NULL;
338 }
339 
340 /************************************************************
341  * WTSOpenServerA (WTSAPI32.@)
342  */
344 {
345  FIXME("(%s) stub\n", debugstr_a(pServerName));
347  return NULL;
348 }
349 
350 /************************************************************
351  * WTSOpenServerW (WTSAPI32.@)
352  */
354 {
355  FIXME("(%s) stub\n", debugstr_w(pServerName));
357  return NULL;
358 }
359 
360 /************************************************************
361  * WTSQuerySessionInformationA (WTSAPI32.@)
362  */
364  HANDLE hServer,
366  WTS_INFO_CLASS WTSInfoClass,
367  LPSTR* Buffer,
369 {
370 #ifdef __REACTOS__
371  const size_t wcsErrorCode = -1;
372  LPWSTR buffer = NULL;
373  LPSTR ansiBuffer = NULL;
374  DWORD bytesReturned = 0;
375  BOOL result = FALSE;
376  size_t len;
377 
378  if (!BytesReturned || !Buffer)
379  {
381  return FALSE;
382  }
383 
384  if (!WTSQuerySessionInformationW(hServer, SessionId, WTSInfoClass, &buffer, &bytesReturned))
385  {
386  ansiBuffer = (LPSTR)buffer;
387  *Buffer = ansiBuffer;
388  *BytesReturned = bytesReturned;
389  return FALSE;
390  }
391 
392  switch (WTSInfoClass)
393  {
394  case WTSInitialProgram:
395  case WTSApplicationName:
396  case WTSWorkingDirectory:
397  case WTSOEMId:
398  case WTSUserName:
399  case WTSWinStationName:
400  case WTSDomainName:
401  case WTSClientName:
402  case WTSClientDirectory:
403  {
404  len = wcstombs(NULL, buffer, 0);
405  if (len != wcsErrorCode)
406  {
407  len++;
408  ansiBuffer = heap_alloc_zero(len);
409  if (ansiBuffer && (wcstombs(ansiBuffer, buffer, len) != wcsErrorCode))
410  {
411  result = TRUE;
412  bytesReturned = len;
413  }
414  }
416  break;
417  }
418 
419  default:
420  {
421  result = TRUE;
422  ansiBuffer = (LPSTR)buffer;
423  break;
424  }
425  }
426 
427  *Buffer = ansiBuffer;
428  *BytesReturned = bytesReturned;
429 
430  return result;
431 #else
432  /* FIXME: Forward request to winsta.dll::WinStationQueryInformationA */
433  FIXME("Stub %p 0x%08x %d %p %p\n", hServer, SessionId, WTSInfoClass,
435 
436  return FALSE;
437 #endif
438 }
439 
440 /************************************************************
441  * WTSQuerySessionInformationW (WTSAPI32.@)
442  */
444  HANDLE hServer,
446  WTS_INFO_CLASS WTSInfoClass,
447  LPWSTR* Buffer,
449 {
450 #ifdef __REACTOS__
451  if (!BytesReturned || !Buffer)
452  {
454  return FALSE;
455  }
456 
457 #if (NTDDI_VERSION >= NTDDI_WS08)
458  if (WTSInfoClass > WTSIsRemoteSession)
459 #else
460  if (WTSInfoClass > WTSClientProtocolType)
461 #endif
462  {
464  return FALSE;
465  }
466 
467  switch (WTSInfoClass)
468  {
469  case WTSSessionId:
470  {
471  const DWORD size = sizeof(ULONG);
472  ULONG* output = heap_alloc_zero(size);
473  if (!output)
474  {
476  return FALSE;
477  }
478 
479  *output = NtCurrentTeb()->Peb->SessionId;
480  *Buffer = (LPWSTR)output;
481  *BytesReturned = size;
482  return TRUE;
483  }
484 
485  case WTSUserName:
486  {
487  WCHAR* username;
488  DWORD count = 0;
489 
492  return FALSE;
493  username = heap_alloc(count * sizeof(WCHAR));
494  if (!username)
495  {
497  return FALSE;
498  }
499 
501  *Buffer = username;
502  *BytesReturned = count * sizeof(WCHAR);
503  return TRUE;
504  }
505 
506  case WTSConnectState:
507  {
508  const DWORD size = sizeof(DWORD);
509  WCHAR* output = heap_alloc_zero(size);
510  if (!output)
511  {
513  return FALSE;
514  }
515 
516  *Buffer = output;
517  *BytesReturned = size;
518  return TRUE;
519  }
520 
522  {
523  const DWORD size = sizeof(WORD);
524  WCHAR* output = heap_alloc_zero(size);
525  if (!output)
526  {
528  return FALSE;
529  }
530 
531  *Buffer = output;
532  *BytesReturned = size;
533  return TRUE;
534  }
535 
536 #if (NTDDI_VERSION >= NTDDI_WS08)
537  case WTSIdleTime:
538  case WTSLogonTime:
539  case WTSIncomingBytes:
540  case WTSOutgoingBytes:
541  case WTSIncomingFrames:
542  case WTSOutgoingFrames:
543  {
545  return FALSE;
546  }
547 #endif /* (NTDDI_VERSION >= NTDDI_WS08) */
548 
549  default:
550  {
551  if (BytesReturned)
552  *BytesReturned = 0;
553 
554  break;
555  }
556  }
557 
558  /* FIXME: Forward request to winsta.dll::WinStationQueryInformationW */
559  FIXME("Stub %p 0x%08x %d %p %p\n", hServer, SessionId, WTSInfoClass,
561 
562  return FALSE;
563 #else
564  /* FIXME: Forward request to winsta.dll::WinStationQueryInformationW */
565  FIXME("Stub %p 0x%08x %d %p %p\n", hServer, SessionId, WTSInfoClass,
567 
568  if (WTSInfoClass == WTSUserName)
569  {
570  WCHAR *username;
571  DWORD count = 0;
572 
575  if (!(username = heap_alloc(count * sizeof(WCHAR)))) return FALSE;
577  *Buffer = username;
578  *BytesReturned = count * sizeof(WCHAR);
579  return TRUE;
580  }
581  return FALSE;
582 #endif
583 }
584 
585 /************************************************************
586  * WTSQueryUserToken (WTSAPI32.@)
587  */
589 {
590  FIXME("%u %p semi-stub!\n", session_id, token);
591 
592  if (!token)
593  {
595  return FALSE;
596  }
597 
601 }
602 
603 /************************************************************
604  * WTSQueryUserConfigA (WTSAPI32.@)
605  */
606 BOOL WINAPI WTSQueryUserConfigA(LPSTR pServerName, LPSTR pUserName, WTS_CONFIG_CLASS WTSConfigClass, LPSTR *ppBuffer, DWORD *pBytesReturned)
607 {
608  FIXME("Stub (%s) (%s) 0x%08x %p %p\n", debugstr_a(pServerName), debugstr_a(pUserName), WTSConfigClass,
609  ppBuffer, pBytesReturned);
610  return FALSE;
611 }
612 
613 /************************************************************
614  * WTSQueryUserConfigW (WTSAPI32.@)
615  */
616 BOOL WINAPI WTSQueryUserConfigW(LPWSTR pServerName, LPWSTR pUserName, WTS_CONFIG_CLASS WTSConfigClass, LPWSTR *ppBuffer, DWORD *pBytesReturned)
617 {
618  FIXME("Stub (%s) (%s) 0x%08x %p %p\n", debugstr_w(pServerName), debugstr_w(pUserName), WTSConfigClass,
619  ppBuffer, pBytesReturned);
620  return FALSE;
621 }
622 
623 
624 /************************************************************
625  * WTSRegisterSessionNotification (WTSAPI32.@)
626  */
628 {
629  FIXME("Stub %p 0x%08x\n", hWnd, dwFlags);
630  return TRUE;
631 }
632 
633 /************************************************************
634  * WTSRegisterSessionNotificationEx (WTSAPI32.@)
635  */
637 {
638  FIXME("Stub %p %p 0x%08x\n", hServer, hWnd, dwFlags);
639  return FALSE;
640 }
641 
642 
643 /************************************************************
644  * WTSSendMessageA (WTSAPI32.@)
645  */
646 BOOL WINAPI WTSSendMessageA(HANDLE hServer, DWORD SessionId, LPSTR pTitle, DWORD TitleLength, LPSTR pMessage,
647  DWORD MessageLength, DWORD Style, DWORD Timeout, DWORD *pResponse, BOOL bWait)
648 {
649  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);
650  return FALSE;
651 }
652 
653 /************************************************************
654  * WTSSendMessageW (WTSAPI32.@)
655  */
656 BOOL WINAPI WTSSendMessageW(HANDLE hServer, DWORD SessionId, LPWSTR pTitle, DWORD TitleLength, LPWSTR pMessage,
657  DWORD MessageLength, DWORD Style, DWORD Timeout, DWORD *pResponse, BOOL bWait)
658 {
659  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);
660  return FALSE;
661 }
662 
663 /************************************************************
664  * WTSSetUserConfigA (WTSAPI32.@)
665  */
667 {
668  FIXME("Stub (%s) (%s) 0x%08x %p %d\n", debugstr_a(pServerName), debugstr_a(pUserName), WTSConfigClass,pBuffer, DataLength);
669  return FALSE;
670 }
671 
672 /************************************************************
673  * WTSSetUserConfigW (WTSAPI32.@)
674  */
676 {
677  FIXME("Stub (%s) (%s) 0x%08x %p %d\n", debugstr_w(pServerName), debugstr_w(pUserName), WTSConfigClass,pBuffer, DataLength);
678  return FALSE;
679 }
680 
681 /************************************************************
682  * WTSShutdownSystem (WTSAPI32.@)
683  */
684 BOOL WINAPI WTSShutdownSystem(HANDLE hServer, DWORD ShutdownFlag)
685 {
686  FIXME("Stub %p 0x%08x\n", hServer,ShutdownFlag);
687  return FALSE;
688 }
689 
690 /************************************************************
691  * WTSStartRemoteControlSessionA (WTSAPI32.@)
692  */
693 BOOL WINAPI WTSStartRemoteControlSessionA(LPSTR pTargetServerName, ULONG TargetLogonId, BYTE HotkeyVk, USHORT HotkeyModifiers)
694 {
695  FIXME("Stub (%s) %d %d %d\n", debugstr_a(pTargetServerName), TargetLogonId, HotkeyVk, HotkeyModifiers);
696  return FALSE;
697 }
698 
699 /************************************************************
700  * WTSStartRemoteControlSessionW (WTSAPI32.@)
701  */
702 BOOL WINAPI WTSStartRemoteControlSessionW(LPWSTR pTargetServerName, ULONG TargetLogonId, BYTE HotkeyVk, USHORT HotkeyModifiers)
703 {
704  FIXME("Stub (%s) %d %d %d\n", debugstr_w(pTargetServerName), TargetLogonId, HotkeyVk, HotkeyModifiers);
705  return FALSE;
706 }
707 
708 /************************************************************
709  * WTSStopRemoteControlSession (WTSAPI32.@)
710  */
712 {
713  FIXME("Stub %d\n", LogonId);
714  return FALSE;
715 }
716 
717 /************************************************************
718  * WTSTerminateProcess (WTSAPI32.@)
719  */
721 {
722  FIXME("Stub %p %d %d\n", hServer, ProcessId, ExitCode);
723  return FALSE;
724 }
725 
726 /************************************************************
727  * WTSUnRegisterSessionNotification (WTSAPI32.@)
728  */
730 {
731  FIXME("Stub %p\n", hWnd);
732  return FALSE;
733 }
734 
735 /************************************************************
736  * WTSUnRegisterSessionNotification (WTSAPI32.@)
737  */
739 {
740  FIXME("Stub %p %p\n", hServer, hWnd);
741  return FALSE;
742 }
743 
744 
745 /************************************************************
746  * WTSVirtualChannelClose (WTSAPI32.@)
747  */
749 {
750  FIXME("Stub %p\n", hChannelHandle);
751  return FALSE;
752 }
753 
754 /************************************************************
755  * WTSVirtualChannelOpen (WTSAPI32.@)
756  */
758 {
759  FIXME("Stub %p %d (%s)\n", hServer, SessionId, debugstr_a(pVirtualName));
760  return NULL;
761 }
762 
763 /************************************************************
764  * WTSVirtualChannelOpen (WTSAPI32.@)
765  */
767 {
768  FIXME("Stub %d (%s) %d\n", SessionId, debugstr_a(pVirtualName), flags);
769  return NULL;
770 }
771 
772 /************************************************************
773  * WTSVirtualChannelPurgeInput (WTSAPI32.@)
774  */
776 {
777  FIXME("Stub %p\n", hChannelHandle);
778  return FALSE;
779 }
780 
781 /************************************************************
782  * WTSVirtualChannelPurgeOutput (WTSAPI32.@)
783  */
785 {
786  FIXME("Stub %p\n", hChannelHandle);
787  return FALSE;
788 }
789 
790 
791 /************************************************************
792  * WTSVirtualChannelQuery (WTSAPI32.@)
793  */
794 BOOL WINAPI WTSVirtualChannelQuery(HANDLE hChannelHandle, WTS_VIRTUAL_CLASS WtsVirtualClass, PVOID *ppBuffer, DWORD *pBytesReturned)
795 {
796  FIXME("Stub %p %d %p %p\n", hChannelHandle, WtsVirtualClass, ppBuffer, pBytesReturned);
797  return FALSE;
798 }
799 
800 /************************************************************
801  * WTSVirtualChannelRead (WTSAPI32.@)
802  */
804 {
805  FIXME("Stub %p %d %p %d %p\n", hChannelHandle, TimeOut, Buffer, BufferSize, pBytesRead);
806  return FALSE;
807 }
808 
809 /************************************************************
810  * WTSVirtualChannelWrite (WTSAPI32.@)
811  */
813 {
814  FIXME("Stub %p %p %d %p\n", hChannelHandle, Buffer, Length, pBytesWritten);
815  return FALSE;
816 }
817 
818 /************************************************************
819  * WTSWaitSystemEvent (WTSAPI32.@)
820  */
822 {
823  /* FIXME: Forward request to winsta.dll::WinStationWaitSystemEvent */
824  FIXME("Stub %p 0x%08x %p\n", hServer, Mask, Flags);
825  return FALSE;
826 }
BOOL WINAPI WTSEnumerateServersW(LPWSTR pDomainName, DWORD Reserved, DWORD Version, PWTS_SERVER_INFOW *ppServerInfo, DWORD *pCount)
Definition: wtsapi32.c:217
BOOL WINAPI WTSVirtualChannelPurgeInput(HANDLE hChannelHandle)
Definition: wtsapi32.c:775
signed char * PCHAR
Definition: retypes.h:7
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
BOOL WINAPI WTSVirtualChannelPurgeOutput(HANDLE hChannelHandle)
Definition: wtsapi32.c:784
GLint level
Definition: gl.h:1546
IN PLARGE_INTEGER IN PLARGE_INTEGER PEPROCESS ProcessId
Definition: fatprocs.h:2697
#define TRUE
Definition: types.h:120
NTSYSAPI NTSTATUS NTAPI NtQuerySystemInformation(IN SYSTEM_INFORMATION_CLASS SystemInfoClass, OUT PVOID SystemInfoBuffer, IN ULONG SystemInfoBufferSize, OUT PULONG BytesReturned OPTIONAL)
static UCHAR ULONG UCHAR ULONG UCHAR * output
Definition: bcrypt.c:29
IN PVOID IN PVOID IN USHORT Version
Definition: pci.h:359
static rfbScreenInfoPtr server
Definition: vnc.c:74
BOOL WINAPI WTSQuerySessionInformationA(HANDLE hServer, DWORD SessionId, WTS_INFO_CLASS WTSInfoClass, LPSTR *Buffer, DWORD *BytesReturned)
Definition: wtsapi32.c:363
#define STATUS_INFO_LENGTH_MISMATCH
Definition: udferr_usr.h:133
BOOL WINAPI WTSVirtualChannelClose(HANDLE hChannelHandle)
Definition: wtsapi32.c:748
BOOL WINAPI WTSStartRemoteControlSessionW(LPWSTR pTargetServerName, ULONG TargetLogonId, BYTE HotkeyVk, USHORT HotkeyModifiers)
Definition: wtsapi32.c:702
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
enum tagWTS_INFO_CLASS WTS_INFO_CLASS
BOOL WINAPI WTSLogoffSession(HANDLE hserver, DWORD session_id, BOOL bwait)
Definition: wtsapi32.c:312
uint16_t * PWSTR
Definition: typedefs.h:55
GLuint GLuint GLsizei count
Definition: gl.h:1545
BOOL WINAPI WTSShutdownSystem(HANDLE hServer, DWORD ShutdownFlag)
Definition: wtsapi32.c:684
BOOL WINAPI WTSEnumerateSessionsExA(HANDLE server, DWORD *level, DWORD filter, WTS_SESSION_INFO_1A *info, DWORD *count)
Definition: wtsapi32.c:237
BOOL WINAPI WTSEnumerateProcessesExA(HANDLE server, DWORD *level, DWORD session_id, char **info, DWORD *count)
Definition: wtsapi32.c:93
ULONG SessionId
Definition: dllmain.c:28
BOOL WINAPI WTSEnumerateProcessesA(HANDLE hServer, DWORD Reserved, DWORD Version, PWTS_PROCESS_INFOA *ppProcessInfo, DWORD *pCount)
Definition: wtsapi32.c:103
LONG NTSTATUS
Definition: precomp.h:26
#define HandleToUlong(h)
Definition: basetsd.h:79
BOOL WINAPI WTSVirtualChannelQuery(HANDLE hChannelHandle, WTS_VIRTUAL_CLASS WtsVirtualClass, PVOID *ppBuffer, DWORD *pBytesReturned)
Definition: wtsapi32.c:794
HWND hWnd
Definition: settings.c:17
BOOL WINAPI WTSEnumerateSessionsA(HANDLE hServer, DWORD Reserved, DWORD Version, PWTS_SESSION_INFOA *ppSessionInfo, DWORD *pCount)
Definition: wtsapi32.c:247
LPWSTR pProcessName
Definition: wtsapi32.h:133
BOOL WINAPI WTSFreeMemoryExA(WTS_TYPE_CLASS type, void *ptr, ULONG nmemb)
Definition: wtsapi32.c:291
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
GLuint buffer
Definition: glext.h:5915
BOOL WINAPI WTSEnableChildSessions(BOOL enable)
Definition: wtsapi32.c:73
HANDLE WINAPI WTSVirtualChannelOpen(HANDLE hServer, DWORD SessionId, LPSTR pVirtualName)
Definition: wtsapi32.c:757
char * LPSTR
Definition: xmlstorage.h:182
BOOL WINAPI WTSStopRemoteControlSession(ULONG LogonId)
Definition: wtsapi32.c:711
#define DWORD
Definition: nt_native.h:44
enum _WTS_VIRTUAL_CLASS WTS_VIRTUAL_CLASS
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
#define ERROR_INVALID_USER_BUFFER
Definition: winerror.h:1091
BOOL WINAPI WTSSendMessageW(HANDLE hServer, DWORD SessionId, LPWSTR pTitle, DWORD TitleLength, LPWSTR pMessage, DWORD MessageLength, DWORD Style, DWORD Timeout, DWORD *pResponse, BOOL bWait)
Definition: wtsapi32.c:656
BOOL WINAPI WTSQueryUserConfigW(LPWSTR pServerName, LPWSTR pUserName, WTS_CONFIG_CLASS WTSConfigClass, LPWSTR *ppBuffer, DWORD *pBytesReturned)
Definition: wtsapi32.c:616
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
NTSYSAPI ULONG WINAPI RtlNtStatusToDosError(NTSTATUS)
#define DUPLICATE_SAME_ACCESS
unsigned int BOOL
Definition: ntddk_ex.h:94
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat token
Definition: glfuncs.h:210
BOOL WINAPI WTSRegisterSessionNotificationEx(HANDLE hServer, HWND hWnd, DWORD dwFlags)
Definition: wtsapi32.c:636
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:110
static PVOID ptr
Definition: dispmode.c:27
BOOL WINAPI WTSEnumerateProcessesExW(HANDLE server, DWORD *level, DWORD session_id, WCHAR **info, DWORD *count)
Definition: wtsapi32.c:83
smooth NULL
Definition: ftsmooth.c:416
PVOID pBuffer
_Reserved_ PVOID Reserved
Definition: winddi.h:3974
Definition: bufpool.h:45
BOOL WINAPI WTSVirtualChannelWrite(HANDLE hChannelHandle, PCHAR Buffer, ULONG Length, PULONG pBytesWritten)
Definition: wtsapi32.c:812
BOOL WINAPI WTSQueryUserToken(ULONG session_id, PHANDLE token)
Definition: wtsapi32.c:588
BOOL WINAPI WTSEnumerateSessionsW(HANDLE hServer, DWORD Reserved, DWORD Version, PWTS_SESSION_INFOW *ppSessionInfo, DWORD *pCount)
Definition: wtsapi32.c:266
enum _WTS_TYPE_CLASS WTS_TYPE_CLASS
#define GetCurrentProcessToken()
Definition: security.c:40
static WCHAR username[]
Definition: url.c:32
#define WTS_CURRENT_SERVER_HANDLE
Definition: wtsapi32.h:197
HANDLE WINAPI WTSVirtualChannelOpenEx(DWORD SessionId, LPSTR pVirtualName, DWORD flags)
Definition: wtsapi32.c:766
BOOL WINAPI GetUserNameW(LPWSTR lpszName, LPDWORD lpSize)
Definition: misc.c:291
#define TRACE(s)
Definition: solgame.cpp:4
GLsizeiptr size
Definition: glext.h:5919
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
const DWORD Style
Definition: appswitch.c:71
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define debugstr_a
Definition: kernel32.h:31
void WINAPI WTSCloseServer(HANDLE hServer)
Definition: wtsapi32.c:38
HANDLE WINAPI GetCurrentProcess(VOID)
Definition: proc.c:1138
BOOL WINAPI WTSEnumerateServersA(LPSTR pDomainName, DWORD Reserved, DWORD Version, PWTS_SERVER_INFOA *ppServerInfo, DWORD *pCount)
Definition: wtsapi32.c:208
BOOL WINAPI WTSQueryUserConfigA(LPSTR pServerName, LPSTR pUserName, WTS_CONFIG_CLASS WTSConfigClass, LPSTR *ppBuffer, DWORD *pBytesReturned)
Definition: wtsapi32.c:606
#define WINAPI
Definition: msvc.h:6
#define BufferSize
Definition: classpnp.h:419
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned long DWORD
Definition: ntddk_ex.h:95
HANDLE WINAPI WTSOpenServerA(LPSTR pServerName)
Definition: wtsapi32.c:343
#define SetLastError(x)
Definition: compat.h:417
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
GLbitfield flags
Definition: glext.h:7161
char * server_name
Definition: widl.c:145
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
HANDLE WINAPI WTSOpenServerW(LPWSTR pServerName)
Definition: wtsapi32.c:353
PVOID *typedef PHANDLE
Definition: ntsecpkg.h:414
BOOL WINAPI WTSEnumerateSessionsExW(HANDLE server, DWORD *level, DWORD filter, WTS_SESSION_INFO_1W *info, DWORD *count)
Definition: wtsapi32.c:227
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
BOOL WINAPI WTSDisconnectSession(HANDLE hServer, DWORD SessionId, BOOL bWait)
Definition: wtsapi32.c:64
GLenum GLsizei len
Definition: glext.h:6722
unsigned char BYTE
Definition: mem.h:68
BOOL WINAPI WTSSendMessageA(HANDLE hServer, DWORD SessionId, LPSTR pTitle, DWORD TitleLength, LPSTR pMessage, DWORD MessageLength, DWORD Style, DWORD Timeout, DWORD *pResponse, BOOL bWait)
Definition: wtsapi32.c:646
BOOL WINAPI WTSRegisterSessionNotification(HWND hWnd, DWORD dwFlags)
Definition: wtsapi32.c:627
void WINAPI WTSFreeMemory(PVOID pMemory)
Definition: wtsapi32.c:283
HANDLE WINAPI WTSOpenServerExW(WCHAR *server_name)
Definition: wtsapi32.c:323
BOOL WINAPI WTSTerminateProcess(HANDLE hServer, DWORD ProcessId, DWORD ExitCode)
Definition: wtsapi32.c:720
GLboolean enable
Definition: glext.h:11120
static ULONG Timeout
Definition: ping.c:61
FORCEINLINE struct _TEB * NtCurrentTeb(VOID)
Definition: psfuncs.h:420
unsigned short USHORT
Definition: pedump.c:61
signed char * PSTR
Definition: retypes.h:7
_In_ FILTER_INFORMATION_CLASS _In_ ULONG _Out_ PULONG BytesReturned
Definition: fltkernel.h:1716
BOOL WINAPI WTSQuerySessionInformationW(HANDLE hServer, DWORD SessionId, WTS_INFO_CLASS WTSInfoClass, LPWSTR *Buffer, DWORD *BytesReturned)
Definition: wtsapi32.c:443
BOOL WINAPI WTSConnectSessionW(ULONG LogonId, ULONG TargetLogonId, PWSTR pPassword, BOOL bWait)
Definition: wtsapi32.c:55
unsigned int * PULONG
Definition: retypes.h:1
struct _WTS_PROCESS_INFOW WTS_PROCESS_INFOW
_IRQL_requires_same_ _In_ PLSA_STRING _In_ SECURITY_LOGON_TYPE _In_ ULONG _In_ ULONG _In_opt_ PTOKEN_GROUPS _In_ PTOKEN_SOURCE _Out_ PVOID _Out_ PULONG _Inout_ PLUID LogonId
HANDLE WINAPI WTSOpenServerExA(char *server_name)
Definition: wtsapi32.c:333
#define ERROR_NOT_SUPPORTED
Definition: compat.h:90
BOOL WINAPI WTSWaitSystemEvent(HANDLE hServer, DWORD Mask, DWORD *Flags)
Definition: wtsapi32.c:821
Definition: name.c:38
BOOL WINAPI WTSUnRegisterSessionNotificationEx(HANDLE hServer, HWND hWnd)
Definition: wtsapi32.c:738
WINE_DEFAULT_DEBUG_CHANNEL(wtsapi)
unsigned int ULONG
Definition: retypes.h:1
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:92
BOOL WINAPI WTSSetUserConfigW(LPWSTR pServerName, LPWSTR pUserName, WTS_CONFIG_CLASS WTSConfigClass, LPWSTR pBuffer, DWORD DataLength)
Definition: wtsapi32.c:675
BOOL WINAPI WTSUnRegisterSessionNotification(HWND hWnd)
Definition: wtsapi32.c:729
BOOL WINAPI WTSFreeMemoryExW(WTS_TYPE_CLASS type, void *ptr, ULONG nmemb)
Definition: wtsapi32.c:301
WCHAR * LPWSTR
Definition: xmlstorage.h:184
_Must_inspect_result_ _Out_writes_to_ DataLength PHIDP_DATA _Inout_ PULONG DataLength
Definition: hidpi.h:333
size_t __cdecl wcstombs(_Out_writes_opt_z_(_MaxCount) char *_Dest, _In_z_ const wchar_t *_Source, _In_ size_t _MaxCount)
BOOL WINAPI WTSStartRemoteControlSessionA(LPSTR pTargetServerName, ULONG TargetLogonId, BYTE HotkeyVk, USHORT HotkeyModifiers)
Definition: wtsapi32.c:693
return STATUS_SUCCESS
Definition: btrfs.c:2938
GLuint64EXT * result
Definition: glext.h:11304
static SERVICE_STATUS status
Definition: service.c:31
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
Definition: glext.h:7005
BOOL WINAPI WTSVirtualChannelRead(HANDLE hChannelHandle, ULONG TimeOut, PCHAR Buffer, ULONG BufferSize, PULONG pBytesRead)
Definition: wtsapi32.c:803
BOOL WINAPI WTSEnumerateProcessesW(HANDLE hServer, DWORD Reserved, DWORD Version, PWTS_PROCESS_INFOW *ppProcessInfo, DWORD *pCount)
Definition: wtsapi32.c:120
BOOL WINAPI WTSConnectSessionA(ULONG LogonId, ULONG TargetLogonId, PSTR pPassword, BOOL bWait)
Definition: wtsapi32.c:46
#define HeapFree(x, y, z)
Definition: compat.h:402
BOOL WINAPI WTSSetUserConfigA(LPSTR pServerName, LPSTR pUserName, WTS_CONFIG_CLASS WTSConfigClass, LPSTR pBuffer, DWORD DataLength)
Definition: wtsapi32.c:666
BOOL WINAPI DuplicateHandle(IN HANDLE hSourceProcessHandle, IN HANDLE hSourceHandle, IN HANDLE hTargetProcessHandle, OUT LPHANDLE lpTargetHandle, IN DWORD dwDesiredAccess, IN BOOL bInheritHandle, IN DWORD dwOptions)
Definition: handle.c:149
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13
static BOOL heap_free(void *mem)
Definition: appwiz.h:75
enum _WTS_CONFIG_CLASS WTS_CONFIG_CLASS
#define ERROR_INSUFFICIENT_BUFFER
Definition: dderror.h:10
Definition: ps.c:97
GLuint const GLchar * name
Definition: glext.h:6031