With the code snippet below, I get error 87 in A_LastError, which means I have an invalid paramater. I tried a couple combinations with no luck.
I need to store the old protection to lpflOldProtect, otherwise I will get the error 988 because as per the MSDN docs, that is the expected behavior.
Could someone skilled spot where I have missed?
Code: Select all
VarSetCapacity(lpflOldProtect, 4)
vStatus := DllCall("VirtualProtectEx", "Ptr", hProcess, "Ptr", Address, "Ptr", 4, "UInt", 0x04, "Ptr", &lpflOldProtect)