From e8dcb74344b9a2721941a88fce772672ed442960 Mon Sep 17 00:00:00 2001 From: Alex Ionescu Date: Wed, 14 Sep 2005 01:05:50 +0000 Subject: [PATCH] ntoskrnl header cleanups svn path=/trunk/; revision=17846 --- reactos/ntoskrnl/include/internal/mm.h | 1577 +++++++++++------ reactos/ntoskrnl/include/internal/ntoskrnl.h | 2 +- .../include/internal/{nls.h => rtl.h} | 15 +- reactos/ntoskrnl/mm/anonmem.c | 5 + reactos/ntoskrnl/mm/aspace.c | 16 +- reactos/ntoskrnl/mm/balance.c | 16 +- reactos/ntoskrnl/mm/freelist.c | 33 +- reactos/ntoskrnl/mm/i386/page.c | 64 +- reactos/ntoskrnl/mm/kmap.c | 2 + reactos/ntoskrnl/mm/marea.c | 4 +- reactos/ntoskrnl/mm/mdl.c | 6 +- reactos/ntoskrnl/mm/mm.c | 16 +- reactos/ntoskrnl/mm/mminit.c | 21 +- reactos/ntoskrnl/mm/mpw.c | 4 +- reactos/ntoskrnl/mm/npool.c | 6 +- reactos/ntoskrnl/mm/pagefile.c | 18 +- reactos/ntoskrnl/mm/pageop.c | 7 +- reactos/ntoskrnl/mm/ppool.c | 4 +- reactos/ntoskrnl/mm/region.c | 3 + reactos/ntoskrnl/mm/rmap.c | 12 +- reactos/ntoskrnl/mm/section.c | 24 +- reactos/ntoskrnl/rtl/nls.c | 21 +- 22 files changed, 1293 insertions(+), 583 deletions(-) rename reactos/ntoskrnl/include/internal/{nls.h => rtl.h} (84%) diff --git a/reactos/ntoskrnl/include/internal/mm.h b/reactos/ntoskrnl/include/internal/mm.h index 4fc09bac0ba..fe83b4a7234 100644 --- a/reactos/ntoskrnl/include/internal/mm.h +++ b/reactos/ntoskrnl/include/internal/mm.h @@ -10,211 +10,260 @@ extern ULONG MiUsedSwapPages; extern ULONG MmPagedPoolSize; extern ULONG MmTotalPagedPoolQuota; extern ULONG MmTotalNonPagedPoolQuota; +extern PHYSICAL_ADDRESS MmSharedDataPagePhysicalAddress; +extern PVOID MmPagedPoolBase; +extern ULONG MmPagedPoolSize; + +struct _KTRAP_FRAME; struct _EPROCESS; struct _MM_RMAP_ENTRY; -struct _MM_PAGEOP -; +struct _MM_PAGEOP; typedef ULONG SWAPENTRY; typedef ULONG PFN_TYPE, *PPFN_TYPE; -#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 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) #define PAGE_TO_SECTION_PAGE_DIRECTORY_OFFSET(x) \ - ((x) / (4*1024*1024)) + ((x) / (4*1024*1024)) + #define PAGE_TO_SECTION_PAGE_TABLE_OFFSET(x) \ - ((((x)) % (4*1024*1024)) / (4*1024)) + ((((x)) % (4*1024*1024)) / (4*1024)) -#define NR_SECTION_PAGE_TABLES (1024) -#define NR_SECTION_PAGE_ENTRIES (1024) +#define NR_SECTION_PAGE_TABLES 1024 +#define NR_SECTION_PAGE_ENTRIES 1024 -#define TEB_BASE (0x7FFDE000) -#define KPCR_BASE 0xFF000000 +#define TEB_BASE 0x7FFDE000 +#define KPCR_BASE 0xFF000000 /* Although Microsoft says this isn't hardcoded anymore, they won't be able to change it. Stuff depends on it */ -#define MM_VIRTMEM_GRANULARITY (64 * 1024) +#define MM_VIRTMEM_GRANULARITY (64 * 1024) -#define STATUS_MM_RESTART_OPERATION ((NTSTATUS)0xD0000001) +#define STATUS_MM_RESTART_OPERATION ((NTSTATUS)0xD0000001) /* * Additional flags for protection attributes */ -#define PAGE_WRITETHROUGH (1024) -#define PAGE_SYSTEM (2048) -#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_WRITETHROUGH (1024) +#define PAGE_SYSTEM (2048) -#define PAGE_IS_READABLE (PAGE_READONLY | \ - PAGE_READWRITE | \ - PAGE_WRITECOPY | \ - PAGE_EXECUTE_READ | \ - PAGE_EXECUTE_READWRITE | \ - PAGE_EXECUTE_WRITECOPY) +#define SEC_PHYSICALMEMORY (0x80000000) -#define PAGE_IS_WRITABLE (PAGE_READWRITE | \ - PAGE_WRITECOPY | \ - PAGE_EXECUTE_READWRITE | \ - PAGE_EXECUTE_WRITECOPY) +#define MM_PAGEFILE_SEGMENT (0x1) +#define MM_DATAFILE_SEGMENT (0x2) -#define PAGE_IS_EXECUTABLE (PAGE_EXECUTE | \ - PAGE_EXECUTE_READ | \ - PAGE_EXECUTE_READWRITE | \ - PAGE_EXECUTE_WRITECOPY) +#define MC_CACHE (0) +#define MC_USER (1) +#define MC_PPOOL (2) +#define MC_NPPOOL (3) +#define MC_MAXIMUM (4) -#define PAGE_IS_WRITECOPY (PAGE_WRITECOPY | \ - PAGE_EXECUTE_WRITECOPY) +#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) typedef struct { - ULONG Entry[NR_SECTION_PAGE_ENTRIES]; + ULONG Entry[NR_SECTION_PAGE_ENTRIES]; } SECTION_PAGE_TABLE, *PSECTION_PAGE_TABLE; typedef struct { - PSECTION_PAGE_TABLE PageTables[NR_SECTION_PAGE_TABLES]; + PSECTION_PAGE_TABLE PageTables[NR_SECTION_PAGE_TABLES]; } SECTION_PAGE_DIRECTORY, *PSECTION_PAGE_DIRECTORY; -#define SEC_PHYSICALMEMORY (0x80000000) - -#define MM_PAGEFILE_SEGMENT (0x1) -#define MM_DATAFILE_SEGMENT (0x2) - typedef struct _MM_SECTION_SEGMENT { - LONGLONG FileOffset; - ULONG_PTR VirtualAddress; - ULONG RawLength; - ULONG Length; - ULONG Protection; - FAST_MUTEX Lock; - ULONG ReferenceCount; - SECTION_PAGE_DIRECTORY PageDirectory; - ULONG Flags; - ULONG Characteristics; - BOOLEAN WriteCopy; + LONGLONG FileOffset; + ULONG_PTR VirtualAddress; + ULONG RawLength; + ULONG Length; + ULONG Protection; + FAST_MUTEX Lock; + ULONG ReferenceCount; + SECTION_PAGE_DIRECTORY PageDirectory; + ULONG Flags; + ULONG Characteristics; + BOOLEAN WriteCopy; } MM_SECTION_SEGMENT, *PMM_SECTION_SEGMENT; typedef struct _MM_IMAGE_SECTION_OBJECT { - ULONG_PTR ImageBase; - ULONG_PTR StackReserve; - ULONG_PTR StackCommit; - ULONG_PTR EntryPoint; - ULONG Subsystem; - ULONG ImageCharacteristics; - USHORT MinorSubsystemVersion; - USHORT MajorSubsystemVersion; - USHORT Machine; - BOOLEAN Executable; - ULONG NrSegments; - PMM_SECTION_SEGMENT Segments; + ULONG_PTR ImageBase; + ULONG_PTR StackReserve; + ULONG_PTR StackCommit; + ULONG_PTR EntryPoint; + ULONG Subsystem; + ULONG ImageCharacteristics; + USHORT MinorSubsystemVersion; + USHORT MajorSubsystemVersion; + USHORT Machine; + BOOLEAN Executable; + ULONG NrSegments; + PMM_SECTION_SEGMENT Segments; } MM_IMAGE_SECTION_OBJECT, *PMM_IMAGE_SECTION_OBJECT; typedef struct _SECTION_OBJECT { - CSHORT Type; - CSHORT Size; - LARGE_INTEGER MaximumSize; - ULONG SectionPageProtection; - ULONG AllocationAttributes; - PFILE_OBJECT FileObject; - union - { - PMM_IMAGE_SECTION_OBJECT ImageSection; - PMM_SECTION_SEGMENT Segment; - }; + CSHORT Type; + CSHORT Size; + LARGE_INTEGER MaximumSize; + ULONG SectionPageProtection; + ULONG AllocationAttributes; + PFILE_OBJECT FileObject; + union + { + PMM_IMAGE_SECTION_OBJECT ImageSection; + PMM_SECTION_SEGMENT Segment; + }; } SECTION_OBJECT; typedef struct _MEMORY_AREA { - PVOID StartingAddress; - PVOID EndingAddress; - struct _MEMORY_AREA *Parent; - struct _MEMORY_AREA *LeftChild; - struct _MEMORY_AREA *RightChild; - ULONG Type; - ULONG Attributes; - ULONG LockCount; - BOOLEAN DeleteInProgress; - ULONG PageOpCount; - union - { - struct + PVOID StartingAddress; + PVOID EndingAddress; + struct _MEMORY_AREA *Parent; + struct _MEMORY_AREA *LeftChild; + struct _MEMORY_AREA *RightChild; + ULONG Type; + ULONG Attributes; + ULONG LockCount; + BOOLEAN DeleteInProgress; + ULONG PageOpCount; + union { - SECTION_OBJECT* Section; - ULONG ViewOffset; - PMM_SECTION_SEGMENT Segment; - BOOLEAN WriteCopyView; - LIST_ENTRY RegionListHead; - } SectionData; - struct - { - LIST_ENTRY RegionListHead; - } VirtualMemoryData; - } Data; + struct + { + SECTION_OBJECT* Section; + ULONG ViewOffset; + PMM_SECTION_SEGMENT Segment; + BOOLEAN WriteCopyView; + LIST_ENTRY RegionListHead; + } SectionData; + struct + { + LIST_ENTRY RegionListHead; + } VirtualMemoryData; + } Data; } MEMORY_AREA, *PMEMORY_AREA; #ifndef _MMTYPES_H typedef struct _MADDRESS_SPACE { - PMEMORY_AREA MemoryAreaRoot; - FAST_MUTEX Lock; - PVOID LowestAddress; - struct _EPROCESS* Process; - PUSHORT PageTableRefCountTable; - ULONG PageTableRefCountTableSize; + PMEMORY_AREA MemoryAreaRoot; + FAST_MUTEX Lock; + PVOID LowestAddress; + struct _EPROCESS* Process; + PUSHORT PageTableRefCountTable; + ULONG PageTableRefCountTableSize; } MADDRESS_SPACE, *PMADDRESS_SPACE; #endif typedef struct { - ULONG NrTotalPages; - ULONG NrSystemPages; - ULONG NrReservedPages; - ULONG NrUserPages; - ULONG NrFreePages; - ULONG NrDirtyPages; - ULONG NrLockedPages; - ULONG PagingRequestsInLastMinute; - ULONG PagingRequestsInLastFiveMinutes; - ULONG PagingRequestsInLastFifteenMinutes; + ULONG NrTotalPages; + ULONG NrSystemPages; + ULONG NrReservedPages; + ULONG NrUserPages; + ULONG NrFreePages; + ULONG NrDirtyPages; + ULONG NrLockedPages; + ULONG PagingRequestsInLastMinute; + ULONG PagingRequestsInLastFiveMinutes; + ULONG PagingRequestsInLastFifteenMinutes; } MM_STATS; extern MM_STATS MmStats; -#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) - typedef struct _MM_PAGEOP { /* Type of operation. */ @@ -246,256 +295,335 @@ typedef struct _MM_PAGEOP ULONG Offset; } MM_PAGEOP, *PMM_PAGEOP; -#define MC_CACHE (0) -#define MC_USER (1) -#define MC_PPOOL (2) -#define MC_NPPOOL (3) -#define MC_MAXIMUM (4) - typedef struct _MM_MEMORY_CONSUMER { - ULONG PagesUsed; - ULONG PagesTarget; - NTSTATUS (*Trim)(ULONG Target, ULONG Priority, PULONG NrFreed); -} -MM_MEMORY_CONSUMER, *PMM_MEMORY_CONSUMER; - -extern MM_MEMORY_CONSUMER MiMemoryConsumers[MC_MAXIMUM]; - -extern PHYSICAL_ADDRESS MmSharedDataPagePhysicalAddress; -struct _KTRAP_FRAME; - -typedef VOID (*PMM_ALTER_REGION_FUNC)(PMADDRESS_SPACE AddressSpace, - PVOID BaseAddress, ULONG Length, - ULONG OldType, ULONG OldProtect, - ULONG NewType, ULONG NewProtect); + ULONG PagesUsed; + ULONG PagesTarget; + NTSTATUS (*Trim)(ULONG Target, ULONG Priority, PULONG NrFreed); +} MM_MEMORY_CONSUMER, *PMM_MEMORY_CONSUMER; typedef struct _MM_REGION { - ULONG Type; - ULONG Protect; - ULONG Length; - LIST_ENTRY RegionListEntry; + ULONG Type; + ULONG Protect; + ULONG Length; + LIST_ENTRY RegionListEntry; } MM_REGION, *PMM_REGION; -typedef VOID (*PMM_FREE_PAGE_FUNC)(PVOID Context, PMEMORY_AREA MemoryArea, - PVOID Address, PFN_TYPE Page, - SWAPENTRY SwapEntry, BOOLEAN Dirty); +extern MM_MEMORY_CONSUMER MiMemoryConsumers[MC_MAXIMUM]; -PVOID STDCALL ExAllocateNonPagedPoolWithTag (POOL_TYPE type, - ULONG size, - ULONG Tag, - PVOID Caller); +typedef VOID +(*PMM_ALTER_REGION_FUNC)( + PMADDRESS_SPACE AddressSpace, + PVOID BaseAddress, + ULONG Length, + ULONG OldType, + ULONG OldProtect, + ULONG NewType, + ULONG NewProtect +); -PVOID STDCALL ExAllocatePagedPoolWithTag (POOL_TYPE Type, - ULONG size, - ULONG Tag); -VOID STDCALL ExFreeNonPagedPool (PVOID block); +typedef VOID +(*PMM_FREE_PAGE_FUNC)( + PVOID Context, + PMEMORY_AREA MemoryArea, + PVOID Address, + PFN_TYPE Page, + SWAPENTRY SwapEntry, + BOOLEAN Dirty +); -VOID STDCALL -ExFreePagedPool(IN PVOID Block); -VOID MmInitializePagedPool(VOID); - -PVOID -STDCALL -MiAllocateSpecialPool (IN POOL_TYPE PoolType, - IN SIZE_T NumberOfBytes, - IN ULONG Tag, - IN ULONG Underrun - ); - -extern PVOID MmPagedPoolBase; -extern ULONG MmPagedPoolSize; - -#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))) /* FUNCTIONS */ /* aspace.c ******************************************************************/ -VOID MmLockAddressSpace(PMADDRESS_SPACE AddressSpace); +VOID +NTAPI +MmLockAddressSpace(PMADDRESS_SPACE AddressSpace); -VOID MmUnlockAddressSpace(PMADDRESS_SPACE AddressSpace); +VOID +NTAPI +MmUnlockAddressSpace(PMADDRESS_SPACE AddressSpace); -VOID MmInitializeKernelAddressSpace(VOID); +VOID +NTAPI +MmInitializeKernelAddressSpace(VOID); -PMADDRESS_SPACE MmGetCurrentAddressSpace(VOID); +PMADDRESS_SPACE +NTAPI +MmGetCurrentAddressSpace(VOID); -PMADDRESS_SPACE MmGetKernelAddressSpace(VOID); +PMADDRESS_SPACE +NTAPI +MmGetKernelAddressSpace(VOID); -NTSTATUS MmInitializeAddressSpace(struct _EPROCESS* Process, - PMADDRESS_SPACE AddressSpace); +NTSTATUS +NTAPI +MmInitializeAddressSpace( + struct _EPROCESS* Process, + PMADDRESS_SPACE AddressSpace); -NTSTATUS MmDestroyAddressSpace(PMADDRESS_SPACE AddressSpace); +NTSTATUS +NTAPI +MmDestroyAddressSpace(PMADDRESS_SPACE AddressSpace); /* marea.c *******************************************************************/ NTSTATUS +NTAPI MmInitMemoryAreas(VOID); -NTSTATUS STDCALL +NTSTATUS +STDCALL MmCreateMemoryArea( - struct _EPROCESS* Process, - PMADDRESS_SPACE AddressSpace, - ULONG Type, - PVOID *BaseAddress, - ULONG_PTR Length, - ULONG Attributes, - PMEMORY_AREA *Result, - BOOLEAN FixedAddress, - BOOLEAN TopDown, - PHYSICAL_ADDRESS BoundaryAddressMultiple OPTIONAL); + struct _EPROCESS* Process, + PMADDRESS_SPACE AddressSpace, + ULONG Type, + PVOID *BaseAddress, + ULONG_PTR Length, + ULONG Attributes, + PMEMORY_AREA *Result, + BOOLEAN FixedAddress, + BOOLEAN TopDown, + PHYSICAL_ADDRESS BoundaryAddressMultiple OPTIONAL +); -PMEMORY_AREA STDCALL +PMEMORY_AREA +STDCALL MmLocateMemoryAreaByAddress( - PMADDRESS_SPACE AddressSpace, - PVOID Address); + PMADDRESS_SPACE AddressSpace, + PVOID Address +); -ULONG_PTR STDCALL +ULONG_PTR +STDCALL MmFindGapAtAddress( - PMADDRESS_SPACE AddressSpace, - PVOID Address); + PMADDRESS_SPACE AddressSpace, + PVOID Address +); -NTSTATUS STDCALL +NTSTATUS +STDCALL MmFreeMemoryArea( - PMADDRESS_SPACE AddressSpace, - PMEMORY_AREA MemoryArea, - PMM_FREE_PAGE_FUNC FreePage, - PVOID FreePageContext); + PMADDRESS_SPACE AddressSpace, + PMEMORY_AREA MemoryArea, + PMM_FREE_PAGE_FUNC FreePage, + PVOID FreePageContext +); -NTSTATUS STDCALL +NTSTATUS +STDCALL MmFreeMemoryAreaByPtr( - PMADDRESS_SPACE AddressSpace, - PVOID BaseAddress, - PMM_FREE_PAGE_FUNC FreePage, - PVOID FreePageContext); + PMADDRESS_SPACE AddressSpace, + PVOID BaseAddress, + PMM_FREE_PAGE_FUNC FreePage, + PVOID FreePageContext +); -VOID STDCALL +VOID +STDCALL MmDumpMemoryAreas(PMADDRESS_SPACE AddressSpace); -PMEMORY_AREA STDCALL +PMEMORY_AREA +STDCALL MmLocateMemoryAreaByRegion( - PMADDRESS_SPACE AddressSpace, - PVOID Address, - ULONG_PTR Length); + PMADDRESS_SPACE AddressSpace, + PVOID Address, + ULONG_PTR Length +); -PVOID STDCALL +PVOID +STDCALL MmFindGap( - PMADDRESS_SPACE AddressSpace, - ULONG_PTR Length, - ULONG_PTR Granularity, - BOOLEAN TopDown); + PMADDRESS_SPACE AddressSpace, + ULONG_PTR Length, + ULONG_PTR Granularity, + BOOLEAN TopDown +); -VOID STDCALL +VOID +STDCALL MmReleaseMemoryAreaIfDecommitted( - PEPROCESS Process, - PMADDRESS_SPACE AddressSpace, - PVOID BaseAddress); + PEPROCESS Process, + PMADDRESS_SPACE AddressSpace, + PVOID BaseAddress +); /* npool.c *******************************************************************/ -VOID MiDebugDumpNonPagedPool(BOOLEAN NewOnly); +VOID +NTAPI +MiDebugDumpNonPagedPool(BOOLEAN NewOnly); -VOID MiDebugDumpNonPagedPoolStats(BOOLEAN NewOnly); +VOID +NTAPI +MiDebugDumpNonPagedPoolStats(BOOLEAN NewOnly); -VOID MiInitializeNonPagedPool(VOID); +VOID +NTAPI +MiInitializeNonPagedPool(VOID); -PVOID MmGetMdlPageAddress(PMDL Mdl, PVOID Offset); +PVOID +NTAPI +MmGetMdlPageAddress( + PMDL Mdl, + PVOID Offset +); /* pool.c *******************************************************************/ +PVOID +STDCALL +ExAllocateNonPagedPoolWithTag( + POOL_TYPE type, + ULONG size, + ULONG Tag, + PVOID Caller +); + +PVOID +STDCALL +ExAllocatePagedPoolWithTag( + POOL_TYPE Type, + ULONG size, + ULONG Tag +); + +VOID +STDCALL +ExFreeNonPagedPool(PVOID block); + +VOID +STDCALL +ExFreePagedPool(IN PVOID Block); + +VOID +NTAPI +MmInitializePagedPool(VOID); + +PVOID +STDCALL +MiAllocateSpecialPool( + IN POOL_TYPE PoolType, + IN SIZE_T NumberOfBytes, + IN ULONG Tag, + IN ULONG Underrun +); + BOOLEAN STDCALL MiRaisePoolQuota( IN POOL_TYPE PoolType, IN ULONG CurrentMaxQuota, OUT PULONG NewMaxQuota - ); +); /* mdl.c *********************************************************************/ -VOID MmBuildMdlFromPages(PMDL Mdl, PULONG Pages); +VOID +NTAPI +MmBuildMdlFromPages( + PMDL Mdl, + PULONG Pages +); /* mminit.c ******************************************************************/ -VOID MiShutdownMemoryManager(VOID); +VOID +NTAPI +MiShutdownMemoryManager(VOID); -VOID MmInit1(ULONG_PTR FirstKernelPhysAddress, - ULONG_PTR LastKernelPhysAddress, - ULONG_PTR LastKernelAddress, - PADDRESS_RANGE BIOSMemoryMap, - ULONG AddressRangeCount, - ULONG MaxMemInMeg); +VOID +NTAPI +MmInit1( + ULONG_PTR FirstKernelPhysAddress, + ULONG_PTR LastKernelPhysAddress, + ULONG_PTR LastKernelAddress, + PADDRESS_RANGE BIOSMemoryMap, + ULONG AddressRangeCount, + ULONG MaxMemInMeg +); -VOID MmInit2(VOID); +VOID +NTAPI +MmInit2(VOID); -VOID MmInit3(VOID); +VOID +NTAPI +MmInit3(VOID); -VOID MiFreeInitMemory(VOID); +VOID +NTAPI +MiFreeInitMemory(VOID); -VOID MmInitializeMdlImplementation(VOID); +VOID +NTAPI +MmInitializeMdlImplementation(VOID); /* pagefile.c ****************************************************************/ -SWAPENTRY MmAllocSwapPage(VOID); +SWAPENTRY +NTAPI +MmAllocSwapPage(VOID); -VOID MmDereserveSwapPages(ULONG Nr); +VOID +NTAPI +MmDereserveSwapPages(ULONG Nr); -VOID MmFreeSwapPage(SWAPENTRY Entry); +VOID +NTAPI +MmFreeSwapPage(SWAPENTRY Entry); -VOID MmInitPagingFile(VOID); +VOID +NTAPI +MmInitPagingFile(VOID); -NTSTATUS MmReadFromSwapPage(SWAPENTRY SwapEntry, PFN_TYPE Page); +NTSTATUS +NTAPI +MmReadFromSwapPage( + SWAPENTRY SwapEntry, + PFN_TYPE Page +); -BOOLEAN MmReserveSwapPages(ULONG Nr); +BOOLEAN +NTAPI +MmReserveSwapPages(ULONG Nr); -NTSTATUS MmWriteToSwapPage(SWAPENTRY SwapEntry, PFN_TYPE Page); +NTSTATUS +NTAPI +MmWriteToSwapPage( + SWAPENTRY SwapEntry, + PFN_TYPE Page +); -NTSTATUS STDCALL -MmDumpToPagingFile(ULONG BugCode, - ULONG BugCodeParameter1, - ULONG BugCodeParameter2, - ULONG BugCodeParameter3, - ULONG BugCodeParameter4, - struct _KTRAP_FRAME* TrapFrame); +NTSTATUS +STDCALL +MmDumpToPagingFile( + ULONG BugCode, + ULONG BugCodeParameter1, + ULONG BugCodeParameter2, + ULONG BugCodeParameter3, + ULONG BugCodeParameter4, + struct _KTRAP_FRAME* TrapFrame +); -BOOLEAN MmIsAvailableSwapPage(VOID); +BOOLEAN +NTAPI +MmIsAvailableSwapPage(VOID); -VOID MmShowOutOfSpaceMessagePagingFile(VOID); +VOID +NTAPI +MmShowOutOfSpaceMessagePagingFile(VOID); /* process.c ****************************************************************/ NTSTATUS STDCALL -MmCreateProcessAddressSpace(IN struct _EPROCESS* Process, - IN PSECTION_OBJECT Section OPTIONAL); +MmCreateProcessAddressSpace( + IN struct _EPROCESS* Process, + IN PSECTION_OBJECT Section OPTIONAL +); NTSTATUS STDCALL @@ -503,92 +631,166 @@ MmCreatePeb(PEPROCESS Process); struct _TEB* STDCALL -MmCreateTeb(PEPROCESS Process, - PCLIENT_ID ClientId, - PINITIAL_TEB InitialTeb); +MmCreateTeb( + PEPROCESS Process, + PCLIENT_ID ClientId, + PINITIAL_TEB InitialTeb +); VOID STDCALL -MmDeleteTeb(PEPROCESS Process, - struct _TEB* Teb); +MmDeleteTeb( + PEPROCESS Process, + struct _TEB* Teb +); /* i386/pfault.c *************************************************************/ -NTSTATUS MmPageFault(ULONG Cs, - PULONG Eip, - PULONG Eax, - ULONG Cr2, - ULONG ErrorCode); +NTSTATUS +NTAPI +MmPageFault( + ULONG Cs, + PULONG Eip, + PULONG Eax, + ULONG Cr2, + ULONG ErrorCode +); /* mm.c **********************************************************************/ -NTSTATUS MmAccessFault(KPROCESSOR_MODE Mode, - ULONG_PTR Address, - BOOLEAN FromMdl); +NTSTATUS +NTAPI +MmAccessFault( + KPROCESSOR_MODE Mode, + ULONG_PTR Address, + BOOLEAN FromMdl +); -NTSTATUS MmNotPresentFault(KPROCESSOR_MODE Mode, - ULONG_PTR Address, - BOOLEAN FromMdl); +NTSTATUS +NTAPI +MmNotPresentFault( + KPROCESSOR_MODE Mode, + ULONG_PTR Address, + BOOLEAN FromMdl +); /* anonmem.c *****************************************************************/ -NTSTATUS MmNotPresentFaultVirtualMemory(PMADDRESS_SPACE AddressSpace, - MEMORY_AREA* MemoryArea, - PVOID Address, - BOOLEAN Locked); +NTSTATUS +NTAPI +MmNotPresentFaultVirtualMemory( + PMADDRESS_SPACE AddressSpace, + MEMORY_AREA* MemoryArea, + PVOID Address, + BOOLEAN Locked +); -NTSTATUS MmPageOutVirtualMemory(PMADDRESS_SPACE AddressSpace, - PMEMORY_AREA MemoryArea, - PVOID Address, - struct _MM_PAGEOP* PageOp); -NTSTATUS STDCALL -MmQueryAnonMem(PMEMORY_AREA MemoryArea, - PVOID Address, - PMEMORY_BASIC_INFORMATION Info, - PULONG ResultLength); +NTSTATUS +NTAPI +MmPageOutVirtualMemory( + PMADDRESS_SPACE AddressSpace, + PMEMORY_AREA MemoryArea, + PVOID Address, + struct _MM_PAGEOP* PageOp +); -VOID MmFreeVirtualMemory(struct _EPROCESS* Process, PMEMORY_AREA MemoryArea); +NTSTATUS +STDCALL +MmQueryAnonMem( + PMEMORY_AREA MemoryArea, + PVOID Address, + PMEMORY_BASIC_INFORMATION Info, + PULONG ResultLength +); -NTSTATUS MmProtectAnonMem(PMADDRESS_SPACE AddressSpace, - PMEMORY_AREA MemoryArea, - PVOID BaseAddress, - ULONG Length, - ULONG Protect, - PULONG OldProtect); +VOID +NTAPI +MmFreeVirtualMemory( + struct _EPROCESS* Process, + PMEMORY_AREA MemoryArea +); -NTSTATUS MmWritePageVirtualMemory(PMADDRESS_SPACE AddressSpace, - PMEMORY_AREA MArea, - PVOID Address, - PMM_PAGEOP PageOp); +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 +); /* kmap.c ********************************************************************/ -PVOID ExAllocatePage(VOID); +PVOID +NTAPI +ExAllocatePage(VOID); -VOID ExUnmapPage(PVOID Addr); +VOID +NTAPI +ExUnmapPage(PVOID Addr); -PVOID ExAllocatePageWithPhysPage(PFN_TYPE Page); +PVOID +NTAPI +ExAllocatePageWithPhysPage(PFN_TYPE Page); -NTSTATUS MiCopyFromUserPage(PFN_TYPE Page, PVOID SourceAddress); +NTSTATUS +NTAPI +MiCopyFromUserPage( + PFN_TYPE Page, + PVOID SourceAddress +); -NTSTATUS MiZeroPage(PFN_TYPE Page); +NTSTATUS +NTAPI +MiZeroPage(PFN_TYPE Page); /* memsafe.s *****************************************************************/ -PVOID FASTCALL MmSafeReadPtr(PVOID Source); +PVOID +FASTCALL +MmSafeReadPtr(PVOID Source); /* pageop.c ******************************************************************/ VOID +NTAPI MmReleasePageOp(PMM_PAGEOP PageOp); PMM_PAGEOP -MmGetPageOp(PMEMORY_AREA MArea, HANDLE Pid, PVOID Address, - PMM_SECTION_SEGMENT Segment, ULONG Offset, ULONG OpType, BOOL First); +NTAPI +MmGetPageOp( + PMEMORY_AREA MArea, + HANDLE Pid, + PVOID Address, + PMM_SECTION_SEGMENT Segment, + ULONG Offset, + ULONG OpType, + BOOL First +); + PMM_PAGEOP -MmCheckForPageOp(PMEMORY_AREA MArea, HANDLE Pid, PVOID Address, - PMM_SECTION_SEGMENT Segment, ULONG Offset); +NTAPI +MmCheckForPageOp( + PMEMORY_AREA MArea, + HANDLE Pid, + PVOID Address, + PMM_SECTION_SEGMENT Segment, + ULONG Offset +); + VOID +NTAPI MmInitializePageOp(VOID); /* process.c *****************************************************************/ @@ -604,297 +806,612 @@ MmDeleteKernelStack(PVOID Stack, /* balace.c ******************************************************************/ -VOID MmInitializeMemoryConsumer(ULONG Consumer, - NTSTATUS (*Trim)(ULONG Target, ULONG Priority, PULONG NrFreed)); +VOID +NTAPI +MmInitializeMemoryConsumer( + ULONG Consumer, + NTSTATUS (*Trim)(ULONG Target, ULONG Priority, PULONG NrFreed) +); -VOID MmInitializeBalancer(ULONG NrAvailablePages, ULONG NrSystemPages); +VOID +NTAPI +MmInitializeBalancer( + ULONG NrAvailablePages, + ULONG NrSystemPages +); -NTSTATUS MmReleasePageMemoryConsumer(ULONG Consumer, PFN_TYPE Page); +NTSTATUS +NTAPI +MmReleasePageMemoryConsumer( + ULONG Consumer, + PFN_TYPE Page +); -NTSTATUS MmRequestPageMemoryConsumer(ULONG Consumer, BOOLEAN MyWait, PPFN_TYPE AllocatedPage); +NTSTATUS +NTAPI +MmRequestPageMemoryConsumer( + ULONG Consumer, + BOOLEAN MyWait, + PPFN_TYPE AllocatedPage +); -VOID MiInitBalancerThread(VOID); +VOID +NTAPI +MiInitBalancerThread(VOID); -VOID MmRebalanceMemoryConsumers(VOID); +VOID +NTAPI +MmRebalanceMemoryConsumers(VOID); /* rmap.c **************************************************************/ -VOID MmSetRmapListHeadPage(PFN_TYPE Page, struct _MM_RMAP_ENTRY* ListHead); +VOID +NTAPI +MmSetRmapListHeadPage( + PFN_TYPE Page, + struct _MM_RMAP_ENTRY* ListHead +); -struct _MM_RMAP_ENTRY* MmGetRmapListHeadPage(PFN_TYPE Page); +struct _MM_RMAP_ENTRY* +NTAPI +MmGetRmapListHeadPage(PFN_TYPE Page); -VOID MmInsertRmap(PFN_TYPE Page, PEPROCESS Process, PVOID Address); +VOID +NTAPI +MmInsertRmap( + PFN_TYPE Page, + PEPROCESS Process, + PVOID Address +); -VOID MmDeleteAllRmaps(PFN_TYPE Page, PVOID Context, - VOID (*DeleteMapping)(PVOID Context, PEPROCESS Process, PVOID Address)); +VOID +NTAPI +MmDeleteAllRmaps( + PFN_TYPE Page, + PVOID Context, + VOID (*DeleteMapping)(PVOID Context, PEPROCESS Process, PVOID Address) +); -VOID MmDeleteRmap(PFN_TYPE Page, PEPROCESS Process, PVOID Address); +VOID +NTAPI +MmDeleteRmap( + PFN_TYPE Page, + PEPROCESS Process, + PVOID Address +); -VOID MmInitializeRmapList(VOID); +VOID +NTAPI +MmInitializeRmapList(VOID); -VOID MmSetCleanAllRmaps(PFN_TYPE Page); +VOID +NTAPI +MmSetCleanAllRmaps(PFN_TYPE Page); -VOID MmSetDirtyAllRmaps(PFN_TYPE Page); +VOID +NTAPI +MmSetDirtyAllRmaps(PFN_TYPE Page); -BOOL MmIsDirtyPageRmap(PFN_TYPE Page); +BOOL +NTAPI +MmIsDirtyPageRmap(PFN_TYPE Page); -NTSTATUS MmWritePagePhysicalAddress(PFN_TYPE Page); +NTSTATUS +NTAPI +MmWritePagePhysicalAddress(PFN_TYPE Page); -NTSTATUS MmPageOutPhysicalAddress(PFN_TYPE Page); +NTSTATUS +NTAPI +MmPageOutPhysicalAddress(PFN_TYPE Page); /* freelist.c **********************************************************/ -PFN_TYPE MmGetLRUNextUserPage(PFN_TYPE PreviousPage); +PFN_TYPE +NTAPI +MmGetLRUNextUserPage(PFN_TYPE PreviousPage); -PFN_TYPE MmGetLRUFirstUserPage(VOID); +PFN_TYPE +NTAPI +MmGetLRUFirstUserPage(VOID); -VOID MmSetLRULastPage(PFN_TYPE Page); +VOID +NTAPI +MmSetLRULastPage(PFN_TYPE Page); -VOID MmLockPage(PFN_TYPE Page); -VOID MmLockPageUnsafe(PFN_TYPE Page); +VOID +NTAPI +MmLockPage(PFN_TYPE Page); -VOID MmUnlockPage(PFN_TYPE Page); +VOID +NTAPI +MmLockPageUnsafe(PFN_TYPE Page); -ULONG MmGetLockCountPage(PFN_TYPE Page); +VOID +NTAPI +MmUnlockPage(PFN_TYPE Page); -PVOID MmInitializePageList(ULONG_PTR FirstPhysKernelAddress, - ULONG_PTR LastPhysKernelAddress, - ULONG MemorySizeInPages, - ULONG_PTR LastKernelBase, - PADDRESS_RANGE BIOSMemoryMap, - ULONG AddressRangeCount); +ULONG +NTAPI +MmGetLockCountPage(PFN_TYPE Page); -PFN_TYPE MmGetContinuousPages(ULONG NumberOfBytes, - PHYSICAL_ADDRESS LowestAcceptableAddress, - PHYSICAL_ADDRESS HighestAcceptableAddress, - PHYSICAL_ADDRESS BoundaryAddressMultiple); +PVOID +NTAPI +MmInitializePageList( + ULONG_PTR FirstPhysKernelAddress, + ULONG_PTR LastPhysKernelAddress, + ULONG MemorySizeInPages, + ULONG_PTR LastKernelBase, + PADDRESS_RANGE BIOSMemoryMap, + ULONG AddressRangeCount +); -NTSTATUS MmInitZeroPageThread(VOID); +PFN_TYPE +NTAPI +MmGetContinuousPages( + ULONG NumberOfBytes, + PHYSICAL_ADDRESS LowestAcceptableAddress, + PHYSICAL_ADDRESS HighestAcceptableAddress, + PHYSICAL_ADDRESS BoundaryAddressMultiple +); + +NTSTATUS +NTAPI +MmInitZeroPageThread(VOID); /* i386/page.c *********************************************************/ -PVOID MmCreateHyperspaceMapping(PFN_TYPE Page); +PVOID +NTAPI +MmCreateHyperspaceMapping(PFN_TYPE Page); -PFN_TYPE MmChangeHyperspaceMapping(PVOID Address, PFN_TYPE Page); +PFN_TYPE +NTAPI +MmChangeHyperspaceMapping( + PVOID Address, + PFN_TYPE Page +); -PFN_TYPE MmDeleteHyperspaceMapping(PVOID Address); +PFN_TYPE +NTAPI +MmDeleteHyperspaceMapping(PVOID Address); -NTSTATUS MmCreateVirtualMappingForKernel(PVOID Address, - ULONG flProtect, - PPFN_TYPE Pages, - ULONG PageCount); +NTSTATUS +NTAPI +MmCreateVirtualMappingForKernel( + PVOID Address, + ULONG flProtect, + PPFN_TYPE Pages, + ULONG PageCount +); -NTSTATUS MmCommitPagedPoolAddress(PVOID Address, BOOLEAN Locked); +NTSTATUS +NTAPI +MmCommitPagedPoolAddress( + PVOID Address, + BOOLEAN Locked +); -NTSTATUS MmCreateVirtualMapping(struct _EPROCESS* Process, - PVOID Address, - ULONG flProtect, - PPFN_TYPE Pages, - ULONG PageCount); +NTSTATUS +NTAPI +MmCreateVirtualMapping( + struct _EPROCESS* Process, + PVOID Address, + ULONG flProtect, + PPFN_TYPE Pages, + ULONG PageCount +); -NTSTATUS MmCreateVirtualMappingUnsafe(struct _EPROCESS* Process, - PVOID Address, - ULONG flProtect, - PPFN_TYPE Pages, - ULONG PageCount); +NTSTATUS +NTAPI +MmCreateVirtualMappingUnsafe( + struct _EPROCESS* Process, + PVOID Address, + ULONG flProtect, + PPFN_TYPE Pages, + ULONG PageCount +); -ULONG MmGetPageProtect(struct _EPROCESS* Process, PVOID Address); +ULONG +NTAPI +MmGetPageProtect( + struct _EPROCESS* Process, + PVOID Address); -VOID MmSetPageProtect(struct _EPROCESS* Process, - PVOID Address, - ULONG flProtect); +VOID +NTAPI +MmSetPageProtect( + struct _EPROCESS* Process, + PVOID Address, + ULONG flProtect +); -BOOLEAN MmIsPagePresent(struct _EPROCESS* Process, - PVOID Address); +BOOLEAN +NTAPI +MmIsPagePresent( + struct _EPROCESS* Process, + PVOID Address +); -VOID MmInitGlobalKernelPageDirectory(VOID); +VOID +NTAPI +MmInitGlobalKernelPageDirectory(VOID); -VOID MmDisableVirtualMapping(PEPROCESS Process, PVOID Address, BOOL* WasDirty, PPFN_TYPE Page); +VOID +NTAPI +MmDisableVirtualMapping( + PEPROCESS Process, + PVOID Address, + BOOL* WasDirty, + PPFN_TYPE Page +); -VOID MmEnableVirtualMapping(PEPROCESS Process, PVOID Address); +VOID +NTAPI +MmEnableVirtualMapping( + PEPROCESS Process, + PVOID Address +); -VOID MmRawDeleteVirtualMapping(PVOID Address); +VOID +NTAPI +MmRawDeleteVirtualMapping(PVOID Address); -VOID MmDeletePageFileMapping(PEPROCESS Process, PVOID Address, SWAPENTRY* SwapEntry); +VOID +NTAPI +MmDeletePageFileMapping( + PEPROCESS Process, + PVOID Address, + SWAPENTRY* SwapEntry +); -NTSTATUS MmCreatePageFileMapping(PEPROCESS Process, PVOID Address, SWAPENTRY SwapEntry); +NTSTATUS +NTAPI +MmCreatePageFileMapping( + PEPROCESS Process, + PVOID Address, + SWAPENTRY SwapEntry +); -BOOLEAN MmIsPageSwapEntry(PEPROCESS Process, PVOID Address); +BOOLEAN +NTAPI +MmIsPageSwapEntry( + PEPROCESS Process, + PVOID Address +); -VOID MmTransferOwnershipPage(PFN_TYPE Page, ULONG NewConsumer); +VOID +NTAPI +MmTransferOwnershipPage( + PFN_TYPE Page, + ULONG NewConsumer +); -VOID MmSetDirtyPage(PEPROCESS Process, PVOID Address); +VOID +NTAPI +MmSetDirtyPage( + PEPROCESS Process, + PVOID Address +); -PFN_TYPE MmAllocPage(ULONG Consumer, SWAPENTRY SavedSwapEntry); +PFN_TYPE +NTAPI +MmAllocPage( + ULONG Consumer, + SWAPENTRY SavedSwapEntry +); -LONG MmAllocPagesSpecifyRange(ULONG Consumer, - PHYSICAL_ADDRESS LowestAddress, - PHYSICAL_ADDRESS HighestAddress, - ULONG NumberOfPages, - PPFN_TYPE Pages); +LONG +NTAPI +MmAllocPagesSpecifyRange( + ULONG Consumer, + PHYSICAL_ADDRESS LowestAddress, + PHYSICAL_ADDRESS HighestAddress, + ULONG NumberOfPages, + PPFN_TYPE Pages +); -VOID MmDereferencePage(PFN_TYPE Page); +VOID +NTAPI +MmDereferencePage(PFN_TYPE Page); -VOID MmReferencePage(PFN_TYPE Page); -VOID MmReferencePageUnsafe(PFN_TYPE Page); +VOID +NTAPI +MmReferencePage(PFN_TYPE Page); -BOOLEAN MmIsAccessedAndResetAccessPage(struct _EPROCESS* Process, PVOID Address); +VOID +NTAPI +MmReferencePageUnsafe(PFN_TYPE Page); -ULONG MmGetReferenceCountPage(PFN_TYPE Page); +BOOLEAN +NTAPI +MmIsAccessedAndResetAccessPage( + PEPROCESS Process, + PVOID Address +); -BOOLEAN MmIsUsablePage(PFN_TYPE Page); +ULONG +NTAPI +MmGetReferenceCountPage(PFN_TYPE Page); -VOID MmSetFlagsPage(PFN_TYPE Page, ULONG Flags); +BOOLEAN +NTAPI +MmIsUsablePage(PFN_TYPE Page); -ULONG MmGetFlagsPage(PFN_TYPE Page); +VOID +NTAPI +MmSetFlagsPage( + PFN_TYPE Page, + ULONG Flags); -VOID MmSetSavedSwapEntryPage(PFN_TYPE Page, SWAPENTRY SavedSwapEntry); +ULONG +NTAPI +MmGetFlagsPage(PFN_TYPE Page); -SWAPENTRY MmGetSavedSwapEntryPage(PFN_TYPE Page); +VOID +NTAPI +MmSetSavedSwapEntryPage( + PFN_TYPE Page, + SWAPENTRY SavedSwapEntry); -VOID MmSetCleanPage(struct _EPROCESS* Process, PVOID Address); +SWAPENTRY +NTAPI +MmGetSavedSwapEntryPage(PFN_TYPE Page); -NTSTATUS MmCreatePageTable(PVOID PAddress); +VOID +NTAPI +MmSetCleanPage( + PEPROCESS Process, + PVOID Address +); -VOID MmDeletePageTable(struct _EPROCESS* Process, PVOID Address); +NTSTATUS +NTAPI +MmCreatePageTable(PVOID PAddress); -PFN_TYPE MmGetPfnForProcess(struct _EPROCESS* Process, PVOID Address); +VOID +NTAPI +MmDeletePageTable( + PEPROCESS Process, + PVOID Address +); + +PFN_TYPE +NTAPI +MmGetPfnForProcess( + PEPROCESS Process, + PVOID Address +); NTSTATUS STDCALL -MmCopyMmInfo(struct _EPROCESS* Src, - struct _EPROCESS* Dest, - PPHYSICAL_ADDRESS DirectoryTableBase); +MmCopyMmInfo( + PEPROCESS Src, + PEPROCESS Dest, + PPHYSICAL_ADDRESS DirectoryTableBase +); -NTSTATUS MmReleaseMmInfo(struct _EPROCESS* Process); +NTSTATUS +NTAPI +MmReleaseMmInfo(PEPROCESS Process); -NTSTATUS Mmi386ReleaseMmInfo(struct _EPROCESS* Process); +NTSTATUS +NTAPI +Mmi386ReleaseMmInfo(PEPROCESS Process); -VOID MmDeleteVirtualMapping(struct _EPROCESS* Process, - PVOID Address, - BOOL FreePage, - BOOL* WasDirty, - PPFN_TYPE Page); +VOID +NTAPI +MmDeleteVirtualMapping( + PEPROCESS Process, + PVOID Address, + BOOL FreePage, + BOOL* WasDirty, + PPFN_TYPE Page +); -BOOLEAN MmIsDirtyPage(struct _EPROCESS* Process, PVOID Address); +BOOLEAN +NTAPI +MmIsDirtyPage( + PEPROCESS Process, + PVOID Address +); -VOID MmMarkPageMapped(PFN_TYPE Page); +VOID +NTAPI +MmMarkPageMapped(PFN_TYPE Page); -VOID MmMarkPageUnmapped(PFN_TYPE Page); +VOID +NTAPI +MmMarkPageUnmapped(PFN_TYPE Page); -VOID MmUpdatePageDir(PEPROCESS Process, PVOID Address, ULONG Size); +VOID +NTAPI +MmUpdatePageDir( + PEPROCESS Process, + PVOID Address, + ULONG Size +); -VOID MiInitPageDirectoryMap(VOID); +VOID +NTAPI +MiInitPageDirectoryMap(VOID); -ULONG MiGetUserPageDirectoryCount(VOID); +ULONG +NTAPI +MiGetUserPageDirectoryCount(VOID); /* wset.c ********************************************************************/ -NTSTATUS MmTrimUserMemory(ULONG Target, ULONG Priority, PULONG NrFreedPages); +NTSTATUS +MmTrimUserMemory( + ULONG Target, + ULONG Priority, + PULONG NrFreedPages +); /* cont.c ********************************************************************/ -PVOID STDCALL -MmAllocateContiguousMemorySpecifyCache(IN SIZE_T NumberOfBytes, - IN PHYSICAL_ADDRESS LowestAcceptableAddress, - IN PHYSICAL_ADDRESS HighestAcceptableAddress, - IN PHYSICAL_ADDRESS BoundaryAddressMultiple OPTIONAL, - IN MEMORY_CACHING_TYPE CacheType OPTIONAL); - +PVOID +STDCALL +MmAllocateContiguousMemorySpecifyCache( + IN SIZE_T NumberOfBytes, + IN PHYSICAL_ADDRESS LowestAcceptableAddress, + IN PHYSICAL_ADDRESS HighestAcceptableAddress, + IN PHYSICAL_ADDRESS BoundaryAddressMultiple OPTIONAL, + IN MEMORY_CACHING_TYPE CacheType OPTIONAL +); + /* region.c ************************************************************/ -NTSTATUS MmAlterRegion(PMADDRESS_SPACE AddressSpace, PVOID BaseAddress, - PLIST_ENTRY RegionListHead, PVOID StartAddress, ULONG Length, - ULONG NewType, ULONG NewProtect, - PMM_ALTER_REGION_FUNC AlterFunc); +NTSTATUS +NTAPI +MmAlterRegion( + PMADDRESS_SPACE AddressSpace, + PVOID BaseAddress, + PLIST_ENTRY RegionListHead, + PVOID StartAddress, + ULONG Length, + ULONG NewType, + ULONG NewProtect, + PMM_ALTER_REGION_FUNC AlterFunc +); -VOID MmInitialiseRegion(PLIST_ENTRY RegionListHead, ULONG Length, ULONG Type, - ULONG Protect); +VOID +NTAPI +MmInitialiseRegion( + PLIST_ENTRY RegionListHead, + ULONG Length, + ULONG Type, + ULONG Protect +); -PMM_REGION MmFindRegion(PVOID BaseAddress, PLIST_ENTRY RegionListHead, PVOID Address, - PVOID* RegionBaseAddress); +PMM_REGION +NTAPI +MmFindRegion( + PVOID BaseAddress, + PLIST_ENTRY RegionListHead, + PVOID Address, + PVOID* RegionBaseAddress +); /* section.c *****************************************************************/ -PVOID STDCALL -MmAllocateSection (IN ULONG Length, PVOID BaseAddress); - -NTSTATUS STDCALL -MmQuerySectionView(PMEMORY_AREA MemoryArea, - PVOID Address, - PMEMORY_BASIC_INFORMATION Info, - PULONG ResultLength); +PVOID +STDCALL +MmAllocateSection( + IN ULONG Length, + PVOID BaseAddress +); NTSTATUS -MmProtectSectionView(PMADDRESS_SPACE AddressSpace, - PMEMORY_AREA MemoryArea, - PVOID BaseAddress, - ULONG Length, - ULONG Protect, - PULONG OldProtect); +STDCALL +MmQuerySectionView( + PMEMORY_AREA MemoryArea, + PVOID Address, + PMEMORY_BASIC_INFORMATION Info, + PULONG ResultLength +); NTSTATUS -MmWritePageSectionView(PMADDRESS_SPACE AddressSpace, - PMEMORY_AREA MArea, - PVOID Address, - PMM_PAGEOP PageOp); +NTAPI +MmProtectSectionView( + PMADDRESS_SPACE AddressSpace, + PMEMORY_AREA MemoryArea, + PVOID BaseAddress, + ULONG Length, + ULONG Protect, + PULONG OldProtect +); -NTSTATUS MmInitSectionImplementation(VOID); +NTSTATUS +NTAPI +MmWritePageSectionView( + PMADDRESS_SPACE AddressSpace, + PMEMORY_AREA MArea, + PVOID Address, + PMM_PAGEOP PageOp +); + +NTSTATUS +NTAPI +MmInitSectionImplementation(VOID); NTSTATUS STDCALL -MmCreateSection (OUT PSECTION_OBJECT * SectionObject, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL, - IN PLARGE_INTEGER MaximumSize, - IN ULONG SectionPageProtection, - IN ULONG AllocationAttributes, - IN HANDLE FileHandle OPTIONAL, - IN PFILE_OBJECT File OPTIONAL); +MmCreateSection( + OUT PSECTION_OBJECT *SectionObject, + IN ACCESS_MASK DesiredAccess, + IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL, + IN PLARGE_INTEGER MaximumSize, + IN ULONG SectionPageProtection, + IN ULONG AllocationAttributes, + IN HANDLE FileHandle OPTIONAL, + IN PFILE_OBJECT File OPTIONAL +); NTSTATUS -MmNotPresentFaultSectionView(PMADDRESS_SPACE AddressSpace, - MEMORY_AREA* MemoryArea, - PVOID Address, - BOOLEAN Locked); +NTAPI +MmNotPresentFaultSectionView( + PMADDRESS_SPACE AddressSpace, + MEMORY_AREA* MemoryArea, + PVOID Address, + BOOLEAN Locked +); NTSTATUS -MmPageOutSectionView(PMADDRESS_SPACE AddressSpace, - PMEMORY_AREA MemoryArea, - PVOID Address, - struct _MM_PAGEOP* PageOp); +NTAPI +MmPageOutSectionView( + PMADDRESS_SPACE AddressSpace, + PMEMORY_AREA MemoryArea, + PVOID Address, + struct _MM_PAGEOP *PageOp +); NTSTATUS +NTAPI MmCreatePhysicalMemorySection(VOID); NTSTATUS -MmAccessFaultSectionView(PMADDRESS_SPACE AddressSpace, - MEMORY_AREA* MemoryArea, - PVOID Address, - BOOLEAN Locked); +NTAPI +MmAccessFaultSectionView( + PMADDRESS_SPACE AddressSpace, + MEMORY_AREA* MemoryArea, + PVOID Address, + BOOLEAN Locked +); VOID +NTAPI MmFreeSectionSegments(PFILE_OBJECT FileObject); /* mpw.c *********************************************************************/ -NTSTATUS MmInitMpwThread(VOID); +NTSTATUS +NTAPI +MmInitMpwThread(VOID); /* pager.c *******************************************************************/ -BOOLEAN MiIsPagerThread(VOID); +BOOLEAN +NTAPI +MiIsPagerThread(VOID); -VOID MiStartPagerThread(VOID); +VOID +NTAPI +MiStartPagerThread(VOID); -VOID MiStopPagerThread(VOID); +VOID +NTAPI +MiStopPagerThread(VOID); - -NTSTATUS FASTCALL -MiQueryVirtualMemory (IN HANDLE ProcessHandle, - IN PVOID Address, - IN CINT VirtualMemoryInformationClass, - OUT PVOID VirtualMemoryInformation, - IN ULONG Length, - OUT PULONG ResultLength); +NTSTATUS +FASTCALL +MiQueryVirtualMemory( + IN HANDLE ProcessHandle, + IN PVOID Address, + IN CINT VirtualMemoryInformationClass, + OUT PVOID VirtualMemoryInformation, + IN ULONG Length, + OUT PULONG ResultLength +); #endif diff --git a/reactos/ntoskrnl/include/internal/ntoskrnl.h b/reactos/ntoskrnl/include/internal/ntoskrnl.h index 6ca0b8a933a..ac39b77ffb2 100644 --- a/reactos/ntoskrnl/include/internal/ntoskrnl.h +++ b/reactos/ntoskrnl/include/internal/ntoskrnl.h @@ -28,7 +28,7 @@ #include "v86m.h" #include "fs.h" #include "port.h" -#include "nls.h" +#include "rtl.h" #ifdef KDBG #include "../kdbg/kdb.h" #endif diff --git a/reactos/ntoskrnl/include/internal/nls.h b/reactos/ntoskrnl/include/internal/rtl.h similarity index 84% rename from reactos/ntoskrnl/include/internal/nls.h rename to reactos/ntoskrnl/include/internal/rtl.h index b3e4b69ba7f..5cc346f9249 100644 --- a/reactos/ntoskrnl/include/internal/nls.h +++ b/reactos/ntoskrnl/include/internal/rtl.h @@ -10,32 +10,37 @@ extern ULONG NlsUnicodeTableOffset; extern PUSHORT NlsUnicodeUpcaseTable; extern PUSHORT NlsUnicodeLowercaseTable; -VOID -STDCALL +VOID +STDCALL RtlpInitNls(VOID); VOID +NTAPI RtlpImportAnsiCodePage( - PUSHORT TableBase, + PUSHORT TableBase, ULONG Size ); VOID +NTAPI RtlpImportOemCodePage( - PUSHORT TableBase, + PUSHORT TableBase, ULONG Size ); VOID +NTAPI RtlpImportUnicodeCasemap( - PUSHORT TableBase, + PUSHORT TableBase, ULONG Size ); VOID +NTAPI RtlpCreateInitialNlsTables(VOID); VOID +NTAPI RtlpCreateNlsSection(VOID); #endif /* __NTOSKRNL_INCLUDE_INTERNAL_NLS_H */ diff --git a/reactos/ntoskrnl/mm/anonmem.c b/reactos/ntoskrnl/mm/anonmem.c index 9296d839ab9..e880d56ad03 100644 --- a/reactos/ntoskrnl/mm/anonmem.c +++ b/reactos/ntoskrnl/mm/anonmem.c @@ -48,6 +48,7 @@ /* FUNCTIONS *****************************************************************/ NTSTATUS +NTAPI MmWritePageVirtualMemory(PMADDRESS_SPACE AddressSpace, PMEMORY_AREA MemoryArea, PVOID Address, @@ -129,6 +130,7 @@ MmWritePageVirtualMemory(PMADDRESS_SPACE AddressSpace, } NTSTATUS +NTAPI MmPageOutVirtualMemory(PMADDRESS_SPACE AddressSpace, PMEMORY_AREA MemoryArea, PVOID Address, @@ -232,6 +234,7 @@ MmPageOutVirtualMemory(PMADDRESS_SPACE AddressSpace, } NTSTATUS +NTAPI MmNotPresentFaultVirtualMemory(PMADDRESS_SPACE AddressSpace, MEMORY_AREA* MemoryArea, PVOID Address, @@ -789,6 +792,7 @@ MmFreeVirtualMemoryPage(PVOID Context, } VOID +NTAPI MmFreeVirtualMemory(PEPROCESS Process, PMEMORY_AREA MemoryArea) { @@ -954,6 +958,7 @@ NtFreeVirtualMemory(IN HANDLE ProcessHandle, } NTSTATUS +NTAPI MmProtectAnonMem(PMADDRESS_SPACE AddressSpace, PMEMORY_AREA MemoryArea, PVOID BaseAddress, diff --git a/reactos/ntoskrnl/mm/aspace.c b/reactos/ntoskrnl/mm/aspace.c index efd4fb7fb7c..281c1b47c42 100644 --- a/reactos/ntoskrnl/mm/aspace.c +++ b/reactos/ntoskrnl/mm/aspace.c @@ -20,6 +20,7 @@ STATIC MADDRESS_SPACE KernelAddressSpace; /* FUNCTIONS *****************************************************************/ VOID +NTAPI MmLockAddressSpace(PMADDRESS_SPACE AddressSpace) { /* @@ -33,6 +34,7 @@ MmLockAddressSpace(PMADDRESS_SPACE AddressSpace) } VOID +NTAPI MmUnlockAddressSpace(PMADDRESS_SPACE AddressSpace) { /* @@ -45,23 +47,30 @@ MmUnlockAddressSpace(PMADDRESS_SPACE AddressSpace) ExReleaseFastMutex(&AddressSpace->Lock); } -VOID INIT_FUNCTION +VOID +INIT_FUNCTION +NTAPI MmInitializeKernelAddressSpace(VOID) { MmInitializeAddressSpace(NULL, &KernelAddressSpace); } -PMADDRESS_SPACE MmGetCurrentAddressSpace(VOID) +PMADDRESS_SPACE +NTAPI +MmGetCurrentAddressSpace(VOID) { return(&PsGetCurrentProcess()->AddressSpace); } -PMADDRESS_SPACE MmGetKernelAddressSpace(VOID) +PMADDRESS_SPACE +NTAPI +MmGetKernelAddressSpace(VOID) { return(&KernelAddressSpace); } NTSTATUS +NTAPI MmInitializeAddressSpace(PEPROCESS Process, PMADDRESS_SPACE AddressSpace) { @@ -95,6 +104,7 @@ MmInitializeAddressSpace(PEPROCESS Process, } NTSTATUS +NTAPI MmDestroyAddressSpace(PMADDRESS_SPACE AddressSpace) { if (AddressSpace->PageTableRefCountTable != NULL) diff --git a/reactos/ntoskrnl/mm/balance.c b/reactos/ntoskrnl/mm/balance.c index 3c7f9155ef4..7bde7660138 100644 --- a/reactos/ntoskrnl/mm/balance.c +++ b/reactos/ntoskrnl/mm/balance.c @@ -49,7 +49,9 @@ VOID MmPrintMemoryStatistic(VOID) MmStats.NrFreePages); } -VOID INIT_FUNCTION +VOID +INIT_FUNCTION +NTAPI MmInitializeBalancer(ULONG NrAvailablePages, ULONG NrSystemPages) { memset(MiMemoryConsumers, 0, sizeof(MiMemoryConsumers)); @@ -68,7 +70,9 @@ MmInitializeBalancer(ULONG NrAvailablePages, ULONG NrSystemPages) MiMemoryConsumers[MC_NPPOOL].PagesUsed = NrSystemPages; } -VOID INIT_FUNCTION +VOID +INIT_FUNCTION +NTAPI MmInitializeMemoryConsumer(ULONG Consumer, NTSTATUS (*Trim)(ULONG Target, ULONG Priority, PULONG NrFreed)) @@ -77,6 +81,7 @@ MmInitializeMemoryConsumer(ULONG Consumer, } NTSTATUS +NTAPI MmReleasePageMemoryConsumer(ULONG Consumer, PFN_TYPE Page) { PMM_ALLOCATION_REQUEST Request; @@ -117,6 +122,7 @@ MmReleasePageMemoryConsumer(ULONG Consumer, PFN_TYPE Page) } VOID +NTAPI MiTrimMemoryConsumer(ULONG Consumer) { LONG Target; @@ -136,6 +142,7 @@ MiTrimMemoryConsumer(ULONG Consumer) } VOID +NTAPI MmRebalanceMemoryConsumers(VOID) { LONG Target; @@ -168,6 +175,7 @@ MiIsBalancerThread(VOID) } NTSTATUS +NTAPI MmRequestPageMemoryConsumer(ULONG Consumer, BOOLEAN CanWait, PPFN_TYPE AllocatedPage) { @@ -353,7 +361,9 @@ MiBalancerThread(PVOID Unused) } } -VOID INIT_FUNCTION +VOID +INIT_FUNCTION +NTAPI MiInitBalancerThread(VOID) { KPRIORITY Priority; diff --git a/reactos/ntoskrnl/mm/freelist.c b/reactos/ntoskrnl/mm/freelist.c index 222109f3f8c..2dc9138e440 100644 --- a/reactos/ntoskrnl/mm/freelist.c +++ b/reactos/ntoskrnl/mm/freelist.c @@ -66,6 +66,7 @@ static ULONG UnzeroedPageCount = 0; /* FUNCTIONS *************************************************************/ VOID +NTAPI MmTransferOwnershipPage(PFN_TYPE Pfn, ULONG NewConsumer) { KIRQL oldIrql; @@ -95,6 +96,7 @@ MmTransferOwnershipPage(PFN_TYPE Pfn, ULONG NewConsumer) } PFN_TYPE +NTAPI MmGetLRUFirstUserPage(VOID) { PLIST_ENTRY NextListEntry; @@ -114,6 +116,7 @@ MmGetLRUFirstUserPage(VOID) } VOID +NTAPI MmSetLRULastPage(PFN_TYPE Pfn) { KIRQL oldIrql; @@ -131,6 +134,7 @@ MmSetLRULastPage(PFN_TYPE Pfn) } PFN_TYPE +NTAPI MmGetLRUNextUserPage(PFN_TYPE PreviousPfn) { PLIST_ENTRY NextListEntry; @@ -158,6 +162,7 @@ MmGetLRUNextUserPage(PFN_TYPE PreviousPfn) } PFN_TYPE +NTAPI MmGetContinuousPages(ULONG NumberOfBytes, PHYSICAL_ADDRESS LowestAcceptableAddress, PHYSICAL_ADDRESS HighestAcceptableAddress, @@ -261,6 +266,7 @@ MmGetContinuousPages(ULONG NumberOfBytes, BOOLEAN +NTAPI MiIsPfnRam(PADDRESS_RANGE BIOSMemoryMap, ULONG AddressRangeCount, PFN_TYPE Pfn) @@ -301,7 +307,9 @@ MiIsPfnRam(PADDRESS_RANGE BIOSMemoryMap, } -PVOID INIT_FUNCTION +PVOID +INIT_FUNCTION +NTAPI MmInitializePageList(ULONG_PTR FirstPhysKernelAddress, ULONG_PTR LastPhysKernelAddress, ULONG MemorySizeInPages, @@ -536,6 +544,7 @@ MmInitializePageList(ULONG_PTR FirstPhysKernelAddress, } VOID +NTAPI MmSetFlagsPage(PFN_TYPE Pfn, ULONG Flags) { KIRQL oldIrql; @@ -547,18 +556,21 @@ MmSetFlagsPage(PFN_TYPE Pfn, ULONG Flags) } VOID +NTAPI MmSetRmapListHeadPage(PFN_TYPE Pfn, struct _MM_RMAP_ENTRY* ListHead) { MmPageArray[Pfn].RmapListHead = ListHead; } struct _MM_RMAP_ENTRY* +NTAPI MmGetRmapListHeadPage(PFN_TYPE Pfn) { return(MmPageArray[Pfn].RmapListHead); } VOID +NTAPI MmMarkPageMapped(PFN_TYPE Pfn) { KIRQL oldIrql; @@ -577,6 +589,7 @@ MmMarkPageMapped(PFN_TYPE Pfn) } VOID +NTAPI MmMarkPageUnmapped(PFN_TYPE Pfn) { KIRQL oldIrql; @@ -600,6 +613,7 @@ MmMarkPageUnmapped(PFN_TYPE Pfn) } ULONG +NTAPI MmGetFlagsPage(PFN_TYPE Pfn) { KIRQL oldIrql; @@ -615,6 +629,7 @@ MmGetFlagsPage(PFN_TYPE Pfn) VOID +NTAPI MmSetSavedSwapEntryPage(PFN_TYPE Pfn, SWAPENTRY SavedSwapEntry) { KIRQL oldIrql; @@ -626,6 +641,7 @@ MmSetSavedSwapEntryPage(PFN_TYPE Pfn, SWAPENTRY SavedSwapEntry) } SWAPENTRY +NTAPI MmGetSavedSwapEntryPage(PFN_TYPE Pfn) { SWAPENTRY SavedSwapEntry; @@ -640,6 +656,7 @@ MmGetSavedSwapEntryPage(PFN_TYPE Pfn) } VOID +NTAPI MmReferencePageUnsafe(PFN_TYPE Pfn) { KIRQL oldIrql; @@ -664,6 +681,7 @@ MmReferencePageUnsafe(PFN_TYPE Pfn) } VOID +NTAPI MmReferencePage(PFN_TYPE Pfn) { DPRINT("MmReferencePage(PysicalAddress %x)\n", Pfn << PAGE_SHIFT); @@ -677,6 +695,7 @@ MmReferencePage(PFN_TYPE Pfn) } ULONG +NTAPI MmGetReferenceCountPage(PFN_TYPE Pfn) { KIRQL oldIrql; @@ -704,6 +723,7 @@ MmGetReferenceCountPage(PFN_TYPE Pfn) } BOOLEAN +NTAPI MmIsUsablePage(PFN_TYPE Pfn) { @@ -724,6 +744,7 @@ MmIsUsablePage(PFN_TYPE Pfn) } VOID +NTAPI MmDereferencePage(PFN_TYPE Pfn) { KIRQL oldIrql; @@ -795,6 +816,7 @@ MmDereferencePage(PFN_TYPE Pfn) } ULONG +NTAPI MmGetLockCountPage(PFN_TYPE Pfn) { KIRQL oldIrql; @@ -822,6 +844,7 @@ MmGetLockCountPage(PFN_TYPE Pfn) } VOID +NTAPI MmLockPageUnsafe(PFN_TYPE Pfn) { KIRQL oldIrql; @@ -846,6 +869,7 @@ MmLockPageUnsafe(PFN_TYPE Pfn) } VOID +NTAPI MmLockPage(PFN_TYPE Pfn) { DPRINT("MmLockPage(PhysicalAddress %x)\n", Pfn << PAGE_SHIFT); @@ -859,6 +883,7 @@ MmLockPage(PFN_TYPE Pfn) } VOID +NTAPI MmUnlockPage(PFN_TYPE Pfn) { KIRQL oldIrql; @@ -883,6 +908,7 @@ MmUnlockPage(PFN_TYPE Pfn) } PFN_TYPE +NTAPI MmAllocPage(ULONG Consumer, SWAPENTRY SavedSwapEntry) { PFN_TYPE PfnOffset; @@ -958,6 +984,7 @@ MmAllocPage(ULONG Consumer, SWAPENTRY SavedSwapEntry) } LONG +NTAPI MmAllocPagesSpecifyRange(ULONG Consumer, PHYSICAL_ADDRESS LowestAddress, PHYSICAL_ADDRESS HighestAddress, @@ -1174,7 +1201,9 @@ MmZeroPageThreadMain(PVOID Ignored) } } -NTSTATUS INIT_FUNCTION +NTSTATUS +INIT_FUNCTION +NTAPI MmInitZeroPageThread(VOID) { NTSTATUS Status; diff --git a/reactos/ntoskrnl/mm/i386/page.c b/reactos/ntoskrnl/mm/i386/page.c index 2f6725a76bf..13fe1f26a79 100644 --- a/reactos/ntoskrnl/mm/i386/page.c +++ b/reactos/ntoskrnl/mm/i386/page.c @@ -195,7 +195,9 @@ ProtectToPTE(ULONG flProtect) #define PAE_ADDR_TO_PTE_OFFSET(v) ((((ULONG_PTR)(v)) % (512 * PAGE_SIZE)) / PAGE_SIZE) -NTSTATUS Mmi386ReleaseMmInfo(PEPROCESS Process) +NTSTATUS +NTAPI +Mmi386ReleaseMmInfo(PEPROCESS Process) { PUSHORT LdtDescriptor; ULONG LdtBase; @@ -398,7 +400,9 @@ MmCopyMmInfo(PEPROCESS Src, return(STATUS_SUCCESS); } -VOID MmDeletePageTable(PEPROCESS Process, PVOID Address) +VOID +NTAPI +MmDeletePageTable(PEPROCESS Process, PVOID Address) { PEPROCESS CurrentProcess = PsGetCurrentProcess(); @@ -429,7 +433,9 @@ VOID MmDeletePageTable(PEPROCESS Process, PVOID Address) } } -VOID MmFreePageTable(PEPROCESS Process, PVOID Address) +VOID +NTAPI +MmFreePageTable(PEPROCESS Process, PVOID Address) { PEPROCESS CurrentProcess = PsGetCurrentProcess(); ULONG i; @@ -755,6 +761,7 @@ static ULONG MmGetPageEntryForProcess(PEPROCESS Process, PVOID Address) } PFN_TYPE +NTAPI MmGetPfnForProcess(PEPROCESS Process, PVOID Address) { @@ -782,6 +789,7 @@ MmGetPfnForProcess(PEPROCESS Process, } VOID +NTAPI MmDisableVirtualMapping(PEPROCESS Process, PVOID Address, BOOL* WasDirty, PPFN_TYPE Page) /* * FUNCTION: Delete a virtual mapping @@ -867,6 +875,7 @@ MmDisableVirtualMapping(PEPROCESS Process, PVOID Address, BOOL* WasDirty, PPFN_T } VOID +NTAPI MmRawDeleteVirtualMapping(PVOID Address) { if (Ke386Pae) @@ -900,6 +909,7 @@ MmRawDeleteVirtualMapping(PVOID Address) } VOID +NTAPI MmDeleteVirtualMapping(PEPROCESS Process, PVOID Address, BOOL FreePage, BOOL* WasDirty, PPFN_TYPE Page) /* @@ -1043,6 +1053,7 @@ MmDeleteVirtualMapping(PEPROCESS Process, PVOID Address, BOOL FreePage, } VOID +NTAPI MmDeletePageFileMapping(PEPROCESS Process, PVOID Address, SWAPENTRY* SwapEntry) /* @@ -1180,7 +1191,9 @@ Mmi386MakeKernelPageTableGlobal(PVOID PAddress) return(FALSE); } -BOOLEAN MmIsDirtyPage(PEPROCESS Process, PVOID Address) +BOOLEAN +NTAPI +MmIsDirtyPage(PEPROCESS Process, PVOID Address) { if (Ke386Pae) { @@ -1193,6 +1206,7 @@ BOOLEAN MmIsDirtyPage(PEPROCESS Process, PVOID Address) } BOOLEAN +NTAPI MmIsAccessedAndResetAccessPage(PEPROCESS Process, PVOID Address) { if (Address < MmSystemRangeStart && Process == NULL) @@ -1258,7 +1272,9 @@ MmIsAccessedAndResetAccessPage(PEPROCESS Process, PVOID Address) } } -VOID MmSetCleanPage(PEPROCESS Process, PVOID Address) +VOID +NTAPI +MmSetCleanPage(PEPROCESS Process, PVOID Address) { if (Address < MmSystemRangeStart && Process == NULL) { @@ -1321,7 +1337,9 @@ VOID MmSetCleanPage(PEPROCESS Process, PVOID Address) } } -VOID MmSetDirtyPage(PEPROCESS Process, PVOID Address) +VOID +NTAPI +MmSetDirtyPage(PEPROCESS Process, PVOID Address) { if (Address < MmSystemRangeStart && Process == NULL) { @@ -1380,7 +1398,9 @@ VOID MmSetDirtyPage(PEPROCESS Process, PVOID Address) } } -VOID MmEnableVirtualMapping(PEPROCESS Process, PVOID Address) +VOID +NTAPI +MmEnableVirtualMapping(PEPROCESS Process, PVOID Address) { if (Ke386Pae) { @@ -1434,7 +1454,9 @@ VOID MmEnableVirtualMapping(PEPROCESS Process, PVOID Address) } } -BOOLEAN MmIsPagePresent(PEPROCESS Process, PVOID Address) +BOOLEAN +NTAPI +MmIsPagePresent(PEPROCESS Process, PVOID Address) { if (Ke386Pae) { @@ -1446,7 +1468,9 @@ BOOLEAN MmIsPagePresent(PEPROCESS Process, PVOID Address) } } -BOOLEAN MmIsPageSwapEntry(PEPROCESS Process, PVOID Address) +BOOLEAN +NTAPI +MmIsPageSwapEntry(PEPROCESS Process, PVOID Address) { if (Ke386Pae) { @@ -1463,6 +1487,7 @@ BOOLEAN MmIsPageSwapEntry(PEPROCESS Process, PVOID Address) } NTSTATUS +NTAPI MmCreateVirtualMappingForKernel(PVOID Address, ULONG flProtect, PPFN_TYPE Pages, @@ -1590,6 +1615,7 @@ MmCreateVirtualMappingForKernel(PVOID Address, } NTSTATUS +NTAPI MmCreatePageFileMapping(PEPROCESS Process, PVOID Address, SWAPENTRY SwapEntry) @@ -1677,6 +1703,7 @@ MmCreatePageFileMapping(PEPROCESS Process, NTSTATUS +NTAPI MmCreateVirtualMappingUnsafe(PEPROCESS Process, PVOID Address, ULONG flProtect, @@ -1882,6 +1909,7 @@ MmCreateVirtualMappingUnsafe(PEPROCESS Process, } NTSTATUS +NTAPI MmCreateVirtualMapping(PEPROCESS Process, PVOID Address, ULONG flProtect, @@ -1907,6 +1935,7 @@ MmCreateVirtualMapping(PEPROCESS Process, } ULONG +NTAPI MmGetPageProtect(PEPROCESS Process, PVOID Address) { ULONG Entry; @@ -1952,6 +1981,7 @@ MmGetPageProtect(PEPROCESS Process, PVOID Address) } VOID +NTAPI MmSetPageProtect(PEPROCESS Process, PVOID Address, ULONG flProtect) { ULONG Attributes = 0; @@ -2063,6 +2093,7 @@ MmGetPhysicalAddress(PVOID vaddr) } PVOID +NTAPI MmCreateHyperspaceMapping(PFN_TYPE Page) { PVOID Address; @@ -2191,6 +2222,7 @@ MmCreateHyperspaceMapping(PFN_TYPE Page) } PFN_TYPE +NTAPI MmChangeHyperspaceMapping(PVOID Address, PFN_TYPE NewPage) { PFN_TYPE Pfn; @@ -2212,6 +2244,7 @@ MmChangeHyperspaceMapping(PVOID Address, PFN_TYPE NewPage) } PFN_TYPE +NTAPI MmDeleteHyperspaceMapping(PVOID Address) { PFN_TYPE Pfn; @@ -2232,7 +2265,9 @@ MmDeleteHyperspaceMapping(PVOID Address) return Pfn; } -VOID MmUpdatePageDir(PEPROCESS Process, PVOID Address, ULONG Size) +VOID +NTAPI +MmUpdatePageDir(PEPROCESS Process, PVOID Address, ULONG Size) { ULONG StartOffset, EndOffset, Offset; @@ -2315,7 +2350,9 @@ VOID MmUpdatePageDir(PEPROCESS Process, PVOID Address, ULONG Size) } } -VOID INIT_FUNCTION +VOID +INIT_FUNCTION +NTAPI MmInitGlobalKernelPageDirectory(VOID) { ULONG i; @@ -2361,12 +2398,15 @@ MmInitGlobalKernelPageDirectory(VOID) } ULONG +NTAPI MiGetUserPageDirectoryCount(VOID) { return Ke386Pae ? PAE_ADDR_TO_PDE_OFFSET(MmSystemRangeStart) : ADDR_TO_PDE_OFFSET(MmSystemRangeStart); } -VOID INIT_FUNCTION +VOID +INIT_FUNCTION +NTAPI MiInitPageDirectoryMap(VOID) { MEMORY_AREA* kernel_map_desc = NULL; diff --git a/reactos/ntoskrnl/mm/kmap.c b/reactos/ntoskrnl/mm/kmap.c index 614f69a2df4..5cd680591c9 100644 --- a/reactos/ntoskrnl/mm/kmap.c +++ b/reactos/ntoskrnl/mm/kmap.c @@ -18,6 +18,7 @@ /* FUNCTIONS ***************************************************************/ NTSTATUS +NTAPI MiZeroPage(PFN_TYPE Page) { PVOID TempAddress; @@ -33,6 +34,7 @@ MiZeroPage(PFN_TYPE Page) } NTSTATUS +NTAPI MiCopyFromUserPage(PFN_TYPE DestPage, PVOID SourceAddress) { PVOID TempAddress; diff --git a/reactos/ntoskrnl/mm/marea.c b/reactos/ntoskrnl/mm/marea.c index 87fabbd9fc8..4361aeda87e 100644 --- a/reactos/ntoskrnl/mm/marea.c +++ b/reactos/ntoskrnl/mm/marea.c @@ -705,7 +705,9 @@ MmFindGapAtAddress( * Initialize the memory area list implementation. */ -NTSTATUS INIT_FUNCTION +NTSTATUS +INIT_FUNCTION +NTAPI MmInitMemoryAreas(VOID) { DPRINT("MmInitMemoryAreas()\n",0); diff --git a/reactos/ntoskrnl/mm/mdl.c b/reactos/ntoskrnl/mm/mdl.c index b186db3b2e3..c97638118da 100644 --- a/reactos/ntoskrnl/mm/mdl.c +++ b/reactos/ntoskrnl/mm/mdl.c @@ -55,7 +55,9 @@ MmAdvanceMdl ( } -VOID INIT_FUNCTION +VOID +INIT_FUNCTION +NTAPI MmInitializeMdlImplementation(VOID) { MEMORY_AREA* Result; @@ -97,6 +99,7 @@ MmInitializeMdlImplementation(VOID) PVOID +NTAPI MmGetMdlPageAddress(PMDL Mdl, PVOID Offset) { PPFN_NUMBER MdlPages; @@ -298,6 +301,7 @@ MmUnmapReservedMapping ( VOID +NTAPI MmBuildMdlFromPages(PMDL Mdl, PPFN_TYPE Pages) { memcpy(Mdl + 1, Pages, sizeof(PFN_TYPE) * (PAGE_ROUND_UP(Mdl->ByteOffset+Mdl->ByteCount)/PAGE_SIZE)); diff --git a/reactos/ntoskrnl/mm/mm.c b/reactos/ntoskrnl/mm/mm.c index 379fbb83b84..ec365ccfadb 100644 --- a/reactos/ntoskrnl/mm/mm.c +++ b/reactos/ntoskrnl/mm/mm.c @@ -69,7 +69,9 @@ NTSTATUS MmReleaseMemoryArea(PEPROCESS Process, PMEMORY_AREA Marea) return(STATUS_SUCCESS); } -NTSTATUS MmReleaseMmInfo(PEPROCESS Process) +NTSTATUS +NTAPI +MmReleaseMmInfo(PEPROCESS Process) { DPRINT("MmReleaseMmInfo(Process %x (%s))\n", Process, Process->ImageFileName); @@ -136,7 +138,9 @@ BOOLEAN STDCALL MmIsAddressValid(PVOID VirtualAddress) return(TRUE); } -NTSTATUS MmAccessFault(KPROCESSOR_MODE Mode, +NTSTATUS +NTAPI +MmAccessFault(KPROCESSOR_MODE Mode, ULONG_PTR Address, BOOLEAN FromMdl) { @@ -234,7 +238,9 @@ NTSTATUS MmAccessFault(KPROCESSOR_MODE Mode, return(Status); } -NTSTATUS MmCommitPagedPoolAddress(PVOID Address, BOOLEAN Locked) +NTSTATUS +NTAPI +MmCommitPagedPoolAddress(PVOID Address, BOOLEAN Locked) { NTSTATUS Status; PFN_TYPE AllocatedPage; @@ -258,7 +264,9 @@ NTSTATUS MmCommitPagedPoolAddress(PVOID Address, BOOLEAN Locked) return(Status); } -NTSTATUS MmNotPresentFault(KPROCESSOR_MODE Mode, +NTSTATUS +NTAPI +MmNotPresentFault(KPROCESSOR_MODE Mode, ULONG_PTR Address, BOOLEAN FromMdl) { diff --git a/reactos/ntoskrnl/mm/mminit.c b/reactos/ntoskrnl/mm/mminit.c index eeb95152d40..580cd3431d6 100644 --- a/reactos/ntoskrnl/mm/mminit.c +++ b/reactos/ntoskrnl/mm/mminit.c @@ -69,10 +69,14 @@ MM_SYSTEM_SIZE STDCALL MmQuerySystemSize(VOID) return(MmSystemSize); } -VOID MiShutdownMemoryManager(VOID) +VOID +NTAPI +MiShutdownMemoryManager(VOID) {} -VOID INIT_FUNCTION +VOID +INIT_FUNCTION +NTAPI MmInitVirtualMemory(ULONG_PTR LastKernelAddress, ULONG KernelLength) /* @@ -277,7 +281,9 @@ MmInitVirtualMemory(ULONG_PTR LastKernelAddress, MmInitializeMemoryConsumer(MC_USER, MmTrimUserMemory); } -VOID INIT_FUNCTION +VOID +INIT_FUNCTION +NTAPI MmInit1(ULONG_PTR FirstKrnlPhysAddr, ULONG_PTR LastKrnlPhysAddr, ULONG_PTR LastKernelAddress, @@ -423,7 +429,9 @@ MmInit1(ULONG_PTR FirstKrnlPhysAddr, MmInitializeMdlImplementation(); } -VOID INIT_FUNCTION +VOID +NTAPI +INIT_FUNCTION MmInit2(VOID) { MmInitializeRmapList(); @@ -432,7 +440,9 @@ MmInit2(VOID) MmInitPagingFile(); } -VOID INIT_FUNCTION +VOID +INIT_FUNCTION +NTAPI MmInit3(VOID) { /* @@ -469,6 +479,7 @@ MiFreeInitMemoryPage(PVOID Context, MEMORY_AREA* MemoryArea, PVOID Address, } VOID +NTAPI MiFreeInitMemory(VOID) { MmLockAddressSpace(MmGetKernelAddressSpace()); diff --git a/reactos/ntoskrnl/mm/mpw.c b/reactos/ntoskrnl/mm/mpw.c index f6989391b9d..be3db5898b7 100644 --- a/reactos/ntoskrnl/mm/mpw.c +++ b/reactos/ntoskrnl/mm/mpw.c @@ -93,7 +93,9 @@ MmMpwThreadMain(PVOID Ignored) } } -NTSTATUS MmInitMpwThread(VOID) +NTSTATUS +NTAPI +MmInitMpwThread(VOID) { KPRIORITY Priority; NTSTATUS Status; diff --git a/reactos/ntoskrnl/mm/npool.c b/reactos/ntoskrnl/mm/npool.c index 74faa2dbc38..f05a7b6ffc7 100644 --- a/reactos/ntoskrnl/mm/npool.c +++ b/reactos/ntoskrnl/mm/npool.c @@ -776,6 +776,7 @@ MiDumpTagStats(ULONG CurrentTag, ULONG CurrentNrBlocks, ULONG CurrentSize) #endif /* defined(TAG_STATISTICS_TRACKING) */ VOID +NTAPI MiDebugDumpNonPagedPoolStats(BOOLEAN NewOnly) { #if defined(TAG_STATISTICS_TRACKING) @@ -857,6 +858,7 @@ MiDebugDumpNonPagedPoolStats(BOOLEAN NewOnly) } VOID +NTAPI MiDebugDumpNonPagedPool(BOOLEAN NewOnly) { #if defined(POOL_DEBUG_APIS) @@ -1577,7 +1579,9 @@ ExAllocateNonPagedPoolWithTag(POOL_TYPE Type, ULONG Size, ULONG Tag, PVOID Calle return(block); } -VOID INIT_FUNCTION +VOID +INIT_FUNCTION +NTAPI MiInitializeNonPagedPool(VOID) { NTSTATUS Status; diff --git a/reactos/ntoskrnl/mm/pagefile.c b/reactos/ntoskrnl/mm/pagefile.c index 0a77add62da..7af435b0ed1 100644 --- a/reactos/ntoskrnl/mm/pagefile.c +++ b/reactos/ntoskrnl/mm/pagefile.c @@ -135,6 +135,7 @@ MmIsFileAPagingFile(PFILE_OBJECT FileObject) } VOID +NTAPI MmShowOutOfSpaceMessagePagingFile(VOID) { if (!MmSwapSpaceMessage) @@ -201,7 +202,9 @@ MmGetOffsetPageFile(PRETRIEVAL_POINTERS_BUFFER RetrievalPointers, LARGE_INTEGER #endif } -NTSTATUS MmWriteToSwapPage(SWAPENTRY SwapEntry, PFN_TYPE Page) +NTSTATUS +NTAPI +MmWriteToSwapPage(SWAPENTRY SwapEntry, PFN_TYPE Page) { ULONG i, offset; LARGE_INTEGER file_offset; @@ -255,7 +258,9 @@ NTSTATUS MmWriteToSwapPage(SWAPENTRY SwapEntry, PFN_TYPE Page) return(Status); } -NTSTATUS MmReadFromSwapPage(SWAPENTRY SwapEntry, PFN_TYPE Page) +NTSTATUS +NTAPI +MmReadFromSwapPage(SWAPENTRY SwapEntry, PFN_TYPE Page) { ULONG i, offset; LARGE_INTEGER file_offset; @@ -309,7 +314,9 @@ NTSTATUS MmReadFromSwapPage(SWAPENTRY SwapEntry, PFN_TYPE Page) return(Status); } -VOID INIT_FUNCTION +VOID +INIT_FUNCTION +NTAPI MmInitPagingFile(VOID) { ULONG i; @@ -344,6 +351,7 @@ MmInitPagingFile(VOID) } BOOLEAN +NTAPI MmReserveSwapPages(ULONG Nr) { KIRQL oldIrql; @@ -363,6 +371,7 @@ MmReserveSwapPages(ULONG Nr) } VOID +NTAPI MmDereserveSwapPages(ULONG Nr) { KIRQL oldIrql; @@ -400,6 +409,7 @@ MiAllocPageFromPagingFile(PPAGINGFILE PagingFile) } VOID +NTAPI MmFreeSwapPage(SWAPENTRY Entry) { ULONG i; @@ -435,12 +445,14 @@ MmFreeSwapPage(SWAPENTRY Entry) } BOOLEAN +NTAPI MmIsAvailableSwapPage(VOID) { return(MiFreeSwapPages > 0); } SWAPENTRY +NTAPI MmAllocSwapPage(VOID) { KIRQL oldIrql; diff --git a/reactos/ntoskrnl/mm/pageop.c b/reactos/ntoskrnl/mm/pageop.c index 47b3c92480b..12944b18cdc 100644 --- a/reactos/ntoskrnl/mm/pageop.c +++ b/reactos/ntoskrnl/mm/pageop.c @@ -25,6 +25,7 @@ static NPAGED_LOOKASIDE_LIST MmPageOpLookasideList; /* FUNCTIONS *****************************************************************/ VOID +NTAPI MmReleasePageOp(PMM_PAGEOP PageOp) /* * FUNCTION: Release a reference to a page operation descriptor @@ -65,6 +66,7 @@ MmReleasePageOp(PMM_PAGEOP PageOp) } PMM_PAGEOP +NTAPI MmCheckForPageOp(PMEMORY_AREA MArea, HANDLE Pid, PVOID Address, PMM_SECTION_SEGMENT Segment, ULONG Offset) { @@ -127,6 +129,7 @@ MmCheckForPageOp(PMEMORY_AREA MArea, HANDLE Pid, PVOID Address, } PMM_PAGEOP +NTAPI MmGetPageOp(PMEMORY_AREA MArea, HANDLE Pid, PVOID Address, PMM_SECTION_SEGMENT Segment, ULONG Offset, ULONG OpType, BOOL First) /* @@ -234,7 +237,9 @@ MmGetPageOp(PMEMORY_AREA MArea, HANDLE Pid, PVOID Address, return(PageOp); } -VOID INIT_FUNCTION +VOID +INIT_FUNCTION +NTAPI MmInitializePageOp(VOID) { memset(MmPageOpHashTable, 0, sizeof(MmPageOpHashTable)); diff --git a/reactos/ntoskrnl/mm/ppool.c b/reactos/ntoskrnl/mm/ppool.c index 7774cb102c2..816d30bc5b0 100644 --- a/reactos/ntoskrnl/mm/ppool.c +++ b/reactos/ntoskrnl/mm/ppool.c @@ -43,7 +43,9 @@ static PR_POOL MmPagedPool = NULL; /* FUNCTIONS *****************************************************************/ -VOID INIT_FUNCTION +VOID +INIT_FUNCTION +NTAPI MmInitializePagedPool(VOID) { /* diff --git a/reactos/ntoskrnl/mm/region.c b/reactos/ntoskrnl/mm/region.c index 03427dbd37f..fc553fb427c 100644 --- a/reactos/ntoskrnl/mm/region.c +++ b/reactos/ntoskrnl/mm/region.c @@ -105,6 +105,7 @@ MmSplitRegion(PMM_REGION InitialRegion, PVOID InitialBaseAddress, } NTSTATUS +NTAPI MmAlterRegion(PMADDRESS_SPACE AddressSpace, PVOID BaseAddress, PLIST_ENTRY RegionListHead, PVOID StartAddress, ULONG Length, ULONG NewType, ULONG NewProtect, PMM_ALTER_REGION_FUNC AlterFunc) @@ -237,6 +238,7 @@ MmAlterRegion(PMADDRESS_SPACE AddressSpace, PVOID BaseAddress, } VOID +NTAPI MmInitialiseRegion(PLIST_ENTRY RegionListHead, ULONG Length, ULONG Type, ULONG Protect) { @@ -252,6 +254,7 @@ MmInitialiseRegion(PLIST_ENTRY RegionListHead, ULONG Length, ULONG Type, } PMM_REGION +NTAPI MmFindRegion(PVOID BaseAddress, PLIST_ENTRY RegionListHead, PVOID Address, PVOID* RegionBaseAddress) { diff --git a/reactos/ntoskrnl/mm/rmap.c b/reactos/ntoskrnl/mm/rmap.c index 65423bf48de..6bc9ffea066 100644 --- a/reactos/ntoskrnl/mm/rmap.c +++ b/reactos/ntoskrnl/mm/rmap.c @@ -34,7 +34,9 @@ static NPAGED_LOOKASIDE_LIST RmapLookasideList; /* FUNCTIONS ****************************************************************/ -VOID INIT_FUNCTION +VOID +INIT_FUNCTION +NTAPI MmInitializeRmapList(VOID) { ExInitializeFastMutex(&RmapListLock); @@ -48,6 +50,7 @@ MmInitializeRmapList(VOID) } NTSTATUS +NTAPI MmWritePagePhysicalAddress(PFN_TYPE Page) { PMM_RMAP_ENTRY entry; @@ -181,6 +184,7 @@ MmWritePagePhysicalAddress(PFN_TYPE Page) } NTSTATUS +NTAPI MmPageOutPhysicalAddress(PFN_TYPE Page) { PMM_RMAP_ENTRY entry; @@ -304,6 +308,7 @@ MmPageOutPhysicalAddress(PFN_TYPE Page) } VOID +NTAPI MmSetCleanAllRmaps(PFN_TYPE Page) { PMM_RMAP_ENTRY current_entry; @@ -324,6 +329,7 @@ MmSetCleanAllRmaps(PFN_TYPE Page) } VOID +NTAPI MmSetDirtyAllRmaps(PFN_TYPE Page) { PMM_RMAP_ENTRY current_entry; @@ -344,6 +350,7 @@ MmSetDirtyAllRmaps(PFN_TYPE Page) } BOOL +NTAPI MmIsDirtyPageRmap(PFN_TYPE Page) { PMM_RMAP_ENTRY current_entry; @@ -369,6 +376,7 @@ MmIsDirtyPageRmap(PFN_TYPE Page) } VOID +NTAPI MmInsertRmap(PFN_TYPE Page, PEPROCESS Process, PVOID Address) { @@ -434,6 +442,7 @@ MmInsertRmap(PFN_TYPE Page, PEPROCESS Process, } VOID +NTAPI MmDeleteAllRmaps(PFN_TYPE Page, PVOID Context, VOID (*DeleteMapping)(PVOID Context, PEPROCESS Process, PVOID Address)) @@ -474,6 +483,7 @@ MmDeleteAllRmaps(PFN_TYPE Page, PVOID Context, } VOID +NTAPI MmDeleteRmap(PFN_TYPE Page, PEPROCESS Process, PVOID Address) { diff --git a/reactos/ntoskrnl/mm/section.c b/reactos/ntoskrnl/mm/section.c index 4678e9ae568..5395c47975c 100644 --- a/reactos/ntoskrnl/mm/section.c +++ b/reactos/ntoskrnl/mm/section.c @@ -157,6 +157,7 @@ MmFreePageTablesSectionSegment(PMM_SECTION_SEGMENT Segment) } VOID +NTAPI MmFreeSectionSegments(PFILE_OBJECT FileObject) { if (FileObject->SectionObjectPointer->ImageSectionObject != NULL) @@ -202,18 +203,21 @@ MmFreeSectionSegments(PFILE_OBJECT FileObject) } VOID +NTAPI MmLockSectionSegment(PMM_SECTION_SEGMENT Segment) { ExAcquireFastMutex(&Segment->Lock); } VOID +NTAPI MmUnlockSectionSegment(PMM_SECTION_SEGMENT Segment) { ExReleaseFastMutex(&Segment->Lock); } VOID +NTAPI MmSetPageEntrySectionSegment(PMM_SECTION_SEGMENT Segment, ULONG Offset, ULONG Entry) @@ -250,6 +254,7 @@ MmSetPageEntrySectionSegment(PMM_SECTION_SEGMENT Segment, ULONG +NTAPI MmGetPageEntrySectionSegment(PMM_SECTION_SEGMENT Segment, ULONG Offset) { @@ -280,6 +285,7 @@ MmGetPageEntrySectionSegment(PMM_SECTION_SEGMENT Segment, } VOID +NTAPI MmSharePageEntrySectionSegment(PMM_SECTION_SEGMENT Segment, ULONG Offset) { @@ -305,6 +311,7 @@ MmSharePageEntrySectionSegment(PMM_SECTION_SEGMENT Segment, } BOOLEAN +NTAPI MmUnsharePageEntrySectionSegment(PSECTION_OBJECT Section, PMM_SECTION_SEGMENT Segment, ULONG Offset, @@ -453,6 +460,7 @@ BOOL MiIsPageFromCache(PMEMORY_AREA MemoryArea, } NTSTATUS +NTAPI MiReadPage(PMEMORY_AREA MemoryArea, ULONG SegOffset, PPFN_TYPE Page) @@ -624,6 +632,7 @@ MiReadPage(PMEMORY_AREA MemoryArea, } NTSTATUS +NTAPI MmNotPresentFaultSectionView(PMADDRESS_SPACE AddressSpace, MEMORY_AREA* MemoryArea, PVOID Address, @@ -1142,6 +1151,7 @@ MmNotPresentFaultSectionView(PMADDRESS_SPACE AddressSpace, } NTSTATUS +NTAPI MmAccessFaultSectionView(PMADDRESS_SPACE AddressSpace, MEMORY_AREA* MemoryArea, PVOID Address, @@ -1348,6 +1358,7 @@ MmPageOutDeleteMapping(PVOID Context, PEPROCESS Process, PVOID Address) } NTSTATUS +NTAPI MmPageOutSectionView(PMADDRESS_SPACE AddressSpace, MEMORY_AREA* MemoryArea, PVOID Address, @@ -1693,6 +1704,7 @@ MmPageOutSectionView(PMADDRESS_SPACE AddressSpace, } NTSTATUS +NTAPI MmWritePageSectionView(PMADDRESS_SPACE AddressSpace, PMEMORY_AREA MemoryArea, PVOID Address, @@ -1902,6 +1914,7 @@ MmAlterViewAttributes(PMADDRESS_SPACE AddressSpace, } NTSTATUS +NTAPI MmProtectSectionView(PMADDRESS_SPACE AddressSpace, PMEMORY_AREA MemoryArea, PVOID BaseAddress, @@ -1972,6 +1985,7 @@ MmQuerySectionView(PMEMORY_AREA MemoryArea, } VOID +NTAPI MmpFreePageFileSegment(PMM_SECTION_SEGMENT Segment) { ULONG Length; @@ -2087,7 +2101,9 @@ MmpCloseSection(PVOID ObjectBody, ObjectBody, HandleCount, ObGetObjectPointerCount(ObjectBody)); } -NTSTATUS INIT_FUNCTION +NTSTATUS +INIT_FUNCTION +NTAPI MmCreatePhysicalMemorySection(VOID) { PSECTION_OBJECT PhysSection; @@ -2134,7 +2150,9 @@ MmCreatePhysicalMemorySection(VOID) return(STATUS_SUCCESS); } -NTSTATUS INIT_FUNCTION +NTSTATUS +INIT_FUNCTION +NTAPI MmInitSectionImplementation(VOID) { OBJECT_TYPE_INITIALIZER ObjectTypeInitializer; @@ -2158,6 +2176,7 @@ MmInitSectionImplementation(VOID) } NTSTATUS +NTAPI MmCreatePageFileSection(PSECTION_OBJECT *SectionObject, ACCESS_MASK DesiredAccess, POBJECT_ATTRIBUTES ObjectAttributes, @@ -2229,6 +2248,7 @@ MmCreatePageFileSection(PSECTION_OBJECT *SectionObject, NTSTATUS +NTAPI MmCreateDataFileSection(PSECTION_OBJECT *SectionObject, ACCESS_MASK DesiredAccess, POBJECT_ATTRIBUTES ObjectAttributes, diff --git a/reactos/ntoskrnl/rtl/nls.c b/reactos/ntoskrnl/rtl/nls.c index d32d6316258..6dc536af17d 100644 --- a/reactos/ntoskrnl/rtl/nls.c +++ b/reactos/ntoskrnl/rtl/nls.c @@ -62,7 +62,9 @@ RtlpInitNls(VOID) RtlpCreateNlsSection(); } -VOID INIT_FUNCTION +VOID +INIT_FUNCTION +NTAPI RtlpImportAnsiCodePage(PUSHORT TableBase, ULONG Size) { @@ -71,7 +73,9 @@ RtlpImportAnsiCodePage(PUSHORT TableBase, } -VOID INIT_FUNCTION +VOID +INIT_FUNCTION +NTAPI RtlpImportOemCodePage(PUSHORT TableBase, ULONG Size) { @@ -80,7 +84,9 @@ RtlpImportOemCodePage(PUSHORT TableBase, } -VOID INIT_FUNCTION +VOID +NTAPI +INIT_FUNCTION RtlpImportUnicodeCasemap(PUSHORT TableBase, ULONG Size) { @@ -89,7 +95,9 @@ RtlpImportUnicodeCasemap(PUSHORT TableBase, } -VOID INIT_FUNCTION +VOID +NTAPI +INIT_FUNCTION RtlpCreateInitialNlsTables(VOID) { NLSTABLEINFO NlsTable; @@ -109,8 +117,9 @@ RtlpCreateInitialNlsTables(VOID) RtlResetRtlTranslations (&NlsTable); } - -VOID INIT_FUNCTION +VOID +NTAPI +INIT_FUNCTION RtlpCreateNlsSection(VOID) { NLSTABLEINFO NlsTable;