Author: tkreuzer
Date: Sun Oct 19 12:35:22 2008
New Revision: 36831
URL:
http://svn.reactos.org/svn/reactos?rev=36831&view=rev
Log:
Win32 structure cleanup (WIP):
- remove DesktopHeapBase and DesktopHeapLimit from W32THREADINFO, use DESKTOPINFO members
instead
Modified:
trunk/reactos/dll/win32/user32/include/user32.h
trunk/reactos/include/reactos/win32k/ntuser.h
trunk/reactos/subsystems/win32/win32k/ntuser/desktop.c
trunk/reactos/subsystems/win32/win32k/ntuser/misc.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] Sun Oct 19 12:35:22 2008
@@ -64,13 +64,14 @@
static __inline PVOID
DesktopPtrToUser(PVOID Ptr)
{
- PW32THREADINFO ti = GetW32ThreadInfo();
+ GetW32ThreadInfo();
PCLIENTINFO pci = GetWin32ClientInfo();
+ PDESKTOPINFO pdi = pci->pDeskInfo;
ASSERT(Ptr != NULL);
- ASSERT(ti != NULL);
- if ((ULONG_PTR)Ptr >= (ULONG_PTR)ti->DesktopHeapBase &&
- (ULONG_PTR)Ptr < (ULONG_PTR)ti->DesktopHeapBase + ti->DesktopHeapLimit)
+ ASSERT(pdi != NULL);
+ if ((ULONG_PTR)Ptr >= (ULONG_PTR)pdi->pvDesktopBase &&
+ (ULONG_PTR)Ptr < (ULONG_PTR)pdi->pvDesktopLimit)
{
return (PVOID)((ULONG_PTR)Ptr - pci->ulClientDelta);
}
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] Sun Oct 19 12:35:22 2008
@@ -40,6 +40,8 @@
PVOID pvDesktopBase;
PVOID pvDesktopLimit;
+ HANDLE hKernelHeap;
+ ULONG_PTR HeapLimit;
HWND hTaskManWindow;
HWND hProgmanWindow;
HWND hShellWindow;
@@ -312,8 +314,8 @@
PW32PROCESSINFO pi; /* [USER] */
PW32PROCESSINFO kpi; /* [KERNEL] */
PDESKTOPINFO Desktop;
- PVOID DesktopHeapBase;
- ULONG_PTR DesktopHeapLimit;
+// PVOID DesktopHeapBase;
+// ULONG_PTR DesktopHeapLimit;
/* A mask of what hooks are currently active */
ULONG Hooks;
CLIENTTHREADINFO ClientThreadInfo;
@@ -351,7 +353,7 @@
DWORD dwCompatFlags;
DWORD dwCompatFlags2;
DWORD dwTIFlags;
- PVOID pDeskInfo;
+ PDESKTOPINFO pDeskInfo;
ULONG_PTR ulClientDelta;
PHOOK phkCurrent;
ULONG fsHooks;
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/desktop.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/desktop.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/desktop.c [iso-8859-1] Sun Oct 19
12:35:22 2008
@@ -895,7 +895,7 @@
SIZE_T DesktopInfoSize;
UNICODE_STRING SafeDesktopName;
ULONG DummyContext;
- ULONG_PTR HeapLimit = 4 * 1024 * 1024; /* FIXME */
+ ULONG_PTR HeapSize = 4 * 1024 * 1024; /* FIXME */
DECLARE_RETURN(HDESK);
@@ -983,7 +983,7 @@
DesktopObject->DesktopHeapSection = NULL;
DesktopObject->pheapDesktop =
UserCreateHeap(&DesktopObject->DesktopHeapSection,
&DesktopHeapSystemBase,
- HeapLimit);
+ HeapSize);
if (DesktopObject->pheapDesktop == NULL)
{
ObDereferenceObject(DesktopObject);
@@ -1009,7 +1009,7 @@
DesktopInfoSize);
DesktopObject->DesktopInfo->pvDesktopBase = DesktopHeapSystemBase;
- DesktopObject->DesktopInfo->pvDesktopLimit = (PVOID)HeapLimit;
+ DesktopObject->DesktopInfo->pvDesktopLimit =
(PVOID)((ULONG_PTR)DesktopHeapSystemBase + HeapSize);
RtlCopyMemory(DesktopObject->DesktopInfo->szDesktopName,
lpszDesktopName->Buffer,
lpszDesktopName->Length);
@@ -1771,8 +1771,6 @@
if (ti->Desktop == DesktopObject->DesktopInfo)
{
ti->Desktop = NULL;
- ti->DesktopHeapBase = NULL;
- ti->DesktopHeapLimit = 0;
}
}
GetWin32ClientInfo()->ulClientDelta = 0;
@@ -1853,8 +1851,6 @@
if (ti->Desktop == NULL)
{
ti->Desktop = DesktopObject->DesktopInfo;
- ti->DesktopHeapBase = DesktopObject->pheapDesktop;
- ti->DesktopHeapLimit = ViewSize;
}
}
GetWin32ClientInfo()->ulClientDelta = DesktopHeapGetUserDelta();
@@ -1910,7 +1906,12 @@
/* Hack for system threads */
if (NtCurrentTeb())
{
- GetWin32ClientInfo()->ulClientDelta = DesktopHeapGetUserDelta();
+ PCLIENTINFO pci = GetWin32ClientInfo();
+ pci->ulClientDelta = DesktopHeapGetUserDelta();
+ if (DesktopObject)
+ {
+ pci->pDeskInfo = (PVOID)((ULONG_PTR)DesktopObject->DesktopInfo -
pci->ulClientDelta);
+ }
}
if (OldDesktop != NULL &&
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/misc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/misc.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/misc.c [iso-8859-1] Sun Oct 19 12:35:22
2008
@@ -462,14 +462,10 @@
if (W32Thread->Desktop != NULL)
{
ti->Desktop = W32Thread->Desktop->DesktopInfo;
- ti->DesktopHeapBase =
W32Thread->Desktop->DesktopInfo->pvDesktopBase;
- ti->DesktopHeapLimit =
(ULONG_PTR)W32Thread->Desktop->DesktopInfo->pvDesktopLimit;
}
else
{
ti->Desktop = NULL;
- ti->DesktopHeapBase = NULL;
- ti->DesktopHeapLimit = 0;
}
W32Thread->ThreadInfo = ti;