| ... | ... | @@ -1514,7 +1514,8 @@ pub fn VirtualProtect(lpAddress: ?LPVOID, dwSize: SIZE_T, flNewProtect: DWORD, l |
| 1514 | 1514 | } |
| 1515 | 1515 | } |
| 1516 | 1516 | |
| 1517 | | pub fn VirtualProtectEx(handle: HANDLE, addr: ?LPVOID, size: usize, new_prot: DWORD, old_prot: ?*DWORD) VirtualProtectError!void { |
| 1517 | pub fn VirtualProtectEx(handle: HANDLE, addr: ?LPVOID, size: SIZE_T, new_prot: DWORD) VirtualProtectError!DWORD { |
| 1518 | var old_prot: DWORD = undefined; |
| 1518 | 1519 | var out_addr = addr; |
| 1519 | 1520 | var out_size = size; |
| 1520 | 1521 | switch (ntdll.NtProtectVirtualMemory( |
| ... | ... | @@ -1522,9 +1523,9 @@ pub fn VirtualProtectEx(handle: HANDLE, addr: ?LPVOID, size: usize, new_prot: DW |
| 1522 | 1523 | &out_addr, |
| 1523 | 1524 | &out_size, |
| 1524 | 1525 | new_prot, |
| 1525 | | old_prot, |
| 1526 | &old_prot, |
| 1526 | 1527 | )) { |
| 1527 | | .SUCCESS => {}, |
| 1528 | .SUCCESS => return old_prot, |
| 1528 | 1529 | .INVALID_ADDRESS => return error.InvalidAddress, |
| 1529 | 1530 | // TODO: map errors |
| 1530 | 1531 | else => |rc| return std.os.windows.unexpectedStatus(rc), |