ntapi.h:
- Define LANGID and fix definition of PLANGID.
- Define PVM_COUNTERS, SYSTEM_CACHE_INFORMATION and SYSTEM_INTERRUPT_INFORMATION.
- Match the ROS version of LPC_MESSAGE (the structure itself should be named PORT_MESSAGE and belongs to ntifs.h).
- Move KEY_SET_INFORMATION_CLASS definiton to winddk.h.
- Make the first parameter of NtAllocateUuids PULARGE_INTEGER.
- Declare NtSetUuidSeed.
- Fix definition of ATOM_INFORMATION_CLASS and ATOM_BASIC_INFORMATION to match ReactOS versions.
winddk.h:
- Define NTHALAPI and use it to mark HAL exports instead of NTOSAPI.
- Define PADAPTER_OBJECT, EVENT_QUERY_STATE, EVENT_MODIFY_STATE, EVENT_ALL_ACCESS, SEMAPHORE_QUERY_STATE, SEMAPHORE_MODIFY_STATE, SEMAPHORE_ALL_ACCESS, IRP_QUOTA_CHARGED, IRP_ALLOCATED_MUST_SUCCEED, IRP_ALLOCATED_FIXED_SIZE, IRP_LOOKASIDE_ALLOCATION, HalDispatchTableVersion, HalQuerySystemInformation, HalSetSystemInformation, HalQueryBusSlots, HalDeviceControl, HalIoAssignDriveLetters, HalIoReadPartitionTable, HalIoSetPartitionInformation, HalIoWritePartitionTable, HalReferenceHandlerForBus, HalReferenceBusHandler, HalDereferenceBusHandler, IO_TYPE_ADAPTER, IO_TYPE_CONTROLLER, IO_TYPE_DEVICE, IO_TYPE_DRIVER,
IO_TYPE_FILE, IO_TYPE_IRP, IO_TYPE_MASTER_ADAPTER, IO_TYPE_OPEN_PACKET,
IO_TYPE_TIMER, IO_TYPE_VPB, IO_TYPE_ERROR_LOG, IO_TYPE_ERROR_MESSAGE,
IO_TYPE_DEVICE_OBJECT_EXTENSION, IO_FORCE_ACCESS_CHECK and IO_NO_PARAMETER_CHECKING.
- Remove declaration of HalPrivateDispatchTable, it doesn't belong to public headers.
- Fix declaration of WAIT_CONTEXT_BLOCK, HalDispatchTable, DRIVER_EXTENSION, GENERAL_LOOKASIDE, NPAGED_LOOKASIDE_LIST, PAGED_LOOKASIDE_LIST, KPCR_TIB, MmHighestUserAddress, MmSystemRangeStart, MmUserProbeAddress, KdDebuggerNotPresent and KdDebuggerEnabled.
- Declare KEY_WRITE_TIME_INFORMATION, KEY_USER_FLAGS_INFORMATION, KEY_SET_INFORMATION_CLASS, KfAcquireSpinLock, KfReleaseSpinLock and ExfInterlockedCompareExchange64.
winnt4.h:
- Declare HalAcquireDisplayOwnership and HalAllocateAdapterChannel.
ntifs.h:
- Fix definition of NTKERNELAPI.
- Fix declaration of FsRtlLegalAnsiCharacterArray, FsRtlNotifyInitializeSync, FsRtlNotifyUninitializeSync, IoCheckFunctionAccess and PsGetProcessExitTime.
- Declare IoStatisticsLock, IoReadOperationCount, IoWriteOperationCount, IoOtherOperationCount, IoReadTransferCount, IoWriteTransferCount,
IoOtherTransferCount, FSRTL_ADVANCED_FCB_HEADER, FSRTL_PER_STREAM_CONTEXT, PFILTER_REPORT_CHANGE, FS_FILTER_SECTION_SYNC_TYPE, FS_FILTER_PARAMETERS, FS_FILTER_CALLBACK_DATA, PFS_FILTER_CALLBACK, PFS_FILTER_COMPLETION_CALLBACK, FS_FILTER_CALLBACKS, READ_LIST, ExInitializeRundownProtection, ExReInitializeRundownProtection, ExAcquireRundownProtection, ExAcquireRundownProtectionEx, ExReleaseRundownProtection, ExReleaseRundownProtectionEx, ExRundownCompleted, ExWaitForRundownProtectionRelease, FsRtlMdlReadDev, FsRtlPrepareMdlWriteDev, PFSRTL_STACK_OVERFLOW_ROUTINE, FsRtlPostStackOverflow, FsRtlPostPagingFileStackOverflow, IoAttachDeviceToDeviceStackSafe, IoQueueThreadIrp, KeInitializeMutant, KeReadStateMutant, KeReleaseMutant and PsIsSystemThread.
- Define FSRTL_FAT_LEGAL, FSRTL_HPFS_LEGAL, FSRTL_NTFS_LEGAL, FSRTL_WILD_CHARACTER, FSRTL_OLE_LEGAL, FSRTL_NTFS_STREAM_LEGAL, EX_RUNDOWN_ACTIVE, EX_RUNDOWN_COUNT_SHIFT, EX_RUNDOWN_COUNT_INC, FsRtlIsLeadDbcsCharacter and FsRtlIsAnsiCharacterWild.
- Remove declaration of SYSTEM_CACHE_INFORMATION and SeCreateAccessState, they don't belong to public headers.
Modified: trunk/reactos/w32api/include/ddk/ntapi.h
Modified: trunk/reactos/w32api/include/ddk/ntifs.h
Modified: trunk/reactos/w32api/include/ddk/winddk.h
Modified: trunk/reactos/w32api/include/ddk/winnt4.h

