use winapi::um::winnt::*;
pub unsafe trait IntoPolicy { type Policy; fn into(self) -> (PROCESS_MITIGATION_POLICY, Self::Policy); }
unsafe impl IntoPolicy for PROCESS_MITIGATION_DEP_POLICY { type Policy = Self; fn into(self) -> (PROCESS_MITIGATION_POLICY, Self::Policy) { (Process::DEPPolicy as _, self) } }
unsafe impl IntoPolicy for PROCESS_MITIGATION_ASLR_POLICY { type Policy = Self; fn into(self) -> (PROCESS_MITIGATION_POLICY, Self::Policy) { (Process::ASLRPolicy as _, self) } }
unsafe impl IntoPolicy for PROCESS_MITIGATION_DYNAMIC_CODE_POLICY { type Policy = Self; fn into(self) -> (PROCESS_MITIGATION_POLICY, Self::Policy) { (Process::DynamicCodePolicy as _, self) } }
unsafe impl IntoPolicy for PROCESS_MITIGATION_STRICT_HANDLE_CHECK_POLICY { type Policy = Self; fn into(self) -> (PROCESS_MITIGATION_POLICY, Self::Policy) { (Process::StrictHandleCheckPolicy as _, self) } }
unsafe impl IntoPolicy for PROCESS_MITIGATION_SYSTEM_CALL_DISABLE_POLICY { type Policy = Self; fn into(self) -> (PROCESS_MITIGATION_POLICY, Self::Policy) { (Process::SystemCallDisablePolicy as _, self) } }
unsafe impl IntoPolicy for PROCESS_MITIGATION_EXTENSION_POINT_DISABLE_POLICY { type Policy = Self; fn into(self) -> (PROCESS_MITIGATION_POLICY, Self::Policy) { (Process::ExtensionPointDisablePolicy as _, self) } }
unsafe impl IntoPolicy for PROCESS_MITIGATION_CONTROL_FLOW_GUARD_POLICY { type Policy = Self; fn into(self) -> (PROCESS_MITIGATION_POLICY, Self::Policy) { (Process::ControlFlowGuardPolicy as _, self) } }
unsafe impl IntoPolicy for PROCESS_MITIGATION_BINARY_SIGNATURE_POLICY { type Policy = Self; fn into(self) -> (PROCESS_MITIGATION_POLICY, Self::Policy) { (Process::SignaturePolicy as _, self) } }
unsafe impl IntoPolicy for PROCESS_MITIGATION_FONT_DISABLE_POLICY { type Policy = Self; fn into(self) -> (PROCESS_MITIGATION_POLICY, Self::Policy) { (Process::FontDisablePolicy as _, self) } }
unsafe impl IntoPolicy for PROCESS_MITIGATION_IMAGE_LOAD_POLICY { type Policy = Self; fn into(self) -> (PROCESS_MITIGATION_POLICY, Self::Policy) { (Process::ImageLoadPolicy as _, self) } }
unsafe impl IntoPolicy for PROCESS_MITIGATION_SYSTEM_CALL_FILTER_POLICY { type Policy = Self; fn into(self) -> (PROCESS_MITIGATION_POLICY, Self::Policy) { (Process::SystemCallFilterPolicy as _, self) } }
unsafe impl IntoPolicy for PROCESS_MITIGATION_PAYLOAD_RESTRICTION_POLICY { type Policy = Self; fn into(self) -> (PROCESS_MITIGATION_POLICY, Self::Policy) { (Process::PayloadRestrictionPolicy as _, self) } }
unsafe impl IntoPolicy for PROCESS_MITIGATION_CHILD_PROCESS_POLICY { type Policy = Self; fn into(self) -> (PROCESS_MITIGATION_POLICY, Self::Policy) { (Process::ChildProcessPolicy as _, self) } }
pub use funcs::*;
pub(crate) mod funcs {
include!("funcs/heap_enable_termination_on_corruption.rs");
include!("funcs/set_process_mitigation_policy.rs");
}
#[allow(dead_code)] #[repr(u32)] enum Process {
DEPPolicy,
ASLRPolicy,
DynamicCodePolicy,
StrictHandleCheckPolicy,
SystemCallDisablePolicy,
MitigationOptionsMask,
ExtensionPointDisablePolicy,
ControlFlowGuardPolicy,
SignaturePolicy,
FontDisablePolicy,
ImageLoadPolicy,
SystemCallFilterPolicy,
PayloadRestrictionPolicy,
ChildProcessPolicy,
SideChannelIsolationPolicy,
UserShadowStackPolicy,
RedirectionTrustPolicy,
UserPointerAuthPolicy,
SEHOPPolicy,
}