Author: jimtabor
Date: Mon Mar 30 07:56:53 2009
New Revision: 40293
URL:
http://svn.reactos.org/svn/reactos?rev=40293&view=rev
Log:
- Update W32PROCESS and related code.
Modified:
trunk/reactos/subsystems/win32/win32k/include/win32.h
trunk/reactos/subsystems/win32/win32k/main/dllmain.c
trunk/reactos/subsystems/win32/win32k/ntuser/guicheck.c
trunk/reactos/subsystems/win32/win32k/ntuser/misc.c
trunk/reactos/subsystems/win32/win32k/ntuser/simplecall.c
trunk/reactos/subsystems/win32/win32k/objects/gdiobj.c
Modified: trunk/reactos/subsystems/win32/win32k/include/win32.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/include/win32.h [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/include/win32.h [iso-8859-1] Mon Mar 30 07:56:53
2009
@@ -64,19 +64,21 @@
typedef struct _W32PROCESS
{
- PEPROCESS peProcess;
- DWORD RefCount;
- ULONG Flags; /* W32PF_flags; */
- PKEVENT InputIdleEvent;
- DWORD StartCursorHideTime;
- DWORD NextStart;
- PVOID pDCAttrList;
- PVOID pBrushAttrList;
- DWORD W32Pid;
- LONG GDIObjects;
- LONG UserObjects;
- DWORD cSimpleLock; /* Locking Process during access to structure. */
- RTL_AVL_TABLE rtlAvlTable; /* Process AVL Table. */
+ PEPROCESS peProcess;
+ DWORD RefCount;
+ ULONG W32PF_flags;
+ PKEVENT InputIdleEvent;
+ DWORD StartCursorHideTime;
+ DWORD NextStart;
+ PVOID pDCAttrList;
+ PVOID pBrushAttrList;
+ DWORD W32Pid;
+ LONG GDIHandleCount;
+ LONG UserHandleCount;
+ DWORD cSimpleLock; /* Locking Process during access to structure. */
+ RTL_AVL_TABLE rtlAvlTable; /* Process AVL Table. */
+ LIST_ENTRY leDCAttrList;
+ LIST_ENTRY leObjAttrList;
/* ReactOS */
LIST_ENTRY ClassList;
LIST_ENTRY MenuListHead;
Modified: trunk/reactos/subsystems/win32/win32k/main/dllmain.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ma…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/main/dllmain.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/main/dllmain.c [iso-8859-1] Mon Mar 30 07:56:53
2009
@@ -129,7 +129,7 @@
}
/* setup process flags */
- Win32Process->Flags = 0;
+ Win32Process->W32PF_flags = 0;
}
else
{
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/guicheck.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/guicheck.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/guicheck.c [iso-8859-1] Mon Mar 30
07:56:53 2009
@@ -47,7 +47,7 @@
static BOOL FASTCALL
co_AddGuiApp(PW32PROCESS W32Data)
{
- W32Data->Flags |= W32PF_CREATEDWINORDC;
+ W32Data->W32PF_flags |= W32PF_CREATEDWINORDC;
if (InterlockedIncrement(&NrGuiAppsRunning) == 1)
{
BOOL Initialized;
@@ -56,7 +56,7 @@
if (!Initialized)
{
- W32Data->Flags &= ~W32PF_CREATEDWINORDC;
+ W32Data->W32PF_flags &= ~W32PF_CREATEDWINORDC;
InterlockedDecrement(&NrGuiAppsRunning);
return FALSE;
}
@@ -67,7 +67,7 @@
static void FASTCALL
RemoveGuiApp(PW32PROCESS W32Data)
{
- W32Data->Flags &= ~W32PF_CREATEDWINORDC;
+ W32Data->W32PF_flags &= ~W32PF_CREATEDWINORDC;
if (InterlockedDecrement(&NrGuiAppsRunning) == 0)
{
IntEndDesktopGraphics();
@@ -82,14 +82,14 @@
W32Data = PsGetCurrentProcessWin32Process();
if (Create)
{
- if (! (W32Data->Flags & W32PF_CREATEDWINORDC) && !
(W32Data->Flags & W32PF_MANUALGUICHECK))
+ if (! (W32Data->W32PF_flags & W32PF_CREATEDWINORDC) && !
(W32Data->W32PF_flags & W32PF_MANUALGUICHECK))
{
return co_AddGuiApp(W32Data);
}
}
else
{
- if ((W32Data->Flags & W32PF_CREATEDWINORDC) && ! (W32Data->Flags
& W32PF_MANUALGUICHECK))
+ if ((W32Data->W32PF_flags & W32PF_CREATEDWINORDC) && !
(W32Data->W32PF_flags & W32PF_MANUALGUICHECK))
{
RemoveGuiApp(W32Data);
}
@@ -109,18 +109,18 @@
W32Data = PsGetCurrentProcessWin32Process();
if (0 == Check)
{
- W32Data->Flags |= W32PF_MANUALGUICHECK;
+ W32Data->W32PF_flags |= W32PF_MANUALGUICHECK;
}
else if (0 < Check)
{
- if (! (W32Data->Flags & W32PF_CREATEDWINORDC))
+ if (! (W32Data->W32PF_flags & W32PF_CREATEDWINORDC))
{
co_AddGuiApp(W32Data);
}
}
else
{
- if (W32Data->Flags & W32PF_CREATEDWINORDC)
+ if (W32Data->W32PF_flags & W32PF_CREATEDWINORDC)
{
RemoveGuiApp(W32Data);
}
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] Mon Mar 30 07:56:53
2009
@@ -283,12 +283,12 @@
{
case GR_GDIOBJECTS:
{
- Ret = (DWORD)W32Process->GDIObjects;
+ Ret = (DWORD)W32Process->GDIHandleCount;
break;
}
case GR_USEROBJECTS:
{
- Ret = (DWORD)W32Process->UserObjects;
+ Ret = (DWORD)W32Process->UserHandleCount;
break;
}
default:
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] Mon Mar 30
07:56:53 2009
@@ -342,11 +342,11 @@
if(Enable)
{
- Process->Flags &= ~W32PF_NOWINDOWGHOSTING;
+ Process->W32PF_flags &= ~W32PF_NOWINDOWGHOSTING;
}
else
{
- Process->Flags |= W32PF_NOWINDOWGHOSTING;
+ Process->W32PF_flags |= W32PF_NOWINDOWGHOSTING;
}
RETURN( TRUE);
Modified: trunk/reactos/subsystems/win32/win32k/objects/gdiobj.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/gdiobj.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/gdiobj.c [iso-8859-1] Mon Mar 30
07:56:53 2009
@@ -355,7 +355,7 @@
W32Process = PsGetCurrentProcessWin32Process();
/* HACK HACK HACK: simplest-possible quota implementation - don't allow a
process
to take too many GDI objects, itself. */
- if (W32Process && W32Process->GDIObjects >= 0x2710)
+ if (W32Process && W32Process->GDIHandleCount >= 0x2710)
{
DPRINT1("Too many objects for process!!!\n");
GDIDBG_DUMPHANDLETABLE();
@@ -426,7 +426,7 @@
if (W32Process != NULL)
{
- InterlockedIncrement(&W32Process->GDIObjects);
+ InterlockedIncrement(&W32Process->GDIHandleCount);
}
DPRINT("GDIOBJ_AllocObj: 0x%x ob: 0x%x\n", Handle, newObject);
@@ -559,7 +559,7 @@
if (W32Process != NULL)
{
- InterlockedDecrement(&W32Process->GDIObjects);
+ InterlockedDecrement(&W32Process->GDIHandleCount);
}
/* call the cleanup routine. */
@@ -688,7 +688,7 @@
W32Process = (PW32PROCESS)Process->Win32Process;
ASSERT(W32Process);
- if (W32Process->GDIObjects > 0)
+ if (W32Process->GDIHandleCount > 0)
{
ProcId = Process->UniqueProcessId;
@@ -719,7 +719,7 @@
DPRINT1("Failed to delete object %p!\n",
ObjectHandle);
}
- if (W32Process->GDIObjects == 0)
+ if (W32Process->GDIHandleCount == 0)
{
/* there are no more gdi handles for this process, bail */
break;
@@ -768,9 +768,9 @@
#endif
DPRINT("Completed cleanup for process %d\n", Process->UniqueProcessId);
- if (W32Process->GDIObjects > 0)
- {
- DPRINT1("Leaking %d handles!\n", W32Process->GDIObjects);
+ if (W32Process->GDIHandleCount > 0)
+ {
+ DPRINT1("Leaking %d handles!\n", W32Process->GDIHandleCount);
}
return TRUE;
@@ -1140,7 +1140,7 @@
W32Process = (PW32PROCESS)OldProcess->Win32Process;
if (W32Process != NULL)
{
- InterlockedDecrement(&W32Process->GDIObjects);
+
InterlockedDecrement(&W32Process->GDIHandleCount);
}
ObDereferenceObject(OldProcess);
}
@@ -1243,7 +1243,7 @@
W32Process = (PW32PROCESS)OldProcess->Win32Process;
if (W32Process != NULL)
{
- InterlockedDecrement(&W32Process->GDIObjects);
+
InterlockedDecrement(&W32Process->GDIHandleCount);
}
ObDereferenceObject(OldProcess);
}
@@ -1257,7 +1257,7 @@
W32Process = (PW32PROCESS)NewOwner->Win32Process;
if (W32Process != NULL)
{
- InterlockedIncrement(&W32Process->GDIObjects);
+ InterlockedIncrement(&W32Process->GDIHandleCount);
}
}
else