Author: tkreuzer Date: Sat Oct 18 15:34:36 2008 New Revision: 36811
URL: http://svn.reactos.org/svn/reactos?rev=36811&view=rev Log: Change return type of PsGetCurrentProcessWin32Process to PVOID.
Modified: trunk/reactos/include/ndk/psfuncs.h trunk/reactos/ntoskrnl/ps/process.c trunk/reactos/subsystems/win32/win32k/eng/driverobj.c trunk/reactos/subsystems/win32/win32k/include/desktop.h trunk/reactos/subsystems/win32/win32k/ntuser/desktop.c trunk/reactos/subsystems/win32/win32k/ntuser/menu.c trunk/reactos/subsystems/win32/win32k/w32k.h
Modified: trunk/reactos/include/ndk/psfuncs.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/psfuncs.h?rev=3... ============================================================================== --- trunk/reactos/include/ndk/psfuncs.h [iso-8859-1] (original) +++ trunk/reactos/include/ndk/psfuncs.h [iso-8859-1] Sat Oct 18 15:34:36 2008 @@ -42,7 +42,7 @@ );
NTKERNELAPI -struct _W32PROCESS* +PVOID NTAPI PsGetCurrentProcessWin32Process( VOID
Modified: trunk/reactos/ntoskrnl/ps/process.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ps/process.c?rev=3... ============================================================================== --- trunk/reactos/ntoskrnl/ps/process.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ps/process.c [iso-8859-1] Sat Oct 18 15:34:36 2008 @@ -1118,11 +1118,11 @@ /* * @implemented */ -struct _W32PROCESS* +PVOID NTAPI PsGetCurrentProcessWin32Process(VOID) { - return (struct _W32PROCESS*)PsGetCurrentProcess()->Win32Process; + return PsGetCurrentProcess()->Win32Process; }
/*
Modified: trunk/reactos/subsystems/win32/win32k/eng/driverobj.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/eng... ============================================================================== --- trunk/reactos/subsystems/win32/win32k/eng/driverobj.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/eng/driverobj.c [iso-8859-1] Sat Oct 18 15:34:36 2008 @@ -43,17 +43,19 @@ PW32PROCESS Win32Process) { PDRIVERGDI DrvObjInt; + PW32PROCESS CurrentWin32Process;
- IntEngLockProcessDriverObjs(PsGetCurrentProcessWin32Process()); + CurrentWin32Process = PsGetCurrentProcessWin32Process(); + IntEngLockProcessDriverObjs(CurrentWin32Process); while (!IsListEmpty(&Win32Process->DriverObjListHead)) { DrvObjInt = CONTAINING_RECORD(Win32Process->DriverObjListHead.Flink, DRIVERGDI, ListEntry); - IntEngUnLockProcessDriverObjs(PsGetCurrentProcessWin32Process()); + IntEngUnLockProcessDriverObjs(CurrentWin32Process); EngDeleteDriverObj((HDRVOBJ)(&DrvObjInt->DriverObj), TRUE, FALSE); - IntEngLockProcessDriverObjs(PsGetCurrentProcessWin32Process()); + IntEngLockProcessDriverObjs(CurrentWin32Process); } - IntEngUnLockProcessDriverObjs(PsGetCurrentProcessWin32Process()); + IntEngUnLockProcessDriverObjs(CurrentWin32Process); }
@@ -70,6 +72,7 @@ { PDRIVERGDI DrvObjInt; PDRIVEROBJ DrvObjUser; + PW32PROCESS CurrentWin32Process;
/* Create DRIVEROBJ */ DrvObjInt = EngAllocMem(0, sizeof (DRIVERGDI), TAG_DRIVEROBJ); @@ -88,9 +91,10 @@
/* fill internal object */ ExInitializeFastMutex(&DrvObjInt->Lock); - IntEngLockProcessDriverObjs(PsGetCurrentProcessWin32Process()); - InsertTailList(&PsGetCurrentProcessWin32Process()->DriverObjListHead, &DrvObjInt->ListEntry); - IntEngUnLockProcessDriverObjs(PsGetCurrentProcessWin32Process()); + CurrentWin32Process = PsGetCurrentProcessWin32Process(); + IntEngLockProcessDriverObjs(CurrentWin32Process); + InsertTailList(&CurrentWin32Process->DriverObjListHead, &DrvObjInt->ListEntry); + IntEngUnLockProcessDriverObjs(CurrentWin32Process);
return (HDRVOBJ)DrvObjUser; } @@ -109,6 +113,7 @@ { PDRIVEROBJ DrvObjUser = (PDRIVEROBJ)hdo; PDRIVERGDI DrvObjInt = ObjToGDI(DrvObjUser, DRIVER); + PW32PROCESS CurrentWin32Process;
/* Make sure the obj is locked */ if (!bLocked) @@ -129,9 +134,10 @@ }
/* Free the DRIVEROBJ */ - IntEngLockProcessDriverObjs(PsGetCurrentProcessWin32Process()); + CurrentWin32Process = PsGetCurrentProcessWin32Process(); + IntEngLockProcessDriverObjs(CurrentWin32Process); RemoveEntryList(&DrvObjInt->ListEntry); - IntEngUnLockProcessDriverObjs(PsGetCurrentProcessWin32Process()); + IntEngUnLockProcessDriverObjs(CurrentWin32Process); EngFreeMem(DrvObjInt);
return TRUE;
Modified: trunk/reactos/subsystems/win32/win32k/include/desktop.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/inc... ============================================================================== --- trunk/reactos/subsystems/win32/win32k/include/desktop.h [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/include/desktop.h [iso-8859-1] Sat Oct 18 15:34:36 2008 @@ -201,6 +201,7 @@ { PW32HEAP_USER_MAPPING Mapping; PTHREADINFO pti; + PW32PROCESS W32Process; HANDLE hDesktopHeap; ULONG_PTR Delta = 0;
@@ -210,7 +211,8 @@
hDesktopHeap = pti->Desktop->hDesktopHeap;
- Mapping = PsGetCurrentProcessWin32Process()->HeapMappings.Next; + W32Process = PsGetCurrentProcessWin32Process(); + Mapping = W32Process->HeapMappings.Next; while (Mapping != NULL) { if (Mapping->KernelMapping == (PVOID)hDesktopHeap) @@ -229,8 +231,10 @@ DesktopHeapAddressToUser(PVOID lpMem) { PW32HEAP_USER_MAPPING Mapping; - - Mapping = PsGetCurrentProcessWin32Process()->HeapMappings.Next; + PW32PROCESS W32Process; + + W32Process = PsGetCurrentProcessWin32Process(); + Mapping = W32Process->HeapMappings.Next; while (Mapping != NULL) { if ((ULONG_PTR)lpMem >= (ULONG_PTR)Mapping->KernelMapping &&
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/desktop.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ntu... ============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/desktop.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/desktop.c [iso-8859-1] Sat Oct 18 15:34:36 2008 @@ -1732,10 +1732,14 @@ IntUnmapDesktopView(IN PDESKTOP DesktopObject) { PW32THREADINFO ti; - PW32HEAP_USER_MAPPING HeapMapping, *PrevLink = &PsGetCurrentProcessWin32Process()->HeapMappings.Next; + PW32PROCESS CurrentWin32Process; + PW32HEAP_USER_MAPPING HeapMapping, *PrevLink; NTSTATUS Status = STATUS_SUCCESS;
TRACE("DO %p\n"); + + CurrentWin32Process = PsGetCurrentProcessWin32Process(); + PrevLink = &CurrentWin32Process->HeapMappings.Next;
/* unmap if we're the last thread using the desktop */ HeapMapping = *PrevLink; @@ -1780,11 +1784,15 @@ IntMapDesktopView(IN PDESKTOP DesktopObject) { PW32THREADINFO ti; - PW32HEAP_USER_MAPPING HeapMapping, *PrevLink = &PsGetCurrentProcessWin32Process()->HeapMappings.Next; + PW32PROCESS CurrentWin32Process; + PW32HEAP_USER_MAPPING HeapMapping, *PrevLink; PVOID UserBase = NULL; SIZE_T ViewSize = 0; LARGE_INTEGER Offset; NTSTATUS Status; + + CurrentWin32Process = PsGetCurrentProcessWin32Process(); + PrevLink = &CurrentWin32Process->HeapMappings.Next;
/* find out if another thread already mapped the desktop heap */ HeapMapping = *PrevLink;
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/menu.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ntu... ============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/menu.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/menu.c [iso-8859-1] Sat Oct 18 15:34:36 2008 @@ -313,6 +313,7 @@ IntCreateMenu(PHANDLE Handle, BOOL IsMenuBar) { PMENU_OBJECT Menu; + PW32PROCESS CurrentWin32Process;
Menu = (PMENU_OBJECT)UserCreateObject( gHandleTable, Handle, @@ -346,7 +347,8 @@ Menu->MenuItemList = NULL;
/* Insert menu item into process menu handle list */ - InsertTailList(&PsGetCurrentProcessWin32Process()->MenuListHead, &Menu->ListEntry); + CurrentWin32Process = PsGetCurrentProcessWin32Process(); + InsertTailList(&CurrentWin32Process->MenuListHead, &Menu->ListEntry);
return Menu; } @@ -416,6 +418,7 @@ PMENU_OBJECT FASTCALL IntCloneMenu(PMENU_OBJECT Source) { + PW32PROCESS CurrentWin32Process; HANDLE hMenu; PMENU_OBJECT Menu;
@@ -450,7 +453,8 @@ Menu->MenuItemList = NULL;
/* Insert menu item into process menu handle list */ - InsertTailList(&PsGetCurrentProcessWin32Process()->MenuListHead, &Menu->ListEntry); + CurrentWin32Process = PsGetCurrentProcessWin32Process(); + InsertTailList(&CurrentWin32Process->MenuListHead, &Menu->ListEntry);
IntCloneMenuItems(Menu, Source);
Modified: trunk/reactos/subsystems/win32/win32k/w32k.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/w32... ============================================================================== --- trunk/reactos/subsystems/win32/win32k/w32k.h [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/w32k.h [iso-8859-1] Sat Oct 18 15:34:36 2008 @@ -137,8 +137,9 @@ static __inline PVOID UserHeapAddressToUser(PVOID lpMem) { + PW32PROCESS W32Process = PsGetCurrentProcessWin32Process(); return (PVOID)(((ULONG_PTR)lpMem - (ULONG_PTR)GlobalUserHeap) + - (ULONG_PTR)PsGetCurrentProcessWin32Process()->HeapMappings.UserMapping); + (ULONG_PTR)W32Process->HeapMappings.UserMapping); }
#endif /* __W32K_H */