kernel32: Make CopyFile() call CopyFileEx() instead of the other way around.
[wine] / dlls / wtsapi32 / wtsapi32.c
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 "windef.h"
22 #include "winbase.h"
23 #include "wtsapi32.h"
24 #include "wine/debug.h"
25
26 WINE_DEFAULT_DEBUG_CHANNEL(wtsapi);
27
28
29 BOOL WINAPI DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
30 {
31     TRACE("%p,%x,%p\n", hinstDLL, fdwReason, lpvReserved);
32
33     switch (fdwReason) {
34         case DLL_PROCESS_ATTACH:
35         {
36             DisableThreadLibraryCalls(hinstDLL);
37             break;
38         }
39         case DLL_PROCESS_DETACH:
40         {
41             break;
42         }
43     }
44
45     return TRUE;
46 }
47
48 /************************************************************
49  *                WTSCloseServer  (WTSAPI32.@)
50  */
51 void WINAPI WTSCloseServer(HANDLE hServer)
52 {
53     FIXME("Stub %p\n", hServer);
54 }
55
56 /************************************************************
57  *                WTSConnectSessionA  (WTSAPI32.@)
58  */
59 BOOL WINAPI WTSConnectSessionA(ULONG LogonId, ULONG TargetLogonId, PSTR pPassword, BOOL bWait)
60 {
61    FIXME("Stub %d %d (%s) %d\n", LogonId, TargetLogonId, debugstr_a(pPassword), bWait);
62    return TRUE;
63 }
64
65 /************************************************************
66  *                WTSConnectSessionW  (WTSAPI32.@)
67  */
68 BOOL WINAPI WTSConnectSessionW(ULONG LogonId, ULONG TargetLogonId, PWSTR pPassword, BOOL bWait)
69 {
70    FIXME("Stub %d %d (%s) %d\n", LogonId, TargetLogonId, debugstr_w(pPassword), bWait);
71    return TRUE;
72 }
73
74 /************************************************************
75  *                WTSDisconnectSession  (WTSAPI32.@)
76  */
77 BOOL WINAPI WTSDisconnectSession(HANDLE hServer, DWORD SessionId, BOOL bWait)
78 {
79     FIXME("Stub %p 0x%08x %d\n", hServer, SessionId, bWait);
80     return TRUE;
81 }
82
83 /************************************************************
84  *                WTSEnumerateProcessesA  (WTSAPI32.@)
85  */
86 BOOL WINAPI WTSEnumerateProcessesA(HANDLE hServer, DWORD Reserved, DWORD Version,
87     PWTS_PROCESS_INFOA* ppProcessInfo, DWORD* pCount)
88 {
89     FIXME("Stub %p 0x%08x 0x%08x %p %p\n", hServer, Reserved, Version,
90           ppProcessInfo, pCount);
91
92     if (!ppProcessInfo || !pCount) return FALSE;
93
94     *pCount = 0;
95     *ppProcessInfo = NULL;
96
97     return TRUE;
98 }
99
100 /************************************************************
101  *                WTSEnumerateProcessesW  (WTSAPI32.@)
102  */
103 BOOL WINAPI WTSEnumerateProcessesW(HANDLE hServer, DWORD Reserved, DWORD Version,
104     PWTS_PROCESS_INFOW* ppProcessInfo, DWORD* pCount)
105 {
106     FIXME("Stub %p 0x%08x 0x%08x %p %p\n", hServer, Reserved, Version,
107           ppProcessInfo, pCount);
108
109     if (!ppProcessInfo || !pCount) return FALSE;
110
111     *pCount = 0;
112     *ppProcessInfo = NULL;
113
114     return TRUE;
115 }
116
117 /************************************************************
118  *                WTSEnumerateServersA  (WTSAPI32.@)
119  */
120 BOOL WINAPI WTSEnumerateServersA(LPSTR pDomainName, DWORD Reserved, DWORD Version, PWTS_SERVER_INFOA *ppServerInfo, DWORD *pCount)
121 {
122     FIXME("Stub %s 0x%08x 0x%08x %p %p\n", debugstr_a(pDomainName), Reserved, Version, ppServerInfo, pCount);
123     return FALSE;
124 }
125
126 /************************************************************
127  *                WTSEnumerateServersW  (WTSAPI32.@)
128  */
129 BOOL WINAPI WTSEnumerateServersW(LPWSTR pDomainName, DWORD Reserved, DWORD Version, PWTS_SERVER_INFOW *ppServerInfo, DWORD *pCount)
130 {
131     FIXME("Stub %s 0x%08x 0x%08x %p %p\n", debugstr_w(pDomainName), Reserved, Version, ppServerInfo, pCount);
132     return FALSE;
133 }
134
135
136 /************************************************************
137  *                WTSEnumerateEnumerateSessionsA  (WTSAPI32.@)
138  */
139 BOOL WINAPI WTSEnumerateSessionsA(HANDLE hServer, DWORD Reserved, DWORD Version,
140     PWTS_SESSION_INFOA* ppSessionInfo, DWORD* pCount)
141 {
142     FIXME("Stub %p 0x%08x 0x%08x %p %p\n", hServer, Reserved, Version,
143           ppSessionInfo, pCount);
144
145     if (!ppSessionInfo || !pCount) return FALSE;
146
147     *pCount = 0;
148     *ppSessionInfo = NULL;
149
150     return TRUE;
151 }
152
153 /************************************************************
154  *                WTSEnumerateEnumerateSessionsW  (WTSAPI32.@)
155  */
156 BOOL WINAPI WTSEnumerateSessionsW(HANDLE hServer, DWORD Reserved, DWORD Version,
157     PWTS_SESSION_INFOW* ppSessionInfo, DWORD* pCount)
158 {
159     FIXME("Stub %p 0x%08x 0x%08x %p %p\n", hServer, Reserved, Version,
160           ppSessionInfo, pCount);
161
162     if (!ppSessionInfo || !pCount) return FALSE;
163
164     *pCount = 0;
165     *ppSessionInfo = NULL;
166
167     return TRUE;
168 }
169
170 /************************************************************
171  *                WTSFreeMemory (WTSAPI32.@)
172  */
173 void WINAPI WTSFreeMemory(PVOID pMemory)
174 {
175     FIXME("Stub %p\n", pMemory);
176 }
177
178 /************************************************************
179  *                WTSLogoffSession (WTSAPI32.@)
180  */
181 BOOL WINAPI WTSLogoffSession(HANDLE hserver, DWORD session_id, BOOL bwait)
182 {
183     FIXME("(%p, 0x%x, %d): stub\n", hserver, session_id, bwait);
184     SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
185     return FALSE;
186 }
187
188 /************************************************************
189  *                WTSOpenServerA (WTSAPI32.@)
190  */
191 HANDLE WINAPI WTSOpenServerA(LPSTR pServerName)
192 {
193     FIXME("(%s) stub\n", debugstr_a(pServerName));
194     SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
195     return NULL;
196 }
197
198 /************************************************************
199  *                WTSOpenServerW (WTSAPI32.@)
200  */
201 HANDLE WINAPI WTSOpenServerW(LPWSTR pServerName)
202 {
203     FIXME("(%s) stub\n", debugstr_w(pServerName));
204     SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
205     return NULL;
206 }
207
208 /************************************************************
209  *                WTSQuerySessionInformationA  (WTSAPI32.@)
210  */
211 BOOL WINAPI WTSQuerySessionInformationA(
212     HANDLE hServer,
213     DWORD SessionId,
214     WTS_INFO_CLASS WTSInfoClass,
215     LPSTR* Buffer,
216     DWORD* BytesReturned)
217 {
218     /* FIXME: Forward request to winsta.dll::WinStationQueryInformationA */
219     FIXME("Stub %p 0x%08x %d %p %p\n", hServer, SessionId, WTSInfoClass,
220         Buffer, BytesReturned);
221
222     return FALSE;
223 }
224
225 /************************************************************
226  *                WTSQuerySessionInformationW  (WTSAPI32.@)
227  */
228 BOOL WINAPI WTSQuerySessionInformationW(
229     HANDLE hServer,
230     DWORD SessionId,
231     WTS_INFO_CLASS WTSInfoClass,
232     LPWSTR* Buffer,
233     DWORD* BytesReturned)
234 {
235     /* FIXME: Forward request to winsta.dll::WinStationQueryInformationW */
236     FIXME("Stub %p 0x%08x %d %p %p\n", hServer, SessionId, WTSInfoClass,
237         Buffer, BytesReturned);
238
239     return FALSE;
240 }
241
242 /************************************************************
243  *                WTSQueryUserToken (WTSAPI32.@)
244  */
245 BOOL WINAPI WTSQueryUserToken(ULONG session_id, PHANDLE token)
246 {
247     FIXME("%u %p\n", session_id, token);
248     return FALSE;
249 }
250
251 /************************************************************
252  *                WTSQueryUserConfigA (WTSAPI32.@)
253  */
254 BOOL WINAPI WTSQueryUserConfigA(LPSTR pServerName, LPSTR pUserName, WTS_CONFIG_CLASS WTSConfigClass, LPSTR *ppBuffer, DWORD *pBytesReturned)
255 {
256    FIXME("Stub (%s) (%s) 0x%08x %p %p\n", debugstr_a(pServerName), debugstr_a(pUserName), WTSConfigClass,
257         ppBuffer, pBytesReturned);
258    return FALSE;
259 }
260
261 /************************************************************
262  *                WTSQueryUserConfigW (WTSAPI32.@)
263  */
264 BOOL WINAPI WTSQueryUserConfigW(LPWSTR pServerName, LPWSTR pUserName, WTS_CONFIG_CLASS WTSConfigClass, LPWSTR *ppBuffer, DWORD *pBytesReturned)
265 {
266    FIXME("Stub (%s) (%s) 0x%08x %p %p\n", debugstr_w(pServerName), debugstr_w(pUserName), WTSConfigClass,
267         ppBuffer, pBytesReturned);
268    return FALSE;
269 }
270
271
272 /************************************************************
273  *                WTSRegisterSessionNotification (WTSAPI32.@)
274  */
275 BOOL WINAPI WTSRegisterSessionNotification(HWND hWnd, DWORD dwFlags)
276 {
277     FIXME("Stub %p 0x%08x\n", hWnd, dwFlags);
278     return TRUE;
279 }
280
281 /************************************************************
282  *                WTSRegisterSessionNotification (WTSAPI32.@)
283  */
284 BOOL WINAPI WTSRegisterSessionNotificationEx(HANDLE hServer, HWND hWnd, DWORD dwFlags)
285 {
286     FIXME("Stub %p %p 0x%08x\n", hServer, hWnd, dwFlags);
287     return FALSE;
288 }
289
290
291 /************************************************************
292  *                WTSSendMessageA (WTSAPI32.@)
293  */
294 BOOL WINAPI WTSSendMessageA(HANDLE hServer, DWORD SessionId, LPSTR pTitle, DWORD TitleLength, LPSTR pMessage,
295    DWORD MessageLength, DWORD Style, DWORD Timeout, DWORD *pResponse, BOOL bWait)
296 {
297    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);
298    return FALSE;
299 }
300
301 /************************************************************
302  *                WTSSendMessageW (WTSAPI32.@)
303  */
304 BOOL WINAPI WTSSendMessageW(HANDLE hServer, DWORD SessionId, LPWSTR pTitle, DWORD TitleLength, LPWSTR pMessage,
305    DWORD MessageLength, DWORD Style, DWORD Timeout, DWORD *pResponse, BOOL bWait)
306 {
307    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);
308    return FALSE;
309 }
310
311 /************************************************************
312  *                WTSSetUserConfigA (WTSAPI32.@)
313  */
314 BOOL WINAPI WTSSetUserConfigA(LPSTR pServerName, LPSTR pUserName, WTS_CONFIG_CLASS WTSConfigClass, LPSTR pBuffer, DWORD DataLength)
315 {
316    FIXME("Stub (%s) (%s) 0x%08x %p %d\n", debugstr_a(pServerName), debugstr_a(pUserName), WTSConfigClass,pBuffer, DataLength);
317    return FALSE;
318 }
319
320 /************************************************************
321  *                WTSSetUserConfigW (WTSAPI32.@)
322  */
323 BOOL WINAPI WTSSetUserConfigW(LPWSTR pServerName, LPWSTR pUserName, WTS_CONFIG_CLASS WTSConfigClass, LPWSTR pBuffer, DWORD DataLength)
324 {
325    FIXME("Stub (%s) (%s) 0x%08x %p %d\n", debugstr_w(pServerName), debugstr_w(pUserName), WTSConfigClass,pBuffer, DataLength);
326    return FALSE;
327 }
328
329 /************************************************************
330  *                WTSShutdownSystem (WTSAPI32.@)
331  */
332 BOOL WINAPI WTSShutdownSystem(HANDLE hServer, DWORD ShutdownFlag)
333 {
334    FIXME("Stub %p 0x%08x\n", hServer,ShutdownFlag);
335    return FALSE;
336 }
337
338 /************************************************************
339  *                WTSStartRemoteControlSessionA (WTSAPI32.@)
340  */
341 BOOL WINAPI WTSStartRemoteControlSessionA(LPSTR pTargetServerName, ULONG TargetLogonId, BYTE HotkeyVk, USHORT HotkeyModifiers)
342 {
343    FIXME("Stub (%s) %d %d %d\n", debugstr_a(pTargetServerName), TargetLogonId, HotkeyVk, HotkeyModifiers);
344    return FALSE;
345 }
346
347 /************************************************************
348  *                WTSStartRemoteControlSessionW (WTSAPI32.@)
349  */
350 BOOL WINAPI WTSStartRemoteControlSessionW(LPWSTR pTargetServerName, ULONG TargetLogonId, BYTE HotkeyVk, USHORT HotkeyModifiers)
351 {
352    FIXME("Stub (%s) %d %d %d\n", debugstr_w(pTargetServerName), TargetLogonId, HotkeyVk, HotkeyModifiers);
353    return FALSE;
354 }
355
356 /************************************************************
357  *                WTSStopRemoteControlSession (WTSAPI32.@)
358  */
359 BOOL WINAPI WTSStopRemoteControlSession(ULONG LogonId)
360 {
361    FIXME("Stub %d\n",  LogonId);
362    return FALSE;
363 }
364
365 /************************************************************
366  *                WTSTerminateProcess (WTSAPI32.@)
367  */
368 BOOL WINAPI WTSTerminateProcess(HANDLE hServer, DWORD ProcessId, DWORD ExitCode)
369 {
370    FIXME("Stub %p %d %d\n", hServer, ProcessId, ExitCode);
371    return FALSE;
372 }
373
374 /************************************************************
375  *                WTSUnRegisterSessionNotification (WTSAPI32.@)
376  */
377 BOOL WINAPI WTSUnRegisterSessionNotification(HWND hWnd)
378 {
379     FIXME("Stub %p\n", hWnd);
380     return FALSE;
381 }
382
383 /************************************************************
384  *                WTSUnRegisterSessionNotification (WTSAPI32.@)
385  */
386 BOOL WINAPI WTSUnRegisterSessionNotificationEx(HANDLE hServer, HWND hWnd)
387 {
388     FIXME("Stub %p %p\n", hServer, hWnd);
389     return FALSE;
390 }
391
392
393 /************************************************************
394  *                WTSVirtualChannelClose (WTSAPI32.@)
395  */
396 BOOL WINAPI WTSVirtualChannelClose(HANDLE hChannelHandle)
397 {
398    FIXME("Stub %p\n", hChannelHandle);
399    return FALSE;
400 }
401
402 /************************************************************
403  *                WTSVirtualChannelOpen (WTSAPI32.@)
404  */
405 HANDLE WINAPI WTSVirtualChannelOpen(HANDLE hServer, DWORD SessionId, LPSTR pVirtualName)
406 {
407    FIXME("Stub %p %d (%s)\n", hServer, SessionId, debugstr_a(pVirtualName));
408    return NULL;
409 }
410
411 /************************************************************
412  *                WTSVirtualChannelOpen (WTSAPI32.@)
413  */
414 HANDLE WINAPI WTSVirtualChannelOpenEx(DWORD SessionId, LPSTR pVirtualName, DWORD flags)
415 {
416    FIXME("Stub %d (%s) %d\n",  SessionId, debugstr_a(pVirtualName), flags);
417    return NULL;
418 }
419
420 /************************************************************
421  *                WTSVirtualChannelPurgeInput (WTSAPI32.@)
422  */
423 BOOL WINAPI WTSVirtualChannelPurgeInput(HANDLE hChannelHandle)
424 {
425    FIXME("Stub %p\n", hChannelHandle);
426    return FALSE;
427 }
428
429 /************************************************************
430  *                WTSVirtualChannelPurgeOutput (WTSAPI32.@)
431  */
432 BOOL WINAPI WTSVirtualChannelPurgeOutput(HANDLE hChannelHandle)
433 {
434    FIXME("Stub %p\n", hChannelHandle);
435    return FALSE;
436 }
437
438
439 /************************************************************
440  *                WTSVirtualChannelQuery (WTSAPI32.@)
441  */
442 BOOL WINAPI WTSVirtualChannelQuery(HANDLE hChannelHandle, WTS_VIRTUAL_CLASS WtsVirtualClass, PVOID *ppBuffer, DWORD *pBytesReturned)
443 {
444    FIXME("Stub %p %d %p %p\n", hChannelHandle, WtsVirtualClass, ppBuffer, pBytesReturned);
445    return FALSE;
446 }
447
448 /************************************************************
449  *                WTSVirtualChannelRead (WTSAPI32.@)
450  */
451 BOOL WINAPI WTSVirtualChannelRead(HANDLE hChannelHandle, ULONG TimeOut, PCHAR Buffer, ULONG BufferSize, PULONG pBytesRead)
452 {
453    FIXME("Stub %p %d %p %d %p\n", hChannelHandle, TimeOut, Buffer, BufferSize, pBytesRead);
454    return FALSE;
455 }
456
457 /************************************************************
458  *                WTSVirtualChannelWrite (WTSAPI32.@)
459  */
460 BOOL WINAPI WTSVirtualChannelWrite(HANDLE hChannelHandle, PCHAR Buffer, ULONG Length, PULONG pBytesWritten)
461 {
462    FIXME("Stub %p %p %d %p\n", hChannelHandle, Buffer, Length, pBytesWritten);
463    return FALSE;
464 }
465
466 /************************************************************
467  *                WTSWaitSystemEvent (WTSAPI32.@)
468  */
469 BOOL WINAPI WTSWaitSystemEvent(HANDLE hServer, DWORD Mask, DWORD* Flags)
470 {
471     /* FIXME: Forward request to winsta.dll::WinStationWaitSystemEvent */
472     FIXME("Stub %p 0x%08x %p\n", hServer, Mask, Flags);
473     return FALSE;
474 }