blob: 84d8f41b573929d2687850bde8e08508d08465e2 [file] [log] [blame]
Alexandre Julliard93652e12000-08-04 04:21:02 +00001/*
2 * Misc USER functions
3 *
4 * Copyright 1995 Thomas Sandford
5 * Copyright 1997 Marcus Meissner
Alexandre Julliard0799c1a2002-03-09 23:29:33 +00006 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Alexandre Julliard93652e12000-08-04 04:21:02 +000020 */
21
22#include "windef.h"
23#include "winbase.h"
24#include "wingdi.h"
25#include "winuser.h"
26#include "winerror.h"
27
Alexandre Julliard0799c1a2002-03-09 23:29:33 +000028#include "wine/debug.h"
Alexandre Julliard93652e12000-08-04 04:21:02 +000029
Alexandre Julliard0799c1a2002-03-09 23:29:33 +000030WINE_DEFAULT_DEBUG_CHANNEL(win);
Alexandre Julliard93652e12000-08-04 04:21:02 +000031
32/**********************************************************************
Patrik Stridvall0c610282001-01-25 22:22:21 +000033 * SetLastErrorEx [USER32.@] Sets the last-error code.
Alexandre Julliard93652e12000-08-04 04:21:02 +000034 *
35 * RETURNS
36 * None.
37 */
38void WINAPI SetLastErrorEx(
39 DWORD error, /* [in] Per-thread error code */
40 DWORD type) /* [in] Error type */
41{
42 TRACE("(0x%08lx, 0x%08lx)\n", error,type);
43 switch(type) {
44 case 0:
45 break;
46 case SLE_ERROR:
47 case SLE_MINORERROR:
48 case SLE_WARNING:
49 /* Fall through for now */
50 default:
51 FIXME("(error=%08lx, type=%08lx): Unhandled type\n", error,type);
52 break;
53 }
54 SetLastError( error );
55}
56
57
58/******************************************************************************
Patrik Stridvall0c610282001-01-25 22:22:21 +000059 * GetProcessWindowStation [USER32.@] Returns handle of window station
Alexandre Julliard93652e12000-08-04 04:21:02 +000060 *
61 * NOTES
62 * Docs say the return value is HWINSTA
63 *
64 * RETURNS
65 * Success: Handle to window station associated with calling process
66 * Failure: NULL
67 */
François Gouget54300e52001-01-09 20:56:06 +000068HWINSTA WINAPI GetProcessWindowStation(void)
Alexandre Julliard93652e12000-08-04 04:21:02 +000069{
70 FIXME("(void): stub\n");
François Gouget54300e52001-01-09 20:56:06 +000071 return (HWINSTA)1;
Alexandre Julliard93652e12000-08-04 04:21:02 +000072}
73
74
75/******************************************************************************
Patrik Stridvall0c610282001-01-25 22:22:21 +000076 * GetThreadDesktop [USER32.@] Returns handle to desktop
Alexandre Julliard93652e12000-08-04 04:21:02 +000077 *
78 * NOTES
79 * Docs say the return value is HDESK
80 *
81 * PARAMS
82 * dwThreadId [I] Thread identifier
83 *
84 * RETURNS
85 * Success: Handle to desktop associated with specified thread
86 * Failure: NULL
87 */
88DWORD WINAPI GetThreadDesktop( DWORD dwThreadId )
89{
90 FIXME("(%lx): stub\n",dwThreadId);
91 return 1;
92}
93
94
95/******************************************************************************
Patrik Stridvall0c610282001-01-25 22:22:21 +000096 * SetDebugErrorLevel [USER32.@]
Alexandre Julliard93652e12000-08-04 04:21:02 +000097 * Sets the minimum error level for generating debugging events
98 *
99 * PARAMS
100 * dwLevel [I] Debugging error level
101 */
102VOID WINAPI SetDebugErrorLevel( DWORD dwLevel )
103{
104 FIXME("(%ld): stub\n", dwLevel);
105}
106
107
108/******************************************************************************
Patrik Stridvall0c610282001-01-25 22:22:21 +0000109 * GetProcessDefaultLayout [USER32.@]
Alexandre Julliard93652e12000-08-04 04:21:02 +0000110 *
111 * Gets the default layout for parentless windows.
112 * Right now, just returns 0 (left-to-right).
113 *
114 * RETURNS
115 * Success: Nonzero
116 * Failure: Zero
117 *
118 * BUGS
119 * No RTL
120 */
121BOOL WINAPI GetProcessDefaultLayout( DWORD *pdwDefaultLayout )
122{
123 if ( !pdwDefaultLayout ) {
124 SetLastError( ERROR_INVALID_PARAMETER );
125 return FALSE;
126 }
127 FIXME( "( %p ): No BiDi\n", pdwDefaultLayout );
128 *pdwDefaultLayout = 0;
129 return TRUE;
130}
131
132
133/******************************************************************************
Patrik Stridvall0c610282001-01-25 22:22:21 +0000134 * SetProcessDefaultLayout [USER32.@]
Alexandre Julliard93652e12000-08-04 04:21:02 +0000135 *
136 * Sets the default layout for parentless windows.
137 * Right now, only accepts 0 (left-to-right).
138 *
139 * RETURNS
140 * Success: Nonzero
141 * Failure: Zero
142 *
143 * BUGS
144 * No RTL
145 */
146BOOL WINAPI SetProcessDefaultLayout( DWORD dwDefaultLayout )
147{
148 if ( dwDefaultLayout == 0 )
149 return TRUE;
150 FIXME( "( %08lx ): No BiDi\n", dwDefaultLayout );
151 SetLastError( ERROR_CALL_NOT_IMPLEMENTED );
152 return FALSE;
153}
154
155
156/******************************************************************************
Patrik Stridvall0c610282001-01-25 22:22:21 +0000157 * OpenDesktopA [USER32.@]
Alexandre Julliard93652e12000-08-04 04:21:02 +0000158 *
159 * NOTES
160 * Return type should be HDESK
161 *
162 * Not supported on Win9x - returns NULL and calls SetLastError.
163 */
164HANDLE WINAPI OpenDesktopA( LPCSTR lpszDesktop, DWORD dwFlags,
165 BOOL fInherit, DWORD dwDesiredAccess )
166{
167 FIXME("(%s,%lx,%i,%lx): stub\n",debugstr_a(lpszDesktop),dwFlags,
168 fInherit,dwDesiredAccess);
169
170 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
171 return 0;
172}
173
174
175/******************************************************************************
Patrik Stridvall0c610282001-01-25 22:22:21 +0000176 * SetUserObjectInformationA (USER32.@)
Alexandre Julliard93652e12000-08-04 04:21:02 +0000177 */
178BOOL WINAPI SetUserObjectInformationA( HANDLE hObj, INT nIndex,
179 LPVOID pvInfo, DWORD nLength )
180{
181 FIXME("(%x,%d,%p,%lx): stub\n",hObj,nIndex,pvInfo,nLength);
182 return TRUE;
183}
184
185/******************************************************************************
Patrik Stridvall0c610282001-01-25 22:22:21 +0000186 * SetThreadDesktop (USER32.@)
Alexandre Julliard93652e12000-08-04 04:21:02 +0000187 */
188BOOL WINAPI SetThreadDesktop( HANDLE hDesktop )
189{
190 FIXME("(%x): stub\n",hDesktop);
191 return TRUE;
192}
193
194
195/***********************************************************************
Patrik Stridvall0c610282001-01-25 22:22:21 +0000196 * RegisterShellHookWindow [USER32.@]
Alexandre Julliard93652e12000-08-04 04:21:02 +0000197 */
198HRESULT WINAPI RegisterShellHookWindow ( DWORD u )
199{
200 FIXME("0x%08lx stub\n",u);
201 return 0;
202}
203
204
205/***********************************************************************
Patrik Stridvall0c610282001-01-25 22:22:21 +0000206 * DeregisterShellHookWindow [USER32.@]
Alexandre Julliard93652e12000-08-04 04:21:02 +0000207 */
208HRESULT WINAPI DeregisterShellHookWindow ( DWORD u )
209{
210 FIXME("0x%08lx stub\n",u);
211 return 0;
212
213}
214
215
216/***********************************************************************
Patrik Stridvall0c610282001-01-25 22:22:21 +0000217 * RegisterTasklist [USER32.@]
Alexandre Julliard93652e12000-08-04 04:21:02 +0000218 */
Alexandre Julliard07b1ac82000-11-25 21:43:04 +0000219DWORD WINAPI RegisterTasklist (DWORD x)
Alexandre Julliard93652e12000-08-04 04:21:02 +0000220{
221 FIXME("0x%08lx\n",x);
222 return TRUE;
223}
Alexandre Julliard3850c1a2000-08-06 02:42:46 +0000224
225/***********************************************************************
Patrik Stridvall01d5e5b2001-07-02 19:59:40 +0000226 * USER_489 (USER.489)
Alexandre Julliard3850c1a2000-08-06 02:42:46 +0000227 */
228LONG WINAPI stub_USER_489(void) { FIXME("stub\n"); return 0; }
229
230/***********************************************************************
Patrik Stridvall01d5e5b2001-07-02 19:59:40 +0000231 * USER_490 (USER.490)
Alexandre Julliard3850c1a2000-08-06 02:42:46 +0000232 */
233LONG WINAPI stub_USER_490(void) { FIXME("stub\n"); return 0; }
234
235/***********************************************************************
Patrik Stridvall01d5e5b2001-07-02 19:59:40 +0000236 * USER_492 (USER.492)
Alexandre Julliard3850c1a2000-08-06 02:42:46 +0000237 */
238LONG WINAPI stub_USER_492(void) { FIXME("stub\n"); return 0; }
239
240/***********************************************************************
Patrik Stridvall01d5e5b2001-07-02 19:59:40 +0000241 * USER_496 (USER.496)
Alexandre Julliard3850c1a2000-08-06 02:42:46 +0000242 */
243LONG WINAPI stub_USER_496(void) { FIXME("stub\n"); return 0; }