[CMAKE]
[reactos.git] / 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 <win32k.h>
12
13 #define NDEBUG
14 #include <debug.h>
15
16
17 /* registered Logon process */
18 PPROCESSINFO 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 = (PPROCESSINFO)Process->Win32Process;
45 }
46 else
47 {
48 /* Deregister the logon process */
49 if (LogonProcess != (PPROCESSINFO)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_MSQCLEARWAKEMASK:
114 RETURN( (DWORD_PTR)IntMsqClearWakeMask());
115
116 default:
117 DPRINT1("Calling invalid routine number 0x%x in NtUserCallNoParam\n", Routine);
118 SetLastWin32Error(ERROR_INVALID_PARAMETER);
119 break;
120 }
121 RETURN(Result);
122
123 CLEANUP:
124 DPRINT("Leave NtUserCallNoParam, ret=%i\n",_ret_);
125 UserLeave();
126 END_CLEANUP;
127 }
128
129
130 /*
131 * @implemented
132 */
133 DWORD_PTR
134 APIENTRY
135 NtUserCallOneParam(
136 DWORD_PTR Param,
137 DWORD Routine)
138 {
139 DECLARE_RETURN(DWORD_PTR);
140
141 DPRINT("Enter NtUserCallOneParam\n");
142
143 UserEnterExclusive();
144
145 switch(Routine)
146 {
147 case ONEPARAM_ROUTINE_POSTQUITMESSAGE:
148 {
149 PTHREADINFO pti;
150 pti = PsGetCurrentThreadWin32Thread();
151 MsqPostQuitMessage(pti->MessageQueue, Param);
152 RETURN(TRUE);
153 }
154 case ONEPARAM_ROUTINE_SHOWCURSOR:
155 RETURN( (DWORD_PTR)UserShowCursor((BOOL)Param) );
156
157 case ONEPARAM_ROUTINE_GETDESKTOPMAPPING:
158 {
159 PTHREADINFO ti;
160 ti = GetW32ThreadInfo();
161 if (ti != NULL)
162 {
163 /* Try convert the pointer to a user mode pointer if the desktop is
164 mapped into the process */
165 RETURN((DWORD_PTR)DesktopHeapAddressToUser((PVOID)Param));
166 }
167 else
168 {
169 RETURN(0);
170 }
171 }
172
173 case ONEPARAM_ROUTINE_WINDOWFROMDC:
174 RETURN( (DWORD_PTR)IntWindowFromDC((HDC)Param));
175
176 case ONEPARAM_ROUTINE_SWAPMOUSEBUTTON:
177 {
178 DWORD_PTR Result;
179
180 Result = gspv.bMouseBtnSwap;
181 gspv.bMouseBtnSwap = Param ? TRUE : FALSE;
182 gpsi->aiSysMet[SM_SWAPBUTTON] = gspv.bMouseBtnSwap;
183 RETURN(Result);
184 }
185
186 case ONEPARAM_ROUTINE_SWITCHCARETSHOWING:
187 RETURN( (DWORD_PTR)IntSwitchCaretShowing((PVOID)Param));
188
189 case ONEPARAM_ROUTINE_SETCARETBLINKTIME:
190 RETURN( (DWORD_PTR)IntSetCaretBlinkTime((UINT)Param));
191
192 case ONEPARAM_ROUTINE_SETMESSAGEEXTRAINFO:
193 RETURN( (DWORD_PTR)MsqSetMessageExtraInfo((LPARAM)Param));
194
195 case ONEPARAM_ROUTINE_CREATEEMPTYCUROBJECT:
196 {
197 PCURICON_OBJECT CurIcon;
198 DWORD_PTR Result ;
199
200 if (!(CurIcon = IntCreateCurIconHandle()))
201 {
202 SetLastWin32Error(ERROR_NOT_ENOUGH_MEMORY);
203 RETURN(0);
204 }
205
206 Result = (DWORD_PTR)CurIcon->Self;
207 UserDereferenceObject(CurIcon);
208 RETURN(Result);
209 }
210
211 case ONEPARAM_ROUTINE_GETCURSORPOSITION:
212 {
213 BOOL ret = TRUE;
214
215
216 _SEH2_TRY
217 {
218 ProbeForWrite((POINT*)Param,sizeof(POINT),1);
219 RtlCopyMemory((POINT*)Param,&gpsi->ptCursor,sizeof(POINT));
220 }
221 _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
222 {
223 SetLastNtError(_SEH2_GetExceptionCode());
224 ret = FALSE;
225 }
226 _SEH2_END;
227
228 RETURN (ret);
229 }
230
231 case ONEPARAM_ROUTINE_ISWINDOWINDESTROY:
232 {
233 PWND Window;
234 DWORD_PTR Result;
235
236 if(!(Window = UserGetWindowObject((HWND)Param)))
237 {
238 RETURN( FALSE);
239 }
240
241 Result = (DWORD_PTR)IntIsWindowInDestroy(Window);
242
243 RETURN( Result);
244 }
245
246 case ONEPARAM_ROUTINE_ENABLEPROCWNDGHSTING:
247 {
248 BOOL Enable;
249 PPROCESSINFO Process = PsGetCurrentProcessWin32Process();
250
251 if(Process != NULL)
252 {
253 Enable = (BOOL)(Param != 0);
254
255 if(Enable)
256 {
257 Process->W32PF_flags &= ~W32PF_NOWINDOWGHOSTING;
258 }
259 else
260 {
261 Process->W32PF_flags |= W32PF_NOWINDOWGHOSTING;
262 }
263
264 RETURN( TRUE);
265 }
266
267 RETURN( FALSE);
268 }
269
270 case ONEPARAM_ROUTINE_MSQSETWAKEMASK:
271 RETURN( (DWORD_PTR)IntMsqSetWakeMask(Param));
272
273 case ONEPARAM_ROUTINE_GETKEYBOARDTYPE:
274 RETURN( UserGetKeyboardType(Param));
275
276 case ONEPARAM_ROUTINE_GETKEYBOARDLAYOUT:
277 RETURN( (DWORD_PTR)UserGetKeyboardLayout(Param));
278
279 case ONEPARAM_ROUTINE_RELEASEDC:
280 RETURN (UserReleaseDC(NULL, (HDC) Param, FALSE));
281
282 case ONEPARAM_ROUTINE_REALIZEPALETTE:
283 RETURN (UserRealizePalette((HDC) Param));
284
285 case ONEPARAM_ROUTINE_GETQUEUESTATUS:
286 {
287 DWORD Ret;
288 WORD changed_bits, wake_bits;
289 Ret = IntGetQueueStatus(FALSE);
290 changed_bits = LOWORD(Ret);
291 wake_bits = HIWORD(Ret);
292 RETURN( MAKELONG(changed_bits & Param, wake_bits & Param));
293 }
294 case ONEPARAM_ROUTINE_ENUMCLIPBOARDFORMATS:
295 /* FIXME: Should use UserEnterShared */
296 RETURN(IntEnumClipboardFormats(Param));
297
298 case ONEPARAM_ROUTINE_CSRSS_GUICHECK:
299 IntUserManualGuiCheck(Param);
300 RETURN(TRUE);
301
302 case ONEPARAM_ROUTINE_GETCURSORPOS:
303 {
304 BOOL Ret = TRUE;
305 PPOINTL pptl;
306 PTHREADINFO pti = PsGetCurrentThreadWin32Thread();
307 if (pti->hdesk != InputDesktopHandle) RETURN(FALSE);
308 _SEH2_TRY
309 {
310 pptl = (PPOINTL)Param;
311 *pptl = gpsi->ptCursor;
312 }
313 _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
314 {
315 Ret = FALSE;
316 }
317 _SEH2_END;
318 RETURN(Ret);
319 }
320 case ONEPARAM_ROUTINE_SETPROCDEFLAYOUT:
321 {
322 PPROCESSINFO ppi;
323 if (Param & LAYOUT_ORIENTATIONMASK)
324 {
325 ppi = PsGetCurrentProcessWin32Process();
326 ppi->dwLayout = Param;
327 RETURN(TRUE);
328 }
329 SetLastWin32Error(ERROR_INVALID_PARAMETER);
330 RETURN(FALSE);
331 }
332 case ONEPARAM_ROUTINE_GETPROCDEFLAYOUT:
333 {
334 BOOL Ret = TRUE;
335 PPROCESSINFO ppi;
336 PDWORD pdwLayout;
337 if ( PsGetCurrentProcess() == CsrProcess)
338 {
339 SetLastWin32Error(ERROR_INVALID_ACCESS);
340 RETURN(FALSE);
341 }
342 ppi = PsGetCurrentProcessWin32Process();
343 _SEH2_TRY
344 {
345 pdwLayout = (PDWORD)Param;
346 *pdwLayout = ppi->dwLayout;
347 }
348 _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
349 {
350 SetLastNtError(_SEH2_GetExceptionCode());
351 Ret = FALSE;
352 }
353 _SEH2_END;
354 RETURN(Ret);
355 }
356 }
357 DPRINT1("Calling invalid routine number 0x%x in NtUserCallOneParam(), Param=0x%x\n",
358 Routine, Param);
359 SetLastWin32Error(ERROR_INVALID_PARAMETER);
360 RETURN( 0);
361
362 CLEANUP:
363 DPRINT("Leave NtUserCallOneParam, ret=%i\n",_ret_);
364 UserLeave();
365 END_CLEANUP;
366 }
367
368
369 /*
370 * @implemented
371 */
372 DWORD_PTR
373 APIENTRY
374 NtUserCallTwoParam(
375 DWORD_PTR Param1,
376 DWORD_PTR Param2,
377 DWORD Routine)
378 {
379 NTSTATUS Status;
380 PWND Window;
381 DECLARE_RETURN(DWORD_PTR);
382
383 DPRINT("Enter NtUserCallTwoParam\n");
384 UserEnterExclusive();
385
386 switch(Routine)
387 {
388 case TWOPARAM_ROUTINE_GETWINDOWRGNBOX:
389 {
390 DWORD_PTR Ret;
391 RECTL rcRect;
392 Window = UserGetWindowObject((HWND)Param1);
393 if (!Window) RETURN(ERROR);
394
395 Ret = (DWORD_PTR)IntGetWindowRgnBox(Window, &rcRect);
396 Status = MmCopyToCaller((PVOID)Param2, &rcRect, sizeof(RECT));
397 if(!NT_SUCCESS(Status))
398 {
399 SetLastNtError(Status);
400 RETURN( ERROR);
401 }
402 RETURN( Ret);
403 }
404 case TWOPARAM_ROUTINE_GETWINDOWRGN:
405 {
406 Window = UserGetWindowObject((HWND)Param1);
407 if (!Window) RETURN(ERROR);
408
409 RETURN( (DWORD_PTR)IntGetWindowRgn(Window, (HRGN)Param2));
410 }
411 case TWOPARAM_ROUTINE_SETMENUBARHEIGHT:
412 {
413 DWORD_PTR Ret;
414 PMENU_OBJECT MenuObject = IntGetMenuObject((HMENU)Param1);
415 if(!MenuObject)
416 RETURN( 0);
417
418 if(Param2 > 0)
419 {
420 Ret = (MenuObject->MenuInfo.Height == (int)Param2);
421 MenuObject->MenuInfo.Height = (int)Param2;
422 }
423 else
424 Ret = (DWORD_PTR)MenuObject->MenuInfo.Height;
425 IntReleaseMenuObject(MenuObject);
426 RETURN( Ret);
427 }
428
429 case TWOPARAM_ROUTINE_SETGUITHRDHANDLE:
430 {
431 PUSER_MESSAGE_QUEUE MsgQueue = ((PTHREADINFO)PsGetCurrentThread()->Tcb.Win32Thread)->MessageQueue;
432
433 ASSERT(MsgQueue);
434 RETURN( (DWORD_PTR)MsqSetStateWindow(MsgQueue, (ULONG)Param1, (HWND)Param2));
435 }
436
437 case TWOPARAM_ROUTINE_ENABLEWINDOW:
438 UNIMPLEMENTED
439 RETURN( 0);
440
441 case TWOPARAM_ROUTINE_SHOWOWNEDPOPUPS:
442 {
443 Window = UserGetWindowObject((HWND)Param1);
444 if (!Window) RETURN(0);
445
446 RETURN( (DWORD_PTR)IntShowOwnedPopups(Window, (BOOL) Param2));
447 }
448
449 case TWOPARAM_ROUTINE_ROS_UPDATEUISTATE:
450 {
451 WPARAM wParam;
452 Window = UserGetWindowObject((HWND)Param1);
453 if (!Window) RETURN(0);
454
455 /* Unpack wParam */
456 wParam = MAKEWPARAM((Param2 >> 3) & 0x3,
457 Param2 & (UISF_HIDEFOCUS | UISF_HIDEACCEL | UISF_ACTIVE));
458
459 RETURN( UserUpdateUiState(Window, wParam) );
460 }
461
462 case TWOPARAM_ROUTINE_SWITCHTOTHISWINDOW:
463 UNIMPLEMENTED
464 RETURN( 0);
465
466
467 case TWOPARAM_ROUTINE_SETCARETPOS:
468 RETURN( (DWORD_PTR)co_IntSetCaretPos((int)Param1, (int)Param2));
469
470 case TWOPARAM_ROUTINE_REGISTERLOGONPROC:
471 RETURN( (DWORD_PTR)co_IntRegisterLogonProcess((HANDLE)Param1, (BOOL)Param2));
472
473 case TWOPARAM_ROUTINE_SETCURSORPOS:
474 RETURN( (DWORD_PTR)UserSetCursorPos((int)Param1, (int)Param2, FALSE));
475
476 }
477 DPRINT1("Calling invalid routine number 0x%x in NtUserCallTwoParam(), Param1=0x%x Parm2=0x%x\n",
478 Routine, Param1, Param2);
479 SetLastWin32Error(ERROR_INVALID_PARAMETER);
480 RETURN( 0);
481
482 CLEANUP:
483 DPRINT("Leave NtUserCallTwoParam, ret=%i\n",_ret_);
484 UserLeave();
485 END_CLEANUP;
486 }
487
488
489 /*
490 * @unimplemented
491 */
492 BOOL
493 APIENTRY
494 NtUserCallHwndLock(
495 HWND hWnd,
496 DWORD Routine)
497 {
498 BOOL Ret = 0;
499 PWND Window;
500 USER_REFERENCE_ENTRY Ref;
501 DECLARE_RETURN(BOOLEAN);
502
503 DPRINT("Enter NtUserCallHwndLock\n");
504 UserEnterExclusive();
505
506 if (!(Window = UserGetWindowObject(hWnd)))
507 {
508 RETURN( FALSE);
509 }
510 UserRefObjectCo(Window, &Ref);
511
512 /* FIXME: Routine can be 0x53 - 0x5E */
513 switch (Routine)
514 {
515 case HWNDLOCK_ROUTINE_ARRANGEICONICWINDOWS:
516 co_WinPosArrangeIconicWindows(Window);
517 break;
518
519 case HWNDLOCK_ROUTINE_DRAWMENUBAR:
520 {
521 DPRINT("HWNDLOCK_ROUTINE_DRAWMENUBAR\n");
522 Ret = TRUE;
523 if ((Window->style & (WS_CHILD | WS_POPUP)) != WS_CHILD)
524 co_WinPosSetWindowPos( Window,
525 HWND_DESKTOP,
526 0,0,0,0,
527 SWP_NOSIZE|
528 SWP_NOMOVE|
529 SWP_NOZORDER|
530 SWP_NOACTIVATE|
531 SWP_FRAMECHANGED );
532 break;
533 }
534
535 case HWNDLOCK_ROUTINE_REDRAWFRAME:
536 co_WinPosSetWindowPos( Window,
537 HWND_DESKTOP,
538 0,0,0,0,
539 SWP_NOSIZE|
540 SWP_NOMOVE|
541 SWP_NOZORDER|
542 SWP_NOACTIVATE|
543 SWP_FRAMECHANGED );
544 Ret = TRUE;
545 break;
546
547 case HWNDLOCK_ROUTINE_REDRAWFRAMEANDHOOK:
548 co_WinPosSetWindowPos( Window,
549 HWND_DESKTOP,
550 0,0,0,0,
551 SWP_NOSIZE|
552 SWP_NOMOVE|
553 SWP_NOZORDER|
554 SWP_NOACTIVATE|
555 SWP_FRAMECHANGED );
556 if (!Window->spwndOwner && !IntGetParent(Window))
557 {
558 co_IntShellHookNotify(HSHELL_REDRAW, (LPARAM) hWnd);
559 }
560 Ret = TRUE;
561 break;
562
563 case HWNDLOCK_ROUTINE_SETFOREGROUNDWINDOW:
564 Ret = co_IntSetForegroundWindow(Window);
565 break;
566
567 case HWNDLOCK_ROUTINE_UPDATEWINDOW:
568 Ret = co_UserRedrawWindow( Window, NULL, 0, RDW_UPDATENOW | RDW_ALLCHILDREN);
569 break;
570 }
571
572 UserDerefObjectCo(Window);
573
574 RETURN( Ret);
575
576 CLEANUP:
577 DPRINT("Leave NtUserCallHwndLock, ret=%i\n",_ret_);
578 UserLeave();
579 END_CLEANUP;
580 }
581
582 /*
583 * @unimplemented
584 */
585 HWND
586 APIENTRY
587 NtUserCallHwndOpt(
588 HWND hWnd,
589 DWORD Routine)
590 {
591 switch (Routine)
592 {
593 case HWNDOPT_ROUTINE_SETPROGMANWINDOW:
594 GetW32ThreadInfo()->pDeskInfo->hProgmanWindow = hWnd;
595 break;
596
597 case HWNDOPT_ROUTINE_SETTASKMANWINDOW:
598 GetW32ThreadInfo()->pDeskInfo->hTaskManWindow = hWnd;
599 break;
600 }
601
602 return hWnd;
603 }
604
605 DWORD
606 APIENTRY
607 NtUserCallHwnd(
608 HWND hWnd,
609 DWORD Routine)
610 {
611 switch (Routine)
612 {
613 case HWND_ROUTINE_GETWNDCONTEXTHLPID:
614 {
615 PWND Window;
616 PPROPERTY HelpId;
617 USER_REFERENCE_ENTRY Ref;
618
619 UserEnterExclusive();
620
621 if (!(Window = UserGetWindowObject(hWnd)))
622 {
623 UserLeave();
624 return 0;
625 }
626 UserRefObjectCo(Window, &Ref);
627
628 HelpId = IntGetProp(Window, gpsi->atomContextHelpIdProp);
629
630 UserDerefObjectCo(Window);
631 UserLeave();
632 return (DWORD)HelpId;
633 }
634 case HWND_ROUTINE_REGISTERSHELLHOOKWINDOW:
635 if (IntIsWindow(hWnd))
636 return IntRegisterShellHookWindow(hWnd);
637 return FALSE;
638 break;
639 case HWND_ROUTINE_DEREGISTERSHELLHOOKWINDOW:
640 if (IntIsWindow(hWnd))
641 return IntDeRegisterShellHookWindow(hWnd);
642 return FALSE;
643 }
644 UNIMPLEMENTED;
645
646 return 0;
647 }
648
649 DWORD
650 APIENTRY
651 NtUserCallHwndParam(
652 HWND hWnd,
653 DWORD Param,
654 DWORD Routine)
655 {
656
657 switch (Routine)
658 {
659 case HWNDPARAM_ROUTINE_KILLSYSTEMTIMER:
660 return IntKillTimer(hWnd, (UINT_PTR)Param, TRUE);
661
662 case HWNDPARAM_ROUTINE_SETWNDCONTEXTHLPID:
663 {
664 PWND Window;
665
666 UserEnterExclusive();
667 if(!(Window = UserGetWindowObject(hWnd)))
668 {
669 UserLeave();
670 return FALSE;
671 }
672
673 if ( Param )
674 IntSetProp(Window, gpsi->atomContextHelpIdProp, (HANDLE)Param);
675 else
676 IntRemoveProp(Window, gpsi->atomContextHelpIdProp);
677
678 UserLeave();
679 return TRUE;
680 }
681
682 case HWNDPARAM_ROUTINE_SETDIALOGPOINTER:
683 {
684 PWND pWnd;
685 USER_REFERENCE_ENTRY Ref;
686
687 UserEnterExclusive();
688
689 if (!(pWnd = UserGetWindowObject(hWnd)))
690 {
691 UserLeave();
692 return 0;
693 }
694 UserRefObjectCo(pWnd, &Ref);
695
696 if (pWnd->head.pti->ppi == PsGetCurrentProcessWin32Process() &&
697 pWnd->cbwndExtra == DLGWINDOWEXTRA &&
698 !(pWnd->state & WNDS_SERVERSIDEWINDOWPROC))
699 {
700 if (Param)
701 {
702 if (!pWnd->fnid) pWnd->fnid = FNID_DIALOG;
703 pWnd->state |= WNDS_DIALOGWINDOW;
704 }
705 else
706 {
707 pWnd->fnid |= FNID_DESTROY;
708 pWnd->state &= ~WNDS_DIALOGWINDOW;
709 }
710 }
711
712 UserDerefObjectCo(pWnd);
713 UserLeave();
714 return 0;
715 }
716 }
717
718 UNIMPLEMENTED;
719
720 return 0;
721 }
722
723 DWORD
724 APIENTRY
725 NtUserCallHwndParamLock(
726 HWND hWnd,
727 DWORD Param,
728 DWORD Routine)
729 {
730 DWORD Ret = 0;
731 PWND Window;
732 USER_REFERENCE_ENTRY Ref;
733 DECLARE_RETURN(DWORD);
734
735 DPRINT1("Enter NtUserCallHwndParamLock\n");
736 UserEnterExclusive();
737
738 if (!(Window = UserGetWindowObject(hWnd)))
739 {
740 RETURN( FALSE);
741 }
742 UserRefObjectCo(Window, &Ref);
743
744 switch (Routine)
745 {
746 case TWOPARAM_ROUTINE_VALIDATERGN:
747 Ret = (DWORD)co_UserRedrawWindow( Window, NULL, (HRGN)Param, RDW_VALIDATE);
748 break;
749 }
750
751 UserDerefObjectCo(Window);
752
753 RETURN( Ret);
754
755 CLEANUP:
756 DPRINT1("Leave NtUserCallHwndParamLock, ret=%i\n",_ret_);
757 UserLeave();
758 END_CLEANUP;
759
760 }
761
762 /* EOF */