mirror of
https://github.com/reactos/reactos.git
synced 2024-07-01 18:24:24 +00:00
- 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.
svn path=/trunk/; revision=21935
This commit is contained in:
parent
7b3c313c1c
commit
19e2ef808c
|
@ -1074,7 +1074,7 @@ typedef struct _EPROCESS
|
|||
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;
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
/* TYPES *********************************************************************/
|
||||
|
||||
struct _ROS_EPROCESS;
|
||||
struct _EPROCESS;
|
||||
|
||||
extern ULONG MiFreeSwapPages;
|
||||
extern ULONG MiUsedSwapPages;
|
||||
|
@ -242,7 +242,7 @@ typedef struct _MADDRESS_SPACE
|
|||
{
|
||||
PMEMORY_AREA MemoryAreaRoot;
|
||||
PVOID LowestAddress;
|
||||
struct _ROS_EPROCESS* Process;
|
||||
struct _EPROCESS* Process;
|
||||
PUSHORT PageTableRefCountTable;
|
||||
ULONG PageTableRefCountTableSize;
|
||||
} MADDRESS_SPACE, *PMADDRESS_SPACE;
|
||||
|
@ -360,7 +360,7 @@ MmGetKernelAddressSpace(VOID);
|
|||
NTSTATUS
|
||||
NTAPI
|
||||
MmInitializeAddressSpace(
|
||||
struct _ROS_EPROCESS* Process,
|
||||
struct _EPROCESS* Process,
|
||||
PMADDRESS_SPACE AddressSpace);
|
||||
|
||||
NTSTATUS
|
||||
|
@ -443,7 +443,7 @@ MmFindGap(
|
|||
VOID
|
||||
STDCALL
|
||||
MmReleaseMemoryAreaIfDecommitted(
|
||||
struct _ROS_EPROCESS *Process,
|
||||
struct _EPROCESS *Process,
|
||||
PMADDRESS_SPACE AddressSpace,
|
||||
PVOID BaseAddress
|
||||
);
|
||||
|
@ -619,18 +619,18 @@ MmShowOutOfSpaceMessagePagingFile(VOID);
|
|||
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 @@ MmCreateTeb(
|
|||
VOID
|
||||
STDCALL
|
||||
MmDeleteTeb(
|
||||
struct _ROS_EPROCESS *Process,
|
||||
struct _EPROCESS *Process,
|
||||
struct _TEB* Teb
|
||||
);
|
||||
|
||||
|
@ -704,7 +704,7 @@ MmQueryAnonMem(
|
|||
VOID
|
||||
NTAPI
|
||||
MmFreeVirtualMemory(
|
||||
struct _ROS_EPROCESS* Process,
|
||||
struct _EPROCESS* Process,
|
||||
PMEMORY_AREA MemoryArea
|
||||
);
|
||||
|
||||
|
@ -858,7 +858,7 @@ VOID
|
|||
NTAPI
|
||||
MmInsertRmap(
|
||||
PFN_TYPE Page,
|
||||
struct _ROS_EPROCESS *Process,
|
||||
struct _EPROCESS *Process,
|
||||
PVOID Address
|
||||
);
|
||||
|
||||
|
@ -867,14 +867,14 @@ NTAPI
|
|||
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 @@ MmCommitPagedPoolAddress(
|
|||
NTSTATUS
|
||||
NTAPI
|
||||
MmCreateVirtualMapping(
|
||||
struct _ROS_EPROCESS* Process,
|
||||
struct _EPROCESS* Process,
|
||||
PVOID Address,
|
||||
ULONG flProtect,
|
||||
PPFN_TYPE Pages,
|
||||
|
@ -1002,7 +1002,7 @@ MmCreateVirtualMapping(
|
|||
NTSTATUS
|
||||
NTAPI
|
||||
MmCreateVirtualMappingUnsafe(
|
||||
struct _ROS_EPROCESS* Process,
|
||||
struct _EPROCESS* Process,
|
||||
PVOID Address,
|
||||
ULONG flProtect,
|
||||
PPFN_TYPE Pages,
|
||||
|
@ -1012,13 +1012,13 @@ MmCreateVirtualMappingUnsafe(
|
|||
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 @@ MmSetPageProtect(
|
|||
BOOLEAN
|
||||
NTAPI
|
||||
MmIsPagePresent(
|
||||
struct _ROS_EPROCESS* Process,
|
||||
struct _EPROCESS* Process,
|
||||
PVOID Address
|
||||
);
|
||||
|
||||
|
@ -1037,7 +1037,7 @@ MmInitGlobalKernelPageDirectory(VOID);
|
|||
VOID
|
||||
NTAPI
|
||||
MmDisableVirtualMapping(
|
||||
struct _ROS_EPROCESS *Process,
|
||||
struct _EPROCESS *Process,
|
||||
PVOID Address,
|
||||
BOOLEAN* WasDirty,
|
||||
PPFN_TYPE Page
|
||||
|
@ -1046,7 +1046,7 @@ MmDisableVirtualMapping(
|
|||
VOID
|
||||
NTAPI
|
||||
MmEnableVirtualMapping(
|
||||
struct _ROS_EPROCESS *Process,
|
||||
struct _EPROCESS *Process,
|
||||
PVOID Address
|
||||
);
|
||||
|
||||
|
@ -1057,7 +1057,7 @@ MmRawDeleteVirtualMapping(PVOID Address);
|
|||
VOID
|
||||
NTAPI
|
||||
MmDeletePageFileMapping(
|
||||
struct _ROS_EPROCESS *Process,
|
||||
struct _EPROCESS *Process,
|
||||
PVOID Address,
|
||||
SWAPENTRY* SwapEntry
|
||||
);
|
||||
|
@ -1065,7 +1065,7 @@ MmDeletePageFileMapping(
|
|||
NTSTATUS
|
||||
NTAPI
|
||||
MmCreatePageFileMapping(
|
||||
struct _ROS_EPROCESS *Process,
|
||||
struct _EPROCESS *Process,
|
||||
PVOID Address,
|
||||
SWAPENTRY SwapEntry
|
||||
);
|
||||
|
@ -1073,7 +1073,7 @@ MmCreatePageFileMapping(
|
|||
BOOLEAN
|
||||
NTAPI
|
||||
MmIsPageSwapEntry(
|
||||
struct _ROS_EPROCESS *Process,
|
||||
struct _EPROCESS *Process,
|
||||
PVOID Address
|
||||
);
|
||||
|
||||
|
@ -1087,7 +1087,7 @@ MmTransferOwnershipPage(
|
|||
VOID
|
||||
NTAPI
|
||||
MmSetDirtyPage(
|
||||
struct _ROS_EPROCESS *Process,
|
||||
struct _EPROCESS *Process,
|
||||
PVOID Address
|
||||
);
|
||||
|
||||
|
@ -1123,7 +1123,7 @@ MmReferencePageUnsafe(PFN_TYPE Page);
|
|||
BOOLEAN
|
||||
NTAPI
|
||||
MmIsAccessedAndResetAccessPage(
|
||||
struct _ROS_EPROCESS *Process,
|
||||
struct _EPROCESS *Process,
|
||||
PVOID Address
|
||||
);
|
||||
|
||||
|
@ -1158,7 +1158,7 @@ MmGetSavedSwapEntryPage(PFN_TYPE Page);
|
|||
VOID
|
||||
NTAPI
|
||||
MmSetCleanPage(
|
||||
struct _ROS_EPROCESS *Process,
|
||||
struct _EPROCESS *Process,
|
||||
PVOID Address
|
||||
);
|
||||
|
||||
|
@ -1169,37 +1169,37 @@ MmCreatePageTable(PVOID PAddress);
|
|||
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);
|
||||
MmReleaseMmInfo(struct _EPROCESS *Process);
|
||||
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
Mmi386ReleaseMmInfo(struct _ROS_EPROCESS *Process);
|
||||
Mmi386ReleaseMmInfo(struct _EPROCESS *Process);
|
||||
|
||||
VOID
|
||||
NTAPI
|
||||
MmDeleteVirtualMapping(
|
||||
struct _ROS_EPROCESS *Process,
|
||||
struct _EPROCESS *Process,
|
||||
PVOID Address,
|
||||
BOOLEAN FreePage,
|
||||
BOOLEAN* WasDirty,
|
||||
|
@ -1209,7 +1209,7 @@ MmDeleteVirtualMapping(
|
|||
BOOLEAN
|
||||
NTAPI
|
||||
MmIsDirtyPage(
|
||||
struct _ROS_EPROCESS *Process,
|
||||
struct _EPROCESS *Process,
|
||||
PVOID Address
|
||||
);
|
||||
|
||||
|
@ -1224,7 +1224,7 @@ MmMarkPageUnmapped(PFN_TYPE Page);
|
|||
VOID
|
||||
NTAPI
|
||||
MmUpdatePageDir(
|
||||
struct _ROS_EPROCESS *Process,
|
||||
struct _EPROCESS *Process,
|
||||
PVOID Address,
|
||||
ULONG Size
|
||||
);
|
||||
|
|
|
@ -8,201 +8,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;
|
||||
extern LIST_ENTRY PspReaperListHead;
|
||||
|
@ -563,12 +368,12 @@ PspGetSystemDllEntryPoints(VOID);
|
|||
NTSTATUS
|
||||
NTAPI
|
||||
PsLockProcess(
|
||||
PROS_EPROCESS Process,
|
||||
PEPROCESS Process,
|
||||
BOOLEAN Timeout
|
||||
);
|
||||
|
||||
VOID
|
||||
NTAPI
|
||||
PsUnlockProcess(PROS_EPROCESS Process);
|
||||
PsUnlockProcess(PEPROCESS Process);
|
||||
|
||||
#endif /* __INCLUDE_INTERNAL_PS_H */
|
||||
|
|
|
@ -154,7 +154,7 @@ KiDispatchThreadNoLock(ULONG NewThreadStatus)
|
|||
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 @@ KeInitializeThread(PKPROCESS Process,
|
|||
* 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);
|
||||
|
|
|
@ -56,8 +56,8 @@ UpdatePageDirs(IN PKTHREAD Thread,
|
|||
* 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
|
||||
|
|
|
@ -544,7 +544,7 @@ NtAllocateVirtualMemory(IN HANDLE ProcessHandle,
|
|||
* RETURNS: Status
|
||||
*/
|
||||
{
|
||||
PROS_EPROCESS Process;
|
||||
PEPROCESS Process;
|
||||
MEMORY_AREA* MemoryArea;
|
||||
ULONG_PTR MemoryAreaLength;
|
||||
ULONG Type;
|
||||
|
@ -784,7 +784,7 @@ MmFreeVirtualMemoryPage(PVOID Context,
|
|||
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 @@ MmFreeVirtualMemoryPage(PVOID Context,
|
|||
|
||||
VOID
|
||||
NTAPI
|
||||
MmFreeVirtualMemory(PROS_EPROCESS Process,
|
||||
MmFreeVirtualMemory(PEPROCESS Process,
|
||||
PMEMORY_AREA MemoryArea)
|
||||
{
|
||||
PLIST_ENTRY current_entry;
|
||||
|
@ -889,7 +889,7 @@ NtFreeVirtualMemory(IN HANDLE ProcessHandle,
|
|||
{
|
||||
MEMORY_AREA* MemoryArea;
|
||||
NTSTATUS Status;
|
||||
PROS_EPROCESS Process;
|
||||
PEPROCESS Process;
|
||||
PMADDRESS_SPACE AddressSpace;
|
||||
PVOID BaseAddress;
|
||||
ULONG RegionSize;
|
||||
|
|
|
@ -80,7 +80,7 @@ PMADDRESS_SPACE
|
|||
NTAPI
|
||||
MmGetCurrentAddressSpace(VOID)
|
||||
{
|
||||
return((PMADDRESS_SPACE)&((PROS_EPROCESS)PsGetCurrentProcess())->VadRoot);
|
||||
return((PMADDRESS_SPACE)&(PsGetCurrentProcess())->VadRoot);
|
||||
}
|
||||
|
||||
PMADDRESS_SPACE
|
||||
|
@ -92,7 +92,7 @@ MmGetKernelAddressSpace(VOID)
|
|||
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
MmInitializeAddressSpace(PROS_EPROCESS Process,
|
||||
MmInitializeAddressSpace(PEPROCESS Process,
|
||||
PMADDRESS_SPACE AddressSpace)
|
||||
{
|
||||
AddressSpace->MemoryAreaRoot = NULL;
|
||||
|
|
|
@ -203,7 +203,7 @@ ProtectToPTE(ULONG flProtect)
|
|||
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
Mmi386ReleaseMmInfo(PROS_EPROCESS Process)
|
||||
Mmi386ReleaseMmInfo(PEPROCESS Process)
|
||||
{
|
||||
PUSHORT LdtDescriptor;
|
||||
ULONG LdtBase;
|
||||
|
@ -329,8 +329,8 @@ Mmi386ReleaseMmInfo(PROS_EPROCESS Process)
|
|||
|
||||
NTSTATUS
|
||||
STDCALL
|
||||
MmCopyMmInfo(PROS_EPROCESS Src,
|
||||
PROS_EPROCESS Dest,
|
||||
MmCopyMmInfo(PEPROCESS Src,
|
||||
PEPROCESS Dest,
|
||||
PPHYSICAL_ADDRESS DirectoryTableBase)
|
||||
{
|
||||
NTSTATUS Status;
|
||||
|
@ -408,9 +408,9 @@ MmCopyMmInfo(PROS_EPROCESS Src,
|
|||
|
||||
VOID
|
||||
NTAPI
|
||||
MmDeletePageTable(PROS_EPROCESS Process, PVOID Address)
|
||||
MmDeletePageTable(PEPROCESS Process, PVOID Address)
|
||||
{
|
||||
PROS_EPROCESS CurrentProcess = (PROS_EPROCESS)PsGetCurrentProcess();
|
||||
PEPROCESS CurrentProcess = PsGetCurrentProcess();
|
||||
|
||||
if (Process != NULL && Process != CurrentProcess)
|
||||
{
|
||||
|
@ -441,9 +441,9 @@ MmDeletePageTable(PROS_EPROCESS Process, PVOID Address)
|
|||
|
||||
VOID
|
||||
NTAPI
|
||||
MmFreePageTable(PROS_EPROCESS Process, PVOID Address)
|
||||
MmFreePageTable(PEPROCESS Process, PVOID Address)
|
||||
{
|
||||
PROS_EPROCESS CurrentProcess = (PROS_EPROCESS)PsGetCurrentProcess();
|
||||
PEPROCESS CurrentProcess = PsGetCurrentProcess();
|
||||
ULONG i;
|
||||
PFN_TYPE Pfn;
|
||||
|
||||
|
@ -504,7 +504,7 @@ MmFreePageTable(PROS_EPROCESS Process, PVOID Address)
|
|||
}
|
||||
|
||||
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 @@ MmGetPageTableForProcessForPAE(PROS_EPROCESS Process, PVOID Address, BOOLEAN Cre
|
|||
{
|
||||
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 @@ MmGetPageTableForProcessForPAE(PROS_EPROCESS Process, PVOID Address, BOOLEAN Cre
|
|||
}
|
||||
|
||||
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 @@ MmGetPageTableForProcess(PROS_EPROCESS Process, PVOID Address, BOOLEAN Create)
|
|||
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 @@ BOOLEAN MmUnmapPageTable(PULONG Pt)
|
|||
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 @@ static ULONGLONG MmGetPageEntryForProcessForPAE(PROS_EPROCESS Process, PVOID Add
|
|||
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 @@ static ULONG MmGetPageEntryForProcess(PROS_EPROCESS Process, PVOID Address)
|
|||
|
||||
PFN_TYPE
|
||||
NTAPI
|
||||
MmGetPfnForProcess(PROS_EPROCESS Process,
|
||||
MmGetPfnForProcess(PEPROCESS Process,
|
||||
PVOID Address)
|
||||
{
|
||||
|
||||
|
@ -796,7 +796,7 @@ MmGetPfnForProcess(PROS_EPROCESS Process,
|
|||
|
||||
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 @@ MmRawDeleteVirtualMapping(PVOID Address)
|
|||
|
||||
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 @@ MmDeleteVirtualMapping(PROS_EPROCESS Process, PVOID Address, BOOLEAN FreePage,
|
|||
|
||||
VOID
|
||||
NTAPI
|
||||
MmDeletePageFileMapping(PROS_EPROCESS Process, PVOID Address,
|
||||
MmDeletePageFileMapping(PEPROCESS Process, PVOID Address,
|
||||
SWAPENTRY* SwapEntry)
|
||||
/*
|
||||
* FUNCTION: Delete a virtual mapping
|
||||
|
@ -1199,7 +1199,7 @@ Mmi386MakeKernelPageTableGlobal(PVOID PAddress)
|
|||
|
||||
BOOLEAN
|
||||
NTAPI
|
||||
MmIsDirtyPage(PROS_EPROCESS Process, PVOID Address)
|
||||
MmIsDirtyPage(PEPROCESS Process, PVOID Address)
|
||||
{
|
||||
if (Ke386Pae)
|
||||
{
|
||||
|
@ -1213,7 +1213,7 @@ MmIsDirtyPage(PROS_EPROCESS Process, PVOID Address)
|
|||
|
||||
BOOLEAN
|
||||
NTAPI
|
||||
MmIsAccessedAndResetAccessPage(PROS_EPROCESS Process, PVOID Address)
|
||||
MmIsAccessedAndResetAccessPage(PEPROCESS Process, PVOID Address)
|
||||
{
|
||||
if (Address < MmSystemRangeStart && Process == NULL)
|
||||
{
|
||||
|
@ -1280,7 +1280,7 @@ MmIsAccessedAndResetAccessPage(PROS_EPROCESS Process, PVOID Address)
|
|||
|
||||
VOID
|
||||
NTAPI
|
||||
MmSetCleanPage(PROS_EPROCESS Process, PVOID Address)
|
||||
MmSetCleanPage(PEPROCESS Process, PVOID Address)
|
||||
{
|
||||
if (Address < MmSystemRangeStart && Process == NULL)
|
||||
{
|
||||
|
@ -1345,7 +1345,7 @@ MmSetCleanPage(PROS_EPROCESS Process, PVOID Address)
|
|||
|
||||
VOID
|
||||
NTAPI
|
||||
MmSetDirtyPage(PROS_EPROCESS Process, PVOID Address)
|
||||
MmSetDirtyPage(PEPROCESS Process, PVOID Address)
|
||||
{
|
||||
if (Address < MmSystemRangeStart && Process == NULL)
|
||||
{
|
||||
|
@ -1406,7 +1406,7 @@ MmSetDirtyPage(PROS_EPROCESS Process, PVOID Address)
|
|||
|
||||
VOID
|
||||
NTAPI
|
||||
MmEnableVirtualMapping(PROS_EPROCESS Process, PVOID Address)
|
||||
MmEnableVirtualMapping(PEPROCESS Process, PVOID Address)
|
||||
{
|
||||
if (Ke386Pae)
|
||||
{
|
||||
|
@ -1462,7 +1462,7 @@ MmEnableVirtualMapping(PROS_EPROCESS Process, PVOID Address)
|
|||
|
||||
BOOLEAN
|
||||
NTAPI
|
||||
MmIsPagePresent(PROS_EPROCESS Process, PVOID Address)
|
||||
MmIsPagePresent(PEPROCESS Process, PVOID Address)
|
||||
{
|
||||
if (Ke386Pae)
|
||||
{
|
||||
|
@ -1476,7 +1476,7 @@ MmIsPagePresent(PROS_EPROCESS Process, PVOID Address)
|
|||
|
||||
BOOLEAN
|
||||
NTAPI
|
||||
MmIsPageSwapEntry(PROS_EPROCESS Process, PVOID Address)
|
||||
MmIsPageSwapEntry(PEPROCESS Process, PVOID Address)
|
||||
{
|
||||
if (Ke386Pae)
|
||||
{
|
||||
|
@ -1622,7 +1622,7 @@ MmCreateVirtualMappingForKernel(PVOID Address,
|
|||
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
MmCreatePageFileMapping(PROS_EPROCESS Process,
|
||||
MmCreatePageFileMapping(PEPROCESS Process,
|
||||
PVOID Address,
|
||||
SWAPENTRY SwapEntry)
|
||||
{
|
||||
|
@ -1710,7 +1710,7 @@ MmCreatePageFileMapping(PROS_EPROCESS Process,
|
|||
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
MmCreateVirtualMappingUnsafe(PROS_EPROCESS Process,
|
||||
MmCreateVirtualMappingUnsafe(PEPROCESS Process,
|
||||
PVOID Address,
|
||||
ULONG flProtect,
|
||||
PPFN_TYPE Pages,
|
||||
|
@ -1916,7 +1916,7 @@ MmCreateVirtualMappingUnsafe(PROS_EPROCESS Process,
|
|||
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
MmCreateVirtualMapping(PROS_EPROCESS Process,
|
||||
MmCreateVirtualMapping(PEPROCESS Process,
|
||||
PVOID Address,
|
||||
ULONG flProtect,
|
||||
PPFN_TYPE Pages,
|
||||
|
@ -1942,7 +1942,7 @@ MmCreateVirtualMapping(PROS_EPROCESS Process,
|
|||
|
||||
ULONG
|
||||
NTAPI
|
||||
MmGetPageProtect(PROS_EPROCESS Process, PVOID Address)
|
||||
MmGetPageProtect(PEPROCESS Process, PVOID Address)
|
||||
{
|
||||
ULONG Entry;
|
||||
ULONG Protect;
|
||||
|
@ -1988,7 +1988,7 @@ MmGetPageProtect(PROS_EPROCESS Process, PVOID Address)
|
|||
|
||||
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 @@ MmDeleteHyperspaceMapping(PVOID Address)
|
|||
|
||||
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 @@ MmUpdatePageDir(PROS_EPROCESS Process, PVOID Address, ULONG Size)
|
|||
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 @@ MmUpdatePageDir(PROS_EPROCESS Process, PVOID Address, ULONG Size)
|
|||
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));
|
||||
}
|
||||
|
|
|
@ -747,7 +747,7 @@ MmFreeMemoryArea(
|
|||
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 @@ MmCreateMemoryArea(PMADDRESS_SPACE AddressSpace,
|
|||
|
||||
|
||||
VOID STDCALL
|
||||
MmReleaseMemoryAreaIfDecommitted(PROS_EPROCESS Process,
|
||||
MmReleaseMemoryAreaIfDecommitted(PEPROCESS Process,
|
||||
PMADDRESS_SPACE AddressSpace,
|
||||
PVOID BaseAddress)
|
||||
{
|
||||
|
|
|
@ -241,7 +241,7 @@ MmUnmapLockedPages(PVOID BaseAddress, PMDL Mdl)
|
|||
/* 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 @@ MmUnmapLockedPages(PVOID BaseAddress, PMDL Mdl)
|
|||
|
||||
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 @@ VOID STDCALL MmProbeAndLockPages (PMDL Mdl,
|
|||
/* 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 @@ MmMapLockedPagesSpecifyCache ( IN PMDL Mdl,
|
|||
KIRQL oldIrql;
|
||||
ULONG PageCount;
|
||||
ULONG StartingOffset;
|
||||
PROS_EPROCESS CurrentProcess;
|
||||
PEPROCESS CurrentProcess;
|
||||
NTSTATUS Status;
|
||||
ULONG Protect;
|
||||
|
||||
|
@ -803,7 +803,7 @@ MmMapLockedPagesSpecifyCache ( IN PMDL Mdl,
|
|||
BoundaryAddressMultiple.QuadPart = 0;
|
||||
Base = BaseAddress;
|
||||
|
||||
CurrentProcess = (PROS_EPROCESS)PsGetCurrentProcess();
|
||||
CurrentProcess = PsGetCurrentProcess();
|
||||
|
||||
MmLockAddressSpace((PMADDRESS_SPACE)&CurrentProcess->VadRoot);
|
||||
Status = MmCreateMemoryArea((PMADDRESS_SPACE)&CurrentProcess->VadRoot,
|
||||
|
|
|
@ -30,7 +30,7 @@ MM_STATS MmStats;
|
|||
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
MmReleaseMmInfo(PROS_EPROCESS Process)
|
||||
MmReleaseMmInfo(PEPROCESS Process)
|
||||
{
|
||||
PVOID Address;
|
||||
PMEMORY_AREA MemoryArea;
|
||||
|
@ -114,7 +114,7 @@ BOOLEAN STDCALL MmIsAddressValid(PVOID VirtualAddress)
|
|||
}
|
||||
else
|
||||
{
|
||||
AddressSpace = (PMADDRESS_SPACE)&((PROS_EPROCESS)PsGetCurrentProcess())->VadRoot;
|
||||
AddressSpace = (PMADDRESS_SPACE)&(PsGetCurrentProcess())->VadRoot;
|
||||
}
|
||||
|
||||
MmLockAddressSpace(AddressSpace);
|
||||
|
@ -171,7 +171,7 @@ MmAccessFault(KPROCESSOR_MODE Mode,
|
|||
}
|
||||
else
|
||||
{
|
||||
AddressSpace = (PMADDRESS_SPACE)&((PROS_EPROCESS)PsGetCurrentProcess())->VadRoot;
|
||||
AddressSpace = (PMADDRESS_SPACE)&(PsGetCurrentProcess())->VadRoot;
|
||||
}
|
||||
|
||||
if (!FromMdl)
|
||||
|
@ -304,7 +304,7 @@ MmNotPresentFault(KPROCESSOR_MODE Mode,
|
|||
}
|
||||
else
|
||||
{
|
||||
AddressSpace = (PMADDRESS_SPACE)&((PROS_EPROCESS)PsGetCurrentProcess())->VadRoot;
|
||||
AddressSpace = (PMADDRESS_SPACE)&(PsGetCurrentProcess())->VadRoot;
|
||||
}
|
||||
|
||||
if (!FromMdl)
|
||||
|
@ -357,7 +357,7 @@ MmNotPresentFault(KPROCESSOR_MODE Mode,
|
|||
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,
|
||||
|
|
|
@ -25,7 +25,7 @@ extern ULONG NtGlobalFlag;
|
|||
|
||||
PVOID
|
||||
STDCALL
|
||||
MiCreatePebOrTeb(PROS_EPROCESS Process,
|
||||
MiCreatePebOrTeb(PEPROCESS Process,
|
||||
PVOID BaseAddress)
|
||||
{
|
||||
NTSTATUS Status;
|
||||
|
@ -107,7 +107,7 @@ MmDeleteKernelStack(PVOID Stack,
|
|||
|
||||
VOID
|
||||
STDCALL
|
||||
MmDeleteTeb(PROS_EPROCESS Process,
|
||||
MmDeleteTeb(PEPROCESS Process,
|
||||
PTEB Teb)
|
||||
{
|
||||
PMADDRESS_SPACE ProcessAddressSpace = (PMADDRESS_SPACE)&Process->VadRoot;
|
||||
|
@ -220,7 +220,7 @@ MmGrowKernelStack(PVOID StackPointer)
|
|||
|
||||
NTSTATUS
|
||||
STDCALL
|
||||
MmCreatePeb(PROS_EPROCESS Process)
|
||||
MmCreatePeb(PEPROCESS Process)
|
||||
{
|
||||
PPEB Peb = NULL;
|
||||
LARGE_INTEGER SectionOffset;
|
||||
|
@ -370,7 +370,7 @@ MmCreatePeb(PROS_EPROCESS Process)
|
|||
|
||||
PTEB
|
||||
STDCALL
|
||||
MmCreateTeb(PROS_EPROCESS Process,
|
||||
MmCreateTeb(PEPROCESS Process,
|
||||
PCLIENT_ID ClientId,
|
||||
PINITIAL_TEB InitialTeb)
|
||||
{
|
||||
|
@ -379,7 +379,7 @@ MmCreateTeb(PROS_EPROCESS Process,
|
|||
|
||||
/* 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 @@ MmCreateTeb(PROS_EPROCESS Process,
|
|||
|
||||
NTSTATUS
|
||||
STDCALL
|
||||
MmCreateProcessAddressSpace(IN PROS_EPROCESS Process,
|
||||
MmCreateProcessAddressSpace(IN PEPROCESS Process,
|
||||
IN PROS_SECTION_OBJECT Section OPTIONAL)
|
||||
{
|
||||
NTSTATUS Status;
|
||||
|
|
|
@ -62,7 +62,7 @@ MmWritePagePhysicalAddress(PFN_TYPE Page)
|
|||
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 @@ MmWritePagePhysicalAddress(PFN_TYPE Page)
|
|||
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 @@ MmPageOutPhysicalAddress(PFN_TYPE Page)
|
|||
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 @@ MmPageOutPhysicalAddress(PFN_TYPE Page)
|
|||
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 @@ MmSetCleanAllRmaps(PFN_TYPE Page)
|
|||
}
|
||||
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 @@ MmSetDirtyAllRmaps(PFN_TYPE Page)
|
|||
}
|
||||
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 @@ MmIsDirtyPageRmap(PFN_TYPE Page)
|
|||
}
|
||||
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 @@ MmIsDirtyPageRmap(PFN_TYPE Page)
|
|||
|
||||
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 @@ MmInsertRmap(PFN_TYPE Page, PROS_EPROCESS Process,
|
|||
ExReleaseFastMutex(&RmapListLock);
|
||||
if (Process == NULL)
|
||||
{
|
||||
Process = (PROS_EPROCESS)PsInitialSystemProcess;
|
||||
Process = PsInitialSystemProcess;
|
||||
}
|
||||
if (Process)
|
||||
{
|
||||
|
@ -448,7 +448,7 @@ MmInsertRmap(PFN_TYPE Page, PROS_EPROCESS Process,
|
|||
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 @@ MmDeleteAllRmaps(PFN_TYPE Page, PVOID Context,
|
|||
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 @@ MmDeleteAllRmaps(PFN_TYPE Page, PVOID Context,
|
|||
|
||||
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 @@ MmDeleteRmap(PFN_TYPE Page, PROS_EPROCESS Process,
|
|||
ExFreeToNPagedLookasideList(&RmapLookasideList, current_entry);
|
||||
if (Process == NULL)
|
||||
{
|
||||
Process = (PROS_EPROCESS)PsInitialSystemProcess;
|
||||
Process = PsInitialSystemProcess;
|
||||
}
|
||||
if (Process)
|
||||
{
|
||||
|
|
|
@ -1329,7 +1329,7 @@ MmAccessFaultSectionView(PMADDRESS_SPACE AddressSpace,
|
|||
}
|
||||
|
||||
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 @@ NtMapViewOfSection(IN HANDLE SectionHandle,
|
|||
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 @@ MmUnmapViewOfSection(PEPROCESS Process,
|
|||
|
||||
ASSERT(Process);
|
||||
|
||||
AddressSpace = (PMADDRESS_SPACE)&((PROS_EPROCESS)Process)->VadRoot;
|
||||
AddressSpace = (PMADDRESS_SPACE)&(Process)->VadRoot;
|
||||
|
||||
MmLockAddressSpace(AddressSpace);
|
||||
MemoryArea = MmLocateMemoryAreaByAddress(AddressSpace,
|
||||
|
@ -4432,7 +4432,7 @@ MmMapViewOfSection(IN PVOID SectionObject,
|
|||
|
||||
|
||||
Section = (PROS_SECTION_OBJECT)SectionObject;
|
||||
AddressSpace = (PMADDRESS_SPACE)&((PROS_EPROCESS)Process)->VadRoot;
|
||||
AddressSpace = (PMADDRESS_SPACE)&(Process)->VadRoot;
|
||||
|
||||
AllocationType |= (Section->AllocationAttributes & SEC_NO_CHANGE);
|
||||
|
||||
|
|
|
@ -119,7 +119,7 @@ MiQueryVirtualMemory (IN HANDLE ProcessHandle,
|
|||
OUT PULONG ResultLength)
|
||||
{
|
||||
NTSTATUS Status;
|
||||
PROS_EPROCESS Process;
|
||||
PEPROCESS Process;
|
||||
MEMORY_AREA* MemoryArea;
|
||||
PMADDRESS_SPACE AddressSpace;
|
||||
|
||||
|
@ -393,7 +393,7 @@ MiProtectVirtualMemory(IN PEPROCESS Process,
|
|||
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);
|
||||
|
|
|
@ -157,7 +157,7 @@ NtAssignProcessToJobObject (
|
|||
/* 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 @@ NtAssignProcessToJobObject (
|
|||
/* 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))
|
||||
{
|
||||
|
|
|
@ -165,7 +165,7 @@ PspDeleteProcess(PVOID ObjectBody)
|
|||
}
|
||||
|
||||
/* Delete the process lock */
|
||||
ExFreePool(((PROS_EPROCESS)Process)->LockEvent);
|
||||
ExFreePool(Process->LockEvent);
|
||||
|
||||
/* KDB hook */
|
||||
KDB_DELETEPROCESS_HOOK(Process);
|
||||
|
@ -174,7 +174,7 @@ PspDeleteProcess(PVOID ObjectBody)
|
|||
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 @@ PspExitThread(NTSTATUS ExitStatus)
|
|||
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 @@ PspExitThread(NTSTATUS ExitStatus)
|
|||
}
|
||||
|
||||
DPRINT("Decommit teb at %p\n", Teb);
|
||||
MmDeleteTeb((PROS_EPROCESS)CurrentProcess, Teb);
|
||||
MmDeleteTeb(CurrentProcess, Teb);
|
||||
CurrentThread->Tcb.Teb = NULL;
|
||||
}
|
||||
|
||||
|
@ -324,7 +324,7 @@ PspExitThread(NTSTATUS ExitStatus)
|
|||
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 @@ NtTerminateProcess(IN HANDLE ProcessHandle OPTIONAL,
|
|||
|
||||
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 @@ NtTerminateProcess(IN HANDLE ProcessHandle OPTIONAL,
|
|||
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 @@ NtTerminateProcess(IN HANDLE ProcessHandle OPTIONAL,
|
|||
}
|
||||
|
||||
/* 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 @@ NtTerminateThread(IN HANDLE ThreadHandle,
|
|||
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 @@ NtTerminateThread(IN HANDLE ThreadHandle,
|
|||
PspTerminateThreadByPointer(Thread, ExitStatus);
|
||||
}
|
||||
|
||||
PsUnlockProcess((PROS_EPROCESS)Thread->ThreadsProcess);
|
||||
PsUnlockProcess(Thread->ThreadsProcess);
|
||||
|
||||
/* Dereference the Thread and return */
|
||||
ObDereferenceObject(Thread);
|
||||
|
|
|
@ -35,7 +35,7 @@ LARGE_INTEGER ShortPsLockDelay, PsLockTimeout;
|
|||
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
PsLockProcess(PROS_EPROCESS Process, BOOLEAN Timeout)
|
||||
PsLockProcess(PEPROCESS Process, BOOLEAN Timeout)
|
||||
{
|
||||
ULONG Attempts = 0;
|
||||
PKTHREAD PrevLockOwner;
|
||||
|
@ -94,7 +94,7 @@ PsLockProcess(PROS_EPROCESS Process, BOOLEAN Timeout)
|
|||
|
||||
VOID
|
||||
NTAPI
|
||||
PsUnlockProcess(PROS_EPROCESS Process)
|
||||
PsUnlockProcess(PEPROCESS Process)
|
||||
{
|
||||
PAGED_CODE();
|
||||
|
||||
|
@ -292,7 +292,7 @@ PspCreateProcess(OUT PHANDLE ProcessHandle,
|
|||
ObjectAttributes,
|
||||
PreviousMode,
|
||||
NULL,
|
||||
sizeof(ROS_EPROCESS),
|
||||
sizeof(EPROCESS),
|
||||
0,
|
||||
0,
|
||||
(PVOID*)&Process);
|
||||
|
@ -305,7 +305,7 @@ PspCreateProcess(OUT PHANDLE ProcessHandle,
|
|||
|
||||
/* 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 @@ PspCreateProcess(OUT PHANDLE ProcessHandle,
|
|||
|
||||
/* 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 @@ PspCreateProcess(OUT PHANDLE ProcessHandle,
|
|||
|
||||
/* 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 @@ PspCreateProcess(OUT PHANDLE ProcessHandle,
|
|||
|
||||
/* 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 @@ PspCreateProcess(OUT PHANDLE ProcessHandle,
|
|||
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);
|
||||
|
|
|
@ -158,7 +158,7 @@ PsInitProcessManagment(VOID)
|
|||
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 @@ PsInitProcessManagment(VOID)
|
|||
NULL,
|
||||
KernelMode,
|
||||
NULL,
|
||||
sizeof(ROS_EPROCESS),
|
||||
sizeof(EPROCESS),
|
||||
0,
|
||||
0,
|
||||
(PVOID*)&PsIdleProcess);
|
||||
|
@ -196,7 +196,7 @@ PsInitProcessManagment(VOID)
|
|||
return;
|
||||
}
|
||||
|
||||
RtlZeroMemory(PsIdleProcess, sizeof(ROS_EPROCESS));
|
||||
RtlZeroMemory(PsIdleProcess, sizeof(EPROCESS));
|
||||
|
||||
PsIdleProcess->Pcb.Affinity = 0xFFFFFFFF;
|
||||
PsIdleProcess->Pcb.IopmOffset = 0xffff;
|
||||
|
@ -207,7 +207,7 @@ PsInitProcessManagment(VOID)
|
|||
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 @@ PsInitProcessManagment(VOID)
|
|||
NULL,
|
||||
KernelMode,
|
||||
NULL,
|
||||
sizeof(ROS_EPROCESS),
|
||||
sizeof(EPROCESS),
|
||||
0,
|
||||
0,
|
||||
(PVOID*)&PsInitialSystemProcess);
|
||||
|
@ -233,7 +233,7 @@ PsInitProcessManagment(VOID)
|
|||
}
|
||||
|
||||
/* 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 @@ PsInitProcessManagment(VOID)
|
|||
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);
|
||||
MmInitializeAddressSpace(PsInitialSystemProcess,
|
||||
(PMADDRESS_SPACE)&(PsInitialSystemProcess)->VadRoot);
|
||||
|
||||
((PROS_EPROCESS)PsInitialSystemProcess)->LockEvent =
|
||||
(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 =
|
||||
|
|
|
@ -653,7 +653,7 @@ NtSetInformationProcess(IN HANDLE ProcessHandle,
|
|||
{
|
||||
/* 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 @@ NtSetInformationProcess(IN HANDLE ProcessHandle,
|
|||
ObDereferenceObject(ExceptionPort);
|
||||
Status = STATUS_PORT_ALREADY_SET;
|
||||
}
|
||||
PsUnlockProcess((PROS_EPROCESS)Process);
|
||||
PsUnlockProcess(Process);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -758,7 +758,7 @@ NtSetInformationProcess(IN HANDLE ProcessHandle,
|
|||
|
||||
/* 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 @@ NtSetInformationProcess(IN HANDLE ProcessHandle,
|
|||
KeDetachProcess();
|
||||
}
|
||||
|
||||
PsUnlockProcess((PROS_EPROCESS)Process);
|
||||
PsUnlockProcess(Process);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -220,7 +220,7 @@ PspCreateThread(OUT PHANDLE ThreadHandle,
|
|||
|
||||
/* 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);
|
||||
|
|
Loading…
Reference in a new issue