Sync to trunk head(r38096)
[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->Flags &= ~W32PF_NOWINDOWGHOSTING;
346 }
347 else
348 {
349 Process->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->kpi->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 DPRINT1("Calling invalid routine number 0x%x in NtUserCallOneParam(), Param=0x%x\n",
404 Routine, Param);
405 SetLastWin32Error(ERROR_INVALID_PARAMETER);
406 RETURN( 0);
407
408 CLEANUP:
409 DPRINT("Leave NtUserCallOneParam, ret=%i\n",_ret_);
410 UserLeave();
411 END_CLEANUP;
412 }
413
414
415 /*
416 * @implemented
417 */
418 DWORD_PTR
419 APIENTRY
420 NtUserCallTwoParam(
421 DWORD Param1,
422 DWORD Param2,
423 DWORD Routine)
424 {
425 NTSTATUS Status;
426 PWINDOW_OBJECT Window;
427 DECLARE_RETURN(DWORD_PTR);
428
429 DPRINT("Enter NtUserCallTwoParam\n");
430 UserEnterExclusive();
431
432 switch(Routine)
433 {
434 case TWOPARAM_ROUTINE_GETWINDOWRGNBOX:
435 {
436 DWORD_PTR Ret;
437 RECT rcRect;
438 Window = UserGetWindowObject((HWND)Param1);
439 if (!Window) RETURN(ERROR);
440
441 Ret = (DWORD_PTR)IntGetWindowRgnBox(Window, &rcRect);
442 Status = MmCopyToCaller((PVOID)Param2, &rcRect, sizeof(RECT));
443 if(!NT_SUCCESS(Status))
444 {
445 SetLastNtError(Status);
446 RETURN( ERROR);
447 }
448 RETURN( Ret);
449 }
450 case TWOPARAM_ROUTINE_GETWINDOWRGN:
451 {
452 Window = UserGetWindowObject((HWND)Param1);
453 if (!Window) RETURN(ERROR);
454
455 RETURN( (DWORD_PTR)IntGetWindowRgn(Window, (HRGN)Param2));
456 }
457 case TWOPARAM_ROUTINE_SETMENUBARHEIGHT:
458 {
459 DWORD_PTR Ret;
460 PMENU_OBJECT MenuObject = IntGetMenuObject((HMENU)Param1);
461 if(!MenuObject)
462 RETURN( 0);
463
464 if(Param2 > 0)
465 {
466 Ret = (MenuObject->MenuInfo.Height == (int)Param2);
467 MenuObject->MenuInfo.Height = (int)Param2;
468 }
469 else
470 Ret = (DWORD_PTR)MenuObject->MenuInfo.Height;
471 IntReleaseMenuObject(MenuObject);
472 RETURN( Ret);
473 }
474 case TWOPARAM_ROUTINE_SETMENUITEMRECT:
475 {
476 BOOL Ret;
477 SETMENUITEMRECT smir;
478 PMENU_OBJECT MenuObject = IntGetMenuObject((HMENU)Param1);
479 if(!MenuObject)
480 RETURN( 0);
481
482 if(!NT_SUCCESS(MmCopyFromCaller(&smir, (PVOID)Param2, sizeof(SETMENUITEMRECT))))
483 {
484 IntReleaseMenuObject(MenuObject);
485 RETURN( 0);
486 }
487
488 Ret = IntSetMenuItemRect(MenuObject, smir.uItem, smir.fByPosition, &smir.rcRect);
489
490 IntReleaseMenuObject(MenuObject);
491 RETURN( (DWORD_PTR)Ret);
492 }
493
494 case TWOPARAM_ROUTINE_SETGUITHRDHANDLE:
495 {
496 PUSER_MESSAGE_QUEUE MsgQueue = ((PTHREADINFO)PsGetCurrentThread()->Tcb.Win32Thread)->MessageQueue;
497
498 ASSERT(MsgQueue);
499 RETURN( (DWORD_PTR)MsqSetStateWindow(MsgQueue, (ULONG)Param1, (HWND)Param2));
500 }
501
502 case TWOPARAM_ROUTINE_ENABLEWINDOW:
503 UNIMPLEMENTED
504 RETURN( 0);
505
506 case TWOPARAM_ROUTINE_SHOWOWNEDPOPUPS:
507 {
508 Window = UserGetWindowObject((HWND)Param1);
509 if (!Window) RETURN(0);
510
511 RETURN( (DWORD_PTR)IntShowOwnedPopups(Window, (BOOL) Param2));
512 }
513
514 case TWOPARAM_ROUTINE_ROS_UPDATEUISTATE:
515 {
516 WPARAM wParam;
517 Window = UserGetWindowObject((HWND)Param1);
518 if (!Window) RETURN(0);
519
520 /* Unpack wParam */
521 wParam = MAKEWPARAM((Param2 >> 3) & 0x3,
522 Param2 & (UISF_HIDEFOCUS | UISF_HIDEACCEL | UISF_ACTIVE));
523
524 RETURN( UserUpdateUiState(Window->Wnd, wParam) );
525 }
526
527 case TWOPARAM_ROUTINE_SWITCHTOTHISWINDOW:
528 UNIMPLEMENTED
529 RETURN( 0);
530
531 case TWOPARAM_ROUTINE_SETWNDCONTEXTHLPID:
532
533 if(!(Window = UserGetWindowObject((HWND)Param1)))
534 {
535 RETURN( (DWORD_PTR)FALSE);
536 }
537
538 Window->Wnd->ContextHelpId = Param2;
539
540 RETURN( (DWORD_PTR)TRUE);
541
542 case TWOPARAM_ROUTINE_SETCARETPOS:
543 RETURN( (DWORD_PTR)co_IntSetCaretPos((int)Param1, (int)Param2));
544
545 case TWOPARAM_ROUTINE_GETWINDOWINFO:
546 {
547 WINDOWINFO wi;
548 DWORD_PTR Ret;
549
550 if(!(Window = UserGetWindowObject((HWND)Param1)))
551 {
552 RETURN( FALSE);
553 }
554
555 #if 0
556 /*
557 * According to WINE, Windows' doesn't check the cbSize field
558 */
559
560 Status = MmCopyFromCaller(&wi.cbSize, (PVOID)Param2, sizeof(wi.cbSize));
561 if(!NT_SUCCESS(Status))
562 {
563 SetLastNtError(Status);
564 RETURN( FALSE);
565 }
566
567 if(wi.cbSize != sizeof(WINDOWINFO))
568 {
569 SetLastWin32Error(ERROR_INVALID_PARAMETER);
570 RETURN( FALSE);
571 }
572 #endif
573
574 if((Ret = (DWORD_PTR)IntGetWindowInfo(Window, &wi)))
575 {
576 Status = MmCopyToCaller((PVOID)Param2, &wi, sizeof(WINDOWINFO));
577 if(!NT_SUCCESS(Status))
578 {
579 SetLastNtError(Status);
580 RETURN( FALSE);
581 }
582 }
583
584 RETURN( Ret);
585 }
586
587 case TWOPARAM_ROUTINE_REGISTERLOGONPROC:
588 RETURN( (DWORD_PTR)co_IntRegisterLogonProcess((HANDLE)Param1, (BOOL)Param2));
589
590 case TWOPARAM_ROUTINE_GETSYSCOLORBRUSHES:
591 case TWOPARAM_ROUTINE_GETSYSCOLORPENS:
592 case TWOPARAM_ROUTINE_GETSYSCOLORS:
593 {
594 DWORD_PTR Ret = 0;
595 union
596 {
597 PVOID Pointer;
598 HBRUSH *Brushes;
599 HPEN *Pens;
600 COLORREF *Colors;
601 } Buffer;
602
603 /* FIXME - we should make use of SEH here... */
604
605 Buffer.Pointer = ExAllocatePool(PagedPool, Param2 * sizeof(HANDLE));
606 if(Buffer.Pointer != NULL)
607 {
608 switch(Routine)
609 {
610 case TWOPARAM_ROUTINE_GETSYSCOLORBRUSHES:
611 Ret = (DWORD_PTR)IntGetSysColorBrushes(Buffer.Brushes, (UINT)Param2);
612 break;
613 case TWOPARAM_ROUTINE_GETSYSCOLORPENS:
614 Ret = (DWORD_PTR)IntGetSysColorPens(Buffer.Pens, (UINT)Param2);
615 break;
616 case TWOPARAM_ROUTINE_GETSYSCOLORS:
617 Ret = (DWORD_PTR)IntGetSysColors(Buffer.Colors, (UINT)Param2);
618 break;
619 default:
620 Ret = 0;
621 break;
622 }
623
624 if(Ret > 0)
625 {
626 Status = MmCopyToCaller((PVOID)Param1, Buffer.Pointer, Param2 * sizeof(HANDLE));
627 if(!NT_SUCCESS(Status))
628 {
629 SetLastNtError(Status);
630 Ret = 0;
631 }
632 }
633
634 ExFreePool(Buffer.Pointer);
635 }
636 RETURN( Ret);
637 }
638
639 case TWOPARAM_ROUTINE_ROS_REGSYSCLASSES:
640 {
641 DWORD_PTR Ret = 0;
642 DWORD Count = Param1;
643 PREGISTER_SYSCLASS RegSysClassArray = (PREGISTER_SYSCLASS)Param2;
644
645 if (Count != 0 && RegSysClassArray != NULL)
646 {
647 _SEH2_TRY
648 {
649 ProbeArrayForRead(RegSysClassArray,
650 sizeof(RegSysClassArray[0]),
651 Count,
652 2);
653
654 Ret = (DWORD_PTR)UserRegisterSystemClasses(Count,
655 RegSysClassArray);
656 }
657 _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
658 {
659 SetLastNtError(_SEH2_GetExceptionCode());
660 }
661 _SEH2_END;
662 }
663
664 RETURN( Ret);
665 }
666 }
667 DPRINT1("Calling invalid routine number 0x%x in NtUserCallTwoParam(), Param1=0x%x Parm2=0x%x\n",
668 Routine, Param1, Param2);
669 SetLastWin32Error(ERROR_INVALID_PARAMETER);
670 RETURN( 0);
671
672 CLEANUP:
673 DPRINT("Leave NtUserCallTwoParam, ret=%i\n",_ret_);
674 UserLeave();
675 END_CLEANUP;
676 }
677
678
679 /*
680 * @unimplemented
681 */
682 BOOL
683 APIENTRY
684 NtUserCallHwndLock(
685 HWND hWnd,
686 DWORD Routine)
687 {
688 BOOL Ret = 0;
689 PWINDOW_OBJECT Window;
690 PWINDOW Wnd;
691 USER_REFERENCE_ENTRY Ref;
692 DECLARE_RETURN(BOOLEAN);
693
694 DPRINT("Enter NtUserCallHwndLock\n");
695 UserEnterExclusive();
696
697 if (!(Window = UserGetWindowObject(hWnd)))
698 {
699 RETURN( FALSE);
700 }
701 UserRefObjectCo(Window, &Ref);
702
703 Wnd = Window->Wnd;
704
705 /* FIXME: Routine can be 0x53 - 0x5E */
706 switch (Routine)
707 {
708 case HWNDLOCK_ROUTINE_ARRANGEICONICWINDOWS:
709 co_WinPosArrangeIconicWindows(Window);
710 break;
711
712 case HWNDLOCK_ROUTINE_DRAWMENUBAR:
713 {
714 PMENU_OBJECT Menu;
715 DPRINT("HWNDLOCK_ROUTINE_DRAWMENUBAR\n");
716 Ret = FALSE;
717 if (!((Wnd->Style & (WS_CHILD | WS_POPUP)) != WS_CHILD))
718 break;
719
720 if(!(Menu = UserGetMenuObject((HMENU) Wnd->IDMenu)))
721 break;
722
723 Menu->MenuInfo.WndOwner = hWnd;
724 Menu->MenuInfo.Height = 0;
725
726 co_WinPosSetWindowPos(Window, 0, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE |
727 SWP_NOACTIVATE | SWP_NOZORDER | SWP_FRAMECHANGED );
728
729 Ret = TRUE;
730 break;
731 }
732
733 case HWNDLOCK_ROUTINE_REDRAWFRAME:
734 /* FIXME */
735 break;
736
737 case HWNDLOCK_ROUTINE_SETFOREGROUNDWINDOW:
738 Ret = co_IntSetForegroundWindow(Window);
739 break;
740
741 case HWNDLOCK_ROUTINE_UPDATEWINDOW:
742 /* FIXME */
743 break;
744 }
745
746 UserDerefObjectCo(Window);
747
748 RETURN( Ret);
749
750 CLEANUP:
751 DPRINT("Leave NtUserCallHwndLock, ret=%i\n",_ret_);
752 UserLeave();
753 END_CLEANUP;
754 }
755
756 /*
757 * @unimplemented
758 */
759 HWND
760 APIENTRY
761 NtUserCallHwndOpt(
762 HWND hWnd,
763 DWORD Routine)
764 {
765 switch (Routine)
766 {
767 case HWNDOPT_ROUTINE_SETPROGMANWINDOW:
768 GetW32ThreadInfo()->Desktop->hProgmanWindow = hWnd;
769 break;
770
771 case HWNDOPT_ROUTINE_SETTASKMANWINDOW:
772 GetW32ThreadInfo()->Desktop->hTaskManWindow = hWnd;
773 break;
774 }
775
776 return hWnd;
777 }
778
779 DWORD
780 APIENTRY
781 NtUserCallHwnd(
782 HWND hWnd,
783 DWORD Routine)
784 {
785 switch (Routine)
786 {
787 case HWND_ROUTINE_REGISTERSHELLHOOKWINDOW:
788 if (IntIsWindow(hWnd))
789 return IntRegisterShellHookWindow(hWnd);
790 return FALSE;
791 break;
792 case HWND_ROUTINE_DEREGISTERSHELLHOOKWINDOW:
793 if (IntIsWindow(hWnd))
794 return IntDeRegisterShellHookWindow(hWnd);
795 return FALSE;
796 }
797 UNIMPLEMENTED;
798
799 return 0;
800 }
801
802 DWORD
803 APIENTRY
804 NtUserCallHwndParam(
805 HWND hWnd,
806 DWORD Param,
807 DWORD Routine)
808 {
809
810 switch (Routine)
811 {
812 case HWNDPARAM_ROUTINE_KILLSYSTEMTIMER:
813 return IntKillTimer(hWnd, (UINT_PTR)Param, TRUE);
814 }
815
816 UNIMPLEMENTED;
817
818 return 0;
819 }
820
821 DWORD
822 APIENTRY
823 NtUserCallHwndParamLock(
824 HWND hWnd,
825 DWORD Param,
826 DWORD Routine)
827 {
828 UNIMPLEMENTED;
829
830 return 0;
831 }
832
833 /* EOF */