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