[USER32]
[reactos.git] / reactos / win32ss / user / 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("(%lu): 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 VOID
76 WINAPI
77 LoadLocalFonts ( VOID )
78 {
79 UNIMPLEMENTED;
80 }
81
82 /*
83 * @unimplemented
84 */
85 VOID
86 WINAPI
87 LoadRemoteFonts ( VOID )
88 {
89 UNIMPLEMENTED;
90 }
91
92 /*
93 * @unimplemented
94 */
95 VOID
96 WINAPI
97 RegisterSystemThread ( DWORD flags, DWORD reserved )
98 {
99 UNIMPLEMENTED;
100 }
101
102
103 /*
104 * @implemented
105 */
106 UINT
107 WINAPI
108 UserRealizePalette ( HDC hDC )
109 {
110 return NtUserxRealizePalette(hDC);
111 }
112
113
114 /*************************************************************************
115 * SetSysColorsTemp (USER32.@) (Wine 10/22/2008)
116 *
117 * UNDOCUMENTED !!
118 *
119 * Called by W98SE desk.cpl Control Panel Applet:
120 * handle = SetSysColorsTemp(ptr, ptr, nCount); ("set" call)
121 * result = SetSysColorsTemp(NULL, NULL, handle); ("restore" call)
122 *
123 * pPens is an array of COLORREF values, which seems to be used
124 * to indicate the color values to create new pens with.
125 *
126 * pBrushes is an array of solid brush handles (returned by a previous
127 * CreateSolidBrush), which seems to contain the brush handles to set
128 * for the system colors.
129 *
130 * n seems to be used for
131 * a) indicating the number of entries to operate on (length of pPens,
132 * pBrushes)
133 * b) passing the handle that points to the previously used color settings.
134 * I couldn't figure out in hell what kind of handle this is on
135 * Windows. I just use a heap handle instead. Shouldn't matter anyway.
136 *
137 * RETURNS
138 * heap handle of our own copy of the current syscolors in case of
139 * "set" call, i.e. pPens, pBrushes != NULL.
140 * TRUE (unconditionally !) in case of "restore" call,
141 * i.e. pPens, pBrushes == NULL.
142 * FALSE in case of either pPens != NULL and pBrushes == NULL
143 * or pPens == NULL and pBrushes != NULL.
144 *
145 * I'm not sure whether this implementation is 100% correct. [AM]
146 */
147
148 static HPEN SysColorPens[COLOR_MENUBAR + 1];
149 static HBRUSH SysColorBrushes[COLOR_MENUBAR + 1];
150
151 DWORD_PTR
152 WINAPI
153 SetSysColorsTemp(const COLORREF *pPens,
154 const HBRUSH *pBrushes,
155 DWORD_PTR n)
156 {
157 DWORD i;
158
159 if (pPens && pBrushes) /* "set" call */
160 {
161 /* allocate our structure to remember old colors */
162 LPVOID pOldCol = HeapAlloc(GetProcessHeap(), 0, sizeof(DWORD)+n*sizeof(HPEN)+n*sizeof(HBRUSH));
163 LPVOID p = pOldCol;
164 *(DWORD_PTR *)p = n; p = (char*)p + sizeof(DWORD);
165 memcpy(p, SysColorPens, n*sizeof(HPEN)); p = (char*)p + n*sizeof(HPEN);
166 memcpy(p, SysColorBrushes, n*sizeof(HBRUSH)); p = (char*)p + n*sizeof(HBRUSH);
167
168 for (i=0; i < n; i++)
169 {
170 SysColorPens[i] = CreatePen( PS_SOLID, 1, pPens[i] );
171 SysColorBrushes[i] = pBrushes[i];
172 }
173
174 return (DWORD_PTR) pOldCol;
175 }
176 if (!pPens && !pBrushes) /* "restore" call */
177 {
178 LPVOID pOldCol = (LPVOID)n;
179 LPVOID p = pOldCol;
180 DWORD nCount = *(DWORD *)p;
181 p = (char*)p + sizeof(DWORD);
182
183 for (i=0; i < nCount; i++)
184 {
185 DeleteObject(SysColorPens[i]);
186 SysColorPens[i] = *(HPEN *)p; p = (char*)p + sizeof(HPEN);
187 }
188 for (i=0; i < nCount; i++)
189 {
190 SysColorBrushes[i] = *(HBRUSH *)p; p = (char*)p + sizeof(HBRUSH);
191 }
192 /* get rid of storage structure */
193 HeapFree(GetProcessHeap(), 0, pOldCol);
194
195 return TRUE;
196 }
197 return FALSE;
198 }
199
200 /*
201 * @unimplemented
202 */
203 HDESK
204 WINAPI
205 GetInputDesktop ( VOID )
206 {
207 UNIMPLEMENTED;
208 return FALSE;
209 }
210
211 /*
212 * @unimplemented
213 */
214 BOOL
215 WINAPI
216 GetAccCursorInfo ( PCURSORINFO pci )
217 {
218 UNIMPLEMENTED;
219 return FALSE;
220 }
221
222 /*
223 * @unimplemented
224 */
225 UINT
226 WINAPI
227 GetRawInputDeviceInfoW(
228 HANDLE hDevice,
229 UINT uiCommand,
230 LPVOID pData,
231 PUINT pcbSize)
232 {
233 UNIMPLEMENTED;
234 return 0;
235 }
236
237 /*
238 * @unimplemented
239 */
240 LONG
241 WINAPI
242 CsrBroadcastSystemMessageExW(
243 DWORD dwflags,
244 LPDWORD lpdwRecipients,
245 UINT uiMessage,
246 WPARAM wParam,
247 LPARAM lParam,
248 PBSMINFO pBSMInfo)
249 {
250 UNIMPLEMENTED;
251 return FALSE;
252 }
253
254 /*
255 * @unimplemented
256 */
257 UINT
258 WINAPI
259 GetRawInputDeviceInfoA(
260 HANDLE hDevice,
261 UINT uiCommand,
262 LPVOID pData,
263 PUINT pcbSize)
264 {
265 UNIMPLEMENTED;
266 return 0;
267 }
268
269 /*
270 * @unimplemented
271 */
272 BOOL
273 WINAPI
274 AlignRects(LPRECT rect, DWORD b, DWORD c, DWORD d)
275 {
276 UNIMPLEMENTED;
277 return FALSE;
278 }
279
280 /*
281 * @implemented
282 */
283 LRESULT
284 WINAPI
285 DefRawInputProc(
286 PRAWINPUT* paRawInput,
287 INT nInput,
288 UINT cbSizeHeader)
289 {
290 if (cbSizeHeader == sizeof(RAWINPUTHEADER))
291 return S_OK;
292 return 1;
293 }
294
295 /*
296 * @unimplemented
297 */
298 UINT
299 WINAPI
300 DECLSPEC_HOTPATCH
301 GetRawInputBuffer(
302 PRAWINPUT pData,
303 PUINT pcbSize,
304 UINT cbSizeHeader)
305 {
306 UNIMPLEMENTED;
307 return 0;
308 }
309
310 /*
311 * @unimplemented
312 */
313 UINT
314 WINAPI
315 GetRawInputData(
316 HRAWINPUT hRawInput,
317 UINT uiCommand,
318 LPVOID pData,
319 PUINT pcbSize,
320 UINT cbSizeHeader)
321 {
322 UNIMPLEMENTED;
323 return 0;
324 }
325
326 /*
327 * @unimplemented
328 */
329 UINT
330 WINAPI
331 GetRawInputDeviceList(
332 PRAWINPUTDEVICELIST pRawInputDeviceList,
333 PUINT puiNumDevices,
334 UINT cbSize)
335 {
336 if(pRawInputDeviceList)
337 memset(pRawInputDeviceList, 0, sizeof *pRawInputDeviceList);
338 *puiNumDevices = 0;
339
340 UNIMPLEMENTED;
341 return 0;
342 }
343
344 /*
345 * @unimplemented
346 */
347 UINT
348 WINAPI
349 GetRegisteredRawInputDevices(
350 PRAWINPUTDEVICE pRawInputDevices,
351 PUINT puiNumDevices,
352 UINT cbSize)
353 {
354 UNIMPLEMENTED;
355 return 0;
356 }
357
358 /*
359 * @unimplemented
360 */
361 BOOL
362 WINAPI
363 DECLSPEC_HOTPATCH
364 RegisterRawInputDevices(
365 PCRAWINPUTDEVICE pRawInputDevices,
366 UINT uiNumDevices,
367 UINT cbSize)
368 {
369 UNIMPLEMENTED;
370 return FALSE;
371 }
372
373 /*
374 * @unimplemented
375 */
376 BOOL WINAPI DisplayExitWindowsWarnings(ULONG flags)
377 {
378 UNIMPLEMENTED;
379 return FALSE;
380 }
381
382 /*
383 * @unimplemented
384 */
385 BOOL WINAPI ReasonCodeNeedsBugID(ULONG reasoncode)
386 {
387 UNIMPLEMENTED;
388 return FALSE;
389 }
390
391 /*
392 * @unimplemented
393 */
394 BOOL WINAPI ReasonCodeNeedsComment(ULONG reasoncode)
395 {
396 UNIMPLEMENTED;
397 return FALSE;
398 }
399
400 /*
401 * @unimplemented
402 */
403 BOOL WINAPI CtxInitUser32(VOID)
404 {
405 UNIMPLEMENTED;
406 return FALSE;
407 }
408
409 /*
410 * @unimplemented
411 */
412 BOOL WINAPI EnterReaderModeHelper(HWND hwnd)
413 {
414 UNIMPLEMENTED;
415 return FALSE;
416 }
417
418 /*
419 * @unimplemented
420 */
421 VOID WINAPI InitializeLpkHooks(FARPROC *hookfuncs)
422 {
423 UNIMPLEMENTED;
424 }
425
426 /*
427 * @unimplemented
428 */
429 WORD WINAPI InitializeWin32EntryTable(UCHAR* EntryTablePlus0x1000)
430 {
431 UNIMPLEMENTED;
432 return FALSE;
433 }
434
435 /*
436 * @unimplemented
437 */
438 BOOL WINAPI IsServerSideWindow(HWND wnd)
439 {
440 UNIMPLEMENTED;
441 return FALSE;
442 }
443
444 /*
445 * @unimplemented
446 */
447 HKL WINAPI LoadKeyboardLayoutEx(DWORD unknown,LPCWSTR pwszKLID,UINT Flags) //1st parameter unknown
448 {
449 UNIMPLEMENTED;
450 return FALSE;
451 }
452
453 /*
454 * @unimplemented
455 */
456 VOID WINAPI AllowForegroundActivation(VOID)
457 {
458 UNIMPLEMENTED;
459 }
460
461 /*
462 * @unimplemented
463 */
464 VOID WINAPI ShowStartGlass(DWORD unknown)
465 {
466 UNIMPLEMENTED;
467 }
468
469 /*
470 * @unimplemented
471 */
472 BOOL WINAPI DdeGetQualityOfService(HWND hWnd, DWORD Reserved, PSECURITY_QUALITY_OF_SERVICE pqosPrev)
473 {
474 UNIMPLEMENTED;
475 return FALSE;
476 }
477
478 /*
479 * @unimplemented
480 */
481 BOOL WINAPI CliImmSetHotKey(DWORD dwID, UINT uModifiers, UINT uVirtualKey, HKL hKl)
482 {
483 UNIMPLEMENTED;
484 return FALSE;
485 }
486
487 /*
488 * @implemented
489 */
490 DWORD WINAPI GetMenuIndex(HMENU hMenu, HMENU hSubMenu)
491 {
492 return NtUserGetMenuIndex(hMenu, hSubMenu);
493 }
494
495 /*
496 * @unimplemented
497 */
498 DWORD WINAPI UserRegisterWowHandlers(PVOID Unknown1, PVOID Unknown2)
499 {
500 UNIMPLEMENTED;
501 return 0;
502 }
503
504 BOOL
505 WINAPI
506 BuildReasonArray(PVOID Pointer)
507 {
508 UNIMPLEMENTED;
509 return FALSE;
510 }
511
512 VOID
513 WINAPI
514 CreateSystemThreads(DWORD dwUnknown)
515 {
516 NtUserxCreateSystemThreads(dwUnknown);
517 ExitThread(0);
518 }
519
520 BOOL
521 WINAPI
522 DestroyReasons(PVOID Pointer)
523 {
524 UNIMPLEMENTED;
525 return FALSE;
526 }
527
528 BOOL
529 WINAPI
530 DeviceEventWorker(DWORD dw1, DWORD dw2, DWORD dw3, DWORD dw4, DWORD dw5)
531 {
532 UNIMPLEMENTED;
533 return FALSE;
534 }
535
536 BOOL
537 WINAPI
538 GetReasonTitleFromReasonCode(DWORD dw1, DWORD dw2, DWORD dw3)
539 {
540 UNIMPLEMENTED;
541 return FALSE;
542 }
543
544 BOOL
545 WINAPI
546 IsSETEnabled(VOID)
547 {
548 /*
549 * Determines whether the Shutdown Event Tracker is enabled.
550 *
551 * See http://undoc.airesoft.co.uk/user32.dll/IsSETEnabled.php
552 * for more information.
553 */
554 UNIMPLEMENTED;
555 return FALSE;
556 }
557
558 BOOL
559 WINAPI
560 RecordShutdownReason(DWORD dw0)
561 {
562 UNIMPLEMENTED;
563 return FALSE;
564 }
565
566 BOOL
567 WINAPI
568 UserLpkPSMTextOut(DWORD dw1, DWORD dw2, DWORD dw3, DWORD dw4, DWORD dw5, DWORD dw6)
569 {
570 UNIMPLEMENTED;
571 return FALSE;
572 }
573
574 BOOL
575 WINAPI
576 UserLpkTabbedTextOut(
577 DWORD dw1,
578 DWORD dw2,
579 DWORD dw3,
580 DWORD dw4,
581 DWORD dw5,
582 DWORD dw6,
583 DWORD dw7,
584 DWORD dw8,
585 DWORD dw9,
586 DWORD dw10,
587 DWORD dw11,
588 DWORD dw12)
589 {
590 UNIMPLEMENTED;
591 return FALSE;
592 }
593
594 BOOL
595 WINAPI
596 Win32PoolAllocationStats(DWORD dw1, DWORD dw2, DWORD dw3, DWORD dw4, DWORD dw5)
597 {
598 UNIMPLEMENTED;
599 return FALSE;
600 }
601