Author: jimtabor
Date: Sat Jul 12 19:24:05 2008
New Revision: 34443
URL:
http://svn.reactos.org/svn/reactos?rev=34443&view=rev
Log:
The rest of rev 34442.
Modified:
trunk/reactos/subsystems/win32/win32k/ntuser/class.c
trunk/reactos/subsystems/win32/win32k/ntuser/message.c
trunk/reactos/subsystems/win32/win32k/ntuser/ntstubs.c
trunk/reactos/subsystems/win32/win32k/ntuser/simplecall.c
trunk/reactos/subsystems/win32/win32k/ntuser/window.c
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/class.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/class.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/class.c [iso-8859-1] Sat Jul 12 19:24:05
2008
@@ -16,8 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id$
- *
+/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
* PURPOSE: Window classes
@@ -1855,7 +1854,7 @@
pi);
if (Class != NULL)
{
- Class->ClassId = SystemClasses[i].ClassId;
+ Class->fnID = SystemClasses[i].ClassId;
ASSERT(Class->System);
Class->Next = pi->SystemClassList;
@@ -1985,6 +1984,111 @@
return Ret;
}
+
+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
@@ -2116,7 +2220,7 @@
BOOL NTAPI
NtUserUnregisterClass(IN PUNICODE_STRING ClassNameOrAtom,
IN HINSTANCE hInstance,
- DWORD Unknown)
+ OUT PCLSMENUNAME pClassMenuName)
{
UNICODE_STRING CapturedClassName;
BOOL Ret = FALSE;
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/message.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/message.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/message.c [iso-8859-1] Sat Jul 12
19:24:05 2008
@@ -1052,20 +1052,6 @@
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
CopyMsgToKernelMem(MSG *KernelModeMsg, MSG *UserModeMsg, PMSGMEMORY MsgMemoryEntry)
@@ -1844,6 +1830,82 @@
return TRUE;
}
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
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/ntstubs.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/ntstubs.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/ntstubs.c [iso-8859-1] Sat Jul 12
19:24:05 2008
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
* PURPOSE: Native User stubs
@@ -909,22 +908,6 @@
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
NTAPI
NtUserRegisterUserApiHook(
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/simplecall.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/simplecall.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/simplecall.c [iso-8859-1] Sat Jul 12
19:24:05 2008
@@ -510,31 +510,6 @@
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:
{
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/window.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/window.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/window.c [iso-8859-1] Sat Jul 12 19:24:05
2008
@@ -4701,7 +4701,6 @@
END_CLEANUP;
}
-#define WIN_NEEDS_SHOW_OWNEDPOPUP (0x00000040)
BOOL
FASTCALL
@@ -4711,9 +4710,9 @@
PWINDOW_OBJECT pWnd;
HWND *win_array;
- ASSERT(OwnerWnd);
-
- win_array = IntWinListChildren(OwnerWnd);//faxme: use desktop?
+// ASSERT(OwnerWnd);
+
+ win_array = IntWinListChildren(UserGetWindowObject(IntGetDesktopWindow()));
if (!win_array)
return TRUE;