Skip to main content

MitigationPolicy

Struct MitigationPolicy 

Source
pub struct MitigationPolicy { /* private fields */ }
Expand description

A complete SDK 10.0.22621 process-creation mitigation policy.

Setters replace one field. Reserved values and combined raw policy words cannot be represented.

§Runtime support

This type mirrors the policy fields in Windows SDK 10.0.22621; it is not a claim that every field works on every supported Windows installation. Availability varies by individual policy, Windows release, processor architecture, hardware, and child executable. windows-spawn does not weaken a requested policy. Unsupported policies return the process-creation error.

Implementations§

Source§

impl MitigationPolicy

Source

pub const fn new() -> Self

Creates a policy which defers every field.

Source

pub const fn words(self) -> [u64; 2]

Returns the encoded words for diagnostics.

Source

pub const fn dep(self, enable: bool) -> Self

Enables or removes the legacy DEP-enable bit.

Source

pub const fn dep_atl_thunk(self, enable: bool) -> Self

Enables or removes the legacy DEP ATL-thunk-emulation bit.

Source

pub const fn sehop(self, enable: bool) -> Self

Enables or removes the legacy SEHOP bit.

Source

pub const fn relocate_images(self, value: RelocateImages) -> Self

Sets mandatory image relocation.

Source

pub const fn heap_terminate(self, value: Mitigation) -> Self

Sets heap termination on corruption.

Source

pub const fn bottom_up_aslr(self, value: Mitigation) -> Self

Sets bottom-up ASLR.

Source

pub const fn high_entropy_aslr(self, value: Mitigation) -> Self

Sets high-entropy ASLR.

Source

pub const fn strict_handle_checks(self, value: Mitigation) -> Self

Sets strict invalid-handle checking.

Source

pub const fn disable_win32k_system_calls(self, value: Mitigation) -> Self

Sets the Win32k system-call-disable mitigation.

Source

pub const fn disable_extension_points(self, value: Mitigation) -> Self

Sets extension-point disabling.

Source

pub const fn dynamic_code(self, value: DynamicCode) -> Self

Sets dynamic-code policy.

Source

pub const fn control_flow_guard(self, value: ControlFlowGuard) -> Self

Sets Control Flow Guard policy.

Source

pub const fn signed_binaries(self, value: SignedBinaries) -> Self

Sets signed-binary loading policy.

Source

pub const fn font_disable(self, value: FontDisable) -> Self

Sets non-system-font policy.

Source

pub const fn block_remote_images(self, value: Mitigation) -> Self

Sets remote-image blocking.

Source

pub const fn block_low_label_images(self, value: Mitigation) -> Self

Sets low-integrity-label image blocking.

Source

pub const fn prefer_system32_images(self, value: Mitigation) -> Self

Sets System32 image preference.

Source

pub const fn loader_integrity(self, value: LoaderIntegrity) -> Self

Sets loader integrity continuity.

Source

pub const fn strict_control_flow_guard(self, value: Mitigation) -> Self

Sets strict Control Flow Guard.

Source

pub const fn module_tampering(self, value: ModuleTampering) -> Self

Sets module-tampering protection.

Source

pub const fn restrict_indirect_branch_prediction( self, value: Mitigation, ) -> Self

Sets restricted indirect branch prediction.

Source

pub const fn allow_downgrade_dynamic_code(self, value: Mitigation) -> Self

Sets permission for a broker to downgrade dynamic-code policy.

Source

pub const fn disable_speculative_store_bypass(self, value: Mitigation) -> Self

Sets speculative-store-bypass disabling.

Source

pub const fn cet_user_shadow_stacks(self, value: CetShadowStacks) -> Self

Sets CET user shadow stacks.

Source

pub const fn user_cet_context_ip_validation( self, value: UserCetContextIpValidation, ) -> Self

Sets CET set-context instruction-pointer validation.

Source

pub const fn block_non_cet_binaries(self, value: BlockNonCetBinaries) -> Self

Sets blocking of binaries without CET metadata.

Source

pub const fn extended_control_flow_guard(self, value: Mitigation) -> Self

Sets extended Control Flow Guard.

Source

pub const fn pointer_authentication(self, value: Mitigation) -> Self

Sets ARM64 user-mode instruction-pointer authentication.

Source

pub const fn cet_dynamic_apis_out_of_process(self, value: Mitigation) -> Self

Sets CET dynamic APIs to out-of-process-only mode.

Source

pub const fn restrict_core_sharing(self, value: Mitigation) -> Self

Sets restricted CPU-core sharing.

Source

pub const fn disable_fsctl_system_calls(self, value: Mitigation) -> Self

Sets FSCTL system-call disabling.

Trait Implementations§

Source§

impl Clone for MitigationPolicy

Source§

fn clone(&self) -> MitigationPolicy

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for MitigationPolicy

Source§

impl Debug for MitigationPolicy

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for MitigationPolicy

Source§

fn default() -> MitigationPolicy

Returns the “default value” for a type. Read more
Source§

impl Eq for MitigationPolicy

Source§

impl Hash for MitigationPolicy

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for MitigationPolicy

Source§

fn eq(&self, other: &MitigationPolicy) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for MitigationPolicy

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.