Fix signed/unsigned compilation warnings.
[wine] / dlls / user / misc.c
1 /*
2  * Misc USER functions
3  *
4  * Copyright 1995 Thomas Sandford
5  * Copyright 1997 Marcus Meissner
6  *
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
20  */
21
22 #include "windef.h"
23 #include "winbase.h"
24 #include "wingdi.h"
25 #include "winuser.h"
26 #include "winerror.h"
27
28 #include "wine/debug.h"
29
30 WINE_DEFAULT_DEBUG_CHANNEL(win);
31
32 /**********************************************************************
33  * SetLastErrorEx [USER32.@]  Sets the last-error code.
34  *
35  * RETURNS
36  *    None.
37  */
38 void 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 /******************************************************************************
59  * GetProcessWindowStation [USER32.@]  Returns handle of window station
60  *
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  */
68 HWINSTA WINAPI GetProcessWindowStation(void)
69 {
70     FIXME("(void): stub\n");
71     return (HWINSTA)1;
72 }
73
74
75 /******************************************************************************
76  * GetThreadDesktop [USER32.@]  Returns handle to desktop
77  *
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  */
88 DWORD WINAPI GetThreadDesktop( DWORD dwThreadId )
89 {
90     FIXME("(%lx): stub\n",dwThreadId);
91     return 1;
92 }
93
94
95 /******************************************************************************
96  * SetDebugErrorLevel [USER32.@]
97  * Sets the minimum error level for generating debugging events
98  *
99  * PARAMS
100  *    dwLevel [I] Debugging error level
101  */
102 VOID WINAPI SetDebugErrorLevel( DWORD dwLevel )
103 {
104     FIXME("(%ld): stub\n", dwLevel);
105 }
106
107
108 /******************************************************************************
109  *                    GetProcessDefaultLayout [USER32.@]
110  *
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  */
121 BOOL 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 /******************************************************************************
134  *                    SetProcessDefaultLayout [USER32.@]
135  *
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  */
146 BOOL 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 /******************************************************************************
157  * OpenDesktopA [USER32.@]
158  *
159  * NOTES
160  *    Return type should be HDESK
161  *
162  *    Not supported on Win9x - returns NULL and calls SetLastError.
163  */
164 HANDLE 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 /******************************************************************************
176  *              SetUserObjectInformationA   (USER32.@)
177  */
178 BOOL WINAPI SetUserObjectInformationA( HANDLE hObj, INT nIndex,
179                                        LPVOID pvInfo, DWORD nLength )
180 {
181     FIXME("(%p,%d,%p,%lx): stub\n",hObj,nIndex,pvInfo,nLength);
182     return TRUE;
183 }
184
185 /******************************************************************************
186  *              SetThreadDesktop   (USER32.@)
187  */
188 BOOL WINAPI SetThreadDesktop( HANDLE hDesktop )
189 {
190     FIXME("(%p): stub\n",hDesktop);
191     return TRUE;
192 }
193
194
195 /***********************************************************************
196  *           RegisterShellHookWindow                    [USER32.@]
197  */
198 HRESULT WINAPI RegisterShellHookWindow ( DWORD u )
199 {
200     FIXME("0x%08lx stub\n",u);
201     return 0;
202 }
203
204
205 /***********************************************************************
206  *           DeregisterShellHookWindow                  [USER32.@]
207  */
208 HRESULT WINAPI DeregisterShellHookWindow ( DWORD u )
209 {
210     FIXME("0x%08lx stub\n",u);
211     return 0;
212
213 }
214
215
216 /***********************************************************************
217  *           RegisterTasklist                           [USER32.@]
218  */
219 DWORD WINAPI RegisterTasklist (DWORD x)
220 {
221     FIXME("0x%08lx\n",x);
222     return TRUE;
223 }
224
225
226 /***********************************************************************
227  *           GetAppCompatFlags   (USER32.@)
228  */
229 DWORD WINAPI GetAppCompatFlags( HTASK hTask )
230 {
231     FIXME("stub\n");
232     return 0;
233 }
234
235
236 /***********************************************************************
237  *              USER_489 (USER.489)
238  */
239 LONG WINAPI stub_USER_489(void) { FIXME("stub\n"); return 0; }
240
241 /***********************************************************************
242  *              USER_490 (USER.490)
243  */
244 LONG WINAPI stub_USER_490(void) { FIXME("stub\n"); return 0; }
245
246 /***********************************************************************
247  *              USER_492 (USER.492)
248  */
249 LONG WINAPI stub_USER_492(void) { FIXME("stub\n"); return 0; }
250
251 /***********************************************************************
252  *              USER_496 (USER.496)
253  */
254 LONG WINAPI stub_USER_496(void) { FIXME("stub\n"); return 0; }