Append .dll extension in all cases (spotted by Mike Hearn).
[wine/wine-kai.git] / dlls / user / misc.c
blobfd2b4b35b97e3ad3a5d2497f5bcbc38185aa8c8e
1 /*
2 * Misc USER functions
4 * Copyright 1995 Thomas Sandford
5 * Copyright 1997 Marcus Meissner
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.
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.
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
22 #include <stdarg.h>
24 #include "windef.h"
25 #include "winbase.h"
26 #include "wingdi.h"
27 #include "winuser.h"
28 #include "winerror.h"
29 #include "winnls.h"
31 #include "wine/debug.h"
33 WINE_DEFAULT_DEBUG_CHANNEL(win);
35 /* callback to allow EnumDesktopsA to use EnumDesktopsW */
36 typedef struct {
37 DESKTOPENUMPROCA lpEnumFunc;
38 LPARAM lParam;
39 } ENUMDESKTOPS_LPARAM;
41 /* EnumDesktopsA passes this callback function to EnumDesktopsW.
42 * It simply converts the string to ASCII and calls the callback
43 * function provided by the original caller
45 static BOOL CALLBACK EnumDesktopProcWtoA(LPWSTR lpszDesktop, LPARAM lParam)
47 LPSTR buffer;
48 INT len;
49 BOOL ret;
50 ENUMDESKTOPS_LPARAM *data = (ENUMDESKTOPS_LPARAM *)lParam;
52 len = WideCharToMultiByte(CP_ACP, 0, lpszDesktop, -1, NULL, 0, NULL, NULL);
53 if (!(buffer = HeapAlloc( GetProcessHeap(), 0, len))) return FALSE;
54 WideCharToMultiByte(CP_ACP, 0, lpszDesktop, -1, buffer, len, NULL, NULL);
56 ret = data->lpEnumFunc(buffer, data->lParam);
58 HeapFree(GetProcessHeap(), 0, buffer);
59 return ret;
62 /**********************************************************************
63 * SetLastErrorEx [USER32.@] Sets the last-error code.
65 * RETURNS
66 * None.
68 void WINAPI SetLastErrorEx(
69 DWORD error, /* [in] Per-thread error code */
70 DWORD type) /* [in] Error type */
72 TRACE("(0x%08lx, 0x%08lx)\n", error,type);
73 switch(type) {
74 case 0:
75 break;
76 case SLE_ERROR:
77 case SLE_MINORERROR:
78 case SLE_WARNING:
79 /* Fall through for now */
80 default:
81 FIXME("(error=%08lx, type=%08lx): Unhandled type\n", error,type);
82 break;
84 SetLastError( error );
88 /******************************************************************************
89 * GetProcessWindowStation [USER32.@] Returns handle of window station
91 * NOTES
92 * Docs say the return value is HWINSTA
94 * RETURNS
95 * Success: Handle to window station associated with calling process
96 * Failure: NULL
98 HWINSTA WINAPI GetProcessWindowStation(void)
100 FIXME("(void): stub\n");
101 return (HWINSTA)1;
105 /******************************************************************************
106 * GetThreadDesktop [USER32.@] Returns handle to desktop
108 * PARAMS
109 * dwThreadId [I] Thread identifier
111 * RETURNS
112 * Success: Handle to desktop associated with specified thread
113 * Failure: NULL
115 HDESK WINAPI GetThreadDesktop( DWORD dwThreadId )
117 FIXME("(%lx): stub\n",dwThreadId);
118 return (HDESK)1;
122 /******************************************************************************
123 * SetDebugErrorLevel [USER32.@]
124 * Sets the minimum error level for generating debugging events
126 * PARAMS
127 * dwLevel [I] Debugging error level
129 VOID WINAPI SetDebugErrorLevel( DWORD dwLevel )
131 FIXME("(%ld): stub\n", dwLevel);
135 /******************************************************************************
136 * GetProcessDefaultLayout [USER32.@]
138 * Gets the default layout for parentless windows.
139 * Right now, just returns 0 (left-to-right).
141 * RETURNS
142 * Success: Nonzero
143 * Failure: Zero
145 * BUGS
146 * No RTL
148 BOOL WINAPI GetProcessDefaultLayout( DWORD *pdwDefaultLayout )
150 if ( !pdwDefaultLayout ) {
151 SetLastError( ERROR_INVALID_PARAMETER );
152 return FALSE;
154 FIXME( "( %p ): No BiDi\n", pdwDefaultLayout );
155 *pdwDefaultLayout = 0;
156 return TRUE;
160 /******************************************************************************
161 * SetProcessDefaultLayout [USER32.@]
163 * Sets the default layout for parentless windows.
164 * Right now, only accepts 0 (left-to-right).
166 * RETURNS
167 * Success: Nonzero
168 * Failure: Zero
170 * BUGS
171 * No RTL
173 BOOL WINAPI SetProcessDefaultLayout( DWORD dwDefaultLayout )
175 if ( dwDefaultLayout == 0 )
176 return TRUE;
177 FIXME( "( %08lx ): No BiDi\n", dwDefaultLayout );
178 SetLastError( ERROR_CALL_NOT_IMPLEMENTED );
179 return FALSE;
183 /******************************************************************************
184 * OpenDesktopA [USER32.@]
186 * Not supported on Win9x - returns NULL and calls SetLastError.
188 HDESK WINAPI OpenDesktopA( LPCSTR lpszDesktop, DWORD dwFlags,
189 BOOL fInherit, DWORD dwDesiredAccess )
191 FIXME("(%s,%lx,%i,%lx): stub\n",debugstr_a(lpszDesktop),dwFlags,
192 fInherit,dwDesiredAccess);
194 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
195 return 0;
198 /******************************************************************************
199 * OpenInputDesktop [USER32.@]
201 * Not supported on Win9x - returns NULL and calls SetLastError.
203 HDESK WINAPI OpenInputDesktop( DWORD dwFlags, BOOL fInherit, ACCESS_MASK dwDesiredAccess )
205 FIXME("(%lx,%i,%lx): stub\n",dwFlags, fInherit,dwDesiredAccess);
206 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
207 return 0;
210 /******************************************************************************
211 * EnumDesktopsA [USER32.@]
213 BOOL WINAPI EnumDesktopsA( HWINSTA hwinsta, DESKTOPENUMPROCA lpEnumFunc,
214 LPARAM lParam )
216 ENUMDESKTOPS_LPARAM caller_data;
218 caller_data.lpEnumFunc = lpEnumFunc;
219 caller_data.lParam = lParam;
221 return EnumDesktopsW(hwinsta, EnumDesktopProcWtoA, (LPARAM) &caller_data);
224 /******************************************************************************
225 * EnumDesktopsW [USER32.@]
227 BOOL WINAPI EnumDesktopsW( HWINSTA hwinsta, DESKTOPENUMPROCW lpEnumFunc,
228 LPARAM lParam )
230 FIXME("%p,%p,%lx): stub\n",hwinsta,lpEnumFunc,lParam);
231 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
232 return FALSE;
235 /******************************************************************************
236 * EnumWindowStationsA [USER32.@]
238 BOOL WINAPI EnumWindowStationsA( WINSTAENUMPROCA lpEnumFunc, LPARAM lParam)
240 FIXME("%p,%lx): stub\n",lpEnumFunc,lParam);
241 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
242 return FALSE;
245 /******************************************************************************
246 * EnumWindowStationsW [USER32.@]
248 BOOL WINAPI EnumWindowStationsW( WINSTAENUMPROCW lpEnumFunc, LPARAM lParam)
250 FIXME("%p,%lx): stub\n",lpEnumFunc,lParam);
251 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
252 return FALSE;
255 /******************************************************************************
256 * SetUserObjectInformationA (USER32.@)
258 BOOL WINAPI SetUserObjectInformationA( HANDLE hObj, INT nIndex,
259 LPVOID pvInfo, DWORD nLength )
261 FIXME("(%p,%d,%p,%lx): stub\n",hObj,nIndex,pvInfo,nLength);
262 return TRUE;
265 /******************************************************************************
266 * SetThreadDesktop (USER32.@)
268 BOOL WINAPI SetThreadDesktop( HANDLE hDesktop )
270 FIXME("(%p): stub\n",hDesktop);
271 return TRUE;
275 /***********************************************************************
276 * RegisterShellHookWindow [USER32.@]
278 BOOL WINAPI RegisterShellHookWindow ( HWND hWnd )
280 FIXME("(%p): stub\n", hWnd);
281 return 0;
285 /***********************************************************************
286 * DeregisterShellHookWindow [USER32.@]
288 HRESULT WINAPI DeregisterShellHookWindow ( DWORD u )
290 FIXME("0x%08lx stub\n",u);
291 return 0;
296 /***********************************************************************
297 * RegisterTasklist [USER32.@]
299 DWORD WINAPI RegisterTasklist (DWORD x)
301 FIXME("0x%08lx\n",x);
302 return TRUE;
306 /***********************************************************************
307 * GetAppCompatFlags (USER32.@)
309 DWORD WINAPI GetAppCompatFlags( HTASK hTask )
311 FIXME("stub\n");
312 return 0;
316 /***********************************************************************
317 * AlignRects (USER32.@)
319 BOOL WINAPI AlignRects(LPRECT rect, DWORD b, DWORD c, DWORD d)
321 FIXME("(%p, %ld, %ld, %ld): stub\n", rect, b, c, d);
322 if (rect)
323 FIXME("rect: [[%ld, %ld], [%ld, %ld]]\n", rect->left, rect->top, rect->right, rect->bottom);
324 /* Calls OffsetRect */
325 return FALSE;
329 /***********************************************************************
330 * USER_489 (USER.489)
332 LONG WINAPI stub_USER_489(void) { FIXME("stub\n"); return 0; }
334 /***********************************************************************
335 * USER_490 (USER.490)
337 LONG WINAPI stub_USER_490(void) { FIXME("stub\n"); return 0; }
339 /***********************************************************************
340 * USER_492 (USER.492)
342 LONG WINAPI stub_USER_492(void) { FIXME("stub\n"); return 0; }
344 /***********************************************************************
345 * USER_496 (USER.496)
347 LONG WINAPI stub_USER_496(void) { FIXME("stub\n"); return 0; }
349 /***********************************************************************
350 * User32InitializeImmEntryTable
352 BOOL WINAPI User32InitializeImmEntryTable(LPVOID ptr) {
353 FIXME("(%p): stub\n", ptr);
354 return TRUE;