Modified: trunk/reactos/w32api/include/ddk/ntapi.h
--- trunk/reactos/w32api/include/ddk/ntapi.h	2005-06-18 12:12:41 UTC (rev 16027)
+++ trunk/reactos/w32api/include/ddk/ntapi.h	2005-06-18 12:39:24 UTC (rev 16028)
@@ -46,8 +46,9 @@
 /* FIXME: Unknown definitions */
 typedef PVOID POBJECT_TYPE_LIST;
 typedef PVOID PEXECUTION_STATE;
-typedef PVOID PLANGID;
 
+typedef unsigned short LANGID, *PLANGID;
+
 #ifndef NtCurrentProcess
 #define NtCurrentProcess() ( (HANDLE) 0xFFFFFFFF )
 #endif /* NtCurrentProcess */
@@ -261,7 +262,7 @@
 	ULONG  QuotaNonPagedPoolUsage;
 	ULONG  PagefileUsage;
 	ULONG  PeakPagefileUsage;
-} VM_COUNTERS;
+} VM_COUNTERS, *PVM_COUNTERS;
 
 typedef enum _THREAD_STATE {
 	Initialized,
@@ -463,6 +464,15 @@
 	ULONG  GenericInvalidOpcode;
 } SYSTEM_INSTRUCTION_EMULATION_INFORMATION, *PSYSTEM_INSTRUCTION_EMULATION_INFORMATION;
 
+typedef struct _SYSTEM_CACHE_INFORMATION {
+	ULONG  CurrentSize;
+	ULONG  PeakSize;
+	ULONG  PageFaultCount;
+	ULONG  MinimumWorkingSet;
+	ULONG  MaximumWorkingSet;
+	ULONG  Unused[4];
+} SYSTEM_CACHE_INFORMATION, *PSYSTEM_CACHE_INFORMATION;
+
 typedef struct _SYSTEM_POOL_TAG_INFORMATION {
 	CHAR  Tag[4];
 	ULONG  PagedPoolAllocs;
@@ -473,6 +483,15 @@
 	ULONG  NonPagedPoolUsage;
 } SYSTEM_POOL_TAG_INFORMATION, *PSYSTEM_POOL_TAG_INFORMATION;
 
+typedef struct _SYSTEM_INTERRUPT_INFORMATION {
+	ULONG	ContextSwitches;
+	ULONG	DpcCount;
+	ULONG	DpcRate;
+	ULONG	TimeIncrement;
+	ULONG	DpcBypassCount;
+	ULONG	ApcBypassCount;
+} SYSTEM_INTERRUPT_INFORMATION, *PSYSTEM_INTERRUPT_INFORMATION;
+
 typedef struct _SYSTEM_PROCESSOR_STATISTICS {
 	ULONG  ContextSwitches;
 	ULONG  DpcCount;
@@ -1991,7 +2010,6 @@
 	CLIENT_ID  ClientId;
 	ULONG  MessageId;
 	ULONG  SectionSize;
-	UCHAR  Data[ANYSIZE_ARRAY];
 } LPC_MESSAGE, *PLPC_MESSAGE;
 
 #define LPC_MESSAGE_BASE_SIZE	24
@@ -2332,10 +2350,6 @@
 	IN HANDLE  KeyHandle,
 	IN POBJECT_ATTRIBUTES  OldFileObjectAttributes);
 
-typedef enum _KEY_SET_INFORMATION_CLASS {
-  KeyLastWriteTimeInformation
-} KEY_SET_INFORMATION_CLASS;
-
 NTOSAPI
 NTSTATUS
 NTAPI
@@ -2802,7 +2816,7 @@
 NTSTATUS
 NTAPI
 NtAllocateUuids(
-  OUT PLARGE_INTEGER  UuidLastTimeAllocated,
+  OUT PULARGE_INTEGER  UuidLastTimeAllocated,
   OUT PULONG  UuidDeltaTime,
   OUT PULONG  UuidSequenceNumber,
   OUT PUCHAR  UuidSeed);
@@ -2810,6 +2824,12 @@
 NTOSAPI
 NTSTATUS
 NTAPI
+NtSetUuidSeed(
+  IN PUCHAR  UuidSeed);
+
+NTOSAPI
+NTSTATUS
+NTAPI
 ZwSetUuidSeed(
   IN PUCHAR  UuidSeed);
 
@@ -2893,7 +2913,7 @@
 
 typedef enum _ATOM_INFORMATION_CLASS {
 	AtomBasicInformation,
-	AtomListInformation
+	AtomTableInformation
 } ATOM_INFORMATION_CLASS;
 
 NTOSAPI
@@ -2907,8 +2927,8 @@
   OUT PULONG  ReturnLength  OPTIONAL);
 
 typedef struct _ATOM_BASIC_INFORMATION {
-	USHORT  ReferenceCount;
-	USHORT  Pinned;
+	USHORT  UsageCount;
+	USHORT  Flags;
 	USHORT  NameLength;
 	WCHAR  Name[1];
 } ATOM_BASIC_INFORMATION, *PATOM_BASIC_INFORMATION;

Modified: trunk/reactos/w32api/include/ddk/ntifs.h
--- trunk/reactos/w32api/include/ddk/ntifs.h	2005-06-18 12:12:41 UTC (rev 16027)
+++ trunk/reactos/w32api/include/ddk/ntifs.h	2005-06-18 12:39:24 UTC (rev 16028)
@@ -44,16 +44,28 @@
 #endif
 
 #ifndef NTKERNELAPI
-#define NTKERNELAPI STDCALL
+#define NTKERNELAPI DECLSPEC_IMPORT
 #endif
 
 typedef struct _SE_EXPORTS                  *PSE_EXPORTS;
 
-extern PUCHAR                       *FsRtlLegalAnsiCharacterArray;
+#ifdef _NTOSKRNL_
+extern PUCHAR                       FsRtlLegalAnsiCharacterArray;
+#else
+extern DECLSPEC_IMPORT PUCHAR       FsRtlLegalAnsiCharacterArray;
+#endif
 extern PSE_EXPORTS                  SeExports;
 extern PACL                         SePublicDefaultDacl;
 extern PACL                         SeSystemDefaultDacl;
 
