riched20: Fix ME_SetSelection when cpMax > strlen().
[wine.git] / dlls / wtsapi32 / wtsapi32.c
blob79d5a7f75b79dcda14b96ff337ef2b5206801f63
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
18 #include "config.h"
19 #include <stdarg.h>
20 #include <stdlib.h>
21 #include "windef.h"
22 #include "winbase.h"
23 #include "wtsapi32.h"
24 #include "wine/debug.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);
43 return TRUE;
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);
52 return TRUE;
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);
61 return TRUE;
64 /************************************************************
65 * WTSEnumerateProcessesA (WTSAPI32.@)
67 BOOL WINAPI WTSEnumerateProcessesA(HANDLE hServer, DWORD Reserved, DWORD Version,
68 PWTS_PROCESS_INFOA* ppProcessInfo, DWORD* pCount)
70 FIXME("Stub %p 0x%08x 0x%08x %p %p\n", hServer, Reserved, Version,
71 ppProcessInfo, pCount);
73 if (!ppProcessInfo || !pCount) return FALSE;
75 *pCount = 0;
76 *ppProcessInfo = NULL;
78 return TRUE;
81 /************************************************************
82 * WTSEnumerateProcessesW (WTSAPI32.@)
84 BOOL WINAPI WTSEnumerateProcessesW(HANDLE hServer, DWORD Reserved, DWORD Version,
85 PWTS_PROCESS_INFOW* ppProcessInfo, DWORD* pCount)
87 FIXME("Stub %p 0x%08x 0x%08x %p %p\n", hServer, Reserved, Version,
88 ppProcessInfo, pCount);
90 if (!ppProcessInfo || !pCount || Reserved != 0 || Version != 1)
92 SetLastError(ERROR_INVALID_PARAMETER);
93 return FALSE;
96 *pCount = 0;
97 *ppProcessInfo = NULL;
99 return TRUE;
102 /************************************************************
103 * WTSEnumerateServersA (WTSAPI32.@)
105 BOOL WINAPI WTSEnumerateServersA(LPSTR pDomainName, DWORD Reserved, DWORD Version, PWTS_SERVER_INFOA *ppServerInfo, DWORD *pCount)
107 FIXME("Stub %s 0x%08x 0x%08x %p %p\n", debugstr_a(pDomainName), Reserved, Version, ppServerInfo, pCount);
108 return FALSE;
111 /************************************************************
112 * WTSEnumerateServersW (WTSAPI32.@)
114 BOOL WINAPI WTSEnumerateServersW(LPWSTR pDomainName, DWORD Reserved, DWORD Version, PWTS_SERVER_INFOW *ppServerInfo, DWORD *pCount)
116 FIXME("Stub %s 0x%08x 0x%08x %p %p\n", debugstr_w(pDomainName), Reserved, Version, ppServerInfo, pCount);
117 return FALSE;
121 /************************************************************
122 * WTSEnumerateEnumerateSessionsA (WTSAPI32.@)
124 BOOL WINAPI WTSEnumerateSessionsA(HANDLE hServer, DWORD Reserved, DWORD Version,
125 PWTS_SESSION_INFOA* ppSessionInfo, DWORD* pCount)
127 static int once;
129 if (!once++) FIXME("Stub %p 0x%08x 0x%08x %p %p\n", hServer, Reserved, Version,
130 ppSessionInfo, pCount);
132 if (!ppSessionInfo || !pCount) return FALSE;
134 *pCount = 0;
135 *ppSessionInfo = NULL;
137 return TRUE;
140 /************************************************************
141 * WTSEnumerateEnumerateSessionsW (WTSAPI32.@)
143 BOOL WINAPI WTSEnumerateSessionsW(HANDLE hServer, DWORD Reserved, DWORD Version,
144 PWTS_SESSION_INFOW* ppSessionInfo, DWORD* pCount)
146 FIXME("Stub %p 0x%08x 0x%08x %p %p\n", hServer, Reserved, Version,
147 ppSessionInfo, pCount);
149 if (!ppSessionInfo || !pCount) return FALSE;
151 *pCount = 0;
152 *ppSessionInfo = NULL;
154 return TRUE;
157 /************************************************************
158 * WTSFreeMemory (WTSAPI32.@)
160 void WINAPI WTSFreeMemory(PVOID pMemory)
162 static int once;
164 if (!once++) FIXME("Stub %p\n", pMemory);
167 /************************************************************
168 * WTSLogoffSession (WTSAPI32.@)
170 BOOL WINAPI WTSLogoffSession(HANDLE hserver, DWORD session_id, BOOL bwait)
172 FIXME("(%p, 0x%x, %d): stub\n", hserver, session_id, bwait);
173 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
174 return FALSE;
177 /************************************************************
178 * WTSOpenServerA (WTSAPI32.@)
180 HANDLE WINAPI WTSOpenServerA(LPSTR pServerName)
182 FIXME("(%s) stub\n", debugstr_a(pServerName));
183 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
184 return NULL;
187 /************************************************************
188 * WTSOpenServerW (WTSAPI32.@)
190 HANDLE WINAPI WTSOpenServerW(LPWSTR pServerName)
192 FIXME("(%s) stub\n", debugstr_w(pServerName));
193 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
194 return NULL;
197 /************************************************************
198 * WTSQuerySessionInformationA (WTSAPI32.@)
200 BOOL WINAPI WTSQuerySessionInformationA(
201 HANDLE hServer,
202 DWORD SessionId,
203 WTS_INFO_CLASS WTSInfoClass,
204 LPSTR* Buffer,
205 DWORD* BytesReturned)
207 /* FIXME: Forward request to winsta.dll::WinStationQueryInformationA */
208 FIXME("Stub %p 0x%08x %d %p %p\n", hServer, SessionId, WTSInfoClass,
209 Buffer, BytesReturned);
211 return FALSE;
214 /************************************************************
215 * WTSQuerySessionInformationW (WTSAPI32.@)
217 BOOL WINAPI WTSQuerySessionInformationW(
218 HANDLE hServer,
219 DWORD SessionId,
220 WTS_INFO_CLASS WTSInfoClass,
221 LPWSTR* Buffer,
222 DWORD* BytesReturned)
224 /* FIXME: Forward request to winsta.dll::WinStationQueryInformationW */
225 FIXME("Stub %p 0x%08x %d %p %p\n", hServer, SessionId, WTSInfoClass,
226 Buffer, BytesReturned);
228 return FALSE;
231 /************************************************************
232 * WTSQueryUserToken (WTSAPI32.@)
234 BOOL WINAPI WTSQueryUserToken(ULONG session_id, PHANDLE token)
236 FIXME("%u %p\n", session_id, token);
237 return FALSE;
240 /************************************************************
241 * WTSQueryUserConfigA (WTSAPI32.@)
243 BOOL WINAPI WTSQueryUserConfigA(LPSTR pServerName, LPSTR pUserName, WTS_CONFIG_CLASS WTSConfigClass, LPSTR *ppBuffer, DWORD *pBytesReturned)
245 FIXME("Stub (%s) (%s) 0x%08x %p %p\n", debugstr_a(pServerName), debugstr_a(pUserName), WTSConfigClass,
246 ppBuffer, pBytesReturned);
247 return FALSE;
250 /************************************************************
251 * WTSQueryUserConfigW (WTSAPI32.@)
253 BOOL WINAPI WTSQueryUserConfigW(LPWSTR pServerName, LPWSTR pUserName, WTS_CONFIG_CLASS WTSConfigClass, LPWSTR *ppBuffer, DWORD *pBytesReturned)
255 FIXME("Stub (%s) (%s) 0x%08x %p %p\n", debugstr_w(pServerName), debugstr_w(pUserName), WTSConfigClass,
256 ppBuffer, pBytesReturned);
257 return FALSE;
261 /************************************************************
262 * WTSRegisterSessionNotification (WTSAPI32.@)
264 BOOL WINAPI WTSRegisterSessionNotification(HWND hWnd, DWORD dwFlags)
266 FIXME("Stub %p 0x%08x\n", hWnd, dwFlags);
267 return TRUE;
270 /************************************************************
271 * WTSRegisterSessionNotification (WTSAPI32.@)
273 BOOL WINAPI WTSRegisterSessionNotificationEx(HANDLE hServer, HWND hWnd, DWORD dwFlags)
275 FIXME("Stub %p %p 0x%08x\n", hServer, hWnd, dwFlags);
276 return FALSE;
280 /************************************************************
281 * WTSSendMessageA (WTSAPI32.@)
283 BOOL WINAPI WTSSendMessageA(HANDLE hServer, DWORD SessionId, LPSTR pTitle, DWORD TitleLength, LPSTR pMessage,
284 DWORD MessageLength, DWORD Style, DWORD Timeout, DWORD *pResponse, BOOL bWait)
286 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);
287 return FALSE;
290 /************************************************************
291 * WTSSendMessageW (WTSAPI32.@)
293 BOOL WINAPI WTSSendMessageW(HANDLE hServer, DWORD SessionId, LPWSTR pTitle, DWORD TitleLength, LPWSTR pMessage,
294 DWORD MessageLength, DWORD Style, DWORD Timeout, DWORD *pResponse, BOOL bWait)
296 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);
297 return FALSE;
300 /************************************************************
301 * WTSSetUserConfigA (WTSAPI32.@)
303 BOOL WINAPI WTSSetUserConfigA(LPSTR pServerName, LPSTR pUserName, WTS_CONFIG_CLASS WTSConfigClass, LPSTR pBuffer, DWORD DataLength)
305 FIXME("Stub (%s) (%s) 0x%08x %p %d\n", debugstr_a(pServerName), debugstr_a(pUserName), WTSConfigClass,pBuffer, DataLength);
306 return FALSE;
309 /************************************************************
310 * WTSSetUserConfigW (WTSAPI32.@)
312 BOOL WINAPI WTSSetUserConfigW(LPWSTR pServerName, LPWSTR pUserName, WTS_CONFIG_CLASS WTSConfigClass, LPWSTR pBuffer, DWORD DataLength)
314 FIXME("Stub (%s) (%s) 0x%08x %p %d\n", debugstr_w(pServerName), debugstr_w(pUserName), WTSConfigClass,pBuffer, DataLength);
315 return FALSE;
318 /************************************************************
319 * WTSShutdownSystem (WTSAPI32.@)
321 BOOL WINAPI WTSShutdownSystem(HANDLE hServer, DWORD ShutdownFlag)
323 FIXME("Stub %p 0x%08x\n", hServer,ShutdownFlag);
324 return FALSE;
327 /************************************************************
328 * WTSStartRemoteControlSessionA (WTSAPI32.@)
330 BOOL WINAPI WTSStartRemoteControlSessionA(LPSTR pTargetServerName, ULONG TargetLogonId, BYTE HotkeyVk, USHORT HotkeyModifiers)
332 FIXME("Stub (%s) %d %d %d\n", debugstr_a(pTargetServerName), TargetLogonId, HotkeyVk, HotkeyModifiers);
333 return FALSE;
336 /************************************************************
337 * WTSStartRemoteControlSessionW (WTSAPI32.@)
339 BOOL WINAPI WTSStartRemoteControlSessionW(LPWSTR pTargetServerName, ULONG TargetLogonId, BYTE HotkeyVk, USHORT HotkeyModifiers)
341 FIXME("Stub (%s) %d %d %d\n", debugstr_w(pTargetServerName), TargetLogonId, HotkeyVk, HotkeyModifiers);
342 return FALSE;
345 /************************************************************
346 * WTSStopRemoteControlSession (WTSAPI32.@)
348 BOOL WINAPI WTSStopRemoteControlSession(ULONG LogonId)
350 FIXME("Stub %d\n", LogonId);
351 return FALSE;
354 /************************************************************
355 * WTSTerminateProcess (WTSAPI32.@)
357 BOOL WINAPI WTSTerminateProcess(HANDLE hServer, DWORD ProcessId, DWORD ExitCode)
359 FIXME("Stub %p %d %d\n", hServer, ProcessId, ExitCode);
360 return FALSE;
363 /************************************************************
364 * WTSUnRegisterSessionNotification (WTSAPI32.@)
366 BOOL WINAPI WTSUnRegisterSessionNotification(HWND hWnd)
368 FIXME("Stub %p\n", hWnd);
369 return FALSE;
372 /************************************************************
373 * WTSUnRegisterSessionNotification (WTSAPI32.@)
375 BOOL WINAPI WTSUnRegisterSessionNotificationEx(HANDLE hServer, HWND hWnd)
377 FIXME("Stub %p %p\n", hServer, hWnd);
378 return FALSE;
382 /************************************************************
383 * WTSVirtualChannelClose (WTSAPI32.@)
385 BOOL WINAPI WTSVirtualChannelClose(HANDLE hChannelHandle)
387 FIXME("Stub %p\n", hChannelHandle);
388 return FALSE;
391 /************************************************************
392 * WTSVirtualChannelOpen (WTSAPI32.@)
394 HANDLE WINAPI WTSVirtualChannelOpen(HANDLE hServer, DWORD SessionId, LPSTR pVirtualName)
396 FIXME("Stub %p %d (%s)\n", hServer, SessionId, debugstr_a(pVirtualName));
397 return NULL;
400 /************************************************************
401 * WTSVirtualChannelOpen (WTSAPI32.@)
403 HANDLE WINAPI WTSVirtualChannelOpenEx(DWORD SessionId, LPSTR pVirtualName, DWORD flags)
405 FIXME("Stub %d (%s) %d\n", SessionId, debugstr_a(pVirtualName), flags);
406 return NULL;
409 /************************************************************
410 * WTSVirtualChannelPurgeInput (WTSAPI32.@)
412 BOOL WINAPI WTSVirtualChannelPurgeInput(HANDLE hChannelHandle)
414 FIXME("Stub %p\n", hChannelHandle);
415 return FALSE;
418 /************************************************************
419 * WTSVirtualChannelPurgeOutput (WTSAPI32.@)
421 BOOL WINAPI WTSVirtualChannelPurgeOutput(HANDLE hChannelHandle)
423 FIXME("Stub %p\n", hChannelHandle);
424 return FALSE;
428 /************************************************************
429 * WTSVirtualChannelQuery (WTSAPI32.@)
431 BOOL WINAPI WTSVirtualChannelQuery(HANDLE hChannelHandle, WTS_VIRTUAL_CLASS WtsVirtualClass, PVOID *ppBuffer, DWORD *pBytesReturned)
433 FIXME("Stub %p %d %p %p\n", hChannelHandle, WtsVirtualClass, ppBuffer, pBytesReturned);
434 return FALSE;
437 /************************************************************
438 * WTSVirtualChannelRead (WTSAPI32.@)
440 BOOL WINAPI WTSVirtualChannelRead(HANDLE hChannelHandle, ULONG TimeOut, PCHAR Buffer, ULONG BufferSize, PULONG pBytesRead)
442 FIXME("Stub %p %d %p %d %p\n", hChannelHandle, TimeOut, Buffer, BufferSize, pBytesRead);
443 return FALSE;
446 /************************************************************
447 * WTSVirtualChannelWrite (WTSAPI32.@)
449 BOOL WINAPI WTSVirtualChannelWrite(HANDLE hChannelHandle, PCHAR Buffer, ULONG Length, PULONG pBytesWritten)
451 FIXME("Stub %p %p %d %p\n", hChannelHandle, Buffer, Length, pBytesWritten);
452 return FALSE;
455 /************************************************************
456 * WTSWaitSystemEvent (WTSAPI32.@)
458 BOOL WINAPI WTSWaitSystemEvent(HANDLE hServer, DWORD Mask, DWORD* Flags)
460 /* FIXME: Forward request to winsta.dll::WinStationWaitSystemEvent */
461 FIXME("Stub %p 0x%08x %p\n", hServer, Mask, Flags);
462 return FALSE;