ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

simplecall.c
Go to the documentation of this file.
00001 /*
00002  * COPYRIGHT:        See COPYING in the top level directory
00003  * PROJECT:          ReactOS kernel
00004  * PURPOSE:          NtUserCallXxx call stubs
00005  * FILE:             subsystem/win32/win32k/ntuser/simplecall.c
00006  * PROGRAMER:        Ge van Geldorp (ge@gse.nl)
00007  */
00008 
00009 #include <win32k.h>
00010 DBG_DEFAULT_CHANNEL(UserMisc);
00011 
00012 /* registered Logon process */
00013 PPROCESSINFO LogonProcess = NULL;
00014 
00015 BOOL FASTCALL
00016 co_IntRegisterLogonProcess(HANDLE ProcessId, BOOL Register)
00017 {
00018    PEPROCESS Process;
00019    NTSTATUS Status;
00020    CSR_API_MESSAGE Request;
00021 
00022    Status = PsLookupProcessByProcessId(ProcessId,
00023                                        &Process);
00024    if (!NT_SUCCESS(Status))
00025    {
00026       EngSetLastError(RtlNtStatusToDosError(Status));
00027       return FALSE;
00028    }
00029 
00030    if (Register)
00031    {
00032       /* Register the logon process */
00033       if (LogonProcess != NULL)
00034       {
00035          ObDereferenceObject(Process);
00036          return FALSE;
00037       }
00038 
00039       LogonProcess = (PPROCESSINFO)Process->Win32Process;
00040    }
00041    else
00042    {
00043       /* Deregister the logon process */
00044       if (LogonProcess != (PPROCESSINFO)Process->Win32Process)
00045       {
00046          ObDereferenceObject(Process);
00047          return FALSE;
00048       }
00049 
00050       LogonProcess = NULL;
00051    }
00052 
00053    ObDereferenceObject(Process);
00054 
00055    Request.Type = MAKE_CSR_API(REGISTER_LOGON_PROCESS, CSR_GUI);
00056    Request.Data.RegisterLogonProcessRequest.ProcessId = ProcessId;
00057    Request.Data.RegisterLogonProcessRequest.Register = Register;
00058 
00059    Status = co_CsrNotify(&Request);
00060    if (! NT_SUCCESS(Status))
00061    {
00062       ERR("Failed to register logon process with CSRSS\n");
00063       return FALSE;
00064    }
00065 
00066    return TRUE;
00067 }
00068 
00069 /*
00070  * @unimplemented
00071  */
00072 DWORD_PTR
00073 APIENTRY
00074 NtUserCallNoParam(DWORD Routine)
00075 {
00076    DWORD_PTR Result = 0;
00077    DECLARE_RETURN(DWORD_PTR);
00078 
00079    TRACE("Enter NtUserCallNoParam\n");
00080    UserEnterExclusive();
00081 
00082    switch(Routine)
00083    {
00084       case NOPARAM_ROUTINE_CREATEMENU:
00085          Result = (DWORD_PTR)UserCreateMenu(FALSE);
00086          break;
00087 
00088       case NOPARAM_ROUTINE_CREATEMENUPOPUP:
00089          Result = (DWORD_PTR)UserCreateMenu(TRUE);
00090          break;
00091 
00092       case NOPARAM_ROUTINE_DESTROY_CARET:
00093          Result = (DWORD_PTR)co_IntDestroyCaret(PsGetCurrentThread()->Tcb.Win32Thread);
00094          break;
00095 
00096       case NOPARAM_ROUTINE_INIT_MESSAGE_PUMP:
00097          Result = (DWORD_PTR)IntInitMessagePumpHook();
00098          break;
00099 
00100       case NOPARAM_ROUTINE_UNINIT_MESSAGE_PUMP:
00101          Result = (DWORD_PTR)IntUninitMessagePumpHook();
00102          break;
00103 
00104       case NOPARAM_ROUTINE_GETMESSAGEEXTRAINFO:
00105          Result = (DWORD_PTR)MsqGetMessageExtraInfo();
00106          break;
00107 
00108       case NOPARAM_ROUTINE_MSQCLEARWAKEMASK:
00109          RETURN( (DWORD_PTR)IntMsqClearWakeMask());
00110 
00111       case NOPARAM_ROUTINE_GETMSESSAGEPOS:
00112       {
00113          PTHREADINFO pti = PsGetCurrentThreadWin32Thread();
00114          RETURN( (DWORD_PTR)MAKELONG(pti->ptLast.x, pti->ptLast.y));
00115       }
00116 
00117       case NOPARAM_ROUTINE_RELEASECAPTURE:
00118          RETURN( (DWORD_PTR)IntReleaseCapture());
00119 
00120       case NOPARAM_ROUTINE_LOADUSERAPIHOOK:
00121           RETURN(UserLoadApiHook());
00122 
00123       default:
00124          ERR("Calling invalid routine number 0x%x in NtUserCallNoParam\n", Routine);
00125          EngSetLastError(ERROR_INVALID_PARAMETER);
00126          break;
00127    }
00128    RETURN(Result);
00129 
00130 CLEANUP:
00131    TRACE("Leave NtUserCallNoParam, ret=%i\n",_ret_);
00132    UserLeave();
00133    END_CLEANUP;
00134 }
00135 
00136 
00137 /*
00138  * @implemented
00139  */
00140 DWORD_PTR
00141 APIENTRY
00142 NtUserCallOneParam(
00143    DWORD_PTR Param,
00144    DWORD Routine)
00145 {
00146    DECLARE_RETURN(DWORD_PTR);
00147 
00148    TRACE("Enter NtUserCallOneParam\n");
00149 
00150    UserEnterExclusive();
00151 
00152    switch(Routine)
00153    {
00154       case ONEPARAM_ROUTINE_POSTQUITMESSAGE:
00155           {
00156                 PTHREADINFO pti;
00157                 pti = PsGetCurrentThreadWin32Thread();
00158                 MsqPostQuitMessage(pti->MessageQueue, Param);
00159                 RETURN(TRUE);
00160           }
00161 
00162       case ONEPARAM_ROUTINE_BEGINDEFERWNDPOS:
00163          {
00164              PSMWP psmwp;
00165              HDWP hDwp = NULL;
00166              INT count = (INT)Param;
00167 
00168              if (count < 0)
00169              {
00170                 EngSetLastError(ERROR_INVALID_PARAMETER);
00171                 RETURN(0);
00172              }
00173              /* Windows allows zero count, in which case it allocates context for 8 moves */
00174              if (count == 0) count = 8;
00175 
00176              psmwp = (PSMWP) UserCreateObject( gHandleTable,
00177                                                NULL,
00178                                               (PHANDLE)&hDwp,
00179                                                otSMWP,
00180                                                sizeof(SMWP));
00181              if (!psmwp) RETURN(0);
00182              psmwp->acvr = ExAllocatePoolWithTag(PagedPool, count * sizeof(CVR), USERTAG_SWP);
00183              if (!psmwp->acvr)
00184              {
00185                 UserDeleteObject(hDwp, otSMWP);
00186                 RETURN(0);
00187              }
00188              RtlZeroMemory(psmwp->acvr, count * sizeof(CVR));
00189              psmwp->bHandle = TRUE;
00190              psmwp->ccvr = 0;          // actualCount
00191              psmwp->ccvrAlloc = count; // suggestedCount
00192              RETURN((DWORD_PTR)hDwp);
00193          }
00194 
00195       case ONEPARAM_ROUTINE_SHOWCURSOR:
00196          RETURN( (DWORD_PTR)UserShowCursor((BOOL)Param) );
00197 
00198       case ONEPARAM_ROUTINE_GETDESKTOPMAPPING:
00199          {
00200              PTHREADINFO ti;
00201              ti = GetW32ThreadInfo();
00202              if (ti != NULL)
00203              {
00204                 /* Try convert the pointer to a user mode pointer if the desktop is
00205                    mapped into the process */
00206                 RETURN((DWORD_PTR)DesktopHeapAddressToUser((PVOID)Param));
00207              }
00208              else
00209              {
00210                 RETURN(0);
00211              }
00212          }
00213 
00214       case ONEPARAM_ROUTINE_WINDOWFROMDC:
00215          RETURN( (DWORD_PTR)IntWindowFromDC((HDC)Param));
00216 
00217       case ONEPARAM_ROUTINE_SWAPMOUSEBUTTON:
00218          {
00219             DWORD_PTR Result;
00220 
00221             Result = gspv.bMouseBtnSwap;
00222             gspv.bMouseBtnSwap = Param ? TRUE : FALSE;
00223             gpsi->aiSysMet[SM_SWAPBUTTON] = gspv.bMouseBtnSwap;
00224             RETURN(Result);
00225          }
00226 
00227       case ONEPARAM_ROUTINE_SWITCHCARETSHOWING:
00228          RETURN( (DWORD_PTR)IntSwitchCaretShowing((PVOID)Param));
00229 
00230       case ONEPARAM_ROUTINE_SETCARETBLINKTIME:
00231          RETURN( (DWORD_PTR)IntSetCaretBlinkTime((UINT)Param));
00232 
00233       case ONEPARAM_ROUTINE_SETMESSAGEEXTRAINFO:
00234          RETURN( (DWORD_PTR)MsqSetMessageExtraInfo((LPARAM)Param));
00235 
00236       case ONEPARAM_ROUTINE_CREATEEMPTYCUROBJECT:
00237          {
00238             PCURICON_OBJECT CurIcon;
00239             DWORD_PTR Result ;
00240 
00241             if (!(CurIcon = IntCreateCurIconHandle()))
00242             {
00243                EngSetLastError(ERROR_NOT_ENOUGH_MEMORY);
00244                RETURN(0);
00245             }
00246 
00247             Result = (DWORD_PTR)CurIcon->Self;
00248             UserDereferenceObject(CurIcon);
00249             RETURN(Result);
00250          }
00251 
00252       case ONEPARAM_ROUTINE_GETCURSORPOSITION:
00253          {
00254              BOOL ret = TRUE;
00255 
00256             _SEH2_TRY
00257             {
00258                ProbeForWrite((POINT*)Param,sizeof(POINT),1);
00259                RtlCopyMemory((POINT*)Param,&gpsi->ptCursor,sizeof(POINT));
00260             }
00261             _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
00262             {
00263                 SetLastNtError(_SEH2_GetExceptionCode());
00264                 ret = FALSE;
00265             }
00266             _SEH2_END;
00267 
00268             RETURN (ret);
00269          }
00270 
00271       case ONEPARAM_ROUTINE_ENABLEPROCWNDGHSTING:
00272          {
00273             BOOL Enable;
00274             PPROCESSINFO Process = PsGetCurrentProcessWin32Process();
00275 
00276             if(Process != NULL)
00277             {
00278                Enable = (BOOL)(Param != 0);
00279 
00280                if(Enable)
00281                {
00282                   Process->W32PF_flags &= ~W32PF_NOWINDOWGHOSTING;
00283                }
00284                else
00285                {
00286                   Process->W32PF_flags |= W32PF_NOWINDOWGHOSTING;
00287                }
00288 
00289                RETURN( TRUE);
00290             }
00291 
00292             RETURN( FALSE);
00293          }
00294 
00295       case ONEPARAM_ROUTINE_GETINPUTEVENT:
00296          RETURN( (DWORD_PTR)IntMsqSetWakeMask(Param));
00297 
00298       case ONEPARAM_ROUTINE_GETKEYBOARDTYPE:
00299          RETURN( UserGetKeyboardType(Param));
00300 
00301       case ONEPARAM_ROUTINE_GETKEYBOARDLAYOUT:
00302          RETURN( (DWORD_PTR)UserGetKeyboardLayout(Param));
00303 
00304       case ONEPARAM_ROUTINE_RELEASEDC:
00305          RETURN (UserReleaseDC(NULL, (HDC) Param, FALSE));
00306 
00307       case ONEPARAM_ROUTINE_REALIZEPALETTE:
00308          RETURN (UserRealizePalette((HDC) Param));
00309 
00310       case ONEPARAM_ROUTINE_GETQUEUESTATUS:
00311       {
00312          RETURN (IntGetQueueStatus((DWORD)Param));
00313       }
00314       case ONEPARAM_ROUTINE_ENUMCLIPBOARDFORMATS:
00315          /* FIXME: Should use UserEnterShared */
00316          RETURN(UserEnumClipboardFormats(Param));
00317 
00318       case ONEPARAM_ROUTINE_CSRSS_GUICHECK:
00319           IntUserManualGuiCheck(Param);
00320           RETURN(TRUE);
00321 
00322       case ONEPARAM_ROUTINE_GETCURSORPOS:
00323       {
00324           BOOL Ret = TRUE;
00325           PPOINTL pptl;
00326           PTHREADINFO pti = PsGetCurrentThreadWin32Thread();
00327           if (pti->hdesk != InputDesktopHandle) RETURN(FALSE);
00328           _SEH2_TRY
00329           {
00330              pptl = (PPOINTL)Param;
00331              *pptl = gpsi->ptCursor;
00332           }
00333           _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
00334           {
00335              Ret = FALSE;
00336           }
00337           _SEH2_END;
00338           RETURN(Ret);
00339       }
00340       case ONEPARAM_ROUTINE_SETPROCDEFLAYOUT:
00341       {
00342           PPROCESSINFO ppi;
00343           if (Param & LAYOUT_ORIENTATIONMASK)
00344           {
00345              ppi = PsGetCurrentProcessWin32Process();
00346              ppi->dwLayout = Param;
00347              RETURN(TRUE);
00348           }
00349           EngSetLastError(ERROR_INVALID_PARAMETER);
00350           RETURN(FALSE);
00351       }
00352       case ONEPARAM_ROUTINE_GETPROCDEFLAYOUT:
00353       {
00354           BOOL Ret = TRUE;
00355           PPROCESSINFO ppi;
00356           PDWORD pdwLayout;
00357           if ( PsGetCurrentProcess() == CsrProcess)
00358           {
00359              EngSetLastError(ERROR_INVALID_ACCESS);
00360              RETURN(FALSE);
00361           }
00362           ppi = PsGetCurrentProcessWin32Process();
00363           _SEH2_TRY
00364           {
00365              pdwLayout = (PDWORD)Param;
00366              *pdwLayout = ppi->dwLayout;
00367           }
00368           _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
00369           {
00370              SetLastNtError(_SEH2_GetExceptionCode());
00371              Ret = FALSE;
00372           }
00373           _SEH2_END;
00374           RETURN(Ret);
00375       }
00376       case ONEPARAM_ROUTINE_REPLYMESSAGE:
00377           RETURN (co_MsqReplyMessage((LRESULT) Param));
00378       case ONEPARAM_ROUTINE_MESSAGEBEEP:
00379           RETURN ( UserPostMessage(hwndSAS, WM_LOGONNOTIFY, LN_MESSAGE_BEEP, Param) );
00380           /* TODO: Implement sound sentry */
00381       case ONEPARAM_ROUTINE_CREATESYSTEMTHREADS:
00382           RETURN(CreateSystemThreads(Param));
00383       case ONEPARAM_ROUTINE_LOCKFOREGNDWINDOW:
00384           RETURN( (DWORD_PTR)IntLockSetForegroundWindow(Param));
00385       case ONEPARAM_ROUTINE_ALLOWSETFOREGND:
00386           RETURN( (DWORD_PTR)IntAllowSetForegroundWindow(Param));
00387    }
00388    ERR("Calling invalid routine number 0x%x in NtUserCallOneParam(), Param=0x%x\n",
00389            Routine, Param);
00390    EngSetLastError(ERROR_INVALID_PARAMETER);
00391    RETURN( 0);
00392 
00393 CLEANUP:
00394    TRACE("Leave NtUserCallOneParam, ret=%i\n",_ret_);
00395    UserLeave();
00396    END_CLEANUP;
00397 }
00398 
00399 
00400 /*
00401  * @implemented
00402  */
00403 DWORD_PTR
00404 APIENTRY
00405 NtUserCallTwoParam(
00406    DWORD_PTR Param1,
00407    DWORD_PTR Param2,
00408    DWORD Routine)
00409 {
00410    PWND Window;
00411    DECLARE_RETURN(DWORD_PTR);
00412 
00413    TRACE("Enter NtUserCallTwoParam\n");
00414    UserEnterExclusive();
00415 
00416    switch(Routine)
00417    {
00418       case TWOPARAM_ROUTINE_SETMENUBARHEIGHT:
00419          {
00420             DWORD_PTR Ret;
00421             PMENU_OBJECT MenuObject = IntGetMenuObject((HMENU)Param1);
00422             if(!MenuObject)
00423                RETURN( 0);
00424 
00425             if(Param2 > 0)
00426             {
00427                Ret = (MenuObject->MenuInfo.Height == (int)Param2);
00428                MenuObject->MenuInfo.Height = (int)Param2;
00429             }
00430             else
00431                Ret = (DWORD_PTR)MenuObject->MenuInfo.Height;
00432             IntReleaseMenuObject(MenuObject);
00433             RETURN( Ret);
00434          }
00435 
00436       case TWOPARAM_ROUTINE_SETGUITHRDHANDLE:
00437          {
00438             PUSER_MESSAGE_QUEUE MsgQueue = ((PTHREADINFO)PsGetCurrentThread()->Tcb.Win32Thread)->MessageQueue;
00439 
00440             ASSERT(MsgQueue);
00441             RETURN( (DWORD_PTR)MsqSetStateWindow(MsgQueue, (ULONG)Param1, (HWND)Param2));
00442          }
00443 
00444       case TWOPARAM_ROUTINE_ENABLEWINDOW:
00445          RETURN( IntEnableWindow((HWND)Param1, (BOOL)Param2));
00446 
00447       case TWOPARAM_ROUTINE_SHOWOWNEDPOPUPS:
00448       {
00449          Window = UserGetWindowObject((HWND)Param1);
00450          if (!Window) RETURN(0);
00451 
00452          RETURN( (DWORD_PTR)IntShowOwnedPopups(Window, (BOOL) Param2));
00453       }
00454 
00455       case TWOPARAM_ROUTINE_ROS_UPDATEUISTATE:
00456       {
00457           WPARAM wParam;
00458           Window = UserGetWindowObject((HWND)Param1);
00459           if (!Window) RETURN(0);
00460 
00461           /* Unpack wParam */
00462           wParam = MAKEWPARAM((Param2 >> 3) & 0x3,
00463                               Param2 & (UISF_HIDEFOCUS | UISF_HIDEACCEL | UISF_ACTIVE));
00464 
00465           RETURN( UserUpdateUiState(Window, wParam) );
00466       }
00467 
00468       case TWOPARAM_ROUTINE_SWITCHTOTHISWINDOW:
00469          STUB
00470          RETURN( 0);
00471 
00472 
00473       case TWOPARAM_ROUTINE_SETCARETPOS:
00474          RETURN( (DWORD_PTR)co_IntSetCaretPos((int)Param1, (int)Param2));
00475 
00476       case TWOPARAM_ROUTINE_REGISTERLOGONPROCESS:
00477          RETURN( (DWORD_PTR)co_IntRegisterLogonProcess((HANDLE)Param1, (BOOL)Param2));
00478 
00479       case TWOPARAM_ROUTINE_SETCURSORPOS:
00480          RETURN( (DWORD_PTR)UserSetCursorPos((int)Param1, (int)Param2, 0, 0, FALSE));
00481 
00482       case TWOPARAM_ROUTINE_UNHOOKWINDOWSHOOK:
00483          RETURN( IntUnhookWindowsHook((int)Param1, (HOOKPROC)Param2));
00484    }
00485    ERR("Calling invalid routine number 0x%x in NtUserCallTwoParam(), Param1=0x%x Parm2=0x%x\n",
00486            Routine, Param1, Param2);
00487    EngSetLastError(ERROR_INVALID_PARAMETER);
00488    RETURN( 0);
00489 
00490 CLEANUP:
00491    TRACE("Leave NtUserCallTwoParam, ret=%i\n",_ret_);
00492    UserLeave();
00493    END_CLEANUP;
00494 }
00495 
00496 
00497 /*
00498  * @unimplemented
00499  */
00500 BOOL
00501 APIENTRY
00502 NtUserCallHwndLock(
00503    HWND hWnd,
00504    DWORD Routine)
00505 {
00506    BOOL Ret = 0;
00507    PWND Window;
00508    USER_REFERENCE_ENTRY Ref;
00509    DECLARE_RETURN(BOOLEAN);
00510 
00511    TRACE("Enter NtUserCallHwndLock\n");
00512    UserEnterExclusive();
00513 
00514    if (!(Window = UserGetWindowObject(hWnd)))
00515    {
00516       RETURN( FALSE);
00517    }
00518    UserRefObjectCo(Window, &Ref);
00519 
00520    /* FIXME: Routine can be 0x53 - 0x5E */
00521    switch (Routine)
00522    {
00523       case HWNDLOCK_ROUTINE_ARRANGEICONICWINDOWS:
00524          co_WinPosArrangeIconicWindows(Window);
00525          break;
00526 
00527       case HWNDLOCK_ROUTINE_DRAWMENUBAR:
00528          {
00529             TRACE("HWNDLOCK_ROUTINE_DRAWMENUBAR\n");
00530             Ret = TRUE;
00531             if ((Window->style & (WS_CHILD | WS_POPUP)) != WS_CHILD)
00532                co_WinPosSetWindowPos( Window,
00533                                       HWND_DESKTOP,
00534                                       0,0,0,0,
00535                                       SWP_NOSIZE|
00536                                       SWP_NOMOVE|
00537                                       SWP_NOZORDER|
00538                                       SWP_NOACTIVATE|
00539                                       SWP_FRAMECHANGED );
00540             break;
00541          }
00542 
00543       case HWNDLOCK_ROUTINE_REDRAWFRAME:
00544          co_WinPosSetWindowPos( Window,
00545                                 HWND_DESKTOP,
00546                                 0,0,0,0,
00547                                 SWP_NOSIZE|
00548                                 SWP_NOMOVE|
00549                                 SWP_NOZORDER|
00550                                 SWP_NOACTIVATE|
00551                                 SWP_FRAMECHANGED );
00552          Ret = TRUE;
00553          break;
00554 
00555       case HWNDLOCK_ROUTINE_REDRAWFRAMEANDHOOK:
00556          co_WinPosSetWindowPos( Window,
00557                                 HWND_DESKTOP,
00558                                 0,0,0,0,
00559                                 SWP_NOSIZE|
00560                                 SWP_NOMOVE|
00561                                 SWP_NOZORDER|
00562                                 SWP_NOACTIVATE|
00563                                 SWP_FRAMECHANGED );
00564          if (!Window->spwndOwner && !IntGetParent(Window))
00565          {
00566             co_IntShellHookNotify(HSHELL_REDRAW, (LPARAM) hWnd);
00567          }
00568          Ret = TRUE;
00569          break;
00570 
00571       case HWNDLOCK_ROUTINE_SETFOREGROUNDWINDOW:
00572          TRACE("co_IntSetForegroundWindow 1 %p\n",hWnd);
00573          Ret = co_IntSetForegroundWindow(Window);
00574          TRACE("co_IntSetForegroundWindow 2 \n");
00575          break;
00576 
00577       case HWNDLOCK_ROUTINE_UPDATEWINDOW:
00578          Ret = co_UserRedrawWindow( Window, NULL, 0, RDW_UPDATENOW | RDW_ALLCHILDREN);
00579          break;
00580    }
00581 
00582    UserDerefObjectCo(Window);
00583 
00584    RETURN( Ret);
00585 
00586 CLEANUP:
00587    TRACE("Leave NtUserCallHwndLock, ret=%i\n",_ret_);
00588    UserLeave();
00589    END_CLEANUP;
00590 }
00591 
00592 /*
00593  * @unimplemented
00594  */
00595 HWND
00596 APIENTRY
00597 NtUserCallHwndOpt(
00598    HWND hWnd,
00599    DWORD Routine)
00600 {
00601    switch (Routine)
00602    {
00603       case HWNDOPT_ROUTINE_SETPROGMANWINDOW:
00604          GetW32ThreadInfo()->pDeskInfo->hProgmanWindow = hWnd;
00605          break;
00606 
00607       case HWNDOPT_ROUTINE_SETTASKMANWINDOW:
00608          GetW32ThreadInfo()->pDeskInfo->hTaskManWindow = hWnd;
00609          break;
00610    }
00611 
00612    return hWnd;
00613 }
00614 
00615 DWORD
00616 APIENTRY
00617 NtUserCallHwnd(
00618    HWND hWnd,
00619    DWORD Routine)
00620 {
00621    switch (Routine)
00622    {
00623       case HWND_ROUTINE_GETWNDCONTEXTHLPID:
00624       {
00625          PWND Window;
00626          PPROPERTY HelpId;
00627          USER_REFERENCE_ENTRY Ref;
00628 
00629          UserEnterExclusive();
00630 
00631          if (!(Window = UserGetWindowObject(hWnd)))
00632          {
00633             UserLeave();
00634             return 0;
00635          }
00636          UserRefObjectCo(Window, &Ref);
00637 
00638          HelpId = IntGetProp(Window, gpsi->atomContextHelpIdProp);
00639 
00640          UserDerefObjectCo(Window);
00641          UserLeave();
00642          return (DWORD)HelpId->Data;
00643       }
00644       case HWND_ROUTINE_REGISTERSHELLHOOKWINDOW:
00645          if (IntIsWindow(hWnd))
00646             return IntRegisterShellHookWindow(hWnd);
00647          return FALSE;
00648          break;
00649       case HWND_ROUTINE_DEREGISTERSHELLHOOKWINDOW:
00650          if (IntIsWindow(hWnd))
00651             return IntDeRegisterShellHookWindow(hWnd);
00652          return FALSE;
00653       case HWND_ROUTINE_SETMSGBOX:
00654       {
00655          PWND Window;
00656          UserEnterExclusive();
00657          if ((Window = UserGetWindowObject(hWnd)))
00658          {
00659             Window->state |= WNDS_MSGBOX;
00660          }
00661          UserLeave();
00662          return FALSE;
00663       }
00664    }
00665    STUB;
00666 
00667    return 0;
00668 }
00669 
00670 DWORD
00671 APIENTRY
00672 NtUserCallHwndParam(
00673    HWND hWnd,
00674    DWORD Param,
00675    DWORD Routine)
00676 {
00677 
00678    switch (Routine)
00679    {
00680       case HWNDPARAM_ROUTINE_KILLSYSTEMTIMER:
00681           return IntKillTimer(UserGetWindowObject(hWnd), (UINT_PTR)Param, TRUE);
00682 
00683       case HWNDPARAM_ROUTINE_SETWNDCONTEXTHLPID:
00684       {
00685          PWND Window;
00686 
00687          UserEnterExclusive();
00688          if(!(Window = UserGetWindowObject(hWnd)))
00689          {
00690             UserLeave();
00691             return FALSE;
00692          }
00693 
00694          if ( Param )
00695             IntSetProp(Window, gpsi->atomContextHelpIdProp, (HANDLE)Param);
00696          else
00697             IntRemoveProp(Window, gpsi->atomContextHelpIdProp);
00698 
00699          UserLeave();
00700          return TRUE;
00701       }
00702 
00703       case HWNDPARAM_ROUTINE_SETDIALOGPOINTER:
00704       {
00705          PWND pWnd;
00706          USER_REFERENCE_ENTRY Ref;
00707 
00708          UserEnterExclusive();
00709 
00710          if (!(pWnd = UserGetWindowObject(hWnd)))
00711          {
00712             UserLeave();
00713             return 0;
00714          }
00715          UserRefObjectCo(pWnd, &Ref);
00716 
00717          if (pWnd->head.pti->ppi == PsGetCurrentProcessWin32Process() &&
00718              pWnd->cbwndExtra == DLGWINDOWEXTRA &&
00719              !(pWnd->state & WNDS_SERVERSIDEWINDOWPROC))
00720          {
00721             if (Param)
00722             {
00723                if (!pWnd->fnid) pWnd->fnid = FNID_DIALOG;
00724                pWnd->state |= WNDS_DIALOGWINDOW;
00725             }
00726             else
00727             {
00728                pWnd->fnid |= FNID_DESTROY;
00729                pWnd->state &= ~WNDS_DIALOGWINDOW;
00730             }
00731          }
00732 
00733          UserDerefObjectCo(pWnd);
00734          UserLeave();
00735          return 0;
00736       }
00737 
00738       case HWNDPARAM_ROUTINE_ROS_NOTIFYWINEVENT:
00739       {
00740          PWND pWnd;
00741          PNOTIFYEVENT pne;
00742          UserEnterExclusive();
00743          pne = (PNOTIFYEVENT)Param;
00744          if (hWnd)
00745             pWnd = UserGetWindowObject(hWnd);
00746          else
00747             pWnd = NULL;
00748          IntNotifyWinEvent(pne->event, pWnd, pne->idObject, pne->idChild, pne->flags);
00749          UserLeave();
00750          return 0;
00751       }
00752    }
00753 
00754    STUB;
00755 
00756    return 0;
00757 }
00758 
00759 DWORD
00760 APIENTRY
00761 NtUserCallHwndParamLock(
00762    HWND hWnd,
00763    DWORD Param,
00764    DWORD Routine)
00765 {
00766    DWORD Ret = 0;
00767    PWND Window;
00768    USER_REFERENCE_ENTRY Ref;
00769    DECLARE_RETURN(DWORD);
00770 
00771    TRACE("Enter NtUserCallHwndParamLock\n");
00772    UserEnterExclusive();
00773 
00774    if (!(Window = UserGetWindowObject(hWnd)))
00775    {
00776       RETURN( FALSE);
00777    }
00778    UserRefObjectCo(Window, &Ref);
00779 
00780    switch (Routine)
00781    {
00782       case TWOPARAM_ROUTINE_VALIDATERGN:
00783          Ret = (DWORD)co_UserRedrawWindow( Window, NULL, (HRGN)Param, RDW_VALIDATE);
00784          break;
00785    }
00786 
00787    UserDerefObjectCo(Window);
00788 
00789    RETURN( Ret);
00790 
00791 CLEANUP:
00792    TRACE("Leave NtUserCallHwndParamLock, ret=%i\n",_ret_);
00793    UserLeave();
00794    END_CLEANUP;
00795 
00796 }
00797 
00798 /* EOF */

Generated on Sat May 26 2012 04:37:26 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.