+extern KSPIN_LOCK                   IoStatisticsLock;
+extern ULONG                        IoReadOperationCount;
+extern ULONG                        IoWriteOperationCount;
+extern ULONG                        IoOtherOperationCount;
+extern LARGE_INTEGER                IoReadTransferCount;
+extern LARGE_INTEGER                IoWriteTransferCount;
+extern LARGE_INTEGER                IoOtherTransferCount;
+
 #define ANSI_DOS_STAR                   ('<')
 #define ANSI_DOS_QM                     ('>')
 #define ANSI_DOS_DOT                    ('"')
@@ -241,6 +253,13 @@
 
 #define FSRTL_WILD_CHARACTER            0x08
 
+#define FSRTL_FAT_LEGAL                 0x01
+#define FSRTL_HPFS_LEGAL                0x02
+#define FSRTL_NTFS_LEGAL                0x04
+#define FSRTL_WILD_CHARACTER            0x08
+#define FSRTL_OLE_LEGAL                 0x10
+#define FSRTL_NTFS_STREAM_LEGAL         0x14
+
 #ifdef _X86_
 #define HARDWARE_PTE    HARDWARE_PTE_X86
 #define PHARDWARE_PTE   PHARDWARE_PTE_X86
@@ -502,7 +521,6 @@
 
 #define IOCTL_REDIR_QUERY_PATH          CTL_CODE(FILE_DEVICE_NETWORK_FILE_SYSTEM, 99, METHOD_NEITHER, FILE_ANY_ACCESS)
 
-typedef PVOID PEJOB;
 typedef PVOID OPLOCK, *POPLOCK;
 
 typedef struct _CACHE_MANAGER_CALLBACKS         *PCACHE_MANAGER_CALLBACKS;
@@ -718,6 +736,10 @@
     } DUMMYUNIONNAME;
 } EX_PUSH_LOCK, *PEX_PUSH_LOCK;
 
+#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;
@@ -1197,6 +1219,33 @@
     LARGE_INTEGER   ValidDataLength;
 } FSRTL_COMMON_FCB_HEADER, *PFSRTL_COMMON_FCB_HEADER;
 
+#if (VER_PRODUCTBUILD >= 2600)
+
+typedef struct _FSRTL_ADVANCED_FCB_HEADER {
+    CSHORT          NodeTypeCode;
+    CSHORT          NodeByteSize;
+    UCHAR           Flags;
+    UCHAR           IsFastIoPossible;
+    UCHAR           Flags2;
+    UCHAR           Reserved;
+    PERESOURCE      Resource;
+    PERESOURCE      PagingIoResource;
+    LARGE_INTEGER   AllocationSize;
+    LARGE_INTEGER   FileSize;
+    LARGE_INTEGER   ValidDataLength;
+    PFAST_MUTEX     FastMutex;
+    LIST_ENTRY      FilterContexts;
+} FSRTL_ADVANCED_FCB_HEADER, *PFSRTL_ADVANCED_FCB_HEADER;
+
+typedef struct _FSRTL_PER_STREAM_CONTEXT {
+    LIST_ENTRY     Links;
+    PVOID          OwnerId;
+    PVOID          InstanceId;
+    PFREE_FUNCTION FreeCallback;
+} FSRTL_PER_STREAM_CONTEXT, *PFSRTL_PER_STREAM_CONTEXT;
+
+#endif /* (VER_PRODUCTBUILD >= 2600) */
+
 typedef struct _GENERATE_NAME_CONTEXT {
     USHORT  Checksum;
     BOOLEAN CheckSumInserted;
@@ -1549,15 +1598,6 @@
     LARGE_INTEGER StartingVcn;
 } STARTING_VCN_INPUT_BUFFER, *PSTARTING_VCN_INPUT_BUFFER;
 
-typedef struct _SYSTEM_CACHE_INFORMATION {
-    ULONG CurrentSize;
-    ULONG PeakSize;
-    ULONG PageFaultCount;
-    ULONG MinimumWorkingSet;
-    ULONG MaximumWorkingSet;
-    ULONG Unused[4];
-} SYSTEM_CACHE_INFORMATION, *PSYSTEM_CACHE_INFORMATION;
-
 typedef struct _SECURITY_CLIENT_CONTEXT {
     SECURITY_QUALITY_OF_SERVICE SecurityQos;
     PACCESS_TOKEN               ClientToken;
@@ -1598,6 +1638,90 @@
     LIST_ENTRY  Secured;
 } VAD_HEADER, *PVAD_HEADER;
 
