예제 #1
0
        public string GetDepPolicy()
        {
            if (GetProcType() == "64bit")
            {
                return("Enable (Permanent)");
            }

            string     status;
            bool       success   = false;
            ProcessDEP depPolicy = new ProcessDEP();

            try
            {
                success = GetProcessMitigationPolicy(ProcList[ProcNumber].Handle, Process_Mitigation_Policy.ProcessDEPPolicy, ref depPolicy, Marshal.SizeOf(depPolicy));
            }
            catch { return("Acess_Denied"); }

            if (depPolicy.Enable)
            {
                status = "Enable";
                return(status);
            }
            if (depPolicy.Permanent)
            {
                status = "Enable";
                return(status);
            }
            status = "Disable";
            return(status);
        }
예제 #2
0
 static extern bool GetProcessMitigationPolicy(
     IntPtr hProcess,
     Process_Mitigation_Policy mitigationPolicy,
     ref ProcessDEP lpBuffer,
     int dwLength);