DelphiXe; Xp,Vista,Win7,WSrv2008R2;
0.DEP(Data Execution Prevention) CPU supported
Function isCpuDEP:bool;
begin
Result:=... //???
end;
1.How to define, DEP is ON in system?
Function isEnableDEP:bool; // Win Xp comparable
begin
Result:=false;if isCpuDEP=false then exit;
Result:=... //???
end;
2.To define, that if DEP it is enabled, and also enabled for ALL programs and services?
Function isEnableDEPForAllProgram:bool;
begin
Result:=false;if isEnableDEP=false then exit;
Result:=... //???
end;
3.Get DEP program list?
Function GetDEPProgramList:TStringList;
begin
Result:=nil;if isEnableDEPForAllProgram=false then exit;
Result:=Tstringlist.Create;
Result:=... //???
end;
The below uses
GetProcessDEPPolicy
for point (1):For point (2), you can use
GetSystemDEPPolicy
in a similar fashion.For point (3), you can enumerate processes and find out the ones running with DEP.
Here is a simple but unorthodox method of checking for DEP but it works only for current program
The
Win32_OperatingSystem
WMi class has 4 properties which report the status of DEPRead the MSDN documentation about these properties to see the description.
Check this sample application