*/
#include <win32k.h>
+
+#include <winlogon.h>
+
DBG_DEFAULT_CHANNEL(UserMisc);
/* registered Logon process */
BOOL FASTCALL
co_IntRegisterLogonProcess(HANDLE ProcessId, BOOL Register)
{
- PEPROCESS Process;
NTSTATUS Status;
- CSR_API_MESSAGE Request;
+ PEPROCESS Process;
Status = PsLookupProcessByProcessId(ProcessId,
&Process);
ObDereferenceObject(Process);
- Request.Type = MAKE_CSR_API(REGISTER_LOGON_PROCESS, CSR_GUI);
- Request.Data.RegisterLogonProcessRequest.ProcessId = ProcessId;
- Request.Data.RegisterLogonProcessRequest.Register = Register;
-
- Status = co_CsrNotify(&Request);
- if (! NT_SUCCESS(Status))
- {
- ERR("Failed to register logon process with CSRSS\n");
- return FALSE;
- }
-
return TRUE;
}
RETURN( (DWORD_PTR)IntReleaseCapture());
case NOPARAM_ROUTINE_LOADUSERAPIHOOK:
- RETURN(UserLoadApiHook());
+ RETURN(UserLoadApiHook());
+
+ case NOPARAM_ROUTINE_ZAPACTIVEANDFOUS:
+ {
+ PTHREADINFO pti = PsGetCurrentThreadWin32Thread();
+ TRACE("Zapping the Active and Focus window out of the Queue!\n");
+ pti->MessageQueue->spwndFocus = NULL;
+ pti->MessageQueue->spwndActive = NULL;
+ RETURN(0);
+ }
+
+ /* this is a Reactos only case and is needed for gui-on-demand */
+ case NOPARAM_ROUTINE_ISCONSOLEMODE:
+ RETURN( ScreenDeviceContext == NULL );
default:
ERR("Calling invalid routine number 0x%x in NtUserCallNoParam\n", Routine);
RETURN(Result);
CLEANUP:
- TRACE("Leave NtUserCallNoParam, ret=%i\n",_ret_);
+ TRACE("Leave NtUserCallNoParam, ret=%p\n",(PVOID)_ret_);
UserLeave();
END_CLEANUP;
}
{
PTHREADINFO pti;
pti = PsGetCurrentThreadWin32Thread();
- MsqPostQuitMessage(pti->MessageQueue, Param);
+ MsqPostQuitMessage(pti, Param);
RETURN(TRUE);
}
if (count == 0) count = 8;
psmwp = (PSMWP) UserCreateObject( gHandleTable,
- NULL,
+ NULL,
+ NULL,
(PHANDLE)&hDwp,
- otSMWP,
+ TYPE_SETWINDOWPOS,
sizeof(SMWP));
if (!psmwp) RETURN(0);
psmwp->acvr = ExAllocatePoolWithTag(PagedPool, count * sizeof(CVR), USERTAG_SWP);
if (!psmwp->acvr)
{
- UserDeleteObject(hDwp, otSMWP);
+ UserDeleteObject(hDwp, TYPE_SETWINDOWPOS);
RETURN(0);
}
RtlZeroMemory(psmwp->acvr, count * sizeof(CVR));
psmwp->bHandle = TRUE;
psmwp->ccvr = 0; // actualCount
- psmwp->ccvrAlloc = count; // suggestedCount
+ psmwp->ccvrAlloc = count; // suggestedCount
RETURN((DWORD_PTR)hDwp);
}
case ONEPARAM_ROUTINE_CREATEEMPTYCUROBJECT:
{
- PCURICON_OBJECT CurIcon;
DWORD_PTR Result ;
- if (!(CurIcon = IntCreateCurIconHandle()))
+ if (!(Result = (DWORD_PTR)IntCreateCurIconHandle((DWORD)Param)))
{
EngSetLastError(ERROR_NOT_ENOUGH_MEMORY);
RETURN(0);
}
-
- Result = (DWORD_PTR)CurIcon->Self;
- UserDereferenceObject(CurIcon);
RETURN(Result);
}
- case ONEPARAM_ROUTINE_GETCURSORPOSITION:
- {
- BOOL ret = TRUE;
-
- _SEH2_TRY
- {
- ProbeForWrite((POINT*)Param,sizeof(POINT),1);
- RtlCopyMemory((POINT*)Param,&gpsi->ptCursor,sizeof(POINT));
- }
- _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
- {
- SetLastNtError(_SEH2_GetExceptionCode());
- ret = FALSE;
- }
- _SEH2_END;
-
- RETURN (ret);
- }
-
case ONEPARAM_ROUTINE_ENABLEPROCWNDGHSTING:
{
BOOL Enable;
BOOL Ret = TRUE;
PPOINTL pptl;
PTHREADINFO pti = PsGetCurrentThreadWin32Thread();
- if (pti->hdesk != InputDesktopHandle) RETURN(FALSE);
+ if (pti->rpdesk != IntGetActiveDesktop()) RETURN(FALSE);
_SEH2_TRY
{
+ ProbeForWrite((POINT*)Param,sizeof(POINT),1);
pptl = (PPOINTL)Param;
*pptl = gpsi->ptCursor;
}
BOOL Ret = TRUE;
PPROCESSINFO ppi;
PDWORD pdwLayout;
- if ( PsGetCurrentProcess() == CsrProcess)
+ if ( PsGetCurrentProcess() == gpepCSRSS)
{
EngSetLastError(ERROR_INVALID_ACCESS);
RETURN(FALSE);
/* TODO: Implement sound sentry */
case ONEPARAM_ROUTINE_CREATESYSTEMTHREADS:
RETURN(CreateSystemThreads(Param));
+ case ONEPARAM_ROUTINE_LOCKFOREGNDWINDOW:
+ RETURN( (DWORD_PTR)IntLockSetForegroundWindow(Param));
+ case ONEPARAM_ROUTINE_ALLOWSETFOREGND:
+ RETURN( (DWORD_PTR)IntAllowSetForegroundWindow(Param));
}
ERR("Calling invalid routine number 0x%x in NtUserCallOneParam(), Param=0x%x\n",
Routine, Param);
RETURN( 0);
CLEANUP:
- TRACE("Leave NtUserCallOneParam, ret=%i\n",_ret_);
+ TRACE("Leave NtUserCallOneParam, ret=%p\n", (PVOID)_ret_);
UserLeave();
END_CLEANUP;
}
case TWOPARAM_ROUTINE_SETGUITHRDHANDLE:
{
- PUSER_MESSAGE_QUEUE MsgQueue = ((PTHREADINFO)PsGetCurrentThread()->Tcb.Win32Thread)->MessageQueue;
-
- ASSERT(MsgQueue);
- RETURN( (DWORD_PTR)MsqSetStateWindow(MsgQueue, (ULONG)Param1, (HWND)Param2));
+ PTHREADINFO pti = (PTHREADINFO)PsGetCurrentThreadWin32Thread();
+ ASSERT(pti->MessageQueue);
+ RETURN( (DWORD_PTR)MsqSetStateWindow(pti, (ULONG)Param1, (HWND)Param2));
}
case TWOPARAM_ROUTINE_ENABLEWINDOW:
case TWOPARAM_ROUTINE_UNHOOKWINDOWSHOOK:
RETURN( IntUnhookWindowsHook((int)Param1, (HOOKPROC)Param2));
+ case TWOPARAM_ROUTINE_EXITREACTOS:
+ if(hwndSAS == NULL)
+ {
+ ASSERT(hwndSAS);
+ RETURN(STATUS_NOT_FOUND);
+ }
+ RETURN( co_IntSendMessage (hwndSAS, PM_WINLOGON_EXITWINDOWS, (WPARAM) Param1, (LPARAM)Param2));
}
ERR("Calling invalid routine number 0x%x in NtUserCallTwoParam(), Param1=0x%x Parm2=0x%x\n",
Routine, Param1, Param2);
RETURN( 0);
CLEANUP:
- TRACE("Leave NtUserCallTwoParam, ret=%i\n",_ret_);
+ TRACE("Leave NtUserCallTwoParam, ret=%p\n", (PVOID)_ret_);
UserLeave();
END_CLEANUP;
}
SWP_FRAMECHANGED );
if (!Window->spwndOwner && !IntGetParent(Window))
{
- co_IntShellHookNotify(HSHELL_REDRAW, (LPARAM) hWnd);
+ co_IntShellHookNotify(HSHELL_REDRAW, (WPARAM) hWnd, FALSE); // FIXME Flashing?
}
Ret = TRUE;
break;
case HWNDLOCK_ROUTINE_SETFOREGROUNDWINDOW:
+ TRACE("co_IntSetForegroundWindow 1 0x%p\n",hWnd);
Ret = co_IntSetForegroundWindow(Window);
+ TRACE("co_IntSetForegroundWindow 2 0x%p\n",hWnd);
+ break;
+
+ case HWNDLOCK_ROUTINE_SETFOREGROUNDWINDOWMOUSE:
+ TRACE("co_IntSetForegroundWindow 1 0x%p\n",hWnd);
+ Ret = co_IntSetForegroundWindowMouse(Window);
+ TRACE("co_IntSetForegroundWindow 2 0x%p\n",hWnd);
break;
case HWNDLOCK_ROUTINE_UPDATEWINDOW:
RETURN( Ret);
CLEANUP:
- TRACE("Leave NtUserCallHwndLock, ret=%i\n",_ret_);
+ TRACE("Leave NtUserCallHwndLock, ret=%u\n",_ret_);
UserLeave();
END_CLEANUP;
}
UserRefObjectCo(Window, &Ref);
HelpId = IntGetProp(Window, gpsi->atomContextHelpIdProp);
-
+
UserDerefObjectCo(Window);
UserLeave();
return (DWORD)HelpId->Data;
if (IntIsWindow(hWnd))
return IntDeRegisterShellHookWindow(hWnd);
return FALSE;
+ case HWND_ROUTINE_SETMSGBOX:
+ {
+ PWND Window;
+ UserEnterExclusive();
+ if ((Window = UserGetWindowObject(hWnd)))
+ {
+ Window->state |= WNDS_MSGBOX;
+ }
+ UserLeave();
+ return FALSE;
+ }
}
STUB;
switch (Routine)
{
case HWNDPARAM_ROUTINE_KILLSYSTEMTIMER:
- return IntKillTimer(hWnd, (UINT_PTR)Param, TRUE);
+ return IntKillTimer(UserGetWindowObject(hWnd), (UINT_PTR)Param, TRUE);
case HWNDPARAM_ROUTINE_SETWNDCONTEXTHLPID:
{
UserRefObjectCo(pWnd, &Ref);
if (pWnd->head.pti->ppi == PsGetCurrentProcessWin32Process() &&
- pWnd->cbwndExtra == DLGWINDOWEXTRA &&
+ pWnd->cbwndExtra == DLGWINDOWEXTRA &&
!(pWnd->state & WNDS_SERVERSIDEWINDOWPROC))
{
if (Param)
pWnd->state &= ~WNDS_DIALOGWINDOW;
}
}
-
+
UserDerefObjectCo(pWnd);
UserLeave();
return 0;
UserLeave();
return 0;
}
+ case HWNDPARAM_ROUTINE_CLEARWINDOWSTATE:
+ {
+ PWND pWnd;
+ UserEnterExclusive();
+ pWnd = UserGetWindowObject(hWnd);
+ if (pWnd) IntClearWindowState(pWnd, (UINT)Param);
+ UserLeave();
+ return 0;
+ }
+ case HWNDPARAM_ROUTINE_SETWINDOWSTATE:
+ {
+ PWND pWnd;
+ UserEnterExclusive();
+ pWnd = UserGetWindowObject(hWnd);
+ if (pWnd) IntSetWindowState(pWnd, (UINT)Param);
+ UserLeave();
+ return 0;
+ }
}
STUB;
RETURN( Ret);
CLEANUP:
- TRACE("Leave NtUserCallHwndParamLock, ret=%i\n",_ret_);
+ TRACE("Leave NtUserCallHwndParamLock, ret=%lu\n",_ret_);
UserLeave();
END_CLEANUP;