diff --git a/reactos/dll/win32/user32/misc/misc.c b/reactos/dll/win32/user32/misc/misc.c index 5b8e9be5bf2..801543eb479 100644 --- a/reactos/dll/win32/user32/misc/misc.c +++ b/reactos/dll/win32/user32/misc/misc.c @@ -524,7 +524,7 @@ PWND FASTCALL GetThreadDesktopWnd(VOID) { - PWND Wnd = GetThreadDesktopInfo()->Wnd; + PWND Wnd = GetThreadDesktopInfo()->spwnd; if (Wnd != NULL) Wnd = DesktopPtrToUser(Wnd); return Wnd; diff --git a/reactos/include/reactos/win32k/ntuser.h b/reactos/include/reactos/win32k/ntuser.h index ff21d4cab8e..f8dc6c4f52a 100644 --- a/reactos/include/reactos/win32k/ntuser.h +++ b/reactos/include/reactos/win32k/ntuser.h @@ -40,13 +40,13 @@ typedef struct _DESKTOPINFO { PVOID pvDesktopBase; PVOID pvDesktopLimit; + struct _WND *spwnd; + DWORD fsHooks; + struct tagHOOK * aphkStart[16]; - HANDLE hKernelHeap; - ULONG_PTR HeapLimit; HWND hTaskManWindow; HWND hProgmanWindow; HWND hShellWindow; - struct _WND *Wnd; union { diff --git a/reactos/subsystems/win32/win32k/include/desktop.h b/reactos/subsystems/win32/win32k/include/desktop.h index 26179a4a5af..17020c9caef 100644 --- a/reactos/subsystems/win32/win32k/include/desktop.h +++ b/reactos/subsystems/win32/win32k/include/desktop.h @@ -6,29 +6,36 @@ typedef struct _DESKTOP { + PDESKTOPINFO pDeskInfo; + LIST_ENTRY ListEntry; + PWND spwndForeground; + PWND spwndTray; + PWND spwndMessage; + PWND spwndTooltip; + PSECTION_OBJECT hsectionDesktop; + PWIN32HEAP pheapDesktop; + ULONG_PTR ulHeapSize; + LIST_ENTRY PtiList; + /* use for tracking mouse moves. */ + PWND spwndTrack; + DWORD htEx; + RECT rcMouseHover; + DWORD dwMouseHoverTime; + + /* ReactOS */ CSHORT Type; CSHORT Size; - LIST_ENTRY ListEntry; - - LIST_ENTRY PtiList; - + /* Rectangle of the work area */ + RECTL WorkArea; /* Pointer to the associated window station. */ struct _WINSTATION_OBJECT *WindowStation; /* Pointer to the active queue. */ PVOID ActiveMessageQueue; - /* Rectangle of the work area */ - RECTL WorkArea; /* Handle of the desktop window. */ HANDLE DesktopWindow; /* Thread blocking input */ PVOID BlockInputThread; - LIST_ENTRY ShellHookWindows; - - PWIN32HEAP pheapDesktop; - PSECTION_OBJECT DesktopHeapSection; - PDESKTOPINFO pDeskInfo; - PWND spwndMessage; } DESKTOP, *PDESKTOP; extern PDESKTOP InputDesktop; diff --git a/reactos/subsystems/win32/win32k/ntuser/desktop.c b/reactos/subsystems/win32/win32k/ntuser/desktop.c index 7c14a654fa4..b0567271dcb 100644 --- a/reactos/subsystems/win32/win32k/ntuser/desktop.c +++ b/reactos/subsystems/win32/win32k/ntuser/desktop.c @@ -847,10 +847,10 @@ BOOL IntDeRegisterShellHookWindow(HWND hWnd) static VOID IntFreeDesktopHeap(IN OUT PDESKTOP Desktop) { - if (Desktop->DesktopHeapSection != NULL) + if (Desktop->hsectionDesktop != NULL) { - ObDereferenceObject(Desktop->DesktopHeapSection); - Desktop->DesktopHeapSection = NULL; + ObDereferenceObject(Desktop->hsectionDesktop); + Desktop->hsectionDesktop = NULL; } } /* SYSCALLS *******************************************************************/ @@ -1018,8 +1018,8 @@ NtUserCreateDesktop( NULL); if (!NT_SUCCESS(Status)) RETURN(NULL); - DesktopObject->DesktopHeapSection = NULL; - DesktopObject->pheapDesktop = UserCreateHeap(&DesktopObject->DesktopHeapSection, + DesktopObject->hsectionDesktop = NULL; + DesktopObject->pheapDesktop = UserCreateHeap(&DesktopObject->hsectionDesktop, &DesktopHeapSystemBase, HeapSize); if (DesktopObject->pheapDesktop == NULL) @@ -1890,7 +1890,7 @@ IntMapDesktopView(IN PDESKTOP DesktopObject) /* we're the first, map the heap */ DPRINT("Noone mapped the desktop heap %p yet, so - map it!\n", DesktopObject->pheapDesktop); Offset.QuadPart = 0; - Status = MmMapViewOfSection(DesktopObject->DesktopHeapSection, + Status = MmMapViewOfSection(DesktopObject->hsectionDesktop, PsGetCurrentProcess(), &UserBase, 0, diff --git a/reactos/subsystems/win32/win32k/ntuser/hook.c b/reactos/subsystems/win32/win32k/ntuser/hook.c index a59444b9f60..080164613fe 100644 --- a/reactos/subsystems/win32/win32k/ntuser/hook.c +++ b/reactos/subsystems/win32/win32k/ntuser/hook.c @@ -117,6 +117,9 @@ IntAddHook(PETHREAD Thread, int HookId, BOOLEAN Global, PWINSTATION_OBJECT WinSt if (W32Thread->pClientInfo) W32Thread->pClientInfo->fsHooks = W32Thread->fsHooks; + if (W32Thread->pDeskInfo) // Do this for now. + W32Thread->pDeskInfo->fsHooks= W32Thread->fsHooks; + Hook->head.pti = W32Thread; Hook->head.rpdesk = W32Thread->Desktop; } @@ -238,6 +241,9 @@ IntRemoveHook(PHOOK Hook, PWINSTATION_OBJECT WinStaObj, BOOL TableAlreadyLocked) GetWin32ClientInfo()->fsHooks = W32Thread->fsHooks; + if (W32Thread->pDeskInfo) // Do this for now. + W32Thread->pDeskInfo->fsHooks= W32Thread->fsHooks; + if (0 != Table->Counts[HOOKID_TO_INDEX(Hook->HookId)]) { Hook->Proc = NULL; /* chain is in use, just mark it and return */ diff --git a/reactos/subsystems/win32/win32k/ntuser/window.c b/reactos/subsystems/win32/win32k/ntuser/window.c index 1713360c759..a3c90abb417 100644 --- a/reactos/subsystems/win32/win32k/ntuser/window.c +++ b/reactos/subsystems/win32/win32k/ntuser/window.c @@ -1844,7 +1844,7 @@ AllocErr: { /* If there is no desktop window yet, we must be creating it */ pti->Desktop->DesktopWindow = hWnd; - pti->Desktop->pDeskInfo->Wnd = Wnd; + pti->Desktop->pDeskInfo->spwnd = Wnd; } /*