mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-02 09:18:31 +00:00
Make mappings unlimited on NT
This change might also fix fork() in certain cases on NT.
This commit is contained in:
parent
ab64c746cc
commit
34b68f1945
31 changed files with 356 additions and 127 deletions
|
@ -1,2 +1,12 @@
|
|||
.include "o/libc/nt/codegen.inc"
|
||||
.imp kernel32,__imp_GlobalAlloc,GlobalAlloc,0
|
||||
|
||||
.text.windows
|
||||
GlobalAlloc:
|
||||
push %rbp
|
||||
mov %rsp,%rbp
|
||||
.profilable
|
||||
mov __imp_GlobalAlloc(%rip),%rax
|
||||
jmp __sysv2nt
|
||||
.endfn GlobalAlloc,globl
|
||||
.previous
|
||||
|
|
|
@ -1,2 +1,15 @@
|
|||
.include "o/libc/nt/codegen.inc"
|
||||
.imp kernel32,__imp_GlobalFree,GlobalFree,0
|
||||
|
||||
.text.windows
|
||||
GlobalFree:
|
||||
push %rbp
|
||||
mov %rsp,%rbp
|
||||
.profilable
|
||||
mov %rdi,%rcx
|
||||
sub $32,%rsp
|
||||
call *__imp_GlobalFree(%rip)
|
||||
leave
|
||||
ret
|
||||
.endfn GlobalFree,globl
|
||||
.previous
|
||||
|
|
|
@ -2785,14 +2785,14 @@ imp 'GlobalAddAtomA' GlobalAddAtomA kernel32 815
|
|||
imp 'GlobalAddAtomExA' GlobalAddAtomExA kernel32 816
|
||||
imp 'GlobalAddAtomEx' GlobalAddAtomExW kernel32 817
|
||||
imp 'GlobalAddAtom' GlobalAddAtomW kernel32 818
|
||||
imp 'GlobalAlloc' GlobalAlloc kernel32 0 # KernelBase
|
||||
imp 'GlobalAlloc' GlobalAlloc kernel32 0 2 # KernelBase
|
||||
imp 'GlobalCompact' GlobalCompact kernel32 820
|
||||
imp 'GlobalDeleteAtom' GlobalDeleteAtom kernel32 821
|
||||
imp 'GlobalFindAtomA' GlobalFindAtomA kernel32 822
|
||||
imp 'GlobalFindAtom' GlobalFindAtomW kernel32 823
|
||||
imp 'GlobalFix' GlobalFix kernel32 824
|
||||
imp 'GlobalFlags' GlobalFlags kernel32 825
|
||||
imp 'GlobalFree' GlobalFree kernel32 0 # KernelBase
|
||||
imp 'GlobalFree' GlobalFree kernel32 0 1 # KernelBase
|
||||
imp 'GlobalGetAtomNameA' GlobalGetAtomNameA kernel32 827
|
||||
imp 'GlobalGetAtomName' GlobalGetAtomNameW kernel32 828
|
||||
imp 'GlobalHandle' GlobalHandle kernel32 829
|
||||
|
|
|
@ -70,6 +70,9 @@ bool32 PrefetchVirtualMemory(int64_t hProcess, const uint32_t *NumberOfEntries,
|
|||
bool32 OfferVirtualMemory(void *inout_VirtualAddress, size_t Size,
|
||||
int Priority);
|
||||
|
||||
void *GlobalAlloc(uint32_t uFlags, uint64_t dwBytes) nodiscard;
|
||||
void *GlobalFree(void *hMem);
|
||||
|
||||
#if ShouldUseMsabiAttribute()
|
||||
#include "libc/nt/thunk/memory.inc"
|
||||
#endif /* ShouldUseMsabiAttribute() */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue