Author: ion Date: Fri May 19 00:32:17 2006 New Revision: 21935
URL: http://svn.reactos.ru/svn/reactos?rev=21935&view=rev Log: - Get rid of ROS_EPROCESS and all the ugly type-casting that was being done, now that the last two hacks make us able to compatibly use EPROCESS.
Modified: trunk/reactos/include/ndk/pstypes.h trunk/reactos/ntoskrnl/include/internal/mm.h trunk/reactos/ntoskrnl/include/internal/ps.h trunk/reactos/ntoskrnl/ke/kthread.c trunk/reactos/ntoskrnl/ke/process.c trunk/reactos/ntoskrnl/mm/anonmem.c trunk/reactos/ntoskrnl/mm/aspace.c trunk/reactos/ntoskrnl/mm/i386/page.c trunk/reactos/ntoskrnl/mm/marea.c trunk/reactos/ntoskrnl/mm/mdl.c trunk/reactos/ntoskrnl/mm/mm.c trunk/reactos/ntoskrnl/mm/process.c trunk/reactos/ntoskrnl/mm/rmap.c trunk/reactos/ntoskrnl/mm/section.c trunk/reactos/ntoskrnl/mm/virtual.c trunk/reactos/ntoskrnl/ps/job.c trunk/reactos/ntoskrnl/ps/kill.c trunk/reactos/ntoskrnl/ps/process.c trunk/reactos/ntoskrnl/ps/psmgr.c trunk/reactos/ntoskrnl/ps/query.c trunk/reactos/ntoskrnl/ps/thread.c
Modified: trunk/reactos/include/ndk/pstypes.h URL: http://svn.reactos.ru/svn/reactos/trunk/reactos/include/ndk/pstypes.h?rev=21... ============================================================================== --- trunk/reactos/include/ndk/pstypes.h (original) +++ trunk/reactos/include/ndk/pstypes.h Fri May 19 00:32:17 2006 @@ -1074,7 +1074,7 @@ EX_PUSH_LOCK AddressCreationLock; PETHREAD RotateInProgress; #else - KGUARDED_MUTEX AddressCreationLock; + FAST_MUTEX AddressCreationLock; // FIXME: FAST_MUTEX for XP, KGUARDED_MUTEX for 2K3 KSPIN_LOCK HyperSpaceLock; #endif PETHREAD ForkInProgress;
Modified: trunk/reactos/ntoskrnl/include/internal/mm.h URL: http://svn.reactos.ru/svn/reactos/trunk/reactos/ntoskrnl/include/internal/mm... ============================================================================== --- trunk/reactos/ntoskrnl/include/internal/mm.h (original) +++ trunk/reactos/ntoskrnl/include/internal/mm.h Fri May 19 00:32:17 2006 @@ -5,7 +5,7 @@
/* TYPES *********************************************************************/
-struct _ROS_EPROCESS; +struct _EPROCESS;
extern ULONG MiFreeSwapPages; extern ULONG MiUsedSwapPages; @@ -242,7 +242,7 @@ { PMEMORY_AREA MemoryAreaRoot; PVOID LowestAddress; - struct _ROS_EPROCESS* Process; + struct _EPROCESS* Process; PUSHORT PageTableRefCountTable; ULONG PageTableRefCountTableSize; } MADDRESS_SPACE, *PMADDRESS_SPACE; @@ -360,7 +360,7 @@ NTSTATUS NTAPI MmInitializeAddressSpace( - struct _ROS_EPROCESS* Process, + struct _EPROCESS* Process, PMADDRESS_SPACE AddressSpace);
NTSTATUS @@ -443,7 +443,7 @@ VOID STDCALL MmReleaseMemoryAreaIfDecommitted( - struct _ROS_EPROCESS *Process, + struct _EPROCESS *Process, PMADDRESS_SPACE AddressSpace, PVOID BaseAddress ); @@ -619,18 +619,18 @@ NTSTATUS STDCALL MmCreateProcessAddressSpace( - IN struct _ROS_EPROCESS* Process, + IN struct _EPROCESS* Process, IN PROS_SECTION_OBJECT Section OPTIONAL );
NTSTATUS STDCALL -MmCreatePeb(struct _ROS_EPROCESS *Process); +MmCreatePeb(struct _EPROCESS *Process);
struct _TEB* STDCALL MmCreateTeb( - struct _ROS_EPROCESS *Process, + struct _EPROCESS *Process, PCLIENT_ID ClientId, PINITIAL_TEB InitialTeb ); @@ -638,7 +638,7 @@ VOID STDCALL MmDeleteTeb( - struct _ROS_EPROCESS *Process, + struct _EPROCESS *Process, struct _TEB* Teb );
@@ -704,7 +704,7 @@ VOID NTAPI MmFreeVirtualMemory( - struct _ROS_EPROCESS* Process, + struct _EPROCESS* Process, PMEMORY_AREA MemoryArea );
@@ -858,7 +858,7 @@ NTAPI MmInsertRmap( PFN_TYPE Page, - struct _ROS_EPROCESS *Process, + struct _EPROCESS *Process, PVOID Address );
@@ -867,14 +867,14 @@ MmDeleteAllRmaps( PFN_TYPE Page, PVOID Context, - VOID (*DeleteMapping)(PVOID Context, struct _ROS_EPROCESS *Process, PVOID Address) + VOID (*DeleteMapping)(PVOID Context, struct _EPROCESS *Process, PVOID Address) );
VOID NTAPI MmDeleteRmap( PFN_TYPE Page, - struct _ROS_EPROCESS *Process, + struct _EPROCESS *Process, PVOID Address );
@@ -992,7 +992,7 @@ NTSTATUS NTAPI MmCreateVirtualMapping( - struct _ROS_EPROCESS* Process, + struct _EPROCESS* Process, PVOID Address, ULONG flProtect, PPFN_TYPE Pages, @@ -1002,7 +1002,7 @@ NTSTATUS NTAPI MmCreateVirtualMappingUnsafe( - struct _ROS_EPROCESS* Process, + struct _EPROCESS* Process, PVOID Address, ULONG flProtect, PPFN_TYPE Pages, @@ -1012,13 +1012,13 @@ ULONG NTAPI MmGetPageProtect( - struct _ROS_EPROCESS* Process, + struct _EPROCESS* Process, PVOID Address);
VOID NTAPI MmSetPageProtect( - struct _ROS_EPROCESS* Process, + struct _EPROCESS* Process, PVOID Address, ULONG flProtect ); @@ -1026,7 +1026,7 @@ BOOLEAN NTAPI MmIsPagePresent( - struct _ROS_EPROCESS* Process, + struct _EPROCESS* Process, PVOID Address );
@@ -1037,7 +1037,7 @@ VOID NTAPI MmDisableVirtualMapping( - struct _ROS_EPROCESS *Process, + struct _EPROCESS *Process, PVOID Address, BOOLEAN* WasDirty, PPFN_TYPE Page @@ -1046,7 +1046,7 @@ VOID NTAPI MmEnableVirtualMapping( - struct _ROS_EPROCESS *Process, + struct _EPROCESS *Process, PVOID Address );
@@ -1057,7 +1057,7 @@ VOID NTAPI MmDeletePageFileMapping( - struct _ROS_EPROCESS *Process, + struct _EPROCESS *Process, PVOID Address, SWAPENTRY* SwapEntry ); @@ -1065,7 +1065,7 @@ NTSTATUS NTAPI MmCreatePageFileMapping( - struct _ROS_EPROCESS *Process, + struct _EPROCESS *Process, PVOID Address, SWAPENTRY SwapEntry ); @@ -1073,7 +1073,7 @@ BOOLEAN NTAPI MmIsPageSwapEntry( - struct _ROS_EPROCESS *Process, + struct _EPROCESS *Process, PVOID Address );
@@ -1087,7 +1087,7 @@ VOID NTAPI MmSetDirtyPage( - struct _ROS_EPROCESS *Process, + struct _EPROCESS *Process, PVOID Address );
@@ -1123,7 +1123,7 @@ BOOLEAN NTAPI MmIsAccessedAndResetAccessPage( - struct _ROS_EPROCESS *Process, + struct _EPROCESS *Process, PVOID Address );
@@ -1158,7 +1158,7 @@ VOID NTAPI MmSetCleanPage( - struct _ROS_EPROCESS *Process, + struct _EPROCESS *Process, PVOID Address );
@@ -1169,37 +1169,37 @@ VOID NTAPI MmDeletePageTable( - struct _ROS_EPROCESS *Process, + struct _EPROCESS *Process, PVOID Address );
PFN_TYPE NTAPI MmGetPfnForProcess( - struct _ROS_EPROCESS *Process, + struct _EPROCESS *Process, PVOID Address );
NTSTATUS STDCALL MmCopyMmInfo( - struct _ROS_EPROCESS *Src, - struct _ROS_EPROCESS *Dest, + struct _EPROCESS *Src, + struct _EPROCESS *Dest, PPHYSICAL_ADDRESS DirectoryTableBase );
NTSTATUS NTAPI -MmReleaseMmInfo(struct _ROS_EPROCESS *Process); - -NTSTATUS -NTAPI -Mmi386ReleaseMmInfo(struct _ROS_EPROCESS *Process); +MmReleaseMmInfo(struct _EPROCESS *Process); + +NTSTATUS +NTAPI +Mmi386ReleaseMmInfo(struct _EPROCESS *Process);
VOID NTAPI MmDeleteVirtualMapping( - struct _ROS_EPROCESS *Process, + struct _EPROCESS *Process, PVOID Address, BOOLEAN FreePage, BOOLEAN* WasDirty, @@ -1209,7 +1209,7 @@ BOOLEAN NTAPI MmIsDirtyPage( - struct _ROS_EPROCESS *Process, + struct _EPROCESS *Process, PVOID Address );
@@ -1224,7 +1224,7 @@ VOID NTAPI MmUpdatePageDir( - struct _ROS_EPROCESS *Process, + struct _EPROCESS *Process, PVOID Address, ULONG Size );
Modified: trunk/reactos/ntoskrnl/include/internal/ps.h URL: http://svn.reactos.ru/svn/reactos/trunk/reactos/ntoskrnl/include/internal/ps... ============================================================================== --- trunk/reactos/ntoskrnl/include/internal/ps.h (original) +++ trunk/reactos/ntoskrnl/include/internal/ps.h Fri May 19 00:32:17 2006 @@ -7,201 +7,6 @@ struct _EJOB;
#include <internal/arch/ps.h> - -// -// ROS Process -// -#include <pshpack4.h> -typedef struct _ROS_EPROCESS -{ - KPROCESS Pcb; - EX_PUSH_LOCK ProcessLock; - LARGE_INTEGER CreateTime; - LARGE_INTEGER ExitTime; - EX_RUNDOWN_REF RundownProtect; - HANDLE UniqueProcessId; - LIST_ENTRY ActiveProcessLinks; - ULONG QuotaUsage[3]; - ULONG QuotaPeak[3]; - ULONG CommitCharge; - ULONG PeakVirtualSize; - ULONG VirtualSize; - LIST_ENTRY SessionProcessLinks; - PVOID DebugPort; -#if (NTDDI_VERSION >= NTDDI_LONGHORN) - union - { - PVOID ExceptionPortData; - ULONG ExceptionPortValue; - UCHAR ExceptionPortState:3; - }; -#else - PVOID ExceptionPort; -#endif - PHANDLE_TABLE ObjectTable; - EX_FAST_REF Token; - ULONG WorkingSetPage; -#if (NTDDI_VERSION >= NTDDI_LONGHORN) - EX_PUSH_LOCK AddressCreationLock; - PETHREAD RotateInProgress; -#else - FAST_MUTEX AddressCreationLock; // FIXME: FAST_MUTEX for XP, KGUARDED_MUTEX for 2K3 - KSPIN_LOCK HyperSpaceLock; -#endif - PETHREAD ForkInProgress; - ULONG HardwareTrigger; - MM_AVL_TABLE PhysicalVadroot; - PVOID CloneRoot; - ULONG NumberOfPrivatePages; - ULONG NumberOfLockedPages; - PVOID *Win32Process; - struct _EJOB *Job; - PVOID SectionObject; - PVOID SectionBaseAddress; - PEPROCESS_QUOTA_BLOCK QuotaBlock; - PPAGEFAULT_HISTORY WorkingSetWatch; - PVOID Win32WindowStation; - HANDLE InheritedFromUniqueProcessId; - PVOID LdtInformation; - PVOID VadFreeHint; - PVOID VdmObjects; - PVOID DeviceMap; -#if (NTDDI_VERSION >= NTDDI_LONGHORN) - ULONG AlpcPagedPoolQuotaCache; - PVOID EtwDataSource; - PVOID FreeTebHint; -#else - PVOID Spare0[3]; -#endif - union - { - HARDWARE_PTE_X86 PagedirectoryPte; - ULONGLONG Filler; - }; - ULONG Session; - CHAR ImageFileName[16]; - LIST_ENTRY JobLinks; - PVOID LockedPagesList; - LIST_ENTRY ThreadListHead; - PVOID SecurityPort; - PVOID PaeTop; - ULONG ActiveThreads; -#if (NTDDI_VERSION >= NTDDI_LONGHORN) - ULONG ImagePathHash; -#else - ACCESS_MASK GrantedAccess; -#endif - ULONG DefaultHardErrorProcessing; - NTSTATUS LastThreadExitStatus; - struct _PEB* Peb; - EX_FAST_REF PrefetchTrace; - LARGE_INTEGER ReadOperationCount; - LARGE_INTEGER WriteOperationCount; - LARGE_INTEGER OtherOperationCount; - LARGE_INTEGER ReadTransferCount; - LARGE_INTEGER WriteTransferCount; - LARGE_INTEGER OtherTransferCount; - ULONG CommitChargeLimit; - ULONG CommitChargePeak; - PVOID AweInfo; - SE_AUDIT_PROCESS_CREATION_INFO SeAuditProcessCreationInfo; - MMSUPPORT Vm; - LIST_ENTRY MmProcessLinks; - ULONG ModifiedPageCount; -#if (NTDDI_VERSION >= NTDDI_LONGHORN) - union - { - struct - { - ULONG JobNotReallyActive:1; - ULONG AccountingFolded:1; - ULONG NewProcessReported:1; - ULONG ExitProcessReported:1; - ULONG ReportCommitChanges:1; - ULONG LastReportMemory:1; - ULONG ReportPhysicalPageChanges:1; - ULONG HandleTableRundown:1; - ULONG NeedsHandleRundown:1; - ULONG RefTraceEnabled:1; - ULONG NumaAware:1; - ULONG ProtectedProcess:1; - ULONG DefaultPagePriority:3; - ULONG ProcessDeleteSelf:1; - ULONG ProcessVerifierTarget:1; - }; - ULONG Flags2; - }; -#else - ULONG JobStatus; -#endif - union - { - struct - { - ULONG CreateReported:1; - ULONG NoDebugInherit:1; - ULONG ProcessExiting:1; - ULONG ProcessDelete:1; - ULONG Wow64SplitPages:1; - ULONG VmDeleted:1; - ULONG OutswapEnabled:1; - ULONG Outswapped:1; - ULONG ForkFailed:1; - ULONG Wow64VaSpace4Gb:1; - ULONG AddressSpaceInitialized:2; - ULONG SetTimerResolution:1; - ULONG BreakOnTermination:1; -#if (NTDDI_VERSION >= NTDDI_LONGHORN) - ULONG DeprioritizeViews:1; -#else - ULONG SessionCreationUnderway:1; -#endif - ULONG WriteWatch:1; - ULONG ProcessInSession:1; - ULONG OverrideAddressSpace:1; - ULONG HasAddressSpace:1; - ULONG LaunchPrefetched:1; - ULONG InjectInpageErrors:1; - ULONG VmTopDown:1; - ULONG ImageNotifyDone:1; - ULONG PdeUpdateNeeded:1; - ULONG VdmAllowed:1; - ULONG SmapAllowed:1; -#if (NTDDI_VERSION >= NTDDI_LONGHORN) - ULONG ProcessInserted:1; -#else - ULONG CreateFailed:1; -#endif - ULONG DefaultIoPriority:3; -#if (NTDDI_VERSION >= NTDDI_LONGHORN) - ULONG SparePsFlags1:2; -#else - ULONG Spare1:1; - ULONG Spare2:1; -#endif - }; - ULONG Flags; - }; - NTSTATUS ExitStatus; -#if (NTDDI_VERSION >= NTDDI_LONGHORN) - USHORT Spare7; -#else - USHORT NextPageColor; -#endif - union - { - struct - { - UCHAR SubSystemMinorVersion; - UCHAR SubSystemMajorVersion; - }; - USHORT SubSystemVersion; - }; - UCHAR PriorityClass; - MM_AVL_TABLE VadRoot; - ULONG Cookie; -} ROS_EPROCESS, *PROS_EPROCESS; -#include <poppack.h>
extern LCID PsDefaultThreadLocaleId; extern LCID PsDefaultSystemLocaleId; @@ -563,12 +368,12 @@ NTSTATUS NTAPI PsLockProcess( - PROS_EPROCESS Process, + PEPROCESS Process, BOOLEAN Timeout );
VOID NTAPI -PsUnlockProcess(PROS_EPROCESS Process); +PsUnlockProcess(PEPROCESS Process);
#endif /* __INCLUDE_INTERNAL_PS_H */
Modified: trunk/reactos/ntoskrnl/ke/kthread.c URL: http://svn.reactos.ru/svn/reactos/trunk/reactos/ntoskrnl/ke/kthread.c?rev=21... ============================================================================== --- trunk/reactos/ntoskrnl/ke/kthread.c (original) +++ trunk/reactos/ntoskrnl/ke/kthread.c Fri May 19 00:32:17 2006 @@ -154,7 +154,7 @@ IdleProcessorMask |= Affinity; }
- MmUpdatePageDir((PROS_EPROCESS)PsGetCurrentProcess(),((PETHREAD)CurrentThread)->ThreadsProcess, sizeof(ROS_EPROCESS)); + MmUpdatePageDir((PEPROCESS)PsGetCurrentProcess(),((PETHREAD)CurrentThread)->ThreadsProcess, sizeof(EPROCESS));
/* Special note for Filip: This will release the Dispatcher DB Lock ;-) -- Alex */ DPRINT("You are : %x, swapping to: %x\n", OldThread, CurrentThread); @@ -864,8 +864,8 @@ * while handling page faults. At this point it isn't possible to call the * page fault handler for the missing pde's. */ - MmUpdatePageDir((PROS_EPROCESS)Process, (PVOID)Thread->StackLimit, KERNEL_STACK_SIZE); - MmUpdatePageDir((PROS_EPROCESS)Process, (PVOID)Thread, sizeof(ETHREAD)); + MmUpdatePageDir((PEPROCESS)Process, (PVOID)Thread->StackLimit, KERNEL_STACK_SIZE); + MmUpdatePageDir((PEPROCESS)Process, (PVOID)Thread, sizeof(ETHREAD));
/* Initalize the Thread Context */ DPRINT("Initializing the Context for the thread: %x\n", Thread);
Modified: trunk/reactos/ntoskrnl/ke/process.c URL: http://svn.reactos.ru/svn/reactos/trunk/reactos/ntoskrnl/ke/process.c?rev=21... ============================================================================== --- trunk/reactos/ntoskrnl/ke/process.c (original) +++ trunk/reactos/ntoskrnl/ke/process.c Fri May 19 00:32:17 2006 @@ -56,8 +56,8 @@ * To prevent this, make sure the page directory of the process we're * attaching to is up-to-date. */ - MmUpdatePageDir((PROS_EPROCESS)Process, (PVOID)Thread->StackLimit, KERNEL_STACK_SIZE); - MmUpdatePageDir((PROS_EPROCESS)Process, (PVOID)Thread, sizeof(ETHREAD)); + MmUpdatePageDir((PEPROCESS)Process, (PVOID)Thread->StackLimit, KERNEL_STACK_SIZE); + MmUpdatePageDir((PEPROCESS)Process, (PVOID)Thread, sizeof(ETHREAD)); }
VOID
Modified: trunk/reactos/ntoskrnl/mm/anonmem.c URL: http://svn.reactos.ru/svn/reactos/trunk/reactos/ntoskrnl/mm/anonmem.c?rev=21... ============================================================================== --- trunk/reactos/ntoskrnl/mm/anonmem.c (original) +++ trunk/reactos/ntoskrnl/mm/anonmem.c Fri May 19 00:32:17 2006 @@ -544,7 +544,7 @@ * RETURNS: Status */ { - PROS_EPROCESS Process; + PEPROCESS Process; MEMORY_AREA* MemoryArea; ULONG_PTR MemoryAreaLength; ULONG Type; @@ -784,7 +784,7 @@ MmFreeSwapPage(SavedSwapEntry); MmSetSavedSwapEntryPage(Page, 0); } - MmDeleteRmap(Page, (PROS_EPROCESS)Process, Address); + MmDeleteRmap(Page, Process, Address); MmReleasePageMemoryConsumer(MC_USER, Page); } else if (SwapEntry != 0) @@ -795,7 +795,7 @@
VOID NTAPI -MmFreeVirtualMemory(PROS_EPROCESS Process, +MmFreeVirtualMemory(PEPROCESS Process, PMEMORY_AREA MemoryArea) { PLIST_ENTRY current_entry; @@ -889,7 +889,7 @@ { MEMORY_AREA* MemoryArea; NTSTATUS Status; - PROS_EPROCESS Process; + PEPROCESS Process; PMADDRESS_SPACE AddressSpace; PVOID BaseAddress; ULONG RegionSize;
Modified: trunk/reactos/ntoskrnl/mm/aspace.c URL: http://svn.reactos.ru/svn/reactos/trunk/reactos/ntoskrnl/mm/aspace.c?rev=219... ============================================================================== --- trunk/reactos/ntoskrnl/mm/aspace.c (original) +++ trunk/reactos/ntoskrnl/mm/aspace.c Fri May 19 00:32:17 2006 @@ -80,7 +80,7 @@ NTAPI MmGetCurrentAddressSpace(VOID) { - return((PMADDRESS_SPACE)&((PROS_EPROCESS)PsGetCurrentProcess())->VadRoot); + return((PMADDRESS_SPACE)&(PsGetCurrentProcess())->VadRoot); }
PMADDRESS_SPACE @@ -92,7 +92,7 @@
NTSTATUS NTAPI -MmInitializeAddressSpace(PROS_EPROCESS Process, +MmInitializeAddressSpace(PEPROCESS Process, PMADDRESS_SPACE AddressSpace) { AddressSpace->MemoryAreaRoot = NULL;
Modified: trunk/reactos/ntoskrnl/mm/i386/page.c URL: http://svn.reactos.ru/svn/reactos/trunk/reactos/ntoskrnl/mm/i386/page.c?rev=... ============================================================================== --- trunk/reactos/ntoskrnl/mm/i386/page.c (original) +++ trunk/reactos/ntoskrnl/mm/i386/page.c Fri May 19 00:32:17 2006 @@ -203,7 +203,7 @@
NTSTATUS NTAPI -Mmi386ReleaseMmInfo(PROS_EPROCESS Process) +Mmi386ReleaseMmInfo(PEPROCESS Process) { PUSHORT LdtDescriptor; ULONG LdtBase; @@ -329,8 +329,8 @@
NTSTATUS STDCALL -MmCopyMmInfo(PROS_EPROCESS Src, - PROS_EPROCESS Dest, +MmCopyMmInfo(PEPROCESS Src, + PEPROCESS Dest, PPHYSICAL_ADDRESS DirectoryTableBase) { NTSTATUS Status; @@ -408,9 +408,9 @@
VOID NTAPI -MmDeletePageTable(PROS_EPROCESS Process, PVOID Address) -{ - PROS_EPROCESS CurrentProcess = (PROS_EPROCESS)PsGetCurrentProcess(); +MmDeletePageTable(PEPROCESS Process, PVOID Address) +{ + PEPROCESS CurrentProcess = PsGetCurrentProcess();
if (Process != NULL && Process != CurrentProcess) { @@ -441,9 +441,9 @@
VOID NTAPI -MmFreePageTable(PROS_EPROCESS Process, PVOID Address) -{ - PROS_EPROCESS CurrentProcess = (PROS_EPROCESS)PsGetCurrentProcess(); +MmFreePageTable(PEPROCESS Process, PVOID Address) +{ + PEPROCESS CurrentProcess = PsGetCurrentProcess(); ULONG i; PFN_TYPE Pfn;
@@ -504,7 +504,7 @@ }
static PULONGLONG -MmGetPageTableForProcessForPAE(PROS_EPROCESS Process, PVOID Address, BOOLEAN Create) +MmGetPageTableForProcessForPAE(PEPROCESS Process, PVOID Address, BOOLEAN Create) { NTSTATUS Status; PFN_TYPE Pfn; @@ -520,7 +520,7 @@ { KEBUGCHECK(0); } - if (Address < MmSystemRangeStart && Process && Process != (PROS_EPROCESS)PsGetCurrentProcess()) + if (Address < MmSystemRangeStart && Process && Process != PsGetCurrentProcess()) { PageDirTable = MmCreateHyperspaceMapping(PAE_PTE_TO_PFN(Process->Pcb.DirectoryTableBase.QuadPart)); if (PageDirTable == NULL) @@ -618,7 +618,7 @@ }
static PULONG -MmGetPageTableForProcess(PROS_EPROCESS Process, PVOID Address, BOOLEAN Create) +MmGetPageTableForProcess(PEPROCESS Process, PVOID Address, BOOLEAN Create) { ULONG PdeOffset = ADDR_TO_PDE_OFFSET(Address); NTSTATUS Status; @@ -626,7 +626,7 @@ ULONG Entry; PULONG Pt, PageDir;
- if (Address < MmSystemRangeStart && Process && Process != (PROS_EPROCESS)PsGetCurrentProcess()) + if (Address < MmSystemRangeStart && Process && Process != PsGetCurrentProcess()) { PageDir = MmCreateHyperspaceMapping(PTE_TO_PFN(Process->Pcb.DirectoryTableBase.QuadPart)); if (PageDir == NULL) @@ -736,7 +736,7 @@ return FALSE; }
-static ULONGLONG MmGetPageEntryForProcessForPAE(PROS_EPROCESS Process, PVOID Address) +static ULONGLONG MmGetPageEntryForProcessForPAE(PEPROCESS Process, PVOID Address) { ULONGLONG Pte; PULONGLONG Pt; @@ -751,7 +751,7 @@ return 0; }
-static ULONG MmGetPageEntryForProcess(PROS_EPROCESS Process, PVOID Address) +static ULONG MmGetPageEntryForProcess(PEPROCESS Process, PVOID Address) { ULONG Pte; PULONG Pt; @@ -768,7 +768,7 @@
PFN_TYPE NTAPI -MmGetPfnForProcess(PROS_EPROCESS Process, +MmGetPfnForProcess(PEPROCESS Process, PVOID Address) {
@@ -796,7 +796,7 @@
VOID NTAPI -MmDisableVirtualMapping(PROS_EPROCESS Process, PVOID Address, BOOLEAN* WasDirty, PPFN_TYPE Page) +MmDisableVirtualMapping(PEPROCESS Process, PVOID Address, BOOLEAN* WasDirty, PPFN_TYPE Page) /* * FUNCTION: Delete a virtual mapping */ @@ -916,7 +916,7 @@
VOID NTAPI -MmDeleteVirtualMapping(PROS_EPROCESS Process, PVOID Address, BOOLEAN FreePage, +MmDeleteVirtualMapping(PEPROCESS Process, PVOID Address, BOOLEAN FreePage, BOOLEAN* WasDirty, PPFN_TYPE Page) /* * FUNCTION: Delete a virtual mapping @@ -1060,7 +1060,7 @@
VOID NTAPI -MmDeletePageFileMapping(PROS_EPROCESS Process, PVOID Address, +MmDeletePageFileMapping(PEPROCESS Process, PVOID Address, SWAPENTRY* SwapEntry) /* * FUNCTION: Delete a virtual mapping @@ -1199,7 +1199,7 @@
BOOLEAN NTAPI -MmIsDirtyPage(PROS_EPROCESS Process, PVOID Address) +MmIsDirtyPage(PEPROCESS Process, PVOID Address) { if (Ke386Pae) { @@ -1213,7 +1213,7 @@
BOOLEAN NTAPI -MmIsAccessedAndResetAccessPage(PROS_EPROCESS Process, PVOID Address) +MmIsAccessedAndResetAccessPage(PEPROCESS Process, PVOID Address) { if (Address < MmSystemRangeStart && Process == NULL) { @@ -1280,7 +1280,7 @@
VOID NTAPI -MmSetCleanPage(PROS_EPROCESS Process, PVOID Address) +MmSetCleanPage(PEPROCESS Process, PVOID Address) { if (Address < MmSystemRangeStart && Process == NULL) { @@ -1345,7 +1345,7 @@
VOID NTAPI -MmSetDirtyPage(PROS_EPROCESS Process, PVOID Address) +MmSetDirtyPage(PEPROCESS Process, PVOID Address) { if (Address < MmSystemRangeStart && Process == NULL) { @@ -1406,7 +1406,7 @@
VOID NTAPI -MmEnableVirtualMapping(PROS_EPROCESS Process, PVOID Address) +MmEnableVirtualMapping(PEPROCESS Process, PVOID Address) { if (Ke386Pae) { @@ -1462,7 +1462,7 @@
BOOLEAN NTAPI -MmIsPagePresent(PROS_EPROCESS Process, PVOID Address) +MmIsPagePresent(PEPROCESS Process, PVOID Address) { if (Ke386Pae) { @@ -1476,7 +1476,7 @@
BOOLEAN NTAPI -MmIsPageSwapEntry(PROS_EPROCESS Process, PVOID Address) +MmIsPageSwapEntry(PEPROCESS Process, PVOID Address) { if (Ke386Pae) { @@ -1622,7 +1622,7 @@
NTSTATUS NTAPI -MmCreatePageFileMapping(PROS_EPROCESS Process, +MmCreatePageFileMapping(PEPROCESS Process, PVOID Address, SWAPENTRY SwapEntry) { @@ -1710,7 +1710,7 @@
NTSTATUS NTAPI -MmCreateVirtualMappingUnsafe(PROS_EPROCESS Process, +MmCreateVirtualMappingUnsafe(PEPROCESS Process, PVOID Address, ULONG flProtect, PPFN_TYPE Pages, @@ -1916,7 +1916,7 @@
NTSTATUS NTAPI -MmCreateVirtualMapping(PROS_EPROCESS Process, +MmCreateVirtualMapping(PEPROCESS Process, PVOID Address, ULONG flProtect, PPFN_TYPE Pages, @@ -1942,7 +1942,7 @@
ULONG NTAPI -MmGetPageProtect(PROS_EPROCESS Process, PVOID Address) +MmGetPageProtect(PEPROCESS Process, PVOID Address) { ULONG Entry; ULONG Protect; @@ -1988,7 +1988,7 @@
VOID NTAPI -MmSetPageProtect(PROS_EPROCESS Process, PVOID Address, ULONG flProtect) +MmSetPageProtect(PEPROCESS Process, PVOID Address, ULONG flProtect) { ULONG Attributes = 0; BOOLEAN NoExecute = FALSE; @@ -2273,7 +2273,7 @@
VOID NTAPI -MmUpdatePageDir(PROS_EPROCESS Process, PVOID Address, ULONG Size) +MmUpdatePageDir(PEPROCESS Process, PVOID Address, ULONG Size) { ULONG StartOffset, EndOffset, Offset;
@@ -2307,7 +2307,7 @@ EndOffset = 511; }
- if (Process != NULL && Process != (PROS_EPROCESS)PsGetCurrentProcess()) + if (Process != NULL && Process != PsGetCurrentProcess()) { PageDirTable = MmCreateHyperspaceMapping(PAE_PTE_TO_PFN(Process->Pcb.DirectoryTableBase.QuadPart)); Pde = (PULONGLONG)MmCreateHyperspaceMapping(PTE_TO_PFN(PageDirTable[i])); @@ -2334,7 +2334,7 @@ StartOffset = ADDR_TO_PDE_OFFSET(Address); EndOffset = ADDR_TO_PDE_OFFSET((PVOID)((ULONG_PTR)Address + Size));
- if (Process != NULL && Process != (PROS_EPROCESS)PsGetCurrentProcess()) + if (Process != NULL && Process != PsGetCurrentProcess()) { Pde = MmCreateHyperspaceMapping(PTE_TO_PFN(Process->Pcb.DirectoryTableBase.u.LowPart)); }
Modified: trunk/reactos/ntoskrnl/mm/marea.c URL: http://svn.reactos.ru/svn/reactos/trunk/reactos/ntoskrnl/mm/marea.c?rev=2193... ============================================================================== --- trunk/reactos/ntoskrnl/mm/marea.c (original) +++ trunk/reactos/ntoskrnl/mm/marea.c Fri May 19 00:32:17 2006 @@ -747,7 +747,7 @@ PMEMORY_AREA *ParentReplace; ULONG_PTR Address; PVOID EndAddress; - PROS_EPROCESS CurrentProcess = (PROS_EPROCESS)PsGetCurrentProcess(); + PEPROCESS CurrentProcess = PsGetCurrentProcess();
if (AddressSpace->Process != NULL && AddressSpace->Process != CurrentProcess) @@ -1025,7 +1025,7 @@
VOID STDCALL -MmReleaseMemoryAreaIfDecommitted(PROS_EPROCESS Process, +MmReleaseMemoryAreaIfDecommitted(PEPROCESS Process, PMADDRESS_SPACE AddressSpace, PVOID BaseAddress) {
Modified: trunk/reactos/ntoskrnl/mm/mdl.c URL: http://svn.reactos.ru/svn/reactos/trunk/reactos/ntoskrnl/mm/mdl.c?rev=21935&... ============================================================================== --- trunk/reactos/ntoskrnl/mm/mdl.c (original) +++ trunk/reactos/ntoskrnl/mm/mdl.c Fri May 19 00:32:17 2006 @@ -241,7 +241,7 @@ /* Unmap all the pages. */ for (i = 0; i < PageCount; i++) { - MmDeleteVirtualMapping((PROS_EPROCESS)Mdl->Process, + MmDeleteVirtualMapping(Mdl->Process, (char*)BaseAddress + (i * PAGE_SIZE), FALSE, NULL, @@ -273,14 +273,14 @@
ASSERT(Mdl->Process == PsGetCurrentProcess());
- Marea = MmLocateMemoryAreaByAddress( (PMADDRESS_SPACE)&((PROS_EPROCESS)Mdl->Process)->VadRoot, BaseAddress ); + Marea = MmLocateMemoryAreaByAddress( (PMADDRESS_SPACE)&(Mdl->Process)->VadRoot, BaseAddress ); if (Marea == NULL) { DPRINT1( "Couldn't open memory area when unmapping user-space pages!\n" ); KEBUGCHECK(0); }
- MmFreeMemoryArea( (PMADDRESS_SPACE)&((PROS_EPROCESS)Mdl->Process)->VadRoot, Marea, NULL, NULL ); + MmFreeMemoryArea( (PMADDRESS_SPACE)&(Mdl->Process)->VadRoot, Marea, NULL, NULL );
Mdl->Process = NULL; } @@ -411,7 +411,7 @@ /* FIXME: why isn't AccessMode used? */ Mode = UserMode; Mdl->Process = CurrentProcess; - AddressSpace = (PMADDRESS_SPACE)&((PROS_EPROCESS)CurrentProcess)->VadRoot; + AddressSpace = (PMADDRESS_SPACE)&(CurrentProcess)->VadRoot; }
@@ -771,7 +771,7 @@ KIRQL oldIrql; ULONG PageCount; ULONG StartingOffset; - PROS_EPROCESS CurrentProcess; + PEPROCESS CurrentProcess; NTSTATUS Status; ULONG Protect;
@@ -803,7 +803,7 @@ BoundaryAddressMultiple.QuadPart = 0; Base = BaseAddress;
- CurrentProcess = (PROS_EPROCESS)PsGetCurrentProcess(); + CurrentProcess = PsGetCurrentProcess();
MmLockAddressSpace((PMADDRESS_SPACE)&CurrentProcess->VadRoot); Status = MmCreateMemoryArea((PMADDRESS_SPACE)&CurrentProcess->VadRoot,
Modified: trunk/reactos/ntoskrnl/mm/mm.c URL: http://svn.reactos.ru/svn/reactos/trunk/reactos/ntoskrnl/mm/mm.c?rev=21935&a... ============================================================================== --- trunk/reactos/ntoskrnl/mm/mm.c (original) +++ trunk/reactos/ntoskrnl/mm/mm.c Fri May 19 00:32:17 2006 @@ -30,7 +30,7 @@
NTSTATUS NTAPI -MmReleaseMmInfo(PROS_EPROCESS Process) +MmReleaseMmInfo(PEPROCESS Process) { PVOID Address; PMEMORY_AREA MemoryArea; @@ -114,7 +114,7 @@ } else { - AddressSpace = (PMADDRESS_SPACE)&((PROS_EPROCESS)PsGetCurrentProcess())->VadRoot; + AddressSpace = (PMADDRESS_SPACE)&(PsGetCurrentProcess())->VadRoot; }
MmLockAddressSpace(AddressSpace); @@ -171,7 +171,7 @@ } else { - AddressSpace = (PMADDRESS_SPACE)&((PROS_EPROCESS)PsGetCurrentProcess())->VadRoot; + AddressSpace = (PMADDRESS_SPACE)&(PsGetCurrentProcess())->VadRoot; }
if (!FromMdl) @@ -304,7 +304,7 @@ } else { - AddressSpace = (PMADDRESS_SPACE)&((PROS_EPROCESS)PsGetCurrentProcess())->VadRoot; + AddressSpace = (PMADDRESS_SPACE)&(PsGetCurrentProcess())->VadRoot; }
if (!FromMdl) @@ -357,7 +357,7 @@ case MEMORY_AREA_SHARED_DATA: Pfn = MmSharedDataPagePhysicalAddress.QuadPart >> PAGE_SHIFT; Status = - MmCreateVirtualMapping((PROS_EPROCESS)PsGetCurrentProcess(), + MmCreateVirtualMapping(PsGetCurrentProcess(), (PVOID)PAGE_ROUND_DOWN(Address), PAGE_READONLY, &Pfn,
Modified: trunk/reactos/ntoskrnl/mm/process.c URL: http://svn.reactos.ru/svn/reactos/trunk/reactos/ntoskrnl/mm/process.c?rev=21... ============================================================================== --- trunk/reactos/ntoskrnl/mm/process.c (original) +++ trunk/reactos/ntoskrnl/mm/process.c Fri May 19 00:32:17 2006 @@ -25,7 +25,7 @@
PVOID STDCALL -MiCreatePebOrTeb(PROS_EPROCESS Process, +MiCreatePebOrTeb(PEPROCESS Process, PVOID BaseAddress) { NTSTATUS Status; @@ -107,7 +107,7 @@
VOID STDCALL -MmDeleteTeb(PROS_EPROCESS Process, +MmDeleteTeb(PEPROCESS Process, PTEB Teb) { PMADDRESS_SPACE ProcessAddressSpace = (PMADDRESS_SPACE)&Process->VadRoot; @@ -220,7 +220,7 @@
NTSTATUS STDCALL -MmCreatePeb(PROS_EPROCESS Process) +MmCreatePeb(PEPROCESS Process) { PPEB Peb = NULL; LARGE_INTEGER SectionOffset; @@ -370,7 +370,7 @@
PTEB STDCALL -MmCreateTeb(PROS_EPROCESS Process, +MmCreateTeb(PEPROCESS Process, PCLIENT_ID ClientId, PINITIAL_TEB InitialTeb) { @@ -379,7 +379,7 @@
/* Attach to the process */ DPRINT("MmCreateTeb\n"); - if (Process != (PROS_EPROCESS)PsGetCurrentProcess()) + if (Process != PsGetCurrentProcess()) { /* Attach to Target */ KeAttachProcess(&Process->Pcb); @@ -420,7 +420,7 @@
NTSTATUS STDCALL -MmCreateProcessAddressSpace(IN PROS_EPROCESS Process, +MmCreateProcessAddressSpace(IN PEPROCESS Process, IN PROS_SECTION_OBJECT Section OPTIONAL) { NTSTATUS Status;
Modified: trunk/reactos/ntoskrnl/mm/rmap.c URL: http://svn.reactos.ru/svn/reactos/trunk/reactos/ntoskrnl/mm/rmap.c?rev=21935... ============================================================================== --- trunk/reactos/ntoskrnl/mm/rmap.c (original) +++ trunk/reactos/ntoskrnl/mm/rmap.c Fri May 19 00:32:17 2006 @@ -62,7 +62,7 @@ PMADDRESS_SPACE AddressSpace; ULONG Type; PVOID Address; - PROS_EPROCESS Process; + PEPROCESS Process; PMM_PAGEOP PageOp; ULONG Offset; NTSTATUS Status = STATUS_SUCCESS; @@ -78,7 +78,7 @@ ExReleaseFastMutex(&RmapListLock); return(STATUS_UNSUCCESSFUL); } - Process = (PROS_EPROCESS)entry->Process; + Process = entry->Process; Address = entry->Address; if ((((ULONG_PTR)Address) & 0xFFF) != 0) { @@ -196,7 +196,7 @@ PMADDRESS_SPACE AddressSpace; ULONG Type; PVOID Address; - PROS_EPROCESS Process; + PEPROCESS Process; PMM_PAGEOP PageOp; ULONG Offset; NTSTATUS Status = STATUS_SUCCESS; @@ -208,7 +208,7 @@ ExReleaseFastMutex(&RmapListLock); return(STATUS_UNSUCCESSFUL); } - Process = (PROS_EPROCESS)entry->Process; + Process = entry->Process; Address = entry->Address; if ((((ULONG_PTR)Address) & 0xFFF) != 0) { @@ -326,7 +326,7 @@ } while (current_entry != NULL) { - MmSetCleanPage((PROS_EPROCESS)current_entry->Process, current_entry->Address); + MmSetCleanPage(current_entry->Process, current_entry->Address); current_entry = current_entry->Next; } ExReleaseFastMutex(&RmapListLock); @@ -347,7 +347,7 @@ } while (current_entry != NULL) { - MmSetDirtyPage((PROS_EPROCESS)current_entry->Process, current_entry->Address); + MmSetDirtyPage(current_entry->Process, current_entry->Address); current_entry = current_entry->Next; } ExReleaseFastMutex(&RmapListLock); @@ -368,7 +368,7 @@ } while (current_entry != NULL) { - if (MmIsDirtyPage((PROS_EPROCESS)current_entry->Process, current_entry->Address)) + if (MmIsDirtyPage(current_entry->Process, current_entry->Address)) { ExReleaseFastMutex(&RmapListLock); return(TRUE); @@ -381,7 +381,7 @@
VOID NTAPI -MmInsertRmap(PFN_TYPE Page, PROS_EPROCESS Process, +MmInsertRmap(PFN_TYPE Page, PEPROCESS Process, PVOID Address) { PMM_RMAP_ENTRY current_entry; @@ -433,7 +433,7 @@ ExReleaseFastMutex(&RmapListLock); if (Process == NULL) { - Process = (PROS_EPROCESS)PsInitialSystemProcess; + Process = PsInitialSystemProcess; } if (Process) { @@ -448,7 +448,7 @@ VOID NTAPI MmDeleteAllRmaps(PFN_TYPE Page, PVOID Context, - VOID (*DeleteMapping)(PVOID Context, PROS_EPROCESS Process, + VOID (*DeleteMapping)(PVOID Context, PEPROCESS Process, PVOID Address)) { PMM_RMAP_ENTRY current_entry; @@ -470,7 +470,7 @@ current_entry = current_entry->Next; if (DeleteMapping) { - DeleteMapping(Context, (PROS_EPROCESS)previous_entry->Process, + DeleteMapping(Context, previous_entry->Process, previous_entry->Address); } Process = previous_entry->Process; @@ -488,7 +488,7 @@
VOID NTAPI -MmDeleteRmap(PFN_TYPE Page, PROS_EPROCESS Process, +MmDeleteRmap(PFN_TYPE Page, PEPROCESS Process, PVOID Address) { PMM_RMAP_ENTRY current_entry, previous_entry; @@ -513,7 +513,7 @@ ExFreeToNPagedLookasideList(&RmapLookasideList, current_entry); if (Process == NULL) { - Process = (PROS_EPROCESS)PsInitialSystemProcess; + Process = PsInitialSystemProcess; } if (Process) {
Modified: trunk/reactos/ntoskrnl/mm/section.c URL: http://svn.reactos.ru/svn/reactos/trunk/reactos/ntoskrnl/mm/section.c?rev=21... ============================================================================== --- trunk/reactos/ntoskrnl/mm/section.c (original) +++ trunk/reactos/ntoskrnl/mm/section.c Fri May 19 00:32:17 2006 @@ -1329,7 +1329,7 @@ }
VOID -MmPageOutDeleteMapping(PVOID Context, PROS_EPROCESS Process, PVOID Address) +MmPageOutDeleteMapping(PVOID Context, PEPROCESS Process, PVOID Address) { MM_SECTION_PAGEOUT_CONTEXT* PageOutContext; BOOLEAN WasDirty; @@ -3595,7 +3595,7 @@ LARGE_INTEGER SafeSectionOffset; SIZE_T SafeViewSize; PROS_SECTION_OBJECT Section; - PROS_EPROCESS Process; + PEPROCESS Process; KPROCESSOR_MODE PreviousMode; PMADDRESS_SPACE AddressSpace; NTSTATUS Status = STATUS_SUCCESS; @@ -3911,7 +3911,7 @@
ASSERT(Process);
- AddressSpace = (PMADDRESS_SPACE)&((PROS_EPROCESS)Process)->VadRoot; + AddressSpace = (PMADDRESS_SPACE)&(Process)->VadRoot;
MmLockAddressSpace(AddressSpace); MemoryArea = MmLocateMemoryAreaByAddress(AddressSpace, @@ -4432,7 +4432,7 @@
Section = (PROS_SECTION_OBJECT)SectionObject; - AddressSpace = (PMADDRESS_SPACE)&((PROS_EPROCESS)Process)->VadRoot; + AddressSpace = (PMADDRESS_SPACE)&(Process)->VadRoot;
AllocationType |= (Section->AllocationAttributes & SEC_NO_CHANGE);
Modified: trunk/reactos/ntoskrnl/mm/virtual.c URL: http://svn.reactos.ru/svn/reactos/trunk/reactos/ntoskrnl/mm/virtual.c?rev=21... ============================================================================== --- trunk/reactos/ntoskrnl/mm/virtual.c (original) +++ trunk/reactos/ntoskrnl/mm/virtual.c Fri May 19 00:32:17 2006 @@ -119,7 +119,7 @@ OUT PULONG ResultLength) { NTSTATUS Status; - PROS_EPROCESS Process; + PEPROCESS Process; MEMORY_AREA* MemoryArea; PMADDRESS_SPACE AddressSpace;
@@ -393,7 +393,7 @@ PAGE_ROUND_DOWN(*BaseAddress); *BaseAddress = (PVOID)PAGE_ROUND_DOWN(*BaseAddress);
- AddressSpace = (PMADDRESS_SPACE)&((PROS_EPROCESS)Process)->VadRoot; + AddressSpace = (PMADDRESS_SPACE)&(Process)->VadRoot;
MmLockAddressSpace(AddressSpace); MemoryArea = MmLocateMemoryAreaByAddress(AddressSpace, *BaseAddress);
Modified: trunk/reactos/ntoskrnl/ps/job.c URL: http://svn.reactos.ru/svn/reactos/trunk/reactos/ntoskrnl/ps/job.c?rev=21935&... ============================================================================== --- trunk/reactos/ntoskrnl/ps/job.c (original) +++ trunk/reactos/ntoskrnl/ps/job.c Fri May 19 00:32:17 2006 @@ -157,7 +157,7 @@ /* lock the process so we can safely assign the process. Note that in the meanwhile another thread could have assigned this process to a job! */
- Status = PsLockProcess((PROS_EPROCESS)Process, FALSE); + Status = PsLockProcess(Process, FALSE); if(NT_SUCCESS(Status)) { if(Process->Job == NULL && Process->Session == Job->SessionId) @@ -173,7 +173,7 @@ /* process is already assigned to a job or session id differs! */ Status = STATUS_ACCESS_DENIED; } - PsUnlockProcess((PROS_EPROCESS)Process); + PsUnlockProcess(Process);
if(NT_SUCCESS(Status)) {
Modified: trunk/reactos/ntoskrnl/ps/kill.c URL: http://svn.reactos.ru/svn/reactos/trunk/reactos/ntoskrnl/ps/kill.c?rev=21935... ============================================================================== --- trunk/reactos/ntoskrnl/ps/kill.c (original) +++ trunk/reactos/ntoskrnl/ps/kill.c Fri May 19 00:32:17 2006 @@ -165,7 +165,7 @@ }
/* Delete the process lock */ - ExFreePool(((PROS_EPROCESS)Process)->LockEvent); + ExFreePool(Process->LockEvent);
/* KDB hook */ KDB_DELETEPROCESS_HOOK(Process); @@ -174,7 +174,7 @@ SeDeassignPrimaryToken(Process);
/* Release Memory Information */ - MmReleaseMmInfo((PROS_EPROCESS)Process); + MmReleaseMmInfo(Process);
/* Delete the W32PROCESS structure if there's one associated */ if(Process->Win32Process != NULL) ExFreePool(Process->Win32Process); @@ -248,7 +248,7 @@ KeLowerIrql(PASSIVE_LEVEL);
/* Lock the Process before we modify its thread entries */ - PsLockProcess((PROS_EPROCESS)CurrentProcess, FALSE); + PsLockProcess(CurrentProcess, FALSE);
/* wake up the thread so we don't deadlock on PsLockProcess */ KeForceResumeThread(&CurrentThread->Tcb); @@ -316,7 +316,7 @@ }
DPRINT("Decommit teb at %p\n", Teb); - MmDeleteTeb((PROS_EPROCESS)CurrentProcess, Teb); + MmDeleteTeb(CurrentProcess, Teb); CurrentThread->Tcb.Teb = NULL; }
@@ -324,7 +324,7 @@ if (Last) PspExitProcess(CurrentProcess);
/* Unlock the Process */ - PsUnlockProcess((PROS_EPROCESS)CurrentProcess); + PsUnlockProcess(CurrentProcess);
/* Cancel I/O for the thread. */ IoCancelThreadIo(CurrentThread); @@ -571,11 +571,11 @@
CurrentThread = PsGetCurrentThread();
- PsLockProcess((PROS_EPROCESS)Process, FALSE); + PsLockProcess(Process, FALSE);
if(Process->ExitTime.QuadPart != 0) { - PsUnlockProcess((PROS_EPROCESS)Process); + PsUnlockProcess(Process); ObDereferenceObject(Process); return STATUS_PROCESS_IS_TERMINATING; } @@ -600,7 +600,7 @@ unlocking the process, fail */ CurrentThread->Terminated = TRUE;
- PsUnlockProcess((PROS_EPROCESS)Process); + PsUnlockProcess(Process);
/* we can safely dereference the process because the current thread holds a reference to it until it gets reaped */ @@ -618,7 +618,7 @@ }
/* unlock and dereference the process so the threads can kill themselves */ - PsUnlockProcess((PROS_EPROCESS)Process); + PsUnlockProcess(Process); ObDereferenceObject(Process);
return(STATUS_SUCCESS); @@ -676,7 +676,7 @@ if (Thread != PsGetCurrentThread()) {
/* we need to lock the process to make sure it's not already terminating */ - PsLockProcess((PROS_EPROCESS)Thread->ThreadsProcess, FALSE); + PsLockProcess(Thread->ThreadsProcess, FALSE);
/* This isn't our thread, terminate it if not already done */ if (!Thread->Terminated) { @@ -687,7 +687,7 @@ PspTerminateThreadByPointer(Thread, ExitStatus); }
- PsUnlockProcess((PROS_EPROCESS)Thread->ThreadsProcess); + PsUnlockProcess(Thread->ThreadsProcess);
/* Dereference the Thread and return */ ObDereferenceObject(Thread);
Modified: trunk/reactos/ntoskrnl/ps/process.c URL: http://svn.reactos.ru/svn/reactos/trunk/reactos/ntoskrnl/ps/process.c?rev=21... ============================================================================== --- trunk/reactos/ntoskrnl/ps/process.c (original) +++ trunk/reactos/ntoskrnl/ps/process.c Fri May 19 00:32:17 2006 @@ -35,7 +35,7 @@
NTSTATUS NTAPI -PsLockProcess(PROS_EPROCESS Process, BOOLEAN Timeout) +PsLockProcess(PEPROCESS Process, BOOLEAN Timeout) { ULONG Attempts = 0; PKTHREAD PrevLockOwner; @@ -94,7 +94,7 @@
VOID NTAPI -PsUnlockProcess(PROS_EPROCESS Process) +PsUnlockProcess(PEPROCESS Process) { PAGED_CODE();
@@ -292,7 +292,7 @@ ObjectAttributes, PreviousMode, NULL, - sizeof(ROS_EPROCESS), + sizeof(EPROCESS), 0, 0, (PVOID*)&Process); @@ -305,7 +305,7 @@
/* Clean up the Object */ DPRINT("Cleaning Process Object\n"); - RtlZeroMemory(Process, sizeof(ROS_EPROCESS)); + RtlZeroMemory(Process, sizeof(EPROCESS));
/* Inherit stuff from the Parent since we now have the object created */ if (pParentProcess) @@ -329,10 +329,10 @@
/* Setup the Lock Event */ DPRINT("Initialzing Process Lock\n"); - ((PROS_EPROCESS)Process)->LockEvent = ExAllocatePoolWithTag(PagedPool, + Process->LockEvent = ExAllocatePoolWithTag(PagedPool, sizeof(KEVENT), TAG('P', 's', 'L', 'k')); - KeInitializeEvent(((PROS_EPROCESS)Process)->LockEvent, SynchronizationEvent, FALSE); + KeInitializeEvent(Process->LockEvent, SynchronizationEvent, FALSE);
/* Setup the Thread List Head */ DPRINT("Initialzing Process ThreadListHead\n"); @@ -345,8 +345,8 @@
/* Set Process's Directory Base */ DPRINT("Initialzing Process Directory Base\n"); - MmCopyMmInfo((PROS_EPROCESS)(pParentProcess ? pParentProcess : PsInitialSystemProcess), - (PROS_EPROCESS)Process, + MmCopyMmInfo((pParentProcess ? pParentProcess : PsInitialSystemProcess), + Process, &DirectoryTableBase);
/* Now initialize the Kernel Process */ @@ -367,7 +367,7 @@
/* Create the Process' Address Space */ DPRINT("Initialzing Process Address Space\n"); - Status = MmCreateProcessAddressSpace((PROS_EPROCESS)Process, (PROS_SECTION_OBJECT)SectionObject); + Status = MmCreateProcessAddressSpace(Process, (PROS_SECTION_OBJECT)SectionObject); if (!NT_SUCCESS(Status)) { DPRINT1("Failed to create Address Space\n"); @@ -400,7 +400,7 @@ if (pParentProcess) { DPRINT("Creating PEB\n"); - Status = MmCreatePeb((PROS_EPROCESS)Process); + Status = MmCreatePeb(Process); if (!NT_SUCCESS(Status)) { DbgPrint("NtCreateProcess() Peb creation failed: Status %x\n",Status);
Modified: trunk/reactos/ntoskrnl/ps/psmgr.c URL: http://svn.reactos.ru/svn/reactos/trunk/reactos/ntoskrnl/ps/psmgr.c?rev=2193... ============================================================================== --- trunk/reactos/ntoskrnl/ps/psmgr.c (original) +++ trunk/reactos/ntoskrnl/ps/psmgr.c Fri May 19 00:32:17 2006 @@ -158,7 +158,7 @@ RtlZeroMemory(&ObjectTypeInitializer, sizeof(ObjectTypeInitializer)); RtlInitUnicodeString(&Name, L"Process"); ObjectTypeInitializer.Length = sizeof(ObjectTypeInitializer); - ObjectTypeInitializer.DefaultNonPagedPoolCharge = sizeof(ROS_EPROCESS); + ObjectTypeInitializer.DefaultNonPagedPoolCharge = sizeof(EPROCESS); ObjectTypeInitializer.GenericMapping = PiProcessMapping; ObjectTypeInitializer.PoolType = NonPagedPool; ObjectTypeInitializer.ValidAccessMask = PROCESS_ALL_ACCESS; @@ -185,7 +185,7 @@ NULL, KernelMode, NULL, - sizeof(ROS_EPROCESS), + sizeof(EPROCESS), 0, 0, (PVOID*)&PsIdleProcess); @@ -196,7 +196,7 @@ return; }
- RtlZeroMemory(PsIdleProcess, sizeof(ROS_EPROCESS)); + RtlZeroMemory(PsIdleProcess, sizeof(EPROCESS));
PsIdleProcess->Pcb.Affinity = 0xFFFFFFFF; PsIdleProcess->Pcb.IopmOffset = 0xffff; @@ -207,7 +207,7 @@ InitializeListHead(&PsIdleProcess->ActiveProcessLinks); KeInitializeDispatcherHeader(&PsIdleProcess->Pcb.Header, ProcessObject, - sizeof(ROS_EPROCESS) / sizeof(LONG), + sizeof(EPROCESS) / sizeof(LONG), FALSE); PsIdleProcess->Pcb.DirectoryTableBase.QuadPart = (ULONG_PTR)MmGetPageDirectory(); strcpy(PsIdleProcess->ImageFileName, "Idle"); @@ -221,7 +221,7 @@ NULL, KernelMode, NULL, - sizeof(ROS_EPROCESS), + sizeof(EPROCESS), 0, 0, (PVOID*)&PsInitialSystemProcess); @@ -233,7 +233,7 @@ }
/* System threads may run on any processor. */ - RtlZeroMemory(PsInitialSystemProcess, sizeof(ROS_EPROCESS)); + RtlZeroMemory(PsInitialSystemProcess, sizeof(EPROCESS)); #ifdef CONFIG_SMP /* FIXME: * Only the boot cpu is initialized. Threads of the @@ -249,17 +249,17 @@ InitializeListHead(&PsInitialSystemProcess->Pcb.ThreadListHead); KeInitializeDispatcherHeader(&PsInitialSystemProcess->Pcb.Header, ProcessObject, - sizeof(ROS_EPROCESS) / sizeof(LONG), + sizeof(EPROCESS) / sizeof(LONG), FALSE); KProcess = &PsInitialSystemProcess->Pcb; PspInheritQuota(PsInitialSystemProcess, NULL);
- MmInitializeAddressSpace((PROS_EPROCESS)PsInitialSystemProcess, - (PMADDRESS_SPACE)&((PROS_EPROCESS)PsInitialSystemProcess)->VadRoot); - - ((PROS_EPROCESS)PsInitialSystemProcess)->LockEvent = + MmInitializeAddressSpace(PsInitialSystemProcess, + (PMADDRESS_SPACE)&(PsInitialSystemProcess)->VadRoot); + + (PsInitialSystemProcess)->LockEvent = ExAllocatePoolWithTag(PagedPool, sizeof(KEVENT), TAG('P', 's', 'L', 'k')); - KeInitializeEvent(((PROS_EPROCESS)PsInitialSystemProcess)->LockEvent, SynchronizationEvent, FALSE); + KeInitializeEvent((PsInitialSystemProcess)->LockEvent, SynchronizationEvent, FALSE);
#if defined(__GNUC__) KProcess->DirectoryTableBase =
Modified: trunk/reactos/ntoskrnl/ps/query.c URL: http://svn.reactos.ru/svn/reactos/trunk/reactos/ntoskrnl/ps/query.c?rev=2193... ============================================================================== --- trunk/reactos/ntoskrnl/ps/query.c (original) +++ trunk/reactos/ntoskrnl/ps/query.c Fri May 19 00:32:17 2006 @@ -653,7 +653,7 @@ { /* lock the process to be thread-safe! */
- Status = PsLockProcess((PROS_EPROCESS)Process, FALSE); + Status = PsLockProcess(Process, FALSE); if(NT_SUCCESS(Status)) { /* @@ -671,7 +671,7 @@ ObDereferenceObject(ExceptionPort); Status = STATUS_PORT_ALREADY_SET; } - PsUnlockProcess((PROS_EPROCESS)Process); + PsUnlockProcess(Process); } else { @@ -758,7 +758,7 @@
/* FIXME - update the session id for the process token */
- Status = PsLockProcess((PROS_EPROCESS)Process, FALSE); + Status = PsLockProcess(Process, FALSE); if(NT_SUCCESS(Status)) { Process->Session = SessionInfo.SessionId; @@ -785,7 +785,7 @@ KeDetachProcess(); }
- PsUnlockProcess((PROS_EPROCESS)Process); + PsUnlockProcess(Process); } } break;
Modified: trunk/reactos/ntoskrnl/ps/thread.c URL: http://svn.reactos.ru/svn/reactos/trunk/reactos/ntoskrnl/ps/thread.c?rev=219... ============================================================================== --- trunk/reactos/ntoskrnl/ps/thread.c (original) +++ trunk/reactos/ntoskrnl/ps/thread.c Fri May 19 00:32:17 2006 @@ -220,7 +220,7 @@
/* Create Teb */ DPRINT("Initialliazing Thread PEB\n"); - TebBase = MmCreateTeb((PROS_EPROCESS)Process, &Thread->Cid, InitialTeb); + TebBase = MmCreateTeb(Process, &Thread->Cid, InitialTeb);
/* Set the Start Addresses */ DPRINT("Initialliazing Thread Start Addresses :%x, %x\n", ThreadContext->Eip, ThreadContext->Eax);