+#if (VER_PRODUCTBUILD >= 2600)
+
+typedef BOOLEAN
+(NTAPI *PFILTER_REPORT_CHANGE) (
+    IN PVOID  NotifyContext,
+    IN PVOID  FilterContext
+);
+
+typedef enum _FS_FILTER_SECTION_SYNC_TYPE {
+    SyncTypeOther = 0,
+    SyncTypeCreateSection
+} FS_FILTER_SECTION_SYNC_TYPE, *PFS_FILTER_SECTION_SYNC_TYPE;
+
+typedef union _FS_FILTER_PARAMETERS {
+    struct {
+        PLARGE_INTEGER  EndingOffset;
+    } AcquireForModifiedPageWriter;
+
+    struct {
+        PERESOURCE  ResourceToRelease;
+    } ReleaseForModifiedPageWriter;
+
+    struct {
+        FS_FILTER_SECTION_SYNC_TYPE  SyncType;
+        ULONG  PageProtection;
+    } AcquireForSectionSynchronization;
+
+    struct {
+        PVOID  Argument1;
+        PVOID  Argument2;
+        PVOID  Argument3;
+        PVOID  Argument4;
+        PVOID  Argument5;
+    } Others;
+} FS_FILTER_PARAMETERS, *PFS_FILTER_PARAMETERS;
+
+typedef struct _FS_FILTER_CALLBACK_DATA {
+    ULONG                  SizeOfFsFilterCallbackData;
+    UCHAR                  Operation;
+    UCHAR                  Reserved;
+    struct _DEVICE_OBJECT  *DeviceObject;
+    struct _FILE_OBJECT    *FileObject;
+    FS_FILTER_PARAMETERS   Parameters;
+} FS_FILTER_CALLBACK_DATA, *PFS_FILTER_CALLBACK_DATA;
+
+typedef NTSTATUS
+(NTAPI *PFS_FILTER_CALLBACK) (
+    IN PFS_FILTER_CALLBACK_DATA  Data,
+    OUT PVOID                    *CompletionContext
+);
+
+typedef VOID
+(NTAPI *PFS_FILTER_COMPLETION_CALLBACK) (
+    IN PFS_FILTER_CALLBACK_DATA  Data,
+    IN NTSTATUS                  OperationStatus,
+    IN PVOID                     CompletionContext
+);
+
+typedef struct _FS_FILTER_CALLBACKS {
+    ULONG                           SizeOfFsFilterCallbacks;
+    ULONG                           Reserved;
+    PFS_FILTER_CALLBACK             PreAcquireForSectionSynchronization;
+    PFS_FILTER_COMPLETION_CALLBACK  PostAcquireForSectionSynchronization;
+    PFS_FILTER_CALLBACK             PreReleaseForSectionSynchronization;
+    PFS_FILTER_COMPLETION_CALLBACK  PostReleaseForSectionSynchronization;
+    PFS_FILTER_CALLBACK             PreAcquireForCcFlush;
+    PFS_FILTER_COMPLETION_CALLBACK  PostAcquireForCcFlush;
+    PFS_FILTER_CALLBACK             PreReleaseForCcFlush;
+    PFS_FILTER_COMPLETION_CALLBACK  PostReleaseForCcFlush;
+    PFS_FILTER_CALLBACK             PreAcquireForModifiedPageWriter;
+    PFS_FILTER_COMPLETION_CALLBACK  PostAcquireForModifiedPageWriter;
+    PFS_FILTER_CALLBACK             PreReleaseForModifiedPageWriter;
+    PFS_FILTER_COMPLETION_CALLBACK  PostReleaseForModifiedPageWriter;
+} FS_FILTER_CALLBACKS, *PFS_FILTER_CALLBACKS;
+
+typedef struct _READ_LIST {
+    PFILE_OBJECT          FileObject;
+    ULONG                 NumberOfEntries;
+    LOGICAL               IsImage;
+    FILE_SEGMENT_ELEMENT  List[ANYSIZE_ARRAY];
+} READ_LIST, *PREAD_LIST;
+
+#endif
+
 NTKERNELAPI
 BOOLEAN
 NTAPI
@@ -1734,6 +1858,7 @@
 
 NTKERNELAPI
 LARGE_INTEGER
+NTAPI
 CcGetLsnForFileObject (
     IN PFILE_OBJECT     FileObject,
     OUT PLARGE_INTEGER  OldestLsn OPTIONAL
@@ -2051,17 +2176,79 @@
 VOID
 NTAPI
 ExDisableResourceBoostLite (
-    IN PERESOURCE Resource
+    IN PERESOURCE  Resource
 );
 
 NTKERNELAPI
 ULONG
 NTAPI
 ExQueryPoolBlockSize (
-    IN PVOID        PoolBlock,
-    OUT PBOOLEAN    QuotaCharged
+    IN PVOID      PoolBlock,
+    OUT PBOOLEAN  QuotaCharged
 );
 
+#if (VER_PRODUCTBUILD >= 2600)
+
+NTKERNELAPI
+VOID
+FASTCALL
+ExInitializeRundownProtection (
+    IN PEX_RUNDOWN_REF  RunRef
+);
+
+NTKERNELAPI
+VOID
+FASTCALL
+ExReInitializeRundownProtection (
+    IN PEX_RUNDOWN_REF  RunRef
+);
+
+NTKERNELAPI
+BOOLEAN
+FASTCALL
+ExAcquireRundownProtection (
+    IN PEX_RUNDOWN_REF  RunRef
+);
+
+NTKERNELAPI
+BOOLEAN
+FASTCALL
+ExAcquireRundownProtectionEx (
+    IN PEX_RUNDOWN_REF  RunRef,
+    IN ULONG            Count
+);
+
+NTKERNELAPI
+VOID
+FASTCALL
+ExReleaseRundownProtection (
+    IN PEX_RUNDOWN_REF  RunRef
+);
+
+NTKERNELAPI
+VOID
+FASTCALL
+ExReleaseRundownProtectionEx (
+    IN PEX_RUNDOWN_REF  RunRef,
+    IN ULONG            Count
+);
+
+NTKERNELAPI
+VOID
+FASTCALL
+ExRundownCompleted (
+    IN PEX_RUNDOWN_REF  RunRef
+);
+
+NTKERNELAPI
+VOID
+FASTCALL
+ExWaitForRundownProtectionRelease (
+    IN PEX_RUNDOWN_REF  RunRef
+);
+
+#endif /* (VER_PRODUCTBUILD >= 2600) */
+
 #define FlagOn(x, f) ((x) & (f))
 
 NTKERNELAPI
@@ -2442,15 +2629,38 @@
     IN NTSTATUS Ntstatus
 );
 
+#define FsRtlIsLeadDbcsCharacter(DBCS_CHAR) (                               \
+    (BOOLEAN)((UCHAR)(DBCS_CHAR) < 0x80 ? FALSE :                           \
+              (NLS_MB_CODE_PAGE_TAG &&                                      \
+               (NLS_OEM_LEAD_BYTE_INFO[(UCHAR)(DBCS_CHAR)] != 0)))          \
+)
+
+#define FsRtlIsAnsiCharacterWild(C) (                                       \
+    FlagOn(FsRtlLegalAnsiCharacterArray[(UCHAR)(C)], FSRTL_WILD_CHARACTER ) \
+)
+
 #define FsRtlIsUnicodeCharacterWild(C) (                                    \
     (((C) >= 0x40) ?                                                        \
     FALSE :                                                                 \
-    FlagOn((*FsRtlLegalAnsiCharacterArray)[(C)], FSRTL_WILD_CHARACTER ))    \
+    FlagOn(FsRtlLegalAnsiCharacterArray[(C)], FSRTL_WILD_CHARACTER ))       \
 )
 
 NTKERNELAPI
 BOOLEAN
 NTAPI
