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
24 #include "wine/debug.h"
25 #include "wine/heap.h"
27 WINE_DEFAULT_DEBUG_CHANNEL(wtsapi
);
30 /************************************************************
31 * WTSCloseServer (WTSAPI32.@)
33 void WINAPI
WTSCloseServer(HANDLE hServer
)
35 FIXME("Stub %p\n", hServer
);
38 /************************************************************
39 * WTSConnectSessionA (WTSAPI32.@)
41 BOOL WINAPI
WTSConnectSessionA(ULONG LogonId
, ULONG TargetLogonId
, PSTR pPassword
, BOOL bWait
)
43 FIXME("Stub %d %d (%s) %d\n", LogonId
, TargetLogonId
, debugstr_a(pPassword
), bWait
);
47 /************************************************************
48 * WTSConnectSessionW (WTSAPI32.@)
50 BOOL WINAPI
WTSConnectSessionW(ULONG LogonId
, ULONG TargetLogonId
, PWSTR pPassword
, BOOL bWait
)
52 FIXME("Stub %d %d (%s) %d\n", LogonId
, TargetLogonId
, debugstr_w(pPassword
), bWait
);
56 /************************************************************
57 * WTSDisconnectSession (WTSAPI32.@)
59 BOOL WINAPI
WTSDisconnectSession(HANDLE hServer
, DWORD SessionId
, BOOL bWait
)
61 FIXME("Stub %p 0x%08x %d\n", hServer
, SessionId
, bWait
);
65 /************************************************************
66 * WTSEnableChildSessions (WTSAPI32.@)
68 BOOL WINAPI
WTSEnableChildSessions(BOOL enable
)
70 FIXME("Stub %d\n", enable
);
74 /************************************************************
75 * WTSEnumerateProcessesA (WTSAPI32.@)
77 BOOL WINAPI
WTSEnumerateProcessesA(HANDLE hServer
, DWORD Reserved
, DWORD Version
,
78 PWTS_PROCESS_INFOA
* ppProcessInfo
, DWORD
* pCount
)
80 FIXME("Stub %p 0x%08x 0x%08x %p %p\n", hServer
, Reserved
, Version
,
81 ppProcessInfo
, pCount
);
83 if (!ppProcessInfo
|| !pCount
) return FALSE
;
86 *ppProcessInfo
= NULL
;
91 /************************************************************
92 * WTSEnumerateProcessesW (WTSAPI32.@)
94 BOOL WINAPI
WTSEnumerateProcessesW(HANDLE hServer
, DWORD Reserved
, DWORD Version
,
95 PWTS_PROCESS_INFOW
* ppProcessInfo
, DWORD
* pCount
)
97 FIXME("Stub %p 0x%08x 0x%08x %p %p\n", hServer
, Reserved
, Version
,
98 ppProcessInfo
, pCount
);
100 if (!ppProcessInfo
|| !pCount
|| Reserved
!= 0 || Version
!= 1)
102 SetLastError(ERROR_INVALID_PARAMETER
);
107 *ppProcessInfo
= NULL
;
112 /************************************************************
113 * WTSEnumerateServersA (WTSAPI32.@)
115 BOOL WINAPI
WTSEnumerateServersA(LPSTR pDomainName
, DWORD Reserved
, DWORD Version
, PWTS_SERVER_INFOA
*ppServerInfo
, DWORD
*pCount
)
117 FIXME("Stub %s 0x%08x 0x%08x %p %p\n", debugstr_a(pDomainName
), Reserved
, Version
, ppServerInfo
, pCount
);
121 /************************************************************
122 * WTSEnumerateServersW (WTSAPI32.@)
124 BOOL WINAPI
WTSEnumerateServersW(LPWSTR pDomainName
, DWORD Reserved
, DWORD Version
, PWTS_SERVER_INFOW
*ppServerInfo
, DWORD
*pCount
)
126 FIXME("Stub %s 0x%08x 0x%08x %p %p\n", debugstr_w(pDomainName
), Reserved
, Version
, ppServerInfo
, pCount
);
131 /************************************************************
132 * WTSEnumerateEnumerateSessionsA (WTSAPI32.@)
134 BOOL WINAPI
WTSEnumerateSessionsA(HANDLE hServer
, DWORD Reserved
, DWORD Version
,
135 PWTS_SESSION_INFOA
* ppSessionInfo
, DWORD
* pCount
)
139 if (!once
++) FIXME("Stub %p 0x%08x 0x%08x %p %p\n", hServer
, Reserved
, Version
,
140 ppSessionInfo
, pCount
);
142 if (!ppSessionInfo
|| !pCount
) return FALSE
;
145 *ppSessionInfo
= NULL
;
150 /************************************************************
151 * WTSEnumerateEnumerateSessionsW (WTSAPI32.@)
153 BOOL WINAPI
WTSEnumerateSessionsW(HANDLE hServer
, DWORD Reserved
, DWORD Version
,
154 PWTS_SESSION_INFOW
* ppSessionInfo
, DWORD
* pCount
)
156 FIXME("Stub %p 0x%08x 0x%08x %p %p\n", hServer
, Reserved
, Version
,
157 ppSessionInfo
, pCount
);
159 if (!ppSessionInfo
|| !pCount
) return FALSE
;
162 *ppSessionInfo
= NULL
;
167 /************************************************************
168 * WTSFreeMemory (WTSAPI32.@)
170 void WINAPI
WTSFreeMemory(PVOID pMemory
)
175 /************************************************************
176 * WTSLogoffSession (WTSAPI32.@)
178 BOOL WINAPI
WTSLogoffSession(HANDLE hserver
, DWORD session_id
, BOOL bwait
)
180 FIXME("(%p, 0x%x, %d): stub\n", hserver
, session_id
, bwait
);
181 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
185 /************************************************************
186 * WTSOpenServerA (WTSAPI32.@)
188 HANDLE WINAPI
WTSOpenServerA(LPSTR pServerName
)
190 FIXME("(%s) stub\n", debugstr_a(pServerName
));
191 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
195 /************************************************************
196 * WTSOpenServerW (WTSAPI32.@)
198 HANDLE WINAPI
WTSOpenServerW(LPWSTR pServerName
)
200 FIXME("(%s) stub\n", debugstr_w(pServerName
));
201 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
205 /************************************************************
206 * WTSQuerySessionInformationA (WTSAPI32.@)
208 BOOL WINAPI
WTSQuerySessionInformationA(
211 WTS_INFO_CLASS WTSInfoClass
,
213 DWORD
* BytesReturned
)
215 /* FIXME: Forward request to winsta.dll::WinStationQueryInformationA */
216 FIXME("Stub %p 0x%08x %d %p %p\n", hServer
, SessionId
, WTSInfoClass
,
217 Buffer
, BytesReturned
);
222 /************************************************************
223 * WTSQuerySessionInformationW (WTSAPI32.@)
225 BOOL WINAPI
WTSQuerySessionInformationW(
228 WTS_INFO_CLASS WTSInfoClass
,
230 DWORD
* BytesReturned
)
232 /* FIXME: Forward request to winsta.dll::WinStationQueryInformationW */
233 FIXME("Stub %p 0x%08x %d %p %p\n", hServer
, SessionId
, WTSInfoClass
,
234 Buffer
, BytesReturned
);
236 if (WTSInfoClass
== WTSUserName
)
241 GetUserNameW(NULL
, &count
);
242 if (GetLastError() != ERROR_INSUFFICIENT_BUFFER
) return FALSE
;
243 if (!(username
= heap_alloc(count
* sizeof(WCHAR
)))) return FALSE
;
244 GetUserNameW(username
, &count
);
246 *BytesReturned
= count
* sizeof(WCHAR
);
252 /************************************************************
253 * WTSQueryUserToken (WTSAPI32.@)
255 BOOL WINAPI
WTSQueryUserToken(ULONG session_id
, PHANDLE token
)
257 FIXME("%u %p\n", session_id
, token
);
261 /************************************************************
262 * WTSQueryUserConfigA (WTSAPI32.@)
264 BOOL WINAPI
WTSQueryUserConfigA(LPSTR pServerName
, LPSTR pUserName
, WTS_CONFIG_CLASS WTSConfigClass
, LPSTR
*ppBuffer
, DWORD
*pBytesReturned
)
266 FIXME("Stub (%s) (%s) 0x%08x %p %p\n", debugstr_a(pServerName
), debugstr_a(pUserName
), WTSConfigClass
,
267 ppBuffer
, pBytesReturned
);
271 /************************************************************
272 * WTSQueryUserConfigW (WTSAPI32.@)
274 BOOL WINAPI
WTSQueryUserConfigW(LPWSTR pServerName
, LPWSTR pUserName
, WTS_CONFIG_CLASS WTSConfigClass
, LPWSTR
*ppBuffer
, DWORD
*pBytesReturned
)
276 FIXME("Stub (%s) (%s) 0x%08x %p %p\n", debugstr_w(pServerName
), debugstr_w(pUserName
), WTSConfigClass
,
277 ppBuffer
, pBytesReturned
);
282 /************************************************************
283 * WTSRegisterSessionNotification (WTSAPI32.@)
285 BOOL WINAPI
WTSRegisterSessionNotification(HWND hWnd
, DWORD dwFlags
)
287 FIXME("Stub %p 0x%08x\n", hWnd
, dwFlags
);
291 /************************************************************
292 * WTSRegisterSessionNotificationEx (WTSAPI32.@)
294 BOOL WINAPI
WTSRegisterSessionNotificationEx(HANDLE hServer
, HWND hWnd
, DWORD dwFlags
)
296 FIXME("Stub %p %p 0x%08x\n", hServer
, hWnd
, dwFlags
);
301 /************************************************************
302 * WTSSendMessageA (WTSAPI32.@)
304 BOOL WINAPI
WTSSendMessageA(HANDLE hServer
, DWORD SessionId
, LPSTR pTitle
, DWORD TitleLength
, LPSTR pMessage
,
305 DWORD MessageLength
, DWORD Style
, DWORD Timeout
, DWORD
*pResponse
, BOOL bWait
)
307 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
);
311 /************************************************************
312 * WTSSendMessageW (WTSAPI32.@)
314 BOOL WINAPI
WTSSendMessageW(HANDLE hServer
, DWORD SessionId
, LPWSTR pTitle
, DWORD TitleLength
, LPWSTR pMessage
,
315 DWORD MessageLength
, DWORD Style
, DWORD Timeout
, DWORD
*pResponse
, BOOL bWait
)
317 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
);
321 /************************************************************
322 * WTSSetUserConfigA (WTSAPI32.@)
324 BOOL WINAPI
WTSSetUserConfigA(LPSTR pServerName
, LPSTR pUserName
, WTS_CONFIG_CLASS WTSConfigClass
, LPSTR pBuffer
, DWORD DataLength
)
326 FIXME("Stub (%s) (%s) 0x%08x %p %d\n", debugstr_a(pServerName
), debugstr_a(pUserName
), WTSConfigClass
,pBuffer
, DataLength
);
330 /************************************************************
331 * WTSSetUserConfigW (WTSAPI32.@)
333 BOOL WINAPI
WTSSetUserConfigW(LPWSTR pServerName
, LPWSTR pUserName
, WTS_CONFIG_CLASS WTSConfigClass
, LPWSTR pBuffer
, DWORD DataLength
)
335 FIXME("Stub (%s) (%s) 0x%08x %p %d\n", debugstr_w(pServerName
), debugstr_w(pUserName
), WTSConfigClass
,pBuffer
, DataLength
);
339 /************************************************************
340 * WTSShutdownSystem (WTSAPI32.@)
342 BOOL WINAPI
WTSShutdownSystem(HANDLE hServer
, DWORD ShutdownFlag
)
344 FIXME("Stub %p 0x%08x\n", hServer
,ShutdownFlag
);
348 /************************************************************
349 * WTSStartRemoteControlSessionA (WTSAPI32.@)
351 BOOL WINAPI
WTSStartRemoteControlSessionA(LPSTR pTargetServerName
, ULONG TargetLogonId
, BYTE HotkeyVk
, USHORT HotkeyModifiers
)
353 FIXME("Stub (%s) %d %d %d\n", debugstr_a(pTargetServerName
), TargetLogonId
, HotkeyVk
, HotkeyModifiers
);
357 /************************************************************
358 * WTSStartRemoteControlSessionW (WTSAPI32.@)
360 BOOL WINAPI
WTSStartRemoteControlSessionW(LPWSTR pTargetServerName
, ULONG TargetLogonId
, BYTE HotkeyVk
, USHORT HotkeyModifiers
)
362 FIXME("Stub (%s) %d %d %d\n", debugstr_w(pTargetServerName
), TargetLogonId
, HotkeyVk
, HotkeyModifiers
);
366 /************************************************************
367 * WTSStopRemoteControlSession (WTSAPI32.@)
369 BOOL WINAPI
WTSStopRemoteControlSession(ULONG LogonId
)
371 FIXME("Stub %d\n", LogonId
);
375 /************************************************************
376 * WTSTerminateProcess (WTSAPI32.@)
378 BOOL WINAPI
WTSTerminateProcess(HANDLE hServer
, DWORD ProcessId
, DWORD ExitCode
)
380 FIXME("Stub %p %d %d\n", hServer
, ProcessId
, ExitCode
);
384 /************************************************************
385 * WTSUnRegisterSessionNotification (WTSAPI32.@)
387 BOOL WINAPI
WTSUnRegisterSessionNotification(HWND hWnd
)
389 FIXME("Stub %p\n", hWnd
);
393 /************************************************************
394 * WTSUnRegisterSessionNotification (WTSAPI32.@)
396 BOOL WINAPI
WTSUnRegisterSessionNotificationEx(HANDLE hServer
, HWND hWnd
)
398 FIXME("Stub %p %p\n", hServer
, hWnd
);
403 /************************************************************
404 * WTSVirtualChannelClose (WTSAPI32.@)
406 BOOL WINAPI
WTSVirtualChannelClose(HANDLE hChannelHandle
)
408 FIXME("Stub %p\n", hChannelHandle
);
412 /************************************************************
413 * WTSVirtualChannelOpen (WTSAPI32.@)
415 HANDLE WINAPI
WTSVirtualChannelOpen(HANDLE hServer
, DWORD SessionId
, LPSTR pVirtualName
)
417 FIXME("Stub %p %d (%s)\n", hServer
, SessionId
, debugstr_a(pVirtualName
));
421 /************************************************************
422 * WTSVirtualChannelOpen (WTSAPI32.@)
424 HANDLE WINAPI
WTSVirtualChannelOpenEx(DWORD SessionId
, LPSTR pVirtualName
, DWORD flags
)
426 FIXME("Stub %d (%s) %d\n", SessionId
, debugstr_a(pVirtualName
), flags
);
430 /************************************************************
431 * WTSVirtualChannelPurgeInput (WTSAPI32.@)
433 BOOL WINAPI
WTSVirtualChannelPurgeInput(HANDLE hChannelHandle
)
435 FIXME("Stub %p\n", hChannelHandle
);
439 /************************************************************
440 * WTSVirtualChannelPurgeOutput (WTSAPI32.@)
442 BOOL WINAPI
WTSVirtualChannelPurgeOutput(HANDLE hChannelHandle
)
444 FIXME("Stub %p\n", hChannelHandle
);
449 /************************************************************
450 * WTSVirtualChannelQuery (WTSAPI32.@)
452 BOOL WINAPI
WTSVirtualChannelQuery(HANDLE hChannelHandle
, WTS_VIRTUAL_CLASS WtsVirtualClass
, PVOID
*ppBuffer
, DWORD
*pBytesReturned
)
454 FIXME("Stub %p %d %p %p\n", hChannelHandle
, WtsVirtualClass
, ppBuffer
, pBytesReturned
);
458 /************************************************************
459 * WTSVirtualChannelRead (WTSAPI32.@)
461 BOOL WINAPI
WTSVirtualChannelRead(HANDLE hChannelHandle
, ULONG TimeOut
, PCHAR Buffer
, ULONG BufferSize
, PULONG pBytesRead
)
463 FIXME("Stub %p %d %p %d %p\n", hChannelHandle
, TimeOut
, Buffer
, BufferSize
, pBytesRead
);
467 /************************************************************
468 * WTSVirtualChannelWrite (WTSAPI32.@)
470 BOOL WINAPI
WTSVirtualChannelWrite(HANDLE hChannelHandle
, PCHAR Buffer
, ULONG Length
, PULONG pBytesWritten
)
472 FIXME("Stub %p %p %d %p\n", hChannelHandle
, Buffer
, Length
, pBytesWritten
);
476 /************************************************************
477 * WTSWaitSystemEvent (WTSAPI32.@)
479 BOOL WINAPI
WTSWaitSystemEvent(HANDLE hServer
, DWORD Mask
, DWORD
* Flags
)
481 /* FIXME: Forward request to winsta.dll::WinStationWaitSystemEvent */
482 FIXME("Stub %p 0x%08x %p\n", hServer
, Mask
, Flags
);