2008-03-21 00:07:06 +00:00
|
|
|
/*
|
|
|
|
* COPYRIGHT: See COPYING in the top level directory
|
|
|
|
* PROJECT: ReactOS kernel
|
|
|
|
* PURPOSE: NtUserCallXxx call stubs
|
2015-11-10 17:41:55 +00:00
|
|
|
* FILE: win32ss/user/ntuser/simplecall.c
|
2018-10-27 17:56:16 +00:00
|
|
|
* PROGRAMERS: Ge van Geldorp (ge@gse.nl)
|
|
|
|
* Katayama Hirofumi MZ (katayama.hirofumi.mz@gmail.com)
|
2008-03-21 00:07:06 +00:00
|
|
|
*/
|
|
|
|
|
2010-04-26 13:58:46 +00:00
|
|
|
#include <win32k.h>
|
2014-02-05 16:30:19 +00:00
|
|
|
|
2011-08-21 12:38:52 +00:00
|
|
|
DBG_DEFAULT_CHANNEL(UserMisc);
|
2008-03-21 00:07:06 +00:00
|
|
|
|
2014-11-23 16:09:00 +00:00
|
|
|
/* Registered logon process ID */
|
|
|
|
HANDLE gpidLogon = 0;
|
2008-03-21 00:07:06 +00:00
|
|
|
|
|
|
|
BOOL FASTCALL
|
|
|
|
co_IntRegisterLogonProcess(HANDLE ProcessId, BOOL Register)
|
|
|
|
{
|
2018-02-19 14:04:38 +00:00
|
|
|
NTSTATUS Status;
|
|
|
|
PEPROCESS Process;
|
|
|
|
|
|
|
|
Status = PsLookupProcessByProcessId(ProcessId, &Process);
|
|
|
|
if (!NT_SUCCESS(Status))
|
|
|
|
{
|
|
|
|
EngSetLastError(RtlNtStatusToDosError(Status));
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
ProcessId = Process->UniqueProcessId;
|
|
|
|
|
|
|
|
ObDereferenceObject(Process);
|
|
|
|
|
|
|
|
if (Register)
|
|
|
|
{
|
|
|
|
/* Register the logon process */
|
|
|
|
if (gpidLogon != 0)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
gpidLogon = ProcessId;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* Deregister the logon process */
|
|
|
|
if (gpidLogon != ProcessId)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
gpidLogon = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
return TRUE;
|
2008-03-21 00:07:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* @unimplemented
|
|
|
|
*/
|
2010-01-05 19:26:32 +00:00
|
|
|
DWORD_PTR
|
2008-11-29 22:48:58 +00:00
|
|
|
APIENTRY
|
2008-03-21 00:07:06 +00:00
|
|
|
NtUserCallNoParam(DWORD Routine)
|
|
|
|
{
|
2018-02-19 14:04:38 +00:00
|
|
|
DWORD_PTR Result = 0;
|
|
|
|
|
|
|
|
TRACE("Enter NtUserCallNoParam\n");
|
|
|
|
UserEnterExclusive();
|
|
|
|
|
|
|
|
switch (Routine)
|
|
|
|
{
|
|
|
|
case NOPARAM_ROUTINE_CREATEMENU:
|
|
|
|
Result = (DWORD_PTR)UserCreateMenu(GetW32ThreadInfo()->rpdesk, FALSE);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case NOPARAM_ROUTINE_CREATEMENUPOPUP:
|
|
|
|
Result = (DWORD_PTR)UserCreateMenu(GetW32ThreadInfo()->rpdesk, TRUE);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case NOPARAM_ROUTINE_DESTROY_CARET:
|
|
|
|
Result = (DWORD_PTR)co_IntDestroyCaret(PsGetCurrentThread()->Tcb.Win32Thread);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case NOPARAM_ROUTINE_INIT_MESSAGE_PUMP:
|
|
|
|
Result = (DWORD_PTR)IntInitMessagePumpHook();
|
|
|
|
break;
|
|
|
|
|
|
|
|
case NOPARAM_ROUTINE_UNINIT_MESSAGE_PUMP:
|
|
|
|
Result = (DWORD_PTR)IntUninitMessagePumpHook();
|
|
|
|
break;
|
|
|
|
|
|
|
|
case NOPARAM_ROUTINE_MSQCLEARWAKEMASK:
|
2017-09-09 12:42:53 +00:00
|
|
|
Result = (DWORD_PTR)IntMsqClearWakeMask();
|
|
|
|
break;
|
2018-02-19 14:04:38 +00:00
|
|
|
|
|
|
|
case NOPARAM_ROUTINE_GETMSESSAGEPOS:
|
|
|
|
{
|
|
|
|
PTHREADINFO pti = PsGetCurrentThreadWin32Thread();
|
2017-09-09 12:42:53 +00:00
|
|
|
Result = (DWORD_PTR)MAKELONG(pti->ptLast.x, pti->ptLast.y);
|
|
|
|
break;
|
2018-02-19 14:04:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
case NOPARAM_ROUTINE_RELEASECAPTURE:
|
2017-09-09 12:42:53 +00:00
|
|
|
Result = (DWORD_PTR)IntReleaseCapture();
|
|
|
|
break;
|
2018-02-19 14:04:38 +00:00
|
|
|
|
|
|
|
case NOPARAM_ROUTINE_LOADUSERAPIHOOK:
|
2017-09-09 12:42:53 +00:00
|
|
|
Result = UserLoadApiHook();
|
|
|
|
break;
|
2018-02-19 14:04:38 +00:00
|
|
|
|
|
|
|
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;
|
2017-09-09 12:42:53 +00:00
|
|
|
Result = 0;
|
|
|
|
break;
|
2018-02-19 14:04:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* this is a ReactOS only case and is needed for gui-on-demand */
|
|
|
|
case NOPARAM_ROUTINE_ISCONSOLEMODE:
|
2017-09-09 12:42:53 +00:00
|
|
|
Result = (ScreenDeviceContext == NULL);
|
|
|
|
break;
|
2018-02-19 14:04:38 +00:00
|
|
|
|
|
|
|
case NOPARAM_ROUTINE_UPDATEPERUSERIMMENABLING:
|
|
|
|
gpsi->dwSRVIFlags |= SRVINFO_IMM32; // Always set.
|
2017-09-09 12:42:53 +00:00
|
|
|
Result = TRUE; // Always return TRUE.
|
|
|
|
break;
|
2018-02-19 14:04:38 +00:00
|
|
|
|
|
|
|
default:
|
|
|
|
ERR("Calling invalid routine number 0x%x in NtUserCallNoParam\n", Routine);
|
|
|
|
EngSetLastError(ERROR_INVALID_PARAMETER);
|
|
|
|
break;
|
|
|
|
}
|
2008-03-21 00:07:06 +00:00
|
|
|
|
2017-09-09 12:42:53 +00:00
|
|
|
TRACE("Leave NtUserCallNoParam, ret=%p\n",(PVOID)Result);
|
2018-02-19 14:04:38 +00:00
|
|
|
UserLeave();
|
2017-09-09 12:42:53 +00:00
|
|
|
|
|
|
|
return Result;
|
2008-03-21 00:07:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* @implemented
|
|
|
|
*/
|
2010-01-05 19:26:32 +00:00
|
|
|
DWORD_PTR
|
2008-11-29 22:48:58 +00:00
|
|
|
APIENTRY
|
2008-03-21 00:07:06 +00:00
|
|
|
NtUserCallOneParam(
|
2018-02-19 14:04:38 +00:00
|
|
|
DWORD_PTR Param,
|
|
|
|
DWORD Routine)
|
2008-03-21 00:07:06 +00:00
|
|
|
{
|
2017-09-09 12:42:53 +00:00
|
|
|
DWORD_PTR Result;
|
2008-03-21 00:07:06 +00:00
|
|
|
|
2018-02-19 14:04:38 +00:00
|
|
|
TRACE("Enter NtUserCallOneParam\n");
|
2008-03-21 00:07:06 +00:00
|
|
|
|
2018-02-19 14:04:38 +00:00
|
|
|
UserEnterExclusive();
|
2008-03-21 00:07:06 +00:00
|
|
|
|
2018-02-19 14:04:38 +00:00
|
|
|
switch (Routine)
|
|
|
|
{
|
|
|
|
case ONEPARAM_ROUTINE_POSTQUITMESSAGE:
|
|
|
|
{
|
|
|
|
PTHREADINFO pti;
|
|
|
|
pti = PsGetCurrentThreadWin32Thread();
|
|
|
|
MsqPostQuitMessage(pti, Param);
|
2017-09-09 12:42:53 +00:00
|
|
|
Result = TRUE;
|
|
|
|
break;
|
2018-02-19 14:04:38 +00:00
|
|
|
}
|
2011-03-18 22:41:22 +00:00
|
|
|
|
2018-02-19 14:04:38 +00:00
|
|
|
case ONEPARAM_ROUTINE_BEGINDEFERWNDPOS:
|
|
|
|
{
|
|
|
|
PSMWP psmwp;
|
|
|
|
HDWP hDwp = NULL;
|
|
|
|
INT count = (INT)Param;
|
2011-03-20 00:21:45 +00:00
|
|
|
|
2018-02-19 14:04:38 +00:00
|
|
|
if (count < 0)
|
|
|
|
{
|
2011-03-18 22:41:22 +00:00
|
|
|
EngSetLastError(ERROR_INVALID_PARAMETER);
|
2017-09-09 12:42:53 +00:00
|
|
|
Result = 0;
|
|
|
|
break;
|
2018-02-19 14:04:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Windows allows zero count, in which case it allocates context for 8 moves */
|
|
|
|
if (count == 0) count = 8;
|
|
|
|
|
|
|
|
psmwp = (PSMWP)UserCreateObject(gHandleTable,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
(PHANDLE)&hDwp,
|
|
|
|
TYPE_SETWINDOWPOS,
|
|
|
|
sizeof(SMWP));
|
2017-09-09 12:42:53 +00:00
|
|
|
if (!psmwp)
|
|
|
|
{
|
|
|
|
Result = 0;
|
|
|
|
break;
|
|
|
|
}
|
2018-02-19 14:04:38 +00:00
|
|
|
|
|
|
|
psmwp->acvr = ExAllocatePoolWithTag(PagedPool, count * sizeof(CVR), USERTAG_SWP);
|
|
|
|
if (!psmwp->acvr)
|
|
|
|
{
|
2012-12-29 20:57:10 +00:00
|
|
|
UserDeleteObject(hDwp, TYPE_SETWINDOWPOS);
|
2017-09-09 12:42:53 +00:00
|
|
|
Result = 0;
|
|
|
|
break;
|
2018-02-19 14:04:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
RtlZeroMemory(psmwp->acvr, count * sizeof(CVR));
|
|
|
|
psmwp->bHandle = TRUE;
|
|
|
|
psmwp->ccvr = 0; // actualCount
|
|
|
|
psmwp->ccvrAlloc = count; // suggestedCount
|
2017-09-09 12:42:53 +00:00
|
|
|
Result = (DWORD_PTR)hDwp;
|
|
|
|
break;
|
2018-02-19 14:04:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
case ONEPARAM_ROUTINE_SHOWCURSOR:
|
2017-09-09 12:42:53 +00:00
|
|
|
Result = (DWORD_PTR)UserShowCursor((BOOL)Param);
|
|
|
|
break;
|
2018-02-19 14:04:38 +00:00
|
|
|
|
|
|
|
case ONEPARAM_ROUTINE_GETDESKTOPMAPPING:
|
|
|
|
{
|
|
|
|
PTHREADINFO ti;
|
|
|
|
ti = GetW32ThreadInfo();
|
|
|
|
if (ti != NULL)
|
|
|
|
{
|
2008-03-21 00:07:06 +00:00
|
|
|
/* Try convert the pointer to a user mode pointer if the desktop is
|
|
|
|
mapped into the process */
|
2017-09-09 12:42:53 +00:00
|
|
|
Result = (DWORD_PTR)DesktopHeapAddressToUser((PVOID)Param);
|
2018-02-19 14:04:38 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2017-09-09 12:42:53 +00:00
|
|
|
Result = 0;
|
2018-02-19 14:04:38 +00:00
|
|
|
}
|
2017-09-09 12:42:53 +00:00
|
|
|
break;
|
2018-02-19 14:04:38 +00:00
|
|
|
}
|
2008-03-21 00:07:06 +00:00
|
|
|
|
2018-02-19 14:04:38 +00:00
|
|
|
case ONEPARAM_ROUTINE_WINDOWFROMDC:
|
2017-09-09 12:42:53 +00:00
|
|
|
Result = (DWORD_PTR)IntWindowFromDC((HDC)Param);
|
|
|
|
break;
|
2008-03-21 00:07:06 +00:00
|
|
|
|
2018-02-19 14:04:38 +00:00
|
|
|
case ONEPARAM_ROUTINE_SWAPMOUSEBUTTON:
|
|
|
|
{
|
2009-06-25 02:43:38 +00:00
|
|
|
Result = gspv.bMouseBtnSwap;
|
|
|
|
gspv.bMouseBtnSwap = Param ? TRUE : FALSE;
|
2009-06-27 23:33:57 +00:00
|
|
|
gpsi->aiSysMet[SM_SWAPBUTTON] = gspv.bMouseBtnSwap;
|
2017-09-09 12:42:53 +00:00
|
|
|
break;
|
2018-02-19 14:04:38 +00:00
|
|
|
}
|
2008-03-21 00:07:06 +00:00
|
|
|
|
2018-02-19 14:04:38 +00:00
|
|
|
case ONEPARAM_ROUTINE_SETCARETBLINKTIME:
|
2017-09-09 12:42:53 +00:00
|
|
|
Result = (DWORD_PTR)IntSetCaretBlinkTime((UINT)Param);
|
|
|
|
break;
|
Patch by Stefan Ginsberg (stefan__100__ AT hotmail DOT com):
- remove NtUserEnumClipboardFormats, use ->ONEPARAM_ROUTINE_ENUMCLIPBOARDFORMAT insetad
- remove NtUserRegisterClipboardFormat, use NtUserRegisterWIndowsMessage instead
- remove NtUserKillSystemTimer, use HWNDPARAM_ROUTINE_KILLSYSTEMTIMER instead
- remove NtUserInsertMenuItem, use NtUserThunkedMenuItemInfo instead
- remove NtUserGetCapture, use THREADSTATE_CAPTUREWINDOW instead
- remove NtUserGetActiveWindow, use THREADSTATE_ACTIVEWINDOW instead
- remove NtUserGetQueueStatus, use ONEPARAM_ROUTIME_GETQUEUESTATUS instead
- remove NtUserGetLastActivePopup, wasn't implemented
- remove NtUserRealizePalette from ntuser.h, it's not implemented
- remove duplicate NtUserGetLastInputInfo from ntuser.h
- remove PrivateCsrssRergisterPrimitive from user32, it was unused and unimplemented
- remove NtUserDereferenceWndprocHandle, it was unused
- move WNDPROC_INFO structure from ntuser.h to win32k/include/class.h, as it's not used in usermode anymore
tested with AbiWord and FF on VMWare
svn path=/trunk/; revision=32825
2008-04-03 02:13:34 +00:00
|
|
|
|
2018-02-19 14:04:38 +00:00
|
|
|
case ONEPARAM_ROUTINE_SETMESSAGEEXTRAINFO:
|
2017-09-09 12:42:53 +00:00
|
|
|
Result = (DWORD_PTR)MsqSetMessageExtraInfo((LPARAM)Param);
|
|
|
|
break;
|
2008-03-21 00:07:06 +00:00
|
|
|
|
2018-02-19 14:04:38 +00:00
|
|
|
case ONEPARAM_ROUTINE_CREATEEMPTYCUROBJECT:
|
|
|
|
{
|
2013-11-13 20:06:01 +00:00
|
|
|
if (!(Result = (DWORD_PTR)IntCreateCurIconHandle((DWORD)Param)))
|
2008-03-21 00:07:06 +00:00
|
|
|
{
|
2018-02-19 14:04:38 +00:00
|
|
|
EngSetLastError(ERROR_NOT_ENOUGH_MEMORY);
|
2017-09-09 12:42:53 +00:00
|
|
|
Result = 0;
|
2008-03-21 00:07:06 +00:00
|
|
|
}
|
2017-09-09 12:42:53 +00:00
|
|
|
break;
|
2018-02-19 14:04:38 +00:00
|
|
|
}
|
2008-03-21 00:07:06 +00:00
|
|
|
|
2018-02-19 14:04:38 +00:00
|
|
|
case ONEPARAM_ROUTINE_ENABLEPROCWNDGHSTING:
|
|
|
|
{
|
2008-03-21 00:07:06 +00:00
|
|
|
BOOL Enable;
|
2009-07-26 16:17:50 +00:00
|
|
|
PPROCESSINFO Process = PsGetCurrentProcessWin32Process();
|
2008-03-21 00:07:06 +00:00
|
|
|
|
2018-02-19 14:04:38 +00:00
|
|
|
if (Process != NULL)
|
2008-03-21 00:07:06 +00:00
|
|
|
{
|
2018-02-19 14:04:38 +00:00
|
|
|
Enable = (BOOL)(Param != 0);
|
|
|
|
|
|
|
|
if (Enable)
|
|
|
|
{
|
|
|
|
Process->W32PF_flags &= ~W32PF_NOWINDOWGHOSTING;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
Process->W32PF_flags |= W32PF_NOWINDOWGHOSTING;
|
|
|
|
}
|
|
|
|
|
2017-09-09 12:42:53 +00:00
|
|
|
Result = TRUE;
|
|
|
|
break;
|
2008-03-21 00:07:06 +00:00
|
|
|
}
|
|
|
|
|
2017-09-09 12:42:53 +00:00
|
|
|
Result = FALSE;
|
|
|
|
break;
|
2018-02-19 14:04:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
case ONEPARAM_ROUTINE_GETINPUTEVENT:
|
2017-09-09 12:42:53 +00:00
|
|
|
Result = (DWORD_PTR)IntMsqSetWakeMask(Param);
|
|
|
|
break;
|
2018-02-19 14:04:38 +00:00
|
|
|
|
|
|
|
case ONEPARAM_ROUTINE_GETKEYBOARDTYPE:
|
2017-09-09 12:42:53 +00:00
|
|
|
Result = UserGetKeyboardType(Param);
|
|
|
|
break;
|
2018-02-19 14:04:38 +00:00
|
|
|
|
|
|
|
case ONEPARAM_ROUTINE_GETKEYBOARDLAYOUT:
|
2017-09-09 12:42:53 +00:00
|
|
|
Result = (DWORD_PTR)UserGetKeyboardLayout(Param);
|
|
|
|
break;
|
2018-02-19 14:04:38 +00:00
|
|
|
|
|
|
|
case ONEPARAM_ROUTINE_RELEASEDC:
|
2017-09-09 12:42:53 +00:00
|
|
|
Result = UserReleaseDC(NULL, (HDC) Param, FALSE);
|
|
|
|
break;
|
2018-02-19 14:04:38 +00:00
|
|
|
|
|
|
|
case ONEPARAM_ROUTINE_REALIZEPALETTE:
|
2017-09-09 12:42:53 +00:00
|
|
|
Result = UserRealizePalette((HDC) Param);
|
|
|
|
break;
|
2018-02-19 14:04:38 +00:00
|
|
|
|
|
|
|
case ONEPARAM_ROUTINE_GETQUEUESTATUS:
|
|
|
|
{
|
2017-09-09 12:42:53 +00:00
|
|
|
Result = IntGetQueueStatus((DWORD)Param);
|
|
|
|
break;
|
2018-02-19 14:04:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
case ONEPARAM_ROUTINE_ENUMCLIPBOARDFORMATS:
|
|
|
|
/* FIXME: Should use UserEnterShared */
|
2017-09-09 12:42:53 +00:00
|
|
|
Result = UserEnumClipboardFormats(Param);
|
|
|
|
break;
|
2018-02-19 14:04:38 +00:00
|
|
|
|
|
|
|
case ONEPARAM_ROUTINE_GETCURSORPOS:
|
|
|
|
{
|
|
|
|
PPOINTL pptl;
|
|
|
|
PTHREADINFO pti = PsGetCurrentThreadWin32Thread();
|
2017-09-09 12:42:53 +00:00
|
|
|
Result = TRUE;
|
|
|
|
if (pti->rpdesk != IntGetActiveDesktop())
|
|
|
|
{
|
|
|
|
Result = FALSE;
|
|
|
|
break;
|
|
|
|
}
|
2018-02-19 14:04:38 +00:00
|
|
|
_SEH2_TRY
|
|
|
|
{
|
|
|
|
ProbeForWrite((POINT*)Param,sizeof(POINT),1);
|
|
|
|
pptl = (PPOINTL)Param;
|
|
|
|
*pptl = gpsi->ptCursor;
|
|
|
|
}
|
2017-09-09 12:42:53 +00:00
|
|
|
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
2018-02-19 14:04:38 +00:00
|
|
|
{
|
2017-09-09 12:42:53 +00:00
|
|
|
Result = FALSE;
|
2018-02-19 14:04:38 +00:00
|
|
|
}
|
|
|
|
_SEH2_END;
|
2017-09-09 12:42:53 +00:00
|
|
|
break;
|
2018-02-19 14:04:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
case ONEPARAM_ROUTINE_SETPROCDEFLAYOUT:
|
|
|
|
{
|
|
|
|
PPROCESSINFO ppi;
|
2018-10-20 08:53:14 +00:00
|
|
|
if (Param & LAYOUT_ORIENTATIONMASK || Param == LAYOUT_LTR)
|
2018-02-19 14:04:38 +00:00
|
|
|
{
|
|
|
|
ppi = PsGetCurrentProcessWin32Process();
|
|
|
|
ppi->dwLayout = Param;
|
2017-09-09 12:42:53 +00:00
|
|
|
Result = TRUE;
|
|
|
|
break;
|
2018-02-19 14:04:38 +00:00
|
|
|
}
|
|
|
|
EngSetLastError(ERROR_INVALID_PARAMETER);
|
2017-09-09 12:42:53 +00:00
|
|
|
Result = FALSE;
|
|
|
|
break;
|
2018-02-19 14:04:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
case ONEPARAM_ROUTINE_GETPROCDEFLAYOUT:
|
|
|
|
{
|
|
|
|
PPROCESSINFO ppi;
|
|
|
|
PDWORD pdwLayout;
|
2017-09-09 12:42:53 +00:00
|
|
|
Result = TRUE;
|
|
|
|
|
2018-02-19 14:04:38 +00:00
|
|
|
if (PsGetCurrentProcess() == gpepCSRSS)
|
|
|
|
{
|
|
|
|
EngSetLastError(ERROR_INVALID_ACCESS);
|
2017-09-09 12:42:53 +00:00
|
|
|
Result = FALSE;
|
|
|
|
break;
|
2018-02-19 14:04:38 +00:00
|
|
|
}
|
2017-09-09 12:42:53 +00:00
|
|
|
|
2018-02-19 14:04:38 +00:00
|
|
|
ppi = PsGetCurrentProcessWin32Process();
|
|
|
|
_SEH2_TRY
|
|
|
|
{
|
|
|
|
pdwLayout = (PDWORD)Param;
|
|
|
|
*pdwLayout = ppi->dwLayout;
|
|
|
|
}
|
2017-09-09 12:42:53 +00:00
|
|
|
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
2018-02-19 14:04:38 +00:00
|
|
|
{
|
|
|
|
SetLastNtError(_SEH2_GetExceptionCode());
|
2017-09-09 12:42:53 +00:00
|
|
|
Result = FALSE;
|
2018-02-19 14:04:38 +00:00
|
|
|
}
|
|
|
|
_SEH2_END;
|
2017-09-09 12:42:53 +00:00
|
|
|
break;
|
2018-02-19 14:04:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
case ONEPARAM_ROUTINE_REPLYMESSAGE:
|
2017-09-09 12:42:53 +00:00
|
|
|
Result = co_MsqReplyMessage((LRESULT)Param);
|
|
|
|
break;
|
2018-02-19 14:04:38 +00:00
|
|
|
|
|
|
|
case ONEPARAM_ROUTINE_MESSAGEBEEP:
|
|
|
|
/* TODO: Implement sound sentry */
|
2017-09-09 12:42:53 +00:00
|
|
|
Result = UserPostMessage(hwndSAS, WM_LOGONNOTIFY, LN_MESSAGE_BEEP, Param);
|
|
|
|
break;
|
2018-02-19 14:04:38 +00:00
|
|
|
|
|
|
|
case ONEPARAM_ROUTINE_CREATESYSTEMTHREADS:
|
2018-12-16 11:16:29 +00:00
|
|
|
Result = UserSystemThreadProc(Param);
|
2017-09-09 12:42:53 +00:00
|
|
|
break;
|
2018-02-19 14:04:38 +00:00
|
|
|
|
|
|
|
case ONEPARAM_ROUTINE_LOCKFOREGNDWINDOW:
|
2017-09-09 12:42:53 +00:00
|
|
|
Result = (DWORD_PTR)IntLockSetForegroundWindow(Param);
|
|
|
|
break;
|
2018-02-19 14:04:38 +00:00
|
|
|
|
|
|
|
case ONEPARAM_ROUTINE_ALLOWSETFOREGND:
|
2017-09-09 12:42:53 +00:00
|
|
|
Result = (DWORD_PTR)IntAllowSetForegroundWindow(Param);
|
|
|
|
break;
|
2018-02-19 14:04:38 +00:00
|
|
|
|
2017-09-09 12:42:53 +00:00
|
|
|
default:
|
|
|
|
ERR("Calling invalid routine number 0x%x in NtUserCallOneParam(), Param=0x%x\n",
|
|
|
|
Routine, Param);
|
|
|
|
EngSetLastError(ERROR_INVALID_PARAMETER);
|
|
|
|
Result = 0;
|
|
|
|
break;
|
2018-02-19 14:04:38 +00:00
|
|
|
}
|
|
|
|
|
2017-09-09 12:42:53 +00:00
|
|
|
TRACE("Leave NtUserCallOneParam, ret=%p\n", (PVOID)Result);
|
|
|
|
UserLeave();
|
2008-03-21 00:07:06 +00:00
|
|
|
|
2017-09-09 12:42:53 +00:00
|
|
|
return Result;
|
2008-03-21 00:07:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* @implemented
|
|
|
|
*/
|
2010-01-05 19:26:32 +00:00
|
|
|
DWORD_PTR
|
2008-11-29 22:48:58 +00:00
|
|
|
APIENTRY
|
2008-03-21 00:07:06 +00:00
|
|
|
NtUserCallTwoParam(
|
2018-02-19 14:04:38 +00:00
|
|
|
DWORD_PTR Param1,
|
|
|
|
DWORD_PTR Param2,
|
|
|
|
DWORD Routine)
|
2008-03-21 00:07:06 +00:00
|
|
|
{
|
2018-02-19 14:04:38 +00:00
|
|
|
PWND Window;
|
2017-09-09 12:42:53 +00:00
|
|
|
DWORD_PTR Ret;
|
2018-02-19 14:04:38 +00:00
|
|
|
TRACE("Enter NtUserCallTwoParam\n");
|
|
|
|
UserEnterExclusive();
|
|
|
|
|
|
|
|
switch (Routine)
|
|
|
|
{
|
|
|
|
case TWOPARAM_ROUTINE_REDRAWTITLE:
|
|
|
|
{
|
|
|
|
Window = UserGetWindowObject((HWND)Param1);
|
|
|
|
Ret = (DWORD_PTR)UserPaintCaption(Window, (INT)Param2);
|
2017-09-09 12:42:53 +00:00
|
|
|
break;
|
2018-02-19 14:04:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
case TWOPARAM_ROUTINE_SETMENUBARHEIGHT:
|
|
|
|
{
|
2014-04-28 03:55:23 +00:00
|
|
|
PMENU MenuObject = IntGetMenuObject((HMENU)Param1);
|
2018-02-19 14:04:38 +00:00
|
|
|
if (!MenuObject)
|
2017-09-09 12:42:53 +00:00
|
|
|
{
|
|
|
|
Ret = 0;
|
|
|
|
break;
|
|
|
|
}
|
2008-03-21 00:07:06 +00:00
|
|
|
|
2018-02-19 14:04:38 +00:00
|
|
|
if (Param2 > 0)
|
2008-03-21 00:07:06 +00:00
|
|
|
{
|
2018-02-19 14:04:38 +00:00
|
|
|
Ret = (MenuObject->cyMenu == (int)Param2);
|
|
|
|
MenuObject->cyMenu = (int)Param2;
|
2008-03-21 00:07:06 +00:00
|
|
|
}
|
|
|
|
else
|
2018-02-19 14:04:38 +00:00
|
|
|
Ret = (DWORD_PTR)MenuObject->cyMenu;
|
2008-03-21 00:07:06 +00:00
|
|
|
IntReleaseMenuObject(MenuObject);
|
2017-09-09 12:42:53 +00:00
|
|
|
break;
|
2018-02-19 14:04:38 +00:00
|
|
|
}
|
2008-03-21 00:07:06 +00:00
|
|
|
|
2018-02-19 14:04:38 +00:00
|
|
|
case TWOPARAM_ROUTINE_SETGUITHRDHANDLE:
|
|
|
|
{
|
2013-05-10 22:28:18 +00:00
|
|
|
PTHREADINFO pti = (PTHREADINFO)PsGetCurrentThreadWin32Thread();
|
|
|
|
ASSERT(pti->MessageQueue);
|
2017-09-09 12:42:53 +00:00
|
|
|
Ret = (DWORD_PTR)MsqSetStateWindow(pti, (ULONG)Param1, (HWND)Param2);
|
|
|
|
break;
|
2018-02-19 14:04:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
case TWOPARAM_ROUTINE_ENABLEWINDOW:
|
2017-09-09 12:42:53 +00:00
|
|
|
Ret = IntEnableWindow((HWND)Param1, (BOOL)Param2);
|
|
|
|
break;
|
2008-03-21 00:07:06 +00:00
|
|
|
|
2018-02-19 14:04:38 +00:00
|
|
|
case TWOPARAM_ROUTINE_SHOWOWNEDPOPUPS:
|
|
|
|
{
|
|
|
|
Window = UserGetWindowObject((HWND)Param1);
|
2017-09-09 12:42:53 +00:00
|
|
|
if (!Window)
|
|
|
|
{
|
|
|
|
Ret = 0;
|
|
|
|
break;
|
|
|
|
}
|
2008-03-21 00:07:06 +00:00
|
|
|
|
2017-09-09 12:42:53 +00:00
|
|
|
Ret = (DWORD_PTR)IntShowOwnedPopups(Window, (BOOL)Param2);
|
|
|
|
break;
|
2018-02-19 14:04:38 +00:00
|
|
|
}
|
2008-03-21 00:07:06 +00:00
|
|
|
|
2018-02-19 14:04:38 +00:00
|
|
|
case TWOPARAM_ROUTINE_ROS_UPDATEUISTATE:
|
|
|
|
{
|
|
|
|
WPARAM wParam;
|
|
|
|
Window = UserGetWindowObject((HWND)Param1);
|
2017-09-09 12:42:53 +00:00
|
|
|
if (!Window)
|
|
|
|
{
|
|
|
|
Ret = 0;
|
|
|
|
break;
|
|
|
|
}
|
2008-03-21 00:07:06 +00:00
|
|
|
|
2018-02-19 14:04:38 +00:00
|
|
|
/* Unpack wParam */
|
|
|
|
wParam = MAKEWPARAM((Param2 >> 3) & 0x3,
|
|
|
|
Param2 & (UISF_HIDEFOCUS | UISF_HIDEACCEL | UISF_ACTIVE));
|
2008-03-21 00:07:06 +00:00
|
|
|
|
2017-09-09 12:42:53 +00:00
|
|
|
Ret = UserUpdateUiState(Window, wParam);
|
|
|
|
break;
|
2018-02-19 14:04:38 +00:00
|
|
|
}
|
2008-03-21 00:07:06 +00:00
|
|
|
|
2018-02-19 14:04:38 +00:00
|
|
|
case TWOPARAM_ROUTINE_SWITCHTOTHISWINDOW:
|
2018-10-27 17:56:16 +00:00
|
|
|
{
|
|
|
|
HWND hwnd = (HWND)Param1;
|
2018-10-27 18:14:04 +00:00
|
|
|
BOOL fAltTab = (BOOL)Param2;
|
2017-09-09 12:42:53 +00:00
|
|
|
Ret = 0;
|
2018-10-27 17:56:16 +00:00
|
|
|
Window = UserGetWindowObject(hwnd);
|
|
|
|
if (!Window)
|
|
|
|
{
|
|
|
|
break;
|
|
|
|
}
|
2019-01-15 04:45:28 +00:00
|
|
|
if (MsqIsHung(Window->head.pti))
|
|
|
|
{
|
|
|
|
// TODO: Make the window ghosted and activate.
|
|
|
|
break;
|
|
|
|
}
|
2018-10-27 18:14:04 +00:00
|
|
|
if (fAltTab)
|
2018-10-27 17:56:16 +00:00
|
|
|
{
|
|
|
|
if (Window->style & WS_MINIMIZE)
|
|
|
|
{
|
|
|
|
UserPostMessage(hwnd, WM_SYSCOMMAND, SC_RESTORE, 0);
|
|
|
|
}
|
2018-10-29 23:13:05 +00:00
|
|
|
/* bring window to top and activate */
|
2018-10-30 08:24:47 +00:00
|
|
|
co_WinPosSetWindowPos(Window, HWND_TOP, 0, 0, 0, 0,
|
|
|
|
SWP_NOSIZE | SWP_NOMOVE | SWP_NOSENDCHANGING |
|
|
|
|
SWP_NOOWNERZORDER | SWP_ASYNCWINDOWPOS);
|
2018-10-29 23:13:05 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
UserSetActiveWindow(Window);
|
2018-10-27 17:56:16 +00:00
|
|
|
}
|
2017-09-09 12:42:53 +00:00
|
|
|
break;
|
2018-10-27 17:56:16 +00:00
|
|
|
}
|
2008-03-21 00:07:06 +00:00
|
|
|
|
2018-02-19 14:04:38 +00:00
|
|
|
case TWOPARAM_ROUTINE_SETCARETPOS:
|
2017-09-09 12:42:53 +00:00
|
|
|
Ret = (DWORD_PTR)co_IntSetCaretPos((int)Param1, (int)Param2);
|
|
|
|
break;
|
2008-03-21 00:07:06 +00:00
|
|
|
|
2018-02-19 14:04:38 +00:00
|
|
|
case TWOPARAM_ROUTINE_REGISTERLOGONPROCESS:
|
2017-09-09 12:42:53 +00:00
|
|
|
Ret = (DWORD_PTR)co_IntRegisterLogonProcess((HANDLE)Param1, (BOOL)Param2);
|
|
|
|
break;
|
2008-03-21 00:07:06 +00:00
|
|
|
|
2018-02-19 14:04:38 +00:00
|
|
|
case TWOPARAM_ROUTINE_SETCURSORPOS:
|
2017-09-09 12:42:53 +00:00
|
|
|
Ret = (DWORD_PTR)UserSetCursorPos((int)Param1, (int)Param2, 0, 0, FALSE);
|
|
|
|
break;
|
2010-01-06 12:44:31 +00:00
|
|
|
|
2018-02-19 14:04:38 +00:00
|
|
|
case TWOPARAM_ROUTINE_UNHOOKWINDOWSHOOK:
|
2017-09-09 12:42:53 +00:00
|
|
|
Ret = IntUnhookWindowsHook((int)Param1, (HOOKPROC)Param2);
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
ERR("Calling invalid routine number 0x%x in NtUserCallTwoParam(), Param1=0x%x Parm2=0x%x\n",
|
|
|
|
Routine, Param1, Param2);
|
|
|
|
EngSetLastError(ERROR_INVALID_PARAMETER);
|
|
|
|
Ret = 0;
|
2018-02-19 14:04:38 +00:00
|
|
|
}
|
2010-01-06 12:44:31 +00:00
|
|
|
|
2008-03-21 00:07:06 +00:00
|
|
|
|
2017-09-09 12:42:53 +00:00
|
|
|
TRACE("Leave NtUserCallTwoParam, ret=%p\n", (PVOID)Ret);
|
2018-02-19 14:04:38 +00:00
|
|
|
UserLeave();
|
2017-09-09 12:42:53 +00:00
|
|
|
|
|
|
|
return Ret;
|
2008-03-21 00:07:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* @unimplemented
|
|
|
|
*/
|
|
|
|
BOOL
|
2008-11-29 22:48:58 +00:00
|
|
|
APIENTRY
|
2008-03-21 00:07:06 +00:00
|
|
|
NtUserCallHwndLock(
|
2018-02-19 14:04:38 +00:00
|
|
|
HWND hWnd,
|
|
|
|
DWORD Routine)
|
2008-03-21 00:07:06 +00:00
|
|
|
{
|
2017-09-09 12:42:53 +00:00
|
|
|
BOOL Ret = FALSE;
|
2018-02-19 14:04:38 +00:00
|
|
|
PWND Window;
|
|
|
|
USER_REFERENCE_ENTRY Ref;
|
|
|
|
|
|
|
|
TRACE("Enter NtUserCallHwndLock\n");
|
|
|
|
UserEnterExclusive();
|
|
|
|
|
|
|
|
if (!(Window = UserGetWindowObject(hWnd)))
|
|
|
|
{
|
2017-09-09 12:42:53 +00:00
|
|
|
Ret = FALSE;
|
|
|
|
goto Exit;
|
2018-02-19 14:04:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
UserRefObjectCo(Window, &Ref);
|
|
|
|
|
|
|
|
/* FIXME: Routine can be 0x53 - 0x5E */
|
|
|
|
switch (Routine)
|
|
|
|
{
|
|
|
|
case HWNDLOCK_ROUTINE_ARRANGEICONICWINDOWS:
|
|
|
|
co_WinPosArrangeIconicWindows(Window);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case HWNDLOCK_ROUTINE_DRAWMENUBAR:
|
|
|
|
{
|
2011-08-21 12:38:52 +00:00
|
|
|
TRACE("HWNDLOCK_ROUTINE_DRAWMENUBAR\n");
|
2008-03-21 00:07:06 +00:00
|
|
|
Ret = TRUE;
|
2010-10-11 03:41:41 +00:00
|
|
|
if ((Window->style & (WS_CHILD | WS_POPUP)) != WS_CHILD)
|
2018-02-19 14:04:38 +00:00
|
|
|
co_WinPosSetWindowPos(Window,
|
2010-03-05 23:10:16 +00:00
|
|
|
HWND_DESKTOP,
|
2018-02-19 14:04:38 +00:00
|
|
|
0, 0, 0, 0,
|
|
|
|
SWP_NOSIZE |
|
|
|
|
SWP_NOMOVE |
|
|
|
|
SWP_NOZORDER |
|
|
|
|
SWP_NOACTIVATE |
|
|
|
|
SWP_FRAMECHANGED);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
case HWNDLOCK_ROUTINE_REDRAWFRAME:
|
|
|
|
co_WinPosSetWindowPos(Window,
|
|
|
|
HWND_DESKTOP,
|
|
|
|
0, 0, 0, 0,
|
|
|
|
SWP_NOSIZE |
|
|
|
|
SWP_NOMOVE |
|
|
|
|
SWP_NOZORDER |
|
|
|
|
SWP_NOACTIVATE |
|
|
|
|
SWP_FRAMECHANGED);
|
|
|
|
Ret = TRUE;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case HWNDLOCK_ROUTINE_REDRAWFRAMEANDHOOK:
|
|
|
|
co_WinPosSetWindowPos(Window,
|
|
|
|
HWND_DESKTOP,
|
|
|
|
0, 0, 0, 0,
|
|
|
|
SWP_NOSIZE |
|
|
|
|
SWP_NOMOVE |
|
|
|
|
SWP_NOZORDER |
|
|
|
|
SWP_NOACTIVATE |
|
|
|
|
SWP_FRAMECHANGED);
|
|
|
|
if (!Window->spwndOwner && !IntGetParent(Window))
|
|
|
|
{
|
|
|
|
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 M 1 0x%p\n", hWnd);
|
|
|
|
Ret = co_IntSetForegroundWindowMouse(Window);
|
|
|
|
TRACE("co_IntSetForegroundWindow M 2 0x%p\n", hWnd);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case HWNDLOCK_ROUTINE_UPDATEWINDOW:
|
|
|
|
co_IntUpdateWindows(Window, RDW_ALLCHILDREN, FALSE);
|
|
|
|
Ret = TRUE;
|
2008-03-21 00:07:06 +00:00
|
|
|
break;
|
2018-02-19 14:04:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
UserDerefObjectCo(Window);
|
|
|
|
|
2017-09-09 12:42:53 +00:00
|
|
|
Exit:
|
|
|
|
TRACE("Leave NtUserCallHwndLock, ret=%u\n", Ret);
|
2018-02-19 14:04:38 +00:00
|
|
|
UserLeave();
|
2017-09-09 12:42:53 +00:00
|
|
|
|
|
|
|
return Ret;
|
2008-03-21 00:07:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* @unimplemented
|
|
|
|
*/
|
|
|
|
HWND
|
2008-11-29 22:48:58 +00:00
|
|
|
APIENTRY
|
2008-03-21 00:07:06 +00:00
|
|
|
NtUserCallHwndOpt(
|
2018-02-19 14:04:38 +00:00
|
|
|
HWND hWnd,
|
|
|
|
DWORD Routine)
|
2008-03-21 00:07:06 +00:00
|
|
|
{
|
2018-02-19 14:04:38 +00:00
|
|
|
switch (Routine)
|
|
|
|
{
|
|
|
|
case HWNDOPT_ROUTINE_SETPROGMANWINDOW:
|
|
|
|
GetW32ThreadInfo()->pDeskInfo->hProgmanWindow = hWnd;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case HWNDOPT_ROUTINE_SETTASKMANWINDOW:
|
|
|
|
GetW32ThreadInfo()->pDeskInfo->hTaskManWindow = hWnd;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return hWnd;
|
2008-03-22 02:53:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
DWORD
|
2008-11-29 22:48:58 +00:00
|
|
|
APIENTRY
|
2008-03-22 02:53:56 +00:00
|
|
|
NtUserCallHwnd(
|
2018-02-19 14:04:38 +00:00
|
|
|
HWND hWnd,
|
|
|
|
DWORD Routine)
|
2008-03-22 02:53:56 +00:00
|
|
|
{
|
2018-02-19 14:04:38 +00:00
|
|
|
switch (Routine)
|
|
|
|
{
|
|
|
|
case HWND_ROUTINE_GETWNDCONTEXTHLPID:
|
|
|
|
{
|
|
|
|
PWND Window;
|
|
|
|
DWORD HelpId;
|
|
|
|
|
|
|
|
UserEnterShared();
|
|
|
|
|
|
|
|
if (!(Window = UserGetWindowObject(hWnd)))
|
|
|
|
{
|
|
|
|
UserLeave();
|
|
|
|
return 0;
|
|
|
|
}
|
2009-07-22 04:11:06 +00:00
|
|
|
|
2018-02-19 14:04:38 +00:00
|
|
|
HelpId = (DWORD)(DWORD_PTR)UserGetProp(Window, gpsi->atomContextHelpIdProp, TRUE);
|
2009-07-22 04:11:06 +00:00
|
|
|
|
|
|
|
UserLeave();
|
2018-02-19 14:04:38 +00:00
|
|
|
return HelpId;
|
|
|
|
}
|
|
|
|
|
|
|
|
case HWND_ROUTINE_REGISTERSHELLHOOKWINDOW:
|
|
|
|
if (IntIsWindow(hWnd))
|
|
|
|
return IntRegisterShellHookWindow(hWnd);
|
|
|
|
return FALSE;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case HWND_ROUTINE_DEREGISTERSHELLHOOKWINDOW:
|
|
|
|
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;
|
|
|
|
|
|
|
|
return 0;
|
2008-03-22 02:53:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
DWORD
|
2008-11-29 22:48:58 +00:00
|
|
|
APIENTRY
|
2008-03-22 02:53:56 +00:00
|
|
|
NtUserCallHwndParam(
|
2018-02-19 14:04:38 +00:00
|
|
|
HWND hWnd,
|
2018-03-18 14:53:52 +00:00
|
|
|
DWORD_PTR Param,
|
2018-02-19 14:04:38 +00:00
|
|
|
DWORD Routine)
|
2008-03-22 02:53:56 +00:00
|
|
|
{
|
Patch by Stefan Ginsberg (stefan__100__ AT hotmail DOT com):
- remove NtUserEnumClipboardFormats, use ->ONEPARAM_ROUTINE_ENUMCLIPBOARDFORMAT insetad
- remove NtUserRegisterClipboardFormat, use NtUserRegisterWIndowsMessage instead
- remove NtUserKillSystemTimer, use HWNDPARAM_ROUTINE_KILLSYSTEMTIMER instead
- remove NtUserInsertMenuItem, use NtUserThunkedMenuItemInfo instead
- remove NtUserGetCapture, use THREADSTATE_CAPTUREWINDOW instead
- remove NtUserGetActiveWindow, use THREADSTATE_ACTIVEWINDOW instead
- remove NtUserGetQueueStatus, use ONEPARAM_ROUTIME_GETQUEUESTATUS instead
- remove NtUserGetLastActivePopup, wasn't implemented
- remove NtUserRealizePalette from ntuser.h, it's not implemented
- remove duplicate NtUserGetLastInputInfo from ntuser.h
- remove PrivateCsrssRergisterPrimitive from user32, it was unused and unimplemented
- remove NtUserDereferenceWndprocHandle, it was unused
- move WNDPROC_INFO structure from ntuser.h to win32k/include/class.h, as it's not used in usermode anymore
tested with AbiWord and FF on VMWare
svn path=/trunk/; revision=32825
2008-04-03 02:13:34 +00:00
|
|
|
|
2018-02-19 14:04:38 +00:00
|
|
|
switch (Routine)
|
|
|
|
{
|
|
|
|
case HWNDPARAM_ROUTINE_KILLSYSTEMTIMER:
|
|
|
|
return IntKillTimer(UserGetWindowObject(hWnd), (UINT_PTR)Param, TRUE);
|
2009-08-12 06:41:20 +00:00
|
|
|
|
2018-02-19 14:04:38 +00:00
|
|
|
case HWNDPARAM_ROUTINE_SETWNDCONTEXTHLPID:
|
|
|
|
{
|
|
|
|
PWND Window;
|
2009-08-12 18:46:34 +00:00
|
|
|
|
2018-02-19 14:04:38 +00:00
|
|
|
UserEnterExclusive();
|
|
|
|
if (!(Window = UserGetWindowObject(hWnd)))
|
|
|
|
{
|
|
|
|
UserLeave();
|
|
|
|
return FALSE;
|
|
|
|
}
|
2009-08-12 18:46:34 +00:00
|
|
|
|
2018-02-19 14:04:38 +00:00
|
|
|
if (Param)
|
|
|
|
UserSetProp(Window, gpsi->atomContextHelpIdProp, (HANDLE)Param, TRUE);
|
|
|
|
else
|
|
|
|
UserRemoveProp(Window, gpsi->atomContextHelpIdProp, TRUE);
|
2009-08-12 18:46:34 +00:00
|
|
|
|
2018-02-19 14:04:38 +00:00
|
|
|
UserLeave();
|
|
|
|
return TRUE;
|
|
|
|
}
|
2009-08-12 06:41:20 +00:00
|
|
|
|
2018-02-19 14:04:38 +00:00
|
|
|
case HWNDPARAM_ROUTINE_SETDIALOGPOINTER:
|
|
|
|
{
|
|
|
|
PWND pWnd;
|
|
|
|
USER_REFERENCE_ENTRY Ref;
|
2009-08-12 06:41:20 +00:00
|
|
|
|
2018-02-19 14:04:38 +00:00
|
|
|
UserEnterExclusive();
|
2009-08-12 06:41:20 +00:00
|
|
|
|
2018-02-19 14:04:38 +00:00
|
|
|
if (!(pWnd = UserGetWindowObject(hWnd)))
|
2009-08-12 06:41:20 +00:00
|
|
|
{
|
2018-02-19 14:04:38 +00:00
|
|
|
UserLeave();
|
|
|
|
return 0;
|
2009-08-12 06:41:20 +00:00
|
|
|
}
|
2018-02-19 14:04:38 +00:00
|
|
|
UserRefObjectCo(pWnd, &Ref);
|
|
|
|
|
|
|
|
if (pWnd->head.pti->ppi == PsGetCurrentProcessWin32Process() &&
|
|
|
|
pWnd->cbwndExtra == DLGWINDOWEXTRA &&
|
|
|
|
!(pWnd->state & WNDS_SERVERSIDEWINDOWPROC))
|
2009-08-12 06:41:20 +00:00
|
|
|
{
|
2018-02-19 14:04:38 +00:00
|
|
|
if (Param)
|
|
|
|
{
|
|
|
|
if (!pWnd->fnid) pWnd->fnid = FNID_DIALOG;
|
|
|
|
pWnd->state |= WNDS_DIALOGWINDOW;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
pWnd->fnid |= FNID_DESTROY;
|
|
|
|
pWnd->state &= ~WNDS_DIALOGWINDOW;
|
|
|
|
}
|
2009-08-12 06:41:20 +00:00
|
|
|
}
|
2018-02-19 14:04:38 +00:00
|
|
|
|
|
|
|
UserDerefObjectCo(pWnd);
|
|
|
|
UserLeave();
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
case HWNDPARAM_ROUTINE_ROS_NOTIFYWINEVENT:
|
|
|
|
{
|
|
|
|
PWND pWnd;
|
|
|
|
PNOTIFYEVENT pne;
|
|
|
|
UserEnterExclusive();
|
|
|
|
pne = (PNOTIFYEVENT)Param;
|
|
|
|
if (hWnd)
|
|
|
|
pWnd = UserGetWindowObject(hWnd);
|
|
|
|
else
|
|
|
|
pWnd = NULL;
|
|
|
|
IntNotifyWinEvent(pne->event, pWnd, pne->idObject, pne->idChild, pne->flags);
|
|
|
|
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();
|
2010-10-23 05:36:12 +00:00
|
|
|
pWnd = UserGetWindowObject(hWnd);
|
2018-02-19 14:04:38 +00:00
|
|
|
if (pWnd) IntSetWindowState(pWnd, (UINT)Param);
|
|
|
|
UserLeave();
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
STUB;
|
|
|
|
|
|
|
|
return 0;
|
2008-03-22 02:53:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
DWORD
|
2008-11-29 22:48:58 +00:00
|
|
|
APIENTRY
|
2008-03-22 02:53:56 +00:00
|
|
|
NtUserCallHwndParamLock(
|
2018-02-19 14:04:38 +00:00
|
|
|
HWND hWnd,
|
2018-03-18 14:53:52 +00:00
|
|
|
DWORD_PTR Param,
|
2018-02-19 14:04:38 +00:00
|
|
|
DWORD Routine)
|
2008-03-22 02:53:56 +00:00
|
|
|
{
|
2017-09-09 12:42:53 +00:00
|
|
|
DWORD Ret = FALSE;
|
2018-02-19 14:04:38 +00:00
|
|
|
PWND Window;
|
|
|
|
USER_REFERENCE_ENTRY Ref;
|
|
|
|
|
|
|
|
TRACE("Enter NtUserCallHwndParamLock\n");
|
|
|
|
UserEnterExclusive();
|
|
|
|
|
|
|
|
if (!(Window = UserGetWindowObject(hWnd)))
|
|
|
|
{
|
2017-09-09 12:42:53 +00:00
|
|
|
Ret = FALSE;
|
|
|
|
goto Exit;
|
2018-02-19 14:04:38 +00:00
|
|
|
}
|
2017-09-09 12:42:53 +00:00
|
|
|
|
2018-02-19 14:04:38 +00:00
|
|
|
UserRefObjectCo(Window, &Ref);
|
|
|
|
|
|
|
|
switch (Routine)
|
|
|
|
{
|
|
|
|
case TWOPARAM_ROUTINE_VALIDATERGN:
|
|
|
|
{
|
|
|
|
PREGION Rgn = REGION_LockRgn((HRGN)Param);
|
|
|
|
Ret = (DWORD)co_UserRedrawWindow(Window, NULL, Rgn, RDW_VALIDATE);
|
|
|
|
if (Rgn) REGION_UnlockRgn(Rgn);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
UserDerefObjectCo(Window);
|
|
|
|
|
2017-09-09 12:42:53 +00:00
|
|
|
Exit:
|
2010-01-30 04:23:58 +00:00
|
|
|
|
2017-09-09 12:42:53 +00:00
|
|
|
TRACE("Leave NtUserCallHwndParamLock, ret=%lu\n", Ret);
|
2018-02-19 14:04:38 +00:00
|
|
|
UserLeave();
|
2008-03-22 02:53:56 +00:00
|
|
|
|
2017-09-09 12:42:53 +00:00
|
|
|
return Ret;
|
2008-03-21 00:07:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* EOF */
|