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