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