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
29 #include "wine/debug.h"
31 WINE_DEFAULT_DEBUG_CHANNEL(win);
33 /* callback to allow EnumDesktopsA to use EnumDesktopsW */
35 DESKTOPENUMPROCA lpEnumFunc;
37 } ENUMDESKTOPS_LPARAM;
39 /* EnumDesktopsA passes this callback function to EnumDesktopsW.
40 * It simply converts the string to ASCII and calls the callback
41 * function provided by the original caller
43 static BOOL CALLBACK EnumDesktopProcWtoA(LPWSTR lpszDesktop, LPARAM lParam)
48 ENUMDESKTOPS_LPARAM *data = (ENUMDESKTOPS_LPARAM *)lParam;
50 len = WideCharToMultiByte(CP_ACP, 0, lpszDesktop, -1, NULL, 0, NULL, NULL);
51 if (!(buffer = HeapAlloc( GetProcessHeap(), 0, len))) return FALSE;
52 WideCharToMultiByte(CP_ACP, 0, lpszDesktop, -1, buffer, len, NULL, NULL);
54 ret = data->lpEnumFunc(buffer, data->lParam);
56 HeapFree(GetProcessHeap(), 0, buffer);
60 /**********************************************************************
61 * SetLastErrorEx [USER32.@] Sets the last-error code.
66 void WINAPI SetLastErrorEx(
67 DWORD error, /* [in] Per-thread error code */
68 DWORD type) /* [in] Error type */
70 TRACE("(0x%08lx, 0x%08lx)\n", error,type);
77 /* Fall through for now */
79 FIXME("(error=%08lx, type=%08lx): Unhandled type\n", error,type);
82 SetLastError( error );
86 /******************************************************************************
87 * GetProcessWindowStation [USER32.@] Returns handle of window station
90 * Docs say the return value is HWINSTA
93 * Success: Handle to window station associated with calling process
96 HWINSTA WINAPI GetProcessWindowStation(void)
98 FIXME("(void): stub\n");
103 /******************************************************************************
104 * GetThreadDesktop [USER32.@] Returns handle to desktop
107 * dwThreadId [I] Thread identifier
110 * Success: Handle to desktop associated with specified thread
113 HDESK WINAPI GetThreadDesktop( DWORD dwThreadId )
115 FIXME("(%lx): stub\n",dwThreadId);
120 /******************************************************************************
121 * SetDebugErrorLevel [USER32.@]
122 * Sets the minimum error level for generating debugging events
125 * dwLevel [I] Debugging error level
127 VOID WINAPI SetDebugErrorLevel( DWORD dwLevel )
129 FIXME("(%ld): stub\n", dwLevel);
133 /******************************************************************************
134 * GetProcessDefaultLayout [USER32.@]
136 * Gets the default layout for parentless windows.
137 * Right now, just returns 0 (left-to-right).
146 BOOL WINAPI GetProcessDefaultLayout( DWORD *pdwDefaultLayout )
148 if ( !pdwDefaultLayout ) {
149 SetLastError( ERROR_INVALID_PARAMETER );
152 FIXME( "( %p ): No BiDi\n", pdwDefaultLayout );
153 *pdwDefaultLayout = 0;
158 /******************************************************************************
159 * SetProcessDefaultLayout [USER32.@]
161 * Sets the default layout for parentless windows.
162 * Right now, only accepts 0 (left-to-right).
171 BOOL WINAPI SetProcessDefaultLayout( DWORD dwDefaultLayout )
173 if ( dwDefaultLayout == 0 )
175 FIXME( "( %08lx ): No BiDi\n", dwDefaultLayout );
176 SetLastError( ERROR_CALL_NOT_IMPLEMENTED );
181 /******************************************************************************
182 * OpenDesktopA [USER32.@]
184 * Not supported on Win9x - returns NULL and calls SetLastError.
186 HDESK WINAPI OpenDesktopA( LPCSTR lpszDesktop, DWORD dwFlags,
187 BOOL fInherit, DWORD dwDesiredAccess )
189 FIXME("(%s,%lx,%i,%lx): stub\n",debugstr_a(lpszDesktop),dwFlags,
190 fInherit,dwDesiredAccess);
192 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
196 /******************************************************************************
197 * OpenInputDesktop [USER32.@]
199 * Not supported on Win9x - returns NULL and calls SetLastError.
201 HDESK WINAPI OpenInputDesktop( DWORD dwFlags, BOOL fInherit, ACCESS_MASK dwDesiredAccess )
203 FIXME("(%lx,%i,%lx): stub\n",dwFlags, fInherit,dwDesiredAccess);
204 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
208 /******************************************************************************
209 * EnumDesktopsA [USER32.@]
211 BOOL WINAPI EnumDesktopsA( HWINSTA hwinsta, DESKTOPENUMPROCA lpEnumFunc,
214 ENUMDESKTOPS_LPARAM caller_data;
216 caller_data.lpEnumFunc = lpEnumFunc;
217 caller_data.lParam = lParam;
219 return EnumDesktopsW(hwinsta, EnumDesktopProcWtoA, (LPARAM) &caller_data);
222 /******************************************************************************
223 * EnumDesktopsW [USER32.@]
225 BOOL WINAPI EnumDesktopsW( HWINSTA hwinsta, DESKTOPENUMPROCW lpEnumFunc,
228 FIXME("%p,%p,%lx): stub\n",hwinsta,lpEnumFunc,lParam);
229 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
233 /******************************************************************************
234 * EnumWindowStationsA [USER32.@]
236 BOOL WINAPI EnumWindowStationsA( WINSTAENUMPROCA lpEnumFunc, LPARAM lParam)
238 FIXME("%p,%lx): stub\n",lpEnumFunc,lParam);
239 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
243 /******************************************************************************
244 * EnumWindowStationsW [USER32.@]
246 BOOL WINAPI EnumWindowStationsW( WINSTAENUMPROCW lpEnumFunc, LPARAM lParam)
248 FIXME("%p,%lx): stub\n",lpEnumFunc,lParam);
249 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
253 /******************************************************************************
254 * SetUserObjectInformationA (USER32.@)
256 BOOL WINAPI SetUserObjectInformationA( HANDLE hObj, INT nIndex,
257 LPVOID pvInfo, DWORD nLength )
259 FIXME("(%p,%d,%p,%lx): stub\n",hObj,nIndex,pvInfo,nLength);
263 /******************************************************************************
264 * SetThreadDesktop (USER32.@)
266 BOOL WINAPI SetThreadDesktop( HANDLE hDesktop )
268 FIXME("(%p): stub\n",hDesktop);
273 /***********************************************************************
274 * RegisterShellHookWindow [USER32.@]
276 BOOL WINAPI RegisterShellHookWindow ( HWND hWnd )
278 FIXME("(%p): stub\n", hWnd);
283 /***********************************************************************
284 * DeregisterShellHookWindow [USER32.@]
286 HRESULT WINAPI DeregisterShellHookWindow ( DWORD u )
288 FIXME("0x%08lx stub\n",u);
294 /***********************************************************************
295 * RegisterTasklist [USER32.@]
297 DWORD WINAPI RegisterTasklist (DWORD x)
299 FIXME("0x%08lx\n",x);
304 /***********************************************************************
305 * GetAppCompatFlags (USER32.@)
307 DWORD WINAPI GetAppCompatFlags( HTASK hTask )
314 /***********************************************************************
315 * AlignRects (USER32.@)
317 BOOL WINAPI AlignRects(LPRECT rect, DWORD b, DWORD c, DWORD d)
319 FIXME("(%p, %ld, %ld, %ld): stub\n", rect, b, c, d);
321 FIXME("rect: [[%ld, %ld], [%ld, %ld]]\n", rect->left, rect->top, rect->right, rect->bottom);
322 /* Calls OffsetRect */
327 /***********************************************************************
328 * USER_489 (USER.489)
330 LONG WINAPI stub_USER_489(void) { FIXME("stub\n"); return 0; }
332 /***********************************************************************
333 * USER_490 (USER.490)
335 LONG WINAPI stub_USER_490(void) { FIXME("stub\n"); return 0; }
337 /***********************************************************************
338 * USER_492 (USER.492)
340 LONG WINAPI stub_USER_492(void) { FIXME("stub\n"); return 0; }
342 /***********************************************************************
343 * USER_496 (USER.496)
345 LONG WINAPI stub_USER_496(void) { FIXME("stub\n"); return 0; }
347 /***********************************************************************
348 * User32InitializeImmEntryTable
350 BOOL WINAPI User32InitializeImmEntryTable(LPVOID ptr) {
351 FIXME("(%p): stub\n", ptr);