mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-08 20:28:30 +00:00
Add mlock() and munlock()
This commit is contained in:
parent
7c9ef924bf
commit
fec139f423
8 changed files with 115 additions and 2 deletions
|
@ -1,2 +1,12 @@
|
|||
.include "o/libc/nt/codegen.inc"
|
||||
.imp kernel32,__imp_VirtualLock,VirtualLock,0
|
||||
|
||||
.text.windows
|
||||
VirtualLock:
|
||||
push %rbp
|
||||
mov %rsp,%rbp
|
||||
.profilable
|
||||
mov __imp_VirtualLock(%rip),%rax
|
||||
jmp __sysv2nt
|
||||
.endfn VirtualLock,globl
|
||||
.previous
|
||||
|
|
|
@ -1,2 +1,12 @@
|
|||
.include "o/libc/nt/codegen.inc"
|
||||
.imp kernel32,__imp_VirtualUnlock,VirtualUnlock,0
|
||||
|
||||
.text.windows
|
||||
VirtualUnlock:
|
||||
push %rbp
|
||||
mov %rsp,%rbp
|
||||
.profilable
|
||||
mov __imp_VirtualUnlock(%rip),%rax
|
||||
jmp __sysv2nt
|
||||
.endfn VirtualUnlock,globl
|
||||
.previous
|
||||
|
|
|
@ -1046,11 +1046,11 @@ imp 'VirtualAllocEx' VirtualAllocEx kernel32 0 5
|
|||
imp 'VirtualAllocExNuma' VirtualAllocExNuma kernel32 0
|
||||
imp 'VirtualFree' VirtualFree kernel32 0 3
|
||||
imp 'VirtualFreeEx' VirtualFreeEx kernel32 0
|
||||
imp 'VirtualLock' VirtualLock kernel32 0
|
||||
imp 'VirtualLock' VirtualLock kernel32 0 2
|
||||
imp 'VirtualUnlock' VirtualUnlock kernel32 0 2
|
||||
imp 'VirtualProtectEx' VirtualProtectEx kernel32 0
|
||||
imp 'VirtualQuery' VirtualQuery kernel32 0 3
|
||||
imp 'VirtualQueryEx' VirtualQueryEx kernel32 0
|
||||
imp 'VirtualUnlock' VirtualUnlock kernel32 0
|
||||
imp 'WTSGetActiveConsoleSessionId' WTSGetActiveConsoleSessionId kernel32 1497
|
||||
imp 'WaitCommEvent' WaitCommEvent kernel32 0
|
||||
imp 'WaitForDebugEvent' WaitForDebugEvent kernel32 0
|
||||
|
|
|
@ -66,6 +66,8 @@ void *VirtualAlloc(void *opt_lpAddress, uint64_t dwSize,
|
|||
bool32 VirtualFree(void *lpAddress, uint64_t dwSize, uint32_t dwFreeType);
|
||||
bool32 VirtualProtect(void *lpAddress, uint64_t dwSize, uint32_t flNewProtect,
|
||||
uint32_t *lpflOldProtect) paramsnonnull();
|
||||
bool32 VirtualLock(void *lpAddress, size_t dwSize);
|
||||
bool32 VirtualUnlock(void *lpAddress, size_t dwSize);
|
||||
uint64_t VirtualQuery(const void *lpAddress,
|
||||
struct NtMemoryBasicInformation *lpBuffer,
|
||||
uint64_t dwLength);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue