mirror of
https://github.com/reactos/reactos.git
synced 2025-04-22 05:00:27 +00:00
Change return type of PsGetCurrentProcessWin32Process to PVOID.
svn path=/trunk/; revision=36811
This commit is contained in:
parent
a0cd996949
commit
35fe207a58
7 changed files with 42 additions and 19 deletions
|
@ -42,7 +42,7 @@ PsGetCurrentThreadWin32Thread(
|
|||
);
|
||||
|
||||
NTKERNELAPI
|
||||
struct _W32PROCESS*
|
||||
PVOID
|
||||
NTAPI
|
||||
PsGetCurrentProcessWin32Process(
|
||||
VOID
|
||||
|
|
|
@ -1118,11 +1118,11 @@ PsGetProcessSessionId(PEPROCESS Process)
|
|||
/*
|
||||
* @implemented
|
||||
*/
|
||||
struct _W32PROCESS*
|
||||
PVOID
|
||||
NTAPI
|
||||
PsGetCurrentProcessWin32Process(VOID)
|
||||
{
|
||||
return (struct _W32PROCESS*)PsGetCurrentProcess()->Win32Process;
|
||||
return PsGetCurrentProcess()->Win32Process;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -43,17 +43,19 @@ IntEngCleanupDriverObjs(struct _EPROCESS *Process,
|
|||
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 @@ EngCreateDriverObj(
|
|||
{
|
||||
PDRIVERGDI DrvObjInt;
|
||||
PDRIVEROBJ DrvObjUser;
|
||||
PW32PROCESS CurrentWin32Process;
|
||||
|
||||
/* Create DRIVEROBJ */
|
||||
DrvObjInt = EngAllocMem(0, sizeof (DRIVERGDI), TAG_DRIVEROBJ);
|
||||
|
@ -88,9 +91,10 @@ EngCreateDriverObj(
|
|||
|
||||
/* 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 @@ EngDeleteDriverObj(
|
|||
{
|
||||
PDRIVEROBJ DrvObjUser = (PDRIVEROBJ)hdo;
|
||||
PDRIVERGDI DrvObjInt = ObjToGDI(DrvObjUser, DRIVER);
|
||||
PW32PROCESS CurrentWin32Process;
|
||||
|
||||
/* Make sure the obj is locked */
|
||||
if (!bLocked)
|
||||
|
@ -129,9 +134,10 @@ EngDeleteDriverObj(
|
|||
}
|
||||
|
||||
/* Free the DRIVEROBJ */
|
||||
IntEngLockProcessDriverObjs(PsGetCurrentProcessWin32Process());
|
||||
CurrentWin32Process = PsGetCurrentProcessWin32Process();
|
||||
IntEngLockProcessDriverObjs(CurrentWin32Process);
|
||||
RemoveEntryList(&DrvObjInt->ListEntry);
|
||||
IntEngUnLockProcessDriverObjs(PsGetCurrentProcessWin32Process());
|
||||
IntEngUnLockProcessDriverObjs(CurrentWin32Process);
|
||||
EngFreeMem(DrvObjInt);
|
||||
|
||||
return TRUE;
|
||||
|
|
|
@ -201,6 +201,7 @@ DesktopHeapGetUserDelta(VOID)
|
|||
{
|
||||
PW32HEAP_USER_MAPPING Mapping;
|
||||
PTHREADINFO pti;
|
||||
PW32PROCESS W32Process;
|
||||
HANDLE hDesktopHeap;
|
||||
ULONG_PTR Delta = 0;
|
||||
|
||||
|
@ -210,7 +211,8 @@ DesktopHeapGetUserDelta(VOID)
|
|||
|
||||
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 @@ static __inline PVOID
|
|||
DesktopHeapAddressToUser(PVOID lpMem)
|
||||
{
|
||||
PW32HEAP_USER_MAPPING Mapping;
|
||||
PW32PROCESS W32Process;
|
||||
|
||||
Mapping = PsGetCurrentProcessWin32Process()->HeapMappings.Next;
|
||||
W32Process = PsGetCurrentProcessWin32Process();
|
||||
Mapping = W32Process->HeapMappings.Next;
|
||||
while (Mapping != NULL)
|
||||
{
|
||||
if ((ULONG_PTR)lpMem >= (ULONG_PTR)Mapping->KernelMapping &&
|
||||
|
|
|
@ -1732,11 +1732,15 @@ static NTSTATUS
|
|||
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;
|
||||
while (HeapMapping != NULL)
|
||||
|
@ -1780,12 +1784,16 @@ static NTSTATUS
|
|||
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;
|
||||
while (HeapMapping != NULL)
|
||||
|
|
|
@ -313,6 +313,7 @@ PMENU_OBJECT FASTCALL
|
|||
IntCreateMenu(PHANDLE Handle, BOOL IsMenuBar)
|
||||
{
|
||||
PMENU_OBJECT Menu;
|
||||
PW32PROCESS CurrentWin32Process;
|
||||
|
||||
Menu = (PMENU_OBJECT)UserCreateObject(
|
||||
gHandleTable, Handle,
|
||||
|
@ -346,7 +347,8 @@ IntCreateMenu(PHANDLE Handle, BOOL IsMenuBar)
|
|||
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 @@ IntCloneMenuItems(PMENU_OBJECT Destination, PMENU_OBJECT Source)
|
|||
PMENU_OBJECT FASTCALL
|
||||
IntCloneMenu(PMENU_OBJECT Source)
|
||||
{
|
||||
PW32PROCESS CurrentWin32Process;
|
||||
HANDLE hMenu;
|
||||
PMENU_OBJECT Menu;
|
||||
|
||||
|
@ -450,7 +453,8 @@ IntCloneMenu(PMENU_OBJECT Source)
|
|||
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);
|
||||
|
||||
|
|
|
@ -137,8 +137,9 @@ UserHeapReAlloc(PVOID lpMem,
|
|||
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 */
|
||||
|
|
Loading…
Reference in a new issue