From 5260bf08c848507a2926033e9970eac59dc3d62f Mon Sep 17 00:00:00 2001 From: Hartmut Birr Date: Sat, 13 Nov 2004 22:27:16 +0000 Subject: [PATCH] - Removed some unnecessary type casts. svn path=/trunk/; revision=11645 --- reactos/ntoskrnl/ldr/sysdll.c | 2 +- reactos/ntoskrnl/lpc/send.c | 22 +++++++++++----------- reactos/ntoskrnl/mm/marea.c | 2 +- reactos/ntoskrnl/mm/virtual.c | 6 +++--- reactos/ntoskrnl/ps/kill.c | 4 ++-- reactos/ntoskrnl/ps/process.c | 6 +++--- 6 files changed, 21 insertions(+), 21 deletions(-) diff --git a/reactos/ntoskrnl/ldr/sysdll.c b/reactos/ntoskrnl/ldr/sysdll.c index 63431abdc79..f2842a0b168 100644 --- a/reactos/ntoskrnl/ldr/sysdll.c +++ b/reactos/ntoskrnl/ldr/sysdll.c @@ -194,7 +194,7 @@ NTSTATUS LdrpMapSystemDll(HANDLE ProcessHandle, if (Process != CurrentProcess) { DPRINT("Attaching to Process\n"); - KeAttachProcess((PKPROCESS)Process); + KeAttachProcess(&Process->Pcb); } /* diff --git a/reactos/ntoskrnl/lpc/send.c b/reactos/ntoskrnl/lpc/send.c index 78632a34b86..2627539cfa3 100644 --- a/reactos/ntoskrnl/lpc/send.c +++ b/reactos/ntoskrnl/lpc/send.c @@ -1,4 +1,4 @@ -/* $Id: send.c,v 1.19 2004/11/11 22:37:05 ion Exp $ +/* $Id: send.c,v 1.20 2004/11/13 22:27:16 hbirr Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -218,7 +218,7 @@ NtRequestWaitReplyPort (IN HANDLE PortHandle, PLPC_MESSAGE UnsafeLpcReply) { PETHREAD CurrentThread; - struct _EPROCESS *AttachedProcess; + struct _KPROCESS *AttachedProcess; NTSTATUS Status; PEPORT Port; PQUEUEDMESSAGE Message; @@ -257,7 +257,7 @@ NtRequestWaitReplyPort (IN HANDLE PortHandle, } else { - AttachedProcess = (PEPROCESS)CurrentThread->Tcb.ApcState.Process; + AttachedProcess = CurrentThread->Tcb.ApcState.Process; KeDetachProcess(); } @@ -268,7 +268,7 @@ NtRequestWaitReplyPort (IN HANDLE PortHandle, { if (NULL != AttachedProcess) { - KeAttachProcess((PKPROCESS)AttachedProcess); + KeAttachProcess(AttachedProcess); } ObDereferenceObject(Port); return(Status); @@ -277,7 +277,7 @@ NtRequestWaitReplyPort (IN HANDLE PortHandle, { if (NULL != AttachedProcess) { - KeAttachProcess((PKPROCESS)AttachedProcess); + KeAttachProcess(AttachedProcess); } ObDereferenceObject(Port); return(STATUS_PORT_MESSAGE_TOO_LONG); @@ -287,7 +287,7 @@ NtRequestWaitReplyPort (IN HANDLE PortHandle, { if (NULL != AttachedProcess) { - KeAttachProcess((PKPROCESS)AttachedProcess); + KeAttachProcess(AttachedProcess); } ObDereferenceObject(Port); return(STATUS_NO_MEMORY); @@ -299,7 +299,7 @@ NtRequestWaitReplyPort (IN HANDLE PortHandle, ExFreePool(LpcRequest); if (NULL != AttachedProcess) { - KeAttachProcess((PKPROCESS)AttachedProcess); + KeAttachProcess(AttachedProcess); } ObDereferenceObject(Port); return(Status); @@ -310,7 +310,7 @@ NtRequestWaitReplyPort (IN HANDLE PortHandle, ExFreePool(LpcRequest); if (NULL != AttachedProcess) { - KeAttachProcess((PKPROCESS)AttachedProcess); + KeAttachProcess(AttachedProcess); } ObDereferenceObject(Port); return(STATUS_PORT_MESSAGE_TOO_LONG); @@ -320,7 +320,7 @@ NtRequestWaitReplyPort (IN HANDLE PortHandle, ExFreePool(LpcRequest); if (NULL != AttachedProcess) { - KeAttachProcess((PKPROCESS)AttachedProcess); + KeAttachProcess(AttachedProcess); } ObDereferenceObject(Port); return(STATUS_PORT_MESSAGE_TOO_LONG); @@ -336,7 +336,7 @@ NtRequestWaitReplyPort (IN HANDLE PortHandle, ExFreePool(LpcRequest); if (NULL != AttachedProcess) { - KeAttachProcess((PKPROCESS)AttachedProcess); + KeAttachProcess(AttachedProcess); } ObDereferenceObject(Port); return(Status); @@ -382,7 +382,7 @@ NtRequestWaitReplyPort (IN HANDLE PortHandle, } if (NULL != AttachedProcess) { - KeAttachProcess((PKPROCESS)AttachedProcess); + KeAttachProcess(AttachedProcess); } ObDereferenceObject(Port); diff --git a/reactos/ntoskrnl/mm/marea.c b/reactos/ntoskrnl/mm/marea.c index 96b2e181ed4..b687c249ab0 100644 --- a/reactos/ntoskrnl/mm/marea.c +++ b/reactos/ntoskrnl/mm/marea.c @@ -453,7 +453,7 @@ MmFreeMemoryArea(PMADDRESS_SPACE AddressSpace, if (AddressSpace->Process != NULL && AddressSpace->Process != CurrentProcess) { - KeAttachProcess((PKPROCESS)AddressSpace->Process); + KeAttachProcess(&AddressSpace->Process->Pcb); } EndAddress = (char*)MemoryArea->BaseAddress + PAGE_ROUND_UP(MemoryArea->Length); for (Address = MemoryArea->BaseAddress; Address < EndAddress; Address += PAGE_SIZE) diff --git a/reactos/ntoskrnl/mm/virtual.c b/reactos/ntoskrnl/mm/virtual.c index 810d41ac642..2eaf17c03d5 100644 --- a/reactos/ntoskrnl/mm/virtual.c +++ b/reactos/ntoskrnl/mm/virtual.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: virtual.c,v 1.84 2004/11/11 22:23:52 ion Exp $ +/* $Id: virtual.c,v 1.85 2004/11/13 22:27:16 hbirr Exp $ * * PROJECT: ReactOS kernel * FILE: ntoskrnl/mm/virtual.c @@ -425,7 +425,7 @@ NtReadVirtualMemory(IN HANDLE ProcessHandle, UserMode, IoWriteAccess); - KeAttachProcess((PKPROCESS)Process); + KeAttachProcess(&Process->Pcb); SystemAddress = MmGetSystemAddressForMdl(Mdl); memcpy(SystemAddress, BaseAddress, NumberOfBytesToRead); @@ -553,7 +553,7 @@ NtWriteVirtualMemory(IN HANDLE ProcessHandle, ObDereferenceObject(Process); return(STATUS_NO_MEMORY); } - KeAttachProcess((PKPROCESS)Process); + KeAttachProcess(&Process->Pcb); SystemAddress = MmGetSystemAddressForMdl(Mdl); memcpy(BaseAddress, SystemAddress, NumberOfBytesToWrite); diff --git a/reactos/ntoskrnl/ps/kill.c b/reactos/ntoskrnl/ps/kill.c index 21629c4424d..8c6598a3f6d 100644 --- a/reactos/ntoskrnl/ps/kill.c +++ b/reactos/ntoskrnl/ps/kill.c @@ -1,4 +1,4 @@ -/* $Id: kill.c,v 1.82 2004/11/11 22:40:30 ion Exp $ +/* $Id: kill.c,v 1.83 2004/11/13 22:27:15 hbirr Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -288,7 +288,7 @@ PiTerminateProcess(PEPROCESS Process, CurrentProcess = PsGetCurrentProcess(); if (Process != CurrentProcess) { - KeAttachProcess((PKPROCESS) Process ); + KeAttachProcess(&Process->Pcb); } ObCloseAllHandles(Process); if (Process != CurrentProcess) diff --git a/reactos/ntoskrnl/ps/process.c b/reactos/ntoskrnl/ps/process.c index 81d896747ca..177b8d3c0c3 100644 --- a/reactos/ntoskrnl/ps/process.c +++ b/reactos/ntoskrnl/ps/process.c @@ -1,4 +1,4 @@ -/* $Id: process.c,v 1.150 2004/11/11 22:40:30 ion Exp $ +/* $Id: process.c,v 1.151 2004/11/13 22:27:15 hbirr Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -364,7 +364,7 @@ PiDeleteProcessWorker(PVOID pContext) if (CurrentProcess != Process) { - KeAttachProcess((PKPROCESS)Process); + KeAttachProcess(&Process->Pcb); } KeAcquireSpinLock(&PsProcessListLock, &oldIrql); @@ -486,7 +486,7 @@ PsCreatePeb(HANDLE ProcessHandle, } DPRINT("TableBase %p ViewSize %lx\n", TableBase, ViewSize); - KeAttachProcess((PKPROCESS)Process); + KeAttachProcess(&Process->Pcb); /* Initialize the PEB */ RtlZeroMemory(Peb, sizeof(PEB));