c141ef6f6c2fe46f4fa0c820510a21ae19154604
[reactos.git] / reactos / dll / win32 / user32 / misc / stubs.c
1 /*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS user32.dll
4 * FILE: lib/user32/misc/stubs.c
5 * PURPOSE: User32.dll stubs
6 * PROGRAMMER: Casper S. Hornstrup (chorns@users.sourceforge.net)
7 * NOTES: If you implement a function, remove it from this file
8 * UPDATE HISTORY:
9 * 08-F05-2001 CSH Created
10 */
11
12 #include <user32.h>
13
14 #include <wine/debug.h>
15
16 WINE_DEFAULT_DEBUG_CHANNEL(user32);
17
18 /*
19 * @unimplemented
20 */
21 DWORD
22 WINAPI
23 WaitForInputIdle(
24 HANDLE hProcess,
25 DWORD dwMilliseconds)
26 {
27 // Need to call NtQueryInformationProcess and send ProcessId not hProcess.
28 return NtUserWaitForInputIdle(hProcess, dwMilliseconds, FALSE);
29 }
30
31 /******************************************************************************
32 * SetDebugErrorLevel [USER32.@]
33 * Sets the minimum error level for generating debugging events
34 *
35 * PARAMS
36 * dwLevel [I] Debugging error level
37 *
38 * @unimplemented
39 */
40 VOID
41 WINAPI
42 SetDebugErrorLevel( DWORD dwLevel )
43 {
44 DbgPrint("(%ld): stub\n", dwLevel);
45 }
46
47
48 /*
49 * @implemented
50 */
51 DWORD
52 WINAPI
53 GetAppCompatFlags(HTASK hTask)
54 {
55 PCLIENTINFO pci = GetWin32ClientInfo();
56
57 return pci->dwCompatFlags;
58 }
59
60 /*
61 * @implemented
62 */
63 DWORD
64 WINAPI
65 GetAppCompatFlags2(HTASK hTask)
66 {
67 PCLIENTINFO pci = GetWin32ClientInfo();
68
69 return pci->dwCompatFlags2;
70 }
71
72 /*
73 * @unimplemented
74 */
75 UINT
76 WINAPI
77 GetInternalWindowPos(
78 HWND hwnd,
79 LPRECT rectWnd,
80 LPPOINT ptIcon
81 )
82 {
83 WINDOWPLACEMENT wndpl;
84
85 if (GetWindowPlacement(hwnd, &wndpl))
86 {
87 if (rectWnd) *rectWnd = wndpl.rcNormalPosition;
88 if (ptIcon) *ptIcon = wndpl.ptMinPosition;
89 return wndpl.showCmd;
90 }
91 return 0;
92 }
93
94 /*
95 * @unimplemented
96 */
97 VOID
98 WINAPI
99 LoadLocalFonts ( VOID )
100 {
101 UNIMPLEMENTED;
102 }
103
104 /*
105 * @unimplemented
106 */
107 VOID
108 WINAPI
109 LoadRemoteFonts ( VOID )
110 {
111 UNIMPLEMENTED;
112 }
113
114 /*
115 * @unimplemented
116 */
117 VOID
118 WINAPI
119 RegisterSystemThread ( DWORD flags, DWORD reserved )
120 {
121 UNIMPLEMENTED;
122 }
123
124
125 /*
126 * @implemented
127 */
128 UINT
129 WINAPI
130 UserRealizePalette ( HDC hDC )
131 {
132 return NtUserCallOneParam((DWORD_PTR) hDC, ONEPARAM_ROUTINE_REALIZEPALETTE);
133 }
134
135
136 /*************************************************************************
137 * SetSysColorsTemp (USER32.@) (Wine 10/22/2008)
138 *
139 * UNDOCUMENTED !!
140 *
141 * Called by W98SE desk.cpl Control Panel Applet:
142 * handle = SetSysColorsTemp(ptr, ptr, nCount); ("set" call)
143 * result = SetSysColorsTemp(NULL, NULL, handle); ("restore" call)
144 *
145 * pPens is an array of COLORREF values, which seems to be used
146 * to indicate the color values to create new pens with.
147 *
148 * pBrushes is an array of solid brush handles (returned by a previous
149 * CreateSolidBrush), which seems to contain the brush handles to set
150 * for the system colors.
151 *
152 * n seems to be used for
153 * a) indicating the number of entries to operate on (length of pPens,
154 * pBrushes)
155 * b) passing the handle that points to the previously used color settings.
156 * I couldn't figure out in hell what kind of handle this is on
157 * Windows. I just use a heap handle instead. Shouldn't matter anyway.
158 *
159 * RETURNS
160 * heap handle of our own copy of the current syscolors in case of
161 * "set" call, i.e. pPens, pBrushes != NULL.
162 * TRUE (unconditionally !) in case of "restore" call,
163 * i.e. pPens, pBrushes == NULL.
164 * FALSE in case of either pPens != NULL and pBrushes == NULL
165 * or pPens == NULL and pBrushes != NULL.
166 *
167 * I'm not sure whether this implementation is 100% correct. [AM]
168 */
169
170 static HPEN SysColorPens[COLOR_MENUBAR + 1];
171 static HBRUSH SysColorBrushes[COLOR_MENUBAR + 1];
172
173 DWORD_PTR
174 WINAPI
175 SetSysColorsTemp(const COLORREF *pPens,
176 const HBRUSH *pBrushes,
177 DWORD n)
178 {
179 DWORD i;
180
181 if (pPens && pBrushes) /* "set" call */
182 {
183 /* allocate our structure to remember old colors */
184 LPVOID pOldCol = HeapAlloc(GetProcessHeap(), 0, sizeof(DWORD)+n*sizeof(HPEN)+n*sizeof(HBRUSH));
185 LPVOID p = pOldCol;
186 *(DWORD *)p = n; p = (char*)p + sizeof(DWORD);
187 memcpy(p, SysColorPens, n*sizeof(HPEN)); p = (char*)p + n*sizeof(HPEN);
188 memcpy(p, SysColorBrushes, n*sizeof(HBRUSH)); p = (char*)p + n*sizeof(HBRUSH);
189
190 for (i=0; i < n; i++)
191 {
192 SysColorPens[i] = CreatePen( PS_SOLID, 1, pPens[i] );
193 SysColorBrushes[i] = pBrushes[i];
194 }
195
196 return (DWORD_PTR) pOldCol;
197 }
198 if (!pPens && !pBrushes) /* "restore" call */
199 {
200 LPVOID pOldCol = (LPVOID)n; /* FIXME: not 64-bit safe */
201 LPVOID p = pOldCol;
202 DWORD nCount = *(DWORD *)p;
203 p = (char*)p + sizeof(DWORD);
204
205 for (i=0; i < nCount; i++)
206 {
207 DeleteObject(SysColorPens[i]);
208 SysColorPens[i] = *(HPEN *)p; p = (char*)p + sizeof(HPEN);
209 }
210 for (i=0; i < nCount; i++)
211 {
212 SysColorBrushes[i] = *(HBRUSH *)p; p = (char*)p + sizeof(HBRUSH);
213 }
214 /* get rid of storage structure */
215 HeapFree(GetProcessHeap(), 0, pOldCol);
216
217 return TRUE;
218 }
219 return FALSE;
220 }
221
222 /*
223 * @unimplemented
224 */
225 HDESK
226 WINAPI
227 GetInputDesktop ( VOID )
228 {
229 UNIMPLEMENTED;
230 return FALSE;
231 }
232
233 /*
234 * @unimplemented
235 */
236 BOOL
237 WINAPI
238 GetAccCursorInfo ( PCURSORINFO pci )
239 {
240 UNIMPLEMENTED;
241 return FALSE;
242 }
243
244 /*
245 * @unimplemented
246 */
247 BOOL
248 WINAPI
249 ClientThreadSetup ( VOID )
250 {
251 UNIMPLEMENTED;
252 return FALSE;
253 }
254
255 /*
256 * @unimplemented
257 */
258 UINT
259 WINAPI
260 GetRawInputDeviceInfoW(
261 HANDLE hDevice,
262 UINT uiCommand,
263 LPVOID pData,
264 PUINT pcbSize)
265 {
266 UNIMPLEMENTED;
267 return 0;
268 }
269
270 /*
271 * @unimplemented
272 */
273 LONG
274 WINAPI
275 CsrBroadcastSystemMessageExW(
276 DWORD dwflags,
277 LPDWORD lpdwRecipients,
278 UINT uiMessage,
279 WPARAM wParam,
280 LPARAM lParam,
281 PBSMINFO pBSMInfo)
282 {
283 UNIMPLEMENTED;
284 return FALSE;
285 }
286
287 /*
288 * @unimplemented
289 */
290 UINT
291 WINAPI
292 GetRawInputDeviceInfoA(
293 HANDLE hDevice,
294 UINT uiCommand,
295 LPVOID pData,
296 PUINT pcbSize)
297 {
298 UNIMPLEMENTED;
299 return 0;
300 }
301
302 /*
303 * @unimplemented
304 */
305 BOOL
306 WINAPI
307 AlignRects(LPRECT rect, DWORD b, DWORD c, DWORD d)
308 {
309 UNIMPLEMENTED;
310 return FALSE;
311 }
312
313 /*
314 * @unimplemented
315 */
316 LRESULT
317 WINAPI
318 DefRawInputProc(
319 PRAWINPUT* paRawInput,
320 INT nInput,
321 UINT cbSizeHeader)
322 {
323 UNIMPLEMENTED;
324 return 0;
325 }
326
327 /*
328 * @unimplemented
329 */
330 UINT
331 WINAPI
332 GetRawInputBuffer(
333 PRAWINPUT pData,
334 PUINT pcbSize,
335 UINT cbSizeHeader)
336 {
337 UNIMPLEMENTED;
338 return 0;
339 }
340
341 /*
342 * @unimplemented
343 */
344 UINT
345 WINAPI
346 GetRawInputData(
347 HRAWINPUT hRawInput,
348 UINT uiCommand,
349 LPVOID pData,
350 PUINT pcbSize,
351 UINT cbSizeHeader)
352 {
353 UNIMPLEMENTED;
354 return 0;
355 }
356
357 /*
358 * @unimplemented
359 */
360 UINT
361 WINAPI
362 GetRawInputDeviceList(
363 PRAWINPUTDEVICELIST pRawInputDeviceList,
364 PUINT puiNumDevices,
365 UINT cbSize)
366 {
367 if(pRawInputDeviceList)
368 memset(pRawInputDeviceList, 0, sizeof *pRawInputDeviceList);
369 *puiNumDevices = 0;
370
371 UNIMPLEMENTED;
372 return 0;
373 }
374
375 /*
376 * @unimplemented
377 */
378 UINT
379 WINAPI
380 GetRegisteredRawInputDevices(
381 PRAWINPUTDEVICE pRawInputDevices,
382 PUINT puiNumDevices,
383 UINT cbSize)
384 {
385 UNIMPLEMENTED;
386 return 0;
387 }
388
389 /*
390 * @unimplemented
391 */
392 BOOL
393 WINAPI
394 PrintWindow(
395 HWND hwnd,
396 HDC hdcBlt,
397 UINT nFlags)
398 {
399 UNIMPLEMENTED;
400 return FALSE;
401 }
402
403 /*
404 * @unimplemented
405 */
406 BOOL
407 WINAPI
408 RegisterRawInputDevices(
409 PCRAWINPUTDEVICE pRawInputDevices,
410 UINT uiNumDevices,
411 UINT cbSize)
412 {
413 UNIMPLEMENTED;
414 return FALSE;
415 }
416
417 /*
418 * @unimplemented
419 */
420 BOOL WINAPI DisplayExitWindowsWarnings(ULONG flags)
421 {
422 UNIMPLEMENTED;
423 return FALSE;
424 }
425
426 /*
427 * @unimplemented
428 */
429 BOOL WINAPI ReasonCodeNeedsBugID(ULONG reasoncode)
430 {
431 UNIMPLEMENTED;
432 return FALSE;
433 }
434
435 /*
436 * @unimplemented
437 */
438 BOOL WINAPI ReasonCodeNeedsComment(ULONG reasoncode)
439 {
440 UNIMPLEMENTED;
441 return FALSE;
442 }
443
444 /*
445 * @unimplemented
446 */
447 BOOL WINAPI CtxInitUser32(VOID)
448 {
449 UNIMPLEMENTED;
450 return FALSE;
451 }
452
453 /*
454 * @unimplemented
455 */
456 BOOL WINAPI EnterReaderModeHelper(HWND hwnd)
457 {
458 UNIMPLEMENTED;
459 return FALSE;
460 }
461
462 /*
463 * @unimplemented
464 */
465 VOID WINAPI InitializeLpkHooks(FARPROC *hookfuncs)
466 {
467 UNIMPLEMENTED;
468 }
469
470 /*
471 * @unimplemented
472 */
473 WORD WINAPI InitializeWin32EntryTable(UCHAR* EntryTablePlus0x1000)
474 {
475 UNIMPLEMENTED;
476 return FALSE;
477 }
478
479 /*
480 * @unimplemented
481 */
482 BOOL WINAPI IsServerSideWindow(HWND wnd)
483 {
484 UNIMPLEMENTED;
485 return FALSE;
486 }
487
488 /*
489 * @unimplemented
490 */
491 HKL WINAPI LoadKeyboardLayoutEx(DWORD unknown,LPCWSTR pwszKLID,UINT Flags) //1st parameter unknown
492 {
493 UNIMPLEMENTED;
494 return FALSE;
495 }
496
497 /*
498 * @unimplemented
499 */
500 VOID WINAPI AllowForegroundActivation(VOID)
501 {
502 UNIMPLEMENTED;
503 }
504
505 /*
506 * @unimplemented
507 */
508 VOID WINAPI ShowStartGlass(DWORD unknown)
509 {
510 UNIMPLEMENTED;
511 }
512
513 /*
514 * @unimplemented
515 */
516 BOOL WINAPI DdeGetQualityOfService(HWND hWnd, DWORD Reserved, PSECURITY_QUALITY_OF_SERVICE pqosPrev)
517 {
518 UNIMPLEMENTED;
519 return FALSE;
520 }
521
522 /*
523 * @unimplemented
524 */
525 BOOL WINAPI SetProcessDPIAware(VOID)
526 {
527 UNIMPLEMENTED;
528 return TRUE;
529 }
530
531 /*
532 * @unimplemented
533 */
534 BOOL WINAPI CliImmSetHotKey(DWORD dwID, UINT uModifiers, UINT uVirtualKey, HKL hKl)
535 {
536 UNIMPLEMENTED;
537 return FALSE;
538 }
539
540 /*
541 * @unimplemented
542 */
543 DWORD WINAPI GetMenuIndex(HMENU hMenu, HMENU hSubMenu)
544 {
545 UNIMPLEMENTED;
546 return 0;
547 }
548
549 /*
550 * @unimplemented
551 */
552 DWORD WINAPI UserRegisterWowHandlers(PVOID Unknown1, PVOID Unknown2)
553 {
554 UNIMPLEMENTED;
555 return 0;
556 }
557