+FsRtlMdlReadDev (
+    IN PFILE_OBJECT       FileObject,
+    IN PLARGE_INTEGER     FileOffset,
+    IN ULONG              Length,
+    IN ULONG              LockKey,
+    OUT PMDL              *MdlChain,
+    OUT PIO_STATUS_BLOCK  IoStatus,
+    IN PDEVICE_OBJECT     DeviceObject
+);
+
+NTKERNELAPI
+BOOLEAN
+NTAPI
 FsRtlMdlReadComplete (
     IN PFILE_OBJECT     FileObject,
     IN PMDL             MdlChain
@@ -2468,6 +2678,19 @@
 NTKERNELAPI
 BOOLEAN
 NTAPI
+FsRtlPrepareMdlWriteDev (
+    IN PFILE_OBJECT       FileObject,
+    IN PLARGE_INTEGER     FileOffset,
+    IN ULONG              Length,
+    IN ULONG              LockKey,
+    OUT PMDL              *MdlChain,
+    OUT PIO_STATUS_BLOCK  IoStatus,
+    IN PDEVICE_OBJECT     DeviceObject
+);
+
+NTKERNELAPI
+BOOLEAN
+NTAPI
 FsRtlMdlWriteComplete (
     IN PFILE_OBJECT     FileObject,
     IN PLARGE_INTEGER   FileOffset,
@@ -2555,7 +2778,7 @@
 VOID
 NTAPI
 FsRtlNotifyInitializeSync (
-    IN PNOTIFY_SYNC NotifySync
+    IN PNOTIFY_SYNC *NotifySync
 );
 
 NTKERNELAPI
@@ -2573,7 +2796,7 @@
 VOID
 NTAPI
 FsRtlNotifyUninitializeSync (
-    IN PNOTIFY_SYNC NotifySync
+    IN PNOTIFY_SYNC *NotifySync
 );
 
 #if (VER_PRODUCTBUILD >= 2195)
@@ -2670,9 +2893,33 @@
     IN BOOLEAN          MailslotsSupported
 );
 
+typedef VOID
+(NTAPI *PFSRTL_STACK_OVERFLOW_ROUTINE) (
+    IN PVOID    Context,
+    IN PKEVENT  Event
+);
+
 NTKERNELAPI
 VOID
 NTAPI
+FsRtlPostStackOverflow (
+    IN PVOID                          Context,
+    IN PKEVENT                        Event,
+    IN PFSRTL_STACK_OVERFLOW_ROUTINE  StackOverflowRoutine
+);
+
+NTKERNELAPI
+VOID
+NTAPI
+FsRtlPostPagingFileStackOverflow (
+    IN PVOID                          Context,
+    IN PKEVENT                        Event,
+    IN PFSRTL_STACK_OVERFLOW_ROUTINE  StackOverflowRoutine
+);
+
+NTKERNELAPI
+VOID
+NTAPI
 FsRtlUninitializeFileLock (
     IN PFILE_LOCK FileLock
 );
@@ -2713,6 +2960,15 @@
 }
 
 NTKERNELAPI
+NTSTATUS
+NTAPI
+IoAttachDeviceToDeviceStackSafe(
+    IN PDEVICE_OBJECT   SourceDevice,
+    IN PDEVICE_OBJECT   TargetDevice,
+    OUT PDEVICE_OBJECT  *AttachedToDeviceObject
+);
+
+NTKERNELAPI
 VOID
 NTAPI
 IoAcquireVpbSpinLock (
@@ -2744,8 +3000,8 @@
     IN UCHAR                    MajorFunction,
     IN UCHAR                    MinorFunction,
     IN ULONG                    IoControlCode,
-    IN PFILE_INFORMATION_CLASS  FileInformationClass OPTIONAL,
-    IN PFS_INFORMATION_CLASS    FsInformationClass OPTIONAL
+    IN PVOID                    Argument1 OPTIONAL,
+    IN PVOID                    Argument2 OPTIONAL
 );
 
 #if (VER_PRODUCTBUILD >= 2195)
@@ -2901,6 +3157,13 @@
 NTKERNELAPI
 VOID
 NTAPI
+IoQueueThreadIrp(
+    IN PIRP Irp
+);
+
+NTKERNELAPI
+VOID
+NTAPI
 IoRegisterFileSystem (
     IN OUT PDEVICE_OBJECT DeviceObject
 );
@@ -2982,7 +3245,7 @@
 #if (VER_PRODUCTBUILD >= 1381)
 
 NTKERNELAPI
-NTSTATUS
+VOID
 NTAPI
 IoUnregisterFsRegistrationChange (
     IN PDRIVER_OBJECT           DriverObject,
@@ -3070,6 +3333,31 @@
     IN PRKQUEUE Queue
 );
 
+NTKERNELAPI
+VOID
+NTAPI
+KeInitializeMutant (
+    IN PRKMUTANT  Mutant,
+    IN BOOLEAN    InitialOwner
+);
+
+NTKERNELAPI
+LONG
+NTAPI
+KeReadStateMutant (
+    IN PRKMUTANT  Mutant
+);
+
+NTKERNELAPI
+LONG
+NTAPI
+KeReleaseMutant (
+    IN PRKMUTANT  Mutant,
+    IN KPRIORITY  Increment,
+    IN BOOLEAN    Abandoned,
+    IN BOOLEAN    Wait
+);
+
 #if (VER_PRODUCTBUILD >= 2195)
 
 NTKERNELAPI
