ReactOS  0.4.14-dev-317-g96040ec
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 "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 
31 
32 #ifdef __REACTOS__ /* FIXME: Inspect */
33 #define GetCurrentProcessToken() ((HANDLE)~(ULONG_PTR)3)
34 #endif
35 
36 /************************************************************
37  * WTSCloseServer (WTSAPI32.@)
38  */
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  */
66 {
67  FIXME("Stub %p 0x%08x %d\n", hServer, SessionId, bWait);
68  return TRUE;
69 }
70 
71 /************************************************************
72  * WTSEnableChildSessions (WTSAPI32.@)
73  */
75 {
76  FIXME("Stub %d\n", enable);
77  return TRUE;
78 }
79 
80 /************************************************************
81  * WTSEnumerateProcessesA (WTSAPI32.@)
82  */
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  */
101  PWTS_PROCESS_INFOW* ppProcessInfo, DWORD* pCount)
102 {
103  WTS_PROCESS_INFOW *processInfo;
105  ULONG size = 0x4000;
106  void *buf = NULL;
108  DWORD count;
109  WCHAR *name;
110 
111  if (!ppProcessInfo || !pCount || Reserved != 0 || Version != 1)
112  {
114  return FALSE;
115  }
116 
117  if (hServer != WTS_CURRENT_SERVER_HANDLE)
118  {
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  {
131  return FALSE;
132  }
134  }
136 
137  if (status != STATUS_SUCCESS)
138  {
139  HeapFree(GetProcessHeap(), 0, buf);
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);
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  */
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  */
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  */
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  */
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  */
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);
255  return FALSE;
256 }
257 
258 /************************************************************
259  * WTSOpenServerA (WTSAPI32.@)
260  */
262 {
263  FIXME("(%s) stub\n", debugstr_a(pServerName));
265  return NULL;
266 }
267 
268 /************************************************************
269  * WTSOpenServerW (WTSAPI32.@)
270  */
272 {
273  FIXME("(%s) stub\n", debugstr_w(pServerName));
275  return NULL;
276 }
277 
278 /************************************************************
279  * WTSQuerySessionInformationA (WTSAPI32.@)
280  */
282  HANDLE hServer,
284  WTS_INFO_CLASS WTSInfoClass,
285  LPSTR* Buffer,
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  {
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  }
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,
353 
354  return FALSE;
355 #endif
356 }
357 
358 /************************************************************
359  * WTSQuerySessionInformationW (WTSAPI32.@)
360  */
362  HANDLE hServer,
364  WTS_INFO_CLASS WTSInfoClass,
365  LPWSTR* Buffer,
367 {
368 #ifdef __REACTOS__
369  if (!BytesReturned || !Buffer)
370  {
372  return FALSE;
373  }
374 
375 #if (NTDDI_VERSION >= NTDDI_WS08)
376  if (WTSInfoClass > WTSIsRemoteSession)
377 #else
378  if (WTSInfoClass > WTSClientProtocolType)
379 #endif
380  {
382  return FALSE;
383  }
384 
385  switch (WTSInfoClass)
386  {
387  case WTSSessionId:
388  {
389  const DWORD size = sizeof(ULONG);
390  ULONG* output = heap_alloc_zero(size);
391  if (!output)
392  {
394  return FALSE;
395  }
396 
397  *output = NtCurrentTeb()->Peb->SessionId;
398  *Buffer = (LPWSTR)output;
399  *BytesReturned = size;
400  return TRUE;
401  }
402 
403  case WTSUserName:
404  {
405  WCHAR* username;
406  DWORD count = 0;
407 
410  return FALSE;
411  username = heap_alloc(count * sizeof(WCHAR));
412  if (!username)
413  {
415  return FALSE;
416  }
417 
419  *Buffer = username;
420  *BytesReturned = count * sizeof(WCHAR);
421  return TRUE;
422  }
423 
424  case WTSConnectState:
425  {
426  const DWORD size = sizeof(DWORD);
427  WCHAR* output = heap_alloc_zero(size);
428  if (!output)
429  {
431  return FALSE;
432  }
433 
434  *Buffer = output;
435  *BytesReturned = size;
436  return TRUE;
437  }
438 
440  {
441  const DWORD size = sizeof(WORD);
442  WCHAR* output = heap_alloc_zero(size);
443  if (!output)
444  {
446  return FALSE;
447  }
448 
449  *Buffer = output;
450  *BytesReturned = size;
451  return TRUE;
452  }
453 
454 #if (NTDDI_VERSION >= NTDDI_WS08)
455  case WTSIdleTime:
456  case WTSLogonTime:
457  case WTSIncomingBytes:
458  case WTSOutgoingBytes:
459  case WTSIncomingFrames:
460  case WTSOutgoingFrames:
461  {
463  return FALSE;
464  }
465 #endif /* (NTDDI_VERSION >= NTDDI_WS08) */
466 
467  default:
468  {
469  if (BytesReturned)
470  *BytesReturned = 0;
471 
472  break;
473  }
474  }
475 
476  /* FIXME: Forward request to winsta.dll::WinStationQueryInformationW */
477  FIXME("Stub %p 0x%08x %d %p %p\n", hServer, SessionId, WTSInfoClass,
479 
480  return FALSE;
481 #else
482  /* FIXME: Forward request to winsta.dll::WinStationQueryInformationW */
483  FIXME("Stub %p 0x%08x %d %p %p\n", hServer, SessionId, WTSInfoClass,
485 
486  if (WTSInfoClass == WTSUserName)
487  {
488  WCHAR *username;
489  DWORD count = 0;
490 
493  if (!(username = heap_alloc(count * sizeof(WCHAR)))) return FALSE;
495  *Buffer = username;
496  *BytesReturned = count * sizeof(WCHAR);
497  return TRUE;
498  }
499  return FALSE;
500 #endif
501 }
502 
503 /************************************************************
504  * WTSQueryUserToken (WTSAPI32.@)
505  */
507 {
508  FIXME("%u %p\n", session_id, token);
509 
510  if (!token)
511  {
513  return FALSE;
514  }
515 
519 }
520 
521 /************************************************************
522  * WTSQueryUserConfigA (WTSAPI32.@)
523  */
524 BOOL WINAPI WTSQueryUserConfigA(LPSTR pServerName, LPSTR pUserName, WTS_CONFIG_CLASS WTSConfigClass, LPSTR *ppBuffer, DWORD *pBytesReturned)
525 {
526  FIXME("Stub (%s) (%s) 0x%08x %p %p\n", debugstr_a(pServerName), debugstr_a(pUserName), WTSConfigClass,
527  ppBuffer, pBytesReturned);
528  return FALSE;
529 }
530 
531 /************************************************************
532  * WTSQueryUserConfigW (WTSAPI32.@)
533  */
534 BOOL WINAPI WTSQueryUserConfigW(LPWSTR pServerName, LPWSTR pUserName, WTS_CONFIG_CLASS WTSConfigClass, LPWSTR *ppBuffer, DWORD *pBytesReturned)
535 {
536  FIXME("Stub (%s) (%s) 0x%08x %p %p\n", debugstr_w(pServerName), debugstr_w(pUserName), WTSConfigClass,
537  ppBuffer, pBytesReturned);
538  return FALSE;
539 }
540 
541 
542 /************************************************************
543  * WTSRegisterSessionNotification (WTSAPI32.@)
544  */
546 {
547  FIXME("Stub %p 0x%08x\n", hWnd, dwFlags);
548  return TRUE;
549 }
550 
551 /************************************************************
552  * WTSRegisterSessionNotificationEx (WTSAPI32.@)
553  */
555 {
556  FIXME("Stub %p %p 0x%08x\n", hServer, hWnd, dwFlags);
557  return FALSE;
558 }
559 
560 
561 /************************************************************
562  * WTSSendMessageA (WTSAPI32.@)
563  */
564 BOOL WINAPI WTSSendMessageA(HANDLE hServer, DWORD SessionId, LPSTR pTitle, DWORD TitleLength, LPSTR pMessage,
565  DWORD MessageLength, DWORD Style, DWORD Timeout, DWORD *pResponse, BOOL bWait)
566 {
567  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);
568  return FALSE;
569 }
570 
571 /************************************************************
572  * WTSSendMessageW (WTSAPI32.@)
573  */
574 BOOL WINAPI WTSSendMessageW(HANDLE hServer, DWORD SessionId, LPWSTR pTitle, DWORD TitleLength, LPWSTR pMessage,
575  DWORD MessageLength, DWORD Style, DWORD Timeout, DWORD *pResponse, BOOL bWait)
576 {
577  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);
578  return FALSE;
579 }
580 
581 /************************************************************
582  * WTSSetUserConfigA (WTSAPI32.@)
583  */
585 {
586  FIXME("Stub (%s) (%s) 0x%08x %p %d\n", debugstr_a(pServerName), debugstr_a(pUserName), WTSConfigClass,pBuffer, DataLength);
587  return FALSE;
588 }
589 
590 /************************************************************
591  * WTSSetUserConfigW (WTSAPI32.@)
592  */
594 {
595  FIXME("Stub (%s) (%s) 0x%08x %p %d\n", debugstr_w(pServerName), debugstr_w(pUserName), WTSConfigClass,pBuffer, DataLength);
596  return FALSE;
597 }
598 
599 /************************************************************
600  * WTSShutdownSystem (WTSAPI32.@)
601  */
602 BOOL WINAPI WTSShutdownSystem(HANDLE hServer, DWORD ShutdownFlag)
603 {
604  FIXME("Stub %p 0x%08x\n", hServer,ShutdownFlag);
605  return FALSE;
606 }
607 
608 /************************************************************
609  * WTSStartRemoteControlSessionA (WTSAPI32.@)
610  */
611 BOOL WINAPI WTSStartRemoteControlSessionA(LPSTR pTargetServerName, ULONG TargetLogonId, BYTE HotkeyVk, USHORT HotkeyModifiers)
612 {
613  FIXME("Stub (%s) %d %d %d\n", debugstr_a(pTargetServerName), TargetLogonId, HotkeyVk, HotkeyModifiers);
614  return FALSE;
615 }
616 
617 /************************************************************
618  * WTSStartRemoteControlSessionW (WTSAPI32.@)
619  */
620 BOOL WINAPI WTSStartRemoteControlSessionW(LPWSTR pTargetServerName, ULONG TargetLogonId, BYTE HotkeyVk, USHORT HotkeyModifiers)
621 {
622  FIXME("Stub (%s) %d %d %d\n", debugstr_w(pTargetServerName), TargetLogonId, HotkeyVk, HotkeyModifiers);
623  return FALSE;
624 }
625 
626 /************************************************************
627  * WTSStopRemoteControlSession (WTSAPI32.@)
628  */
630 {
631  FIXME("Stub %d\n", LogonId);
632  return FALSE;
633 }
634 
635 /************************************************************
636  * WTSTerminateProcess (WTSAPI32.@)
637  */
639 {
640  FIXME("Stub %p %d %d\n", hServer, ProcessId, ExitCode);
641  return FALSE;
642 }
643 
644 /************************************************************
645  * WTSUnRegisterSessionNotification (WTSAPI32.@)
646  */
648 {
649  FIXME("Stub %p\n", hWnd);
650  return FALSE;
651 }
652 
653 /************************************************************
654  * WTSUnRegisterSessionNotification (WTSAPI32.@)
655  */
657 {
658  FIXME("Stub %p %p\n", hServer, hWnd);
659  return FALSE;
660 }
661 
662 
663 /************************************************************
664  * WTSVirtualChannelClose (WTSAPI32.@)
665  */
667 {
668  FIXME("Stub %p\n", hChannelHandle);
669  return FALSE;
670 }
671 
672 /************************************************************
673  * WTSVirtualChannelOpen (WTSAPI32.@)
674  */
676 {
677  FIXME("Stub %p %d (%s)\n", hServer, SessionId, debugstr_a(pVirtualName));
678  return NULL;
679 }
680 
681 /************************************************************
682  * WTSVirtualChannelOpen (WTSAPI32.@)
683  */
685 {
686  FIXME("Stub %d (%s) %d\n", SessionId, debugstr_a(pVirtualName), flags);
687  return NULL;
688 }
689 
690 /************************************************************
691  * WTSVirtualChannelPurgeInput (WTSAPI32.@)
692  */
694 {
695  FIXME("Stub %p\n", hChannelHandle);
696  return FALSE;
697 }
698 
699 /************************************************************
700  * WTSVirtualChannelPurgeOutput (WTSAPI32.@)
701  */
703 {
704  FIXME("Stub %p\n", hChannelHandle);
705  return FALSE;
706 }
707 
708 
709 /************************************************************
710  * WTSVirtualChannelQuery (WTSAPI32.@)
711  */
712 BOOL WINAPI WTSVirtualChannelQuery(HANDLE hChannelHandle, WTS_VIRTUAL_CLASS WtsVirtualClass, PVOID *ppBuffer, DWORD *pBytesReturned)
713 {
714  FIXME("Stub %p %d %p %p\n", hChannelHandle, WtsVirtualClass, ppBuffer, pBytesReturned);
715  return FALSE;
716 }
717 
718 /************************************************************
719  * WTSVirtualChannelRead (WTSAPI32.@)
720  */
722 {
723  FIXME("Stub %p %d %p %d %p\n", hChannelHandle, TimeOut, Buffer, BufferSize, pBytesRead);
724  return FALSE;
725 }
726 
727 /************************************************************
728  * WTSVirtualChannelWrite (WTSAPI32.@)
729  */
731 {
732  FIXME("Stub %p %p %d %p\n", hChannelHandle, Buffer, Length, pBytesWritten);
733  return FALSE;
734 }
735 
736 /************************************************************
737  * WTSWaitSystemEvent (WTSAPI32.@)
738  */
740 {
741  /* FIXME: Forward request to winsta.dll::WinStationWaitSystemEvent */
742  FIXME("Stub %p 0x%08x %p\n", hServer, Mask, Flags);
743  return FALSE;
744 }
BOOL WINAPI WTSEnumerateServersW(LPWSTR pDomainName, DWORD Reserved, DWORD Version, PWTS_SERVER_INFOW *ppServerInfo, DWORD *pCount)
Definition: wtsapi32.c:197
BOOL WINAPI WTSVirtualChannelPurgeInput(HANDLE hChannelHandle)
Definition: wtsapi32.c:693
signed char * PCHAR
Definition: retypes.h:7
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
BOOL WINAPI WTSVirtualChannelPurgeOutput(HANDLE hChannelHandle)
Definition: wtsapi32.c:702
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
BOOL WINAPI WTSQuerySessionInformationA(HANDLE hServer, DWORD SessionId, WTS_INFO_CLASS WTSInfoClass, LPSTR *Buffer, DWORD *BytesReturned)
Definition: wtsapi32.c:281
#define STATUS_INFO_LENGTH_MISMATCH
Definition: udferr_usr.h:133
BOOL WINAPI WTSVirtualChannelClose(HANDLE hChannelHandle)
Definition: wtsapi32.c:666
BOOL WINAPI WTSStartRemoteControlSessionW(LPWSTR pTargetServerName, ULONG TargetLogonId, BYTE HotkeyVk, USHORT HotkeyModifiers)
Definition: wtsapi32.c:620
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:251
uint16_t * PWSTR
Definition: typedefs.h:54
GLuint GLuint GLsizei count
Definition: gl.h:1545
BOOL WINAPI WTSShutdownSystem(HANDLE hServer, DWORD ShutdownFlag)
Definition: wtsapi32.c:602
ULONG SessionId
Definition: dllmain.c:28
BOOL WINAPI WTSEnumerateProcessesA(HANDLE hServer, DWORD Reserved, DWORD Version, PWTS_PROCESS_INFOA *ppProcessInfo, DWORD *pCount)
Definition: wtsapi32.c:83
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:712
HWND hWnd
Definition: settings.c:17
BOOL WINAPI WTSEnumerateSessionsA(HANDLE hServer, DWORD Reserved, DWORD Version, PWTS_SESSION_INFOA *ppSessionInfo, DWORD *pCount)
Definition: wtsapi32.c:207
LPWSTR pProcessName
Definition: wtsapi32.h:126
#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:74
HANDLE WINAPI WTSVirtualChannelOpen(HANDLE hServer, DWORD SessionId, LPSTR pVirtualName)
Definition: wtsapi32.c:675
char * LPSTR
Definition: xmlstorage.h:182
BOOL WINAPI WTSStopRemoteControlSession(ULONG LogonId)
Definition: wtsapi32.c:629
#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:574
BOOL WINAPI WTSQueryUserConfigW(LPWSTR pServerName, LPWSTR pUserName, WTS_CONFIG_CLASS WTSConfigClass, LPWSTR *ppBuffer, DWORD *pBytesReturned)
Definition: wtsapi32.c:534
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
#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:554
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:110
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:730
BOOL WINAPI WTSQueryUserToken(ULONG session_id, PHANDLE token)
Definition: wtsapi32.c:506
BOOL WINAPI WTSEnumerateSessionsW(HANDLE hServer, DWORD Reserved, DWORD Version, PWTS_SESSION_INFOW *ppSessionInfo, DWORD *pCount)
Definition: wtsapi32.c:226
#define GetCurrentProcessToken()
Definition: security.c:40
static WCHAR username[]
Definition: url.c:32
#define WTS_CURRENT_SERVER_HANDLE
Definition: wtsapi32.h:163
HANDLE WINAPI WTSVirtualChannelOpenEx(DWORD SessionId, LPSTR pVirtualName, DWORD flags)
Definition: wtsapi32.c:684
BOOL WINAPI GetUserNameW(LPWSTR lpszName, LPDWORD lpSize)
Definition: misc.c:291
GLsizeiptr size
Definition: glext.h:5919
#define GetProcessHeap()
Definition: compat.h:395
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:39
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:188
BOOL WINAPI WTSQueryUserConfigA(LPSTR pServerName, LPSTR pUserName, WTS_CONFIG_CLASS WTSConfigClass, LPSTR *ppBuffer, DWORD *pBytesReturned)
Definition: wtsapi32.c:524
#define WINAPI
Definition: msvc.h:8
#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:261
#define SetLastError(x)
Definition: compat.h:409
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
GLbitfield flags
Definition: glext.h:7161
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
HANDLE WINAPI WTSOpenServerW(LPWSTR pServerName)
Definition: wtsapi32.c:271
PVOID *typedef PHANDLE
Definition: ntsecpkg.h:414
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
BOOL WINAPI WTSDisconnectSession(HANDLE hServer, DWORD SessionId, BOOL bWait)
Definition: wtsapi32.c:65
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:564
BOOL WINAPI WTSRegisterSessionNotification(HWND hWnd, DWORD dwFlags)
Definition: wtsapi32.c:545
void WINAPI WTSFreeMemory(PVOID pMemory)
Definition: wtsapi32.c:243
NTSYSAPI ULONG WINAPI RtlNtStatusToDosError(NTSTATUS)
BOOL WINAPI WTSTerminateProcess(HANDLE hServer, DWORD ProcessId, DWORD ExitCode)
Definition: wtsapi32.c:638
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:361
BOOL WINAPI WTSConnectSessionW(ULONG LogonId, ULONG TargetLogonId, PWSTR pPassword, BOOL bWait)
Definition: wtsapi32.c:56
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
#define ERROR_NOT_SUPPORTED
Definition: compat.h:90
BOOL WINAPI WTSWaitSystemEvent(HANDLE hServer, DWORD Mask, DWORD *Flags)
Definition: wtsapi32.c:739
Definition: name.c:36
BOOL WINAPI WTSUnRegisterSessionNotificationEx(HANDLE hServer, HWND hWnd)
Definition: wtsapi32.c:656
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:593
BOOL WINAPI WTSUnRegisterSessionNotification(HWND hWnd)
Definition: wtsapi32.c:647
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:611
return STATUS_SUCCESS
Definition: btrfs.c:2938
GLuint64EXT * result
Definition: glext.h:11304
static SERVICE_STATUS status
Definition: service.c:31
BOOL WINAPI WTSVirtualChannelRead(HANDLE hChannelHandle, ULONG TimeOut, PCHAR Buffer, ULONG BufferSize, PULONG pBytesRead)
Definition: wtsapi32.c:721
BOOL WINAPI WTSEnumerateProcessesW(HANDLE hServer, DWORD Reserved, DWORD Version, PWTS_PROCESS_INFOW *ppProcessInfo, DWORD *pCount)
Definition: wtsapi32.c:100
BOOL WINAPI WTSConnectSessionA(ULONG LogonId, ULONG TargetLogonId, PSTR pPassword, BOOL bWait)
Definition: wtsapi32.c:47
#define HeapFree(x, y, z)
Definition: compat.h:394
BOOL WINAPI WTSSetUserConfigA(LPSTR pServerName, LPSTR pUserName, WTS_CONFIG_CLASS WTSConfigClass, LPSTR pBuffer, DWORD DataLength)
Definition: wtsapi32.c:584
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