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