Sync trunk r40500
[reactos.git] / reactos / subsystems / win32 / win32k / ntuser / simplecall.c
1 /*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS kernel
4 * PURPOSE: NtUserCallXxx call stubs
5 * FILE: subsystem/win32/win32k/ntuser/simplecall.c
6 * PROGRAMER: Ge van Geldorp (ge@gse.nl)
7 * REVISION HISTORY:
8 * 2008/03/20 Split from misc.c
9 */
10
11 #include <w32k.h>
12
13 #define NDEBUG
14 #include <debug.h>
15
16
17 /* registered Logon process */
18 PW32PROCESS LogonProcess = NULL;
19
20 BOOL FASTCALL
21 co_IntRegisterLogonProcess(HANDLE ProcessId, BOOL Register)
22 {
23 PEPROCESS Process;
24 NTSTATUS Status;
25 CSR_API_MESSAGE Request;
26
27 Status = PsLookupProcessByProcessId(ProcessId,
28 &Process);
29 if (!NT_SUCCESS(Status))
30 {
31 SetLastWin32Error(RtlNtStatusToDosError(Status));
32 return FALSE;
33 }
34
35 if (Register)
36 {
37 /* Register the logon process */
38 if (LogonProcess != NULL)
39 {
40 ObDereferenceObject(Process);
41 return FALSE;
42 }
43
44 LogonProcess = (PW32PROCESS)Process->Win32Process;
45 }
46 else
47 {
48 /* Deregister the logon process */
49 if (LogonProcess != (PW32PROCESS)Process->Win32Process)
50 {
51 ObDereferenceObject(Process);
52 return FALSE;
53 }
54
55 LogonProcess = NULL;
56 }
57
58 ObDereferenceObject(Process);
59
60 Request.Type = MAKE_CSR_API(REGISTER_LOGON_PROCESS, CSR_GUI);
61 Request.Data.RegisterLogonProcessRequest.ProcessId = ProcessId;
62 Request.Data.RegisterLogonProcessRequest.Register = Register;
63
64 Status = co_CsrNotify(&Request);
65 if (! NT_SUCCESS(Status))
66 {
67 DPRINT1("Failed to register logon process with CSRSS\n");
68 return FALSE;
69 }
70
71 return TRUE;
72 }
73
74 /*
75 * @unimplemented
76 */
77 DWORD_PTR
78 APIENTRY
79 NtUserCallNoParam(DWORD Routine)
80 {
81 DWORD_PTR Result = 0;
82 DECLARE_RETURN(DWORD_PTR);
83
84 DPRINT("Enter NtUserCallNoParam\n");
85 UserEnterExclusive();
86
87 switch(Routine)
88 {
89 case NOPARAM_ROUTINE_CREATEMENU:
90 Result = (DWORD_PTR)UserCreateMenu(FALSE);
91 break;
92
93 case NOPARAM_ROUTINE_CREATEMENUPOPUP:
94 Result = (DWORD_PTR)UserCreateMenu(TRUE);
95 break;
96
97 case NOPARAM_ROUTINE_DESTROY_CARET:
98 Result = (DWORD_PTR)co_IntDestroyCaret(PsGetCurrentThread()->Tcb.Win32Thread);
99 break;
100
101 case NOPARAM_ROUTINE_INIT_MESSAGE_PUMP:
102 Result = (DWORD_PTR)IntInitMessagePumpHook();
103 break;
104
105 case NOPARAM_ROUTINE_UNINIT_MESSAGE_PUMP:
106 Result = (DWORD_PTR)IntUninitMessagePumpHook();
107 break;
108
109 case NOPARAM_ROUTINE_GETMESSAGEEXTRAINFO:
110 Result = (DWORD_PTR)MsqGetMessageExtraInfo();
111 break;
112
113 case NOPARAM_ROUTINE_ANYPOPUP:
114 Result = (DWORD_PTR)IntAnyPopup();
115 break;
116
117 case NOPARAM_ROUTINE_CSRSS_INITIALIZED:
118 Result = (DWORD_PTR)CsrInit();
119 break;
120
121 case NOPARAM_ROUTINE_MSQCLEARWAKEMASK:
122 RETURN( (DWORD_PTR)IntMsqClearWakeMask());
123
124 default:
125 DPRINT1("Calling invalid routine number 0x%x in NtUserCallNoParam\n", Routine);
126 SetLastWin32Error(ERROR_INVALID_PARAMETER);
127 break;
128 }
129 RETURN(Result);
130
131 CLEANUP:
132 DPRINT("Leave NtUserCallNoParam, ret=%i\n",_ret_);
133 UserLeave();
134 END_CLEANUP;
135 }
136
137
138 /*
139 * @implemented
140 */
141 DWORD_PTR
142 APIENTRY
143 NtUserCallOneParam(
144 DWORD Param,
145 DWORD Routine)
146 {
147 DECLARE_RETURN(DWORD_PTR);
148
149 DPRINT("Enter NtUserCallOneParam\n");
150
151 UserEnterExclusive();
152
153 switch(Routine)
154 {
155 case ONEPARAM_ROUTINE_SHOWCURSOR:
156 RETURN( (DWORD_PTR)UserShowCursor((BOOL)Param) );
157
158 case ONEPARAM_ROUTINE_GETDESKTOPMAPPING:
159 {
160 PW32THREADINFO ti;
161 ti = GetW32ThreadInfo();
162 if (ti != NULL)
163 {
164 /* Try convert the pointer to a user mode pointer if the desktop is
165 mapped into the process */
166 RETURN((DWORD_PTR)DesktopHeapAddressToUser((PVOID)Param));
167 }
168 else
169 {
170 RETURN(0);
171 }
172 }
173
174 case ONEPARAM_ROUTINE_GETMENU:
175 {
176 PWINDOW_OBJECT Window;
177 DWORD_PTR Result;
178
179 if(!(Window = UserGetWindowObject((HWND)Param)))
180 {
181 RETURN( FALSE);
182 }
183
184 Result = Window->Wnd->IDMenu;
185
186 RETURN( Result);
187 }
188
189 case ONEPARAM_ROUTINE_ISWINDOWUNICODE:
190 {
191 PWINDOW_OBJECT Window;
192 DWORD_PTR Result;
193
194 Window = UserGetWindowObject((HWND)Param);
195 if(!Window)
196 {
197 RETURN( FALSE);
198 }
199 Result = Window->Wnd->Unicode;
200 RETURN( Result);
201 }
202
203 case ONEPARAM_ROUTINE_WINDOWFROMDC:
204 RETURN( (DWORD_PTR)IntWindowFromDC((HDC)Param));
205
206 case ONEPARAM_ROUTINE_GETWNDCONTEXTHLPID:
207 {
208 PWINDOW_OBJECT Window;
209 DWORD_PTR Result;
210
211 Window = UserGetWindowObject((HWND)Param);
212 if(!Window)
213 {
214 RETURN( FALSE);
215 }
216
217 Result = Window->Wnd->ContextHelpId;
218
219 RETURN( Result);
220 }
221
222 case ONEPARAM_ROUTINE_SWAPMOUSEBUTTON:
223 {
224 PWINSTATION_OBJECT WinSta;
225 NTSTATUS Status;
226 DWORD_PTR Result;
227
228 Status = IntValidateWindowStationHandle(PsGetCurrentProcess()->Win32WindowStation,
229 KernelMode,
230 0,
231 &WinSta);
232 if (!NT_SUCCESS(Status))
233 RETURN( (DWORD_PTR)FALSE);
234
235 /* FIXME
236 Result = (DWORD_PTR)IntSwapMouseButton(WinStaObject, (BOOL)Param); */
237 Result = 0;
238
239 ObDereferenceObject(WinSta);
240 RETURN( Result);
241 }
242
243 case ONEPARAM_ROUTINE_SWITCHCARETSHOWING:
244 RETURN( (DWORD_PTR)IntSwitchCaretShowing((PVOID)Param));
245
246 case ONEPARAM_ROUTINE_SETCARETBLINKTIME:
247 RETURN( (DWORD_PTR)IntSetCaretBlinkTime((UINT)Param));
248
249 case ONEPARAM_ROUTINE_GETWINDOWINSTANCE:
250 {
251 PWINDOW_OBJECT Window;
252 DWORD Result;
253
254 if(!(Window = UserGetWindowObject((HWND)Param)))
255 {
256 RETURN( FALSE);
257 }
258
259 Result = (DWORD_PTR)Window->Wnd->Instance;
260 RETURN( Result);
261 }
262
263 case ONEPARAM_ROUTINE_SETMESSAGEEXTRAINFO:
264 RETURN( (DWORD_PTR)MsqSetMessageExtraInfo((LPARAM)Param));
265
266 case ONEPARAM_ROUTINE_CREATECURICONHANDLE:
267 {
268 PCURICON_OBJECT CurIcon;
269 PWINSTATION_OBJECT WinSta;
270
271 WinSta = IntGetWinStaObj();
272 if(WinSta == NULL)
273 {
274 RETURN(0);
275 }
276
277 if (!(CurIcon = IntCreateCurIconHandle(WinSta)))
278 {
279 SetLastWin32Error(ERROR_NOT_ENOUGH_MEMORY);
280 ObDereferenceObject(WinSta);
281 RETURN(0);
282 }
283
284 ObDereferenceObject(WinSta);
285 RETURN((DWORD_PTR)CurIcon->Self);
286 }
287
288 case ONEPARAM_ROUTINE_GETCURSORPOSITION:
289 {
290 PWINSTATION_OBJECT WinSta;
291 NTSTATUS Status;
292 POINT Pos;
293
294 if(!Param)
295 RETURN( (DWORD_PTR)FALSE);
296 Status = IntValidateWindowStationHandle(PsGetCurrentProcess()->Win32WindowStation,
297 KernelMode,
298 0,
299 &WinSta);
300 if (!NT_SUCCESS(Status))
301 RETURN( (DWORD_PTR)FALSE);
302
303 /* FIXME - check if process has WINSTA_READATTRIBUTES */
304 IntGetCursorLocation(WinSta, &Pos);
305
306 Status = MmCopyToCaller((PPOINT)Param, &Pos, sizeof(POINT));
307 if(!NT_SUCCESS(Status))
308 {
309 ObDereferenceObject(WinSta);
310 SetLastNtError(Status);
311 RETURN( FALSE);
312 }
313
314 ObDereferenceObject(WinSta);
315
316 RETURN( (DWORD_PTR)TRUE);
317 }
318
319 case ONEPARAM_ROUTINE_ISWINDOWINDESTROY:
320 {
321 PWINDOW_OBJECT Window;
322 DWORD_PTR Result;
323
324 if(!(Window = UserGetWindowObject((HWND)Param)))
325 {
326 RETURN( FALSE);
327 }
328
329 Result = (DWORD_PTR)IntIsWindowInDestroy(Window);
330
331 RETURN( Result);
332 }
333
334 case ONEPARAM_ROUTINE_ENABLEPROCWNDGHSTING:
335 {
336 BOOL Enable;
337 PW32PROCESS Process = PsGetCurrentProcessWin32Process();
338
339 if(Process != NULL)
340 {
341 Enable = (BOOL)(Param != 0);
342
343 if(Enable)
344 {
345 Process->W32PF_flags &= ~W32PF_NOWINDOWGHOSTING;
346 }
347 else
348 {
349 Process->W32PF_flags |= W32PF_NOWINDOWGHOSTING;
350 }
351
352 RETURN( TRUE);
353 }
354
355 RETURN( FALSE);
356 }
357
358 case ONEPARAM_ROUTINE_MSQSETWAKEMASK:
359 RETURN( (DWORD_PTR)IntMsqSetWakeMask(Param));
360
361 case ONEPARAM_ROUTINE_GETKEYBOARDTYPE:
362 RETURN( UserGetKeyboardType(Param));
363
364 case ONEPARAM_ROUTINE_GETKEYBOARDLAYOUT:
365 RETURN( (DWORD_PTR)UserGetKeyboardLayout(Param));
366
367 case ONEPARAM_ROUTINE_REGISTERUSERMODULE:
368 {
369 PW32THREADINFO ti;
370
371 ti = GetW32ThreadInfo();
372 if (ti == NULL)
373 {
374 DPRINT1("Cannot register user32 module instance!\n");
375 SetLastWin32Error(ERROR_INVALID_PARAMETER);
376 RETURN(FALSE);
377 }
378
379 if (InterlockedCompareExchangePointer(&ti->ppi->hModUser,
380 (HINSTANCE)Param,
381 NULL) == NULL)
382 {
383 RETURN(TRUE);
384 }
385 }
386 case ONEPARAM_ROUTINE_RELEASEDC:
387 RETURN (UserReleaseDC(NULL, (HDC) Param, FALSE));
388
389 case ONEPARAM_ROUTINE_REALIZEPALETTE:
390 RETURN (UserRealizePalette((HDC) Param));
391
392 case ONEPARAM_ROUTINE_GETQUEUESTATUS:
393 RETURN (IntGetQueueStatus((BOOL) Param));
394
395 case ONEPARAM_ROUTINE_ENUMCLIPBOARDFORMATS:
396 /* FIXME: Should use UserEnterShared */
397 RETURN(IntEnumClipboardFormats(Param));
398
399 case ONEPARAM_ROUTINE_CSRSS_GUICHECK:
400 IntUserManualGuiCheck(Param);
401 RETURN(TRUE);
402
403 case ONEPARAM_ROUTINE_GETCURSORPOS:
404 {
405 BOOL Ret = TRUE;
406 PPOINTL pptl;
407 PTHREADINFO pti = PsGetCurrentThreadWin32Thread();
408 if (pti->hDesktop != InputDesktopHandle) RETURN(FALSE);
409 _SEH2_TRY
410 {
411 pptl = (PPOINTL)Param;
412 *pptl = gpsi->ptCursor;
413 }
414 _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
415 {
416 Ret = FALSE;
417 }
418 _SEH2_END;
419 RETURN(Ret);
420 }
421 }
422 DPRINT1("Calling invalid routine number 0x%x in NtUserCallOneParam(), Param=0x%x\n",
423 Routine, Param);
424 SetLastWin32Error(ERROR_INVALID_PARAMETER);
425 RETURN( 0);
426
427 CLEANUP:
428 DPRINT("Leave NtUserCallOneParam, ret=%i\n",_ret_);
429 UserLeave();
430 END_CLEANUP;
431 }
432
433
434 /*
435 * @implemented
436 */
437 DWORD_PTR
438 APIENTRY
439 NtUserCallTwoParam(
440 DWORD Param1,
441 DWORD Param2,
442 DWORD Routine)
443 {
444 NTSTATUS Status;
445 PWINDOW_OBJECT Window;
446 DECLARE_RETURN(DWORD_PTR);
447
448 DPRINT("Enter NtUserCallTwoParam\n");
449 UserEnterExclusive();
450
451 switch(Routine)
452 {
453 case TWOPARAM_ROUTINE_GETWINDOWRGNBOX:
454 {
455 DWORD_PTR Ret;
456 RECTL rcRect;
457 Window = UserGetWindowObject((HWND)Param1);
458 if (!Window) RETURN(ERROR);
459
460 Ret = (DWORD_PTR)IntGetWindowRgnBox(Window, &rcRect);
461 Status = MmCopyToCaller((PVOID)Param2, &rcRect, sizeof(RECT));
462 if(!NT_SUCCESS(Status))
463 {
464 SetLastNtError(Status);
465 RETURN( ERROR);
466 }
467 RETURN( Ret);
468 }
469 case TWOPARAM_ROUTINE_GETWINDOWRGN:
470 {
471 Window = UserGetWindowObject((HWND)Param1);
472 if (!Window) RETURN(ERROR);
473
474 RETURN( (DWORD_PTR)IntGetWindowRgn(Window, (HRGN)Param2));
475 }
476 case TWOPARAM_ROUTINE_SETMENUBARHEIGHT:
477 {
478 DWORD_PTR Ret;
479 PMENU_OBJECT MenuObject = IntGetMenuObject((HMENU)Param1);
480 if(!MenuObject)
481 RETURN( 0);
482
483 if(Param2 > 0)
484 {
485 Ret = (MenuObject->MenuInfo.Height == (int)Param2);
486 MenuObject->MenuInfo.Height = (int)Param2;
487 }
488 else
489 Ret = (DWORD_PTR)MenuObject->MenuInfo.Height;
490 IntReleaseMenuObject(MenuObject);
491 RETURN( Ret);
492 }
493 case TWOPARAM_ROUTINE_SETMENUITEMRECT:
494 {
495 BOOL Ret;
496 SETMENUITEMRECT smir;
497 PMENU_OBJECT MenuObject = IntGetMenuObject((HMENU)Param1);
498 if(!MenuObject)
499 RETURN( 0);
500
501 if(!NT_SUCCESS(MmCopyFromCaller(&smir, (PVOID)Param2, sizeof(SETMENUITEMRECT))))
502 {
503 IntReleaseMenuObject(MenuObject);
504 RETURN( 0);
505 }
506
507 Ret = IntSetMenuItemRect(MenuObject, smir.uItem, smir.fByPosition, &smir.rcRect);
508
509 IntReleaseMenuObject(MenuObject);
510 RETURN( (DWORD_PTR)Ret);
511 }
512
513 case TWOPARAM_ROUTINE_SETGUITHRDHANDLE:
514 {
515 PUSER_MESSAGE_QUEUE MsgQueue = ((PTHREADINFO)PsGetCurrentThread()->Tcb.Win32Thread)->MessageQueue;
516
517 ASSERT(MsgQueue);
518 RETURN( (DWORD_PTR)MsqSetStateWindow(MsgQueue, (ULONG)Param1, (HWND)Param2));
519 }
520
521 case TWOPARAM_ROUTINE_ENABLEWINDOW:
522 UNIMPLEMENTED
523 RETURN( 0);
524
525 case TWOPARAM_ROUTINE_SHOWOWNEDPOPUPS:
526 {
527 Window = UserGetWindowObject((HWND)Param1);
528 if (!Window) RETURN(0);
529
530 RETURN( (DWORD_PTR)IntShowOwnedPopups(Window, (BOOL) Param2));
531 }
532
533 case TWOPARAM_ROUTINE_ROS_UPDATEUISTATE:
534 {
535 WPARAM wParam;
536 Window = UserGetWindowObject((HWND)Param1);
537 if (!Window) RETURN(0);
538
539 /* Unpack wParam */
540 wParam = MAKEWPARAM((Param2 >> 3) & 0x3,
541 Param2 & (UISF_HIDEFOCUS | UISF_HIDEACCEL | UISF_ACTIVE));
542
543 RETURN( UserUpdateUiState(Window->Wnd, wParam) );
544 }
545
546 case TWOPARAM_ROUTINE_SWITCHTOTHISWINDOW:
547 UNIMPLEMENTED
548 RETURN( 0);
549
550 case TWOPARAM_ROUTINE_SETWNDCONTEXTHLPID:
551
552 if(!(Window = UserGetWindowObject((HWND)Param1)))
553 {
554 RETURN( (DWORD_PTR)FALSE);
555 }
556
557 Window->Wnd->ContextHelpId = Param2;
558
559 RETURN( (DWORD_PTR)TRUE);
560
561 case TWOPARAM_ROUTINE_SETCARETPOS:
562 RETURN( (DWORD_PTR)co_IntSetCaretPos((int)Param1, (int)Param2));
563
564 case TWOPARAM_ROUTINE_GETWINDOWINFO:
565 {
566 WINDOWINFO wi;
567 DWORD_PTR Ret;
568
569 if(!(Window = UserGetWindowObject((HWND)Param1)))
570 {
571 RETURN( FALSE);
572 }
573
574 #if 0
575 /*
576 * According to WINE, Windows' doesn't check the cbSize field
577 */
578
579 Status = MmCopyFromCaller(&wi.cbSize, (PVOID)Param2, sizeof(wi.cbSize));
580 if(!NT_SUCCESS(Status))
581 {
582 SetLastNtError(Status);
583 RETURN( FALSE);
584 }
585
586 if(wi.cbSize != sizeof(WINDOWINFO))
587 {
588 SetLastWin32Error(ERROR_INVALID_PARAMETER);
589 RETURN( FALSE);
590 }
591 #endif
592
593 if((Ret = (DWORD_PTR)IntGetWindowInfo(Window, &wi)))
594 {
595 Status = MmCopyToCaller((PVOID)Param2, &wi, sizeof(WINDOWINFO));
596 if(!NT_SUCCESS(Status))
597 {
598 SetLastNtError(Status);
599 RETURN( FALSE);
600 }
601 }
602
603 RETURN( Ret);
604 }
605
606 case TWOPARAM_ROUTINE_REGISTERLOGONPROC:
607 RETURN( (DWORD_PTR)co_IntRegisterLogonProcess((HANDLE)Param1, (BOOL)Param2));
608
609 case TWOPARAM_ROUTINE_GETSYSCOLORBRUSHES:
610 case TWOPARAM_ROUTINE_GETSYSCOLORPENS:
611 case TWOPARAM_ROUTINE_GETSYSCOLORS:
612 {
613 DWORD_PTR Ret = 0;
614 union
615 {
616 PVOID Pointer;
617 HBRUSH *Brushes;
618 HPEN *Pens;
619 COLORREF *Colors;
620 } Buffer;
621
622 /* FIXME - we should make use of SEH here... */
623
624 Buffer.Pointer = ExAllocatePool(PagedPool, Param2 * sizeof(HANDLE));
625 if(Buffer.Pointer != NULL)
626 {
627 switch(Routine)
628 {
629 case TWOPARAM_ROUTINE_GETSYSCOLORBRUSHES:
630 Ret = (DWORD_PTR)IntGetSysColorBrushes(Buffer.Brushes, (UINT)Param2);
631 break;
632 case TWOPARAM_ROUTINE_GETSYSCOLORPENS:
633 Ret = (DWORD_PTR)IntGetSysColorPens(Buffer.Pens, (UINT)Param2);
634 break;
635 case TWOPARAM_ROUTINE_GETSYSCOLORS:
636 Ret = (DWORD_PTR)IntGetSysColors(Buffer.Colors, (UINT)Param2);
637 break;
638 default:
639 Ret = 0;
640 break;
641 }
642
643 if(Ret > 0)
644 {
645 Status = MmCopyToCaller((PVOID)Param1, Buffer.Pointer, Param2 * sizeof(HANDLE));
646 if(!NT_SUCCESS(Status))
647 {
648 SetLastNtError(Status);
649 Ret = 0;
650 }
651 }
652
653 ExFreePool(Buffer.Pointer);
654 }
655 RETURN( Ret);
656 }
657
658 case TWOPARAM_ROUTINE_ROS_REGSYSCLASSES:
659 {
660 DWORD_PTR Ret = 0;
661 DWORD Count = Param1;
662 PREGISTER_SYSCLASS RegSysClassArray = (PREGISTER_SYSCLASS)Param2;
663
664 if (Count != 0 && RegSysClassArray != NULL)
665 {
666 _SEH2_TRY
667 {
668 ProbeArrayForRead(RegSysClassArray,
669 sizeof(RegSysClassArray[0]),
670 Count,
671 2);
672
673 Ret = (DWORD_PTR)UserRegisterSystemClasses(Count,
674 RegSysClassArray);
675 }
676 _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
677 {
678 SetLastNtError(_SEH2_GetExceptionCode());
679 }
680 _SEH2_END;
681 }
682
683 RETURN( Ret);
684 }
685 }
686 DPRINT1("Calling invalid routine number 0x%x in NtUserCallTwoParam(), Param1=0x%x Parm2=0x%x\n",
687 Routine, Param1, Param2);
688 SetLastWin32Error(ERROR_INVALID_PARAMETER);
689 RETURN( 0);
690
691 CLEANUP:
692 DPRINT("Leave NtUserCallTwoParam, ret=%i\n",_ret_);
693 UserLeave();
694 END_CLEANUP;
695 }
696
697
698 /*
699 * @unimplemented
700 */
701 BOOL
702 APIENTRY
703 NtUserCallHwndLock(
704 HWND hWnd,
705 DWORD Routine)
706 {
707 BOOL Ret = 0;
708 PWINDOW_OBJECT Window;
709 PWINDOW Wnd;
710 USER_REFERENCE_ENTRY Ref;
711 DECLARE_RETURN(BOOLEAN);
712
713 DPRINT("Enter NtUserCallHwndLock\n");
714 UserEnterExclusive();
715
716 if (!(Window = UserGetWindowObject(hWnd)) || !Window->Wnd)
717 {
718 RETURN( FALSE);
719 }
720 UserRefObjectCo(Window, &Ref);
721
722 Wnd = Window->Wnd;
723
724 /* FIXME: Routine can be 0x53 - 0x5E */
725 switch (Routine)
726 {
727 case HWNDLOCK_ROUTINE_ARRANGEICONICWINDOWS:
728 co_WinPosArrangeIconicWindows(Window);
729 break;
730
731 case HWNDLOCK_ROUTINE_DRAWMENUBAR:
732 {
733 PMENU_OBJECT Menu;
734 DPRINT("HWNDLOCK_ROUTINE_DRAWMENUBAR\n");
735 Ret = FALSE;
736 if (!((Wnd->Style & (WS_CHILD | WS_POPUP)) != WS_CHILD))
737 break;
738
739 if(!(Menu = UserGetMenuObject((HMENU) Wnd->IDMenu)))
740 break;
741
742 Menu->MenuInfo.WndOwner = hWnd;
743 Menu->MenuInfo.Height = 0;
744
745 co_WinPosSetWindowPos( Window,
746 HWND_DESKTOP,
747 0,0,0,0,
748 SWP_NOSIZE|
749 SWP_NOMOVE|
750 SWP_NOZORDER|
751 SWP_NOACTIVATE|
752 SWP_FRAMECHANGED );
753
754 Ret = TRUE;
755 break;
756 }
757
758 case HWNDLOCK_ROUTINE_REDRAWFRAME:
759 co_WinPosSetWindowPos( Window,
760 HWND_DESKTOP,
761 0,0,0,0,
762 SWP_NOSIZE|
763 SWP_NOMOVE|
764 SWP_NOZORDER|
765 SWP_NOACTIVATE|
766 SWP_FRAMECHANGED );
767 Ret = TRUE;
768 break;
769
770 case HWNDLOCK_ROUTINE_REDRAWFRAMEANDHOOK:
771 co_WinPosSetWindowPos( Window,
772 HWND_DESKTOP,
773 0,0,0,0,
774 SWP_NOSIZE|
775 SWP_NOMOVE|
776 SWP_NOZORDER|
777 SWP_NOACTIVATE|
778 SWP_FRAMECHANGED );
779 if (!IntGetOwner(Window) && !IntGetParent(Window))
780 {
781 co_IntShellHookNotify(HSHELL_REDRAW, (LPARAM) hWnd);
782 }
783 Ret = TRUE;
784 break;
785
786 case HWNDLOCK_ROUTINE_SETFOREGROUNDWINDOW:
787 Ret = co_IntSetForegroundWindow(Window);
788 break;
789
790 case HWNDLOCK_ROUTINE_UPDATEWINDOW:
791 Ret = co_UserRedrawWindow( Window, NULL, 0, RDW_UPDATENOW | RDW_ALLCHILDREN);
792 break;
793 }
794
795 UserDerefObjectCo(Window);
796
797 RETURN( Ret);
798
799 CLEANUP:
800 DPRINT("Leave NtUserCallHwndLock, ret=%i\n",_ret_);
801 UserLeave();
802 END_CLEANUP;
803 }
804
805 /*
806 * @unimplemented
807 */
808 HWND
809 APIENTRY
810 NtUserCallHwndOpt(
811 HWND hWnd,
812 DWORD Routine)
813 {
814 switch (Routine)
815 {
816 case HWNDOPT_ROUTINE_SETPROGMANWINDOW:
817 GetW32ThreadInfo()->pDeskInfo->hProgmanWindow = hWnd;
818 break;
819
820 case HWNDOPT_ROUTINE_SETTASKMANWINDOW:
821 GetW32ThreadInfo()->pDeskInfo->hTaskManWindow = hWnd;
822 break;
823 }
824
825 return hWnd;
826 }
827
828 DWORD
829 APIENTRY
830 NtUserCallHwnd(
831 HWND hWnd,
832 DWORD Routine)
833 {
834 switch (Routine)
835 {
836 case HWND_ROUTINE_REGISTERSHELLHOOKWINDOW:
837 if (IntIsWindow(hWnd))
838 return IntRegisterShellHookWindow(hWnd);
839 return FALSE;
840 break;
841 case HWND_ROUTINE_DEREGISTERSHELLHOOKWINDOW:
842 if (IntIsWindow(hWnd))
843 return IntDeRegisterShellHookWindow(hWnd);
844 return FALSE;
845 }
846 UNIMPLEMENTED;
847
848 return 0;
849 }
850
851 DWORD
852 APIENTRY
853 NtUserCallHwndParam(
854 HWND hWnd,
855 DWORD Param,
856 DWORD Routine)
857 {
858
859 switch (Routine)
860 {
861 case HWNDPARAM_ROUTINE_KILLSYSTEMTIMER:
862 return IntKillTimer(hWnd, (UINT_PTR)Param, TRUE);
863 }
864
865 UNIMPLEMENTED;
866
867 return 0;
868 }
869
870 DWORD
871 APIENTRY
872 NtUserCallHwndParamLock(
873 HWND hWnd,
874 DWORD Param,
875 DWORD Routine)
876 {
877 UNIMPLEMENTED;
878
879 return 0;
880 }
881
882 /* EOF */