2006-05-10 17:47:44 +00:00
|
|
|
/*++ NDK Version: 0098
|
2005-11-22 04:57:45 +00:00
|
|
|
|
|
|
|
Copyright (c) Alex Ionescu. All rights reserved.
|
|
|
|
|
|
|
|
Header Name:
|
|
|
|
|
|
|
|
mmfuncs.h
|
|
|
|
|
|
|
|
Abstract:
|
|
|
|
|
|
|
|
Functions definitions for the Memory Manager.
|
|
|
|
|
|
|
|
Author:
|
|
|
|
|
2006-05-10 17:47:44 +00:00
|
|
|
Alex Ionescu (alexi@tinykrnl.org) - Updated - 27-Feb-2006
|
2005-11-22 04:57:45 +00:00
|
|
|
|
|
|
|
--*/
|
|
|
|
|
2005-06-25 20:05:56 +00:00
|
|
|
#ifndef _MMFUNCS_H
|
|
|
|
#define _MMFUNCS_H
|
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
//
|
|
|
|
// Dependencies
|
|
|
|
//
|
2005-11-25 00:17:40 +00:00
|
|
|
#include <umtypes.h>
|
2012-04-25 07:24:17 +00:00
|
|
|
#include <mmtypes.h>
|
2005-11-25 00:17:40 +00:00
|
|
|
|
|
|
|
#ifndef NTOS_MODE_USER
|
2005-06-25 20:05:56 +00:00
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
//
|
|
|
|
// Section Functions
|
|
|
|
//
|
2007-03-02 16:26:45 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
MmCreateSection(
|
2013-01-13 14:49:21 +00:00
|
|
|
_Out_ PVOID *SectionObject,
|
|
|
|
_In_ ACCESS_MASK DesiredAccess,
|
|
|
|
_In_opt_ POBJECT_ATTRIBUTES ObjectAttributes,
|
|
|
|
_In_ PLARGE_INTEGER MaximumSize,
|
|
|
|
_In_ ULONG SectionPageProtection,
|
|
|
|
_In_ ULONG AllocationAttributes,
|
|
|
|
_In_opt_ HANDLE FileHandle,
|
|
|
|
_In_opt_ PFILE_OBJECT File
|
2007-03-02 16:26:45 +00:00
|
|
|
);
|
|
|
|
|
2006-05-10 17:47:44 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
MmMapViewOfSection(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PVOID SectionObject,
|
|
|
|
_In_ PEPROCESS Process,
|
|
|
|
_Inout_ PVOID *BaseAddress,
|
|
|
|
_In_ ULONG_PTR ZeroBits,
|
|
|
|
_In_ SIZE_T CommitSize,
|
|
|
|
_Inout_opt_ PLARGE_INTEGER SectionOffset,
|
|
|
|
_Inout_ PSIZE_T ViewSize,
|
|
|
|
_In_ SECTION_INHERIT InheritDisposition,
|
|
|
|
_In_ ULONG AllocationType,
|
|
|
|
_In_ ULONG Protect
|
2006-05-10 17:47:44 +00:00
|
|
|
);
|
|
|
|
|
2005-06-26 01:08:55 +00:00
|
|
|
NTSTATUS
|
2005-09-05 04:48:20 +00:00
|
|
|
NTAPI
|
2005-06-25 20:05:56 +00:00
|
|
|
MmUnmapViewOfSection(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ struct _EPROCESS* Process,
|
|
|
|
_In_ PVOID BaseAddress
|
2005-06-25 20:05:56 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
#endif
|
2005-11-25 00:17:40 +00:00
|
|
|
|
|
|
|
//
|
|
|
|
// Native calls
|
|
|
|
//
|
2006-05-10 17:47:44 +00:00
|
|
|
NTSYSCALLAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
NtAreMappedFilesTheSame(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PVOID File1MappedAsAnImage,
|
|
|
|
_In_ PVOID File2MappedAsFile
|
2006-05-10 17:47:44 +00:00
|
|
|
);
|
|
|
|
|
2006-10-23 21:19:15 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
NtAllocateUserPhysicalPages(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ HANDLE ProcessHandle,
|
|
|
|
_Inout_ PULONG_PTR NumberOfPages,
|
|
|
|
_Inout_ PULONG_PTR UserPfnArray
|
2006-10-23 21:19:15 +00:00
|
|
|
);
|
|
|
|
|
2013-01-13 14:49:21 +00:00
|
|
|
_Must_inspect_result_
|
2013-01-19 21:49:12 +00:00
|
|
|
_At_(*BaseAddress, __drv_allocatesMem(Mem))
|
2013-01-13 14:49:21 +00:00
|
|
|
__kernel_entry
|
2005-11-25 00:17:40 +00:00
|
|
|
NTSYSCALLAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
NtAllocateVirtualMemory(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ HANDLE ProcessHandle,
|
2013-01-19 21:49:12 +00:00
|
|
|
_Inout_ _Outptr_result_buffer_(*RegionSize) PVOID *BaseAddress,
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ ULONG_PTR ZeroBits,
|
|
|
|
_Inout_ PSIZE_T RegionSize,
|
|
|
|
_In_ ULONG AllocationType,
|
|
|
|
_In_ ULONG Protect
|
2005-11-25 00:17:40 +00:00
|
|
|
);
|
|
|
|
|
2006-03-04 17:27:40 +00:00
|
|
|
NTSYSCALLAPI
|
2005-11-25 00:17:40 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
NtCreatePagingFile(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PUNICODE_STRING FileName,
|
|
|
|
_In_ PLARGE_INTEGER InitialSize,
|
|
|
|
_In_ PLARGE_INTEGER MaxiumSize,
|
|
|
|
_In_ ULONG Reserved
|
2005-11-25 00:17:40 +00:00
|
|
|
);
|
|
|
|
|
2013-01-13 14:49:21 +00:00
|
|
|
_Must_inspect_result_
|
|
|
|
__kernel_entry
|
2005-11-25 00:17:40 +00:00
|
|
|
NTSYSCALLAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
NtCreateSection(
|
2013-01-13 14:49:21 +00:00
|
|
|
_Out_ PHANDLE SectionHandle,
|
|
|
|
_In_ ACCESS_MASK DesiredAccess,
|
|
|
|
_In_opt_ POBJECT_ATTRIBUTES ObjectAttributes,
|
|
|
|
_In_opt_ PLARGE_INTEGER MaximumSize,
|
|
|
|
_In_ ULONG SectionPageProtection,
|
|
|
|
_In_ ULONG AllocationAttributes,
|
|
|
|
_In_opt_ HANDLE FileHandle
|
2005-11-25 00:17:40 +00:00
|
|
|
);
|
|
|
|
|
2006-03-04 17:27:40 +00:00
|
|
|
NTSYSCALLAPI
|
2005-11-25 00:17:40 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
NtExtendSection(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ HANDLE SectionHandle,
|
|
|
|
_In_ PLARGE_INTEGER NewMaximumSize
|
2005-11-25 00:17:40 +00:00
|
|
|
);
|
|
|
|
|
2015-09-01 23:45:48 +00:00
|
|
|
NTSYSCALLAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
NtFlushInstructionCache(
|
|
|
|
_In_ HANDLE ProcessHandle,
|
|
|
|
_In_ PVOID BaseAddress,
|
|
|
|
_In_ SIZE_T NumberOfBytesToFlush
|
|
|
|
);
|
|
|
|
|
2006-03-04 17:27:40 +00:00
|
|
|
NTSYSCALLAPI
|
2005-11-25 00:17:40 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
NtFlushVirtualMemory(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ HANDLE ProcessHandle,
|
|
|
|
_Inout_ PVOID *BaseAddress,
|
|
|
|
_Inout_ PSIZE_T RegionSize,
|
|
|
|
_Out_ PIO_STATUS_BLOCK IoStatus
|
2005-11-25 00:17:40 +00:00
|
|
|
);
|
|
|
|
|
2006-10-23 21:19:15 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
NtFreeUserPhysicalPages(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ HANDLE ProcessHandle,
|
|
|
|
_Inout_ PULONG_PTR NumberOfPages,
|
|
|
|
_Inout_ PULONG_PTR UserPfnArray
|
2006-10-23 21:19:15 +00:00
|
|
|
);
|
|
|
|
|
2013-01-13 14:49:21 +00:00
|
|
|
__kernel_entry
|
2013-01-19 21:49:12 +00:00
|
|
|
_IRQL_requires_max_(PASSIVE_LEVEL)
|
2005-11-25 00:17:40 +00:00
|
|
|
NTSYSCALLAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
NtFreeVirtualMemory(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ HANDLE ProcessHandle,
|
|
|
|
_Inout_ __drv_freesMem(Mem) PVOID *BaseAddress,
|
|
|
|
_Inout_ PSIZE_T RegionSize,
|
|
|
|
_In_ ULONG FreeType
|
2005-11-25 00:17:40 +00:00
|
|
|
);
|
|
|
|
|
2006-10-23 21:19:15 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
NtGetWriteWatch(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ HANDLE ProcessHandle,
|
|
|
|
_In_ ULONG Flags,
|
|
|
|
_In_ PVOID BaseAddress,
|
|
|
|
_In_ SIZE_T RegionSize,
|
|
|
|
_In_ PVOID *UserAddressArray,
|
|
|
|
_Out_ PULONG_PTR EntriesInUserAddressArray,
|
|
|
|
_Out_ PULONG Granularity
|
2006-10-23 21:19:15 +00:00
|
|
|
);
|
|
|
|
|
2006-03-04 17:27:40 +00:00
|
|
|
NTSYSCALLAPI
|
2005-11-25 00:17:40 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
NtLockVirtualMemory(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ HANDLE ProcessHandle,
|
|
|
|
_Inout_ PVOID *BaseAddress,
|
|
|
|
_Inout_ PSIZE_T NumberOfBytesToLock,
|
|
|
|
_In_ ULONG MapType
|
2005-11-25 00:17:40 +00:00
|
|
|
);
|
|
|
|
|
2006-10-23 21:19:15 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
NtMapUserPhysicalPages(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PVOID VirtualAddresses,
|
|
|
|
_In_ ULONG_PTR NumberOfPages,
|
|
|
|
_Inout_ PULONG_PTR UserPfnArray
|
2006-10-23 21:19:15 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
NtMapUserPhysicalPagesScatter(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PVOID *VirtualAddresses,
|
|
|
|
_In_ ULONG_PTR NumberOfPages,
|
|
|
|
_Inout_ PULONG_PTR UserPfnArray
|
2006-10-23 21:19:15 +00:00
|
|
|
);
|
|
|
|
|
2006-03-04 17:27:40 +00:00
|
|
|
NTSYSCALLAPI
|
2005-11-25 00:17:40 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
NtMapViewOfSection(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ HANDLE SectionHandle,
|
|
|
|
_In_ HANDLE ProcessHandle,
|
|
|
|
_Inout_ PVOID *BaseAddress,
|
|
|
|
_In_ ULONG_PTR ZeroBits,
|
|
|
|
_In_ SIZE_T CommitSize,
|
|
|
|
_Inout_opt_ PLARGE_INTEGER SectionOffset,
|
|
|
|
_Inout_ PSIZE_T ViewSize,
|
|
|
|
_In_ SECTION_INHERIT InheritDisposition,
|
|
|
|
_In_ ULONG AllocationType,
|
|
|
|
_In_ ULONG AccessProtection
|
2005-11-25 00:17:40 +00:00
|
|
|
);
|
|
|
|
|
2006-03-04 17:27:40 +00:00
|
|
|
NTSYSCALLAPI
|
2005-11-25 00:17:40 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
NtOpenSection(
|
2013-01-13 14:49:21 +00:00
|
|
|
_Out_ PHANDLE SectionHandle,
|
|
|
|
_In_ ACCESS_MASK DesiredAccess,
|
|
|
|
_In_ POBJECT_ATTRIBUTES ObjectAttributes
|
2005-11-25 00:17:40 +00:00
|
|
|
);
|
|
|
|
|
2006-03-04 17:27:40 +00:00
|
|
|
NTSYSCALLAPI
|
2005-11-25 00:17:40 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
NtProtectVirtualMemory(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ HANDLE ProcessHandle,
|
|
|
|
_In_ PVOID *BaseAddress,
|
|
|
|
_In_ SIZE_T *NumberOfBytesToProtect,
|
|
|
|
_In_ ULONG NewAccessProtection,
|
|
|
|
_Out_ PULONG OldAccessProtection
|
2005-11-25 00:17:40 +00:00
|
|
|
);
|
|
|
|
|
2006-03-04 17:27:40 +00:00
|
|
|
NTSYSCALLAPI
|
2005-11-25 00:17:40 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
NtQuerySection(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ HANDLE SectionHandle,
|
|
|
|
_In_ SECTION_INFORMATION_CLASS SectionInformationClass,
|
|
|
|
_Out_ PVOID SectionInformation,
|
|
|
|
_In_ SIZE_T Length,
|
|
|
|
_Out_ PSIZE_T ResultLength
|
2005-11-25 00:17:40 +00:00
|
|
|
);
|
|
|
|
|
2006-03-04 17:27:40 +00:00
|
|
|
NTSYSCALLAPI
|
2005-11-25 00:17:40 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
NtQueryVirtualMemory(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ HANDLE ProcessHandle,
|
|
|
|
_In_ PVOID Address,
|
|
|
|
_In_ MEMORY_INFORMATION_CLASS VirtualMemoryInformationClass,
|
|
|
|
_Out_ PVOID VirtualMemoryInformation,
|
|
|
|
_In_ SIZE_T Length,
|
2013-01-19 21:49:12 +00:00
|
|
|
_Out_opt_ PSIZE_T ResultLength
|
2005-11-25 00:17:40 +00:00
|
|
|
);
|
|
|
|
|
2006-03-04 17:27:40 +00:00
|
|
|
NTSYSCALLAPI
|
2005-11-25 00:17:40 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
NtReadVirtualMemory(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ HANDLE ProcessHandle,
|
|
|
|
_In_ PVOID BaseAddress,
|
|
|
|
_Out_ PVOID Buffer,
|
|
|
|
_In_ SIZE_T NumberOfBytesToRead,
|
2013-01-19 21:49:12 +00:00
|
|
|
_Out_opt_ PSIZE_T NumberOfBytesRead
|
2005-11-25 00:17:40 +00:00
|
|
|
);
|
|
|
|
|
2006-10-23 21:19:15 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
NtResetWriteWatch(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ HANDLE ProcessHandle,
|
|
|
|
_In_ PVOID BaseAddress,
|
|
|
|
_In_ SIZE_T RegionSize
|
2006-10-23 21:19:15 +00:00
|
|
|
);
|
|
|
|
|
2006-03-04 17:27:40 +00:00
|
|
|
NTSYSCALLAPI
|
2005-11-25 00:17:40 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
NtUnlockVirtualMemory(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ HANDLE ProcessHandle,
|
|
|
|
_Inout_ PVOID *BaseAddress,
|
|
|
|
_Inout_ PSIZE_T NumberOfBytesToUnlock,
|
|
|
|
_In_ ULONG MapType
|
2005-11-25 00:17:40 +00:00
|
|
|
);
|
|
|
|
|
2006-03-04 17:27:40 +00:00
|
|
|
NTSYSCALLAPI
|
2005-11-25 00:17:40 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
NtUnmapViewOfSection(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ HANDLE ProcessHandle,
|
|
|
|
_In_ PVOID BaseAddress
|
2005-11-25 00:17:40 +00:00
|
|
|
);
|
|
|
|
|
2006-03-04 17:27:40 +00:00
|
|
|
NTSYSCALLAPI
|
2005-11-25 00:17:40 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
NtWriteVirtualMemory(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ HANDLE ProcessHandle,
|
|
|
|
_In_ PVOID BaseAddress,
|
|
|
|
_In_ PVOID Buffer,
|
|
|
|
_In_ SIZE_T NumberOfBytesToWrite,
|
2013-01-19 21:49:12 +00:00
|
|
|
_Out_opt_ PSIZE_T NumberOfBytesWritten
|
2005-11-25 00:17:40 +00:00
|
|
|
);
|
|
|
|
|
2006-05-10 17:47:44 +00:00
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
ZwAreMappedFilesTheSame(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PVOID File1MappedAsAnImage,
|
|
|
|
_In_ PVOID File2MappedAsFile
|
2006-05-10 17:47:44 +00:00
|
|
|
);
|
|
|
|
|
2013-01-19 21:49:12 +00:00
|
|
|
_Must_inspect_result_
|
|
|
|
_At_(*BaseAddress, __drv_allocatesMem(Mem))
|
2013-01-22 22:51:51 +00:00
|
|
|
__kernel_entry
|
2006-03-04 17:27:40 +00:00
|
|
|
NTSYSAPI
|
2005-11-25 00:17:40 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
ZwAllocateVirtualMemory(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ HANDLE ProcessHandle,
|
2013-01-19 21:49:12 +00:00
|
|
|
_Inout_ _Outptr_result_buffer_(*RegionSize) PVOID *BaseAddress,
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ ULONG_PTR ZeroBits,
|
|
|
|
_Inout_ PSIZE_T RegionSize,
|
|
|
|
_In_ ULONG AllocationType,
|
|
|
|
_In_ ULONG Protect
|
2005-11-25 00:17:40 +00:00
|
|
|
);
|
|
|
|
|
2006-03-04 17:27:40 +00:00
|
|
|
NTSYSAPI
|
2005-11-25 00:17:40 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
ZwCreatePagingFile(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PUNICODE_STRING FileName,
|
|
|
|
_In_ PLARGE_INTEGER InitialSize,
|
|
|
|
_In_ PLARGE_INTEGER MaxiumSize,
|
|
|
|
_In_ ULONG Reserved
|
2005-11-25 00:17:40 +00:00
|
|
|
);
|
|
|
|
|
2013-01-13 14:49:21 +00:00
|
|
|
_IRQL_requires_max_(APC_LEVEL)
|
2006-03-04 17:27:40 +00:00
|
|
|
NTSYSAPI
|
2005-11-25 00:17:40 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
ZwCreateSection(
|
2013-01-13 14:49:21 +00:00
|
|
|
_Out_ PHANDLE SectionHandle,
|
|
|
|
_In_ ACCESS_MASK DesiredAccess,
|
|
|
|
_In_opt_ POBJECT_ATTRIBUTES ObjectAttributes,
|
|
|
|
_In_opt_ PLARGE_INTEGER MaximumSize,
|
|
|
|
_In_ ULONG SectionPageProtection,
|
|
|
|
_In_ ULONG AllocationAttributes,
|
|
|
|
_In_opt_ HANDLE FileHandle
|
2005-11-25 00:17:40 +00:00
|
|
|
);
|
|
|
|
|
2006-03-04 17:27:40 +00:00
|
|
|
NTSYSAPI
|
2005-11-25 00:17:40 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
ZwExtendSection(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ HANDLE SectionHandle,
|
|
|
|
_In_ PLARGE_INTEGER NewMaximumSize
|
2005-11-25 00:17:40 +00:00
|
|
|
);
|
|
|
|
|
2013-01-13 14:49:21 +00:00
|
|
|
_IRQL_requires_max_(PASSIVE_LEVEL)
|
2006-03-04 17:27:40 +00:00
|
|
|
NTSYSAPI
|
2005-11-25 00:17:40 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
ZwFreeVirtualMemory(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ HANDLE ProcessHandle,
|
2013-01-19 21:49:12 +00:00
|
|
|
_Inout_ __drv_freesMem(Mem) PVOID *BaseAddress,
|
2013-01-13 14:49:21 +00:00
|
|
|
_Inout_ PSIZE_T RegionSize,
|
|
|
|
_In_ ULONG FreeType
|
2005-11-25 00:17:40 +00:00
|
|
|
);
|
|
|
|
|
2006-03-04 17:27:40 +00:00
|
|
|
NTSYSAPI
|
2005-11-25 00:17:40 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
ZwLockVirtualMemory(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ HANDLE ProcessHandle,
|
|
|
|
_Inout_ PVOID *BaseAddress,
|
|
|
|
_Inout_ PSIZE_T NumberOfBytesToLock,
|
|
|
|
_In_ ULONG MapType
|
2005-11-25 00:17:40 +00:00
|
|
|
);
|
|
|
|
|
2013-01-13 14:49:21 +00:00
|
|
|
_IRQL_requires_max_(PASSIVE_LEVEL)
|
2005-11-28 21:40:21 +00:00
|
|
|
NTSYSAPI
|
2005-11-25 00:17:40 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
ZwMapViewOfSection(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ HANDLE SectionHandle,
|
|
|
|
_In_ HANDLE ProcessHandle,
|
|
|
|
_Outptr_result_bytebuffer_(*ViewSize) PVOID *BaseAddress,
|
|
|
|
_In_ ULONG_PTR ZeroBits,
|
|
|
|
_In_ SIZE_T CommitSize,
|
|
|
|
_Inout_opt_ PLARGE_INTEGER SectionOffset,
|
|
|
|
_Inout_ PSIZE_T ViewSize,
|
|
|
|
_In_ SECTION_INHERIT InheritDisposition,
|
|
|
|
_In_ ULONG AllocationType,
|
|
|
|
_In_ ULONG Win32Protect
|
2005-11-25 00:17:40 +00:00
|
|
|
);
|
|
|
|
|
2005-11-28 21:40:21 +00:00
|
|
|
NTSYSAPI
|
2005-11-25 00:17:40 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
ZwOpenSection(
|
2013-01-13 14:49:21 +00:00
|
|
|
_Out_ PHANDLE SectionHandle,
|
|
|
|
_In_ ACCESS_MASK DesiredAccess,
|
|
|
|
_In_ POBJECT_ATTRIBUTES ObjectAttributes
|
2005-11-25 00:17:40 +00:00
|
|
|
);
|
|
|
|
|
2006-03-04 17:27:40 +00:00
|
|
|
NTSYSAPI
|
2005-11-25 00:17:40 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
ZwProtectVirtualMemory(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ HANDLE ProcessHandle,
|
|
|
|
_In_ PVOID *BaseAddress,
|
|
|
|
_In_ SIZE_T *NumberOfBytesToProtect,
|
|
|
|
_In_ ULONG NewAccessProtection,
|
|
|
|
_Out_ PULONG OldAccessProtection
|
2005-11-25 00:17:40 +00:00
|
|
|
);
|
|
|
|
|
2006-03-04 17:27:40 +00:00
|
|
|
NTSYSAPI
|
2005-11-25 00:17:40 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
ZwQuerySection(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ HANDLE SectionHandle,
|
|
|
|
_In_ SECTION_INFORMATION_CLASS SectionInformationClass,
|
|
|
|
_Out_ PVOID SectionInformation,
|
|
|
|
_In_ SIZE_T Length,
|
2013-01-19 21:49:12 +00:00
|
|
|
_Out_opt_ PSIZE_T ResultLength
|
2005-11-25 00:17:40 +00:00
|
|
|
);
|
|
|
|
|
2006-03-04 17:27:40 +00:00
|
|
|
NTSYSAPI
|
2005-11-25 00:17:40 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
ZwQueryVirtualMemory(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ HANDLE ProcessHandle,
|
|
|
|
_In_ PVOID Address,
|
|
|
|
_In_ MEMORY_INFORMATION_CLASS VirtualMemoryInformationClass,
|
|
|
|
_Out_ PVOID VirtualMemoryInformation,
|
|
|
|
_In_ SIZE_T Length,
|
2013-01-19 21:49:12 +00:00
|
|
|
_Out_opt_ PSIZE_T ResultLength
|
2005-11-25 00:17:40 +00:00
|
|
|
);
|
|
|
|
|
2006-03-04 17:27:40 +00:00
|
|
|
NTSYSAPI
|
2005-11-25 00:17:40 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
ZwReadVirtualMemory(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ HANDLE ProcessHandle,
|
|
|
|
_In_ PVOID BaseAddress,
|
|
|
|
_Out_ PVOID Buffer,
|
|
|
|
_In_ SIZE_T NumberOfBytesToRead,
|
2013-01-19 21:49:12 +00:00
|
|
|
_Out_opt_ PSIZE_T NumberOfBytesRead
|
2005-11-25 00:17:40 +00:00
|
|
|
);
|
|
|
|
|
2006-03-04 17:27:40 +00:00
|
|
|
NTSYSAPI
|
2005-11-25 00:17:40 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
ZwUnlockVirtualMemory(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ HANDLE ProcessHandle,
|
|
|
|
_Inout_ PVOID *BaseAddress,
|
|
|
|
_Inout_ PSIZE_T NumberOfBytesToUnlock,
|
|
|
|
_In_ ULONG MapType
|
2005-11-25 00:17:40 +00:00
|
|
|
);
|
|
|
|
|
2013-01-13 14:49:21 +00:00
|
|
|
_IRQL_requires_max_(PASSIVE_LEVEL)
|
2005-11-28 21:40:21 +00:00
|
|
|
NTSYSAPI
|
2005-11-25 00:17:40 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
ZwUnmapViewOfSection(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ HANDLE ProcessHandle,
|
|
|
|
_In_opt_ PVOID BaseAddress
|
2005-11-25 00:17:40 +00:00
|
|
|
);
|
|
|
|
|
2006-03-04 17:27:40 +00:00
|
|
|
NTSYSAPI
|
2005-11-25 00:17:40 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
ZwWriteVirtualMemory(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ HANDLE ProcessHandle,
|
|
|
|
_In_ PVOID BaseAddress,
|
|
|
|
_In_ PVOID Buffer,
|
|
|
|
_In_ SIZE_T NumberOfBytesToWrite,
|
2013-01-19 21:49:12 +00:00
|
|
|
_Out_opt_ PSIZE_T NumberOfBytesWritten
|
2005-11-25 00:17:40 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
#endif
|