Author: jimtabor
Date: Sat May 23 04:57:51 2009
New Revision: 41051
URL:
http://svn.reactos.org/svn/reactos?rev=41051&view=rev
Log:
- Move Process Information structure back into kernel space. We use client information via
TEB to provide a pointer for user space as a reference pointer.
Modified:
trunk/reactos/include/reactos/win32k/ntuser.h
trunk/reactos/subsystems/win32/win32k/include/win32.h
trunk/reactos/subsystems/win32/win32k/main/dllmain.c
trunk/reactos/subsystems/win32/win32k/ntuser/misc.c
trunk/reactos/subsystems/win32/win32k/ntuser/ntstubs.c
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] Sat May 23 04:57:51 2009
@@ -1,7 +1,7 @@
#ifndef __WIN32K_NTUSER_H
#define __WIN32K_NTUSER_H
-struct _PROCESSINFO;
+typedef struct _PROCESSINFO *PPROCESSINFO;
struct _W32THREADINFO;
struct _WINDOW;
@@ -334,20 +334,6 @@
DWORD TimeTick;
DWORD SrvEventActivity;
} SERVERINFO, *PSERVERINFO;
-
-typedef struct _PROCESSINFO
-{
- PVOID UserHandleTable;
- HANDLE hUserHeap;
- ULONG_PTR UserHeapDelta;
- HINSTANCE hModUser;
- PWINDOWCLASS LocalClassList;
- PWINDOWCLASS GlobalClassList;
- PWINDOWCLASS SystemClassList;
-
- UINT RegisteredSysClasses : 1;
-
-} PROCESSINFO, *PPROCESSINFO;
#define CTI_INSENDMESSAGE 0x0002
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] Sat May 23 04:57:51
2009
@@ -94,4 +94,17 @@
PPROCESSINFO ProcessInfo;
} W32PROCESS, *PW32PROCESS;
+typedef struct _PROCESSINFO
+{
+ W32PROCESS XzyxW32Process; /* Place holder. */
+ /* ReactOS */
+ HINSTANCE hModUser;
+ PWINDOWCLASS LocalClassList;
+ PWINDOWCLASS GlobalClassList;
+ PWINDOWCLASS SystemClassList;
+
+ UINT RegisteredSysClasses : 1;
+
+} PROCESSINFO;
+
#endif /* __INCLUDE_NAPI_WIN32_H */
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] Sat May 23 04:57:51
2009
@@ -67,12 +67,12 @@
{
/* FIXME - lock the process */
Win32Process = ExAllocatePoolWithTag(NonPagedPool,
- sizeof(W32PROCESS),
+ sizeof(PROCESSINFO),
TAG('W', '3', '2',
'p'));
if (Win32Process == NULL) RETURN( STATUS_NO_MEMORY);
- RtlZeroMemory(Win32Process, sizeof(W32PROCESS));
+ RtlZeroMemory(Win32Process, sizeof(PROCESSINFO));
PsSetProcessWin32Process(Process, Win32Process);
/* FIXME - unlock the process */
@@ -151,12 +151,6 @@
if(LogonProcess == Win32Process)
{
LogonProcess = NULL;
- }
-
- if (Win32Process->ProcessInfo != NULL)
- {
- UserHeapFree(Win32Process->ProcessInfo);
- Win32Process->ProcessInfo = NULL;
}
}
@@ -339,12 +333,12 @@
if (Process->Win32Process == NULL)
{
/* FIXME - lock the process */
- Process->Win32Process = ExAllocatePool(NonPagedPool, sizeof(W32PROCESS));
+ Process->Win32Process = ExAllocatePool(NonPagedPool, sizeof(PROCESSINFO));
if (Process->Win32Process == NULL)
return STATUS_NO_MEMORY;
- RtlZeroMemory(Process->Win32Process, sizeof(W32PROCESS));
+ RtlZeroMemory(Process->Win32Process, sizeof(PROCESSINFO));
/* FIXME - unlock the process */
Win32kProcessCallback(Process, TRUE);
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] Sat May 23 04:57:51
2009
@@ -463,43 +463,7 @@
PPROCESSINFO
GetW32ProcessInfo(VOID)
{
- PPROCESSINFO pi;
- PW32PROCESS W32Process = PsGetCurrentProcessWin32Process();
-
- if (W32Process == NULL)
- {
- /* FIXME - temporary hack for system threads... */
- return NULL;
- }
-
- if (W32Process->ProcessInfo == NULL)
- {
- pi = UserHeapAlloc(sizeof(PROCESSINFO));
- if (pi != NULL)
- {
- RtlZeroMemory(pi,
- sizeof(PROCESSINFO));
-
- /* initialize it */
- pi->UserHandleTable = gHandleTable;
- pi->hUserHeap = W32Process->HeapMappings.KernelMapping;
- pi->UserHeapDelta = (ULONG_PTR)W32Process->HeapMappings.KernelMapping
-
- (ULONG_PTR)W32Process->HeapMappings.UserMapping;
-
- if (InterlockedCompareExchangePointer(&W32Process->ProcessInfo,
- pi,
- NULL) != NULL)
- {
- UserHeapFree(pi);
- }
- }
- else
- {
- SetLastWin32Error(ERROR_NOT_ENOUGH_MEMORY);
- }
- }
-
- return W32Process->ProcessInfo;
+ return (PPROCESSINFO)PsGetCurrentProcessWin32Process();
}
PW32THREADINFO
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/ntstubs.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/ntstubs.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/ntstubs.c [iso-8859-1] Sat May 23
04:57:51 2009
@@ -893,12 +893,13 @@
{
UserEnterShared();
GetW32ThreadInfo();
- PPROCESSINFO ppi = GetW32ProcessInfo();
+ PW32PROCESS W32Process = PsGetCurrentProcessWin32Process();
_SEH2_TRY
{
pUserConnect->siClient.psi = gpsi;
- pUserConnect->siClient.aheList = ppi->UserHandleTable;
- pUserConnect->siClient.ulSharedDelta = ppi->UserHeapDelta;
+ pUserConnect->siClient.aheList = gHandleTable;
+ pUserConnect->siClient.ulSharedDelta =
(ULONG_PTR)W32Process->HeapMappings.KernelMapping -
+
(ULONG_PTR)W32Process->HeapMappings.UserMapping;
}
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
{
@@ -909,7 +910,6 @@
{
SetLastNtError(Status);
}
- DPRINT("NtUserPC SI 0x%x : HT 0x%x : D 0x%x\n", gpsi,
ppi->UserHandleTable, ppi->UserHeapDelta);
UserLeave();
return Status;
}