• Welcome to Valhalla Legends Archive.
 

VirtualProtectEx

Started by Dyndrilliac, September 28, 2004, 12:23 PM

Previous topic - Next topic

Dyndrilliac

Can anyone show me an example of how it's used, and what the definitions for all the protect flags are? I couldn't find them on MSDN  :'(

I found some C excerpts, and I *think* this is right for the declare...Declare Function VirtualProtectEx Lib "kernel32" (ByVal hProcess As Long, ByRef lpAddress As Long, ByVal dwSize As Byte, ByVal flNewProtect As Long, ByRef lpflOldProtect As Long) As Long

Also, I read that in order to make use of this I need to use the access flag PROCESS_VM_OPERATION - is that access level included in PROCESS_ACCESS_ALL, and if not, wahts the definition for that flag?\

Any Information/corrections/Resources would be super.
Quote from: Edsger W. DijkstraIt is practically impossible to teach good programming to students that have had a prior exposure to BASIC; as potential programmers they are mentally mutilated beyond hope of regeneration.

Soul Taker

Public Declare Function VirtualProtectEx Lib "kernel32" Alias "VirtualProtectEx" (ByVal hProcess As Long, lpAddress As Any, ByVal dwSize As Long, ByVal flNewProtect As Long, lpflOldProtect As Long) As Long

Try Google for finding the value of any constants/types you can't find on MSDN/API Text Viewer.