mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-04-26 00:34:43 +00:00
- Remove most __ASSEMBLER__ __LINKER__ ifdefs - Rename libc/intrin/bits.h to libc/serialize.h - Block pthread cancelation in fchmodat() polyfill - Remove `clang-format off` statements in third_party
55 lines
4.9 KiB
C
55 lines
4.9 KiB
C
#ifndef COSMOPOLITAN_LIBC_NT_NT_MEMORY_H_
|
|
#define COSMOPOLITAN_LIBC_NT_NT_MEMORY_H_
|
|
#include "libc/nt/enum/memoryinformationclass.h"
|
|
#include "libc/nt/enum/status.h"
|
|
COSMOPOLITAN_C_START_
|
|
/* ░░░░
|
|
▒▒▒░░░▒▒▒▒▒▒▒▓▓▓░
|
|
▒▒▒▒░░░▒▒▒▒▒▒▓▓▓▓▓▓░
|
|
▒▒▒▒░░░▒▒▒▒▒▒▒▓▓▓▓▓▓ ▒▓░
|
|
▒▒▒░░░░▒▒▒▒▒▒▓▓▓▓▓▓ ▓▓▓▓▓▓▒ ▒▒▒▓▓█
|
|
▒▒▒▒░░░▒▒▒▒▒▒▒▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▓▓▓
|
|
░▒▒▒░░░░▒▒▒▒▒▒▓▓▓▓▓▓ █▓▓▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▓▓█
|
|
▒▒▒▒░░░▒▒▒▒▒▒▒▓▓▓▓▓░ ▓▓▓▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▓▓▓
|
|
▒▒▒▒░░░▒▒▒▒▒▒▒▓▓▓▓▓▓ ▒▓▓▓▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▓▓▒
|
|
▒▒▒▒▓▓ ▓▒▒▓▓▓▓ ▓▓▓▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▓▓█
|
|
▒▓ ▓▓▓▓▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▓▓
|
|
░░░░░░░░░░░▒▒▒▒ ▓▓▓▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▓▓█
|
|
▒▒░░░░░░░░░░▒▒▒▒▒▓▓▓ ▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▓▓▓
|
|
░▒░░░░░░░░░░░▒▒▒▒▒▓▓ ▓░ ░▓███▓
|
|
▒▒░░░░░░░░░░▒▒▒▒▒▓▓░ ▒▓▓▓▒▒▒ ░▒▒▒▓ ████████████
|
|
▒▒░░░░░░░░░░░▒▒▒▒▒▓▓ ▒▓▓▓▓▒▒▒▒▒▒▒▒░░░▒▒▒▒▒░ ░███
|
|
▒░░░░░░░░░░░▒▒▒▒▒▓▓ ▓▓▓▓▒▒▒▒▒▒▒▒░░░░▒▒▒▒▓ ███
|
|
▒▒░░░░░░░░░░▒▒▒▒▒▒▓▓ ▒▓▓▓▒▒▒▒▒▒▒▒░░░░▒▒▒▒▒ ▓██
|
|
▒░░░░░░░░░░░▒▒▒▒▒▓▓ ▓▓▓▓▒▒▒▒▒▒▒▒░░░▒▒▒▒▒▓ ▓██
|
|
▒▒░░░▒▒▒░░░▒▒░▒▒▒▓▓▒ ▒▓▓▓▒▒▒▒▒▒▒▒░░░░▒▒▒▒▒ ███
|
|
░▒▓ ░▓▓▓▓▒▒▒▒▒▒▒▒░░░░▒▒▒▒▓ ▓██
|
|
╔────────────────────────────────────────────────────────────────▀▀▀─────────│─╗
|
|
│ cosmopolitan § new technology » beyond the pale » memory ─╬─│┼
|
|
╚────────────────────────────────────────────────────────────────────────────│─╝
|
|
“The functions and structures in [for these APIs] are internal to
|
|
the operating system and subject to change from one release of
|
|
Windows to the next, and possibly even between service packs for
|
|
each release.” ──Quoth MSDN */
|
|
|
|
NtStatus NtAllocateVirtualMemory(int64_t ProcessHandle,
|
|
void **inout_BaseAddress, uint32_t dwZeroBits,
|
|
uint32_t *inout_AllocationSize,
|
|
uint32_t dwMemAllocationType,
|
|
uint32_t dwPageProtect);
|
|
NtStatus NtFreeVirtualMemory(int64_t ProcessHandle, void **inout_BaseAddress,
|
|
size_t *inout_FreeSize, uint32_t FreeType);
|
|
NtStatus NtQueryVirtualMemory(int64_t ProcessHandle, const void *BaseAddress,
|
|
int MemoryInformationClass,
|
|
void *out_MemoryInformation,
|
|
size_t MemoryInformationLength,
|
|
size_t *opt_out_ReturnLength);
|
|
NtStatus NtProtectVirtualMemory(int64_t ProcessHandle, void **inout_BaseAddress,
|
|
uint32_t *inout_ProtectSize,
|
|
uint32_t NewProtect, uint32_t *out_OldProtect);
|
|
NtStatus NtWriteVirtualMemory(int64_t ProcessHandle, void *BaseAddress,
|
|
const void *Buffer, size_t BufferLength,
|
|
size_t *opt_out_ReturnLength);
|
|
|
|
COSMOPOLITAN_C_END_
|
|
#endif /* COSMOPOLITAN_LIBC_NT_NT_MEMORY_H_ */
|