Author: jimtabor
Date: Wed Aug 12 20:46:34 2009
New Revision: 42637
URL:
http://svn.reactos.org/svn/reactos?rev=42637&view=rev
Log:
- Move GetWindowInfo support into user32. Use HWNDPARAM for SetWindowContextHelpId.
Modified:
trunk/reactos/dll/win32/user32/include/user32.h
trunk/reactos/dll/win32/user32/include/user32p.h
trunk/reactos/dll/win32/user32/windows/window.c
trunk/reactos/include/reactos/win32k/ntuser.h
trunk/reactos/subsystems/win32/win32k/ntuser/simplecall.c
trunk/reactos/subsystems/win32/win32k/ntuser/window.c
Modified: trunk/reactos/dll/win32/user32/include/user32.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/include/u…
==============================================================================
--- trunk/reactos/dll/win32/user32/include/user32.h [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/user32/include/user32.h [iso-8859-1] Wed Aug 12 20:46:34 2009
@@ -119,3 +119,4 @@
VOID FASTCALL GetConnected(VOID);
BOOL FASTCALL DefSetText(HWND hWnd, PCWSTR String, BOOL Ansi);
BOOL FASTCALL TestWindowProcess(PWND);
+VOID UserGetWindowBorders(DWORD, DWORD, SIZE *, BOOL);
Modified: trunk/reactos/dll/win32/user32/include/user32p.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/include/u…
==============================================================================
--- trunk/reactos/dll/win32/user32/include/user32p.h [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/user32/include/user32p.h [iso-8859-1] Wed Aug 12 20:46:34
2009
@@ -41,7 +41,7 @@
(BOOL)NtUserCallTwoParam((DWORD)hWnd, (DWORD)hRgn, TWOPARAM_ROUTINE_VALIDATERGN)
#define NtUserSetWindowContextHelpId(hWnd, dwContextHelpId) \
- (BOOL)NtUserCallTwoParam((DWORD)hwnd, dwContextHelpId,
TWOPARAM_ROUTINE_SETWNDCONTEXTHLPID)
+ (BOOL)NtUserCallTwoParam((DWORD)hwnd, dwContextHelpId,
HWNDPARAM_ROUTINE_SETWNDCONTEXTHLPID)
#define NtUserSetCaretPos(X, Y) \
(BOOL)NtUserCallTwoParam((DWORD)X, (DWORD)Y, TWOPARAM_ROUTINE_SETCARETPOS)
@@ -54,9 +54,6 @@
#define NtUserSetMenuBarHeight(menu, height) \
(BOOL)NtUserCallTwoParam((DWORD)menu, (DWORD)height,
TWOPARAM_ROUTINE_SETMENUBARHEIGHT)
-
-#define NtUserGetWindowInfo(hwnd, pwi) \
- (BOOL)NtUserCallTwoParam((DWORD)hwnd, (DWORD)pwi, TWOPARAM_ROUTINE_GETWINDOWINFO)
#define NtUserRegisterLogonProcess(hproc, x) \
(BOOL)NtUserCallTwoParam((DWORD)hproc, (DWORD)x, TWOPARAM_ROUTINE_REGISTERLOGONPROC)
Modified: trunk/reactos/dll/win32/user32/windows/window.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/windows/w…
==============================================================================
--- trunk/reactos/dll/win32/user32/windows/window.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/user32/windows/window.c [iso-8859-1] Wed Aug 12 20:46:34 2009
@@ -1043,10 +1043,63 @@
* @implemented
*/
BOOL WINAPI
-GetWindowInfo(HWND hwnd,
+GetWindowInfo(HWND hWnd,
PWINDOWINFO pwi)
{
- return NtUserGetWindowInfo(hwnd, pwi);
+ PWND pWnd;
+ PCLS pCls = NULL;
+ SIZE Size = {0,0};
+ BOOL Ret = FALSE;
+
+ if ( !pwi || pwi->cbSize != sizeof(WINDOWINFO))
+ SetLastError(ERROR_INVALID_PARAMETER); // Just set the error and go!
+
+ pWnd = ValidateHwnd(hWnd);
+ if (!pWnd)
+ return Ret;
+
+ UserGetWindowBorders(pWnd->style, pWnd->ExStyle, &Size, FALSE);
+
+ _SEH2_TRY
+ {
+ pCls = DesktopPtrToUser(pWnd->pcls);
+ pwi->rcWindow = pWnd->rcWindow;
+ pwi->rcClient = pWnd->rcClient;
+ pwi->dwStyle = pWnd->style;
+ pwi->dwExStyle = pWnd->ExStyle;
+ pwi->cxWindowBorders = Size.cx;
+ pwi->cyWindowBorders = Size.cy;
+ pwi->dwWindowStatus = 0;
+ if (pWnd->state & WNDS_ACTIVEFRAME)
+ pwi->dwWindowStatus = WS_ACTIVECAPTION;
+ pwi->atomWindowType = (pCls ? pCls->atomClassName : 0 );
+
+ if ( pWnd->state2 & WNDS2_WIN50COMPAT )
+ {
+ pwi->wCreatorVersion = 0x500;
+ }
+ else if ( pWnd->state2 & WNDS2_WIN40COMPAT )
+ {
+ pwi->wCreatorVersion = 0x400;
+ }
+ else if ( pWnd->state2 & WNDS2_WIN31COMPAT )
+ {
+ pwi->wCreatorVersion = 0x30A;
+ }
+ else
+ {
+ pwi->wCreatorVersion = 0x300;
+ }
+
+ Ret = TRUE;
+ }
+ _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
+ {
+ /* Do nothing */
+ }
+ _SEH2_END;
+
+ return Ret;
}
Modified: trunk/reactos/include/reactos/win32k/ntuser.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/win32k/ntu…
==============================================================================
--- trunk/reactos/include/reactos/win32k/ntuser.h [iso-8859-1] (original)
+++ trunk/reactos/include/reactos/win32k/ntuser.h [iso-8859-1] Wed Aug 12 20:46:34 2009
@@ -3051,9 +3051,7 @@
#define MSQ_STATE_MENUOWNER 0x4
#define MSQ_STATE_MOVESIZE 0x5
#define MSQ_STATE_CARET 0x6
-#define TWOPARAM_ROUTINE_SETWNDCONTEXTHLPID 0xfffd0058 // use
HWNDPARAM_ROUTINE_SETWNDCONTEXTHLPID
#define TWOPARAM_ROUTINE_SETCARETPOS 0xfffd0060
-#define TWOPARAM_ROUTINE_GETWINDOWINFO 0xfffd0061
#define TWOPARAM_ROUTINE_REGISTERLOGONPROC 0xfffd0062
#define TWOPARAM_ROUTINE_ROS_ISACTIVEICON 0x1001
#define TWOPARAM_ROUTINE_ROS_NCDESTROY 0x1002
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] Wed Aug 12
20:46:34 2009
@@ -514,64 +514,9 @@
UNIMPLEMENTED
RETURN( 0);
- case TWOPARAM_ROUTINE_SETWNDCONTEXTHLPID:
-
- if(!(Window = UserGetWindowObject((HWND)Param1)))
- {
- RETURN( (DWORD)FALSE);
- }
-
- if ( Param2 )
- IntSetProp(Window, gpsi->atomContextHelpIdProp, (HANDLE)Param2);
- else
- IntRemoveProp(Window, gpsi->atomContextHelpIdProp);
-
- RETURN( (DWORD)TRUE);
case TWOPARAM_ROUTINE_SETCARETPOS:
RETURN( (DWORD)co_IntSetCaretPos((int)Param1, (int)Param2));
-
- case TWOPARAM_ROUTINE_GETWINDOWINFO:
- {
- WINDOWINFO wi;
- DWORD Ret;
-
- if(!(Window = UserGetWindowObject((HWND)Param1)))
- {
- RETURN( FALSE);
- }
-
-#if 0
- /*
- * According to WINE, Windows' doesn't check the cbSize field
- */
-
- Status = MmCopyFromCaller(&wi.cbSize, (PVOID)Param2, sizeof(wi.cbSize));
- if(!NT_SUCCESS(Status))
- {
- SetLastNtError(Status);
- RETURN( FALSE);
- }
-
- if(wi.cbSize != sizeof(WINDOWINFO))
- {
- SetLastWin32Error(ERROR_INVALID_PARAMETER);
- RETURN( FALSE);
- }
-#endif
-
- if((Ret = (DWORD)IntGetWindowInfo(Window, &wi)))
- {
- Status = MmCopyToCaller((PVOID)Param2, &wi, sizeof(WINDOWINFO));
- if(!NT_SUCCESS(Status))
- {
- SetLastNtError(Status);
- RETURN( FALSE);
- }
- }
-
- RETURN( Ret);
- }
case TWOPARAM_ROUTINE_REGISTERLOGONPROC:
RETURN( (DWORD)co_IntRegisterLogonProcess((HANDLE)Param1, (BOOL)Param2));
@@ -803,6 +748,26 @@
case HWNDPARAM_ROUTINE_KILLSYSTEMTIMER:
return IntKillTimer(hWnd, (UINT_PTR)Param, TRUE);
+ case HWNDPARAM_ROUTINE_SETWNDCONTEXTHLPID:
+ {
+ PWINDOW_OBJECT Window;
+
+ UserEnterExclusive();
+ if(!(Window = UserGetWindowObject(hWnd)))
+ {
+ UserLeave();
+ return FALSE;
+ }
+
+ if ( Param )
+ IntSetProp(Window, gpsi->atomContextHelpIdProp, (HANDLE)Param);
+ else
+ IntRemoveProp(Window, gpsi->atomContextHelpIdProp);
+
+ UserLeave();
+ return TRUE;
+ }
+
case HWNDPARAM_ROUTINE_SETDIALOGPOINTER:
{
PWINDOW_OBJECT Window;
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] Wed Aug 12 20:46:34
2009
@@ -1678,6 +1678,7 @@
Wnd->head.pti = ti;
Wnd->head.rpdesk = pti->Desktop;
Wnd->hWndLastActive = hWnd;
+ Wnd->state2 |= WNDS2_WIN40COMPAT;
}
DPRINT("Created object with handle %X\n", hWnd);