@@ -3261,7 +3549,7 @@
 #define PsDereferencePrimaryToken(T) (ObDereferenceObject((T)))
 
 NTKERNELAPI
-ULONGLONG
+LARGE_INTEGER
 NTAPI
 PsGetProcessExitTime (
     VOID
@@ -3270,6 +3558,13 @@
 NTKERNELAPI
 BOOLEAN
 NTAPI
+PsIsSystemThread(
+    IN PETHREAD Thread
+);
+
+NTKERNELAPI
+BOOLEAN
+NTAPI
 PsIsThreadTerminating (
     IN PETHREAD Thread
 );
@@ -3682,16 +3977,6 @@
 NTKERNELAPI
 NTSTATUS
 NTAPI
-SeCreateAccessState (
-    OUT PACCESS_STATE   AccessState,
-    IN PVOID            AuxData,
-    IN ACCESS_MASK      AccessMask,
-    IN PGENERIC_MAPPING Mapping
-);
-
-NTKERNELAPI
-NTSTATUS
-NTAPI
 SeCreateClientSecurity (
     IN PETHREAD                     Thread,
     IN PSECURITY_QUALITY_OF_SERVICE QualityOfService,
@@ -3946,6 +4231,7 @@
 
 NTKERNELAPI
 NTSTATUS
+NTAPI
 SeUnregisterLogonSessionTerminatedRoutine (
     IN PSE_LOGON_SESSION_TERMINATED_ROUTINE CallbackRoutine
 );

Modified: trunk/reactos/w32api/include/ddk/winddk.h
--- trunk/reactos/w32api/include/ddk/winddk.h	2005-06-18 12:12:41 UTC (rev 16027)
+++ trunk/reactos/w32api/include/ddk/winddk.h	2005-06-18 12:39:24 UTC (rev 16028)
@@ -52,6 +52,16 @@
 #define DECLARE_INTERNAL_OBJECT2(x,y) struct _##x; typedef struct _##x *P##y;
 #endif
 
+#if defined(_NTHAL_)
+#ifndef NTHALAPI
+#define NTHALAPI DECL_EXPORT
+#endif
+#else
+#ifndef NTHALAPI
+#define NTHALAPI DECL_IMPORT
+#endif
+#endif
+
 /* Pseudo modifiers for parameters */
 #define IN
 #define OUT
@@ -170,6 +180,7 @@
 typedef struct _HAL_PRIVATE_DISPATCH_TABLE *PHAL_PRIVATE_DISPATCH_TABLE;
 typedef struct _DEVICE_HANDLER_OBJECT *PDEVICE_HANDLER_OBJECT;
 typedef struct _BUS_HANDLER *PBUS_HANDLER;
+typedef struct _ADAPTER_OBJECT *PADAPTER_OBJECT;
 typedef struct _DRIVE_LAYOUT_INFORMATION *PDRIVE_LAYOUT_INFORMATION;
 typedef struct _DRIVE_LAYOUT_INFORMATION_EX *PDRIVE_LAYOUT_INFORMATION_EX;
 typedef struct _NAMED_PIPE_CREATE_PARAMETERS *PNAMED_PIPE_CREATE_PARAMETERS;
@@ -315,6 +326,14 @@
 #define DIRECTORY_CREATE_SUBDIRECTORY (0x0008)
 #define DIRECTORY_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | 0xF)
 
+#define EVENT_QUERY_STATE (0x0001)
+#define EVENT_MODIFY_STATE (0x0002)
+#define EVENT_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0x3)
+
+#define SEMAPHORE_QUERY_STATE (0x0001)
+#define SEMAPHORE_MODIFY_STATE (0x0002)
+#define SEMAPHORE_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0x3)
+
 /* Exported object types */
 extern NTOSAPI POBJECT_TYPE ExDesktopObjectType;
 extern NTOSAPI POBJECT_TYPE ExEventObjectType;
@@ -331,7 +350,6 @@
 extern NTOSAPI POBJECT_TYPE SeTokenObjectType;
 
 extern NTOSAPI CCHAR KeNumberProcessors;
-extern NTOSAPI PHAL_PRIVATE_DISPATCH_TABLE HalPrivateDispatchTable;
 
 
 /*
@@ -897,7 +915,7 @@
 
 typedef struct _WAIT_CONTEXT_BLOCK {
   KDEVICE_QUEUE_ENTRY  WaitQueueEntry;
-  struct _DRIVER_CONTROL  *DeviceRoutine;
+  PDRIVER_CONTROL  DeviceRoutine;
   PVOID  DeviceContext;
   ULONG  NumberOfMapRegisters;
   PVOID  DeviceObject;
@@ -1092,6 +1110,11 @@
    IRP_RETRY_IO_COMPLETION = 0x4000
 };
 
+#define IRP_QUOTA_CHARGED                 0x01
+#define IRP_ALLOCATED_MUST_SUCCEED        0x02
+#define IRP_ALLOCATED_FIXED_SIZE          0x04
+#define IRP_LOOKASIDE_ALLOCATION          0x08
+
 typedef struct _BOOTDISK_INFORMATION {
   LONGLONG  BootPartitionOffset;
   LONGLONG  SystemPartitionOffset;
@@ -2324,9 +2347,28 @@
   pHalMirrorVerify  HalMirrorVerify;
 } HAL_DISPATCH, *PHAL_DISPATCH;
 
-extern HAL_DISPATCH HalDispatchTable;
-#define HALDISPATCH HalDispatchTable
+#if defined(_NTDRIVER_) || defined(_NTDDK_) || defined(_NTIFS_) || defined(_NTHAL_)
+extern DECL_IMPORT PHAL_DISPATCH HalDispatchTable;
+#define HALDISPATCH ((PHAL_DISPATCH)&HalDispatchTable)
+#else
+extern DECL_EXPORT HAL_DISPATCH HalDispatchTable;
+#define HALDISPATCH (&HalDispatchTable)
+#endif
 
+#define HAL_DISPATCH_VERSION            3
+#define HalDispatchTableVersion         HALDISPATCH->Version
+#define HalQuerySystemInformation       HALDISPATCH->HalQuerySystemInformation
+#define HalSetSystemInformation         HALDISPATCH->HalSetSystemInformation
+#define HalQueryBusSlots                HALDISPATCH->HalQueryBusSlots
+#define HalDeviceControl                HALDISPATCH->HalDeviceControl
+#define HalIoAssignDriveLetters         HALDISPATCH->HalIoAssignDriveLetters
+#define HalIoReadPartitionTable         HALDISPATCH->HalIoReadPartitionTable
+#define HalIoSetPartitionInformation    HALDISPATCH->HalIoSetPartitionInformation
+#define HalIoWritePartitionTable        HALDISPATCH->HalIoWritePartitionTable
+#define HalReferenceHandlerForBus       HALDISPATCH->HalReferenceHandlerForBus
+#define HalReferenceBusHandler          HALDISPATCH->HalReferenceBusHandler
+#define HalDereferenceBusHandler        HALDISPATCH->HalDereferenceBusHandler
+
 typedef enum _FILE_INFORMATION_CLASS {
   FileDirectoryInformation = 1,
   FileFullDirectoryInformation,
@@ -2492,10 +2534,9 @@
   KSPIN_LOCK  SpinLock;
 } ERESOURCE, *PERESOURCE;
 
-/* NOTE: PVOID for methods to avoid 'assignment from incompatible pointer type' warning */
 typedef struct _DRIVER_EXTENSION {
   struct _DRIVER_OBJECT  *DriverObject;
-  PVOID  AddDevice;
+  PDRIVER_ADD_DEVICE  AddDevice;
   ULONG  Count;
   UNICODE_STRING  ServiceKeyName;
 } DRIVER_EXTENSION, *PDRIVER_EXTENSION;
@@ -2894,6 +2935,20 @@
   ULONG  FullCreateOptions;
 } IO_SECURITY_CONTEXT, *PIO_SECURITY_CONTEXT;
 
+#define IO_TYPE_ADAPTER                 1
+#define IO_TYPE_CONTROLLER              2
+#define IO_TYPE_DEVICE                  3
+#define IO_TYPE_DRIVER                  4
+#define IO_TYPE_FILE                    5
+#define IO_TYPE_IRP                     6
+#define IO_TYPE_MASTER_ADAPTER          7
+#define IO_TYPE_OPEN_PACKET             8
+#define IO_TYPE_TIMER                   9
+#define IO_TYPE_VPB                     10
+#define IO_TYPE_ERROR_LOG               11
+#define IO_TYPE_ERROR_MESSAGE	        12
+#define IO_TYPE_DEVICE_OBJECT_EXTENSION 13
+
 #define IO_TYPE_CSQ_IRP_CONTEXT 1
 #define IO_TYPE_CSQ 2
 
@@ -3241,6 +3296,20 @@
   KeyValuePartialInformationAlign64
 } KEY_VALUE_INFORMATION_CLASS;
 
