Author: spetreolle
Date: Sat Nov 14 19:25:03 2009
New Revision: 44162
URL:
http://svn.reactos.org/svn/reactos?rev=44162&view=rev
Log:
fix win32k build.
Modified:
branches/pierre-fsd/include/psdk/winuser.h
branches/pierre-fsd/include/reactos/win32k/ntuser.h
branches/pierre-fsd/subsystems/win32/win32k/include/dc.h
branches/pierre-fsd/subsystems/win32/win32k/include/eng.h
branches/pierre-fsd/subsystems/win32/win32k/include/gdifloat.h
branches/pierre-fsd/subsystems/win32/win32k/include/hook.h
branches/pierre-fsd/subsystems/win32/win32k/include/msgqueue.h
branches/pierre-fsd/subsystems/win32/win32k/include/window.h
branches/pierre-fsd/subsystems/win32/win32k/ntuser/defwnd.c
branches/pierre-fsd/subsystems/win32/win32k/ntuser/event.c
branches/pierre-fsd/subsystems/win32/win32k/ntuser/hook.c
branches/pierre-fsd/subsystems/win32/win32k/ntuser/message.c
branches/pierre-fsd/subsystems/win32/win32k/objects/color.c
branches/pierre-fsd/subsystems/win32/win32k/objects/dc.c
branches/pierre-fsd/subsystems/win32/win32k/objects/dcutil.c
branches/pierre-fsd/subsystems/win32/win32k/objects/fillshap.c
branches/pierre-fsd/subsystems/win32/win32k/objects/path.c
Modified: branches/pierre-fsd/include/psdk/winuser.h
URL:
http://svn.reactos.org/svn/reactos/branches/pierre-fsd/include/psdk/winuser…
==============================================================================
--- branches/pierre-fsd/include/psdk/winuser.h [iso-8859-1] (original)
+++ branches/pierre-fsd/include/psdk/winuser.h [iso-8859-1] Sat Nov 14 19:25:03 2009
@@ -1172,6 +1172,12 @@
#define SMTO_ABORTIFHUNG 2
#define SMTO_BLOCK 1
#define SMTO_NORMAL 0
+#if (WINVER >= 0x0500)
+#define SMTO_NOTIMEOUTIFNOTHUNG 8
+#endif
+#if (WINVER >= 0x0600)
+#define SMTO_ERRORONEXIT 32
+#endif
#define SIF_ALL 23
#define SIF_PAGE 2
#define SIF_POS 4
@@ -2834,7 +2840,7 @@
WPARAM wParam;
DWORD message;
HWND hwnd;
-} CWPRETSTRUCT;
+} CWPRETSTRUCT,*PCWPRETSTRUCT, *LPCWPRETSTRUCT;
typedef struct tagCWPSTRUCT {
LPARAM lParam;
WPARAM wParam;
@@ -3236,6 +3242,20 @@
UINT wHitTestCode;
ULONG_PTR dwExtraInfo;
} MOUSEHOOKSTRUCT,*LPMOUSEHOOKSTRUCT,*PMOUSEHOOKSTRUCT;
+#if ( _WIN32_WINNT >= 0x0500 )
+#ifdef __cplusplus
+typedef struct tagMOUSEHOOKSTRUCTEX : public tagMOUSEHOOKSTRUCT
+{
+ DWORD mouseData;
+} MOUSEHOOKSTRUCTEX, *LPMOUSEHOOKSTRUCTEX, *PMOUSEHOOKSTRUCTEX;
+#else
+typedef struct tagMOUSEHOOKSTRUCTEX
+{
+ MOUSEHOOKSTRUCT MOUSEHOOKSTRUCT;
+ DWORD mouseData;
+} MOUSEHOOKSTRUCTEX, *LPMOUSEHOOKSTRUCTEX, *PMOUSEHOOKSTRUCTEX;
+#endif
+#endif
typedef struct tagTRACKMOUSEEVENT {
DWORD cbSize;
DWORD dwFlags;
Modified: branches/pierre-fsd/include/reactos/win32k/ntuser.h
URL:
http://svn.reactos.org/svn/reactos/branches/pierre-fsd/include/reactos/win3…
==============================================================================
--- branches/pierre-fsd/include/reactos/win32k/ntuser.h [iso-8859-1] (original)
+++ branches/pierre-fsd/include/reactos/win32k/ntuser.h [iso-8859-1] Sat Nov 14 19:25:03
2009
@@ -242,23 +242,34 @@
} PFNCLIENTWORKER, *PPFNCLIENTWORKER;
-// FNID's for NtUserSetWindowFNID
-#define FNID_SCROLLBAR 0x029A
-#define FNID_ICONTITLE 0x029B
-#define FNID_MENU 0x029C
-#define FNID_DESKTOP 0x029D
-#define FNID_SWITCH 0x02A0
-#define FNID_BUTTON 0x02A1
-#define FNID_COMBOBOX 0x02A2
-#define FNID_COMBOLBOX 0x02A3
-#define FNID_DIALOG 0x02A4
-#define FNID_EDIT 0x02A5
-#define FNID_LISTBOX 0x02A6
-#define FNID_MDICLIENT 0x02A7
-#define FNID_STATIC 0x02A8
-#define FNID_IME 0x02A9
-#define FNID_TOOLTIPS 0x02B5
-#define FNID_UNKNOWN 0x02B6
+// FNID's for NtUserSetWindowFNID, NtUserMessageCall
+#define FNID_SCROLLBAR 0x029A
+#define FNID_ICONTITLE 0x029B
+#define FNID_MENU 0x029C
+#define FNID_DESKTOP 0x029D
+#define FNID_DEFWINDOWPROC 0x029E
+#define FNID_SWITCH 0x02A0
+#define FNID_BUTTON 0x02A1
+#define FNID_COMBOBOX 0x02A2
+#define FNID_COMBOLBOX 0x02A3
+#define FNID_DIALOG 0x02A4
+#define FNID_EDIT 0x02A5
+#define FNID_LISTBOX 0x02A6
+#define FNID_MDICLIENT 0x02A7
+#define FNID_STATIC 0x02A8
+#define FNID_IME 0x02A9
+#define FNID_CALLWNDPROC 0x02AA
+#define FNID_CALLWNDPROCRET 0x02AB
+#define FNID_SENDMESSAGE 0x02B0
+// Kernel has option to use TimeOut or normal msg send, based on type of msg.
+#define FNID_SENDMESSAGEWTOOPTION 0x02B1
+#define FNID_SENDMESSAGETIMEOUT 0x02B2
+#define FNID_BROADCASTSYSTEMMESSAGE 0x02B4
+#define FNID_TOOLTIPS 0x02B5
+#define FNID_UNKNOWN 0x02B6
+#define FNID_SENDNOTIFYMESSAGE 0x02B7
+#define FNID_SENDMESSAGECALLBACK 0x02B8
+
#define FNID_DDEML 0x2000 // Registers DDEML
#define FNID_DESTROY 0x4000 // This is sent when WM_NCDESTROY or in the support
routine.
@@ -366,12 +377,28 @@
} W32THREADINFO, *PW32THREADINFO;
/* Window Client Information structure */
+struct _ETHREAD;
+
+
+typedef struct tagHOOK
+{
+ LIST_ENTRY Chain; /* Hook chain entry */
+ HHOOK Self; /* user handle for this hook */
+ struct _ETHREAD* Thread; /* Thread owning the hook */
+ int HookId; /* Hook table index */
+ HOOKPROC Proc; /* Hook function */
+ BOOLEAN Ansi; /* Is it an Ansi hook? */
+ ULONG Flags; /* Some internal flags */
+ UNICODE_STRING ModuleName; /* Module name for global hooks */
+} HOOK, *PHOOK;
typedef struct _CALLBACKWND
{
HWND hWnd;
PVOID pvWnd;
} CALLBACKWND, *PCALLBACKWND;
+
+#define CI_CURTHPRHOOK 0x00000010
typedef struct _CLIENTINFO
{
@@ -383,7 +410,7 @@
DWORD dwTIFlags;
PDESKTOPINFO pDeskInfo;
ULONG_PTR ulClientDelta;
- PVOID phkCurrent;
+ PHOOK phkCurrent;
ULONG fsHooks;
CALLBACKWND CallbackWnd;
ULONG Win32ClientInfo;
@@ -430,7 +457,14 @@
ATOM Atom;
} PROPERTY, *PPROPERTY;
-
+typedef struct _BROADCASTPARM
+{
+ DWORD flags;
+ DWORD recipients;
+ HDESK hDesk;
+ HWND hWnd;
+ LUID luid;
+} BROADCASTPARM, *PBROADCASTPARM;
PW32THREADINFO GetW32ThreadInfo(VOID);
PW32PROCESSINFO GetW32ProcessInfo(VOID);
@@ -938,10 +972,10 @@
LRESULT
NTAPI
NtUserCallNextHookEx(
- HHOOK Hook,
int Code,
WPARAM wParam,
- LPARAM lParam);
+ LPARAM lParam,
+ BOOL Ansi);
DWORD
NTAPI
@@ -1838,15 +1872,6 @@
UINT transType,
DWORD keyboardId,
HKL dwhkl );
-// Look like fnID's
-#define NUMC_DEFWINDOWPROC 0x029E
-#define NUMC_SENDMESSAGE 0x02B0
-// Kernel has option to use TO or normal msg send, based on type of msg.
-#define NUMC_SENDMESSAGEWTOOPTION 0x02B1
-#define NUMC_SENDMESSAGETIMEOUT 0x02B2
-#define NUMC_BROADCASTSYSTEMMESSAGE 0x02B4
-#define NUMC_SENDNOTIFYMESSAGE 0x02B7
-#define NUMC_SENDMESSAGECALLBACK 0x02B8
LRESULT
NTAPI
NtUserMessageCall(
@@ -1855,7 +1880,7 @@
WPARAM wParam,
LPARAM lParam,
ULONG_PTR ResultInfo,
- DWORD dwType, // NUMC_XX types
+ DWORD dwType, // FNID_XX types
BOOL Ansi);
DWORD
Modified: branches/pierre-fsd/subsystems/win32/win32k/include/dc.h
URL:
http://svn.reactos.org/svn/reactos/branches/pierre-fsd/subsystems/win32/win…
==============================================================================
--- branches/pierre-fsd/subsystems/win32/win32k/include/dc.h [iso-8859-1] (original)
+++ branches/pierre-fsd/subsystems/win32/win32k/include/dc.h [iso-8859-1] Sat Nov 14
19:25:03 2009
@@ -32,10 +32,7 @@
typedef struct _WIN_DC_INFO
{
HRGN hClipRgn; /* Clip region (may be 0) */
- HRGN hrgnMeta; /* Meta region (may be 0) */
- HRGN hMetaClipRgn; /* Intersection of meta and clip regions (may be 0) */
HRGN hVisRgn; /* Should me to DC. Visible region (must never be 0) */
-
HRGN hGCClipRgn; /* GC clip region (ClipRgn AND VisRgn) */
HBITMAP hBitmap;
@@ -93,7 +90,7 @@
FLOATOBJ efPr22;
PSURFACE pSurface;
SIZE sizl;
-} DCLEVEL, PDCLEVEL;
+} DCLEVEL, *PDCLEVEL;
/* The DC object structure */
typedef struct _DC
@@ -141,8 +138,6 @@
/* Reactos specific members */
WIN_DC_INFO w;
- HRGN hprgnAPI; // should use prgnAPI
- HRGN hprgnVis; // should use prgnVis
CLIPOBJ *CombinedClip;
XLATEOBJ *XlateBrush;
XLATEOBJ *XlatePen;
Modified: branches/pierre-fsd/subsystems/win32/win32k/include/eng.h
URL:
http://svn.reactos.org/svn/reactos/branches/pierre-fsd/subsystems/win32/win…
==============================================================================
--- branches/pierre-fsd/subsystems/win32/win32k/include/eng.h [iso-8859-1] (original)
+++ branches/pierre-fsd/subsystems/win32/win32k/include/eng.h [iso-8859-1] Sat Nov 14
19:25:03 2009
@@ -22,5 +22,6 @@
VOID FASTCALL IntGdiAcquireSemaphore ( HSEMAPHORE hsem );
VOID FASTCALL IntGdiReleaseSemaphore ( HSEMAPHORE hsem );
+ULONGLONG APIENTRY EngGetTickCount(VOID);
#endif /* _WIN32K_ENG_H */
Modified: branches/pierre-fsd/subsystems/win32/win32k/include/gdifloat.h
URL:
http://svn.reactos.org/svn/reactos/branches/pierre-fsd/subsystems/win32/win…
==============================================================================
--- branches/pierre-fsd/subsystems/win32/win32k/include/gdifloat.h [iso-8859-1]
(original)
+++ branches/pierre-fsd/subsystems/win32/win32k/include/gdifloat.h [iso-8859-1] Sat Nov 14
19:25:03 2009
@@ -31,16 +31,20 @@
static __inline void INTERNAL_LPTODP_FLOAT(DC *dc, FLOAT_POINT *point)
{
FLOAT x, y;
+ XFORM xformWorld2Vport;
+
+ MatrixS2XForm(&xformWorld2Vport, &dc->DcLevel.mxWorldToDevice);
/* Perform the transformation */
x = point->x;
y = point->y;
- point->x = x * dc->DcLevel.xformWorld2Vport.eM11 +
- y * dc->DcLevel.xformWorld2Vport.eM21 +
- dc->DcLevel.xformWorld2Vport.eDx;
- point->y = x * dc->DcLevel.xformWorld2Vport.eM12 +
- y * dc->DcLevel.xformWorld2Vport.eM22 +
- dc->DcLevel.xformWorld2Vport.eDy;
+ point->x = x * xformWorld2Vport.eM11 +
+ y * xformWorld2Vport.eM21 +
+ xformWorld2Vport.eDx;
+
+ point->y = x * xformWorld2Vport.eM12 +
+ y * xformWorld2Vport.eM22 +
+ xformWorld2Vport.eDy;
}
/* Performs a viewport-to-world transformation on the specified point (which
@@ -105,8 +109,6 @@
#define YLSTODS(Dc_Attr,ty) \
MulDiv((ty), (Dc_Attr)->szlViewportExt.cy, (Dc_Attr)->szlWindowExt.cy)
-VOID FASTCALL XForm2MatrixS( MATRIX_S *, PXFORM);
-VOID FASTCALL MatrixS2XForm( PXFORM, MATRIX_S *);
-
#endif
+
Modified: branches/pierre-fsd/subsystems/win32/win32k/include/hook.h
URL:
http://svn.reactos.org/svn/reactos/branches/pierre-fsd/subsystems/win32/win…
==============================================================================
--- branches/pierre-fsd/subsystems/win32/win32k/include/hook.h [iso-8859-1] (original)
+++ branches/pierre-fsd/subsystems/win32/win32k/include/hook.h [iso-8859-1] Sat Nov 14
19:25:03 2009
@@ -2,7 +2,7 @@
#define _WIN32K_HOOK_H
#define HOOK_THREAD_REFERENCED (0x1)
-
+#if 0
typedef struct tagHOOK
{
LIST_ENTRY Chain; /* Hook chain entry */
@@ -14,7 +14,7 @@
ULONG Flags; /* Some internal flags */
UNICODE_STRING ModuleName; /* Module name for global hooks */
} HOOK, *PHOOK;
-
+#endif
#define NB_HOOKS (WH_MAXHOOK-WH_MINHOOK+1)
#define HOOKID_TO_INDEX(HookId) (HookId - WH_MINHOOK)
#define HOOKID_TO_FLAG(HookId) (1 << ((HookId) + 1))
@@ -33,6 +33,8 @@
PETHREAD Thread; /* Thread owning the event */
UINT eventMin;
UINT eventMax;
+ DWORD idProcess;
+ DWORD idThread;
WINEVENTPROC Proc; /* Event function */
BOOLEAN Ansi; /* Is it an Ansi event? */
ULONG Flags; /* Some internal flags */
@@ -49,6 +51,8 @@
LRESULT FASTCALL co_EVENT_CallEvents(DWORD, HWND, UINT_PTR, LONG_PTR);
VOID FASTCALL HOOK_DestroyThreadHooks(PETHREAD Thread);
PHOOK FASTCALL IntGetHookObject(HHOOK);
+PHOOK FASTCALL IntGetNextHook(PHOOK Hook);
+LRESULT FASTCALL UserCallNextHookEx( PHOOK pHook, int Code, WPARAM wParam, LPARAM lParam,
BOOL Ansi);
#endif /* _WIN32K_HOOK_H */
Modified: branches/pierre-fsd/subsystems/win32/win32k/include/msgqueue.h
URL:
http://svn.reactos.org/svn/reactos/branches/pierre-fsd/subsystems/win32/win…
==============================================================================
--- branches/pierre-fsd/subsystems/win32/win32k/include/msgqueue.h [iso-8859-1]
(original)
+++ branches/pierre-fsd/subsystems/win32/win32k/include/msgqueue.h [iso-8859-1] Sat Nov 14
19:25:03 2009
@@ -4,6 +4,9 @@
#include "hook.h"
#define MSQ_HUNG 5000
+#define MSQ_NORMAL 0
+#define MSQ_ISHOOK 1
+#define MSQ_ISEVENT 2
typedef struct _USER_MESSAGE
{
@@ -25,7 +28,7 @@
ULONG_PTR CompletionCallbackContext;
/* entry in the dispatching list of the sender's message queue */
LIST_ENTRY DispatchingListEntry;
- BOOL HookMessage;
+ INT HookMessage;
} USER_SENT_MESSAGE, *PUSER_SENT_MESSAGE;
typedef struct _USER_SENT_MESSAGE_NOTIFY
@@ -121,7 +124,7 @@
NTSTATUS FASTCALL
co_MsqSendMessage(PUSER_MESSAGE_QUEUE MessageQueue,
HWND Wnd, UINT Msg, WPARAM wParam, LPARAM lParam,
- UINT uTimeout, BOOL Block, BOOL HookMessage,
+ UINT uTimeout, BOOL Block, INT HookMessage,
ULONG_PTR *uResult);
PUSER_MESSAGE FASTCALL
MsqCreateMessage(LPMSG Msg, BOOLEAN FreeLParam);
Modified: branches/pierre-fsd/subsystems/win32/win32k/include/window.h
URL:
http://svn.reactos.org/svn/reactos/branches/pierre-fsd/subsystems/win32/win…
==============================================================================
--- branches/pierre-fsd/subsystems/win32/win32k/include/window.h [iso-8859-1] (original)
+++ branches/pierre-fsd/subsystems/win32/win32k/include/window.h [iso-8859-1] Sat Nov 14
19:25:03 2009
@@ -165,7 +165,7 @@
IntShowOwnedPopups( PWINDOW_OBJECT owner, BOOL fShow );
LRESULT FASTCALL
-IntDefWindowProc( PWINDOW_OBJECT Window, UINT Msg, WPARAM wParam, LPARAM lParam);
+IntDefWindowProc( PWINDOW_OBJECT Window, UINT Msg, WPARAM wParam, LPARAM lParam, BOOL
Ansi);
VOID FASTCALL IntNotifyWinEvent(DWORD, PWINDOW_OBJECT, LONG, LONG);
Modified: branches/pierre-fsd/subsystems/win32/win32k/ntuser/defwnd.c
URL:
http://svn.reactos.org/svn/reactos/branches/pierre-fsd/subsystems/win32/win…
==============================================================================
--- branches/pierre-fsd/subsystems/win32/win32k/ntuser/defwnd.c [iso-8859-1] (original)
+++ branches/pierre-fsd/subsystems/win32/win32k/ntuser/defwnd.c [iso-8859-1] Sat Nov 14
19:25:03 2009
@@ -4,8 +4,7 @@
* PURPOSE: Misc User funcs
* FILE: subsystem/win32/win32k/ntuser/defwnd.c
* PROGRAMER:
- * REVISION HISTORY:
- * 2003/05/22 Created
+ *
*/
#include <w32k.h>
@@ -13,7 +12,25 @@
#define NDEBUG
#include <debug.h>
+LRESULT FASTCALL
+IntDefWinHandleSysCommand( PWINDOW_OBJECT Window, WPARAM wParam, LPARAM lParam , BOOL
Ansi)
+{
+ DPRINT1("hwnd %p WM_SYSCOMMAND %lx %lx\n", Window->hSelf, wParam, lParam
);
+ if (!ISITHOOKED(WH_CBT)) return 0;
+
+// if (!UserCallNextHookEx(WH_CBT, HCBT_SYSCOMMAND, wParam, lParam, Ansi))
+ return 0;
+
+ switch (wParam & 0xfff0)
+ {
+ case SC_MOVE:
+ case SC_SIZE:
+ // return UserCallNextHookEx(WH_CBT, HCBT_MOVESIZE, (WPARAM)Window->hSelf,
lParam, Ansi);
+ break;
+ }
+ return 1;
+}
/*
Win32k counterpart of User DefWindowProc
*/
@@ -22,9 +39,11 @@
PWINDOW_OBJECT Window,
UINT Msg,
WPARAM wParam,
- LPARAM lParam)
+ LPARAM lParam,
+ BOOL Ansi)
{
PWINDOW Wnd;
+ LRESULT lResult = 0;
if (Msg > WM_USER) return 0;
@@ -33,6 +52,11 @@
switch (Msg)
{
+ case WM_SYSCOMMAND:
+ {
+ lResult = IntDefWinHandleSysCommand( Window, wParam, lParam, Ansi );
+ break;
+ }
case WM_SHOWWINDOW:
{
if ((Wnd->Style & WS_VISIBLE) && wParam) break;
@@ -54,7 +78,7 @@
break;
}
- return 0;
+ return lResult;
}
Modified: branches/pierre-fsd/subsystems/win32/win32k/ntuser/event.c
URL:
http://svn.reactos.org/svn/reactos/branches/pierre-fsd/subsystems/win32/win…
==============================================================================
--- branches/pierre-fsd/subsystems/win32/win32k/ntuser/event.c [iso-8859-1] (original)
+++ branches/pierre-fsd/subsystems/win32/win32k/ntuser/event.c [iso-8859-1] Sat Nov 14
19:25:03 2009
@@ -12,7 +12,6 @@
} EVENTPACK, *PEVENTPACK;
static PEVENTTABLE GlobalEvents = NULL;
-
/* PRIVATE FUNCTIONS *********************************************************/
@@ -237,6 +236,7 @@
IntNotifyWinEvent( Event, Window, idObject, idChild);
UserDerefObjectCo(Window);
}
+ UserLeave();
}
HWINEVENTHOOK
@@ -251,11 +251,14 @@
DWORD idThread,
UINT dwflags)
{
- gpsi->SrvEventActivity |= GetMaskFromEvent(eventMin);
- gpsi->SrvEventActivity &= ~GetMaskFromEvent(eventMin);
+ PEVENTHOOK pEH;
+ HWINEVENTHOOK Ret = NULL;
+ UNICODE_STRING ModuleName;
+ NTSTATUS Status;
+ HANDLE Handle;
PETHREAD Thread = NULL;
- UNIMPLEMENTED
+ UserEnterExclusive();
if ( !GlobalEvents )
{
@@ -381,7 +384,8 @@
NtUserUnhookWinEvent(
HWINEVENTHOOK hWinEventHook)
{
- UNIMPLEMENTED
+ PEVENTHOOK pEH;
+ BOOL Ret = FALSE;
UserEnterExclusive();
Modified: branches/pierre-fsd/subsystems/win32/win32k/ntuser/hook.c
URL:
http://svn.reactos.org/svn/reactos/branches/pierre-fsd/subsystems/win32/win…
==============================================================================
--- branches/pierre-fsd/subsystems/win32/win32k/ntuser/hook.c [iso-8859-1] (original)
+++ branches/pierre-fsd/subsystems/win32/win32k/ntuser/hook.c [iso-8859-1] Sat Nov 14
19:25:03 2009
@@ -15,9 +15,6 @@
#define NDEBUG
#include <debug.h>
-#define HOOKID_TO_INDEX(HookId) (HookId - WH_MINHOOK)
-#define HOOKID_TO_FLAG(HookId) (1 << ((HookId) + 1))
-
static PHOOKTABLE GlobalHooks;
@@ -164,7 +161,8 @@
}
/* find the next hook in the chain, skipping the deleted ones */
-static PHOOK FASTCALL
+PHOOK
+FASTCALL
IntGetNextHook(PHOOK Hook)
{
PHOOKTABLE Table = IntGetTable(Hook);
@@ -269,7 +267,7 @@
}
static LRESULT FASTCALL
-IntCallLowLevelHook(INT HookId, INT Code, WPARAM wParam, LPARAM lParam, PHOOK Hook)
+IntCallLowLevelHook(PHOOK Hook, INT Code, WPARAM wParam, LPARAM lParam)
{
NTSTATUS Status;
ULONG_PTR uResult;
@@ -289,10 +287,14 @@
return NT_SUCCESS(Status) ? uResult : 0;
}
-LRESULT FASTCALL
+/*
+ Called from inside kernel space.
+ */
+LRESULT
+FASTCALL
co_HOOK_CallHooks(INT HookId, INT Code, WPARAM wParam, LPARAM lParam)
{
- PHOOK Hook;
+ PHOOK Hook, SaveHook;
PTHREADINFO pti;
PCLIENTINFO ClientInfo;
PHOOKTABLE Table;
@@ -322,17 +324,10 @@
}
}
- if (Hook->Thread != PsGetCurrentThread()
- && (WH_KEYBOARD_LL == HookId || WH_MOUSE_LL == HookId))
- {
- DPRINT("Calling hook in owning thread\n");
- return IntCallLowLevelHook(HookId, Code, wParam, lParam, Hook);
- }
-
- if (Hook->Thread != PsGetCurrentThread())
- {
- DPRINT1("Calling hooks in other threads not implemented yet");
- return 0;
+ if ((Hook->Thread != PsGetCurrentThread()) && (Hook->Thread != NULL))
+ {
+ // Post it in message queue.
+ return IntCallLowLevelHook(Hook, Code, wParam, lParam);
}
Table->Counts[HOOKID_TO_INDEX(HookId)]++;
@@ -341,8 +336,19 @@
GlobalHooks->Counts[HOOKID_TO_INDEX(HookId)]++;
}
- Result = co_IntCallHookProc(HookId, Code, wParam, lParam, Hook->Proc,
- Hook->Ansi, &Hook->ModuleName);
+ ClientInfo = GetWin32ClientInfo();
+ SaveHook = ClientInfo->phkCurrent;
+ ClientInfo->phkCurrent = Hook; // Load the call.
+
+ Result = co_IntCallHookProc( HookId,
+ Code,
+ wParam,
+ lParam,
+ Hook->Proc,
+ Hook->Ansi,
+ &Hook->ModuleName);
+
+ ClientInfo->phkCurrent = SaveHook;
Status = IntValidateWindowStationHandle(PsGetCurrentProcess()->Win32WindowStation,
KernelMode,
@@ -405,10 +411,28 @@
break;
}
}
-
- ObDereferenceObject(WinStaObj);
- }
-}
+ }
+}
+
+static LRESULT
+FASTCALL
+co_HOOK_CallHookNext(PHOOK Hook, INT Code, WPARAM wParam, LPARAM lParam)
+{
+ if ((Hook->Thread != PsGetCurrentThread()) && (Hook->Thread != NULL))
+ {
+ DPRINT1("CALLING HOOK from another Thread. %d\n",Hook->HookId);
+ return IntCallLowLevelHook(Hook, Code, wParam, lParam);
+ }
+ DPRINT("CALLING HOOK %d\n",Hook->HookId);
+ return co_IntCallHookProc(Hook->HookId,
+ Code,
+ wParam,
+ lParam,
+ Hook->Proc,
+ Hook->Ansi,
+ &Hook->ModuleName);
+}
+
LRESULT
FASTCALL
@@ -856,10 +880,10 @@
LRESULT
APIENTRY
NtUserCallNextHookEx(
- HHOOK Hook,
int Code,
WPARAM wParam,
- LPARAM lParam)
+ LPARAM lParam,
+ BOOL Ansi)
{
PHOOK HookObj, NextObj;
PCLIENTINFO ClientInfo;
@@ -874,30 +898,25 @@
KernelMode,
0,
&WinStaObj);
-
- if (! NT_SUCCESS(Status))
+ if (!NT_SUCCESS(Status))
{
SetLastNtError(Status);
- RETURN( FALSE);
- }
-
- //Status = UserReferenceObjectByHandle(gHandleTable, Hook,
- // otHookProc, (PVOID *) &HookObj);
+ RETURN( 0);
+ }
+
ObDereferenceObject(WinStaObj);
- // if (! NT_SUCCESS(Status))
- // {
- // DPRINT1("Invalid handle passed to NtUserCallNextHookEx\n");
- // SetLastNtError(Status);
- // RETURN( 0);
- // }
-
- if (!(HookObj = IntGetHookObject(Hook)))
- {
- RETURN(0);
- }
-
- ASSERT(Hook == HookObj->Self);
+ ClientInfo = GetWin32ClientInfo();
+
+ if (!ClientInfo) RETURN( 0);
+
+ HookObj = ClientInfo->phkCurrent;
+
+ if (!HookObj) RETURN( 0);
+
+ UserReferenceObject(HookObj);
+
+ Ansi = HookObj->Ansi;
if (NULL != HookObj->Thread && (HookObj->Thread !=
PsGetCurrentThread()))
{
@@ -906,18 +925,13 @@
SetLastWin32Error(ERROR_INVALID_HANDLE);
RETURN( 0);
}
-
+
NextObj = IntGetNextHook(HookObj);
+ ClientInfo->phkCurrent = NextObj; // Preset next hook from list.
+ UserCallNextHookEx( HookObj, Code, wParam, lParam, Ansi);
UserDereferenceObject(HookObj);
- if (NULL != NextObj)
- {
- DPRINT1("Calling next hook not implemented\n");
- UNIMPLEMENTED
- SetLastWin32Error(ERROR_NOT_SUPPORTED);
- RETURN( 0);
- }
-
- RETURN( 0);
+
+ RETURN( (LRESULT)NextObj);
CLEANUP:
DPRINT("Leave NtUserCallNextHookEx, ret=%i\n",_ret_);
Modified: branches/pierre-fsd/subsystems/win32/win32k/ntuser/message.c
URL:
http://svn.reactos.org/svn/reactos/branches/pierre-fsd/subsystems/win32/win…
==============================================================================
--- branches/pierre-fsd/subsystems/win32/win32k/ntuser/message.c [iso-8859-1] (original)
+++ branches/pierre-fsd/subsystems/win32/win32k/ntuser/message.c [iso-8859-1] Sat Nov 14
19:25:03 2009
@@ -407,9 +407,11 @@
BOOL
APIENTRY
NtUserCallMsgFilter(
- LPMSG msg,
+ LPMSG lpmsg,
INT code)
{
+ BOOL BadChk = FALSE, Ret = TRUE;
+ MSG Msg;
DECLARE_RETURN(BOOL);
DPRINT("Enter NtUserCallMsgFilter\n");
@@ -434,9 +436,7 @@
else
RETURN( FALSE);
- if (co_HOOK_CallHooks( WH_SYSMSGFILTER, code, 0, (LPARAM)msg))
- RETURN( TRUE);
- RETURN( co_HOOK_CallHooks( WH_MSGFILTER, code, 0, (LPARAM)msg));
+ if (BadChk) RETURN( FALSE);
if (!co_HOOK_CallHooks( WH_SYSMSGFILTER, code, 0, (LPARAM)&Msg))
{
@@ -747,6 +747,7 @@
BOOL Present, RemoveMessages;
USER_REFERENCE_ENTRY Ref;
USHORT HitTest;
+ MOUSEHOOKSTRUCT MHook;
/* The queues and order in which they are checked are documented in the MSDN
article on GetMessage() */
@@ -784,7 +785,7 @@
{
ThreadQueue->QuitPosted = FALSE;
}
- return TRUE;
+ goto MsgExit;
}
/* Now check for normal messages. */
@@ -831,7 +832,7 @@
if (IntGetPaintMessage(hWnd, MsgFilterMin, MsgFilterMax, pti, &Msg->Msg,
RemoveMessages))
{
Msg->FreeLParam = FALSE;
- return TRUE;
+ goto MsgExit;
}
if (ThreadQueue->WakeMask & QS_TIMER)
@@ -897,7 +898,7 @@
// UserDereferenceObject(MsgWindow);
// }
- return TRUE;
+ goto MsgExit;
}
if((Msg->Msg.hwnd && Msg->Msg.message >= WM_MOUSEFIRST &&
Msg->Msg.message <= WM_MOUSELAST) &&
@@ -1000,12 +1001,9 @@
}
Present = co_IntPeekMessage(&Msg, hWnd, MsgFilterMin, MsgFilterMax, RemoveMsg);
- // The WH_GETMESSAGE hook enables an application to monitor messages about to
- // be returned by the GetMessage or PeekMessage function.
- co_HOOK_CallHooks( WH_GETMESSAGE, HC_ACTION, RemoveMsg & PM_REMOVE,
(LPARAM)&Msg);
-
if (Present)
{
+
Info.Msg = Msg.Msg;
/* See if this message type is present in the table */
MsgMemoryEntry = FindMsgMemory(Info.Msg.message);
@@ -1491,7 +1489,6 @@
DECLARE_RETURN(LRESULT);
USER_REFERENCE_ENTRY Ref;
- /* FIXME: Call hooks. */
if (!(Window = UserGetWindowObject(hWnd)))
{
RETURN( FALSE);
@@ -1501,8 +1498,10 @@
Win32Thread = PsGetCurrentThreadWin32Thread();
+ IntCallWndProc( Window, hWnd, Msg, wParam, lParam);
+
if (NULL != Win32Thread &&
- Window->MessageQueue == Win32Thread->MessageQueue)
+ Window->MessageQueue == Win32Thread->MessageQueue)
{
if (Win32Thread->IsExiting)
{
@@ -1523,7 +1522,7 @@
if (! NT_SUCCESS(PackParam(&lParamPacked, Msg, wParam, lParam)))
{
- DPRINT1("Failed to pack message parameters\n");
+ DPRINT1("Failed to pack message parameters\n");
RETURN( FALSE);
}
@@ -1535,31 +1534,47 @@
*uResult = Result;
}
+ IntCallWndProcRet( Window, hWnd, Msg, wParam, lParam, (LRESULT *)uResult);
+
if (! NT_SUCCESS(UnpackParam(lParamPacked, Msg, wParam, lParam)))
{
DPRINT1("Failed to unpack message parameters\n");
- RETURN( TRUE);
- }
-
- RETURN( TRUE);
- }
-
- if(uFlags & SMTO_ABORTIFHUNG && MsqIsHung(Window->MessageQueue))
+ RETURN( TRUE);
+ }
+
+ RETURN( TRUE);
+ }
+
+ if (uFlags & SMTO_ABORTIFHUNG && MsqIsHung(Window->MessageQueue))
{
/* FIXME - Set a LastError? */
- RETURN( FALSE);
- }
-
- if(Window->Status & WINDOWSTATUS_DESTROYING)
+ RETURN( FALSE);
+ }
+
+ if (Window->Status & WINDOWSTATUS_DESTROYING)
{
/* FIXME - last error? */
DPRINT1("Attempted to send message to window 0x%x that is being
destroyed!\n", hWnd);
- RETURN( FALSE);
- }
-
- Status = co_MsqSendMessage(Window->MessageQueue, hWnd, Msg, wParam, lParam,
- uTimeout, (uFlags & SMTO_BLOCK), FALSE, uResult);
-
+ RETURN( FALSE);
+ }
+
+ do
+ {
+ Status = co_MsqSendMessage( Window->MessageQueue,
+ hWnd,
+ Msg,
+ wParam,
+ lParam,
+ uTimeout,
+ (uFlags & SMTO_BLOCK),
+ MSQ_NORMAL,
+ uResult);
+ }
+ while ((STATUS_TIMEOUT == Status) &&
+ (uFlags & SMTO_NOTIMEOUTIFNOTHUNG) &&
+ !MsqIsHung(Window->MessageQueue));
+
+ IntCallWndProcRet( Window, hWnd, Msg, wParam, lParam, (LRESULT *)uResult);
if (STATUS_TIMEOUT == Status)
{
@@ -1577,7 +1592,7 @@
else if (! NT_SUCCESS(Status))
{
SetLastNtError(Status);
- RETURN( FALSE);
+ RETURN( FALSE);
}
RETURN( TRUE);
@@ -1659,8 +1674,7 @@
}
else
{
- if(!co_IntSendMessageTimeoutSingle(hWnd, Msg, wParam, lParam, SMTO_NORMAL, 0,
&Result))
- {
+ if(!co_IntSendMessageTimeoutSingle(hWnd, Msg, wParam, lParam, SMTO_NORMAL, 0,
&Result)) {
Result = 0;
}
}
@@ -1719,6 +1733,8 @@
Info.Ansi = ! Window->Wnd->Unicode;
}
+ IntCallWndProc( Window, hWnd, Msg, wParam, lParam);
+
if (Window->Wnd->IsSystem)
{
Info.Proc = (!Info.Ansi ? Window->Wnd->WndProc :
Window->Wnd->WndProcExtra);
@@ -1728,6 +1744,9 @@
Info.Ansi = !Window->Wnd->Unicode;
Info.Proc = Window->Wnd->WndProc;
}
+
+ IntCallWndProcRet( Window, hWnd, Msg, wParam, lParam, &Result);
+
}
else
{
@@ -2022,11 +2041,12 @@
{
return 0;
}
- UserRefObjectCo(Window, &Ref);
switch(dwType)
{
- case NUMC_DEFWINDOWPROC:
- lResult = IntDefWindowProc(Window, Msg, wParam, lParam);
+ case FNID_DEFWINDOWPROC:
+ UserRefObjectCo(Window, &Ref);
+ lResult = IntDefWindowProc(Window, Msg, wParam, lParam, Ansi);
+ UserDerefObjectCo(Window);
break;
case FNID_BROADCASTSYSTEMMESSAGE:
{
@@ -2165,7 +2185,6 @@
}
break;
}
- UserDerefObjectCo(Window);
UserLeave();
return lResult;
}
@@ -2198,6 +2217,7 @@
if (!NT_SUCCESS(Status))
{
+ UserLeave();
SetLastNtError(Status);
return WAIT_FAILED;
}
@@ -2206,16 +2226,22 @@
if (!W32Process)
{
ObDereferenceObject(Process);
+ UserLeave();
SetLastWin32Error(ERROR_INVALID_PARAMETER);
return WAIT_FAILED;
}
EngCreateEvent((PEVENT *)&W32Process->InputIdleEvent);
- Handles[0] = hProcess;
+ Handles[0] = Process;
Handles[1] = W32Process->InputIdleEvent;
- if (!Handles[1]) return STATUS_SUCCESS; /* no event to wait on */
+ if (!Handles[1])
+ {
+ ObDereferenceObject(Process);
+ UserLeave();
+ return STATUS_SUCCESS; /* no event to wait on */
+ }
StartTime = EngGetTickCount();
Modified: branches/pierre-fsd/subsystems/win32/win32k/objects/color.c
URL:
http://svn.reactos.org/svn/reactos/branches/pierre-fsd/subsystems/win32/win…
==============================================================================
--- branches/pierre-fsd/subsystems/win32/win32k/objects/color.c [iso-8859-1] (original)
+++ branches/pierre-fsd/subsystems/win32/win32k/objects/color.c [iso-8859-1] Sat Nov 14
19:25:03 2009
@@ -436,18 +436,16 @@
{
if (pe != NULL)
{
- UINT CopyEntries;
-
- if (StartIndex + Entries < palGDI->NumColors)
- CopyEntries = StartIndex + Entries;
- else
- CopyEntries = palGDI->NumColors - StartIndex;
+ if (StartIndex >= palGDI->NumColors)
+ Entries = 0;
+ else if (Entries > palGDI->NumColors - StartIndex)
+ Entries = palGDI->NumColors - StartIndex;
memcpy(pe,
palGDI->IndexedColors + StartIndex,
- CopyEntries * sizeof(pe[0]));
-
- Ret = CopyEntries;
+ Entries * sizeof(pe[0]));
+
+ Ret = Entries;
}
else
{
@@ -498,33 +496,26 @@
USHORT sysMode, palMode;
dc = DC_LockDc(hDC);
- if (!dc)
- return 0;
+ if (!dc) return 0;
systemPalette = NtGdiGetStockObject(DEFAULT_PALETTE);
palGDI = PALETTE_LockPalette(dc->DcLevel.hpal);
if (palGDI == NULL)
{
- /* FIXME - Handle palGDI == NULL!!!!
- we should not unlock dc and return 0 ??
- shall we create the pallete ??
- */
- DC_UnlockDc(dc);
- return 0;
+ DPRINT1("IntGdiRealizePalette(): palGDI is NULL, exiting\n");
+ DC_UnlockDc(dc);
+ return 0;
}
sysGDI = PALETTE_LockPalette(systemPalette);
if (sysGDI == NULL)
{
- /* FIXME - Handle sysGDI == NULL!!!!!
- we should not unlock dc and return 0 ??
- shall we create the pallete ??
- */
- PALETTE_UnlockPalette(palGDI);
- DC_UnlockDc(dc);
- return 0;
+ DPRINT1("IntGdiRealizePalette(): sysGDI is NULL, exiting\n");
+ PALETTE_UnlockPalette(palGDI);
+ DC_UnlockDc(dc);
+ return 0;
}
// The RealizePalette function modifies the palette for the device associated with the
specified device context. If the
@@ -799,6 +790,7 @@
IN BOOL bInbound)
{
LONG ret;
+ LPVOID pEntries = NULL;
/* FIXME: Handle bInbound correctly */
@@ -808,9 +800,12 @@
return 0;
}
- _SEH_TRY
+ if (pUnsafeEntries)
{
- switch(iFunc)
+ pEntries = ExAllocatePool(PagedPool, cEntries * sizeof(PALETTEENTRY));
+ if (!pEntries)
+ return 0;
+ if (bInbound)
{
_SEH2_TRY
{
@@ -847,13 +842,10 @@
ret = IntGetSystemPaletteEntries((HDC)hObj, iStart, cEntries,
(LPPALETTEENTRY)pEntries);
break;
- case GdiPalGetColorTable:
- if (pUnsafeEntries)
- {
- ProbeForWrite(pUnsafeEntries, cEntries * sizeof(PALETTEENTRY), 1);
- }
- ret = IntGetDIBColorTable((HDC)hObj, iStart, cEntries, (RGBQUAD*)pUnsafeEntries);
- break;
+ case GdiPalSetColorTable:
+ if (pEntries)
+ ret = IntSetDIBColorTable((HDC)hObj, iStart, cEntries, (RGBQUAD*)pEntries);
+ break;
case GdiPalGetColorTable:
if (pEntries)
@@ -876,12 +868,8 @@
}
_SEH2_END
}
+ ExFreePool(pEntries);
}
- _SEH_HANDLE
- {
- ret = 0;
- }
- _SEH_END
return ret;
}
Modified: branches/pierre-fsd/subsystems/win32/win32k/objects/dc.c
URL:
http://svn.reactos.org/svn/reactos/branches/pierre-fsd/subsystems/win32/win…
==============================================================================
--- branches/pierre-fsd/subsystems/win32/win32k/objects/dc.c [iso-8859-1] (original)
+++ branches/pierre-fsd/subsystems/win32/win32k/objects/dc.c [iso-8859-1] Sat Nov 14
19:25:03 2009
@@ -1419,9 +1419,9 @@
#endif
nDc_Attr->ptlCurrent = Dc_Attr->ptlCurrent;
nDc_Attr->ptfxCurrent = Dc_Attr->ptfxCurrent;
- newdc->DcLevel.xformWorld2Wnd = dc->DcLevel.xformWorld2Wnd;
- newdc->DcLevel.xformWorld2Vport = dc->DcLevel.xformWorld2Vport;
- newdc->DcLevel.xformVport2World = dc->DcLevel.xformVport2World;
+ newdc->DcLevel.mxWorldToDevice = dc->DcLevel.mxWorldToDevice;
+ newdc->DcLevel.mxDeviceToWorld = dc->DcLevel.mxDeviceToWorld;
+ newdc->DcLevel.mxWorldToPage = dc->DcLevel.mxWorldToPage;
nDc_Attr->flXform = Dc_Attr->flXform;
nDc_Attr->ptlWindowOrg = Dc_Attr->ptlWindowOrg;
nDc_Attr->szlWindowExt = Dc_Attr->szlWindowExt;
@@ -1485,9 +1485,9 @@
#endif
Dc_Attr->ptlCurrent = sDc_Attr->ptlCurrent;
Dc_Attr->ptfxCurrent = sDc_Attr->ptfxCurrent;
- dc->DcLevel.xformWorld2Wnd = dcs->DcLevel.xformWorld2Wnd;
- dc->DcLevel.xformWorld2Vport = dcs->DcLevel.xformWorld2Vport;
- dc->DcLevel.xformVport2World = dcs->DcLevel.xformVport2World;
+ dc->DcLevel.mxWorldToDevice = dcs->DcLevel.mxWorldToDevice;
+ dc->DcLevel.mxDeviceToWorld = dcs->DcLevel.mxDeviceToWorld;
+ dc->DcLevel.mxWorldToPage = dcs->DcLevel.mxWorldToPage;
Dc_Attr->flXform = sDc_Attr->flXform;
Dc_Attr->ptlWindowOrg = sDc_Attr->ptlWindowOrg;
Dc_Attr->szlWindowExt = sDc_Attr->szlWindowExt;
@@ -2402,6 +2402,7 @@
PDC_ATTR Dc_Attr;
HDC hDC;
PWSTR Buf = NULL;
+ XFORM xformTemplate;
if (Driver != NULL)
{
@@ -2438,20 +2439,24 @@
if(!Dc_Attr) Dc_Attr = &NewDC->Dc_Attr;
NewDC->BaseObject.hHmgr = (HGDIOBJ) hDC; // Save the handle for this DC object.
- NewDC->DcLevel.xformWorld2Wnd.eM11 = 1.0f;
- NewDC->DcLevel.xformWorld2Wnd.eM12 = 0.0f;
- NewDC->DcLevel.xformWorld2Wnd.eM21 = 0.0f;
- NewDC->DcLevel.xformWorld2Wnd.eM22 = 1.0f;
- NewDC->DcLevel.xformWorld2Wnd.eDx = 0.0f;
- NewDC->DcLevel.xformWorld2Wnd.eDy = 0.0f;
- NewDC->DcLevel.xformWorld2Vport = NewDC->DcLevel.xformWorld2Wnd;
- NewDC->DcLevel.xformVport2World = NewDC->DcLevel.xformWorld2Wnd;
+
+ xformTemplate.eM11 = 1.0f;
+ xformTemplate.eM12 = 0.0f;
+ xformTemplate.eM21 = 0.0f;
+ xformTemplate.eM22 = 1.0f;
+ xformTemplate.eDx = 0.0f;
+ xformTemplate.eDy = 0.0f;
+ XForm2MatrixS(&NewDC->DcLevel.mxWorldToDevice, &xformTemplate);
+ XForm2MatrixS(&NewDC->DcLevel.mxDeviceToWorld, &xformTemplate);
+ XForm2MatrixS(&NewDC->DcLevel.mxWorldToPage, &xformTemplate);
+
// Setup syncing bits for the dcattr data packets.
Dc_Attr->flXform = DEVICE_TO_PAGE_INVALID;
Dc_Attr->ulDirty_ = 0; // Server side
Dc_Attr->iMapMode = MM_TEXT;
+ Dc_Attr->iGraphicsMode = GM_COMPATIBLE;
Dc_Attr->jFillMode = ALTERNATE;
Dc_Attr->szlWindowExt.cx = 1; // Float to Int,,, WRONG!
@@ -2631,6 +2636,7 @@
FLOAT scaleX, scaleY;
PDC_ATTR Dc_Attr = dc->pDc_Attr;
if(!Dc_Attr) Dc_Attr = &dc->Dc_Attr;
+ XFORM xformWorld2Vport, xformWorld2Wnd, xformVport2World;
/* Construct a transformation to do the window-to-viewport conversion */
scaleX = (Dc_Attr->szlWindowExt.cx ? (FLOAT)Dc_Attr->szlViewportExt.cx /
(FLOAT)Dc_Attr->szlWindowExt.cx : 0.0f);
@@ -2643,13 +2649,23 @@
xformWnd2Vport.eDy = (FLOAT)Dc_Attr->ptlViewportOrg.y - scaleY *
(FLOAT)Dc_Attr->ptlWindowOrg.y;
/* Combine with the world transformation */
- IntGdiCombineTransform(&dc->DcLevel.xformWorld2Vport,
&dc->DcLevel.xformWorld2Wnd, &xformWnd2Vport);
+ MatrixS2XForm(&xformWorld2Vport, &dc->DcLevel.mxWorldToDevice);
+ MatrixS2XForm(&xformWorld2Wnd, &dc->DcLevel.mxWorldToPage);
+ IntGdiCombineTransform(&xformWorld2Vport, &xformWorld2Wnd,
&xformWnd2Vport);
/* Create inverse of world-to-viewport transformation */
- if (DC_InvertXform(&dc->DcLevel.xformWorld2Vport,
&dc->DcLevel.xformVport2World))
- Dc_Attr->flXform &= ~DEVICE_TO_WORLD_INVALID;
+ MatrixS2XForm(&xformVport2World, &dc->DcLevel.mxDeviceToWorld);
+ if (DC_InvertXform(&xformWorld2Vport, &xformVport2World))
+ {
+ Dc_Attr->flXform &= ~DEVICE_TO_WORLD_INVALID;
+ }
else
- Dc_Attr->flXform |= DEVICE_TO_WORLD_INVALID;
+ {
+ Dc_Attr->flXform |= DEVICE_TO_WORLD_INVALID;
+ }
+
+ XForm2MatrixS(&dc->DcLevel.mxWorldToDevice, &xformWorld2Vport);
+
}
BOOL FASTCALL
Modified: branches/pierre-fsd/subsystems/win32/win32k/objects/dcutil.c
URL:
http://svn.reactos.org/svn/reactos/branches/pierre-fsd/subsystems/win32/win…
==============================================================================
--- branches/pierre-fsd/subsystems/win32/win32k/objects/dcutil.c [iso-8859-1] (original)
+++ branches/pierre-fsd/subsystems/win32/win32k/objects/dcutil.c [iso-8859-1] Sat Nov 14
19:25:03 2009
@@ -113,9 +113,10 @@
CopytoUserDcAttr(PDC dc, PDC_ATTR Dc_Attr)
{
NTSTATUS Status = STATUS_SUCCESS;
- XForm2MatrixS( &dc->Dc_Attr.mxWorldToDevice,
&dc->DcLevel.xformWorld2Vport);
- XForm2MatrixS( &dc->Dc_Attr.mxDevicetoWorld,
&dc->DcLevel.xformVport2World);
- XForm2MatrixS( &dc->Dc_Attr.mxWorldToPage, &dc->DcLevel.xformWorld2Wnd);
+ dc->Dc_Attr.mxWorldToDevice = dc->DcLevel.mxWorldToDevice;
+ dc->Dc_Attr.mxDeviceToWorld = dc->DcLevel.mxDeviceToWorld;
+ dc->Dc_Attr.mxWorldToPage = dc->DcLevel.mxWorldToPage;
+
_SEH2_TRY
{
ProbeForWrite( Dc_Attr,
Modified: branches/pierre-fsd/subsystems/win32/win32k/objects/fillshap.c
URL:
http://svn.reactos.org/svn/reactos/branches/pierre-fsd/subsystems/win32/win…
==============================================================================
--- branches/pierre-fsd/subsystems/win32/win32k/objects/fillshap.c [iso-8859-1]
(original)
+++ branches/pierre-fsd/subsystems/win32/win32k/objects/fillshap.c [iso-8859-1] Sat Nov 14
19:25:03 2009
@@ -73,10 +73,6 @@
Dc_Attr = dc->pDc_Attr;
if (!Dc_Attr) Dc_Attr = &dc->Dc_Attr;
- BitmapObj = BITMAPOBJ_LockBitmap(dc->w.hBitmap);
- /* FIXME - BitmapObj can be NULL!!!! don't assert but handle this case
gracefully! */
- ASSERT(BitmapObj);
-
/* Convert to screen coordinates */
IntLPtoDP(dc, Points, Count);
for (CurrentPoint = 0; CurrentPoint < Count; CurrentPoint++)
@@ -113,16 +109,14 @@
ASSERT(psurf);
/* Now fill the polygon with the current brush. */
- FillBrushObj = BRUSHOBJ_LockBrush(Dc_Attr->hbrush);
if (FillBrushObj && !(FillBrushObj->flAttrs & GDIBRUSH_IS_NULL))
{
IntGdiInitBrushInstance(&FillBrushInst, FillBrushObj,
dc->XlateBrush);
ret = FillPolygon ( dc, psurf, &FillBrushInst.BrushObject,
ROP2_TO_MIX(Dc_Attr->jROP2), Points, Count, DestRect );
}
- BRUSHOBJ_UnlockBrush(FillBrushObj);
-
- /* get BRUSHOBJ from current pen. */
- PenBrushObj = PENOBJ_LockPen(Dc_Attr->hpen);
+ if (FillBrushObj)
+ BRUSHOBJ_UnlockBrush(FillBrushObj);
+
// Draw the Polygon Edges with the current pen ( if not a NULL pen )
if (PenBrushObj && !(PenBrushObj->flAttrs & GDIBRUSH_IS_NULL))
{
@@ -162,7 +156,8 @@
ROP2_TO_MIX(Dc_Attr->jROP2)); /* MIX */
}
}
- PENOBJ_UnlockPen(PenBrushObj);
+ if (PenBrushObj)
+ PENOBJ_UnlockPen(PenBrushObj);
}
SURFACE_UnlockSurface(psurf);
@@ -519,8 +514,6 @@
PDC_ATTR Dc_Attr;
ASSERT ( dc ); // caller's responsibility to set this up
- /* FIXME - BitmapObj can be NULL!!! Don't assert but handle this case gracefully!
*/
- ASSERT ( BitmapObj );
Dc_Attr = dc->pDc_Attr;
if(!Dc_Attr) Dc_Attr = &dc->Dc_Attr;
@@ -541,42 +534,27 @@
// Rectangle Path only.
if ( PATH_IsPathOpen(dc->DcLevel) )
{
- ret = PATH_Rectangle ( dc, LeftRect, TopRect, RightRect, BottomRect );
- }
- else
- {
- LeftRect += dc->ptlDCOrig.x;
- RightRect += dc->ptlDCOrig.x - 1;
- TopRect += dc->ptlDCOrig.y;
- BottomRect += dc->ptlDCOrig.y - 1;
-
- DestRect.left = LeftRect;
- DestRect.right = RightRect;
- DestRect.top = TopRect;
- DestRect.bottom = BottomRect;
-
- FillBrushObj = BRUSHOBJ_LockBrush(Dc_Attr->hbrush);
-
- if ( FillBrushObj )
- {
- if (!(FillBrushObj->flAttrs & GDIBRUSH_IS_NULL))
- {
- IntGdiInitBrushInstance(&FillBrushInst, FillBrushObj,
dc->XlateBrush);
- ret = IntEngBitBlt(&BitmapObj->SurfObj,
- NULL,
- NULL,
- dc->CombinedClip,
- NULL,
- &DestRect,
- NULL,
- NULL,
- &FillBrushInst.BrushObject,
- NULL,
- ROP3_TO_ROP4(PATCOPY));
- }
- }
-
- BRUSHOBJ_UnlockBrush(FillBrushObj);
+ return PATH_Rectangle ( dc, LeftRect, TopRect, RightRect, BottomRect );
+ }
+
+ DestRect.left = LeftRect;
+ DestRect.right = RightRect;
+ DestRect.top = TopRect;
+ DestRect.bottom = BottomRect;
+
+ IntLPtoDP(dc, (LPPOINT)&DestRect, 2);
+
+ DestRect.left += dc->ptlDCOrig.x;
+ DestRect.right += dc->ptlDCOrig.x;
+ DestRect.top += dc->ptlDCOrig.y;
+ DestRect.bottom += dc->ptlDCOrig.y;
+
+ /* In GM_COMPATIBLE, don't include bottom and right edges */
+ if (IntGetGraphicsMode(dc) == GM_COMPATIBLE)
+ {
+ DestRect.right--;
+ DestRect.bottom--;
+ }
if (Dc_Attr->ulDirty_ & DC_BRUSH_DIRTY)
IntGdiSelectBrush(dc,Dc_Attr->hbrush);
@@ -616,12 +594,13 @@
NULL,
ROP3_TO_ROP4(PATCOPY));
}
-
- IntGdiInitBrushInstance(&PenBrushInst, PenBrushObj, dc->XlatePen);
-
- // Draw the rectangle with the current pen
-
- ret = TRUE; // change default to success
+ }
+
+ IntGdiInitBrushInstance(&PenBrushInst, PenBrushObj, dc->XlatePen);
+
+ // Draw the rectangle with the current pen
+
+ ret = TRUE; // change default to success
if (!(PenBrushObj->flAttrs & GDIBRUSH_IS_NULL))
{
@@ -655,8 +634,12 @@
Mix);
}
+cleanup:
+ if (FillBrushObj)
+ BRUSHOBJ_UnlockBrush(FillBrushObj);
+
+ if (PenBrushObj)
PENOBJ_UnlockPen(PenBrushObj);
- }
if (psurf)
SURFACE_UnlockSurface(psurf);
@@ -664,7 +647,7 @@
/* Move current position in DC?
MSDN: The current position is neither used nor updated by Rectangle. */
- return TRUE;
+ return ret;
}
BOOL
Modified: branches/pierre-fsd/subsystems/win32/win32k/objects/path.c
URL:
http://svn.reactos.org/svn/reactos/branches/pierre-fsd/subsystems/win32/win…
==============================================================================
--- branches/pierre-fsd/subsystems/win32/win32k/objects/path.c [iso-8859-1] (original)
+++ branches/pierre-fsd/subsystems/win32/win32k/objects/path.c [iso-8859-1] Sat Nov 14
19:25:03 2009
@@ -135,7 +135,7 @@
* tests show that resetting the graphics mode to GM_COMPATIBLE does
* not reset the world transform.
*/
- xform = dc->DcLevel.xformWorld2Wnd;
+ MatrixS2XForm(&xform, &dc->DcLevel.mxWorldToPage);
/* Set MM_TEXT */
// IntGdiSetMapMode( dc, MM_TEXT );
@@ -1353,7 +1353,8 @@
IntGetViewportOrgEx(dc, &ptViewportOrg);
IntGetWindowExtEx(dc, &szWindowExt);
IntGetWindowOrgEx(dc, &ptWindowOrg);
- xform = dc->DcLevel.xformWorld2Wnd;
+
+ MatrixS2XForm(&xform, &dc->DcLevel.mxWorldToPage);
/* Set MM_TEXT */
Dc_Attr->iMapMode = MM_TEXT;
@@ -1480,7 +1481,7 @@
Dc_Attr->ptlViewportOrg.y = ptViewportOrg.y;
/* Restore the world transform */
- dc->DcLevel.xformWorld2Wnd = xform;
+ XForm2MatrixS(&dc->DcLevel.mxWorldToPage, &xform);
/* If we've moved the current point then get its new position
which will be in device (MM_TEXT) co-ords, convert it to