- Make the NDK compatible with the MSDDK again.
authorAlex Ionescu <aionescu@gmail.com>
Mon, 28 Nov 2005 21:40:21 +0000 (21:40 +0000)
committerAlex Ionescu <aionescu@gmail.com>
Mon, 28 Nov 2005 21:40:21 +0000 (21:40 +0000)
- Fix some w32api incompatibility cruft since w32api insists on including winnt.h from kernel-mode.
- Fix some stuff that was including both kernel-mode and user-mode headers together.
- Use PISECURITY_DESCRIPTOR, not PSECURITY_DESCRIPTOR.

svn path=/trunk/; revision=19726

29 files changed:
reactos/drivers/multimedia/portcls/portcls.c
reactos/drivers/multimedia/portcls/portcls.h
reactos/drivers/net/afd/include/afd.h
reactos/drivers/net/wshtcpip/wshtcpip.h
reactos/drivers/video/displays/vga/vgaddi.h
reactos/include/arc/arc.h
reactos/include/ndk/cmfuncs.h
reactos/include/ndk/exfuncs.h
reactos/include/ndk/haltypes.h
reactos/include/ndk/i386/ketypes.h
reactos/include/ndk/ifssupp.h
reactos/include/ndk/iofuncs.h
reactos/include/ndk/ketypes.h
reactos/include/ndk/mmfuncs.h
reactos/include/ndk/obfuncs.h
reactos/include/ndk/obtypes.h
reactos/include/ndk/rtlfuncs.h
reactos/include/ndk/rtltypes.h
reactos/include/ndk/setypes.h
reactos/lib/hid/precomp.h
reactos/lib/rtl/bootdata.c
reactos/ntoskrnl/cm/regobj.c
reactos/ntoskrnl/include/ntoskrnl.h
reactos/ntoskrnl/ob/security.c
reactos/ntoskrnl/se/sd.c
reactos/ntoskrnl/se/semgr.c
reactos/w32api/include/ddk/ntifs.h
reactos/w32api/include/ddk/winddk.h
reactos/w32api/include/winnt.h

index e0c52c1..99fc654 100644 (file)
@@ -25,8 +25,6 @@
  *  REVISION HISTORY:
  *       21 November 2005   Created James Tabor
  */
-#include <ddk/ntddk.h>
-#include <windows.h>
 #include "portcls.h"
 
 
index 49741a5..76158f9 100644 (file)
@@ -13,7 +13,6 @@
 extern "C" {
 #endif
 
-#include <windef.h>
 #include <ddk/ntddk.h>
 
 #define PORTCLASSAPI extern
index eea8e65..adfb2b7 100644 (file)
@@ -17,6 +17,8 @@
 #include <tdikrnl.h>
 #include <tdiinfo.h>
 #include <string.h>
+#define _WINBASE_
+#define _WINDOWS_H
 #include <winsock2.h>
 #include <afd/shared.h>
 
index dea8e2a..fa08822 100644 (file)
@@ -7,7 +7,9 @@
 #ifndef __WSHTCPIP_H
 #define __WSHTCPIP_H
 
-#include <ddk/ntddk.h>
+#define WIN32_NO_STATUS
+#include <windows.h>
+#include <rtlfuncs.h>
 #include <wsahelp.h>
 
 #define EXPORT STDCALL
index b630dc8..2b7f841 100644 (file)
@@ -1,3 +1,5 @@
+#define _WINBASE_
+#define _WINDOWS_H
 #include <windef.h>
 #include <wingdi.h>
 #include <ddk/ntddk.h>
index a913db9..43747c1 100644 (file)
@@ -42,4 +42,17 @@ typedef struct _CONFIGURATION_COMPONENT
     LPSTR Identifier;
 } CONFIGURATION_COMPONENT, *PCONFIGURATION_COMPONENT;
 
+typedef struct _CONFIGURATION_COMPONENT_DATA
+{
+    struct _CONFIGURATION_COMPONENT_DATA *Parent;
+    struct _CONFIGURATION_COMPONENT_DATA *Child;
+    struct _CONFIGURATION_COMPONENT_DATA *Sibling;
+    CONFIGURATION_COMPONENT Component;
+} CONFIGURATION_COMPONENT_DATA, *PCONFIGURATION_COMPONENT_DATA;
+
+typedef struct _ARC_DISK_INFORMATION
+{
+    LIST_ENTRY DiskSignatureListHead;
+} ARC_DISK_INFORMATION, *PARC_DISK_INFORMATION;
+
 #endif
index b149894..9c0fa7b 100644 (file)
@@ -230,6 +230,7 @@ NtUnloadKey(
     IN POBJECT_ATTRIBUTES KeyObjectAttributes\r
 );\r
 \r
