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