+typedef struct _KEY_WRITE_TIME_INFORMATION {
+  LARGE_INTEGER  LastWriteTime;
+} KEY_WRITE_TIME_INFORMATION, *PKEY_WRITE_TIME_INFORMATION;
+
+typedef struct _KEY_USER_FLAGS_INFORMATION {
+  ULONG  UserFlags;
+} KEY_USER_FLAGS_INFORMATION, *PKEY_USER_FLAGS_INFORMATION;
+
+typedef enum _KEY_SET_INFORMATION_CLASS {
+  KeyWriteTimeInformation,
+  KeyUserFlagsInformation,
+  MaxKeySetInfoClass
+} KEY_SET_INFORMATION_CLASS;
+
 /* KEY_VALUE_Xxx.Type */
 
 #define REG_NONE                           0
@@ -3642,44 +3711,41 @@
 (DDKAPI *PFREE_FUNCTION)(
   IN PVOID  Buffer);
 
-#define GENERAL_LOOKASIDE_S \
-  SLIST_HEADER  ListHead; \
-  USHORT  Depth; \
-  USHORT  MaximumDepth; \
-  ULONG  TotalAllocates; \
-  _ANONYMOUS_UNION union { \
-    ULONG  AllocateMisses; \
-    ULONG  AllocateHits; \
-  } DUMMYUNIONNAME; \
-  ULONG  TotalFrees; \
-  _ANONYMOUS_UNION union { \
-    ULONG  FreeMisses; \
-    ULONG  FreeHits; \
-  } DUMMYUNIONNAME2; \
-  POOL_TYPE  Type; \
-  ULONG  Tag; \
-  ULONG  Size; \
-  PALLOCATE_FUNCTION  Allocate; \
-  PFREE_FUNCTION  Free; \
-  LIST_ENTRY  ListEntry; \
-  ULONG  LastTotalAllocates; \
-  _ANONYMOUS_UNION union { \
-    ULONG  LastAllocateMisses; \
-    ULONG  LastAllocateHits; \
-  } DUMMYUNIONNAME3; \
+typedef struct _GENERAL_LOOKASIDE {
+  SLIST_HEADER  ListHead;
+  USHORT  Depth;
+  USHORT  MaximumDepth;
+  ULONG  TotalAllocates;
+  union {
+    ULONG  AllocateMisses;
+    ULONG  AllocateHits;
+  };
+  ULONG  TotalFrees;
+  union {
+    ULONG  FreeMisses;
+    ULONG  FreeHits;
+  };
+  POOL_TYPE  Type;
+  ULONG  Tag;
+  ULONG  Size;
+  PALLOCATE_FUNCTION  Allocate;
+  PFREE_FUNCTION  Free;
+  LIST_ENTRY  ListEntry;
+  ULONG  LastTotalAllocates;
+  union {
+    ULONG  LastAllocateMisses;
+    ULONG  LastAllocateHits;
+  };
   ULONG Future[2];
-
-typedef struct _GENERAL_LOOKASIDE {
-  GENERAL_LOOKASIDE_S
 } GENERAL_LOOKASIDE, *PGENERAL_LOOKASIDE;
 
 typedef struct _NPAGED_LOOKASIDE_LIST {
-  GENERAL_LOOKASIDE_S
+  GENERAL_LOOKASIDE  L;
   KSPIN_LOCK  Obsoleted;
 } NPAGED_LOOKASIDE_LIST, *PNPAGED_LOOKASIDE_LIST;
 
 typedef struct _PAGED_LOOKASIDE_LIST {
-  GENERAL_LOOKASIDE_S
+  GENERAL_LOOKASIDE  L;
   FAST_MUTEX  Obsoleted;
 } PAGED_LOOKASIDE_LIST, *PPAGED_LOOKASIDE_LIST;
 
@@ -3895,6 +3961,9 @@
   MaximumType
 } CONFIGURATION_TYPE, *PCONFIGURATION_TYPE;
 