+#ifdef NTOS_MODE_USER\r
 NTSTATUS\r
 NTAPI\r
 ZwCreateKey(\r
@@ -242,6 +243,7 @@ ZwCreateKey(
     IN PULONG Disposition OPTIONAL\r
 );\r
 \r
+\r
 NTSTATUS\r
 NTAPI\r
 ZwDeleteKey(\r
@@ -426,6 +428,7 @@ ZwSetValueKey(
     IN PVOID Data,\r
     IN ULONG DataSize\r
 );\r
+#endif\r
 \r
 NTSTATUS\r
 NTAPI\r
index ef3a50c..0d3a5ef 100644 (file)
@@ -417,12 +417,14 @@ ZwAddAtom(
     IN OUT PRTL_ATOM Atom\r
 );\r
 \r
+#ifdef NTOS_MODE_USER\r
 NTSTATUS\r
 NTAPI\r
 ZwCancelTimer(\r
     IN HANDLE TimerHandle,\r
     OUT PBOOLEAN CurrentState OPTIONAL\r
 );\r
+#endif\r
 \r
 NTSTATUS\r
 NTAPI\r
@@ -467,6 +469,7 @@ ZwCreateSemaphore(
     IN LONG MaximumCount\r
 );\r
 \r
+#ifdef NTOS_MODE_USER\r
 NTSTATUS\r
 NTAPI\r
 ZwCreateTimer(\r
@@ -475,6 +478,7 @@ ZwCreateTimer(
     IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL,\r
     IN TIMER_TYPE TimerType\r
 );\r
+#endif\r
 \r
 NTSTATUS\r
 NTAPI\r
@@ -528,6 +532,7 @@ ZwOpenSemaphore(
     IN POBJECT_ATTRIBUTES ObjectAttributes\r
 );\r
 \r
+#ifdef NTOS_MODE_USER\r
 NTSTATUS\r
 NTAPI\r
 ZwOpenTimer(\r
@@ -535,6 +540,7 @@ ZwOpenTimer(
     IN ACCESS_MASK DesiredAccess,\r
     IN POBJECT_ATTRIBUTES ObjectAttributes\r
 );\r
+#endif\r
 \r
 NTSTATUS\r
 NTAPI\r
@@ -728,6 +734,7 @@ ZwSetSystemInformation(
     IN ULONG SystemInformationLength\r
 );\r
 \r
+#ifdef NTOS_MODE_USER\r
 NTSTATUS\r
 NTAPI\r
 ZwSetTimer(\r
@@ -739,6 +746,7 @@ ZwSetTimer(
     IN LONG Period OPTIONAL,\r
     OUT PBOOLEAN PreviousState OPTIONAL\r
 );\r
+#endif\r
 \r
 NTSTATUS\r
 NTAPI\r
index ec70395..38d1f61 100644 (file)
@@ -87,8 +87,8 @@ typedef struct _PROFILE_PARAMETER_BLOCK
     USHORT DockData1;
     USHORT DockData2;
     USHORT DockData3;
-    ULONG DockData3;
     ULONG DockData4;
+    ULONG DockData5;
 } PROFILE_PARAMETER_BLOCK, *PPROFILE_PARAMETER_BLOCK;
 
 typedef struct _HEADLESS_LOADER_BLOCK
index 389b7c8..e428a58 100644 (file)
@@ -86,7 +86,7 @@ typedef struct _FX_SAVE_AREA
 } FX_SAVE_AREA, *PFX_SAVE_AREA;
 
 //
-// FIXME: Trap Frame Definition
+// Trap Frame Definition
 //
 typedef struct _KTRAP_FRAME
 {
index e263605..0e1427c 100644 (file)
@@ -19,7 +19,16 @@ Author:
 #ifndef NTOS_MODE_USER\r
 #define _NTIFS_\r
 \r
+#define TOKEN_SOURCE_LENGTH               8\r
+\r
+typedef enum _TOKEN_TYPE\r
+{\r
+    TokenPrimary = 1,\r
+    TokenImpersonation\r
+} TOKEN_TYPE, *PTOKEN_TYPE;\r
+\r
 typedef PVOID PRTL_HEAP_PARAMETERS;\r
+typedef USHORT SECURITY_DESCRIPTOR_CONTROL, *PSECURITY_DESCRIPTOR_CONTROL;\r
 \r
 typedef struct _RTL_SPLAY_LINKS\r
 {\r
@@ -93,7 +102,7 @@ typedef struct _REMOTE_PORT_VIEW
 typedef struct _KAPC_STATE\r
 {\r
     LIST_ENTRY ApcListHead[2];\r
-    PKPROCESS Process;\r
+    struct _KPROCESS *Process;\r
     BOOLEAN KernelApcInProgress;\r
     BOOLEAN KernelApcPending;\r
     BOOLEAN UserApcPending;\r
@@ -108,9 +117,40 @@ typedef struct _KQUEUE
     LIST_ENTRY ThreadListHead;\r
 } KQUEUE, *PKQUEUE, *RESTRICTED_POINTER PRKQUEUE;\r
 \r
-typedef PVOID EX_RUNDOWN_REF;\r
 typedef PVOID EX_PUSH_LOCK;\r
 \r
+typedef enum _RTL_GENERIC_COMPARE_RESULTS\r
+{\r
+    GenericLessThan,\r
+    GenericGreaterThan,\r
+    GenericEqual\r
+} RTL_GENERIC_COMPARE_RESULTS;\r
+\r
+typedef struct _SID_IDENTIFIER_AUTHORITY\r
+{\r
+    UCHAR Value[6];\r
+} SID_IDENTIFIER_AUTHORITY, *PSID_IDENTIFIER_AUTHORITY;\r
+\r
+typedef struct _SID_AND_ATTRIBUTES\r
+{\r
+    PSID Sid;\r
+    ULONG Attributes;\r
+} SID_AND_ATTRIBUTES, * PSID_AND_ATTRIBUTES;\r
+\r
+typedef struct _TOKEN_SOURCE\r
+{\r
+    CHAR SourceName[TOKEN_SOURCE_LENGTH];\r
+    LUID SourceIdentifier;\r
+} TOKEN_SOURCE, *PTOKEN_SOURCE;\r
+\r
+typedef struct _TOKEN_CONTROL\r
+{\r
+    LUID TokenId;\r
+    LUID AuthenticationId;\r
+    LUID ModifiedId;\r
+    TOKEN_SOURCE TokenSource;\r
+} TOKEN_CONTROL, *PTOKEN_CONTROL;\r
+\r
 typedef struct _SECURITY_CLIENT_CONTEXT\r
 {\r
     SECURITY_QUALITY_OF_SERVICE SecurityQos;\r
@@ -121,12 +161,79 @@ typedef struct _SECURITY_CLIENT_CONTEXT
     TOKEN_CONTROL ClientTokenControl;\r
 } SECURITY_CLIENT_CONTEXT, *PSECURITY_CLIENT_CONTEXT;\r
 \r
-typedef enum _RTL_GENERIC_COMPARE_RESULTS\r
+typedef struct _SECURITY_DESCRIPTOR_RELATIVE\r
 {\r
-    GenericLessThan,\r
-    GenericGreaterThan,\r
-    GenericEqual\r
-} RTL_GENERIC_COMPARE_RESULTS;\r
+    UCHAR Revision;\r
+    UCHAR Sbz1;\r
+    SECURITY_DESCRIPTOR_CONTROL Control;\r
+    ULONG Owner;\r
+    ULONG Group;\r
+    ULONG Sacl;\r
+    ULONG Dacl;\r
+} SECURITY_DESCRIPTOR_RELATIVE, *PISECURITY_DESCRIPTOR_RELATIVE;\r
+\r
+typedef struct _TOKEN_GROUPS\r
+{\r
+    ULONG GroupCount;\r
+    SID_AND_ATTRIBUTES Groups[ANYSIZE_ARRAY];\r
+} TOKEN_GROUPS, *PTOKEN_GROUPS;\r
+\r
+typedef struct _TOKEN_PRIVILEGES\r
+{\r
+    ULONG PrivilegeCount;\r
+    LUID_AND_ATTRIBUTES Privileges[ANYSIZE_ARRAY];\r
+} TOKEN_PRIVILEGES, *PTOKEN_PRIVILEGES;\r
+\r
+typedef struct _TOKEN_USER\r
+{\r
+    SID_AND_ATTRIBUTES User;\r
+} TOKEN_USER, *PTOKEN_USER;\r
+\r
+typedef enum _TOKEN_INFORMATION_CLASS\r
+{\r
+    TokenUser = 1,\r
+    TokenGroups,\r
+    TokenPrivileges,\r
+    TokenOwner,\r
+    TokenPrimaryGroup,\r
+    TokenDefaultDacl,\r
+    TokenSource,\r
+    TokenType,\r
+    TokenImpersonationLevel,\r
+    TokenStatistics,\r
+    TokenRestrictedSids,\r
+    TokenSessionId,\r
+    TokenGroupsAndPrivileges,\r
+    TokenSessionReference,\r
+    TokenSandBoxInert,\r
+    TokenAuditPolicy,\r
+    TokenOrigin,\r
+    TokenElevationType,\r
+    TokenLinkedToken,\r
+    TokenElevation,\r
+    TokenIsRestricted,\r
+    TokenAccessInformation,\r
+    TokenVirtualization,\r
+    TokenIntegrityLevel,\r
+    TokenIntegrityLevelDesktop,\r
+    TokenMandatoryPolicy,\r
+    MaxTokenInfoClass\r
+} TOKEN_INFORMATION_CLASS, *PTOKEN_INFORMATION_CLASS;\r
+\r
+typedef struct _TOKEN_OWNER\r
+{\r
+    PSID Owner;\r
+} TOKEN_OWNER, *PTOKEN_OWNER;\r
+\r
+typedef struct _TOKEN_PRIMARY_GROUP\r
+{\r
+    PSID PrimaryGroup;\r
+} TOKEN_PRIMARY_GROUP, *PTOKEN_PRIMARY_GROUP;\r
+\r
+typedef struct _TOKEN_DEFAULT_DACL\r
+{\r
+    PACL DefaultDacl;\r
+} TOKEN_DEFAULT_DACL, *PTOKEN_DEFAULT_DACL;\r
 \r
 #endif // !NTOS_MODE_USER\r
 #endif // _NTIFS_\r
index 2da9d04..c867b02 100644 (file)
@@ -617,11 +617,13 @@ ZwFsControlFile(
     IN ULONG OutputBufferSize
 );
 
+#ifdef NTOS_MODE_USER
 NTSTATUS
 NTAPI
 ZwLoadDriver(
     IN PUNICODE_STRING DriverServiceName
 );
+#endif
 
 NTSYSCALLAPI
 NTSTATUS
@@ -891,6 +893,7 @@ ZwTranslateFilePath(
     ULONG Unknown3
 );
 
+NTSYSAPI
 NTSTATUS
 NTAPI
 ZwUnloadDriver(
index 504ea13..efa84fa 100644 (file)
@@ -338,17 +338,6 @@ typedef struct _PP_LOOKASIDE_LIST
 //
 #include <arch/ketypes.h>
 
-//
-// ARC Component Data
-//
-typedef struct _CONFIGURATION_COMPONENT_DATA
-{
-    struct _CONFIGURATION_COMPONENT_DATA *Parent;
-    struct _CONFIGURATION_COMPONENT_DATA *Child;
-    struct _CONFIGURATION_COMPONENT_DATA *Sibling;
-    CONFIGURATION_COMPONENT Component;
-} CONFIGURATION_COMPONENT_DATA, *PCONFIGURATION_COMPONENT_DATA;
-
 //
 // Kernel Memory Node
 //
@@ -374,7 +363,7 @@ typedef struct _KPROFILE
     CSHORT Type;
     CSHORT Size;
     LIST_ENTRY ProfileListEntry;
-    PKPROCESS Process;
+    struct _KPROCESS *Process;
     PVOID RangeBase;
     PVOID RangeLimit;
     ULONG BucketShift;
@@ -696,7 +685,7 @@ typedef struct _KPROCESS
     KEXECUTE_OPTIONS      Flags;                     /* 06B */
     ULONG                 StackCount;                /* 06C */
     LIST_ENTRY            ProcessListEntry;          /* 070 */
-} KPROCESS;
+} KPROCESS, *PKPROCESS;
 
 //
 // System Service Table Descriptor
index b0f50ee..9c087c8 100644 (file)
@@ -260,6 +260,7 @@ ZwLockVirtualMemory(
     PULONG NumberOfBytesLocked
 );
 
+NTSYSAPI
 NTSTATUS
 NTAPI
 ZwMapViewOfSection(
@@ -275,6 +276,7 @@ ZwMapViewOfSection(
     IN ULONG AccessProtection
 );
 
+NTSYSAPI
 NTSTATUS
 NTAPI
 ZwOpenSection(
@@ -333,6 +335,7 @@ ZwUnlockVirtualMemory(
     OUT PULONG NumberOfBytesUnlocked OPTIONAL
 );
 
+NTSYSAPI
 NTSTATUS
 NTAPI
 ZwUnmapViewOfSection(
index 6fa6d6d..1a5105b 100644 (file)
@@ -269,6 +269,7 @@ ZwCloseObjectAuditAlarm(
     IN BOOLEAN GenerateOnClose
 );
 
+NTSYSAPI
 NTSTATUS
 NTAPI
 ZwCreateDirectoryObject(
@@ -313,6 +314,7 @@ ZwMakePermanentObject(
     IN HANDLE Object
 );
 
+NTSYSAPI
 NTSTATUS
 NTAPI
 ZwMakeTemporaryObject(
@@ -335,6 +337,7 @@ ZwOpenJobObject(
     POBJECT_ATTRIBUTES ObjectAttributes
 );
 
+NTSYSAPI
 NTSTATUS
 NTAPI
 ZwOpenSymbolicLinkObject(
@@ -376,6 +379,7 @@ ZwQuerySecurityObject(
     OUT PULONG ResultLength
 );
 
+NTSYSAPI
 NTSTATUS
 NTAPI
 ZwQuerySymbolicLinkObject(
index ed083a2..061d773 100644 (file)
@@ -120,11 +120,11 @@ typedef enum _OBJECT_INFORMATION_CLASS
 //
 // Dump Control Structure for Object Debugging
 //
-typedef struct _OBJECT_DUMP_CONTROL
+typedef struct _OB_DUMP_CONTROL
 {
     PVOID Stream;
     ULONG Detail;
-} OBJECT_DUMP_CONTROL, *POBJECT_DUMP_CONTROL;
+} OB_DUMP_CONTROL, *POB_DUMP_CONTROL;
 
 #ifndef NTOS_MODE_USER
 #ifndef _REACTOS_
@@ -196,6 +196,11 @@ typedef NTSTATUS
     OUT PULONG ReturnLength
 );
 
+typedef NTSTATUS
+(NTAPI *OB_OKAYTOCLOSE_METHOD)(
+    VOID
+);
+
 #else
 
 //
index ef94bf0..eb8771c 100644 (file)
@@ -1595,32 +1595,7 @@ RtlSetProcessIsCritical(
     IN BOOLEAN IsWinlogon
 );
 
-static __inline
-struct _PEB*
-NtCurrentPeb(VOID)
-{
-    struct _PEB *pPeb;
-
-#if defined(__GNUC__)
-
-    __asm__ __volatile__
-    (
-      "movl %%fs:0x30, %0\n" /* fs:30h == Teb->Peb */
-      : "=r" (pPeb) /* can't have two memory operands */
-      : /* no inputs */
-    );
-
-#elif defined(_MSC_VER)
-
-    __asm mov eax, fs:0x30;
-    __asm mov pPeb, eax
-
-#else
-#error Unknown compiler for inline assembler
-#endif
-
-    return pPeb;
-}
+#define NtCurrentPeb() (NtCurrentTeb()->ProcessEnvironmentBlock)
 
 //
 // Environment/Path Functions
index 92dc4c9..e5abebd 100644 (file)
@@ -537,11 +537,18 @@ typedef struct _TIME_FIELDS
     CSHORT Milliseconds;
     CSHORT Weekday;
 } TIME_FIELDS, *PTIME_FIELDS;
-#endif
 
+#else
 //
-// ACE Definition
+// ACE Definitions
 //
+typedef struct _ACE_HEADER
+{
+    UCHAR AceType;
+    UCHAR AceFlags;
+    USHORT AceSize;
+} ACE_HEADER, *PACE_HEADER;
+#endif
 typedef struct _ACE
 {
     ACE_HEADER Header;
index 7884aaa..eb1a398 100644 (file)
@@ -24,10 +24,11 @@ Author:
 //
 #include <umtypes.h>
 
+#ifdef NTOS_MODE_USER
+
 //
 // Privilege constants
 //
-#ifdef NTOS_MODE_USER
 #define SE_MIN_WELL_KNOWN_PRIVILEGE       (2L)
 #define SE_CREATE_TOKEN_PRIVILEGE         (2L)
 #define SE_ASSIGNPRIMARYTOKEN_PRIVILEGE   (3L)
@@ -54,12 +55,11 @@ Author:
 #define SE_CHANGE_NOTIFY_PRIVILEGE        (23L)
 #define SE_REMOTE_SHUTDOWN_PRIVILEGE      (24L)
 #define SE_MAX_WELL_KNOWN_PRIVILEGE       (SE_REMOTE_SHUTDOWN_PRIVILEGE)
-#endif
+#else
 
 //
-// Policy types
+// Audit and Policy Structures
 //
-#ifndef NTOS_MODE_USER
 typedef struct _SEP_AUDIT_POLICY_CATEGORIES
 {
     UCHAR System:4;
index dc8a747..d19c001 100644 (file)
@@ -1,8 +1,16 @@
-#include <ddk/ntddk.h>
+#define WIN32_NO_STATUS
 #include <windows.h>
 
+#define DDKAPI __stdcall
 #define _HIDPI_
 #define _HIDPI_NO_FUNCTION_MACROS_
+typedef VOID
+(DDKAPI *PINTERFACE_REFERENCE)(
+  PVOID  Context);
+typedef VOID
+(DDKAPI *PINTERFACE_DEREFERENCE)(
+  PVOID  Context);
+#include <ntndk.h>
 #include <ddk/hidusage.h>
 #include <ddk/hidclass.h>
 #include <ddk/hidpi.h>
index de64dea..6040d32 100644 (file)
@@ -126,7 +126,7 @@ Cleanup:
 
 static NTSTATUS
 RtlpSysVolCheckOwnerAndSecurity(IN HANDLE DirectoryHandle,
-                                IN PSECURITY_DESCRIPTOR SecurityDescriptor)
+                                IN PISECURITY_DESCRIPTOR SecurityDescriptor)
 {
     PSECURITY_DESCRIPTOR RelSD = NULL;
     PSECURITY_DESCRIPTOR NewRelSD = NULL;
@@ -549,7 +549,7 @@ RtlCreateSystemVolumeInformationFolder(
     HANDLE hDirectory;
     UNICODE_STRING DirectoryName, NewPath;
     ULONG PathLen;
-    PSECURITY_DESCRIPTOR SecurityDescriptor = NULL;
+    PISECURITY_DESCRIPTOR SecurityDescriptor = NULL;
     PSID SystemSid = NULL;
     BOOLEAN AddSep = FALSE;
     NTSTATUS Status;
index 57ba22a..b824c85 100644 (file)
@@ -336,7 +336,7 @@ CmiObjectDelete(PVOID DeletedObject)
 static NTSTATUS
 CmiQuerySecurityDescriptor(PKEY_OBJECT KeyObject,
                           SECURITY_INFORMATION SecurityInformation,
-                          PSECURITY_DESCRIPTOR SecurityDescriptor,
+                          PISECURITY_DESCRIPTOR SecurityDescriptor,
                           PULONG BufferLength)
 {
   ULONG_PTR Current;
index 02940ec..bc6b616 100755 (executable)
@@ -13,8 +13,8 @@
 #define _NTSYSTEM_
 
 /* DDK/IFS/NDK Headers */
-#include <ddk/ntddk.h>
 #include <ddk/ntifs.h>
+#include <ddk/ntddk.h>
 #include <ddk/wdmguid.h>
 #include <ndk/ntndk.h>
 
index 580ff6a..b23e912 100644 (file)
@@ -263,7 +263,7 @@ ObLogSecurityDescriptor(IN PSECURITY_DESCRIPTOR InputSecurityDescriptor,
                         IN ULONG RefBias)
 {
     /* HACK: Return the same descriptor back */
-    PSECURITY_DESCRIPTOR SdCopy;
+    PISECURITY_DESCRIPTOR SdCopy;
     DPRINT1("ObLogSecurityDescriptor is not implemented!\n", InputSecurityDescriptor);
 
     SdCopy = ExAllocatePool(PagedPool, sizeof(*SdCopy));
index 5f17ab1..18accd3 100644 (file)
@@ -113,7 +113,7 @@ SepInitSDs(VOID)
 NTSTATUS
 STDCALL
 SeSetWorldSecurityDescriptor(SECURITY_INFORMATION SecurityInformation,
-                             PSECURITY_DESCRIPTOR SecurityDescriptor,
+                             PISECURITY_DESCRIPTOR SecurityDescriptor,
                              PULONG BufferLength)
 {
   ULONG_PTR Current;
@@ -356,15 +356,16 @@ SepReleaseSecurityQualityOfService(IN PSECURITY_QUALITY_OF_SERVICE CapturedSecur
 NTSTATUS
 STDCALL
 SeCaptureSecurityDescriptor(
-       IN PSECURITY_DESCRIPTOR OriginalSecurityDescriptor,
+       IN PSECURITY_DESCRIPTOR _OriginalSecurityDescriptor,
        IN KPROCESSOR_MODE CurrentMode,
        IN POOL_TYPE PoolType,
        IN BOOLEAN CaptureIfKernel,
        OUT PSECURITY_DESCRIPTOR *CapturedSecurityDescriptor
        )
 {
+  PISECURITY_DESCRIPTOR OriginalSecurityDescriptor = _OriginalSecurityDescriptor;
   SECURITY_DESCRIPTOR DescriptorCopy;
-  PSECURITY_DESCRIPTOR NewDescriptor;
+  PISECURITY_DESCRIPTOR NewDescriptor;
   ULONG OwnerSAC = 0, GroupSAC = 0;
   ULONG OwnerSize = 0, GroupSize = 0;
   ULONG SaclSize = 0, DaclSize = 0;
@@ -678,7 +679,7 @@ SeQuerySecurityDescriptorInfo(IN PSECURITY_INFORMATION SecurityInformation,
                              IN OUT PULONG Length,
                              IN PSECURITY_DESCRIPTOR *ObjectsSecurityDescriptor OPTIONAL)
 {
-  PSECURITY_DESCRIPTOR ObjectSd;
+  PISECURITY_DESCRIPTOR ObjectSd;
   PISECURITY_DESCRIPTOR_RELATIVE RelSD;
   PSID Owner = NULL;
   PSID Group = NULL;
@@ -873,11 +874,12 @@ SeSetSecurityDescriptorInfoEx(
  */
 BOOLEAN STDCALL
 SeValidSecurityDescriptor(IN ULONG Length,
-                         IN PSECURITY_DESCRIPTOR SecurityDescriptor)
+                         IN PSECURITY_DESCRIPTOR _SecurityDescriptor)
 {
   ULONG SdLength;
   PISID Sid;
   PACL Acl;
+  PISECURITY_DESCRIPTOR SecurityDescriptor = _SecurityDescriptor;
 
   if (Length < SECURITY_DESCRIPTOR_MIN_LENGTH)
     {
index 0b58020..be0bd65 100644 (file)
@@ -196,16 +196,17 @@ VOID SepDeReferenceLogonSession(PLUID AuthenticationId)
 NTSTATUS
 STDCALL
 SeDefaultObjectMethod(PVOID Object,
-                      SECURITY_OPERATION_CODE OperationType,                         
+                      SECURITY_OPERATION_CODE OperationType,
                       SECURITY_INFORMATION SecurityInformation,
-                      PSECURITY_DESCRIPTOR SecurityDescriptor,
+                      PSECURITY_DESCRIPTOR _SecurityDescriptor,
                       PULONG ReturnLength,
                       PSECURITY_DESCRIPTOR *OldSecurityDescriptor,
                       POOL_TYPE PoolType,
                       PGENERIC_MAPPING GenericMapping)
 {
-  PSECURITY_DESCRIPTOR ObjectSd;
-  PSECURITY_DESCRIPTOR NewSd;
+  PISECURITY_DESCRIPTOR ObjectSd;
+  PISECURITY_DESCRIPTOR NewSd;
+  PISECURITY_DESCRIPTOR SecurityDescriptor = _SecurityDescriptor;
   POBJECT_HEADER Header = BODY_TO_HEADER(Object);
   PSID Owner = 0;
   PSID Group = 0;
@@ -541,15 +542,17 @@ SeAssignSecurityEx(IN PSECURITY_DESCRIPTOR ParentDescriptor OPTIONAL,
  * @implemented
  */
 NTSTATUS STDCALL
-SeAssignSecurity(PSECURITY_DESCRIPTOR ParentDescriptor OPTIONAL,
-                PSECURITY_DESCRIPTOR ExplicitDescriptor OPTIONAL,
+SeAssignSecurity(PSECURITY_DESCRIPTOR _ParentDescriptor OPTIONAL,
+                PSECURITY_DESCRIPTOR _ExplicitDescriptor OPTIONAL,
                 PSECURITY_DESCRIPTOR *NewDescriptor,
                 BOOLEAN IsDirectoryObject,
                 PSECURITY_SUBJECT_CONTEXT SubjectContext,
                 PGENERIC_MAPPING GenericMapping,
                 POOL_TYPE PoolType)
 {
-  PSECURITY_DESCRIPTOR Descriptor;
+  PISECURITY_DESCRIPTOR ParentDescriptor = _ParentDescriptor;
+  PISECURITY_DESCRIPTOR ExplicitDescriptor = _ExplicitDescriptor;
+  PISECURITY_DESCRIPTOR Descriptor;
   PTOKEN Token;
   ULONG OwnerLength = 0;
   ULONG GroupLength = 0;
index 8f082f4..a49910f 100644 (file)
@@ -619,17 +619,6 @@ typedef struct _COMPRESSED_DATA_INFO {
     ULONG   CompressedChunkSizes[ANYSIZE_ARRAY];
 } COMPRESSED_DATA_INFO, *PCOMPRESSED_DATA_INFO;
 
-#define EX_RUNDOWN_ACTIVE               0x1
-#define EX_RUNDOWN_COUNT_SHIFT          0x1
-#define EX_RUNDOWN_COUNT_INC            (1 << EX_RUNDOWN_COUNT_SHIFT)
-
-typedef struct _EX_RUNDOWN_REF {
-    _ANONYMOUS_UNION union {
-        ULONG Count;
-        PVOID Ptr;
-    } DUMMYUNIONNAME;
-} EX_RUNDOWN_REF, *PEX_RUNDOWN_REF;
-
 #define EX_PUSH_LOCK_LOCK_V          ((ULONG_PTR)0x0)
 #define EX_PUSH_LOCK_LOCK            ((ULONG_PTR)0x1)
 #define EX_PUSH_LOCK_WAITING         ((ULONG_PTR)0x2)
@@ -655,6 +644,111 @@ typedef struct _EX_PUSH_LOCK
     };
 } EX_PUSH_LOCK, *PEX_PUSH_LOCK;
 
+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;
+typedef struct _SID_AND_ATTRIBUTES {
+       PSID Sid;
+       DWORD Attributes;
+} SID_AND_ATTRIBUTES, *PSID_AND_ATTRIBUTES;
+typedef SID_AND_ATTRIBUTES SID_AND_ATTRIBUTES_ARRAY[ANYSIZE_ARRAY];
+typedef SID_AND_ATTRIBUTES_ARRAY *PSID_AND_ATTRIBUTES_ARRAY;
+typedef struct _TOKEN_SOURCE {
+       CHAR SourceName[TOKEN_SOURCE_LENGTH];
+       LUID SourceIdentifier;
+} TOKEN_SOURCE,*PTOKEN_SOURCE;
+typedef struct _TOKEN_CONTROL {
+       LUID TokenId;
+       LUID AuthenticationId;
+       LUID ModifiedId;
+       TOKEN_SOURCE TokenSource;
+} TOKEN_CONTROL,*PTOKEN_CONTROL;
+typedef struct _TOKEN_DEFAULT_DACL {
+       PACL DefaultDacl;
+} TOKEN_DEFAULT_DACL,*PTOKEN_DEFAULT_DACL;
+typedef struct _TOKEN_GROUPS {
+       DWORD GroupCount;
+       SID_AND_ATTRIBUTES Groups[ANYSIZE_ARRAY];
+} TOKEN_GROUPS,*PTOKEN_GROUPS,*LPTOKEN_GROUPS;
+typedef struct _TOKEN_GROUPS_AND_PRIVILEGES {
+       ULONG SidCount;
+       ULONG SidLength;
+       PSID_AND_ATTRIBUTES Sids;
+       ULONG RestrictedSidCount;
+       ULONG RestrictedSidLength;
+       PSID_AND_ATTRIBUTES RestrictedSids;
+       ULONG PrivilegeCount;
+       ULONG PrivilegeLength;
+       PLUID_AND_ATTRIBUTES Privileges;
+       LUID AuthenticationId;
+} TOKEN_GROUPS_AND_PRIVILEGES, *PTOKEN_GROUPS_AND_PRIVILEGES;
+typedef struct _TOKEN_ORIGIN {
+       LUID OriginatingLogonSession;
+} TOKEN_ORIGIN, *PTOKEN_ORIGIN;
+typedef struct _TOKEN_OWNER {
+       PSID Owner;
+} TOKEN_OWNER,*PTOKEN_OWNER;
+typedef struct _TOKEN_PRIMARY_GROUP {
+       PSID PrimaryGroup;
+} TOKEN_PRIMARY_GROUP,*PTOKEN_PRIMARY_GROUP;
+typedef struct _TOKEN_PRIVILEGES {
+       DWORD PrivilegeCount;
+       LUID_AND_ATTRIBUTES Privileges[ANYSIZE_ARRAY];
+} TOKEN_PRIVILEGES,*PTOKEN_PRIVILEGES,*LPTOKEN_PRIVILEGES;
+typedef enum tagTOKEN_TYPE {
+       TokenPrimary = 1,
+       TokenImpersonation
+} TOKEN_TYPE,*PTOKEN_TYPE;
+typedef struct _TOKEN_STATISTICS {
+       LUID TokenId;
+       LUID AuthenticationId;
+       LARGE_INTEGER ExpirationTime;
+       TOKEN_TYPE TokenType;
+       SECURITY_IMPERSONATION_LEVEL ImpersonationLevel;
+       DWORD DynamicCharged;
+       DWORD DynamicAvailable;
+       DWORD GroupCount;
+       DWORD PrivilegeCount;
+       LUID ModifiedId;
+} TOKEN_STATISTICS, *PTOKEN_STATISTICS;
+typedef struct _TOKEN_USER {
+       SID_AND_ATTRIBUTES User;
+} TOKEN_USER, *PTOKEN_USER;
+typedef DWORD SECURITY_INFORMATION,*PSECURITY_INFORMATION;
+typedef WORD SECURITY_DESCRIPTOR_CONTROL,*PSECURITY_DESCRIPTOR_CONTROL;
+typedef struct _SECURITY_DESCRIPTOR {
+       BYTE Revision;
+       BYTE Sbz1;
+       SECURITY_DESCRIPTOR_CONTROL Control;
+       PSID Owner;
+       PSID Group;
+       PACL Sacl;
+       PACL Dacl;
+} SECURITY_DESCRIPTOR, *PISECURITY_DESCRIPTOR;
+typedef struct _SECURITY_DESCRIPTOR_RELATIVE {
+    BYTE Revision;
+    BYTE Sbz1;
+    SECURITY_DESCRIPTOR_CONTROL Control;
+    DWORD Owner;
+    DWORD Group;
+    DWORD Sacl;
+    DWORD Dacl;
+} SECURITY_DESCRIPTOR_RELATIVE, *PISECURITY_DESCRIPTOR_RELATIVE;
+typedef enum _TOKEN_INFORMATION_CLASS {
+       TokenUser=1,TokenGroups,TokenPrivileges,TokenOwner,
+       TokenPrimaryGroup,TokenDefaultDacl,TokenSource,TokenType,
+       TokenImpersonationLevel,TokenStatistics,TokenRestrictedSids,
+       TokenSessionId,TokenGroupsAndPrivileges,TokenSessionReference,
+       TokenSandBoxInert,TokenAuditPolicy,TokenOrigin,
+} TOKEN_INFORMATION_CLASS;
+
 typedef struct _FILE_ACCESS_INFORMATION {
     ACCESS_MASK AccessFlags;
 } FILE_ACCESS_INFORMATION, *PFILE_ACCESS_INFORMATION;
@@ -831,6 +925,17 @@ typedef struct _FILE_GET_QUOTA_INFORMATION {
     SID     Sid;
 } FILE_GET_QUOTA_INFORMATION, *PFILE_GET_QUOTA_INFORMATION;
 
+typedef struct _FILE_QUOTA_INFORMATION
+{
+    ULONG NextEntryOffset;
+    ULONG SidLength;
+    LARGE_INTEGER ChangeTime;
+    LARGE_INTEGER QuotaUsed;
+    LARGE_INTEGER QuotaThreshold;
+    LARGE_INTEGER QuotaLimit;
+    SID Sid;
+} FILE_QUOTA_INFORMATION, *PFILE_QUOTA_INFORMATION;
+
 typedef struct _FILE_INTERNAL_INFORMATION {
     LARGE_INTEGER IndexNumber;
 } FILE_INTERNAL_INFORMATION, *PFILE_INTERNAL_INFORMATION;
index 6d2423c..eef60ca 100644 (file)
@@ -134,6 +134,10 @@ struct _SCATTER_GATHER_LIST;
 struct _DRIVE_LAYOUT_INFORMATION;
 struct _DRIVE_LAYOUT_INFORMATION_EX;
 
+typedef PVOID PSECURITY_DESCRIPTOR;
+typedef ULONG SECURITY_INFORMATION, *PSECURITY_INFORMATION;
+typedef PVOID PSID;
+
 DECLARE_INTERNAL_OBJECT(ADAPTER_OBJECT)
 DECLARE_INTERNAL_OBJECT(DMA_ADAPTER)
 DECLARE_INTERNAL_OBJECT(IO_STATUS_BLOCK)
@@ -212,6 +216,10 @@ typedef struct _ADAPTER_OBJECT *PADAPTER_OBJECT;
 
 #define MAXIMUM_WAIT_OBJECTS              64
 
+#define EX_RUNDOWN_ACTIVE                 0x1
+#define EX_RUNDOWN_COUNT_SHIFT            0x1
+#define EX_RUNDOWN_COUNT_INC              (1 << EX_RUNDOWN_COUNT_SHIFT)
+
 #define METHOD_BUFFERED                   0
 #define METHOD_IN_DIRECT                  1
 #define METHOD_OUT_DIRECT                 2
@@ -1114,6 +1122,15 @@ typedef struct _FAST_MUTEX
     ULONG OldIrql;
 } FAST_MUTEX, *PFAST_MUTEX;
 
+typedef struct _EX_RUNDOWN_REF
+{
+    union
+    {
+        ULONG_PTR Count;
+        PVOID Ptr;
+    };
+} EX_RUNDOWN_REF, *PEX_RUNDOWN_REF;
+
 typedef struct _KGATE
 {
     DISPATCHER_HEADER Header;
@@ -2556,7 +2573,7 @@ typedef struct {
   pHalMirrorVerify  HalMirrorVerify;
 } HAL_DISPATCH, *PHAL_DISPATCH;
 
-#if defined(_NTDRIVER_) || defined(_NTDDK_) || defined(_NTIFS_) || defined(_NTHAL_)
+#if defined(_NTDRIVER_) || defined(_NTDDK_) || defined(_NTHAL_)
 extern DECL_IMPORT PHAL_DISPATCH HalDispatchTable;
 #define HALDISPATCH ((PHAL_DISPATCH)&HalDispatchTable)
 #else
@@ -2681,16 +2698,6 @@ typedef struct _FILE_DISPOSITION_INFORMATION {
   BOOLEAN  DeleteFile;
 } FILE_DISPOSITION_INFORMATION, *PFILE_DISPOSITION_INFORMATION;
 
-typedef struct _FILE_QUOTA_INFORMATION {
-    ULONG NextEntryOffset;
-    ULONG SidLength;
-    LARGE_INTEGER ChangeTime;
-    LARGE_INTEGER QuotaUsed;
-    LARGE_INTEGER QuotaThreshold;
-    LARGE_INTEGER QuotaLimit;
-    SID Sid;
-} FILE_QUOTA_INFORMATION, *PFILE_QUOTA_INFORMATION;
-
 typedef struct _FILE_END_OF_FILE_INFORMATION {
   LARGE_INTEGER  EndOfFile;
 } FILE_END_OF_FILE_INFORMATION, *PFILE_END_OF_FILE_INFORMATION;
@@ -10247,7 +10254,7 @@ DbgSetDebugFilterState(
 
 #endif /* !DBG */
 
-#if defined(_NTDDK_) || defined(_NTIFS_) || defined(_NTHAL_) || defined(_WDMDDK_) || defined(_NTOSP_)
+#if defined(_NTDDK_) || defined(_NTHAL_) || defined(_WDMDDK_) || defined(_NTOSP_)
 
 extern NTOSAPI PBOOLEAN KdDebuggerNotPresent;
 extern NTOSAPI PBOOLEAN KdDebuggerEnabled;
index ef6a3df..249ba72 100644 (file)
@@ -1530,11 +1530,14 @@ typedef struct _GENERIC_MAPPING {
        ACCESS_MASK GenericExecute;
        ACCESS_MASK GenericAll;
 } GENERIC_MAPPING, *PGENERIC_MAPPING;
+/* Sigh..when will they learn... */
+#ifndef __NTDDK_H
 typedef struct _ACE_HEADER {
        BYTE AceType;
        BYTE AceFlags;
        WORD AceSize;
 } ACE_HEADER, *PACE_HEADER;
+
 typedef struct _ACCESS_ALLOWED_ACE {
        ACE_HEADER Header;
        ACCESS_MASK Mask;
@@ -1588,6 +1591,7 @@ typedef struct _SYSTEM_ALARM_OBJECT_ACE {
        GUID InheritedObjectType;
        DWORD SidStart;
 } SYSTEM_ALARM_OBJECT_ACE,*PSYSTEM_ALARM_OBJECT_ACE;
+#endif
 typedef struct _ACL {
        BYTE AclRevision;
        BYTE Sbz1;
@@ -2217,6 +2221,8 @@ typedef struct _SE_IMPERSONATION_STATE {
        BOOLEAN EffectiveOnly;
        SECURITY_IMPERSONATION_LEVEL Level;
 } SE_IMPERSONATION_STATE,*PSE_IMPERSONATION_STATE;
+/* Steven you are my hero when you fix the w32api ddk! */
+#if !defined(__NTDDK_H)
 typedef struct _SID_IDENTIFIER_AUTHORITY {
        BYTE Value[6];
 } SID_IDENTIFIER_AUTHORITY,*PSID_IDENTIFIER_AUTHORITY,*LPSID_IDENTIFIER_AUTHORITY;
@@ -2321,6 +2327,7 @@ typedef enum _TOKEN_INFORMATION_CLASS {
        TokenSessionId,TokenGroupsAndPrivileges,TokenSessionReference,
        TokenSandBoxInert,TokenAuditPolicy,TokenOrigin,
 } TOKEN_INFORMATION_CLASS;
+#endif
 typedef enum _SID_NAME_USE {
        SidTypeUser=1,SidTypeGroup,SidTypeDomain,SidTypeAlias,
        SidTypeWellKnownGroup,SidTypeDeletedAccount,SidTypeInvalid,
@@ -3225,6 +3232,8 @@ typedef struct _JOBOBJECT_BASIC_PROCESS_ID_LIST {
 typedef struct _JOBOBJECT_BASIC_UI_RESTRICTIONS {
        DWORD UIRestrictionsClass;
 } JOBOBJECT_BASIC_UI_RESTRICTIONS,*PJOBOBJECT_BASIC_UI_RESTRICTIONS;
+/* Steven you are my hero when you fix the w32api ddk! */
+#ifndef __NTDDK_H
 typedef struct _JOBOBJECT_SECURITY_LIMIT_INFORMATION {
        DWORD SecurityLimitFlags;
        HANDLE JobToken;
@@ -3232,6 +3241,7 @@ typedef struct _JOBOBJECT_SECURITY_LIMIT_INFORMATION {
        PTOKEN_PRIVILEGES PrivilegesToDelete;
        PTOKEN_GROUPS RestrictedSids;
 } JOBOBJECT_SECURITY_LIMIT_INFORMATION,*PJOBOBJECT_SECURITY_LIMIT_INFORMATION;
+#endif
 typedef struct _JOBOBJECT_END_OF_JOB_TIME_INFORMATION {
        DWORD EndOfJobTimeAction;
 } JOBOBJECT_END_OF_JOB_TIME_INFORMATION,*PJOBOBJECT_END_OF_JOB_TIME_INFORMATION;