From fdcbfe037e80bda87989b4bb4e732edf421fabc5 Mon Sep 17 00:00:00 2001 From: James Tabor Date: Wed, 12 Oct 2011 22:46:07 +0000 Subject: [PATCH] [Win32k] - Support Active SxS for the window structures. svn path=/trunk/; revision=54101 --- reactos/include/reactos/win32k/ntuser.h | 6 +++--- .../subsystems/win32/win32k/include/window.h | 2 +- .../subsystems/win32/win32k/ntuser/callback.c | 19 +++++++++++-------- .../subsystems/win32/win32k/ntuser/desktop.c | 4 ++-- .../subsystems/win32/win32k/ntuser/window.c | 12 ++++++++---- 5 files changed, 25 insertions(+), 18 deletions(-) diff --git a/reactos/include/reactos/win32k/ntuser.h b/reactos/include/reactos/win32k/ntuser.h index 9247a7315af..dc11a256c33 100644 --- a/reactos/include/reactos/win32k/ntuser.h +++ b/reactos/include/reactos/win32k/ntuser.h @@ -6,7 +6,6 @@ typedef struct _THREADINFO *PTHREADINFO; struct _DESKTOP; struct _WND; - #define FIRST_USER_HANDLE 0x0020 /* first possible value for low word of user handle */ #define LAST_USER_HANDLE 0xffef /* last possible value for low word of user handle */ @@ -247,6 +246,7 @@ typedef struct _CALLBACKWND { HWND hWnd; struct _WND *pWnd; + PVOID pActCtx; } CALLBACKWND, *PCALLBACKWND; #define CI_TRANSACTION 0x00000001 @@ -284,7 +284,7 @@ typedef struct _CLIENTINFO UCHAR achDbcsCF[2]; MSG msgDbcsCB; LPDWORD lpdwRegisteredClasses; - ULONG Win32ClientInfo3[27]; + ULONG Win32ClientInfo3[26]; /* It's just a pointer reference not to be used w the structure in user space. */ PPROCESSINFO ppi; } CLIENTINFO, *PCLIENTINFO; @@ -591,7 +591,7 @@ typedef struct _WND struct _WND *spwndLastActive; //HIMC hImc; // Input context associated with this window. LONG dwUserData; - //PACTIVATION_CONTEXT pActCtx; + PVOID pActCtx; //PD3DMATRIX pTransForm; struct _WND *spwndClipboardListener; DWORD ExStyle2; diff --git a/reactos/subsystems/win32/win32k/include/window.h b/reactos/subsystems/win32/win32k/include/window.h index 388518a134f..4a209386074 100644 --- a/reactos/subsystems/win32/win32k/include/window.h +++ b/reactos/subsystems/win32/win32k/include/window.h @@ -47,7 +47,7 @@ VOID FASTCALL IntGetWindowBorderMeasures(PWND WindowObject, UINT *cx, UINT *cy); BOOL FASTCALL IntShowOwnedPopups( PWND owner, BOOL fShow ); LRESULT FASTCALL IntDefWindowProc( PWND Window, UINT Msg, WPARAM wParam, LPARAM lParam, BOOL Ansi); VOID FASTCALL IntNotifyWinEvent(DWORD, PWND, LONG, LONG, DWORD); -PWND FASTCALL co_UserCreateWindowEx(CREATESTRUCTW*, PUNICODE_STRING, PLARGE_STRING); +PWND FASTCALL co_UserCreateWindowEx(CREATESTRUCTW*, PUNICODE_STRING, PLARGE_STRING, PVOID); BOOL FASTCALL IntEnableWindow(HWND,BOOL); DWORD FASTCALL GetNCHitEx(PWND pWnd, POINT pt); diff --git a/reactos/subsystems/win32/win32k/ntuser/callback.c b/reactos/subsystems/win32/win32k/ntuser/callback.c index e5293a06ea4..52b90181aee 100644 --- a/reactos/subsystems/win32/win32k/ntuser/callback.c +++ b/reactos/subsystems/win32/win32k/ntuser/callback.c @@ -87,7 +87,7 @@ IntCleanupThreadCallbacks(PTHREADINFO W32Thread) // This will help user space programs speed up read access with the window object. // static VOID -IntSetTebWndCallback (HWND * hWnd, PWND * pWnd) +IntSetTebWndCallback (HWND * hWnd, PWND * pWnd, PVOID * pActCtx) { HWND hWndS = *hWnd; PWND Window = UserGetWindowObject(*hWnd); @@ -95,18 +95,21 @@ IntSetTebWndCallback (HWND * hWnd, PWND * pWnd) *hWnd = ClientInfo->CallbackWnd.hWnd; *pWnd = ClientInfo->CallbackWnd.pWnd; + *pActCtx = ClientInfo->CallbackWnd.pActCtx; ClientInfo->CallbackWnd.hWnd = hWndS; ClientInfo->CallbackWnd.pWnd = DesktopHeapAddressToUser(Window); + ClientInfo->CallbackWnd.pActCtx = Window->pActCtx; } static VOID -IntRestoreTebWndCallback (HWND hWnd, PWND pWnd) +IntRestoreTebWndCallback (HWND hWnd, PWND pWnd, PVOID pActCtx) { PCLIENTINFO ClientInfo = GetWin32ClientInfo(); ClientInfo->CallbackWnd.hWnd = hWnd; ClientInfo->CallbackWnd.pWnd = pWnd; + ClientInfo->CallbackWnd.pActCtx = pActCtx; } /* FUNCTIONS *****************************************************************/ @@ -227,7 +230,7 @@ co_IntCallSentMessageCallback(SENDASYNCPROC CompletionCallback, LRESULT Result) { SENDASYNCPROC_CALLBACK_ARGUMENTS Arguments; - PVOID ResultPointer; + PVOID ResultPointer, pActCtx; PWND pWnd; ULONG ResultLength; NTSTATUS Status; @@ -238,7 +241,7 @@ co_IntCallSentMessageCallback(SENDASYNCPROC CompletionCallback, Arguments.Context = CompletionCallbackContext; Arguments.Result = Result; - IntSetTebWndCallback (&hWnd, &pWnd); + IntSetTebWndCallback (&hWnd, &pWnd, &pActCtx); UserLeaveCo(); @@ -250,7 +253,7 @@ co_IntCallSentMessageCallback(SENDASYNCPROC CompletionCallback, UserEnterCo(); - IntRestoreTebWndCallback (hWnd, pWnd); + IntRestoreTebWndCallback (hWnd, pWnd, pActCtx); if (!NT_SUCCESS(Status)) { @@ -271,7 +274,7 @@ co_IntCallWindowProc(WNDPROC Proc, WINDOWPROC_CALLBACK_ARGUMENTS StackArguments; PWINDOWPROC_CALLBACK_ARGUMENTS Arguments; NTSTATUS Status; - PVOID ResultPointer; + PVOID ResultPointer, pActCtx; PWND pWnd; ULONG ResultLength; ULONG ArgumentLength; @@ -304,7 +307,7 @@ co_IntCallWindowProc(WNDPROC Proc, ResultPointer = NULL; ResultLength = ArgumentLength; - IntSetTebWndCallback (&Wnd, &pWnd); + IntSetTebWndCallback (&Wnd, &pWnd, &pActCtx); UserLeaveCo(); @@ -328,7 +331,7 @@ co_IntCallWindowProc(WNDPROC Proc, UserEnterCo(); - IntRestoreTebWndCallback (Wnd, pWnd); + IntRestoreTebWndCallback (Wnd, pWnd, pActCtx); if (!NT_SUCCESS(Status)) { diff --git a/reactos/subsystems/win32/win32k/ntuser/desktop.c b/reactos/subsystems/win32/win32k/ntuser/desktop.c index dc0b9361ca8..1c68a217df5 100644 --- a/reactos/subsystems/win32/win32k/ntuser/desktop.c +++ b/reactos/subsystems/win32/win32k/ntuser/desktop.c @@ -1060,7 +1060,7 @@ NtUserCreateDesktop( Cs.lpszName = (LPCWSTR) &WindowName; Cs.lpszClass = (LPCWSTR) &ClassName; - pWndDesktop = co_UserCreateWindowEx(&Cs, &ClassName, &WindowName); + pWndDesktop = co_UserCreateWindowEx(&Cs, &ClassName, &WindowName, NULL); if (!pWnd) { ERR("Failed to create Desktop window handle\n"); @@ -1088,7 +1088,7 @@ NtUserCreateDesktop( Cs.lpszName = (LPCWSTR) &WindowName; Cs.lpszClass = (LPCWSTR) &ClassName; - pWnd = co_UserCreateWindowEx(&Cs, &ClassName, &WindowName); + pWnd = co_UserCreateWindowEx(&Cs, &ClassName, &WindowName, NULL); if (!pWnd) { ERR("Failed to create Message window handle\n"); diff --git a/reactos/subsystems/win32/win32k/ntuser/window.c b/reactos/subsystems/win32/win32k/ntuser/window.c index ce45077a746..fd3a823bf41 100644 --- a/reactos/subsystems/win32/win32k/ntuser/window.c +++ b/reactos/subsystems/win32/win32k/ntuser/window.c @@ -1557,7 +1557,8 @@ PWND FASTCALL IntCreateWindow(CREATESTRUCTW* Cs, PLARGE_STRING WindowName, PCLS Class, PWND ParentWindow, - PWND OwnerWindow) + PWND OwnerWindow, + PVOID acbiBuffer) { PWND pWnd = NULL; HWND hWnd; @@ -1642,6 +1643,7 @@ PWND FASTCALL IntCreateWindow(CREATESTRUCTW* Cs, pWnd->style = Cs->style & ~WS_VISIBLE; pWnd->ExStyle = Cs->dwExStyle; pWnd->cbwndExtra = pWnd->pcls->cbwndExtra; + pWnd->pActCtx = acbiBuffer; IntReferenceMessageQueue(pWnd->head.pti->MessageQueue); if (pWnd->spwndParent != NULL && Cs->hwndParent != 0) @@ -1835,7 +1837,8 @@ AllocError: PWND FASTCALL co_UserCreateWindowEx(CREATESTRUCTW* Cs, PUNICODE_STRING ClassName, - PLARGE_STRING WindowName) + PLARGE_STRING WindowName, + PVOID acbiBuffer) { PWND Window = NULL, ParentWindow = NULL, OwnerWindow; HWND hWnd, hWndParent, hWndOwner, hwndInsertAfter; @@ -1914,7 +1917,8 @@ co_UserCreateWindowEx(CREATESTRUCTW* Cs, WindowName, Class, ParentWindow, - OwnerWindow); + OwnerWindow, + acbiBuffer); if(!Window) { ERR("IntCreateWindow failed!\n"); @@ -2347,7 +2351,7 @@ NtUserCreateWindowEx( UserEnterExclusive(); /* Call the internal function */ - pwnd = co_UserCreateWindowEx(&Cs, &ustrClassName, plstrWindowName); + pwnd = co_UserCreateWindowEx(&Cs, &ustrClassName, plstrWindowName, acbiBuffer); if(!pwnd) {