+#define IO_FORCE_ACCESS_CHECK               0x001
+#define IO_NO_PARAMETER_CHECKING            0x100
+
 typedef NTSTATUS
 (DDKAPI *PIO_QUERY_DEVICE_ROUTINE)(
   IN PVOID  Context,
@@ -4350,7 +4419,7 @@
     DWORD  Version;             /* 10 */
   } DUMMYUNIONNAME;
   PVOID  ArbitraryUserPointer;  /* 14 */
-  struct _NT_TIB *Self;         /* 18 */
+  struct _KPCR_TIB *Self;       /* 18 */
 } KPCR_TIB, *PKPCR_TIB;         /* 1C */
 
 #define PCR_MINOR_VERSION 1
@@ -4390,13 +4459,13 @@
 #define PAGE_SIZE                         0x1000
 #define PAGE_SHIFT                        12L
 
-extern NTOSAPI PVOID *MmHighestUserAddress;
-extern NTOSAPI PVOID *MmSystemRangeStart;
-extern NTOSAPI ULONG *MmUserProbeAddress;
+extern NTOSAPI PVOID MmHighestUserAddress;
+extern NTOSAPI PVOID MmSystemRangeStart;
+extern NTOSAPI ULONG_PTR MmUserProbeAddress;
 
-#define MM_HIGHEST_USER_ADDRESS           *MmHighestUserAddress
-#define MM_SYSTEM_RANGE_START             *MmSystemRangeStart
-#define MM_USER_PROBE_ADDRESS             *MmUserProbeAddress
+#define MM_HIGHEST_USER_ADDRESS           MmHighestUserAddress
+#define MM_SYSTEM_RANGE_START             MmSystemRangeStart
+#define MM_USER_PROBE_ADDRESS             MmUserProbeAddress
 #define MM_LOWEST_USER_ADDRESS            (PVOID)0x10000
 #define MM_LOWEST_SYSTEM_ADDRESS          (PVOID)0xC0C00000
 
@@ -4417,7 +4486,7 @@
   ResultPositive = RESULT_POSITIVE
 } INTERLOCKED_RESULT;
 
-NTOSAPI
+NTHALAPI
 KIRQL
 DDKAPI
 KeGetCurrentIrql(
@@ -4501,8 +4570,23 @@
 KefReleaseSpinLockFromDpcLevel(
   IN PKSPIN_LOCK  SpinLock);
 
+NTHALAPI
+KIRQL
+DDKFASTAPI
+KfAcquireSpinLock(
+  IN PKSPIN_LOCK SpinLock);
+
+NTHALAPI
+VOID
+DDKFASTAPI
+KfReleaseSpinLock(
+  IN PKSPIN_LOCK SpinLock,
+  IN KIRQL NewIrql);
+
 #define KeAcquireSpinLockAtDpcLevel(SpinLock) KefAcquireSpinLockAtDpcLevel(SpinLock)
 #define KeReleaseSpinLockFromDpcLevel(SpinLock) KefReleaseSpinLockFromDpcLevel(SpinLock)
+#define KeAcquireSpinLock(a,b)  *(b) = KfAcquireSpinLock(a)
+#define KeReleaseSpinLock(a,b)  KfReleaseSpinLock(a,b)
 
 #define RtlCopyMemoryNonTemporal RtlCopyMemory
 
@@ -5655,7 +5739,11 @@
 
 /** Executive support routines **/
 
+#if defined(_X86_)
+NTHALAPI
+#else
 NTOSAPI
+#endif
 VOID
 DDKFASTAPI
 ExAcquireFastMutex(
@@ -5699,14 +5787,14 @@
 ExAllocateFromNPagedLookasideList(
   IN PNPAGED_LOOKASIDE_LIST  Lookaside)
 {
-	PVOID Entry;
+  PVOID Entry;
 
-	Lookaside->TotalAllocates++;
-  Entry = InterlockedPopEntrySList(&Lookaside->ListHead);
-	if (Entry == NULL) {
-		Lookaside->_DDK_DUMMYUNION_MEMBER(AllocateMisses)++;
-		Entry = (Lookaside->Allocate)(Lookaside->Type, Lookaside->Size, Lookaside->Tag);
-	}
+  Lookaside->L.TotalAllocates++;
+  Entry = InterlockedPopEntrySList(&Lookaside->L.ListHead);
+  if (Entry == NULL) {
+    Lookaside->L.AllocateMisses++;
+    Entry = (Lookaside->L.Allocate)(Lookaside->L.Type, Lookaside->L.Size, Lookaside->L.Tag);
+  }
   return Entry;
 }
 
@@ -5716,12 +5804,11 @@
 {
   PVOID Entry;
 
-  Lookaside->TotalAllocates++;
[truncated at 1000 lines; 504 more skipped]