Fix ntsecapi.h so it does not depend on winternl.h.

Francois Gouget fgouget at free.fr
Tue Nov 7 18:20:40 CST 2006


This is needed because in the PSDK it is incompatible with winternl.h which caused compilation errors in the advapi32 tests.
However our ntsecapi.h retains compatibility with winternl.h so our dlls can use both when necessary (e.g. dlls/advapi32/security.c).
Also add SECURITY_STRING to sspi.h.
---
 dlls/advapi32/lsa.c            |    1 -
 dlls/advapi32/tests/lsa.c      |    1 -
 dlls/advapi32/tests/security.c |    1 -
 dlls/netapi32/access.c         |    1 -
 dlls/netapi32/ds.c             |    1 -
 dlls/netapi32/local_group.c    |    1 -
 dlls/netapi32/wksta.c          |    1 -
 dlls/secur32/secur32.c         |    1 -
 include/ntsecapi.h             |   30 ++++++++++++++++++++++++++++++
 include/sspi.h                 |   11 +++++++++++
 include/winternl.h             |    9 +++++++++
 11 files changed, 50 insertions(+), 8 deletions(-)

diff --git a/dlls/advapi32/lsa.c b/dlls/advapi32/lsa.c
index 2e1a04d..05dba40 100644
--- a/dlls/advapi32/lsa.c
+++ b/dlls/advapi32/lsa.c
@@ -28,7 +28,6 @@ #define WIN32_NO_STATUS
 #include "windef.h"
 #include "winbase.h"
 #include "winreg.h"
-#include "winternl.h"
 #include "ntsecapi.h"
 #include "advapi32_misc.h"
 
diff --git a/dlls/advapi32/tests/lsa.c b/dlls/advapi32/tests/lsa.c
index e832a2a..2daf65d 100644
--- a/dlls/advapi32/tests/lsa.c
+++ b/dlls/advapi32/tests/lsa.c
@@ -26,7 +26,6 @@ #define WIN32_NO_STATUS
 #include "windef.h"
 #include "winbase.h"
 #include "winreg.h"
-#include "winternl.h"
 #include "ntsecapi.h"
 #include "sddl.h"
 #include "winnls.h"
diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c
index 452f0d2..6419864 100644
--- a/dlls/advapi32/tests/security.c
+++ b/dlls/advapi32/tests/security.c
@@ -28,7 +28,6 @@ #include "winbase.h"
 #include "winerror.h"
 #include "aclapi.h"
 #include "winnt.h"
-#include "winternl.h"
 #include "sddl.h"
 #include "ntsecapi.h"
 
diff --git a/dlls/netapi32/access.c b/dlls/netapi32/access.c
index 4e3e65b..b9155e5 100644
--- a/dlls/netapi32/access.c
+++ b/dlls/netapi32/access.c
@@ -30,7 +30,6 @@ #include "lmaccess.h"
 #include "lmapibuf.h"
 #include "lmerr.h"
 #include "winreg.h"
-#include "winternl.h"
 #include "ntsecapi.h"
 #include "netapi32_misc.h"
 #include "wine/debug.h"
diff --git a/dlls/netapi32/ds.c b/dlls/netapi32/ds.c
index 5c6713d..33aa1e0 100644
--- a/dlls/netapi32/ds.c
+++ b/dlls/netapi32/ds.c
@@ -25,7 +25,6 @@ #define WIN32_NO_STATUS
 #include "windef.h"
 #include "winbase.h"
 #include "winerror.h"
-#include "winternl.h"
 #include "ntsecapi.h"
 #include "wine/debug.h"
 #include "dsrole.h"
diff --git a/dlls/netapi32/local_group.c b/dlls/netapi32/local_group.c
index bb0b7aa..68534ac 100644
--- a/dlls/netapi32/local_group.c
+++ b/dlls/netapi32/local_group.c
@@ -30,7 +30,6 @@ #include "lmaccess.h"
 #include "lmapibuf.h"
 #include "lmerr.h"
 #include "winreg.h"
-#include "winternl.h"
 #include "ntsecapi.h"
 #include "netapi32_misc.h"
 #include "wine/debug.h"
diff --git a/dlls/netapi32/wksta.c b/dlls/netapi32/wksta.c
index d89cd1a..5774344 100644
--- a/dlls/netapi32/wksta.c
+++ b/dlls/netapi32/wksta.c
@@ -36,7 +36,6 @@ #include "lmwksta.h"
 #include "iphlpapi.h"
 #include "winerror.h"
 #include "winreg.h"
-#include "winternl.h"
 #include "ntsecapi.h"
 #include "netbios.h"
 #include "wine/debug.h"
diff --git a/dlls/secur32/secur32.c b/dlls/secur32/secur32.c
index 8b3da3d..ddd2195 100644
--- a/dlls/secur32/secur32.c
+++ b/dlls/secur32/secur32.c
@@ -25,7 +25,6 @@ #include "windef.h"
 #include "winbase.h"
 #include "winnls.h"
 #include "winreg.h"
-#include "winternl.h"
 #include "shlwapi.h"
 #include "sspi.h"
 #include "secur32_priv.h"
