15#define MODULE_INVOLVED_IN_ARM3
118 IN ULONG NewSectionPageProtection)
120 ULONG ProtectionMask, CompatibleMask;
126 DPRINT1(
"Invalid protection mask\n");
135 return ((CompatibleMask | NewSectionPageProtection) == CompatibleMask);
142 ULONG Mask1, Mask2, ProtectMask;
232 Session = InputSession;
304 if ((Session->SystemSpaceHashEntries + 8) > Session->SystemSpaceHashSize)
307 HashSize = Session->SystemSpaceHashSize * 2;
310 OldTable = Session->SystemSpaceViewTable;
318 if (!Session->SystemSpaceViewTable)
321 Session->SystemSpaceViewTable = OldTable;
327 Session->SystemSpaceHashSize = HashSize;
328 Session->SystemSpaceHashKey = Session->SystemSpaceHashSize - 1;
331 for (
i = 0;
i < Session->SystemSpaceHashSize / 2;
i++)
337 Hash = (OldTable[
i].
Entry >> 16) % Session->SystemSpaceHashKey;
338 while (Session->SystemSpaceViewTable[
Hash].Entry)
341 if (++
Hash >= Session->SystemSpaceHashSize)
Hash = 0;
345 Session->SystemSpaceViewTable[
Hash] = OldTable[
i];
355 if (Session->SystemSpaceHashEntries == Session->SystemSpaceHashSize)
357 DPRINT1(
"Ran out of system view hash entries\n");
367 Session->BitmapFailures++;
368 DPRINT1(
"Out of system view space\n");
378 Hash = (
Entry >> 16) % Session->SystemSpaceHashKey;
381 while (Session->SystemSpaceViewTable[
Hash].Entry)
384 if (++
Hash >= Session->SystemSpaceHashSize)
Hash = 0;
388 Session->SystemSpaceViewTable[
Hash].Entry =
Entry;
389 Session->SystemSpaceViewTable[
Hash].ControlArea = ControlArea;
392 Session->SystemSpaceHashEntries++;
405 PMMPTE PointerPte, ProtoPte, LastProtoPte, LastPte;
412 ASSERT(ControlArea->u.Flags.GlobalOnlyPerSession == 0);
413 ASSERT(ControlArea->u.Flags.Rom == 0);
418 ASSERT(ControlArea->NumberOfMappedViews >= 1);
419 ASSERT(ControlArea->NumberOfUserReferences >= 1);
420 ASSERT(ControlArea->NumberOfSectionReferences != 0);
421 ASSERT(ControlArea->u.Flags.BeingCreated == 0);
422 ASSERT(ControlArea->u.Flags.BeingDeleted == 0);
423 ASSERT(ControlArea->u.Flags.BeingPurged == 0);
426 PointerPte = FirstPte;
427 LastPte = FirstPte + PteCount;
435 while (PointerPte < LastPte)
438 if (ProtoPte >= LastProtoPte)
465 PMMPDE PointerPde, LastPde, SystemMapPde;
475#if (_MI_PAGING_LEVELS == 2)
480 SystemMapPde = PointerPde;
485 while (PointerPde <= LastPde)
500#if (_MI_PAGING_LEVELS == 2)
542 ASSERT(ControlArea->u.Flags.BeingPurged == 0);
545 ControlArea->NumberOfMappedViews++;
546 ControlArea->NumberOfUserReferences++;
547 ASSERT(ControlArea->NumberOfSectionReferences != 0);
564 ControlArea = Vad->ControlArea;
578 PteOffset = Vpn - Vad->StartingVpn;
582 ASSERT(PteOffset < 0xF0000000);
583 ASSERT(PteOffset < Subsection->PtesInSubsection);
596 PMMPTE PointerPte, LastPte, PteForProto;
603 SegmentFlags =
Segment->SegmentFlags;
604 ControlArea =
Segment->ControlArea;
619 LastPte = PointerPte +
Segment->NonExtendedPtes;
633 while (PointerPte < LastPte)
662 if (
TempPte.u.Soft.Transition == 1)
665 DPRINT(
"Releasing page for transition PTE %p\n", PointerPte);
684 else if (
TempPte.u.Soft.PageFileHigh != 0)
700 PointerPte->
u.
Long = 0;
721 if (!(ControlArea->NumberOfMappedViews) &&
722 !(ControlArea->NumberOfSectionReferences))
725 ASSERT(ControlArea->NumberOfUserReferences == 0);
731 ControlArea->u.Flags.BeingDeleted =
TRUE;
732 DeleteSegment =
TRUE;
742 ASSERT(ControlArea->WritableUserReferences == 0);
757 ControlArea->NumberOfMappedViews--;
758 ControlArea->NumberOfUserReferences--;
774 ControlArea = Vad->ControlArea;
854 DPRINT1(
"No VAD or invalid VAD\n");
883 DPRINT1(
"Trying to unmap protected VAD!\n");
932 PFN_NUMBER PageCount = 0, ActualPages = 0, PageFrameNumber;
943 while (StartPde <= EndPde)
965_WARN(
"MiSessionCommitPageTables halfplemented for amd64")
973 while (StartPde <= EndPde)
1020 ASSERT(ActualPages <= PageCount);
1067 SectionSize = ((
PSECTION)Section)->SizeOfSection.QuadPart;
1075 DPRINT1(
"Section end is too far away from the specified offset.\n");
1085 DPRINT1(
"Integer overflow between size & offset!\n");
1094 DPRINT1(
"View is too large\n");
1107 DPRINT1(
"View is too large\n");
1117 DPRINT1(
"Out of system space\n");
1171 ULONG QuotaCharge = 0, QuotaExcess = 0;
1172 PMMPTE PointerPte, LastPte;
1176 DPRINT(
"Mapping ARM3 data section\n");
1179 Segment = ControlArea->Segment;
1233 ASSERT(ControlArea->u.Flags.GlobalOnlyPerSession == 0);
1236 ASSERT(ControlArea->u.Flags.Rom == 0);
1246 ASSERT(PteOffset < Segment->TotalNumberOfPtes);
1250 ASSERT(PteOffset < Subsection->PtesInSubsection);
1299 PteOffset += ViewSizeInPages - 1;
1300 ASSERT(PteOffset < Subsection->PtesInSubsection);
1319 while (PointerPte < LastPte)
1322 if (PointerPte->
u.
Long == 0)
1338 ASSERT(QuotaCharge >= QuotaExcess);
1339 QuotaCharge -= QuotaExcess;
1340 Segment->NumberOfCommittedPages += QuotaCharge;
1353 else if (Section->Address.StartingVpn != 0)
1356 StartAddress = Section->Address.StartingVpn +
SectionOffset->LowPart;
1370 Segment->NumberOfCommittedPages -= QuotaCharge;
1388 Segment->NumberOfCommittedPages -= QuotaCharge;
1445 SizeLimit /=
sizeof(
MMPTE);
1463 sizeof(
MMPTE) * (PteCount - 1),
1483 ControlArea->
Segment = NewSegment;
1502 PointerPte = &NewSegment->
ThePtes[0];
1521 TempPte.u.Soft.Protection = ProtectionMask;
1567 if (Vad->u.VadFlags.Spare != 0)
1581 DPRINT1(
"VAD is a cache section!\n");
1591 if (Vad->u.VadFlags.PrivateMemory == 1)
1593 DPRINT1(
"VAD is not a section\n");
1598 ControlArea = Vad->ControlArea;
1601 DPRINT1(
"Address is not a section\n");
1655 DPRINT1(
"Name query failed\n");
1678 DPRINT1(
"Not an image section\n");
1773 DPRINT(
"MiQueryMemorySectionName: ObReferenceObjectByHandle returned %x\n",
Status);
1781 SectionName = MemoryInformation;
1787 (
PWSTR)(SectionName + 1),
1803 (
PWSTR)(SectionName + 1),
1832 PreviousPte = *PointerPte;
1852 if (Pfn1->u3.e1.CacheAttribute ==
MiCached)
1863 else if (Pfn1->u3.e1.CacheAttribute ==
MiNonCached)
1871 ProtectionMask &= ~MM_NOACCESS;
1901 if (!Pfn1->u3.e1.Modified)
1903 DPRINT1(
"FIXME: Mark PFN as dirty\n");
1925 PMMPTE PointerPte, ProtoPte;
1926 PMMPDE PointerPde, SystemMapPde;
1937 while (NumberOfPtes)
1940 PteContents = *PointerPte;
1958 if (PointerPde->
u.
Long == 0)
1960#if (_MI_PAGING_LEVELS == 2)
1999 PointerPte->
u.
Long = 0;
2013 ControlArea->NumberOfUserReferences--;
2014 ControlArea->NumberOfMappedViews--;
2032 Hash =
Entry % Session->SystemSpaceHashKey;
2033 while ((Session->SystemSpaceViewTable[
Hash].Entry >> 16) !=
Entry)
2036 if (++
Hash >= Session->SystemSpaceHashSize)
2053 Session->SystemSpaceHashEntries--;
2056 Size = Session->SystemSpaceViewTable[
Hash].Entry & 0xFFFF;
2057 Session->SystemSpaceViewTable[
Hash].Entry = 0;
2060 *ControlArea = Session->SystemSpaceViewTable[
Hash].ControlArea;
2115 ULONG ProtectionMask, ControlAreaSize,
Size, NonPagedCharge, PagedCharge;
2121 PVOID PreviousSectionPointer;
2145 DPRINT1(
"Invalid protection mask\n");
2168 if (!
File->SectionObjectPointer)
2225 PreviousSectionPointer =
File->SectionObjectPointer;
2226 File->SectionObjectPointer->DataSectionObject = ControlArea;
2259 File->SectionObjectPointer->DataSectionObject =
NULL;
2284 ASSERT(PreviousSectionPointer ==
File->SectionObjectPointer);
2287 if (!InputMaximumSize->QuadPart)
2295 Section.SizeOfSection.QuadPart = InputMaximumSize->QuadPart;
2318 UserRefIncremented =
TRUE;
2357 Section.Segment = NewSegment;
2358 Section.u.LongFlags = ControlArea->
u.
LongFlags;
2367 Section.u.Flags.UserWritable =
TRUE;
2394 NonPagedCharge +=
Size;
2406 (
PVOID*)&NewSection);
2416 ASSERT(Section.u.Flags.UserWritable == 1);
2421 if (UserRefIncremented)
2544 ULONG ProtectionMask;
2562 DPRINT1(
"MmMapViewOfArm3Section called with MEM_RESERVE, this is not implemented yet!!!\n");
2569 DPRINT1(
"Mapping protection is incompatible\n");
2577 DPRINT1(
"Section offset overflows\n");
2585 DPRINT1(
"Section offset is larger than section\n");
2600 DPRINT1(
"Section view won't fit\n");
2608 DPRINT1(
"Attempting to commit more than the view itself\n");
2615 DPRINT1(
"The view is larger than the section\n");
2623 DPRINT1(
"The protection is invalid\n");
2630 DPRINT1(
"Cannot write combine a pagefile-backed section\n");
2703 DPRINT1(
"Process is not in session\n");
2735 DPRINT1(
"Proess is not in session\n");
2792 PMMPTE LastProtoPte, PointerPte, ProtoPte;
2803 DPRINT1(
"Base outside of valid range\n");
2811 DPRINT1(
"Size outside of valid range\n");
2821 DPRINT1(
"Process is not in session\n");
2850 if ((StartAddress >=
Base) && (EndingAddress < (
Base +
Size)))
break;
2874 DPRINT1(
"Only page-filed backed sections can be commited\n");
2887 LastProtoPte = ProtoPte + QuotaCharge;
2890 DPRINT1(
"PTE is out of bounds\n");
2897 PointerPte = ProtoPte;
2898 while (PointerPte < LastProtoPte)
2900 if (PointerPte->
u.
Long) QuotaCharge--;
2919 PointerPte = ProtoPte;
2920 while (PointerPte < LastProtoPte)
2923 if (PointerPte->
u.
Long == 0)
2937 Segment->NumberOfCommittedPages += QuotaCharge;
3012 DPRINT1(
"No VAD at address 1 %p\n", File1MappedAsAnImage);
3022 DPRINT1(
"No VAD at address 2 %p\n", File2MappedAsFile);
3029 if (FileObject1 ==
NULL)
3031 DPRINT1(
"Failed to get file object for Address 1 %p\n", File1MappedAsAnImage);
3038 if (FileObject2 ==
NULL)
3040 DPRINT1(
"Failed to get file object for Address 2 %p\n", File2MappedAsFile);
3048 DPRINT1(
"Address 1 (%p) is not an image mapping\n", File1MappedAsAnImage);
3054 if (FileObject1->SectionObjectPointer == FileObject2->SectionObjectPointer)
3104 DPRINT1(
"Missing allocation type in allocation attributes\n");
3113 DPRINT1(
"Image allocation with invalid attributes\n");
3120 DPRINT1(
"Commit and reserve in the same time\n");
3130 DPRINT1(
"Sections don't support these protections\n");
3266 PVOID SafeBaseAddress;
3273 ULONG ProtectionMask;
3275#if defined(_M_IX86) || defined(_M_AMD64)
3286 DPRINT1(
"Invalid inherit disposition\n");
3293 DPRINT1(
"Invalid allocation type\n");
3301 DPRINT1(
"Invalid page protection\n");
3344 DPRINT1(
"Kernel base not allowed\n");
3351 DPRINT1(
"Overflowing into kernel base not allowed\n");
3360 DPRINT1(
"Invalid zero bits\n");
3366 DPRINT1(
"Invalid zero bits\n");
3372 DPRINT1(
"Invalid zero bits\n");
3404 DPRINT1(
"Denying map past highest physical page.\n");
3415 DPRINT(
"BaseAddress is not at 64-kilobyte address boundary.\n");
3424 DPRINT(
"SectionOffset is not at 64-kilobyte address boundary.\n");
3491 DPRINT1(
"Trying to unmap a kernel view\n");
3530 SafeNewMaximumSize = *NewMaximumSize;
3542 SafeNewMaximumSize = *NewMaximumSize;
3564 *NewMaximumSize = SafeNewMaximumSize;
static NTSTATUS MiCheckPurgeAndUpMapCount(IN PCONTROL_AREA ControlArea, IN BOOLEAN FailIfSystemViews)
NTSTATUS NTAPI MmUnmapViewInSystemSpace(IN PVOID MappedBase)
static PFILE_OBJECT MiGetFileObjectForVad(_In_ PMMVAD Vad)
KGUARDED_MUTEX MmSectionBasedMutex
NTSTATUS NTAPI MiQueryMemorySectionName(IN HANDLE ProcessHandle, IN PVOID BaseAddress, OUT PVOID MemoryInformation, IN SIZE_T MemoryInformationLength, OUT PSIZE_T ReturnLength)
CHAR MmUserProtectionToMask1[16]
NTSTATUS MiMapViewInSystemSpace(_In_ PVOID Section, _In_ PMMSESSION Session, _Outptr_result_bytebuffer_(*ViewSize) PVOID *MappedBase, _Inout_ PSIZE_T ViewSize, _Inout_ PLARGE_INTEGER SectionOffset)
BOOLEAN NTAPI MmForceSectionClosed(IN PSECTION_OBJECT_POINTERS SectionObjectPointer, IN BOOLEAN DelayClose)
NTSTATUS NTAPI NtUnmapViewOfSection(IN HANDLE ProcessHandle, IN PVOID BaseAddress)
VOID NTAPI MiFillSystemPageDirectory(IN PVOID Base, IN SIZE_T NumberOfBytes)
ACCESS_MASK MmMakeSectionAccess[8]
NTSTATUS NTAPI MmGetFileNameForSection(IN PVOID Section, OUT POBJECT_NAME_INFORMATION *ModuleName)
ULONG MmCompatibleProtectionMask[8]
NTSTATUS NTAPI NtCreateSection(OUT PHANDLE SectionHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL, IN PLARGE_INTEGER MaximumSize OPTIONAL, IN ULONG SectionPageProtection OPTIONAL, IN ULONG AllocationAttributes, IN HANDLE FileHandle OPTIONAL)
NTSTATUS NTAPI NtOpenSection(OUT PHANDLE SectionHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes)
static ULONG MiRemoveFromSystemSpace(IN PMMSESSION Session, IN PVOID Base, OUT PCONTROL_AREA *ControlArea)
VOID NTAPI MiFlushTbAndCapture(IN PMMVAD FoundVad, IN PMMPTE PointerPte, IN ULONG ProtectionMask, IN PMMPFN Pfn1, IN BOOLEAN UpdateDirty)
ULONG NTAPI MmDoesFileHaveUserWritableReferences(IN PSECTION_OBJECT_POINTERS SectionPointer)
VOID NTAPI MiRemoveMappedView(IN PEPROCESS CurrentProcess, IN PMMVAD Vad)
NTSTATUS NTAPI MmCreateArm3Section(OUT PVOID *SectionObject, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL, IN PLARGE_INTEGER InputMaximumSize, IN ULONG SectionPageProtection, IN ULONG AllocationAttributes, IN HANDLE FileHandle OPTIONAL, IN PFILE_OBJECT FileObject OPTIONAL)
static NTSTATUS MiAddMappedPtes(IN PMMPTE FirstPte, IN PFN_NUMBER PteCount, IN PCONTROL_AREA ControlArea, IN LONGLONG SectionOffset)
static VOID MiDereferenceControlArea(IN PCONTROL_AREA ControlArea)
CHAR MmUserProtectionToMask2[16]
VOID NTAPI MmGetImageInformation(OUT PSECTION_IMAGE_INFORMATION ImageInformation)
VOID NTAPI MiDeleteARM3Section(PVOID ObjectBody)
NTSTATUS NTAPI NtMapViewOfSection(IN HANDLE SectionHandle, IN HANDLE ProcessHandle, IN OUT PVOID *BaseAddress, IN ULONG_PTR ZeroBits, IN SIZE_T CommitSize, IN OUT PLARGE_INTEGER SectionOffset OPTIONAL, IN OUT PSIZE_T ViewSize, IN SECTION_INHERIT InheritDisposition, IN ULONG AllocationType, IN ULONG Protect)
static PVOID MiInsertInSystemSpace(IN PMMSESSION Session, IN ULONG Buckets, IN PCONTROL_AREA ControlArea)
static NTSTATUS MiCreateDataFileMap(IN PFILE_OBJECT File, OUT PSEGMENT *Segment, IN PSIZE_T MaximumSize, IN ULONG SectionPageProtection, IN ULONG AllocationAttributes, IN ULONG IgnoreFileSizing)
NTSTATUS NTAPI MmMapViewOfArm3Section(IN PVOID SectionObject, IN PEPROCESS Process, IN OUT PVOID *BaseAddress, IN ULONG_PTR ZeroBits, IN SIZE_T CommitSize, IN OUT PLARGE_INTEGER SectionOffset OPTIONAL, IN OUT PSIZE_T ViewSize, IN SECTION_INHERIT InheritDisposition, IN ULONG AllocationType, IN ULONG Protect)
NTSTATUS NTAPI MmUnmapViewInSessionSpace(IN PVOID MappedBase)
NTSTATUS NTAPI MmMapViewInSessionSpace(IN PVOID Section, OUT PVOID *MappedBase, IN OUT PSIZE_T ViewSize)
static NTSTATUS MiCreatePagingFileMap(OUT PSEGMENT *Segment, IN PLARGE_INTEGER MaximumSize, IN ULONG ProtectionMask, IN ULONG AllocationAttributes)
static NTSTATUS MiSessionCommitPageTables(IN PVOID StartVa, IN PVOID EndVa)
static VOID MiRemoveMappedPtes(IN PVOID BaseAddress, IN ULONG NumberOfPtes, IN PCONTROL_AREA ControlArea, IN PMMSUPPORT Ws)
static NTSTATUS MiUnmapViewInSystemSpace(IN PMMSESSION Session, IN PVOID MappedBase)
PSUBSECTION NTAPI MiLocateSubsection(IN PMMVAD Vad, IN ULONG_PTR Vpn)
NTSTATUS NTAPI NtAreMappedFilesTheSame(IN PVOID File1MappedAsAnImage, IN PVOID File2MappedAsFile)
static NTSTATUS MiUnmapViewOfSection(IN PEPROCESS Process, IN PVOID BaseAddress, IN ULONG Flags)
NTSTATUS NTAPI MmGetFileNameForAddress(IN PVOID Address, OUT PUNICODE_STRING ModuleName)
KGUARDED_MUTEX MmSectionCommitMutex
BOOLEAN NTAPI MiInitializeSystemSpaceMap(IN PMMSESSION InputSession OPTIONAL)
static NTSTATUS MiMapViewOfDataSection(IN PCONTROL_AREA ControlArea, IN PEPROCESS Process, IN PVOID *BaseAddress, IN PLARGE_INTEGER SectionOffset, IN PSIZE_T ViewSize, IN PSECTION Section, IN SECTION_INHERIT InheritDisposition, IN ULONG ProtectionMask, IN SIZE_T CommitSize, IN ULONG_PTR ZeroBits, IN ULONG AllocationType)
NTSTATUS NTAPI MmCommitSessionMappedView(IN PVOID MappedBase, IN SIZE_T ViewSize)
PFILE_OBJECT NTAPI MmGetFileObjectForSection(IN PVOID SectionObject)
NTSTATUS NTAPI MmUnmapViewOfSection(IN PEPROCESS Process, IN PVOID BaseAddress)
ACCESS_MASK MmMakeFileAccess[8]
BOOLEAN NTAPI MmDisableModifiedWriteOfSection(IN PSECTION_OBJECT_POINTERS SectionObjectPointer)
MM_AVL_TABLE MmSectionBasedRoot
static VOID MiSegmentDelete(IN PSEGMENT Segment)
static VOID MiCheckControlArea(IN PCONTROL_AREA ControlArea, IN KIRQL OldIrql)
ULONG NTAPI MiMakeProtectionMask(IN ULONG Protect)
static BOOLEAN MiIsProtectionCompatible(IN ULONG SectionPageProtection, IN ULONG NewSectionPageProtection)
static NTSTATUS MmGetFileNameForFileObject(IN PFILE_OBJECT FileObject, OUT POBJECT_NAME_INFORMATION *ModuleName)
NTSTATUS NTAPI NtExtendSection(IN HANDLE SectionHandle, IN OUT PLARGE_INTEGER NewMaximumSize)
#define ALIGN_DOWN_BY(size, align)
ACPI_BUFFER *RetBuffer ACPI_BUFFER *RetBuffer char ACPI_WALK_RESOURCE_CALLBACK void *Context ACPI_BUFFER *RetBuffer UINT16 ACPI_RESOURCE **ResourcePtr ACPI_GENERIC_ADDRESS *Reg UINT32 *ReturnValue UINT8 UINT8 *Slp_TypB ACPI_PHYSICAL_ADDRESS PhysicalAddress64 UINT32 UINT32 *TimeElapsed UINT32 ACPI_STATUS const char UINT32 ACPI_STATUS const char UINT32 const char const char * ModuleName
HARDWARE_PTE_ARMV6 TempPte
HARDWARE_PDE_ARMV6 TempPde
#define InterlockedIncrement
#define InterlockedDecrement
#define MM_HIGHEST_USER_ADDRESS
while(CdLookupNextInitialFileDirent(IrpContext, Fcb, FileContext))
NTSYSAPI BOOLEAN NTAPI RtlCreateUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
#define STATUS_NOT_IMPLEMENTED
#define RtlInitializeBitMap
#define RtlFindClearBitsAndSet
VOID NTAPI DbgkUnMapViewOfSection(IN PVOID BaseAddress)
VOID NTAPI DbgkMapViewOfSection(IN PVOID Section, IN PVOID BaseAddress, IN ULONG SectionOffset, IN ULONG_PTR ViewSize)
#define NT_SUCCESS(StatCode)
static int Hash(const char *)
IN CINT OUT PVOID IN ULONG OUT PULONG ReturnLength
#define ExAllocatePoolWithTag(hernya, size, tag)
#define PsGetCurrentThread()
#define KeGetCurrentIrql()
#define ExGetPreviousMode
_Must_inspect_result_ _In_opt_ PFLT_INSTANCE _Out_ PHANDLE FileHandle
_Must_inspect_result_ _In_ PDEVICE_OBJECT _In_ PSECTION_OBJECT_POINTERS SectionObjectPointer
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ PLARGE_INTEGER _In_ ULONG _In_ PFILE_OBJECT _In_ PVOID Process
_Must_inspect_result_ _Outptr_ PVOID * SectionObject
#define FSRTL_FSP_TOP_LEVEL_IRP
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
VOID FASTCALL KeReleaseGuardedMutexUnsafe(IN OUT PKGUARDED_MUTEX GuardedMutex)
VOID FASTCALL KeInitializeGuardedMutex(OUT PKGUARDED_MUTEX GuardedMutex)
VOID FASTCALL KeAcquireGuardedMutexUnsafe(IN OUT PKGUARDED_MUTEX GuardedMutex)
VOID FASTCALL KeReleaseGuardedMutex(IN OUT PKGUARDED_MUTEX GuardedMutex)
VOID FASTCALL KeAcquireGuardedMutex(IN PKGUARDED_MUTEX GuardedMutex)
#define EXCEPTION_EXECUTE_HANDLER
#define PROCESS_QUERY_INFORMATION
#define PROCESS_VM_OPERATION
#define InterlockedExchangeAddSizeT(a, b)
POBJECT_TYPE IoFileObjectType
PFN_NUMBER MmHighestPhysicalPage
PMMVAD NTAPI MiLocateAddress(IN PVOID VirtualAddress)
#define MM_EXECUTE_WRITECOPY
VOID NTAPI MiDeleteVirtualAddresses(IN ULONG_PTR Va, IN ULONG_PTR EndingAddress, IN PMMVAD Vad)
PFN_NUMBER NTAPI MiRemoveZeroPage(IN ULONG Color)
FORCEINLINE VOID MI_MAKE_HARDWARE_PTE_USER(IN PMMPTE NewPte, IN PMMPTE MappingPte, IN ULONG_PTR ProtectionMask, IN PFN_NUMBER PageFrameNumber)
VOID NTAPI MiInsertBasedSection(IN PSECTION Section)
VOID NTAPI MiRemoveNode(IN PMMADDRESS_NODE Node, IN PMM_AVL_TABLE Table)
ULONG MmSecondaryColorMask
FORCEINLINE BOOLEAN MiIsRosSectionObject(IN PSECTION Section)
ULONG NTAPI MiMakeSystemAddressValidPfn(IN PVOID VirtualAddress, IN KIRQL OldIrql)
#define MI_SET_PFN_DELETED(x)
PMM_SESSION_SPACE MmSessionSpace
NTSTATUS NTAPI MiFindEmptyAddressRangeDownBasedTree(IN SIZE_T Length, IN ULONG_PTR BoundaryAddress, IN ULONG_PTR Alignment, IN PMM_AVL_TABLE Table, OUT PULONG_PTR Base)
#define MI_IS_SESSION_ADDRESS(Address)
VOID NTAPI MiInsertPageInFreeList(IN PFN_NUMBER PageFrameIndex)
#define MI_GET_NEXT_COLOR()
#define MM_EXECUTE_READWRITE
VOID NTAPI MiInitializePfnForOtherProcess(IN PFN_NUMBER PageFrameIndex, IN PVOID PteAddress, IN PFN_NUMBER PteFrame)
FORCEINLINE VOID MI_WRITE_VALID_PDE(IN PMMPDE PointerPde, IN MMPDE TempPde)
#define MM_INVALID_PROTECTION
VOID NTAPI MiDecrementShareCount(IN PMMPFN Pfn1, IN PFN_NUMBER PageFrameIndex)
#define MI_SYSTEM_VIEW_BUCKET_SIZE
FORCEINLINE VOID MiUnlockProcessWorkingSetUnsafe(IN PEPROCESS Process, IN PETHREAD Thread)
FORCEINLINE VOID MI_WRITE_INVALID_PTE(IN PMMPTE PointerPte, IN MMPTE InvalidPte)
NTSTATUS NTAPI MiRosUnmapViewInSystemSpace(IN PVOID MappedBase)
VOID NTAPI MiUnlinkPageFromList(IN PMMPFN Pfn)
NTSTATUS NTAPI MiRosUnmapViewOfSection(IN PEPROCESS Process, IN PVOID BaseAddress, IN BOOLEAN SkipDebuggerNotify)
NTSTATUS NTAPI MiInsertVadEx(_Inout_ PMMVAD Vad, _In_ ULONG_PTR *BaseAddress, _In_ SIZE_T ViewSize, _In_ ULONG_PTR HighestAddress, _In_ ULONG_PTR Alignment, _In_ ULONG AllocationType)
NTSTATUS NTAPI MiCheckSecuredVad(IN PMMVAD Vad, IN PVOID Base, IN SIZE_T Size, IN ULONG ProtectionMask)
FORCEINLINE VOID MI_UPDATE_VALID_PTE(IN PMMPTE PointerPte, IN MMPTE TempPte)
FORCEINLINE PMMPFN MI_PFN_ELEMENT(IN PFN_NUMBER Pfn)
SIZE_T MmSizeOfPagedPoolInBytes
FORCEINLINE VOID MiLockProcessWorkingSetUnsafe(IN PEPROCESS Process, IN PETHREAD Thread)
#define RtlFillMemoryUlong(dst, len, val)
BOOLEAN NTAPI MmIsAddressValid(IN PVOID VirtualAddress)
#define MiAddressToPte(x)
#define MiAddressToPde(x)
#define ExFreePoolWithTag(_P, _T)
#define _Outptr_result_bytebuffer_(size)
_In_ HANDLE _Outptr_result_bytebuffer_ ViewSize PVOID _In_ ULONG_PTR _In_ SIZE_T _Inout_opt_ PLARGE_INTEGER _Inout_ PSIZE_T _In_ SECTION_INHERIT InheritDisposition
_In_ ACCESS_MASK _In_opt_ POBJECT_ATTRIBUTES _In_opt_ PLARGE_INTEGER MaximumSize
_In_ ACCESS_MASK _In_opt_ POBJECT_ATTRIBUTES _In_opt_ PLARGE_INTEGER _In_ ULONG SectionPageProtection
_In_ HANDLE ProcessHandle
_In_ HANDLE _Outptr_result_bytebuffer_ ViewSize PVOID _In_ ULONG_PTR ZeroBits
_In_ ACCESS_MASK _In_opt_ POBJECT_ATTRIBUTES _In_opt_ PLARGE_INTEGER _In_ ULONG _In_ ULONG AllocationAttributes
_In_ HANDLE _Outptr_result_bytebuffer_ ViewSize PVOID * BaseAddress
_In_ HANDLE _Outptr_result_bytebuffer_ ViewSize PVOID _In_ ULONG_PTR _In_ SIZE_T _Inout_opt_ PLARGE_INTEGER _Inout_ PSIZE_T _In_ SECTION_INHERIT _In_ ULONG AllocationType
_In_ HANDLE _Outptr_result_bytebuffer_ ViewSize PVOID _In_ ULONG_PTR _In_ SIZE_T _Inout_opt_ PLARGE_INTEGER SectionOffset
_In_ HANDLE _Outptr_result_bytebuffer_ ViewSize PVOID _In_ ULONG_PTR _In_ SIZE_T CommitSize
_In_ HANDLE _Outptr_result_bytebuffer_ ViewSize PVOID _In_ ULONG_PTR _In_ SIZE_T _Inout_opt_ PLARGE_INTEGER _Inout_ PSIZE_T ViewSize
__kernel_entry _Inout_ _Inout_ PSIZE_T RegionSize
struct _SUBSECTION * PSUBSECTION
struct _SUBSECTION SUBSECTION
struct _MSUBSECTION MSUBSECTION
struct _SECTION * PSECTION
struct _CONTROL_AREA CONTROL_AREA
_In_ PMEMORY_AREA MemoryArea
NTSYSAPI VOID NTAPI RtlCopyUnicodeString(PUNICODE_STRING DestinationString, PUNICODE_STRING SourceString)
#define SECTION_MAP_EXECUTE
#define SECTION_MAP_WRITE
#define PAGE_EXECUTE_READ
enum _SECTION_INHERIT SECTION_INHERIT
#define PAGE_EXECUTE_WRITECOPY
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
#define SECTION_EXTEND_SIZE
#define PAGE_EXECUTE_READWRITE
#define DBG_UNREFERENCED_LOCAL_VARIABLE(L)
NTSTATUS NTAPI FsRtlAcquireToCreateMappedSection(_In_ PFILE_OBJECT FileObject, _In_ ULONG SectionPageProtection)
#define MI_IS_PAGE_DIRTY(x)
FORCEINLINE PMMPDE MiPdeToPpe(PMMPDE PointerPde)
FORCEINLINE VOID MI_MAKE_PROTOTYPE_PTE(IN PMMPTE NewPte, IN PMMPTE PointerPte)
#define MM_HIGHEST_VAD_ADDRESS
#define MiProtoPteToPte(x)
#define MiIsPteOnPdeBoundary(PointerPte)
VOID NTAPI KeFlushCurrentTb(VOID)
FORCEINLINE PMMSUPPORT MmGetCurrentAddressSpace(VOID)
FORCEINLINE PMMPFN MiGetPfnEntry(IN PFN_NUMBER Pfn)
#define MI_SET_PROCESS2(x)
FORCEINLINE VOID MmLockAddressSpace(PMMSUPPORT AddressSpace)
#define MM_VIRTMEM_GRANULARITY
#define MI_ASSERT_PFN_LOCK_HELD()
PMEMORY_AREA NTAPI MmLocateMemoryAreaByAddress(PMMSUPPORT AddressSpace, PVOID Address)
struct _MM_IMAGE_SECTION_OBJECT * PMM_IMAGE_SECTION_OBJECT
#define MEMORY_AREA_OWNED_BY_ARM3
struct _MEMORY_AREA * PMEMORY_AREA
FORCEINLINE VOID MmUnlockAddressSpace(PMMSUPPORT AddressSpace)
NTSTATUS NTAPI MmExtendSection(_In_ PVOID Section, _Inout_ PLARGE_INTEGER NewSize)
_Out_ PKAPC_STATE ApcState
PFN_NUMBER MmAvailablePages
#define MEMORY_AREA_SECTION_VIEW
FORCEINLINE PMMSUPPORT MmGetKernelAddressSpace(VOID)
VOID NTAPI IoSetTopLevelIrp(IN PIRP Irp)
PFN_NUMBER MmSystemPageDirectory[PPE_PER_PAGE]
MMPTE ValidKernelPdeLocal
POBJECT_TYPE PsProcessType
#define STATUS_INVALID_VIEW_SIZE
#define STATUS_INVALID_ADDRESS
#define STATUS_MAPPED_ALIGNMENT
#define STATUS_SECTION_PROTECTION
#define STATUS_INVALID_PARAMETER_10
#define STATUS_SECTION_NOT_IMAGE
#define STATUS_NOT_MAPPED_VIEW
#define STATUS_INVALID_PARAMETER_9
#define STATUS_INVALID_PARAMETER_4
#define STATUS_ALREADY_COMMITTED
#define STATUS_INVALID_PARAMETER_2
#define STATUS_PROCESS_IS_TERMINATING
#define STATUS_INVALID_FILE_FOR_SECTION
#define STATUS_INVALID_PARAMETER_6
#define STATUS_CONFLICTING_ADDRESSES
#define STATUS_INVALID_PAGE_PROTECTION
#define STATUS_SECTION_TOO_BIG
#define STATUS_INVALID_PARAMETER_1
#define STATUS_INVALID_PARAMETER_8
#define STATUS_INVALID_PARAMETER_3
#define STATUS_IMAGE_NOT_AT_BASE
#define STATUS_INVALID_PARAMETER_5
#define STATUS_NOT_SAME_DEVICE
NTSTATUS NTAPI ObInsertObject(IN PVOID Object, IN PACCESS_STATE AccessState OPTIONAL, IN ACCESS_MASK DesiredAccess, IN ULONG ObjectPointerBias, OUT PVOID *NewObject OPTIONAL, OUT PHANDLE Handle)
NTSTATUS NTAPI ObOpenObjectByName(IN POBJECT_ATTRIBUTES ObjectAttributes, IN POBJECT_TYPE ObjectType, IN KPROCESSOR_MODE AccessMode, IN PACCESS_STATE PassedAccessState, IN ACCESS_MASK DesiredAccess, IN OUT PVOID ParseContext, OUT PHANDLE Handle)
NTSTATUS NTAPI ObCreateObject(IN KPROCESSOR_MODE ProbeMode OPTIONAL, IN POBJECT_TYPE Type, IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL, IN KPROCESSOR_MODE AccessMode, IN OUT PVOID ParseContext OPTIONAL, IN ULONG ObjectSize, IN ULONG PagedPoolCharge OPTIONAL, IN ULONG NonPagedPoolCharge OPTIONAL, OUT PVOID *Object)
NTSTATUS NTAPI ObQueryNameString(IN PVOID Object, OUT POBJECT_NAME_INFORMATION ObjectNameInfo, IN ULONG Length, OUT PULONG ReturnLength)
NTSTATUS NTAPI ObReferenceObjectByHandle(IN HANDLE Handle, IN ACCESS_MASK DesiredAccess, IN POBJECT_TYPE ObjectType, IN KPROCESSOR_MODE AccessMode, OUT PVOID *Object, OUT POBJECT_HANDLE_INFORMATION HandleInformation OPTIONAL)
VOID NTAPI KeStackAttachProcess(IN PKPROCESS Process, OUT PRKAPC_STATE ApcState)
VOID NTAPI KeUnstackDetachProcess(IN PRKAPC_STATE ApcState)
#define _SEH2_GetExceptionCode()
#define _SEH2_EXCEPT(...)
#define _SEH2_YIELD(__stmt)
NTSTATUS NTAPI PsChargeProcessNonPagedPoolQuota(_In_ PEPROCESS Process, _In_ SIZE_T Amount)
Charges the non paged pool quota of a given process.
VOID NTAPI PsReturnProcessNonPagedPoolQuota(_In_ PEPROCESS Process, _In_ SIZE_T Amount)
Returns the non paged quota pool that the process was taking up.
VOID NTAPI KeBugCheckEx(_In_ ULONG BugCheckCode, _In_ ULONG_PTR BugCheckParameter1, _In_ ULONG_PTR BugCheckParameter2, _In_ ULONG_PTR BugCheckParameter3, _In_ ULONG_PTR BugCheckParameter4)
TCHAR ModuleFileName[MAX_PATH+1]
#define ProbeForWriteLargeInteger(Ptr)
#define ProbeForWritePointer(Ptr)
#define ProbeForWriteHandle(Ptr)
#define ProbeForWriteSize_t(Ptr)
#define ProbeForReadLargeInteger(Ptr)
NTSTATUS NTAPI MmMapViewInSystemSpace(IN PVOID SectionObject, OUT PVOID *MappedBase, IN OUT PSIZE_T ViewSize)
NTSTATUS NTAPI MmMapViewOfSection(IN PVOID SectionObject, IN PEPROCESS Process, IN OUT PVOID *BaseAddress, IN ULONG_PTR ZeroBits, IN SIZE_T CommitSize, IN OUT PLARGE_INTEGER SectionOffset OPTIONAL, IN OUT PSIZE_T ViewSize, IN SECTION_INHERIT InheritDisposition, IN ULONG AllocationType, IN ULONG Protect)
NTSTATUS NTAPI MmCreateSection(OUT PVOID *Section, 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 FileObject OPTIONAL)
POBJECT_TYPE MmSectionObjectType
PULONG MinorVersion OPTIONAL
base of all file and directory entries
UNICODE_STRING SectionFileName
ULONG NumberOfSectionReferences
PEVENT_COUNTER WaitingForDeletion
ULONG NumberOfMappedViews
ULONG NumberOfUserReferences
ULONG WritableUserReferences
union _CONTROL_AREA::@2608 u
LIST_ENTRY DereferenceList
struct _LIST_ENTRY * Flink
struct _MEMORY_AREA::@1796 SectionData
ULONG GlobalOnlyPerSession
ULONG SystemSpaceHashEntries
PKGUARDED_MUTEX SystemSpaceViewLockPointer
PRTL_BITMAP SystemSpaceBitMap
PCHAR SystemSpaceViewStart
ULONG SystemSpaceHashSize
PMMVIEW SystemSpaceViewTable
KGUARDED_MUTEX SystemSpaceViewLock
union _MMVAD_LONG::@2618 u
union _MMVAD_LONG::@2621 u4
union _MMVAD_LONG::@2619 u2
PCONTROL_AREA ControlArea
PCONTROL_AREA ControlArea
PFN_NUMBER SessionPageDirectoryIndex
ULONG InitialPageProtection
LARGE_INTEGER SizeOfSection
struct _CONTROL_AREA * ControlArea
PEPROCESS CreatingProcess
ULONG NumberOfCommittedPages
union _SUBSECTION::@2610 u
MMSUBSECTION_FLAGS SubsectionFlags
PCONTROL_AREA ControlArea
struct _SUBSECTION * NextSubsection
#define UNIMPLEMENTED_ONCE
#define RtlCopyMemory(Destination, Source, Length)
#define RtlZeroMemory(Destination, Length)
#define STATUS_INSUFFICIENT_RESOURCES
#define ALIGN_DOWN_POINTER_BY(ptr, align)
_In_ WDFCOLLECTION _In_ ULONG Index
_Must_inspect_result_ _In_ WDFDEVICE _In_ ULONG _In_ ACCESS_MASK DesiredAccess
_In_ WDFREQUEST _In_ WDFFILEOBJECT FileObject
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
_Must_inspect_result_ _In_ ULONG Flags
_In_ ULONG _In_ PHYSICAL_ADDRESS _Inout_ PULONG AddressSpace
_Must_inspect_result_ typedef _In_ PHYSICAL_ADDRESS _Inout_ PLARGE_INTEGER NumberOfBytes
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql
_Must_inspect_result_ _Outptr_result_bytebuffer_ ViewSize PVOID * MappedBase
#define BYTES_TO_PAGES(Size)
#define PAGE_WRITECOMBINE
#define ObDereferenceObject
#define ObReferenceObject
#define PsGetCurrentProcess
NTSYSAPI VOID NTAPI RtlFillMemoryUlonglong(_Out_writes_bytes_all_(Length) PVOID Destination, _In_ SIZE_T Length, _In_ ULONGLONG Pattern)
_In_ KPROCESSOR_MODE PreviousMode
_In_ HANDLE _Outptr_result_bytebuffer_ ViewSize PVOID _In_ ULONG_PTR _In_ SIZE_T _Inout_opt_ PLARGE_INTEGER _Inout_ PSIZE_T _In_ SECTION_INHERIT _In_ ULONG _In_ ULONG Protect