Add MapViewOfFile3 WIN32 API

This commit is contained in:
Justine Tunney 2024-05-04 12:25:07 -07:00
parent 130fd66f9e
commit d5ebb1fa5b
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
5 changed files with 70 additions and 0 deletions

View file

@ -1,5 +1,6 @@
#ifndef COSMOPOLITAN_LIBC_NT_MEMORY_H_
#define COSMOPOLITAN_LIBC_NT_MEMORY_H_
#include "libc/nt/struct/memextendedparameter.h"
#include "libc/nt/struct/memorybasicinformation.h"
#include "libc/nt/struct/memoryrangeentry.h"
#include "libc/nt/struct/securityattributes.h"
@ -82,6 +83,19 @@ void *HeapReAlloc(int64_t hHeap, uint32_t dwFlags, void *lpMem,
void *GlobalAlloc(uint32_t uFlags, uint64_t dwBytes) __wur;
void *GlobalFree(void *hMem);
/**
* @param AllocationType
* - kNtMemReserve
* - kNtMemReplacePlaceholder
* - kNtMemLargePages
*/
void *MapViewOfFile3(
intptr_t FileMapping, intptr_t Process, void *opt_BaseAddress,
uint64_t Offset, size_t ViewSize, unsigned AllocationType,
unsigned PageProtection,
struct NtMemExtendedParameter *in_out_opt_ExtendedParameters,
unsigned ParameterCount);
#if ShouldUseMsabiAttribute()
#include "libc/nt/thunk/memory.inc"
#endif /* ShouldUseMsabiAttribute() */