diff --git a/include/ntsecapi.h b/include/ntsecapi.h
index 4ed878e..8ef6167 100644
--- a/include/ntsecapi.h
+++ b/include/ntsecapi.h
@@ -135,6 +135,36 @@ typedef enum _POLICY_AUDIT_EVENT_TYPE
     AuditCategoryAccountManagement
 } POLICY_AUDIT_EVENT_TYPE, *PPOLICY_AUDIT_EVENT_TYPE;
 
+#ifndef __STRING_DEFINED__
+#define __STRING_DEFINED__
+typedef struct _STRING {
+  USHORT Length;
+  USHORT MaximumLength;
+  PCHAR Buffer;
+} STRING, *PSTRING;
+#endif
+
+#ifndef __UNICODE_STRING_DEFINED__
+#define __UNICODE_STRING_DEFINED__
+typedef struct _UNICODE_STRING {
+  USHORT Length;        /* bytes */
+  USHORT MaximumLength; /* bytes */
+  PWSTR  Buffer;
+} UNICODE_STRING, *PUNICODE_STRING;
+#endif
+
+#ifndef __OBJECT_ATTRIBUTES_DEFINED__
+#define __OBJECT_ATTRIBUTES_DEFINED__
+typedef struct _OBJECT_ATTRIBUTES {
+  ULONG Length;
+  HANDLE RootDirectory;
+  PUNICODE_STRING ObjectName;
+  ULONG Attributes;
+  PVOID SecurityDescriptor;       /* type SECURITY_DESCRIPTOR */
+  PVOID SecurityQualityOfService; /* type SECURITY_QUALITY_OF_SERVICE */
+} OBJECT_ATTRIBUTES, *POBJECT_ATTRIBUTES;
+#endif
+
 typedef UNICODE_STRING LSA_UNICODE_STRING, *PLSA_UNICODE_STRING;
 typedef STRING LSA_STRING, *PLSA_STRING;
 typedef OBJECT_ATTRIBUTES LSA_OBJECT_ATTRIBUTES, *PLSA_OBJECT_ATTRIBUTES;
diff --git a/include/sspi.h b/include/sspi.h
index e743d99..1a4ce52 100644
--- a/include/sspi.h
+++ b/include/sspi.h
@@ -73,6 +73,17 @@ typedef struct _SECURITY_INTEGER
 } SECURITY_INTEGER, *PSECURITY_INTEGER;
 typedef SECURITY_INTEGER TimeStamp, *PTimeStamp;
 
+#ifndef __UNICODE_STRING_DEFINED__
+#define __UNICODE_STRING_DEFINED__
+typedef struct _UNICODE_STRING {
+  USHORT Length;        /* bytes */
+  USHORT MaximumLength; /* bytes */
+  PWSTR  Buffer;
+} UNICODE_STRING, *PUNICODE_STRING;
+#endif
+
+typedef UNICODE_STRING SECURITY_STRING, *PSECURITY_STRING;
+
 typedef struct _SecPkgInfoA
 {
     unsigned long  fCapabilities;
diff --git a/include/winternl.h b/include/winternl.h
index 75557dc..9509176 100644
--- a/include/winternl.h
+++ b/include/winternl.h
@@ -42,11 +42,14 @@ typedef CONST char *PCSZ;
 typedef short CSHORT;
 typedef CSHORT *PCSHORT;
 
+#ifndef __STRING_DEFINED__
+#define __STRING_DEFINED__
 typedef struct _STRING {
   USHORT Length;
   USHORT MaximumLength;
   PCHAR Buffer;
 } STRING, *PSTRING;
+#endif
 
 typedef STRING ANSI_STRING;
 typedef PSTRING PANSI_STRING;
@@ -56,11 +59,14 @@ typedef STRING OEM_STRING;
 typedef PSTRING POEM_STRING;
 typedef const STRING *PCOEM_STRING;
 
+#ifndef __UNICODE_STRING_DEFINED__
+#define __UNICODE_STRING_DEFINED__
 typedef struct _UNICODE_STRING {
   USHORT Length;        /* bytes */
   USHORT MaximumLength; /* bytes */
   PWSTR  Buffer;
 } UNICODE_STRING, *PUNICODE_STRING;
+#endif
 
 typedef const UNICODE_STRING *PCUNICODE_STRING;
 
@@ -919,6 +925,8 @@ typedef struct _KEY_VALUE_PARTIAL_INFORM
     UCHAR Data[1];
 } KEY_VALUE_PARTIAL_INFORMATION, *PKEY_VALUE_PARTIAL_INFORMATION;
 
+#ifndef __OBJECT_ATTRIBUTES_DEFINED__
+#define __OBJECT_ATTRIBUTES_DEFINED__
 typedef struct _OBJECT_ATTRIBUTES {
   ULONG Length;
   HANDLE RootDirectory;
@@ -927,6 +935,7 @@ typedef struct _OBJECT_ATTRIBUTES {
   PVOID SecurityDescriptor;       /* type SECURITY_DESCRIPTOR */
   PVOID SecurityQualityOfService; /* type SECURITY_QUALITY_OF_SERVICE */
 } OBJECT_ATTRIBUTES, *POBJECT_ATTRIBUTES;
+#endif
 
 typedef struct _OBJECT_DATA_INFORMATION {
     BOOLEAN InheritHandle;
-- 
1.4.1.1




More information about the wine-patches mailing list