@@ -1758,6 +1758,38 @@ pub fn TerminateProcess(hProcess: HANDLE, uExitCode: UINT) TerminateProcessError
1758
1758
}
1759
1759
}
1760
1760
1761
+ pub const NtAllocateVirtualMemoryError = error {
1762
+ AccessDenied ,
1763
+ InvalidParameter ,
1764
+ NoMemory ,
1765
+ Unexpected ,
1766
+ };
1767
+
1768
+ pub fn NtAllocateVirtualMemory (hProcess : HANDLE , addr : ? * PVOID , zero_bits : ULONG_PTR , size : ? * SIZE_T , alloc_type : ULONG , protect : ULONG ) NtAllocateVirtualMemoryError ! void {
1769
+ return switch (ntdll .NtAllocateVirtualMemory (hProcess , addr , zero_bits , size , alloc_type , protect )) {
1770
+ .SUCCESS = > return ,
1771
+ .ACCESS_DENIED = > NtAllocateVirtualMemoryError .AccessDenied ,
1772
+ .INVALID_PARAMETER = > NtAllocateVirtualMemoryError .InvalidParameter ,
1773
+ .NO_MEMORY = > NtAllocateVirtualMemoryError .NoMemory ,
1774
+ else = > | st | unexpectedStatus (st ),
1775
+ };
1776
+ }
1777
+
1778
+ pub const NtFreeVirtualMemoryError = error {
1779
+ AccessDenied ,
1780
+ InvalidParameter ,
1781
+ Unexpected ,
1782
+ };
1783
+
1784
+ pub fn NtFreeVirtualMemory (hProcess : HANDLE , addr : ? * PVOID , size : * SIZE_T , free_type : ULONG ) NtFreeVirtualMemoryError ! void {
1785
+ return switch (ntdll .NtFreeVirtualMemory (hProcess , addr , size , free_type )) {
1786
+ .SUCCESS = > return ,
1787
+ .ACCESS_DENIED = > NtFreeVirtualMemoryError .AccessDenied ,
1788
+ .INVALID_PARAMETER = > NtFreeVirtualMemoryError .InvalidParameter ,
1789
+ else = > NtFreeVirtualMemoryError .Unexpected ,
1790
+ };
1791
+ }
1792
+
1761
1793
pub const VirtualAllocError = error {Unexpected };
1762
1794
1763
1795
pub fn VirtualAlloc (addr : ? LPVOID , size : usize , alloc_type : DWORD , flProtect : DWORD ) VirtualAllocError ! LPVOID {
@@ -3554,6 +3586,8 @@ pub const PAGE_TARGETS_NO_UPDATE = 0x40000000; // Same as PAGE_TARGETS_INVALID
3554
3586
pub const PAGE_GUARD = 0x100 ;
3555
3587
pub const PAGE_NOCACHE = 0x200 ;
3556
3588
pub const PAGE_WRITECOMBINE = 0x400 ;
3589
+ pub const MEM_RESERVE_PLACEHOLDER = 0x00040000 ;
3590
+ pub const MEM_PRESERVE_PLACEHOLDER = 0x00000400 ;
3557
3591
3558
3592
// FreeType values
3559
3593
pub const MEM_COALESCE_PLACEHOLDERS = 0x1 ;
0 commit comments