mirror of
https://github.com/reactos/reactos.git
synced 2024-07-04 19:54:58 +00:00
The rest of rev 34442.
svn path=/trunk/; revision=34443
This commit is contained in:
parent
48885ed2c4
commit
b17c0af25f
|
@ -16,8 +16,7 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
/* $Id$
|
/*
|
||||||
*
|
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
* PURPOSE: Window classes
|
* PURPOSE: Window classes
|
||||||
|
@ -1855,7 +1854,7 @@ UserRegisterSystemClasses(IN ULONG Count,
|
||||||
pi);
|
pi);
|
||||||
if (Class != NULL)
|
if (Class != NULL)
|
||||||
{
|
{
|
||||||
Class->ClassId = SystemClasses[i].ClassId;
|
Class->fnID = SystemClasses[i].ClassId;
|
||||||
|
|
||||||
ASSERT(Class->System);
|
ASSERT(Class->System);
|
||||||
Class->Next = pi->SystemClassList;
|
Class->Next = pi->SystemClassList;
|
||||||
|
@ -1986,6 +1985,111 @@ InvalidParameter:
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
RTL_ATOM
|
||||||
|
NTAPI
|
||||||
|
NtUserRegisterClassExWOW(
|
||||||
|
WNDCLASSEXW* lpwcx,
|
||||||
|
PUNICODE_STRING ClassName,
|
||||||
|
PUNICODE_STRING ClsNVersion,
|
||||||
|
PCLSMENUNAME pClassMenuName,
|
||||||
|
DWORD fnID,
|
||||||
|
DWORD Flags,
|
||||||
|
LPDWORD pWow)
|
||||||
|
{
|
||||||
|
WNDCLASSEXW CapturedClassInfo = {0};
|
||||||
|
UNICODE_STRING CapturedName = {0}, ClassnametoVersion = {0};
|
||||||
|
RTL_ATOM Ret = (RTL_ATOM)0;
|
||||||
|
|
||||||
|
UserEnterExclusive();
|
||||||
|
|
||||||
|
_SEH_TRY
|
||||||
|
{
|
||||||
|
/* Probe the parameters and basic parameter checks */
|
||||||
|
if (ProbeForReadUint(&lpwcx->cbSize) != sizeof(WNDCLASSEXW))
|
||||||
|
{
|
||||||
|
goto InvalidParameter;
|
||||||
|
}
|
||||||
|
if (!pClassMenuName)
|
||||||
|
{
|
||||||
|
goto InvalidParameter;
|
||||||
|
}
|
||||||
|
|
||||||
|
ProbeForRead(lpwcx,
|
||||||
|
sizeof(WNDCLASSEXW),
|
||||||
|
sizeof(ULONG));
|
||||||
|
RtlCopyMemory(&CapturedClassInfo,
|
||||||
|
lpwcx,
|
||||||
|
sizeof(WNDCLASSEXW));
|
||||||
|
/*
|
||||||
|
Need to watch this. When UnregisterClass is called these pointers
|
||||||
|
are freed by the caller in user space. So, we just probe the data
|
||||||
|
for now and pass it on and copy it to the shared class structure.
|
||||||
|
*/
|
||||||
|
ProbeForRead(pClassMenuName,
|
||||||
|
sizeof(CLSMENUNAME),
|
||||||
|
sizeof(ULONG));
|
||||||
|
|
||||||
|
CapturedName = ProbeForReadUnicodeString(ClassName);
|
||||||
|
ClassnametoVersion = ProbeForReadUnicodeString(ClsNVersion);
|
||||||
|
|
||||||
|
if (CapturedName.Length & 1 || ClassnametoVersion.Length & 1 ||
|
||||||
|
CapturedClassInfo.cbClsExtra < 0 ||
|
||||||
|
CapturedClassInfo.cbClsExtra + CapturedName.Length +
|
||||||
|
ClassnametoVersion.Length + sizeof(WINDOWCLASS) < CapturedClassInfo.cbClsExtra ||
|
||||||
|
CapturedClassInfo.cbWndExtra < 0 ||
|
||||||
|
CapturedClassInfo.hInstance == NULL)
|
||||||
|
{
|
||||||
|
goto InvalidParameter;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (CapturedName.Length != 0)
|
||||||
|
{
|
||||||
|
ProbeForRead(CapturedName.Buffer,
|
||||||
|
CapturedName.Length,
|
||||||
|
sizeof(WCHAR));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (!IS_ATOM(CapturedName.Buffer))
|
||||||
|
{
|
||||||
|
goto InvalidParameter;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ClassnametoVersion.Length != 0)
|
||||||
|
{
|
||||||
|
ProbeForRead(ClassnametoVersion.Buffer,
|
||||||
|
ClassnametoVersion.Length,
|
||||||
|
sizeof(WCHAR));
|
||||||
|
}
|
||||||
|
else if (ClassnametoVersion.Buffer != NULL &&
|
||||||
|
!IS_INTRESOURCE(ClassnametoVersion.Buffer))
|
||||||
|
{
|
||||||
|
InvalidParameter:
|
||||||
|
SetLastWin32Error(ERROR_INVALID_PARAMETER);
|
||||||
|
_SEH_LEAVE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Register the class */
|
||||||
|
// Ret = UserRegisterClass(&CapturedClassInfo,
|
||||||
|
// &CapturedName,
|
||||||
|
// &ClassnametoVersion,
|
||||||
|
// hMenu, /* FIXME - pass pointer */
|
||||||
|
// wpExtra,
|
||||||
|
// Flags);
|
||||||
|
|
||||||
|
}
|
||||||
|
_SEH_HANDLE
|
||||||
|
{
|
||||||
|
SetLastNtError(_SEH_GetExceptionCode());
|
||||||
|
}
|
||||||
|
_SEH_END;
|
||||||
|
|
||||||
|
UserLeave();
|
||||||
|
|
||||||
|
return Ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
ULONG_PTR NTAPI
|
ULONG_PTR NTAPI
|
||||||
NtUserGetClassLong(IN HWND hWnd,
|
NtUserGetClassLong(IN HWND hWnd,
|
||||||
|
@ -2116,7 +2220,7 @@ NtUserSetClassWord(
|
||||||
BOOL NTAPI
|
BOOL NTAPI
|
||||||
NtUserUnregisterClass(IN PUNICODE_STRING ClassNameOrAtom,
|
NtUserUnregisterClass(IN PUNICODE_STRING ClassNameOrAtom,
|
||||||
IN HINSTANCE hInstance,
|
IN HINSTANCE hInstance,
|
||||||
DWORD Unknown)
|
OUT PCLSMENUNAME pClassMenuName)
|
||||||
{
|
{
|
||||||
UNICODE_STRING CapturedClassName;
|
UNICODE_STRING CapturedClassName;
|
||||||
BOOL Ret = FALSE;
|
BOOL Ret = FALSE;
|
||||||
|
|
|
@ -1052,20 +1052,6 @@ CLEANUP:
|
||||||
END_CLEANUP;
|
END_CLEANUP;
|
||||||
}
|
}
|
||||||
|
|
||||||
LRESULT STDCALL
|
|
||||||
NtUserMessageCall(
|
|
||||||
HWND hWnd,
|
|
||||||
UINT Msg,
|
|
||||||
WPARAM wParam,
|
|
||||||
LPARAM lParam,
|
|
||||||
ULONG_PTR ResultInfo,
|
|
||||||
DWORD dwType,
|
|
||||||
BOOL Ansi)
|
|
||||||
{
|
|
||||||
UNIMPLEMENTED
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static NTSTATUS FASTCALL
|
static NTSTATUS FASTCALL
|
||||||
CopyMsgToKernelMem(MSG *KernelModeMsg, MSG *UserModeMsg, PMSGMEMORY MsgMemoryEntry)
|
CopyMsgToKernelMem(MSG *KernelModeMsg, MSG *UserModeMsg, PMSGMEMORY MsgMemoryEntry)
|
||||||
|
@ -1846,6 +1832,82 @@ IntUninitMessagePumpHook()
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
Win32k counterpart of User DefWindowProc
|
||||||
|
*/
|
||||||
|
LRESULT FASTCALL
|
||||||
|
IntDefWindowProc(
|
||||||
|
PWINDOW_OBJECT Window,
|
||||||
|
UINT Msg,
|
||||||
|
WPARAM wParam,
|
||||||
|
LPARAM lParam)
|
||||||
|
{
|
||||||
|
PWINDOW Wnd;
|
||||||
|
|
||||||
|
if (Msg > WM_USER) return 0;
|
||||||
|
|
||||||
|
Wnd = Window->Wnd;
|
||||||
|
if (!Wnd) return 0;
|
||||||
|
|
||||||
|
switch (Msg)
|
||||||
|
{
|
||||||
|
case WM_SHOWWINDOW:
|
||||||
|
{
|
||||||
|
if ((Wnd->Style & WS_VISIBLE) && wParam) break;
|
||||||
|
if (!(Wnd->Style & WS_VISIBLE) && !wParam) break;
|
||||||
|
if (!Window->hOwner) break;
|
||||||
|
if (LOWORD(lParam))
|
||||||
|
{
|
||||||
|
if (wParam)
|
||||||
|
{
|
||||||
|
if (!(Window->Flags & WIN_NEEDS_SHOW_OWNEDPOPUP)) break;
|
||||||
|
Window->Flags &= ~WIN_NEEDS_SHOW_OWNEDPOPUP;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
Window->Flags |= WIN_NEEDS_SHOW_OWNEDPOPUP;
|
||||||
|
|
||||||
|
co_WinPosShowWindow(Window, wParam ? SW_SHOWNOACTIVATE : SW_HIDE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
LRESULT STDCALL
|
||||||
|
NtUserMessageCall(
|
||||||
|
HWND hWnd,
|
||||||
|
UINT Msg,
|
||||||
|
WPARAM wParam,
|
||||||
|
LPARAM lParam,
|
||||||
|
ULONG_PTR ResultInfo,
|
||||||
|
DWORD dwType, // fnID?
|
||||||
|
BOOL Ansi)
|
||||||
|
{
|
||||||
|
LRESULT lResult = 0;
|
||||||
|
PWINDOW_OBJECT Window = NULL;
|
||||||
|
|
||||||
|
UserEnterExclusive();
|
||||||
|
|
||||||
|
/* Validate input */
|
||||||
|
if (hWnd && (hWnd != INVALID_HANDLE_VALUE) && !(Window = UserGetWindowObject(hWnd)))
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch(dwType)
|
||||||
|
{
|
||||||
|
case NUMC_DEFWINDOWPROC:
|
||||||
|
lResult = IntDefWindowProc(Window, Msg, wParam, lParam);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
UserLeave();
|
||||||
|
return lResult;
|
||||||
|
}
|
||||||
|
|
||||||
#define INFINITE 0xFFFFFFFF
|
#define INFINITE 0xFFFFFFFF
|
||||||
#define WAIT_FAILED ((DWORD)0xFFFFFFFF)
|
#define WAIT_FAILED ((DWORD)0xFFFFFFFF)
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
/* $Id$
|
/*
|
||||||
*
|
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
* PURPOSE: Native User stubs
|
* PURPOSE: Native User stubs
|
||||||
|
@ -909,22 +908,6 @@ NtUserRealWaitMessageEx(
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* http://www.reactos.org/pipermail/ros-kernel/2003-November/000589.html */
|
|
||||||
HWINSTA
|
|
||||||
NTAPI
|
|
||||||
NtUserRegisterClassExWOW(
|
|
||||||
CONST WNDCLASSEXW* lpwcx,
|
|
||||||
BOOL bUnicodeClass,
|
|
||||||
WNDPROC wpExtra,
|
|
||||||
DWORD dwUnknown4,
|
|
||||||
DWORD dwUnknown5,
|
|
||||||
DWORD dwUnknown6,
|
|
||||||
DWORD dwUnknown7)
|
|
||||||
{
|
|
||||||
UNIMPLEMENTED;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
DWORD
|
DWORD
|
||||||
NTAPI
|
NTAPI
|
||||||
NtUserRegisterUserApiHook(
|
NtUserRegisterUserApiHook(
|
||||||
|
|
|
@ -511,31 +511,6 @@ NtUserCallTwoParam(
|
||||||
RETURN( (DWORD)IntShowOwnedPopups(Window, (BOOL) Param2));
|
RETURN( (DWORD)IntShowOwnedPopups(Window, (BOOL) Param2));
|
||||||
}
|
}
|
||||||
|
|
||||||
case TWOPARAM_ROUTINE_ROS_SHOWWINDOW:
|
|
||||||
{
|
|
||||||
#define WIN_NEEDS_SHOW_OWNEDPOPUP (0x00000040)
|
|
||||||
DPRINT1("ROS_SHOWWINDOW\n");
|
|
||||||
|
|
||||||
if (!(Window = UserGetWindowObject((HWND)Param1)))
|
|
||||||
{
|
|
||||||
RETURN( 1 );
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Param2)
|
|
||||||
{
|
|
||||||
if (!(Window->Flags & WIN_NEEDS_SHOW_OWNEDPOPUP))
|
|
||||||
{
|
|
||||||
RETURN( -1 );
|
|
||||||
}
|
|
||||||
Window->Flags &= ~WIN_NEEDS_SHOW_OWNEDPOPUP;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
Window->Flags |= WIN_NEEDS_SHOW_OWNEDPOPUP;
|
|
||||||
|
|
||||||
DPRINT1("ROS_SHOWWINDOW ---> 0x%x\n",Window->Flags);
|
|
||||||
RETURN( 0 );
|
|
||||||
}
|
|
||||||
|
|
||||||
case TWOPARAM_ROUTINE_ROS_UPDATEUISTATE:
|
case TWOPARAM_ROUTINE_ROS_UPDATEUISTATE:
|
||||||
{
|
{
|
||||||
WPARAM wParam;
|
WPARAM wParam;
|
||||||
|
|
|
@ -4701,7 +4701,6 @@ CLEANUP:
|
||||||
END_CLEANUP;
|
END_CLEANUP;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define WIN_NEEDS_SHOW_OWNEDPOPUP (0x00000040)
|
|
||||||
|
|
||||||
BOOL
|
BOOL
|
||||||
FASTCALL
|
FASTCALL
|
||||||
|
@ -4711,9 +4710,9 @@ IntShowOwnedPopups(PWINDOW_OBJECT OwnerWnd, BOOL fShow )
|
||||||
PWINDOW_OBJECT pWnd;
|
PWINDOW_OBJECT pWnd;
|
||||||
HWND *win_array;
|
HWND *win_array;
|
||||||
|
|
||||||
ASSERT(OwnerWnd);
|
// ASSERT(OwnerWnd);
|
||||||
|
|
||||||
win_array = IntWinListChildren(OwnerWnd);//faxme: use desktop?
|
win_array = IntWinListChildren(UserGetWindowObject(IntGetDesktopWindow()));
|
||||||
|
|
||||||
if (!win_array)
|
if (!win_array)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
Loading…
Reference in a new issue