From d2dce8dfe0f02578b2d809190a24437fbb2ea261 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ole=20Andr=C3=A9=20Vadla=20Ravn=C3=A5s?= Date: Wed, 3 Jul 2024 22:44:14 +0200 Subject: [PATCH] Tweak style --- gum/gum.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/gum/gum.c b/gum/gum.c index 0ff4e8fea..2e46efc33 100644 --- a/gum/gum.c +++ b/gum/gum.c @@ -732,9 +732,6 @@ gum_do_query_cpu_features (void) gboolean cpu_supports_cet_ss = FALSE; gboolean os_enabled_xsave = FALSE; guint a, b, c, d; -#ifdef HAVE_WINDOWS - PROCESS_MITIGATION_USER_SHADOW_STACK_POLICY pol; -#endif if (gum_get_cpuid (7, &a, &b, &c, &d)) { @@ -749,16 +746,19 @@ gum_do_query_cpu_features (void) features |= GUM_CPU_AVX2; #ifdef HAVE_WINDOWS - if (cpu_supports_cet_ss && - GetProcessMitigationPolicy ( - GetCurrentProcess (), - ProcessUserShadowStackPolicy, - &pol, - sizeof pol - ) && - !pol.EnableUserShadowStack) { - cpu_supports_cet_ss = FALSE; + PROCESS_MITIGATION_USER_SHADOW_STACK_POLICY pol; + + if (cpu_supports_cet_ss && + GetProcessMitigationPolicy ( + GetCurrentProcess (), + ProcessUserShadowStackPolicy, + &pol, + sizeof (pol)) && + !pol.EnableUserShadowStack) + { + cpu_supports_cet_ss = FALSE; + } } #endif