1998-09-05 17:34:23 +00:00
|
|
|
#ifndef __INCLUDE_INTERNAL_MM_H
|
|
|
|
#define __INCLUDE_INTERNAL_MM_H
|
1998-08-25 04:27:41 +00:00
|
|
|
|
2001-03-16 18:11:24 +00:00
|
|
|
#include <internal/arch/mm.h>
|
1998-08-25 04:27:41 +00:00
|
|
|
|
1998-09-05 17:34:23 +00:00
|
|
|
/* TYPES *********************************************************************/
|
|
|
|
|
2006-05-18 20:32:17 +00:00
|
|
|
struct _EPROCESS;
|
2006-05-10 17:47:44 +00:00
|
|
|
|
2004-04-22 01:57:49 +00:00
|
|
|
extern ULONG MiFreeSwapPages;
|
|
|
|
extern ULONG MiUsedSwapPages;
|
|
|
|
extern ULONG MmPagedPoolSize;
|
2004-08-08 20:33:17 +00:00
|
|
|
extern ULONG MmTotalPagedPoolQuota;
|
|
|
|
extern ULONG MmTotalNonPagedPoolQuota;
|
2005-09-14 01:05:50 +00:00
|
|
|
extern PHYSICAL_ADDRESS MmSharedDataPagePhysicalAddress;
|
2007-09-27 18:07:44 +00:00
|
|
|
extern ULONG MmNumberOfPhysicalPages;
|
2005-09-14 01:05:50 +00:00
|
|
|
|
|
|
|
extern PVOID MmPagedPoolBase;
|
|
|
|
extern ULONG MmPagedPoolSize;
|
2004-04-14 07:11:20 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
struct _KTRAP_FRAME;
|
2000-07-04 08:52:47 +00:00
|
|
|
struct _EPROCESS;
|
2001-12-31 01:53:46 +00:00
|
|
|
struct _MM_RMAP_ENTRY;
|
2005-09-14 01:05:50 +00:00
|
|
|
struct _MM_PAGEOP;
|
2002-05-14 21:19:21 +00:00
|
|
|
typedef ULONG SWAPENTRY;
|
2004-08-01 07:24:59 +00:00
|
|
|
typedef ULONG PFN_TYPE, *PPFN_TYPE;
|
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
#define MEMORY_AREA_INVALID (0)
|
|
|
|
#define MEMORY_AREA_SECTION_VIEW (1)
|
|
|
|
#define MEMORY_AREA_CONTINUOUS_MEMORY (2)
|
|
|
|
#define MEMORY_AREA_NO_CACHE (3)
|
|
|
|
#define MEMORY_AREA_IO_MAPPING (4)
|
|
|
|
#define MEMORY_AREA_SYSTEM (5)
|
|
|
|
#define MEMORY_AREA_MDL_MAPPING (7)
|
|
|
|
#define MEMORY_AREA_VIRTUAL_MEMORY (8)
|
|
|
|
#define MEMORY_AREA_CACHE_SEGMENT (9)
|
|
|
|
#define MEMORY_AREA_SHARED_DATA (10)
|
|
|
|
#define MEMORY_AREA_KERNEL_STACK (11)
|
|
|
|
#define MEMORY_AREA_PAGED_POOL (12)
|
|
|
|
#define MEMORY_AREA_NO_ACCESS (13)
|
|
|
|
#define MEMORY_AREA_PEB_OR_TEB (14)
|
|
|
|
|
|
|
|
#define MM_PHYSICAL_PAGE_MPW_PENDING (0x8)
|
|
|
|
|
|
|
|
#define MM_CORE_DUMP_TYPE_NONE (0x0)
|
|
|
|
#define MM_CORE_DUMP_TYPE_MINIMAL (0x1)
|
|
|
|
#define MM_CORE_DUMP_TYPE_FULL (0x2)
|
|
|
|
|
|
|
|
#define MM_PAGEOP_PAGEIN (1)
|
|
|
|
#define MM_PAGEOP_PAGEOUT (2)
|
|
|
|
#define MM_PAGEOP_PAGESYNCH (3)
|
|
|
|
#define MM_PAGEOP_ACCESSFAULT (4)
|
1998-09-05 17:34:23 +00:00
|
|
|
|
2000-05-24 22:29:38 +00:00
|
|
|
#define PAGE_TO_SECTION_PAGE_DIRECTORY_OFFSET(x) \
|
2005-09-14 01:05:50 +00:00
|
|
|
((x) / (4*1024*1024))
|
|
|
|
|
2000-05-24 22:29:38 +00:00
|
|
|
#define PAGE_TO_SECTION_PAGE_TABLE_OFFSET(x) \
|
2005-09-14 01:05:50 +00:00
|
|
|
((((x)) % (4*1024*1024)) / (4*1024))
|
2000-04-03 21:54:42 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
#define NR_SECTION_PAGE_TABLES 1024
|
|
|
|
#define NR_SECTION_PAGE_ENTRIES 1024
|
2000-04-03 21:54:42 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
#define TEB_BASE 0x7FFDE000
|
2005-06-25 14:04:56 +00:00
|
|
|
|
2005-06-25 17:01:17 +00:00
|
|
|
/* Although Microsoft says this isn't hardcoded anymore,
|
|
|
|
they won't be able to change it. Stuff depends on it */
|
2007-10-19 23:21:45 +00:00
|
|
|
#define MM_VIRTMEM_GRANULARITY (64 * 1024)
|
2004-09-28 19:49:21 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
#define STATUS_MM_RESTART_OPERATION ((NTSTATUS)0xD0000001)
|
2000-12-28 03:38:08 +00:00
|
|
|
|
2001-01-08 02:14:06 +00:00
|
|
|
/*
|
|
|
|
* Additional flags for protection attributes
|
|
|
|
*/
|
2005-09-14 01:05:50 +00:00
|
|
|
#define PAGE_WRITETHROUGH (1024)
|
|
|
|
#define PAGE_SYSTEM (2048)
|
|
|
|
|
|
|
|
#define SEC_PHYSICALMEMORY (0x80000000)
|
|
|
|
|
|
|
|
#define MM_PAGEFILE_SEGMENT (0x1)
|
|
|
|
#define MM_DATAFILE_SEGMENT (0x2)
|
|
|
|
|
|
|
|
#define MC_CACHE (0)
|
|
|
|
#define MC_USER (1)
|
|
|
|
#define MC_PPOOL (2)
|
|
|
|
#define MC_NPPOOL (3)
|
|
|
|
#define MC_MAXIMUM (4)
|
|
|
|
|
|
|
|
#define PAGED_POOL_MASK 1
|
|
|
|
#define MUST_SUCCEED_POOL_MASK 2
|
|
|
|
#define CACHE_ALIGNED_POOL_MASK 4
|
|
|
|
#define QUOTA_POOL_MASK 8
|
|
|
|
#define SESSION_POOL_MASK 32
|
|
|
|
#define VERIFIER_POOL_MASK 64
|
|
|
|
|
|
|
|
#define MM_PAGED_POOL_SIZE (100*1024*1024)
|
|
|
|
#define MM_NONPAGED_POOL_SIZE (100*1024*1024)
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Paged and non-paged pools are 8-byte aligned
|
|
|
|
*/
|
|
|
|
#define MM_POOL_ALIGNMENT 8
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Maximum size of the kmalloc area (this is totally arbitary)
|
|
|
|
*/
|
|
|
|
#define MM_KERNEL_MAP_SIZE (16*1024*1024)
|
|
|
|
#define MM_KERNEL_MAP_BASE (0xf0c00000)
|
|
|
|
|
|
|
|
/*
|
|
|
|
* FIXME - different architectures have different cache line sizes...
|
|
|
|
*/
|
|
|
|
#define MM_CACHE_LINE_SIZE 32
|
|
|
|
|
|
|
|
#define MM_ROUND_UP(x,s) \
|
|
|
|
((PVOID)(((ULONG_PTR)(x)+(s)-1) & ~((ULONG_PTR)(s)-1)))
|
|
|
|
|
|
|
|
#define MM_ROUND_DOWN(x,s) \
|
|
|
|
((PVOID)(((ULONG_PTR)(x)) & ~((ULONG_PTR)(s)-1)))
|
|
|
|
|
|
|
|
#define PAGE_FLAGS_VALID_FROM_USER_MODE \
|
|
|
|
(PAGE_READONLY | \
|
|
|
|
PAGE_READWRITE | \
|
|
|
|
PAGE_WRITECOPY | \
|
|
|
|
PAGE_EXECUTE | \
|
|
|
|
PAGE_EXECUTE_READ | \
|
|
|
|
PAGE_EXECUTE_READWRITE | \
|
|
|
|
PAGE_EXECUTE_WRITECOPY | \
|
|
|
|
PAGE_GUARD | \
|
|
|
|
PAGE_NOACCESS | \
|
|
|
|
PAGE_NOCACHE)
|
|
|
|
|
|
|
|
#define PAGE_IS_READABLE \
|
|
|
|
(PAGE_READONLY | \
|
|
|
|
PAGE_READWRITE | \
|
|
|
|
PAGE_WRITECOPY | \
|
|
|
|
PAGE_EXECUTE_READ | \
|
|
|
|
PAGE_EXECUTE_READWRITE | \
|
|
|
|
PAGE_EXECUTE_WRITECOPY)
|
|
|
|
|
|
|
|
#define PAGE_IS_WRITABLE \
|
|
|
|
(PAGE_READWRITE | \
|
|
|
|
PAGE_WRITECOPY | \
|
|
|
|
PAGE_EXECUTE_READWRITE | \
|
|
|
|
PAGE_EXECUTE_WRITECOPY)
|
|
|
|
|
|
|
|
#define PAGE_IS_EXECUTABLE \
|
|
|
|
(PAGE_EXECUTE | \
|
|
|
|
PAGE_EXECUTE_READ | \
|
|
|
|
PAGE_EXECUTE_READWRITE | \
|
|
|
|
PAGE_EXECUTE_WRITECOPY)
|
|
|
|
|
|
|
|
#define PAGE_IS_WRITECOPY \
|
|
|
|
(PAGE_WRITECOPY | \
|
|
|
|
PAGE_EXECUTE_WRITECOPY)
|
2004-12-30 08:05:12 +00:00
|
|
|
|
2000-04-03 21:54:42 +00:00
|
|
|
typedef struct
|
|
|
|
{
|
2005-09-14 01:05:50 +00:00
|
|
|
ULONG Entry[NR_SECTION_PAGE_ENTRIES];
|
2000-04-03 21:54:42 +00:00
|
|
|
} SECTION_PAGE_TABLE, *PSECTION_PAGE_TABLE;
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
2005-09-14 01:05:50 +00:00
|
|
|
PSECTION_PAGE_TABLE PageTables[NR_SECTION_PAGE_TABLES];
|
2000-04-03 21:54:42 +00:00
|
|
|
} SECTION_PAGE_DIRECTORY, *PSECTION_PAGE_DIRECTORY;
|
|
|
|
|
2001-02-10 22:51:11 +00:00
|
|
|
typedef struct _MM_SECTION_SEGMENT
|
2001-01-12 21:00:08 +00:00
|
|
|
{
|
2007-10-19 23:21:45 +00:00
|
|
|
LONG FileOffset; /* start offset into the file for image sections */
|
2006-07-09 19:37:39 +00:00
|
|
|
ULONG_PTR VirtualAddress; /* dtart offset into the address range for image sections */
|
|
|
|
ULONG RawLength; /* length of the segment which is part of the mapped file */
|
|
|
|
ULONG Length; /* absolute length of the segment */
|
2005-09-14 01:05:50 +00:00
|
|
|
ULONG Protection;
|
2006-07-09 19:37:39 +00:00
|
|
|
FAST_MUTEX Lock; /* lock which protects the page directory */
|
2005-09-14 01:05:50 +00:00
|
|
|
ULONG ReferenceCount;
|
|
|
|
SECTION_PAGE_DIRECTORY PageDirectory;
|
|
|
|
ULONG Flags;
|
|
|
|
ULONG Characteristics;
|
|
|
|
BOOLEAN WriteCopy;
|
2001-02-10 22:51:11 +00:00
|
|
|
} MM_SECTION_SEGMENT, *PMM_SECTION_SEGMENT;
|
2001-01-12 21:00:08 +00:00
|
|
|
|
2003-06-27 21:28:30 +00:00
|
|
|
typedef struct _MM_IMAGE_SECTION_OBJECT
|
1998-08-25 04:27:41 +00:00
|
|
|
{
|
2005-09-14 01:05:50 +00:00
|
|
|
ULONG_PTR ImageBase;
|
|
|
|
ULONG_PTR StackReserve;
|
|
|
|
ULONG_PTR StackCommit;
|
|
|
|
ULONG_PTR EntryPoint;
|
2007-08-05 11:27:39 +00:00
|
|
|
USHORT Subsystem;
|
|
|
|
USHORT ImageCharacteristics;
|
2005-09-14 01:05:50 +00:00
|
|
|
USHORT MinorSubsystemVersion;
|
|
|
|
USHORT MajorSubsystemVersion;
|
|
|
|
USHORT Machine;
|
|
|
|
BOOLEAN Executable;
|
|
|
|
ULONG NrSegments;
|
2007-02-23 15:31:45 +00:00
|
|
|
ULONG ImageSize;
|
2005-09-14 01:05:50 +00:00
|
|
|
PMM_SECTION_SEGMENT Segments;
|
2003-06-27 21:28:30 +00:00
|
|
|
} MM_IMAGE_SECTION_OBJECT, *PMM_IMAGE_SECTION_OBJECT;
|
|
|
|
|
2006-05-10 17:47:44 +00:00
|
|
|
typedef struct _ROS_SECTION_OBJECT
|
2003-06-27 21:28:30 +00:00
|
|
|
{
|
2005-09-14 01:05:50 +00:00
|
|
|
CSHORT Type;
|
|
|
|
CSHORT Size;
|
|
|
|
LARGE_INTEGER MaximumSize;
|
|
|
|
ULONG SectionPageProtection;
|
|
|
|
ULONG AllocationAttributes;
|
|
|
|
PFILE_OBJECT FileObject;
|
|
|
|
union
|
|
|
|
{
|
|
|
|
PMM_IMAGE_SECTION_OBJECT ImageSection;
|
|
|
|
PMM_SECTION_SEGMENT Segment;
|
|
|
|
};
|
2006-05-10 17:47:44 +00:00
|
|
|
} ROS_SECTION_OBJECT, *PROS_SECTION_OBJECT;
|
2003-06-01 14:59:02 +00:00
|
|
|
|
2005-01-02 17:55:06 +00:00
|
|
|
typedef struct _MEMORY_AREA
|
1998-09-05 17:34:23 +00:00
|
|
|
{
|
2005-09-14 01:05:50 +00:00
|
|
|
PVOID StartingAddress;
|
|
|
|
PVOID EndingAddress;
|
|
|
|
struct _MEMORY_AREA *Parent;
|
|
|
|
struct _MEMORY_AREA *LeftChild;
|
|
|
|
struct _MEMORY_AREA *RightChild;
|
|
|
|
ULONG Type;
|
2005-11-13 17:28:24 +00:00
|
|
|
ULONG Protect;
|
|
|
|
ULONG Flags;
|
2005-09-14 01:05:50 +00:00
|
|
|
BOOLEAN DeleteInProgress;
|
|
|
|
ULONG PageOpCount;
|
|
|
|
union
|
2002-06-11 22:09:03 +00:00
|
|
|
{
|
2005-09-14 01:05:50 +00:00
|
|
|
struct
|
|
|
|
{
|
2006-05-10 17:47:44 +00:00
|
|
|
ROS_SECTION_OBJECT* Section;
|
2005-09-14 01:05:50 +00:00
|
|
|
ULONG ViewOffset;
|
|
|
|
PMM_SECTION_SEGMENT Segment;
|
|
|
|
BOOLEAN WriteCopyView;
|
|
|
|
LIST_ENTRY RegionListHead;
|
|
|
|
} SectionData;
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
LIST_ENTRY RegionListHead;
|
|
|
|
} VirtualMemoryData;
|
|
|
|
} Data;
|
1998-10-05 04:01:30 +00:00
|
|
|
} MEMORY_AREA, *PMEMORY_AREA;
|
1998-09-05 17:34:23 +00:00
|
|
|
|
2002-09-08 10:23:54 +00:00
|
|
|
typedef struct _MADDRESS_SPACE
|
|
|
|
{
|
2005-09-14 01:05:50 +00:00
|
|
|
PMEMORY_AREA MemoryAreaRoot;
|
|
|
|
PVOID LowestAddress;
|
2006-05-18 20:32:17 +00:00
|
|
|
struct _EPROCESS* Process;
|
2005-09-14 01:05:50 +00:00
|
|
|
PUSHORT PageTableRefCountTable;
|
|
|
|
ULONG PageTableRefCountTableSize;
|
2002-09-08 10:23:54 +00:00
|
|
|
} MADDRESS_SPACE, *PMADDRESS_SPACE;
|
|
|
|
|
2004-08-01 07:24:59 +00:00
|
|
|
typedef struct
|
|
|
|
{
|
2005-09-14 01:05:50 +00:00
|
|
|
ULONG NrTotalPages;
|
|
|
|
ULONG NrSystemPages;
|
|
|
|
ULONG NrUserPages;
|
|
|
|
ULONG NrFreePages;
|
|
|
|
ULONG NrDirtyPages;
|
|
|
|
ULONG NrLockedPages;
|
|
|
|
ULONG PagingRequestsInLastMinute;
|
|
|
|
ULONG PagingRequestsInLastFiveMinutes;
|
|
|
|
ULONG PagingRequestsInLastFifteenMinutes;
|
2004-08-01 07:24:59 +00:00
|
|
|
} MM_STATS;
|
|
|
|
|
|
|
|
extern MM_STATS MmStats;
|
|
|
|
|
|
|
|
typedef struct _MM_PAGEOP
|
|
|
|
{
|
|
|
|
/* Type of operation. */
|
2005-05-09 01:38:29 +00:00
|
|
|
ULONG OpType;
|
2004-08-01 07:24:59 +00:00
|
|
|
/* Number of threads interested in this operation. */
|
|
|
|
ULONG ReferenceCount;
|
|
|
|
/* Event that will be set when the operation is completed. */
|
|
|
|
KEVENT CompletionEvent;
|
|
|
|
/* Status of the operation once it is completed. */
|
|
|
|
NTSTATUS Status;
|
|
|
|
/* TRUE if the operation was abandoned. */
|
|
|
|
BOOLEAN Abandoned;
|
|
|
|
/* The memory area to be affected by the operation. */
|
|
|
|
PMEMORY_AREA MArea;
|
|
|
|
ULONG Hash;
|
|
|
|
struct _MM_PAGEOP* Next;
|
|
|
|
struct _ETHREAD* Thread;
|
2005-05-09 01:38:29 +00:00
|
|
|
/*
|
2004-08-01 07:24:59 +00:00
|
|
|
* These fields are used to identify the operation if it is against a
|
|
|
|
* virtual memory area.
|
|
|
|
*/
|
2005-01-26 00:03:05 +00:00
|
|
|
HANDLE Pid;
|
2004-08-01 07:24:59 +00:00
|
|
|
PVOID Address;
|
|
|
|
/*
|
|
|
|
* These fields are used to identify the operation if it is against a
|
|
|
|
* section mapping.
|
|
|
|
*/
|
|
|
|
PMM_SECTION_SEGMENT Segment;
|
|
|
|
ULONG Offset;
|
|
|
|
} MM_PAGEOP, *PMM_PAGEOP;
|
|
|
|
|
|
|
|
typedef struct _MM_MEMORY_CONSUMER
|
|
|
|
{
|
2005-09-14 01:05:50 +00:00
|
|
|
ULONG PagesUsed;
|
|
|
|
ULONG PagesTarget;
|
|
|
|
NTSTATUS (*Trim)(ULONG Target, ULONG Priority, PULONG NrFreed);
|
|
|
|
} MM_MEMORY_CONSUMER, *PMM_MEMORY_CONSUMER;
|
2004-08-01 07:24:59 +00:00
|
|
|
|
|
|
|
typedef struct _MM_REGION
|
|
|
|
{
|
2005-09-14 01:05:50 +00:00
|
|
|
ULONG Type;
|
|
|
|
ULONG Protect;
|
|
|
|
ULONG Length;
|
|
|
|
LIST_ENTRY RegionListEntry;
|
2004-08-01 07:24:59 +00:00
|
|
|
} MM_REGION, *PMM_REGION;
|
2003-05-17 19:16:39 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
extern MM_MEMORY_CONSUMER MiMemoryConsumers[MC_MAXIMUM];
|
2005-06-25 17:01:17 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
typedef VOID
|
|
|
|
(*PMM_ALTER_REGION_FUNC)(
|
|
|
|
PMADDRESS_SPACE AddressSpace,
|
|
|
|
PVOID BaseAddress,
|
|
|
|
ULONG Length,
|
|
|
|
ULONG OldType,
|
|
|
|
ULONG OldProtect,
|
|
|
|
ULONG NewType,
|
|
|
|
ULONG NewProtect
|
|
|
|
);
|
|
|
|
|
|
|
|
typedef VOID
|
|
|
|
(*PMM_FREE_PAGE_FUNC)(
|
|
|
|
PVOID Context,
|
|
|
|
PMEMORY_AREA MemoryArea,
|
|
|
|
PVOID Address,
|
|
|
|
PFN_TYPE Page,
|
|
|
|
SWAPENTRY SwapEntry,
|
|
|
|
BOOLEAN Dirty
|
|
|
|
);
|
2005-06-25 17:01:17 +00:00
|
|
|
|
2004-08-01 07:24:59 +00:00
|
|
|
/* aspace.c ******************************************************************/
|
|
|
|
|
2007-10-19 23:21:45 +00:00
|
|
|
VOID
|
2005-09-14 01:05:50 +00:00
|
|
|
NTAPI
|
|
|
|
MmLockAddressSpace(PMADDRESS_SPACE AddressSpace);
|
2004-08-01 07:24:59 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
MmUnlockAddressSpace(PMADDRESS_SPACE AddressSpace);
|
2004-08-01 07:24:59 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
MmInitializeKernelAddressSpace(VOID);
|
2004-08-01 07:24:59 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
PMADDRESS_SPACE
|
|
|
|
NTAPI
|
|
|
|
MmGetCurrentAddressSpace(VOID);
|
2004-08-01 07:24:59 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
PMADDRESS_SPACE
|
|
|
|
NTAPI
|
|
|
|
MmGetKernelAddressSpace(VOID);
|
2004-08-01 07:24:59 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
MmInitializeAddressSpace(
|
2006-05-18 20:32:17 +00:00
|
|
|
struct _EPROCESS* Process,
|
2005-09-14 01:05:50 +00:00
|
|
|
PMADDRESS_SPACE AddressSpace);
|
2004-08-01 07:24:59 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
MmDestroyAddressSpace(PMADDRESS_SPACE AddressSpace);
|
2004-08-01 07:24:59 +00:00
|
|
|
|
|
|
|
/* marea.c *******************************************************************/
|
|
|
|
|
2005-06-25 17:01:17 +00:00
|
|
|
NTSTATUS
|
2005-09-14 01:05:50 +00:00
|
|
|
NTAPI
|
2005-01-02 17:55:06 +00:00
|
|
|
MmInitMemoryAreas(VOID);
|
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
NTSTATUS
|
2006-09-06 12:19:00 +00:00
|
|
|
NTAPI
|
2005-01-02 17:55:06 +00:00
|
|
|
MmCreateMemoryArea(
|
2005-09-14 01:05:50 +00:00
|
|
|
PMADDRESS_SPACE AddressSpace,
|
|
|
|
ULONG Type,
|
|
|
|
PVOID *BaseAddress,
|
|
|
|
ULONG_PTR Length,
|
2005-11-13 17:28:24 +00:00
|
|
|
ULONG Protection,
|
2005-09-14 01:05:50 +00:00
|
|
|
PMEMORY_AREA *Result,
|
|
|
|
BOOLEAN FixedAddress,
|
2005-11-13 17:28:24 +00:00
|
|
|
ULONG AllocationFlags,
|
2005-09-14 01:05:50 +00:00
|
|
|
PHYSICAL_ADDRESS BoundaryAddressMultiple OPTIONAL
|
|
|
|
);
|
|
|
|
|
|
|
|
PMEMORY_AREA
|
2006-09-06 12:19:00 +00:00
|
|
|
NTAPI
|
2005-01-02 19:14:52 +00:00
|
|
|
MmLocateMemoryAreaByAddress(
|
2005-09-14 01:05:50 +00:00
|
|
|
PMADDRESS_SPACE AddressSpace,
|
|
|
|
PVOID Address
|
|
|
|
);
|
2005-01-02 17:55:06 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
ULONG_PTR
|
2006-09-06 12:19:00 +00:00
|
|
|
NTAPI
|
2005-01-02 17:55:06 +00:00
|
|
|
MmFindGapAtAddress(
|
2005-09-14 01:05:50 +00:00
|
|
|
PMADDRESS_SPACE AddressSpace,
|
|
|
|
PVOID Address
|
|
|
|
);
|
2005-01-02 17:55:06 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
NTSTATUS
|
2006-09-06 12:19:00 +00:00
|
|
|
NTAPI
|
2005-01-02 17:55:06 +00:00
|
|
|
MmFreeMemoryArea(
|
2005-09-14 01:05:50 +00:00
|
|
|
PMADDRESS_SPACE AddressSpace,
|
|
|
|
PMEMORY_AREA MemoryArea,
|
|
|
|
PMM_FREE_PAGE_FUNC FreePage,
|
|
|
|
PVOID FreePageContext
|
|
|
|
);
|
2005-01-02 17:55:06 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
NTSTATUS
|
2006-09-06 12:19:00 +00:00
|
|
|
NTAPI
|
2005-01-02 17:55:06 +00:00
|
|
|
MmFreeMemoryAreaByPtr(
|
2005-09-14 01:05:50 +00:00
|
|
|
PMADDRESS_SPACE AddressSpace,
|
|
|
|
PVOID BaseAddress,
|
|
|
|
PMM_FREE_PAGE_FUNC FreePage,
|
|
|
|
PVOID FreePageContext
|
|
|
|
);
|
2005-01-02 17:55:06 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
VOID
|
2006-09-06 12:19:00 +00:00
|
|
|
NTAPI
|
2005-01-02 17:55:06 +00:00
|
|
|
MmDumpMemoryAreas(PMADDRESS_SPACE AddressSpace);
|
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
PMEMORY_AREA
|
2006-09-06 12:19:00 +00:00
|
|
|
NTAPI
|
2005-01-02 19:14:52 +00:00
|
|
|
MmLocateMemoryAreaByRegion(
|
2005-09-14 01:05:50 +00:00
|
|
|
PMADDRESS_SPACE AddressSpace,
|
|
|
|
PVOID Address,
|
|
|
|
ULONG_PTR Length
|
|
|
|
);
|
2005-01-02 17:55:06 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
PVOID
|
2006-09-06 12:19:00 +00:00
|
|
|
NTAPI
|
2005-01-02 17:55:06 +00:00
|
|
|
MmFindGap(
|
2005-09-14 01:05:50 +00:00
|
|
|
PMADDRESS_SPACE AddressSpace,
|
|
|
|
ULONG_PTR Length,
|
|
|
|
ULONG_PTR Granularity,
|
|
|
|
BOOLEAN TopDown
|
|
|
|
);
|
2005-01-02 17:55:06 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
VOID
|
2006-09-06 12:19:00 +00:00
|
|
|
NTAPI
|
2005-01-02 17:55:06 +00:00
|
|
|
MmReleaseMemoryAreaIfDecommitted(
|
2006-05-18 20:32:17 +00:00
|
|
|
struct _EPROCESS *Process,
|
2005-09-14 01:05:50 +00:00
|
|
|
PMADDRESS_SPACE AddressSpace,
|
|
|
|
PVOID BaseAddress
|
|
|
|
);
|
2004-10-01 20:26:05 +00:00
|
|
|
|
2004-08-01 07:24:59 +00:00
|
|
|
/* npool.c *******************************************************************/
|
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
MiDebugDumpNonPagedPool(BOOLEAN NewOnly);
|
2004-08-01 07:24:59 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
MiDebugDumpNonPagedPoolStats(BOOLEAN NewOnly);
|
2004-08-01 07:24:59 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
MiInitializeNonPagedPool(VOID);
|
1999-12-02 20:53:55 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
PVOID
|
|
|
|
NTAPI
|
|
|
|
MmGetMdlPageAddress(
|
|
|
|
PMDL Mdl,
|
|
|
|
PVOID Offset
|
|
|
|
);
|
2004-08-01 07:24:59 +00:00
|
|
|
|
2004-08-08 20:33:17 +00:00
|
|
|
/* pool.c *******************************************************************/
|
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
PVOID
|
2006-09-06 12:19:00 +00:00
|
|
|
NTAPI
|
2005-09-14 01:05:50 +00:00
|
|
|
ExAllocateNonPagedPoolWithTag(
|
|
|
|
POOL_TYPE type,
|
|
|
|
ULONG size,
|
|
|
|
ULONG Tag,
|
|
|
|
PVOID Caller
|
|
|
|
);
|
|
|
|
|
|
|
|
PVOID
|
2006-09-06 12:19:00 +00:00
|
|
|
NTAPI
|
2005-09-14 01:05:50 +00:00
|
|
|
ExAllocatePagedPoolWithTag(
|
|
|
|
POOL_TYPE Type,
|
|
|
|
ULONG size,
|
|
|
|
ULONG Tag
|
|
|
|
);
|
|
|
|
|
|
|
|
VOID
|
2006-09-06 12:19:00 +00:00
|
|
|
NTAPI
|
2005-09-14 01:05:50 +00:00
|
|
|
ExFreeNonPagedPool(PVOID block);
|
|
|
|
|
2007-10-19 23:21:45 +00:00
|
|
|
VOID
|
2006-09-06 12:19:00 +00:00
|
|
|
NTAPI
|
2005-09-14 01:05:50 +00:00
|
|
|
ExFreePagedPool(IN PVOID Block);
|
|
|
|
|
2007-10-19 23:21:45 +00:00
|
|
|
VOID
|
2005-09-14 01:05:50 +00:00
|
|
|
NTAPI
|
|
|
|
MmInitializePagedPool(VOID);
|
|
|
|
|
|
|
|
PVOID
|
2006-09-06 12:19:00 +00:00
|
|
|
NTAPI
|
2005-09-14 01:05:50 +00:00
|
|
|
MiAllocateSpecialPool(
|
|
|
|
IN POOL_TYPE PoolType,
|
|
|
|
IN SIZE_T NumberOfBytes,
|
|
|
|
IN ULONG Tag,
|
|
|
|
IN ULONG Underrun
|
|
|
|
);
|
|
|
|
|
2004-08-08 20:33:17 +00:00
|
|
|
BOOLEAN
|
2006-09-06 12:19:00 +00:00
|
|
|
NTAPI
|
2004-08-08 20:33:17 +00:00
|
|
|
MiRaisePoolQuota(
|
|
|
|
IN POOL_TYPE PoolType,
|
|
|
|
IN ULONG CurrentMaxQuota,
|
|
|
|
OUT PULONG NewMaxQuota
|
2005-09-14 01:05:50 +00:00
|
|
|
);
|
2004-08-08 20:33:17 +00:00
|
|
|
|
2004-08-01 07:24:59 +00:00
|
|
|
/* mdl.c *********************************************************************/
|
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
MmBuildMdlFromPages(
|
|
|
|
PMDL Mdl,
|
|
|
|
PULONG Pages
|
|
|
|
);
|
2004-08-01 07:24:59 +00:00
|
|
|
|
|
|
|
/* mminit.c ******************************************************************/
|
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
MiShutdownMemoryManager(VOID);
|
2004-08-01 07:24:59 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
MmInit1(
|
|
|
|
ULONG_PTR FirstKernelPhysAddress,
|
|
|
|
ULONG_PTR LastKernelPhysAddress,
|
|
|
|
ULONG_PTR LastKernelAddress,
|
|
|
|
PADDRESS_RANGE BIOSMemoryMap,
|
|
|
|
ULONG AddressRangeCount,
|
|
|
|
ULONG MaxMemInMeg
|
|
|
|
);
|
2004-08-01 07:24:59 +00:00
|
|
|
|
2007-01-25 17:51:45 +00:00
|
|
|
BOOLEAN
|
2005-09-14 01:05:50 +00:00
|
|
|
NTAPI
|
2007-01-25 17:51:45 +00:00
|
|
|
MmInitSystem(IN ULONG Phase,
|
|
|
|
IN PLOADER_PARAMETER_BLOCK LoaderBlock);
|
2004-08-01 07:24:59 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
MiFreeInitMemory(VOID);
|
2004-08-01 07:24:59 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
MmInitializeMdlImplementation(VOID);
|
2004-08-01 07:24:59 +00:00
|
|
|
|
|
|
|
/* pagefile.c ****************************************************************/
|
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
SWAPENTRY
|
|
|
|
NTAPI
|
|
|
|
MmAllocSwapPage(VOID);
|
2004-08-01 07:24:59 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
MmDereserveSwapPages(ULONG Nr);
|
2004-08-01 07:24:59 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
MmFreeSwapPage(SWAPENTRY Entry);
|
2004-08-01 07:24:59 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
MmInitPagingFile(VOID);
|
1999-11-25 10:47:58 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
MmReadFromSwapPage(
|
|
|
|
SWAPENTRY SwapEntry,
|
|
|
|
PFN_TYPE Page
|
|
|
|
);
|
2004-08-01 07:24:59 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
BOOLEAN
|
|
|
|
NTAPI
|
|
|
|
MmReserveSwapPages(ULONG Nr);
|
2004-08-01 07:24:59 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
MmWriteToSwapPage(
|
|
|
|
SWAPENTRY SwapEntry,
|
|
|
|
PFN_TYPE Page
|
|
|
|
);
|
2004-08-01 07:24:59 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
NTSTATUS
|
2006-09-06 12:19:00 +00:00
|
|
|
NTAPI
|
2005-09-14 01:05:50 +00:00
|
|
|
MmDumpToPagingFile(
|
|
|
|
ULONG BugCode,
|
|
|
|
ULONG BugCodeParameter1,
|
|
|
|
ULONG BugCodeParameter2,
|
|
|
|
ULONG BugCodeParameter3,
|
|
|
|
ULONG BugCodeParameter4,
|
|
|
|
struct _KTRAP_FRAME* TrapFrame
|
|
|
|
);
|
2004-08-01 07:24:59 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
BOOLEAN
|
|
|
|
NTAPI
|
|
|
|
MmIsAvailableSwapPage(VOID);
|
2004-08-01 07:24:59 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
MmShowOutOfSpaceMessagePagingFile(VOID);
|
2004-08-01 07:24:59 +00:00
|
|
|
|
2005-04-18 00:42:31 +00:00
|
|
|
/* process.c ****************************************************************/
|
|
|
|
|
|
|
|
NTSTATUS
|
2006-09-06 12:19:00 +00:00
|
|
|
NTAPI
|
- PS_UNKNOWN_VALUE determines if the process should be created with large pages: rename to PS_LARGE_PAGES
- Do Address Space initialization as per "Windows Internals II" slides, either for the Boot, System, Cloned User or New User Process cases.
- Rename MmCreateProcessAddressSpace to MmInitializeProcessAddressSpace, and MmCopyMmInfo to MmCreateProcessAddressSpace. What ReactOS did is correct as per "Windows Internals II", but the names were inverted.
- Clone the Object Table if we are the boot process, and only initialize part of the address space (since we don't need things like guard page, TEB, etc), however, do initialize and map the shared user data section.
- Make the initial system process and idle process share the same page directory instead of creating a new one.
- Use the same priority class as the parent process, if the process was in the idle or below-normal priority class.
- Only duplicate handles if the caller requested it, instead of always duplicating the process's handles!
- Generate a null image file name for system processes.
- Rename ObpCreateHandleTable to ObInitProcess and better handle race and out-of-memory conditions. Detect if auditing required, but don't do anything about it.
- Initialize the Idle/System process address space much earlier in the boot process, in MmInitSystem.
Thanks to Alex for providing various information, and answering all my questions.
svn path=/trunk/; revision=29223
2007-09-26 20:55:26 +00:00
|
|
|
MmInitializeProcessAddressSpace(
|
2006-07-09 18:54:13 +00:00
|
|
|
IN PEPROCESS Process,
|
2007-09-27 18:07:44 +00:00
|
|
|
IN PEPROCESS Clone OPTIONAL,
|
- PS_UNKNOWN_VALUE determines if the process should be created with large pages: rename to PS_LARGE_PAGES
- Do Address Space initialization as per "Windows Internals II" slides, either for the Boot, System, Cloned User or New User Process cases.
- Rename MmCreateProcessAddressSpace to MmInitializeProcessAddressSpace, and MmCopyMmInfo to MmCreateProcessAddressSpace. What ReactOS did is correct as per "Windows Internals II", but the names were inverted.
- Clone the Object Table if we are the boot process, and only initialize part of the address space (since we don't need things like guard page, TEB, etc), however, do initialize and map the shared user data section.
- Make the initial system process and idle process share the same page directory instead of creating a new one.
- Use the same priority class as the parent process, if the process was in the idle or below-normal priority class.
- Only duplicate handles if the caller requested it, instead of always duplicating the process's handles!
- Generate a null image file name for system processes.
- Rename ObpCreateHandleTable to ObInitProcess and better handle race and out-of-memory conditions. Detect if auditing required, but don't do anything about it.
- Initialize the Idle/System process address space much earlier in the boot process, in MmInitSystem.
Thanks to Alex for providing various information, and answering all my questions.
svn path=/trunk/; revision=29223
2007-09-26 20:55:26 +00:00
|
|
|
IN PVOID Section OPTIONAL,
|
2007-09-27 18:07:44 +00:00
|
|
|
IN OUT PULONG Flags,
|
2006-07-27 00:22:36 +00:00
|
|
|
IN POBJECT_NAME_INFORMATION *AuditName OPTIONAL
|
2005-09-14 01:05:50 +00:00
|
|
|
);
|
2005-05-09 01:38:29 +00:00
|
|
|
|
2005-04-18 00:42:31 +00:00
|
|
|
NTSTATUS
|
2006-09-06 12:19:00 +00:00
|
|
|
NTAPI
|
2006-05-18 20:32:17 +00:00
|
|
|
MmCreatePeb(struct _EPROCESS *Process);
|
2005-04-18 00:42:31 +00:00
|
|
|
|
2006-07-09 18:54:13 +00:00
|
|
|
PTEB
|
2006-09-06 12:19:00 +00:00
|
|
|
NTAPI
|
2005-09-14 01:05:50 +00:00
|
|
|
MmCreateTeb(
|
2006-05-18 20:32:17 +00:00
|
|
|
struct _EPROCESS *Process,
|
2005-09-14 01:05:50 +00:00
|
|
|
PCLIENT_ID ClientId,
|
|
|
|
PINITIAL_TEB InitialTeb
|
|
|
|
);
|
2005-05-09 01:38:29 +00:00
|
|
|
|
2005-04-22 12:52:25 +00:00
|
|
|
VOID
|
2006-09-06 12:19:00 +00:00
|
|
|
NTAPI
|
2005-09-14 01:05:50 +00:00
|
|
|
MmDeleteTeb(
|
2006-05-18 20:32:17 +00:00
|
|
|
struct _EPROCESS *Process,
|
2006-07-09 18:54:13 +00:00
|
|
|
PTEB Teb
|
2005-09-14 01:05:50 +00:00
|
|
|
);
|
2005-04-22 12:52:25 +00:00
|
|
|
|
2006-07-09 18:54:13 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
MmCleanProcessAddressSpace(IN PEPROCESS Process);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
MmDeleteProcessAddressSpace(IN PEPROCESS Process);
|
|
|
|
|
|
|
|
ULONG
|
|
|
|
NTAPI
|
|
|
|
MmGetSessionLocaleId(VOID);
|
|
|
|
|
2006-07-21 19:28:38 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
MmSetMemoryPriorityProcess(
|
|
|
|
IN PEPROCESS Process,
|
|
|
|
IN UCHAR MemoryPriority
|
|
|
|
);
|
|
|
|
|
2004-08-01 07:24:59 +00:00
|
|
|
/* i386/pfault.c *************************************************************/
|
2000-04-02 13:32:43 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
MmPageFault(
|
|
|
|
ULONG Cs,
|
|
|
|
PULONG Eip,
|
|
|
|
PULONG Eax,
|
|
|
|
ULONG Cr2,
|
|
|
|
ULONG ErrorCode
|
|
|
|
);
|
2000-04-07 02:24:03 +00:00
|
|
|
|
2004-08-01 07:24:59 +00:00
|
|
|
/* mm.c **********************************************************************/
|
2000-04-07 02:24:03 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
MmAccessFault(
|
- Fix critical bugs in exception handling: Unwinding was completely broken, using the wrong SEH protector to detect collided unwinding. The correct protector itself also had a broken check.
- Fix architectural bug in the entire TrapFrame<->Context conversion system and Ring Privilege Transitions (Inter-ring and intra-ring) which was lacking proper sanitation and validation of segments, flags and debug registers. Among other things, IOPL is now respected, CS is not KGDT_R0_CODE | RPL_MASK anymore, and the GPF code is now properly being called. This completely fixes exception handling being totally broken and crashing firefox installer, mirc, and other applications.
- Rewrite the page fault handler base code in assembly instead of relying on a broken C routine. Detect VDM, V8086, detecting expected/normal fault in ExpInterlockedPopEntrySList and faults in the system handler code. Rewrite MmAccessFault to be the main function that calls out to other sub-fault functions, and use the same prototype as NT.
- Fix the KGDT boot table to have proper granularity and big flags, and extend it to 256 entries.
- Create proper thread context in RtlInitializeContext and cleanup Rtl Thread routines.
- Remove all int3 and breakpoints from trap handlers, and replace them with a much better "UNHANDLED_PATH" macro which freezes the system, beeps, and displays a message with the line of code that's unhandled. This is to clearly tell the user that something is unhandled, instead of nesting infinite exceptions due to the int3.
- Fix a bug in INT_PROLOG.
- Sanitize EFLAGS and Code Segments in KeContextToTrapFrame and KeTrapFrameToContext.
- Implement KiUpdateDr7 and KiRecordDr7 as well as DR_MASK and other DR-validation macros and functions to protect against DR-vulnerabilites as well as to properly account for each active hardware breakpoint in a per-thread fashion by using the dispatcher header.
- Allow CR0_EM when running in a VDM.
- Fix FPU/NPX Register handling in KeContextToTrapFrame and KeTrapFrameToContext, and also speed it up by manual copying instead of a memory move.
- Properly give IOPL 3 to user-mode threads if they requested it.
- Detect GPF during GPF.
- Detect pagefault with a trap-frame spread over two or more pages and nested.
- Properly sanitize and set correct trap frame in KiInitailizeUserApc.
- Return STATUS_ACCESS_VIOLATION during page faults instead of STATUS_UNSUCESSFUL.
- Fix assert in VdmSwapContext, as well as Code Selector check which was broken.
- Fix delayed object deletion (ObDeferDeleteObject) and the Ob Repear Routine and list.
- Update Kernel Fun.
- BUGBUG: Temporaily hack VMWare to detection to always detect VMWare.
svn path=/trunk/; revision=25238
2006-12-29 18:49:00 +00:00
|
|
|
IN BOOLEAN StoreInstruction,
|
|
|
|
IN PVOID Address,
|
|
|
|
IN KPROCESSOR_MODE Mode,
|
|
|
|
IN PVOID TrapInformation
|
2005-09-14 01:05:50 +00:00
|
|
|
);
|
2000-07-04 08:52:47 +00:00
|
|
|
|
2004-08-01 07:24:59 +00:00
|
|
|
/* anonmem.c *****************************************************************/
|
2000-07-06 14:34:52 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
MmNotPresentFaultVirtualMemory(
|
|
|
|
PMADDRESS_SPACE AddressSpace,
|
|
|
|
MEMORY_AREA* MemoryArea,
|
|
|
|
PVOID Address,
|
|
|
|
BOOLEAN Locked
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
MmPageOutVirtualMemory(
|
|
|
|
PMADDRESS_SPACE AddressSpace,
|
|
|
|
PMEMORY_AREA MemoryArea,
|
|
|
|
PVOID Address,
|
|
|
|
struct _MM_PAGEOP* PageOp
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
2006-09-06 12:19:00 +00:00
|
|
|
NTAPI
|
2005-09-14 01:05:50 +00:00
|
|
|
MmQueryAnonMem(
|
|
|
|
PMEMORY_AREA MemoryArea,
|
|
|
|
PVOID Address,
|
|
|
|
PMEMORY_BASIC_INFORMATION Info,
|
|
|
|
PULONG ResultLength
|
|
|
|
);
|
|
|
|
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
MmFreeVirtualMemory(
|
2006-05-18 20:32:17 +00:00
|
|
|
struct _EPROCESS* Process,
|
2005-09-14 01:05:50 +00:00
|
|
|
PMEMORY_AREA MemoryArea
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
MmProtectAnonMem(
|
|
|
|
PMADDRESS_SPACE AddressSpace,
|
|
|
|
PMEMORY_AREA MemoryArea,
|
|
|
|
PVOID BaseAddress,
|
|
|
|
ULONG Length,
|
|
|
|
ULONG Protect,
|
|
|
|
PULONG OldProtect
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
MmWritePageVirtualMemory(
|
|
|
|
PMADDRESS_SPACE AddressSpace,
|
|
|
|
PMEMORY_AREA MArea,
|
|
|
|
PVOID Address,
|
|
|
|
PMM_PAGEOP PageOp
|
|
|
|
);
|
2002-05-13 18:10:41 +00:00
|
|
|
|
2004-08-01 07:24:59 +00:00
|
|
|
/* kmap.c ********************************************************************/
|
2001-02-16 18:32:20 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
PVOID
|
|
|
|
NTAPI
|
|
|
|
ExAllocatePage(VOID);
|
2001-03-13 16:25:55 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
ExUnmapPage(PVOID Addr);
|
2004-08-01 07:24:59 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
PVOID
|
|
|
|
NTAPI
|
|
|
|
ExAllocatePageWithPhysPage(PFN_TYPE Page);
|
2004-08-01 07:24:59 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
MiCopyFromUserPage(
|
|
|
|
PFN_TYPE Page,
|
|
|
|
PVOID SourceAddress
|
|
|
|
);
|
2004-08-01 07:24:59 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
MiZeroPage(PFN_TYPE Page);
|
2004-08-01 07:24:59 +00:00
|
|
|
|
|
|
|
/* memsafe.s *****************************************************************/
|
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
PVOID
|
|
|
|
FASTCALL
|
|
|
|
MmSafeReadPtr(PVOID Source);
|
2005-02-22 01:07:41 +00:00
|
|
|
|
2004-08-01 07:24:59 +00:00
|
|
|
/* pageop.c ******************************************************************/
|
2002-05-14 21:19:21 +00:00
|
|
|
|
|
|
|
VOID
|
2005-09-14 01:05:50 +00:00
|
|
|
NTAPI
|
2002-05-14 21:19:21 +00:00
|
|
|
MmReleasePageOp(PMM_PAGEOP PageOp);
|
2002-05-13 18:10:41 +00:00
|
|
|
|
|
|
|
PMM_PAGEOP
|
2005-09-14 01:05:50 +00:00
|
|
|
NTAPI
|
|
|
|
MmGetPageOp(
|
|
|
|
PMEMORY_AREA MArea,
|
|
|
|
HANDLE Pid,
|
|
|
|
PVOID Address,
|
|
|
|
PMM_SECTION_SEGMENT Segment,
|
|
|
|
ULONG Offset,
|
|
|
|
ULONG OpType,
|
2006-01-08 06:23:17 +00:00
|
|
|
BOOLEAN First
|
2005-09-14 01:05:50 +00:00
|
|
|
);
|
|
|
|
|
2003-01-11 15:26:59 +00:00
|
|
|
PMM_PAGEOP
|
2005-09-14 01:05:50 +00:00
|
|
|
NTAPI
|
|
|
|
MmCheckForPageOp(
|
|
|
|
PMEMORY_AREA MArea,
|
|
|
|
HANDLE Pid,
|
|
|
|
PVOID Address,
|
|
|
|
PMM_SECTION_SEGMENT Segment,
|
|
|
|
ULONG Offset
|
|
|
|
);
|
|
|
|
|
2003-01-11 15:26:59 +00:00
|
|
|
VOID
|
2005-09-14 01:05:50 +00:00
|
|
|
NTAPI
|
2003-01-11 15:26:59 +00:00
|
|
|
MmInitializePageOp(VOID);
|
2001-03-09 14:40:28 +00:00
|
|
|
|
2005-04-18 00:42:31 +00:00
|
|
|
/* process.c *****************************************************************/
|
|
|
|
|
|
|
|
PVOID
|
2006-09-06 12:19:00 +00:00
|
|
|
NTAPI
|
2007-09-24 14:01:54 +00:00
|
|
|
MmCreateKernelStack(BOOLEAN GuiStack, UCHAR Node);
|
2005-04-18 00:42:31 +00:00
|
|
|
|
|
|
|
VOID
|
2006-09-06 12:19:00 +00:00
|
|
|
NTAPI
|
2005-05-09 01:38:29 +00:00
|
|
|
MmDeleteKernelStack(PVOID Stack,
|
2005-04-18 00:42:31 +00:00
|
|
|
BOOLEAN GuiStack);
|
2005-05-09 01:38:29 +00:00
|
|
|
|
2004-08-01 07:24:59 +00:00
|
|
|
/* balace.c ******************************************************************/
|
2003-06-27 21:28:30 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
MmInitializeMemoryConsumer(
|
|
|
|
ULONG Consumer,
|
|
|
|
NTSTATUS (*Trim)(ULONG Target, ULONG Priority, PULONG NrFreed)
|
|
|
|
);
|
|
|
|
|
2007-10-19 23:21:45 +00:00
|
|
|
VOID
|
2005-09-14 01:05:50 +00:00
|
|
|
NTAPI
|
|
|
|
MmInitializeBalancer(
|
|
|
|
ULONG NrAvailablePages,
|
|
|
|
ULONG NrSystemPages
|
|
|
|
);
|
2001-03-13 16:25:55 +00:00
|
|
|
|
2007-10-19 23:21:45 +00:00
|
|
|
NTSTATUS
|
2005-09-14 01:05:50 +00:00
|
|
|
NTAPI
|
|
|
|
MmReleasePageMemoryConsumer(
|
|
|
|
ULONG Consumer,
|
|
|
|
PFN_TYPE Page
|
|
|
|
);
|
2004-08-01 07:24:59 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
MmRequestPageMemoryConsumer(
|
|
|
|
ULONG Consumer,
|
|
|
|
BOOLEAN MyWait,
|
|
|
|
PPFN_TYPE AllocatedPage
|
|
|
|
);
|
2004-08-01 07:24:59 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
MiInitBalancerThread(VOID);
|
2004-08-01 07:24:59 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
MmRebalanceMemoryConsumers(VOID);
|
2004-08-01 07:24:59 +00:00
|
|
|
|
|
|
|
/* rmap.c **************************************************************/
|
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
MmSetRmapListHeadPage(
|
|
|
|
PFN_TYPE Page,
|
|
|
|
struct _MM_RMAP_ENTRY* ListHead
|
|
|
|
);
|
2004-08-01 07:24:59 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
struct _MM_RMAP_ENTRY*
|
|
|
|
NTAPI
|
|
|
|
MmGetRmapListHeadPage(PFN_TYPE Page);
|
2004-08-01 07:24:59 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
MmInsertRmap(
|
|
|
|
PFN_TYPE Page,
|
2006-05-18 20:32:17 +00:00
|
|
|
struct _EPROCESS *Process,
|
2005-09-14 01:05:50 +00:00
|
|
|
PVOID Address
|
|
|
|
);
|
2004-08-01 07:24:59 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
MmDeleteAllRmaps(
|
|
|
|
PFN_TYPE Page,
|
|
|
|
PVOID Context,
|
2006-05-18 20:32:17 +00:00
|
|
|
VOID (*DeleteMapping)(PVOID Context, struct _EPROCESS *Process, PVOID Address)
|
2005-09-14 01:05:50 +00:00
|
|
|
);
|
2004-08-01 07:24:59 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
MmDeleteRmap(
|
|
|
|
PFN_TYPE Page,
|
2006-05-18 20:32:17 +00:00
|
|
|
struct _EPROCESS *Process,
|
2005-09-14 01:05:50 +00:00
|
|
|
PVOID Address
|
|
|
|
);
|
2004-08-01 07:24:59 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
MmInitializeRmapList(VOID);
|
2004-08-01 07:24:59 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
MmSetCleanAllRmaps(PFN_TYPE Page);
|
2004-08-01 07:24:59 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
MmSetDirtyAllRmaps(PFN_TYPE Page);
|
2004-08-01 07:24:59 +00:00
|
|
|
|
2006-01-08 06:23:17 +00:00
|
|
|
BOOLEAN
|
2005-09-14 01:05:50 +00:00
|
|
|
NTAPI
|
|
|
|
MmIsDirtyPageRmap(PFN_TYPE Page);
|
2004-08-01 07:24:59 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
MmWritePagePhysicalAddress(PFN_TYPE Page);
|
2004-08-01 07:24:59 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
MmPageOutPhysicalAddress(PFN_TYPE Page);
|
2004-08-01 07:24:59 +00:00
|
|
|
|
|
|
|
/* freelist.c **********************************************************/
|
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
PFN_TYPE
|
|
|
|
NTAPI
|
|
|
|
MmGetLRUNextUserPage(PFN_TYPE PreviousPage);
|
2004-08-01 07:24:59 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
PFN_TYPE
|
|
|
|
NTAPI
|
|
|
|
MmGetLRUFirstUserPage(VOID);
|
2004-08-01 07:24:59 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
MmSetLRULastPage(PFN_TYPE Page);
|
2004-08-01 07:24:59 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
MmLockPage(PFN_TYPE Page);
|
2004-08-01 07:24:59 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
MmLockPageUnsafe(PFN_TYPE Page);
|
2004-08-01 07:24:59 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
MmUnlockPage(PFN_TYPE Page);
|
2004-08-01 07:24:59 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
ULONG
|
|
|
|
NTAPI
|
|
|
|
MmGetLockCountPage(PFN_TYPE Page);
|
2004-08-01 07:24:59 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
PVOID
|
|
|
|
NTAPI
|
|
|
|
MmInitializePageList(
|
|
|
|
ULONG_PTR FirstPhysKernelAddress,
|
|
|
|
ULONG_PTR LastPhysKernelAddress,
|
|
|
|
ULONG MemorySizeInPages,
|
|
|
|
ULONG_PTR LastKernelBase,
|
|
|
|
PADDRESS_RANGE BIOSMemoryMap,
|
|
|
|
ULONG AddressRangeCount
|
|
|
|
);
|
|
|
|
|
|
|
|
PFN_TYPE
|
|
|
|
NTAPI
|
|
|
|
MmGetContinuousPages(
|
|
|
|
ULONG NumberOfBytes,
|
|
|
|
PHYSICAL_ADDRESS LowestAcceptableAddress,
|
|
|
|
PHYSICAL_ADDRESS HighestAcceptableAddress,
|
|
|
|
PHYSICAL_ADDRESS BoundaryAddressMultiple
|
|
|
|
);
|
2004-08-01 07:24:59 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
2006-10-05 16:14:28 +00:00
|
|
|
MmZeroPageThreadMain(
|
|
|
|
PVOID Context
|
|
|
|
);
|
2004-08-01 07:24:59 +00:00
|
|
|
|
|
|
|
/* i386/page.c *********************************************************/
|
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
PVOID
|
|
|
|
NTAPI
|
|
|
|
MmCreateHyperspaceMapping(PFN_TYPE Page);
|
2001-04-04 22:21:32 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
PFN_TYPE
|
|
|
|
NTAPI
|
|
|
|
MmChangeHyperspaceMapping(
|
|
|
|
PVOID Address,
|
|
|
|
PFN_TYPE Page
|
|
|
|
);
|
2004-08-01 07:24:59 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
PFN_TYPE
|
|
|
|
NTAPI
|
|
|
|
MmDeleteHyperspaceMapping(PVOID Address);
|
2004-08-01 07:24:59 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
MmCreateVirtualMappingForKernel(
|
|
|
|
PVOID Address,
|
|
|
|
ULONG flProtect,
|
|
|
|
PPFN_TYPE Pages,
|
|
|
|
ULONG PageCount
|
|
|
|
);
|
2004-08-01 07:24:59 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
MmCommitPagedPoolAddress(
|
|
|
|
PVOID Address,
|
|
|
|
BOOLEAN Locked
|
|
|
|
);
|
2002-06-04 David Welch <welch@whitehall1-5.seh.ox.ac.uk>
* ntoskrnl/ke/i386/exp.c (KiDoubleFaultHandler): Print CR3
correctly.
2002-06-04 David Welch <welch@whitehall1-5.seh.ox.ac.uk>
* ntoskrnl/include/internal/ps.h: Added KTHREAD_STACK_LIMIT definition.
* ntoskrnl/ke/i386/tskswitch.S (Ki386ContextSwitch): Force all the
pages of the kernel stack to be accessible from this process.
2002-06-04 David Welch <welch@cwcom.net>
* ntoskrnl/cc/view.c (ReadCacheSegmentChain): Changes to use
PHYSICAL_ADDRESS type for physical addresses.
* ntoskrnl/cc/copy.c (CcRosCreateCacheSegment): Changes to use
PHYSICAL_ADDRESS type for physical addresses.
* ntoskrnl/cc/copy.c (CcFreeCachePage): Changes to use
PHYSICAL_ADDRESS type for physical addresses.
* ntoskrnl/include/internal/mm.h: Changed prototypes to use
PHYSICAL_ADDRESS type for physical addresses.
* ntoskrnl/include/internal/ps.h (KPROCESS): Changed type of
page directory base to PHYSICAL_ADDRESS.
* ntoskrnl/include/internal/i386/mm.h: Changed prototypes to use
PHYSICAL_ADDRESS type for physical addresses.
* ntoskrnl/ke/kthread.c (KeFreeStackPage): Changes to use
PHYSICAL_ADDRESS type for physical addresses.
* ntoskrnl/ke/kthread.c (KeInitializeThread): Changes to use
PHYSICAL_ADDRESS type for physical addresses.
* ntoskrnl/ke/process.c (KeAttachProcess, KeDetachProcess): Changes
to use PHYSICAL_ADDRESS type for physical addresses.
* ntoskrnl/ke/kernel.c (PcrPages, KeApplicationProcessorInit): Changes
to use PHYSICAL_ADDRESS type for physical addresses.
* ntoskrnl/mm/balance.c (MM_ALLOCATION_REQUEST): Changes to use
PHYSICAL_ADDRESS type for physical addresses.
* ntoskrnl/mm/balance.c (MmReleasePageMemoryConsumer): Changes to use
PHYSICAL_ADDRESS type for physical addresses.
* ntoskrnl/mm/balance.c (MmRequestPageMemoryConsumer): Changes to use
PHYSICAL_ADDRESS type for physical addresses.
* ntoskrnl/mm/cont.c (MmFreeContinuousPage): Changes to use
PHYSICAL_ADDRESS type for physical addresses.
* ntoskrnl/mm/cont.c (MmAllocateContinuousAlignedMemory): Changes to
use PHYSICAL_ADDRESS type for physical addresses.
* ntoskrnl/mm/freelist.c (MmTransferOwnershipPage,
MmGetLRUFirstUserPage, MmGetLRUNextUserPage, MmGetContinuousPages,
MmInitializePageList, MmSetFlagsPage, MmSetRmapListHeadPage,
MmGetRmapListHeadPage, MmMarkPageMapped, MmMarkPageUnmapped,
MmGetFlagsPage, MmSetSavedSwapEntryPage, MmGetSavedSwapEntryPage,
MmReferencePage, MmGetReferenceCountPage, MmIsUsablePage,
MmDereferencePage, MmGetLockCountPage, MmLockPage, MmUnlockPage,
MmAllocPage): Changes to use PHYSICAL_ADDRESS type for physical
addresses.
* ntoskrnl/mm/iospace.c (MmMapIoSpace): Changes to use
PHYSICAL_ADDRESS type for physical addresses.
* ntoskrnl/mm/kmap.c (ExAllocatePage, MiZeroPage, MiCopyFromUserPage,
ExAllocatePageWithPhysPage): Changes to use PHYSICAL_ADDRESS type for
physical addresses.
* ntoskrnl/mm/marea.c (MmFreeMemoryArea): Changes to use
PHYSICAL_ADDRESS type for physical addresses.
* ntoskrnl/mm/mdl.c (MmUnlockPages, MmMapLockedPages,
MmProbeAndLockPages): Changes to use PHYSICAL_ADDRESS type for
physical addresses.
* ntoskrnl/mm/mm.c (MmSharedDataPagePhysicalAddress,
MmCommitPagedPoolAddress, MmNotPresentFault): Changes to use
PHYSICAL_ADDRESS type for physical addresses.
* ntoskrnl/mm/mminit.c (MmInitVirtualMemory): Changes to use
PHYSICAL_ADDRESS type for physical addresses.
* ntoskrnl/mm/ncache.c (MmAllocateNonCachedMemory,
MmFreeNonCachedPage): Changes to use PHYSICAL_ADDRESS type for
physical addresses.
* ntoskrnl/mm/npool.c (grow_kernel_pool): Changes to use
PHYSICAL_ADDRESS type for physical addresses.
* ntoskrnl/mm/rmap.c (MmPageOutPhysicalAddress, MmInsertRmap,
MmDeleteAllRmaps, MmDeleteRmap): Changes to use
PHYSICAL_ADDRESS type for physical addresses.
* ntoskrnl/mm/section.c (MiReadPage, MmNotPresentFaultSectionView,
MmAccessFaultSectionView, MmPageOutDeleteMapping,
MmPageOutSectionView, MmFreeSectionPage): Changes to use
PHYSICAL_ADDRESS type for physical addresses.
* ntoskrnl/mm/slab.c (ExGrowSlabCache): Changes to use
PHYSICAL_ADDRESS type for physical address.
* ntoskrnl/mm/virtual.c (MmPageOutVirtualMemory,
MmNotPresentFaultVirtualMemory, MmFreeVirtualMemoryPage): Changes to
use PHYSICAL_ADDRESS type for physical address.
* ntoskrnl/mm/wset.c (MmTrimUserMemory): Changes to use
PHYSICAL_ADDRESS type for physical address.
* ntoskrnl/mm/page.c (Mmi386ReleaseMmInfo, MmCopyMmInfo,
MmGetPhysicalAddressForProcess, MmCreateVirtualMapping,
MmCreateVirtualMappingUnsafe, MmCreateVirtualMappingForProcess,
MmDeleteVirtualMapping): Changes to use PHYSICAL_ADDRESS type for
physical address.
* ntoskrnl/ps/process (PsInitProcessManagment): Changes to use
PHYSICAL_ADDRESS type for physical address.
* ntoskrnl/ps/thread.c (PsAllocateCallbackStack): Changes to use
PHYSICAL_ADDRESS type for physical address.
2002-06-04 David Welch <welch@cwcom.net>
* Lots of change since the ChangeLog was last updated.
svn path=/trunk/; revision=3000
2002-06-04 15:26:58 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
MmCreateVirtualMapping(
|
2006-05-18 20:32:17 +00:00
|
|
|
struct _EPROCESS* Process,
|
2005-09-14 01:05:50 +00:00
|
|
|
PVOID Address,
|
|
|
|
ULONG flProtect,
|
|
|
|
PPFN_TYPE Pages,
|
|
|
|
ULONG PageCount
|
|
|
|
);
|
2004-08-01 07:24:59 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
MmCreateVirtualMappingUnsafe(
|
2006-05-18 20:32:17 +00:00
|
|
|
struct _EPROCESS* Process,
|
2005-09-14 01:05:50 +00:00
|
|
|
PVOID Address,
|
|
|
|
ULONG flProtect,
|
|
|
|
PPFN_TYPE Pages,
|
|
|
|
ULONG PageCount
|
|
|
|
);
|
|
|
|
|
|
|
|
ULONG
|
|
|
|
NTAPI
|
|
|
|
MmGetPageProtect(
|
2006-05-18 20:32:17 +00:00
|
|
|
struct _EPROCESS* Process,
|
2005-09-14 01:05:50 +00:00
|
|
|
PVOID Address);
|
2001-04-17 04:11:01 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
MmSetPageProtect(
|
2006-05-18 20:32:17 +00:00
|
|
|
struct _EPROCESS* Process,
|
2005-09-14 01:05:50 +00:00
|
|
|
PVOID Address,
|
|
|
|
ULONG flProtect
|
|
|
|
);
|
2003-05-17 13:45:04 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
BOOLEAN
|
|
|
|
NTAPI
|
|
|
|
MmIsPagePresent(
|
2006-05-18 20:32:17 +00:00
|
|
|
struct _EPROCESS* Process,
|
2005-09-14 01:05:50 +00:00
|
|
|
PVOID Address
|
|
|
|
);
|
2001-12-29 14:32:22 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
MmInitGlobalKernelPageDirectory(VOID);
|
2004-04-22 01:57:49 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
MmDisableVirtualMapping(
|
2006-05-18 20:32:17 +00:00
|
|
|
struct _EPROCESS *Process,
|
2005-09-14 01:05:50 +00:00
|
|
|
PVOID Address,
|
2006-01-08 06:23:17 +00:00
|
|
|
BOOLEAN* WasDirty,
|
2005-09-14 01:05:50 +00:00
|
|
|
PPFN_TYPE Page
|
|
|
|
);
|
2004-04-22 01:57:49 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
MmEnableVirtualMapping(
|
2006-05-18 20:32:17 +00:00
|
|
|
struct _EPROCESS *Process,
|
2005-09-14 01:05:50 +00:00
|
|
|
PVOID Address
|
|
|
|
);
|
2004-04-22 01:57:49 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
MmRawDeleteVirtualMapping(PVOID Address);
|
2001-12-31 01:53:46 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
MmDeletePageFileMapping(
|
2006-05-18 20:32:17 +00:00
|
|
|
struct _EPROCESS *Process,
|
2005-09-14 01:05:50 +00:00
|
|
|
PVOID Address,
|
|
|
|
SWAPENTRY* SwapEntry
|
|
|
|
);
|
2004-08-01 07:24:59 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
MmCreatePageFileMapping(
|
2006-05-18 20:32:17 +00:00
|
|
|
struct _EPROCESS *Process,
|
2005-09-14 01:05:50 +00:00
|
|
|
PVOID Address,
|
|
|
|
SWAPENTRY SwapEntry
|
|
|
|
);
|
2004-08-01 07:24:59 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
BOOLEAN
|
|
|
|
NTAPI
|
|
|
|
MmIsPageSwapEntry(
|
2006-05-18 20:32:17 +00:00
|
|
|
struct _EPROCESS *Process,
|
2005-09-14 01:05:50 +00:00
|
|
|
PVOID Address
|
|
|
|
);
|
2001-12-31 01:53:46 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
MmTransferOwnershipPage(
|
|
|
|
PFN_TYPE Page,
|
|
|
|
ULONG NewConsumer
|
|
|
|
);
|
2002-08-10 16:41:20 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
MmSetDirtyPage(
|
2006-05-18 20:32:17 +00:00
|
|
|
struct _EPROCESS *Process,
|
2005-09-14 01:05:50 +00:00
|
|
|
PVOID Address
|
|
|
|
);
|
|
|
|
|
|
|
|
PFN_TYPE
|
|
|
|
NTAPI
|
|
|
|
MmAllocPage(
|
|
|
|
ULONG Consumer,
|
|
|
|
SWAPENTRY SavedSwapEntry
|
|
|
|
);
|
|
|
|
|
|
|
|
LONG
|
|
|
|
NTAPI
|
|
|
|
MmAllocPagesSpecifyRange(
|
|
|
|
ULONG Consumer,
|
|
|
|
PHYSICAL_ADDRESS LowestAddress,
|
|
|
|
PHYSICAL_ADDRESS HighestAddress,
|
|
|
|
ULONG NumberOfPages,
|
|
|
|
PPFN_TYPE Pages
|
|
|
|
);
|
2005-01-07 16:10:48 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
MmDereferencePage(PFN_TYPE Page);
|
2004-08-01 07:24:59 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
MmReferencePage(PFN_TYPE Page);
|
2004-08-01 07:24:59 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
MmReferencePageUnsafe(PFN_TYPE Page);
|
2004-08-01 07:24:59 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
BOOLEAN
|
|
|
|
NTAPI
|
|
|
|
MmIsAccessedAndResetAccessPage(
|
2006-05-18 20:32:17 +00:00
|
|
|
struct _EPROCESS *Process,
|
2005-09-14 01:05:50 +00:00
|
|
|
PVOID Address
|
|
|
|
);
|
2004-08-01 07:24:59 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
ULONG
|
|
|
|
NTAPI
|
|
|
|
MmGetReferenceCountPage(PFN_TYPE Page);
|
2004-08-01 07:24:59 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
BOOLEAN
|
|
|
|
NTAPI
|
2008-02-14 20:30:31 +00:00
|
|
|
MmIsPageInUse(PFN_TYPE Page);
|
2004-08-01 07:24:59 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
MmSetFlagsPage(
|
|
|
|
PFN_TYPE Page,
|
|
|
|
ULONG Flags);
|
2004-08-01 07:24:59 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
ULONG
|
|
|
|
NTAPI
|
|
|
|
MmGetFlagsPage(PFN_TYPE Page);
|
2004-08-01 07:24:59 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
MmSetSavedSwapEntryPage(
|
|
|
|
PFN_TYPE Page,
|
|
|
|
SWAPENTRY SavedSwapEntry);
|
2004-08-01 07:24:59 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
SWAPENTRY
|
|
|
|
NTAPI
|
|
|
|
MmGetSavedSwapEntryPage(PFN_TYPE Page);
|
2004-08-01 07:24:59 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
MmSetCleanPage(
|
2006-05-18 20:32:17 +00:00
|
|
|
struct _EPROCESS *Process,
|
2005-09-14 01:05:50 +00:00
|
|
|
PVOID Address
|
|
|
|
);
|
2004-08-01 07:24:59 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
MmCreatePageTable(PVOID PAddress);
|
2004-08-01 07:24:59 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
MmDeletePageTable(
|
2006-05-18 20:32:17 +00:00
|
|
|
struct _EPROCESS *Process,
|
2005-09-14 01:05:50 +00:00
|
|
|
PVOID Address
|
|
|
|
);
|
|
|
|
|
|
|
|
PFN_TYPE
|
|
|
|
NTAPI
|
|
|
|
MmGetPfnForProcess(
|
2006-05-18 20:32:17 +00:00
|
|
|
struct _EPROCESS *Process,
|
2005-09-14 01:05:50 +00:00
|
|
|
PVOID Address
|
|
|
|
);
|
2004-08-01 07:24:59 +00:00
|
|
|
|
- PS_UNKNOWN_VALUE determines if the process should be created with large pages: rename to PS_LARGE_PAGES
- Do Address Space initialization as per "Windows Internals II" slides, either for the Boot, System, Cloned User or New User Process cases.
- Rename MmCreateProcessAddressSpace to MmInitializeProcessAddressSpace, and MmCopyMmInfo to MmCreateProcessAddressSpace. What ReactOS did is correct as per "Windows Internals II", but the names were inverted.
- Clone the Object Table if we are the boot process, and only initialize part of the address space (since we don't need things like guard page, TEB, etc), however, do initialize and map the shared user data section.
- Make the initial system process and idle process share the same page directory instead of creating a new one.
- Use the same priority class as the parent process, if the process was in the idle or below-normal priority class.
- Only duplicate handles if the caller requested it, instead of always duplicating the process's handles!
- Generate a null image file name for system processes.
- Rename ObpCreateHandleTable to ObInitProcess and better handle race and out-of-memory conditions. Detect if auditing required, but don't do anything about it.
- Initialize the Idle/System process address space much earlier in the boot process, in MmInitSystem.
Thanks to Alex for providing various information, and answering all my questions.
svn path=/trunk/; revision=29223
2007-09-26 20:55:26 +00:00
|
|
|
BOOLEAN
|
|
|
|
NTAPI
|
|
|
|
MmCreateProcessAddressSpace(
|
|
|
|
IN ULONG MinWs,
|
|
|
|
IN PEPROCESS Dest,
|
|
|
|
IN PLARGE_INTEGER DirectoryTableBase
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
MmInitializeHandBuiltProcess(
|
|
|
|
IN PEPROCESS Process,
|
|
|
|
IN PLARGE_INTEGER DirectoryTableBase
|
|
|
|
);
|
|
|
|
|
|
|
|
|
2005-05-09 01:38:29 +00:00
|
|
|
NTSTATUS
|
2006-09-06 12:19:00 +00:00
|
|
|
NTAPI
|
- PS_UNKNOWN_VALUE determines if the process should be created with large pages: rename to PS_LARGE_PAGES
- Do Address Space initialization as per "Windows Internals II" slides, either for the Boot, System, Cloned User or New User Process cases.
- Rename MmCreateProcessAddressSpace to MmInitializeProcessAddressSpace, and MmCopyMmInfo to MmCreateProcessAddressSpace. What ReactOS did is correct as per "Windows Internals II", but the names were inverted.
- Clone the Object Table if we are the boot process, and only initialize part of the address space (since we don't need things like guard page, TEB, etc), however, do initialize and map the shared user data section.
- Make the initial system process and idle process share the same page directory instead of creating a new one.
- Use the same priority class as the parent process, if the process was in the idle or below-normal priority class.
- Only duplicate handles if the caller requested it, instead of always duplicating the process's handles!
- Generate a null image file name for system processes.
- Rename ObpCreateHandleTable to ObInitProcess and better handle race and out-of-memory conditions. Detect if auditing required, but don't do anything about it.
- Initialize the Idle/System process address space much earlier in the boot process, in MmInitSystem.
Thanks to Alex for providing various information, and answering all my questions.
svn path=/trunk/; revision=29223
2007-09-26 20:55:26 +00:00
|
|
|
MmInitializeHandBuiltProcess2(
|
|
|
|
IN PEPROCESS Process
|
2005-09-14 01:05:50 +00:00
|
|
|
);
|
2004-08-01 07:24:59 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
2006-05-18 20:32:17 +00:00
|
|
|
MmReleaseMmInfo(struct _EPROCESS *Process);
|
2004-08-01 07:24:59 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
2006-05-18 20:32:17 +00:00
|
|
|
Mmi386ReleaseMmInfo(struct _EPROCESS *Process);
|
2004-08-01 07:24:59 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
MmDeleteVirtualMapping(
|
2006-05-18 20:32:17 +00:00
|
|
|
struct _EPROCESS *Process,
|
2005-09-14 01:05:50 +00:00
|
|
|
PVOID Address,
|
2006-01-08 06:23:17 +00:00
|
|
|
BOOLEAN FreePage,
|
|
|
|
BOOLEAN* WasDirty,
|
2005-09-14 01:05:50 +00:00
|
|
|
PPFN_TYPE Page
|
|
|
|
);
|
2004-08-01 07:24:59 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
BOOLEAN
|
|
|
|
NTAPI
|
|
|
|
MmIsDirtyPage(
|
2006-05-18 20:32:17 +00:00
|
|
|
struct _EPROCESS *Process,
|
2005-09-14 01:05:50 +00:00
|
|
|
PVOID Address
|
|
|
|
);
|
2004-08-01 07:24:59 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
MmMarkPageMapped(PFN_TYPE Page);
|
2004-08-01 07:24:59 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
MmMarkPageUnmapped(PFN_TYPE Page);
|
2004-08-01 07:24:59 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
MmUpdatePageDir(
|
2006-05-18 20:32:17 +00:00
|
|
|
struct _EPROCESS *Process,
|
2005-09-14 01:05:50 +00:00
|
|
|
PVOID Address,
|
|
|
|
ULONG Size
|
|
|
|
);
|
2004-08-19 21:47:51 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
MiInitPageDirectoryMap(VOID);
|
2004-09-09 20:42:33 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
ULONG
|
|
|
|
NTAPI
|
|
|
|
MiGetUserPageDirectoryCount(VOID);
|
2004-09-09 20:42:33 +00:00
|
|
|
|
2004-08-01 07:24:59 +00:00
|
|
|
/* wset.c ********************************************************************/
|
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
NTSTATUS
|
|
|
|
MmTrimUserMemory(
|
|
|
|
ULONG Target,
|
|
|
|
ULONG Priority,
|
|
|
|
PULONG NrFreedPages
|
|
|
|
);
|
2004-08-01 07:24:59 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
/* region.c ************************************************************/
|
2004-08-01 07:24:59 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
MmAlterRegion(
|
|
|
|
PMADDRESS_SPACE AddressSpace,
|
|
|
|
PVOID BaseAddress,
|
|
|
|
PLIST_ENTRY RegionListHead,
|
|
|
|
PVOID StartAddress,
|
|
|
|
ULONG Length,
|
|
|
|
ULONG NewType,
|
|
|
|
ULONG NewProtect,
|
|
|
|
PMM_ALTER_REGION_FUNC AlterFunc
|
|
|
|
);
|
2004-08-01 07:24:59 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
2005-11-28 23:43:40 +00:00
|
|
|
MmInitializeRegion(
|
2005-09-14 01:05:50 +00:00
|
|
|
PLIST_ENTRY RegionListHead,
|
2005-11-28 23:43:40 +00:00
|
|
|
SIZE_T Length,
|
2005-09-14 01:05:50 +00:00
|
|
|
ULONG Type,
|
|
|
|
ULONG Protect
|
|
|
|
);
|
|
|
|
|
|
|
|
PMM_REGION
|
|
|
|
NTAPI
|
|
|
|
MmFindRegion(
|
|
|
|
PVOID BaseAddress,
|
|
|
|
PLIST_ENTRY RegionListHead,
|
|
|
|
PVOID Address,
|
|
|
|
PVOID* RegionBaseAddress
|
|
|
|
);
|
2004-08-01 07:24:59 +00:00
|
|
|
|
|
|
|
/* section.c *****************************************************************/
|
|
|
|
|
2006-07-27 00:22:36 +00:00
|
|
|
PFILE_OBJECT
|
|
|
|
NTAPI
|
|
|
|
MmGetFileObjectForSection(
|
|
|
|
IN PROS_SECTION_OBJECT Section
|
|
|
|
);
|
2006-10-22 19:53:10 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
MmGetFileNameForAddress(
|
|
|
|
IN PVOID Address,
|
|
|
|
OUT PUNICODE_STRING ModuleName
|
|
|
|
);
|
2006-07-27 00:22:36 +00:00
|
|
|
|
2006-10-22 20:56:24 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
MmGetFileNameForSection(
|
|
|
|
IN PROS_SECTION_OBJECT Section,
|
2006-11-30 05:22:20 +00:00
|
|
|
OUT POBJECT_NAME_INFORMATION *ModuleName
|
2006-10-22 20:56:24 +00:00
|
|
|
);
|
|
|
|
|
2007-10-19 23:21:45 +00:00
|
|
|
PVOID
|
2006-09-06 12:19:00 +00:00
|
|
|
NTAPI
|
2005-09-14 01:05:50 +00:00
|
|
|
MmAllocateSection(
|
|
|
|
IN ULONG Length,
|
|
|
|
PVOID BaseAddress
|
|
|
|
);
|
2002-08-10 16:41:20 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
NTSTATUS
|
2006-09-06 12:19:00 +00:00
|
|
|
NTAPI
|
2005-09-14 01:05:50 +00:00
|
|
|
MmQuerySectionView(
|
|
|
|
PMEMORY_AREA MemoryArea,
|
|
|
|
PVOID Address,
|
|
|
|
PMEMORY_BASIC_INFORMATION Info,
|
|
|
|
PULONG ResultLength
|
|
|
|
);
|
2004-08-01 07:24:59 +00:00
|
|
|
|
2005-05-09 01:38:29 +00:00
|
|
|
NTSTATUS
|
2005-09-14 01:05:50 +00:00
|
|
|
NTAPI
|
|
|
|
MmProtectSectionView(
|
|
|
|
PMADDRESS_SPACE AddressSpace,
|
|
|
|
PMEMORY_AREA MemoryArea,
|
|
|
|
PVOID BaseAddress,
|
|
|
|
ULONG Length,
|
|
|
|
ULONG Protect,
|
|
|
|
PULONG OldProtect
|
|
|
|
);
|
2004-08-01 07:24:59 +00:00
|
|
|
|
2005-05-09 01:38:29 +00:00
|
|
|
NTSTATUS
|
2005-09-14 01:05:50 +00:00
|
|
|
NTAPI
|
|
|
|
MmWritePageSectionView(
|
|
|
|
PMADDRESS_SPACE AddressSpace,
|
|
|
|
PMEMORY_AREA MArea,
|
|
|
|
PVOID Address,
|
|
|
|
PMM_PAGEOP PageOp
|
|
|
|
);
|
2004-08-01 07:24:59 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
MmInitSectionImplementation(VOID);
|
2004-08-01 07:24:59 +00:00
|
|
|
|
2005-05-09 01:38:29 +00:00
|
|
|
NTSTATUS
|
2005-09-14 01:05:50 +00:00
|
|
|
NTAPI
|
|
|
|
MmNotPresentFaultSectionView(
|
|
|
|
PMADDRESS_SPACE AddressSpace,
|
|
|
|
MEMORY_AREA* MemoryArea,
|
|
|
|
PVOID Address,
|
|
|
|
BOOLEAN Locked
|
|
|
|
);
|
2004-08-01 07:24:59 +00:00
|
|
|
|
2005-05-09 01:38:29 +00:00
|
|
|
NTSTATUS
|
2005-09-14 01:05:50 +00:00
|
|
|
NTAPI
|
|
|
|
MmPageOutSectionView(
|
|
|
|
PMADDRESS_SPACE AddressSpace,
|
|
|
|
PMEMORY_AREA MemoryArea,
|
|
|
|
PVOID Address,
|
|
|
|
struct _MM_PAGEOP *PageOp
|
|
|
|
);
|
2004-08-01 07:24:59 +00:00
|
|
|
|
2005-05-09 01:38:29 +00:00
|
|
|
NTSTATUS
|
2005-09-14 01:05:50 +00:00
|
|
|
NTAPI
|
2004-08-01 07:24:59 +00:00
|
|
|
MmCreatePhysicalMemorySection(VOID);
|
|
|
|
|
2005-05-09 01:38:29 +00:00
|
|
|
NTSTATUS
|
2005-09-14 01:05:50 +00:00
|
|
|
NTAPI
|
|
|
|
MmAccessFaultSectionView(
|
|
|
|
PMADDRESS_SPACE AddressSpace,
|
|
|
|
MEMORY_AREA* MemoryArea,
|
|
|
|
PVOID Address,
|
|
|
|
BOOLEAN Locked
|
|
|
|
);
|
2004-08-01 07:24:59 +00:00
|
|
|
|
2002-08-14 20:58:39 +00:00
|
|
|
VOID
|
2005-09-14 01:05:50 +00:00
|
|
|
NTAPI
|
2004-08-01 07:24:59 +00:00
|
|
|
MmFreeSectionSegments(PFILE_OBJECT FileObject);
|
|
|
|
|
|
|
|
/* mpw.c *********************************************************************/
|
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
MmInitMpwThread(VOID);
|
2004-08-01 07:24:59 +00:00
|
|
|
|
2007-01-25 18:48:56 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
MmInitBsmThread(VOID);
|
|
|
|
|
2004-08-01 07:24:59 +00:00
|
|
|
/* pager.c *******************************************************************/
|
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
BOOLEAN
|
|
|
|
NTAPI
|
|
|
|
MiIsPagerThread(VOID);
|
2004-08-01 07:24:59 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
MiStartPagerThread(VOID);
|
2002-08-14 20:58:39 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
MiStopPagerThread(VOID);
|
2005-09-13 23:28:21 +00:00
|
|
|
|
2005-09-14 01:05:50 +00:00
|
|
|
NTSTATUS
|
|
|
|
FASTCALL
|
|
|
|
MiQueryVirtualMemory(
|
|
|
|
IN HANDLE ProcessHandle,
|
|
|
|
IN PVOID Address,
|
2006-01-08 06:23:17 +00:00
|
|
|
IN MEMORY_INFORMATION_CLASS VirtualMemoryInformationClass,
|
2005-09-14 01:05:50 +00:00
|
|
|
OUT PVOID VirtualMemoryInformation,
|
|
|
|
IN ULONG Length,
|
|
|
|
OUT PULONG ResultLength
|
|
|
|
);
|
2005-09-13 23:28:21 +00:00
|
|
|
|
2007-02-23 07:13:19 +00:00
|
|
|
/* sysldr.c ******************************************************************/
|
|
|
|
|
2007-02-22 18:02:53 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
MiReloadBootLoadedDrivers(
|
|
|
|
IN PLOADER_PARAMETER_BLOCK LoaderBlock
|
|
|
|
);
|
|
|
|
|
|
|
|
BOOLEAN
|
|
|
|
NTAPI
|
|
|
|
MiInitializeLoadedModuleList(
|
|
|
|
IN PLOADER_PARAMETER_BLOCK LoaderBlock
|
|
|
|
);
|
|
|
|
|
2007-02-23 07:13:19 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
MmLoadSystemImage(
|
|
|
|
IN PUNICODE_STRING FileName,
|
|
|
|
IN PUNICODE_STRING NamePrefix OPTIONAL,
|
|
|
|
IN PUNICODE_STRING LoadedName OPTIONAL,
|
|
|
|
IN ULONG Flags,
|
|
|
|
OUT PVOID *ModuleObject,
|
|
|
|
OUT PVOID *ImageBaseAddress
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
MmUnloadSystemImage(
|
|
|
|
IN PVOID ImageHandle
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
MmCheckSystemImage(
|
|
|
|
IN HANDLE ImageHandle,
|
|
|
|
IN BOOLEAN PurgeSection
|
|
|
|
);
|
2007-02-22 18:02:53 +00:00
|
|
|
|
2007-09-26 16:41:35 +00:00
|
|
|
FORCEINLINE
|
|
|
|
VOID
|
|
|
|
NTAPI
|
2007-09-27 16:28:56 +00:00
|
|
|
MiSyncThreadProcessViews(IN PVOID Process,
|
2007-09-26 16:41:35 +00:00
|
|
|
IN PVOID Address,
|
|
|
|
IN ULONG Size)
|
|
|
|
{
|
|
|
|
MmUpdatePageDir((PEPROCESS)Process, Address, Size);
|
|
|
|
}
|
|
|
|
|
1998-08-25 04:27:41 +00:00
|
|
|
#endif
|