ntdll: Detect if NX support is enabled.

Francois Gouget fgouget at free.fr
Wed Aug 3 04:53:51 CDT 2011


---

My understanding is that if 'nx' appears in the cpuinfo flags, then it 
means NX is supported *and* enabled. But I'm not 100% sure (I find that 
piece of the kernel code to be a bit confusing).

In any case it does seem that the same assumption was made for PAE.


 dlls/ntdll/nt.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/dlls/ntdll/nt.c b/dlls/ntdll/nt.c
index f9302c1..6e29b19 100644
--- a/dlls/ntdll/nt.c
+++ b/dlls/ntdll/nt.c
@@ -1059,6 +1059,11 @@ void fill_cpu_info(void)
                     user_shared_data->ProcessorFeatures[PF_COMPARE_EXCHANGE128] = TRUE;
                 if (strstr(value, "mmx"))
                     user_shared_data->ProcessorFeatures[PF_MMX_INSTRUCTIONS_AVAILABLE] = TRUE;
+                if (strstr(value, "nx"))
+                {
+                    user_shared_data->ProcessorFeatures[PF_NX_ENABLED] = TRUE;
+                    user_shared_data->NXSupportPolicy = NX_SUPPORT_POLICY_ALWAYSON;
+                }
                 if (strstr(value, "tsc"))
                     user_shared_data->ProcessorFeatures[PF_RDTSC_INSTRUCTION_AVAILABLE] = TRUE;
                 if (strstr(value, "3dnow"))
-- 
1.7.5.4




More information about the wine-patches mailing list