Register Shell Drag and Drop Helper.
[wine/wine64.git] / dlls / user / misc.c
bloba074a3f27d0dd6151f7f2b0f2fb92c1e297a4238
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 "winuser.h"
27 #include "winnls.h"
29 #include "wine/debug.h"
31 WINE_DEFAULT_DEBUG_CHANNEL(win);
33 /* callback to allow EnumDesktopsA to use EnumDesktopsW */
34 typedef struct {
35 DESKTOPENUMPROCA lpEnumFunc;
36 LPARAM lParam;
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)
45 LPSTR buffer;
46 INT len;
47 BOOL ret;
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);
57 return ret;
60 /**********************************************************************
61 * SetLastErrorEx [USER32.@] Sets the last-error code.
63 * RETURNS
64 * None.
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);
71 switch(type) {
72 case 0:
73 break;
74 case SLE_ERROR:
75 case SLE_MINORERROR:
76 case SLE_WARNING:
77 /* Fall through for now */
78 default:
79 FIXME("(error=%08lx, type=%08lx): Unhandled type\n", error,type);
80 break;
82 SetLastError( error );
85 BOOL WINAPI GetAltTabInfoA(HWND hwnd, int iItem, PALTTABINFO pati, LPSTR pszItemText, UINT cchItemText)
87 FIXME("(%p, 0x%08x, %p, %p, 0x%08x)\n", hwnd, iItem, pati, pszItemText, cchItemText);
88 return FALSE;
91 BOOL WINAPI GetAltTabInfoW(HWND hwnd, int iItem, PALTTABINFO pati, LPWSTR pszItemText, UINT cchItemText)
93 FIXME("(%p, 0x%08x, %p, %p, 0x%08x)\n", hwnd, iItem, pati, pszItemText, cchItemText);
94 return FALSE;
97 /******************************************************************************
98 * GetProcessWindowStation [USER32.@] Returns handle of window station
100 * NOTES
101 * Docs say the return value is HWINSTA
103 * RETURNS
104 * Success: Handle to window station associated with calling process
105 * Failure: NULL
107 HWINSTA WINAPI GetProcessWindowStation(void)
109 FIXME("(void): stub\n");
110 return (HWINSTA)1;
114 /******************************************************************************
115 * GetThreadDesktop [USER32.@] Returns handle to desktop
117 * PARAMS
118 * dwThreadId [I] Thread identifier
120 * RETURNS
121 * Success: Handle to desktop associated with specified thread
122 * Failure: NULL
124 HDESK WINAPI GetThreadDesktop( DWORD dwThreadId )
126 FIXME("(%lx): stub\n",dwThreadId);
127 return (HDESK)1;
131 /******************************************************************************
132 * SetDebugErrorLevel [USER32.@]
133 * Sets the minimum error level for generating debugging events
135 * PARAMS
136 * dwLevel [I] Debugging error level
138 VOID WINAPI SetDebugErrorLevel( DWORD dwLevel )
140 FIXME("(%ld): stub\n", dwLevel);
144 /******************************************************************************
145 * GetProcessDefaultLayout [USER32.@]
147 * Gets the default layout for parentless windows.
148 * Right now, just returns 0 (left-to-right).
150 * RETURNS
151 * Success: Nonzero
152 * Failure: Zero
154 * BUGS
155 * No RTL
157 BOOL WINAPI GetProcessDefaultLayout( DWORD *pdwDefaultLayout )
159 if ( !pdwDefaultLayout ) {
160 SetLastError( ERROR_INVALID_PARAMETER );
161 return FALSE;
163 FIXME( "( %p ): No BiDi\n", pdwDefaultLayout );
164 *pdwDefaultLayout = 0;
165 return TRUE;
169 /******************************************************************************
170 * SetProcessDefaultLayout [USER32.@]
172 * Sets the default layout for parentless windows.
173 * Right now, only accepts 0 (left-to-right).
175 * RETURNS
176 * Success: Nonzero
177 * Failure: Zero
179 * BUGS
180 * No RTL
182 BOOL WINAPI SetProcessDefaultLayout( DWORD dwDefaultLayout )
184 if ( dwDefaultLayout == 0 )
185 return TRUE;
186 FIXME( "( %08lx ): No BiDi\n", dwDefaultLayout );
187 SetLastError( ERROR_CALL_NOT_IMPLEMENTED );
188 return FALSE;
192 /******************************************************************************
193 * OpenDesktopA [USER32.@]
195 * Not supported on Win9x - returns NULL and calls SetLastError.
197 HDESK WINAPI OpenDesktopA( LPCSTR lpszDesktop, DWORD dwFlags,
198 BOOL fInherit, DWORD dwDesiredAccess )
200 FIXME("(%s,%lx,%i,%lx): stub\n",debugstr_a(lpszDesktop),dwFlags,
201 fInherit,dwDesiredAccess);
203 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
204 return 0;
207 /******************************************************************************
208 * OpenInputDesktop [USER32.@]
210 * Not supported on Win9x - returns NULL and calls SetLastError.
212 HDESK WINAPI OpenInputDesktop( DWORD dwFlags, BOOL fInherit, ACCESS_MASK dwDesiredAccess )
214 FIXME("(%lx,%i,%lx): stub\n",dwFlags, fInherit,dwDesiredAccess);
215 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
216 return 0;
219 /******************************************************************************
220 * EnumDesktopsA [USER32.@]
222 BOOL WINAPI EnumDesktopsA( HWINSTA hwinsta, DESKTOPENUMPROCA lpEnumFunc,
223 LPARAM lParam )
225 ENUMDESKTOPS_LPARAM caller_data;
227 caller_data.lpEnumFunc = lpEnumFunc;
228 caller_data.lParam = lParam;
230 return EnumDesktopsW(hwinsta, EnumDesktopProcWtoA, (LPARAM) &caller_data);
233 /******************************************************************************
234 * EnumDesktopsW [USER32.@]
236 BOOL WINAPI EnumDesktopsW( HWINSTA hwinsta, DESKTOPENUMPROCW lpEnumFunc,
237 LPARAM lParam )
239 FIXME("%p,%p,%lx): stub\n",hwinsta,lpEnumFunc,lParam);
240 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
241 return FALSE;
244 /******************************************************************************
245 * EnumWindowStationsA [USER32.@]
247 BOOL WINAPI EnumWindowStationsA( WINSTAENUMPROCA lpEnumFunc, LPARAM lParam)
249 FIXME("%p,%lx): stub\n",lpEnumFunc,lParam);
250 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
251 return FALSE;
254 /******************************************************************************
255 * EnumWindowStationsW [USER32.@]
257 BOOL WINAPI EnumWindowStationsW( WINSTAENUMPROCW lpEnumFunc, LPARAM lParam)
259 FIXME("%p,%lx): stub\n",lpEnumFunc,lParam);
260 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
261 return FALSE;
264 /******************************************************************************
265 * SetUserObjectInformationA (USER32.@)
267 BOOL WINAPI SetUserObjectInformationA( HANDLE hObj, INT nIndex,
268 LPVOID pvInfo, DWORD nLength )
270 FIXME("(%p,%d,%p,%lx): stub\n",hObj,nIndex,pvInfo,nLength);
271 return TRUE;
274 /******************************************************************************
275 * SetThreadDesktop (USER32.@)
277 BOOL WINAPI SetThreadDesktop( HANDLE hDesktop )
279 FIXME("(%p): stub\n",hDesktop);
280 return TRUE;
284 /***********************************************************************
285 * RegisterShellHookWindow [USER32.@]
287 BOOL WINAPI RegisterShellHookWindow ( HWND hWnd )
289 FIXME("(%p): stub\n", hWnd);
290 return 0;
294 /***********************************************************************
295 * DeregisterShellHookWindow [USER32.@]
297 HRESULT WINAPI DeregisterShellHookWindow ( DWORD u )
299 FIXME("0x%08lx stub\n",u);
300 return 0;
305 /***********************************************************************
306 * RegisterTasklist [USER32.@]
308 DWORD WINAPI RegisterTasklist (DWORD x)
310 FIXME("0x%08lx\n",x);
311 return TRUE;
315 /***********************************************************************
316 * GetAppCompatFlags (USER32.@)
318 DWORD WINAPI GetAppCompatFlags( HTASK hTask )
320 FIXME("stub\n");
321 return 0;
325 /***********************************************************************
326 * AlignRects (USER32.@)
328 BOOL WINAPI AlignRects(LPRECT rect, DWORD b, DWORD c, DWORD d)
330 FIXME("(%p, %ld, %ld, %ld): stub\n", rect, b, c, d);
331 if (rect)
332 FIXME("rect: [[%ld, %ld], [%ld, %ld]]\n", rect->left, rect->top, rect->right, rect->bottom);
333 /* Calls OffsetRect */
334 return FALSE;
338 /***********************************************************************
339 * USER_489 (USER.489)
341 LONG WINAPI stub_USER_489(void) { FIXME("stub\n"); return 0; }
343 /***********************************************************************
344 * USER_490 (USER.490)
346 LONG WINAPI stub_USER_490(void) { FIXME("stub\n"); return 0; }
348 /***********************************************************************
349 * USER_492 (USER.492)
351 LONG WINAPI stub_USER_492(void) { FIXME("stub\n"); return 0; }
353 /***********************************************************************
354 * USER_496 (USER.496)
356 LONG WINAPI stub_USER_496(void) { FIXME("stub\n"); return 0; }
358 /***********************************************************************
359 * User32InitializeImmEntryTable
361 BOOL WINAPI User32InitializeImmEntryTable(LPVOID ptr)
363 FIXME("(%p): stub\n", ptr);
364 return TRUE;
367 /**********************************************************************
368 * WINNLSGetIMEHotkey [USER32.@]
371 UINT WINAPI WINNLSGetIMEHotkey(HWND hUnknown1)
373 FIXME("hUnknown1 %p: stub!\n", hUnknown1);
374 return 0; /* unknown */
377 /**********************************************************************
378 * WINNLSEnableIME [USER32.@]
381 BOOL WINAPI WINNLSEnableIME(HWND hUnknown1, BOOL bUnknown2)
383 FIXME("hUnknown1 %p bUnknown2 %d: stub!\n", hUnknown1, bUnknown2);
384 return TRUE; /* success (?) */
387 /**********************************************************************
388 * WINNLSGetEnableStatus [USER32.@]
391 BOOL WINAPI WINNLSGetEnableStatus(HWND hUnknown1)
393 FIXME("hUnknown1 %p: stub!\n", hUnknown1);
394 return TRUE; /* success (?) */
397 /**********************************************************************
398 * SendIMEMessageExA [USER32.@]
401 LRESULT WINAPI SendIMEMessageExA(HWND p1, LPARAM p2)
403 FIXME("(%p,%lx): stub\n", p1, p2);
404 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
405 return 0;
408 /**********************************************************************
409 * SendIMEMessageExW [USER32.@]
412 LRESULT WINAPI SendIMEMessageExW(HWND p1, LPARAM p2)
414 FIXME("(%p,%lx): stub\n", p1, p2);
415 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
416 return 0;