ntdll: Fix the field names of KUSER_SHARED_DATA and update it.

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


---

Besides the clearly misspelled fields, some had a different name than in 
the 2003 DDK, and some fields were missing. In particular, assuming I am 
correct in believing KUSER_SHARED_DATA has a 4bytes packing, the 
NXSupportPolicy inserts itself in a gap and thus does not change the 
structure layout.

The structure is larger now but by my count it should still fit in 1KB 
so it will clearly fit in its 64KB region.


 dlls/ntdll/version.c |    5 ++---
 include/ddk/wdm.h    |   24 ++++++++++++++++++------
 2 files changed, 20 insertions(+), 9 deletions(-)

diff --git a/dlls/ntdll/version.c b/dlls/ntdll/version.c
index bcb92a9..74010dd 100644
--- a/dlls/ntdll/version.c
+++ b/dlls/ntdll/version.c
@@ -531,9 +531,8 @@ done:
 
     user_shared_data->NtProductType      = current_version->wProductType;
     user_shared_data->ProductTypeIsValid = TRUE;
-    user_shared_data->MajorNtVersion     = current_version->dwMajorVersion;
-    user_shared_data->MinorNtVersion     = current_version->dwMinorVersion;
-    user_shared_data->MinorNtVersion     = current_version->dwMinorVersion;
+    user_shared_data->NtMajorVersion     = current_version->dwMajorVersion;
+    user_shared_data->NtMinorVersion     = current_version->dwMinorVersion;
     user_shared_data->SuiteMask          = current_version->wSuiteMask;
 
     TRACE( "got %d.%d platform %d build %x name %s service pack %d.%d product %d\n",
diff --git a/include/ddk/wdm.h b/include/ddk/wdm.h
index 8c4755d..1cfc0ff 100644
--- a/include/ddk/wdm.h
+++ b/include/ddk/wdm.h
@@ -993,6 +993,13 @@ typedef enum _ALTERNATIVE_ARCHITECTURE_TYPE
    EndAlternatives
 } ALTERNATIVE_ARCHITECTURE_TYPE;
 
+#define NX_SUPPORT_POLICY_ALWAYSOFF     0
+#define NX_SUPPORT_POLICY_ALWAYSON      1
+#define NX_SUPPORT_POLICY_OPTIN         2
+#define NX_SUPPORT_POLICY_OPTOUT        3
+
+#define MAX_WOW64_SHARED_ENTRIES 16
+
 typedef struct _KUSER_SHARED_DATA {
     ULONG TickCountLowDeprecated;
     ULONG TickCountMultiplier;
@@ -1002,15 +1009,15 @@ typedef struct _KUSER_SHARED_DATA {
     USHORT ImageNumberLow;
     USHORT ImageNumberHigh;
     WCHAR NtSystemRoot[260];
-    ULONG MaxStckTraceDepth;
+    ULONG MaxStackTraceDepth;
     ULONG CryptoExponent;
     ULONG TimeZoneId;
     ULONG LargePageMinimum;
-    ULONG Reserverd2[7];
+    ULONG Reserved2[7];
     NT_PRODUCT_TYPE NtProductType;
     BOOLEAN ProductTypeIsValid;
-    ULONG MajorNtVersion;
-    ULONG MinorNtVersion;
+    ULONG NtMajorVersion;
+    ULONG NtMinorVersion;
     BOOLEAN ProcessorFeatures[PROCESSOR_FEATURE_MAX];
     ULONG Reserved1;
     ULONG Reserved3;
@@ -1019,6 +1026,7 @@ typedef struct _KUSER_SHARED_DATA {
     LARGE_INTEGER SystemExpirationDate;
     ULONG SuiteMask;
     BOOLEAN KdDebuggerEnabled;
+    UCHAR NXSupportPolicy;
     volatile ULONG ActiveConsoleId;
     volatile ULONG DismountCount;
     ULONG ComPlusPackage;
@@ -1026,12 +1034,16 @@ typedef struct _KUSER_SHARED_DATA {
     ULONG NumberOfPhysicalPages;
     BOOLEAN SafeBootMode;
     ULONG TraceLogging;
-    ULONGLONG Fill0;
-    ULONGLONG SystemCall[4];
+    ULONGLONG TestRetInstruction;
+    ULONG SystemCall;
+    ULONG SystemCallReturn;
+    ULONGLONG SystemCallPad[3];
     union {
         volatile KSYSTEM_TIME TickCount;
         volatile ULONG64 TickCountQuad;
     } DUMMYUNIONNAME;
+    ULONG Cookie;
+    ULONG Wow64SharedInformation[MAX_WOW64_SHARED_ENTRIES];
 } KSHARED_USER_DATA, *PKSHARED_USER_DATA;
 
 typedef enum _MEMORY_CACHING_TYPE {
-- 
1.7.5.4




More information about the wine-patches mailing list