VirtualProtect function kernel32
Win32Result<bool>
VirtualProtect(
- Pointer<
NativeType> lpAddress, - int dwSize,
- PAGE_PROTECTION_FLAGS flNewProtect,
- Pointer<
Uint32> lpflOldProtect,
Changes the protection on a region of committed pages in the virtual address space of the calling process.
To learn more, see learn.microsoft.com/windows/win32/api/memoryapi/nf-memoryapi-virtualprotect.
Implementation
Win32Result<bool> VirtualProtect(
Pointer lpAddress,
int dwSize,
PAGE_PROTECTION_FLAGS flNewProtect,
Pointer<Uint32> lpflOldProtect,
) {
final result_ = VirtualProtect_Wrapper(
lpAddress,
dwSize,
flNewProtect,
lpflOldProtect,
);
return Win32Result(value: result_.value.i32 != FALSE, error: result_.error);
}