[XDK][PSDK][DDK] Share some Se types between winnt and ntifs/wdm. WIP.
authorAmine Khaldi <amine.khaldi@reactos.org>
Sun, 7 Jun 2015 09:57:36 +0000 (09:57 +0000)
committerAmine Khaldi <amine.khaldi@reactos.org>
Sun, 7 Jun 2015 09:57:36 +0000 (09:57 +0000)
svn path=/trunk/; revision=68058

reactos/include/ddk/ntifs.h
reactos/include/ddk/wdm.h
reactos/include/psdk/winnt.h
reactos/include/xdk/setypes.h
reactos/include/xdk/winnt_old.h

index 982bef2..a41205f 100644 (file)
@@ -30,6 +30,7 @@
 extern "C" {
 #endif
 
+
 /* Dependencies */
 #include <ntddk.h>
 #include <excpt.h>
@@ -63,6 +64,7 @@ typedef OBJECT_ATTRIBUTES LSA_OBJECT_ATTRIBUTES, *PLSA_OBJECT_ATTRIBUTES;
 /******************************************************************************
  *                            Security Manager Types                          *
  ******************************************************************************/
+
 #ifndef SID_IDENTIFIER_AUTHORITY_DEFINED
 #define SID_IDENTIFIER_AUTHORITY_DEFINED
 typedef struct _SID_IDENTIFIER_AUTHORITY {
@@ -84,6 +86,7 @@ typedef struct _SID {
 } SID, *PISID;
 #endif
 
+
 #define SID_REVISION                    1
 #define SID_MAX_SUB_AUTHORITIES         15
 #define SID_RECOMMENDED_SUB_AUTHORITIES 1
index 51ecf7f..01a320e 100644 (file)
@@ -76,6 +76,7 @@ __drv_Mode_impl(WDM_INCLUDED)
 extern "C" {
 #endif
 
+
 #if !defined(_NTHALDLL_) && !defined(_BLDR_)
 #define NTHALAPI DECLSPEC_IMPORT
 #else
@@ -2514,9 +2515,12 @@ extern NTKERNELAPI ULONG NtGlobalFlag;
 typedef PVOID PSECURITY_DESCRIPTOR;
 typedef ULONG SECURITY_INFORMATION, *PSECURITY_INFORMATION;
 typedef ULONG ACCESS_MASK, *PACCESS_MASK;
+
+
 typedef PVOID PACCESS_TOKEN;
 typedef PVOID PSID;
 
+
 #define DELETE                           0x00010000L
 #define READ_CONTROL                     0x00020000L
 #define WRITE_DAC                        0x00040000L
@@ -2594,6 +2598,7 @@ typedef struct _PRIVILEGE_SET {
   LUID_AND_ATTRIBUTES Privilege[ANYSIZE_ARRAY];
 } PRIVILEGE_SET,*PPRIVILEGE_SET;
 
+
 typedef enum _SECURITY_IMPERSONATION_LEVEL {
   SecurityAnonymous,
   SecurityIdentification,
@@ -2601,6 +2606,7 @@ typedef enum _SECURITY_IMPERSONATION_LEVEL {
   SecurityDelegation
 } SECURITY_IMPERSONATION_LEVEL, * PSECURITY_IMPERSONATION_LEVEL;
 
+
 #define SECURITY_MAX_IMPERSONATION_LEVEL SecurityDelegation
 #define SECURITY_MIN_IMPERSONATION_LEVEL SecurityAnonymous
 #define DEFAULT_IMPERSONATION_LEVEL SecurityImpersonation
@@ -2609,6 +2615,7 @@ typedef enum _SECURITY_IMPERSONATION_LEVEL {
 #define SECURITY_DYNAMIC_TRACKING (TRUE)
 #define SECURITY_STATIC_TRACKING (FALSE)
 
+
 typedef BOOLEAN SECURITY_CONTEXT_TRACKING_MODE, *PSECURITY_CONTEXT_TRACKING_MODE;
 
 typedef struct _SECURITY_QUALITY_OF_SERVICE {
@@ -2625,6 +2632,7 @@ typedef struct _SE_IMPERSONATION_STATE {
   SECURITY_IMPERSONATION_LEVEL Level;
 } SE_IMPERSONATION_STATE, *PSE_IMPERSONATION_STATE;
 
+
 #define OWNER_SECURITY_INFORMATION       (0x00000001L)
 #define GROUP_SECURITY_INFORMATION       (0x00000002L)
 #define DACL_SECURITY_INFORMATION        (0x00000004L)
index 3e098b8..8817a21 100644 (file)
@@ -4462,43 +4462,60 @@ typedef struct _SECURITY_ATTRIBUTES {
     BOOL bInheritHandle;
 } SECURITY_ATTRIBUTES,*PSECURITY_ATTRIBUTES,*LPSECURITY_ATTRIBUTES;
 
+/******************************************************************************
+ *                            Security Manager Types                          *
+ ******************************************************************************/
+
+typedef PVOID PACCESS_TOKEN;
+typedef PVOID PSID;
+
+
 typedef enum _SECURITY_IMPERSONATION_LEVEL {
   SecurityAnonymous,
   SecurityIdentification,
   SecurityImpersonation,
   SecurityDelegation
-} SECURITY_IMPERSONATION_LEVEL,*PSECURITY_IMPERSONATION_LEVEL;
+} SECURITY_IMPERSONATION_LEVEL, * PSECURITY_IMPERSONATION_LEVEL;
 
-typedef BOOLEAN SECURITY_CONTEXT_TRACKING_MODE,*PSECURITY_CONTEXT_TRACKING_MODE;
+
+typedef BOOLEAN SECURITY_CONTEXT_TRACKING_MODE, *PSECURITY_CONTEXT_TRACKING_MODE;
 
 typedef struct _SECURITY_QUALITY_OF_SERVICE {
   DWORD Length;
   SECURITY_IMPERSONATION_LEVEL ImpersonationLevel;
   SECURITY_CONTEXT_TRACKING_MODE ContextTrackingMode;
   BOOLEAN EffectiveOnly;
-} SECURITY_QUALITY_OF_SERVICE,*PSECURITY_QUALITY_OF_SERVICE;
-
-typedef PVOID PACCESS_TOKEN;
+} SECURITY_QUALITY_OF_SERVICE, *PSECURITY_QUALITY_OF_SERVICE;
 
 typedef struct _SE_IMPERSONATION_STATE {
   PACCESS_TOKEN Token;
   BOOLEAN CopyOnOpen;
   BOOLEAN EffectiveOnly;
   SECURITY_IMPERSONATION_LEVEL Level;
-} SE_IMPERSONATION_STATE,*PSE_IMPERSONATION_STATE;
+} SE_IMPERSONATION_STATE, *PSE_IMPERSONATION_STATE;
+
 
+#ifndef SID_IDENTIFIER_AUTHORITY_DEFINED
+#define SID_IDENTIFIER_AUTHORITY_DEFINED
 typedef struct _SID_IDENTIFIER_AUTHORITY {
   BYTE Value[6];
 } SID_IDENTIFIER_AUTHORITY,*PSID_IDENTIFIER_AUTHORITY,*LPSID_IDENTIFIER_AUTHORITY;
+#endif
 
-typedef PVOID PSID;
-
+#ifndef SID_DEFINED
+#define SID_DEFINED
 typedef struct _SID {
   BYTE Revision;
   BYTE SubAuthorityCount;
   SID_IDENTIFIER_AUTHORITY IdentifierAuthority;
+#ifdef MIDL_PASS
+  [size_is(SubAuthorityCount)] DWORD SubAuthority[*];
+#else
   DWORD SubAuthority[ANYSIZE_ARRAY];
+#endif
 } SID, *PISID;
+#endif
+
 
 #define SECURITY_MIN_SID_SIZE (sizeof(SID))
 #define SECURITY_MAX_SID_SIZE (FIELD_OFFSET(SID, SubAuthority) + SID_MAX_SUB_AUTHORITIES * sizeof(DWORD))
index 3eef24d..c9b2dbe 100644 (file)
@@ -7,9 +7,16 @@ $if (_WDMDDK_)
 typedef PVOID PSECURITY_DESCRIPTOR;
 typedef ULONG SECURITY_INFORMATION, *PSECURITY_INFORMATION;
 typedef ULONG ACCESS_MASK, *PACCESS_MASK;
+
+$endif (_WDMDDK_)
+$if (_WDMDDK_ || _WINNT_)
+
 typedef PVOID PACCESS_TOKEN;
 typedef PVOID PSID;
 
+$endif (_WDMDDK_ || _WINNT_)
+$if (_WDMDDK_)
+
 #define DELETE                           0x00010000L
 #define READ_CONTROL                     0x00020000L
 #define WRITE_DAC                        0x00040000L
@@ -87,6 +94,9 @@ typedef struct _PRIVILEGE_SET {
   LUID_AND_ATTRIBUTES Privilege[ANYSIZE_ARRAY];
 } PRIVILEGE_SET,*PPRIVILEGE_SET;
 
+$endif(_WDMDDK_)
+$if(_WDMDDK_ || _WINNT_)
+
 typedef enum _SECURITY_IMPERSONATION_LEVEL {
   SecurityAnonymous,
   SecurityIdentification,
@@ -94,6 +104,9 @@ typedef enum _SECURITY_IMPERSONATION_LEVEL {
   SecurityDelegation
 } SECURITY_IMPERSONATION_LEVEL, * PSECURITY_IMPERSONATION_LEVEL;
 
+$endif (_WDMDDK_ || _WINNT_)
+$if (_WDMDDK_)
+
 #define SECURITY_MAX_IMPERSONATION_LEVEL SecurityDelegation
 #define SECURITY_MIN_IMPERSONATION_LEVEL SecurityAnonymous
 #define DEFAULT_IMPERSONATION_LEVEL SecurityImpersonation
@@ -102,10 +115,13 @@ typedef enum _SECURITY_IMPERSONATION_LEVEL {
 #define SECURITY_DYNAMIC_TRACKING (TRUE)
 #define SECURITY_STATIC_TRACKING (FALSE)
 
+$endif (_WDMDDK_)
+$if (_WDMDDK_ || _WINNT_)
+
 typedef BOOLEAN SECURITY_CONTEXT_TRACKING_MODE, *PSECURITY_CONTEXT_TRACKING_MODE;
 
 typedef struct _SECURITY_QUALITY_OF_SERVICE {
-  ULONG Length;
+  $ULONG Length;
   SECURITY_IMPERSONATION_LEVEL ImpersonationLevel;
   SECURITY_CONTEXT_TRACKING_MODE ContextTrackingMode;
   BOOLEAN EffectiveOnly;
@@ -118,6 +134,9 @@ typedef struct _SE_IMPERSONATION_STATE {
   SECURITY_IMPERSONATION_LEVEL Level;
 } SE_IMPERSONATION_STATE, *PSE_IMPERSONATION_STATE;
 
+$endif (_WDMDDK_ || _WINNT_)
+$if (_WDMDDK_)
+
 #define OWNER_SECURITY_INFORMATION       (0x00000001L)
 #define GROUP_SECURITY_INFORMATION       (0x00000002L)
 #define DACL_SECURITY_INFORMATION        (0x00000004L)
@@ -393,28 +412,32 @@ typedef enum _WELL_KNOWN_SID_TYPE {
   WinThisOrganizationCertificateSid = 82,
 } WELL_KNOWN_SID_TYPE;
 $endif (_NTDDK_)
-$if (_NTIFS_)
+$if (_NTIFS_ || _WINNT_)
+
 #ifndef SID_IDENTIFIER_AUTHORITY_DEFINED
 #define SID_IDENTIFIER_AUTHORITY_DEFINED
 typedef struct _SID_IDENTIFIER_AUTHORITY {
-  UCHAR Value[6];
+  $UCHAR Value[6];
 } SID_IDENTIFIER_AUTHORITY,*PSID_IDENTIFIER_AUTHORITY,*LPSID_IDENTIFIER_AUTHORITY;
 #endif
 
 #ifndef SID_DEFINED
 #define SID_DEFINED
 typedef struct _SID {
-  UCHAR Revision;
-  UCHAR SubAuthorityCount;
+  $UCHAR Revision;
+  $UCHAR SubAuthorityCount;
   SID_IDENTIFIER_AUTHORITY IdentifierAuthority;
 #ifdef MIDL_PASS
-  [size_is(SubAuthorityCount)] ULONG SubAuthority[*];
+  [size_is(SubAuthorityCount)] $ULONG SubAuthority[*];
 #else
-  ULONG SubAuthority[ANYSIZE_ARRAY];
+  $ULONG SubAuthority[ANYSIZE_ARRAY];
 #endif
 } SID, *PISID;
 #endif
 
+$endif (_NTIFS_ || _WINNT_)
+$if (_NTIFS_)
+
 #define SID_REVISION                    1
 #define SID_MAX_SUB_AUTHORITIES         15
 #define SID_RECOMMENDED_SUB_AUTHORITIES 1
index 6484e50..b7ec2ef 100644 (file)
@@ -2567,43 +2567,7 @@ typedef struct _SECURITY_ATTRIBUTES {
     BOOL bInheritHandle;
 } SECURITY_ATTRIBUTES,*PSECURITY_ATTRIBUTES,*LPSECURITY_ATTRIBUTES;
 
-typedef enum _SECURITY_IMPERSONATION_LEVEL {
-  SecurityAnonymous,
-  SecurityIdentification,
-  SecurityImpersonation,
-  SecurityDelegation
-} SECURITY_IMPERSONATION_LEVEL,*PSECURITY_IMPERSONATION_LEVEL;
-
-typedef BOOLEAN SECURITY_CONTEXT_TRACKING_MODE,*PSECURITY_CONTEXT_TRACKING_MODE;
-
-typedef struct _SECURITY_QUALITY_OF_SERVICE {
-  DWORD Length;
-  SECURITY_IMPERSONATION_LEVEL ImpersonationLevel;
-  SECURITY_CONTEXT_TRACKING_MODE ContextTrackingMode;
-  BOOLEAN EffectiveOnly;
-} SECURITY_QUALITY_OF_SERVICE,*PSECURITY_QUALITY_OF_SERVICE;
-
-typedef PVOID PACCESS_TOKEN;
-
-typedef struct _SE_IMPERSONATION_STATE {
-  PACCESS_TOKEN Token;
-  BOOLEAN CopyOnOpen;
-  BOOLEAN EffectiveOnly;
-  SECURITY_IMPERSONATION_LEVEL Level;
-} SE_IMPERSONATION_STATE,*PSE_IMPERSONATION_STATE;
-
-typedef struct _SID_IDENTIFIER_AUTHORITY {
-  BYTE Value[6];
-} SID_IDENTIFIER_AUTHORITY,*PSID_IDENTIFIER_AUTHORITY,*LPSID_IDENTIFIER_AUTHORITY;
-
-typedef PVOID PSID;
-
-typedef struct _SID {
-  BYTE Revision;
-  BYTE SubAuthorityCount;
-  SID_IDENTIFIER_AUTHORITY IdentifierAuthority;
-  DWORD SubAuthority[ANYSIZE_ARRAY];
-} SID, *PISID;
+$include(setypes.h)
 
 #define SECURITY_MIN_SID_SIZE (sizeof(SID))
 #define SECURITY_MAX_SID_SIZE (FIELD_OFFSET(SID, SubAuthority) + SID_MAX_SUB_AUTHORITIES * sizeof(DWORD))