ntdll: Detect if NX support is enabled.

Francois Gouget fgouget at free.fr
Wed Aug 24 08:17:27 CDT 2011


---

It's not entirely clear to me whether seeing 'nx' in the flags line of 
cpuinfo means that the processor supports NX or that NX is activated. 
But the 'pae' test seems to assume it's the latter so I did the same.


 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 83a341f..f45deb6 100644
--- a/dlls/ntdll/nt.c
+++ b/dlls/ntdll/nt.c
@@ -1044,6 +1044,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