1 /* Copyright 2005 Ulrich Czekalla
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.
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.
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
23 #include "wine/debug.h"
24 #include "wine/heap.h"
26 WINE_DEFAULT_DEBUG_CHANNEL(wtsapi
);
29 /************************************************************
30 * WTSCloseServer (WTSAPI32.@)
32 void WINAPI
WTSCloseServer(HANDLE hServer
)
34 FIXME("Stub %p\n", hServer
);
37 /************************************************************
38 * WTSConnectSessionA (WTSAPI32.@)
40 BOOL WINAPI
WTSConnectSessionA(ULONG LogonId
, ULONG TargetLogonId
, PSTR pPassword
, BOOL bWait
)
42 FIXME("Stub %d %d (%s) %d\n", LogonId
, TargetLogonId
, debugstr_a(pPassword
), bWait
);
46 /************************************************************
47 * WTSConnectSessionW (WTSAPI32.@)
49 BOOL WINAPI
WTSConnectSessionW(ULONG LogonId
, ULONG TargetLogonId
, PWSTR pPassword
, BOOL bWait
)
51 FIXME("Stub %d %d (%s) %d\n", LogonId
, TargetLogonId
, debugstr_w(pPassword
), bWait
);
55 /************************************************************
56 * WTSDisconnectSession (WTSAPI32.@)
58 BOOL WINAPI
WTSDisconnectSession(HANDLE hServer
, DWORD SessionId
, BOOL bWait
)
60 FIXME("Stub %p 0x%08x %d\n", hServer
, SessionId
, bWait
);
64 /************************************************************
65 * WTSEnableChildSessions (WTSAPI32.@)
67 BOOL WINAPI
WTSEnableChildSessions(BOOL enable
)
69 FIXME("Stub %d\n", enable
);
73 /************************************************************
74 * WTSEnumerateProcessesA (WTSAPI32.@)
76 BOOL WINAPI
WTSEnumerateProcessesA(HANDLE hServer
, DWORD Reserved
, DWORD Version
,
77 PWTS_PROCESS_INFOA
* ppProcessInfo
, DWORD
* pCount
)
79 FIXME("Stub %p 0x%08x 0x%08x %p %p\n", hServer
, Reserved
, Version
,
80 ppProcessInfo
, pCount
);
82 if (!ppProcessInfo
|| !pCount
) return FALSE
;
85 *ppProcessInfo
= NULL
;
90 /************************************************************
91 * WTSEnumerateProcessesW (WTSAPI32.@)
93 BOOL WINAPI
WTSEnumerateProcessesW(HANDLE hServer
, DWORD Reserved
, DWORD Version
,
94 PWTS_PROCESS_INFOW
* ppProcessInfo
, DWORD
* pCount
)
96 FIXME("Stub %p 0x%08x 0x%08x %p %p\n", hServer
, Reserved
, Version
,
97 ppProcessInfo
, pCount
);
99 if (!ppProcessInfo
|| !pCount
|| Reserved
!= 0 || Version
!= 1)
101 SetLastError(ERROR_INVALID_PARAMETER
);
106 *ppProcessInfo
= NULL
;
111 /************************************************************
112 * WTSEnumerateServersA (WTSAPI32.@)
114 BOOL WINAPI
WTSEnumerateServersA(LPSTR pDomainName
, DWORD Reserved
, DWORD Version
, PWTS_SERVER_INFOA
*ppServerInfo
, DWORD
*pCount
)
116 FIXME("Stub %s 0x%08x 0x%08x %p %p\n", debugstr_a(pDomainName
), Reserved
, Version
, ppServerInfo
, pCount
);
120 /************************************************************
121 * WTSEnumerateServersW (WTSAPI32.@)
123 BOOL WINAPI
WTSEnumerateServersW(LPWSTR pDomainName
, DWORD Reserved
, DWORD Version
, PWTS_SERVER_INFOW
*ppServerInfo
, DWORD
*pCount
)
125 FIXME("Stub %s 0x%08x 0x%08x %p %p\n", debugstr_w(pDomainName
), Reserved
, Version
, ppServerInfo
, pCount
);
130 /************************************************************
131 * WTSEnumerateEnumerateSessionsA (WTSAPI32.@)
133 BOOL WINAPI
WTSEnumerateSessionsA(HANDLE hServer
, DWORD Reserved
, DWORD Version
,
134 PWTS_SESSION_INFOA
* ppSessionInfo
, DWORD
* pCount
)
138 if (!once
++) FIXME("Stub %p 0x%08x 0x%08x %p %p\n", hServer
, Reserved
, Version
,
139 ppSessionInfo
, pCount
);
141 if (!ppSessionInfo
|| !pCount
) return FALSE
;
144 *ppSessionInfo
= NULL
;
149 /************************************************************
150 * WTSEnumerateEnumerateSessionsW (WTSAPI32.@)
152 BOOL WINAPI
WTSEnumerateSessionsW(HANDLE hServer
, DWORD Reserved
, DWORD Version
,
153 PWTS_SESSION_INFOW
* ppSessionInfo
, DWORD
* pCount
)
155 FIXME("Stub %p 0x%08x 0x%08x %p %p\n", hServer
, Reserved
, Version
,
156 ppSessionInfo
, pCount
);
158 if (!ppSessionInfo
|| !pCount
) return FALSE
;
161 *ppSessionInfo
= NULL
;
166 /************************************************************
167 * WTSFreeMemory (WTSAPI32.@)
169 void WINAPI
WTSFreeMemory(PVOID pMemory
)
174 /************************************************************
175 * WTSLogoffSession (WTSAPI32.@)
177 BOOL WINAPI
WTSLogoffSession(HANDLE hserver
, DWORD session_id
, BOOL bwait
)
179 FIXME("(%p, 0x%x, %d): stub\n", hserver
, session_id
, bwait
);
180 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
184 /************************************************************
185 * WTSOpenServerA (WTSAPI32.@)
187 HANDLE WINAPI
WTSOpenServerA(LPSTR pServerName
)
189 FIXME("(%s) stub\n", debugstr_a(pServerName
));
190 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
194 /************************************************************
195 * WTSOpenServerW (WTSAPI32.@)
197 HANDLE WINAPI
WTSOpenServerW(LPWSTR pServerName
)
199 FIXME("(%s) stub\n", debugstr_w(pServerName
));
200 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
204 /************************************************************
205 * WTSQuerySessionInformationA (WTSAPI32.@)
207 BOOL WINAPI
WTSQuerySessionInformationA(
210 WTS_INFO_CLASS WTSInfoClass
,
212 DWORD
* BytesReturned
)
214 /* FIXME: Forward request to winsta.dll::WinStationQueryInformationA */
215 FIXME("Stub %p 0x%08x %d %p %p\n", hServer
, SessionId
, WTSInfoClass
,
216 Buffer
, BytesReturned
);
221 /************************************************************
222 * WTSQuerySessionInformationW (WTSAPI32.@)
224 BOOL WINAPI
WTSQuerySessionInformationW(
227 WTS_INFO_CLASS WTSInfoClass
,
229 DWORD
* BytesReturned
)
231 /* FIXME: Forward request to winsta.dll::WinStationQueryInformationW */
232 FIXME("Stub %p 0x%08x %d %p %p\n", hServer
, SessionId
, WTSInfoClass
,
233 Buffer
, BytesReturned
);
235 if (WTSInfoClass
== WTSUserName
)
240 GetUserNameW(NULL
, &count
);
241 if (GetLastError() != ERROR_INSUFFICIENT_BUFFER
) return FALSE
;
242 if (!(username
= heap_alloc(count
* sizeof(WCHAR
)))) return FALSE
;
243 GetUserNameW(username
, &count
);
245 *BytesReturned
= count
* sizeof(WCHAR
);
251 /************************************************************
252 * WTSQueryUserToken (WTSAPI32.@)
254 BOOL WINAPI
WTSQueryUserToken(ULONG session_id
, PHANDLE token
)
256 FIXME("%u %p semi-stub!\n", session_id
, token
);
260 SetLastError(ERROR_INVALID_PARAMETER
);
264 return DuplicateHandle(GetCurrentProcess(), GetCurrentProcessToken(),
265 GetCurrentProcess(), token
,
266 0, FALSE
, DUPLICATE_SAME_ACCESS
);
269 /************************************************************
270 * WTSQueryUserConfigA (WTSAPI32.@)
272 BOOL WINAPI
WTSQueryUserConfigA(LPSTR pServerName
, LPSTR pUserName
, WTS_CONFIG_CLASS WTSConfigClass
, LPSTR
*ppBuffer
, DWORD
*pBytesReturned
)
274 FIXME("Stub (%s) (%s) 0x%08x %p %p\n", debugstr_a(pServerName
), debugstr_a(pUserName
), WTSConfigClass
,
275 ppBuffer
, pBytesReturned
);
279 /************************************************************
280 * WTSQueryUserConfigW (WTSAPI32.@)
282 BOOL WINAPI
WTSQueryUserConfigW(LPWSTR pServerName
, LPWSTR pUserName
, WTS_CONFIG_CLASS WTSConfigClass
, LPWSTR
*ppBuffer
, DWORD
*pBytesReturned
)
284 FIXME("Stub (%s) (%s) 0x%08x %p %p\n", debugstr_w(pServerName
), debugstr_w(pUserName
), WTSConfigClass
,
285 ppBuffer
, pBytesReturned
);
290 /************************************************************
291 * WTSRegisterSessionNotification (WTSAPI32.@)
293 BOOL WINAPI
WTSRegisterSessionNotification(HWND hWnd
, DWORD dwFlags
)
295 FIXME("Stub %p 0x%08x\n", hWnd
, dwFlags
);
299 /************************************************************
300 * WTSRegisterSessionNotificationEx (WTSAPI32.@)
302 BOOL WINAPI
WTSRegisterSessionNotificationEx(HANDLE hServer
, HWND hWnd
, DWORD dwFlags
)
304 FIXME("Stub %p %p 0x%08x\n", hServer
, hWnd
, dwFlags
);
309 /************************************************************
310 * WTSSendMessageA (WTSAPI32.@)
312 BOOL WINAPI
WTSSendMessageA(HANDLE hServer
, DWORD SessionId
, LPSTR pTitle
, DWORD TitleLength
, LPSTR pMessage
,
313 DWORD MessageLength
, DWORD Style
, DWORD Timeout
, DWORD
*pResponse
, BOOL bWait
)
315 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
);
319 /************************************************************
320 * WTSSendMessageW (WTSAPI32.@)
322 BOOL WINAPI
WTSSendMessageW(HANDLE hServer
, DWORD SessionId
, LPWSTR pTitle
, DWORD TitleLength
, LPWSTR pMessage
,
323 DWORD MessageLength
, DWORD Style
, DWORD Timeout
, DWORD
*pResponse
, BOOL bWait
)
325 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
);
329 /************************************************************
330 * WTSSetUserConfigA (WTSAPI32.@)
332 BOOL WINAPI
WTSSetUserConfigA(LPSTR pServerName
, LPSTR pUserName
, WTS_CONFIG_CLASS WTSConfigClass
, LPSTR pBuffer
, DWORD DataLength
)
334 FIXME("Stub (%s) (%s) 0x%08x %p %d\n", debugstr_a(pServerName
), debugstr_a(pUserName
), WTSConfigClass
,pBuffer
, DataLength
);
338 /************************************************************
339 * WTSSetUserConfigW (WTSAPI32.@)
341 BOOL WINAPI
WTSSetUserConfigW(LPWSTR pServerName
, LPWSTR pUserName
, WTS_CONFIG_CLASS WTSConfigClass
, LPWSTR pBuffer
, DWORD DataLength
)
343 FIXME("Stub (%s) (%s) 0x%08x %p %d\n", debugstr_w(pServerName
), debugstr_w(pUserName
), WTSConfigClass
,pBuffer
, DataLength
);
347 /************************************************************
348 * WTSShutdownSystem (WTSAPI32.@)
350 BOOL WINAPI
WTSShutdownSystem(HANDLE hServer
, DWORD ShutdownFlag
)
352 FIXME("Stub %p 0x%08x\n", hServer
,ShutdownFlag
);
356 /************************************************************
357 * WTSStartRemoteControlSessionA (WTSAPI32.@)
359 BOOL WINAPI
WTSStartRemoteControlSessionA(LPSTR pTargetServerName
, ULONG TargetLogonId
, BYTE HotkeyVk
, USHORT HotkeyModifiers
)
361 FIXME("Stub (%s) %d %d %d\n", debugstr_a(pTargetServerName
), TargetLogonId
, HotkeyVk
, HotkeyModifiers
);
365 /************************************************************
366 * WTSStartRemoteControlSessionW (WTSAPI32.@)
368 BOOL WINAPI
WTSStartRemoteControlSessionW(LPWSTR pTargetServerName
, ULONG TargetLogonId
, BYTE HotkeyVk
, USHORT HotkeyModifiers
)
370 FIXME("Stub (%s) %d %d %d\n", debugstr_w(pTargetServerName
), TargetLogonId
, HotkeyVk
, HotkeyModifiers
);
374 /************************************************************
375 * WTSStopRemoteControlSession (WTSAPI32.@)
377 BOOL WINAPI
WTSStopRemoteControlSession(ULONG LogonId
)
379 FIXME("Stub %d\n", LogonId
);
383 /************************************************************
384 * WTSTerminateProcess (WTSAPI32.@)
386 BOOL WINAPI
WTSTerminateProcess(HANDLE hServer
, DWORD ProcessId
, DWORD ExitCode
)
388 FIXME("Stub %p %d %d\n", hServer
, ProcessId
, ExitCode
);
392 /************************************************************
393 * WTSUnRegisterSessionNotification (WTSAPI32.@)
395 BOOL WINAPI
WTSUnRegisterSessionNotification(HWND hWnd
)
397 FIXME("Stub %p\n", hWnd
);
401 /************************************************************
402 * WTSUnRegisterSessionNotification (WTSAPI32.@)
404 BOOL WINAPI
WTSUnRegisterSessionNotificationEx(HANDLE hServer
, HWND hWnd
)
406 FIXME("Stub %p %p\n", hServer
, hWnd
);
411 /************************************************************
412 * WTSVirtualChannelClose (WTSAPI32.@)
414 BOOL WINAPI
WTSVirtualChannelClose(HANDLE hChannelHandle
)
416 FIXME("Stub %p\n", hChannelHandle
);
420 /************************************************************
421 * WTSVirtualChannelOpen (WTSAPI32.@)
423 HANDLE WINAPI
WTSVirtualChannelOpen(HANDLE hServer
, DWORD SessionId
, LPSTR pVirtualName
)
425 FIXME("Stub %p %d (%s)\n", hServer
, SessionId
, debugstr_a(pVirtualName
));
429 /************************************************************
430 * WTSVirtualChannelOpen (WTSAPI32.@)
432 HANDLE WINAPI
WTSVirtualChannelOpenEx(DWORD SessionId
, LPSTR pVirtualName
, DWORD flags
)
434 FIXME("Stub %d (%s) %d\n", SessionId
, debugstr_a(pVirtualName
), flags
);
438 /************************************************************
439 * WTSVirtualChannelPurgeInput (WTSAPI32.@)
441 BOOL WINAPI
WTSVirtualChannelPurgeInput(HANDLE hChannelHandle
)
443 FIXME("Stub %p\n", hChannelHandle
);
447 /************************************************************
448 * WTSVirtualChannelPurgeOutput (WTSAPI32.@)
450 BOOL WINAPI
WTSVirtualChannelPurgeOutput(HANDLE hChannelHandle
)
452 FIXME("Stub %p\n", hChannelHandle
);
457 /************************************************************
458 * WTSVirtualChannelQuery (WTSAPI32.@)
460 BOOL WINAPI
WTSVirtualChannelQuery(HANDLE hChannelHandle
, WTS_VIRTUAL_CLASS WtsVirtualClass
, PVOID
*ppBuffer
, DWORD
*pBytesReturned
)
462 FIXME("Stub %p %d %p %p\n", hChannelHandle
, WtsVirtualClass
, ppBuffer
, pBytesReturned
);
466 /************************************************************
467 * WTSVirtualChannelRead (WTSAPI32.@)
469 BOOL WINAPI
WTSVirtualChannelRead(HANDLE hChannelHandle
, ULONG TimeOut
, PCHAR Buffer
, ULONG BufferSize
, PULONG pBytesRead
)
471 FIXME("Stub %p %d %p %d %p\n", hChannelHandle
, TimeOut
, Buffer
, BufferSize
, pBytesRead
);
475 /************************************************************
476 * WTSVirtualChannelWrite (WTSAPI32.@)
478 BOOL WINAPI
WTSVirtualChannelWrite(HANDLE hChannelHandle
, PCHAR Buffer
, ULONG Length
, PULONG pBytesWritten
)
480 FIXME("Stub %p %p %d %p\n", hChannelHandle
, Buffer
, Length
, pBytesWritten
);
484 /************************************************************
485 * WTSWaitSystemEvent (WTSAPI32.@)
487 BOOL WINAPI
WTSWaitSystemEvent(HANDLE hServer
, DWORD Mask
, DWORD
* Flags
)
489 /* FIXME: Forward request to winsta.dll::WinStationWaitSystemEvent */
490 FIXME("Stub %p 0x%08x %p\n", hServer
, Mask
, Flags
);