ws2_32: Enable IP_DONTFRAGMENT by default for SOCK_STREAM sockets.
[wine.git] / dlls / wtsapi32 / wtsapi32.c
blob55695029776e1de40c8348673b7a22e5d99d89bc
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"
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);
44 return TRUE;
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);
53 return TRUE;
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);
62 return TRUE;
65 /************************************************************
66 * WTSEnableChildSessions (WTSAPI32.@)
68 BOOL WINAPI WTSEnableChildSessions(BOOL enable)
70 FIXME("Stub %d\n", enable);
71 return TRUE;
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;
85 *pCount = 0;
86 *ppProcessInfo = NULL;
88 return TRUE;
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);
103 return FALSE;
106 *pCount = 0;
107 *ppProcessInfo = NULL;
109 return TRUE;
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);
118 return FALSE;
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);
127 return FALSE;
131 /************************************************************
132 * WTSEnumerateEnumerateSessionsA (WTSAPI32.@)
134 BOOL WINAPI WTSEnumerateSessionsA(HANDLE hServer, DWORD Reserved, DWORD Version,
135 PWTS_SESSION_INFOA* ppSessionInfo, DWORD* pCount)
137 static int once;
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;
144 *pCount = 0;
145 *ppSessionInfo = NULL;
147 return TRUE;
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;
161 *pCount = 0;
162 *ppSessionInfo = NULL;
164 return TRUE;
167 /************************************************************
168 * WTSFreeMemory (WTSAPI32.@)
170 void WINAPI WTSFreeMemory(PVOID pMemory)
172 heap_free(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);
182 return FALSE;
185 /************************************************************
186 * WTSOpenServerA (WTSAPI32.@)
188 HANDLE WINAPI WTSOpenServerA(LPSTR pServerName)
190 FIXME("(%s) stub\n", debugstr_a(pServerName));
191 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
192 return NULL;
195 /************************************************************
196 * WTSOpenServerW (WTSAPI32.@)
198 HANDLE WINAPI WTSOpenServerW(LPWSTR pServerName)
200 FIXME("(%s) stub\n", debugstr_w(pServerName));
201 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
202 return NULL;
205 /************************************************************
206 * WTSQuerySessionInformationA (WTSAPI32.@)
208 BOOL WINAPI WTSQuerySessionInformationA(
209 HANDLE hServer,
210 DWORD SessionId,
211 WTS_INFO_CLASS WTSInfoClass,
212 LPSTR* Buffer,
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);
219 return FALSE;
222 /************************************************************
223 * WTSQuerySessionInformationW (WTSAPI32.@)
225 BOOL WINAPI WTSQuerySessionInformationW(
226 HANDLE hServer,
227 DWORD SessionId,
228 WTS_INFO_CLASS WTSInfoClass,
229 LPWSTR* Buffer,
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)
238 WCHAR *username;
239 DWORD count = 0;
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);
245 *Buffer = username;
246 *BytesReturned = count * sizeof(WCHAR);
247 return TRUE;
249 return FALSE;
252 /************************************************************
253 * WTSQueryUserToken (WTSAPI32.@)
255 BOOL WINAPI WTSQueryUserToken(ULONG session_id, PHANDLE token)
257 FIXME("%u %p\n", session_id, token);
258 return FALSE;
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);
268 return FALSE;
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);
278 return FALSE;
282 /************************************************************
283 * WTSRegisterSessionNotification (WTSAPI32.@)
285 BOOL WINAPI WTSRegisterSessionNotification(HWND hWnd, DWORD dwFlags)
287 FIXME("Stub %p 0x%08x\n", hWnd, dwFlags);
288 return TRUE;
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);
297 return FALSE;
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);
308 return FALSE;
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);
318 return FALSE;
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);
327 return FALSE;
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);
336 return FALSE;
339 /************************************************************
340 * WTSShutdownSystem (WTSAPI32.@)
342 BOOL WINAPI WTSShutdownSystem(HANDLE hServer, DWORD ShutdownFlag)
344 FIXME("Stub %p 0x%08x\n", hServer,ShutdownFlag);
345 return FALSE;
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);
354 return FALSE;
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);
363 return FALSE;
366 /************************************************************
367 * WTSStopRemoteControlSession (WTSAPI32.@)
369 BOOL WINAPI WTSStopRemoteControlSession(ULONG LogonId)
371 FIXME("Stub %d\n", LogonId);
372 return FALSE;
375 /************************************************************
376 * WTSTerminateProcess (WTSAPI32.@)
378 BOOL WINAPI WTSTerminateProcess(HANDLE hServer, DWORD ProcessId, DWORD ExitCode)
380 FIXME("Stub %p %d %d\n", hServer, ProcessId, ExitCode);
381 return FALSE;
384 /************************************************************
385 * WTSUnRegisterSessionNotification (WTSAPI32.@)
387 BOOL WINAPI WTSUnRegisterSessionNotification(HWND hWnd)
389 FIXME("Stub %p\n", hWnd);
390 return FALSE;
393 /************************************************************
394 * WTSUnRegisterSessionNotification (WTSAPI32.@)
396 BOOL WINAPI WTSUnRegisterSessionNotificationEx(HANDLE hServer, HWND hWnd)
398 FIXME("Stub %p %p\n", hServer, hWnd);
399 return FALSE;
403 /************************************************************
404 * WTSVirtualChannelClose (WTSAPI32.@)
406 BOOL WINAPI WTSVirtualChannelClose(HANDLE hChannelHandle)
408 FIXME("Stub %p\n", hChannelHandle);
409 return FALSE;
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));
418 return NULL;
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);
427 return NULL;
430 /************************************************************
431 * WTSVirtualChannelPurgeInput (WTSAPI32.@)
433 BOOL WINAPI WTSVirtualChannelPurgeInput(HANDLE hChannelHandle)
435 FIXME("Stub %p\n", hChannelHandle);
436 return FALSE;
439 /************************************************************
440 * WTSVirtualChannelPurgeOutput (WTSAPI32.@)
442 BOOL WINAPI WTSVirtualChannelPurgeOutput(HANDLE hChannelHandle)
444 FIXME("Stub %p\n", hChannelHandle);
445 return FALSE;
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);
455 return FALSE;
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);
464 return FALSE;
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);
473 return FALSE;
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);
483 return FALSE;