RTL almost builds. Wrapping up and cleaning tomororw
Modified: branches/new_headers/reactos/include/ddk/ntifs.h
Modified: branches/new_headers/reactos/include/ddk/winddk.h
Modified: branches/new_headers/reactos/include/ndk/rtlfuncs.h
Modified: branches/new_headers/reactos/include/ndk/rtltypes.h
Modified: branches/new_headers/reactos/include/ndk/umtypes.h
Modified: branches/new_headers/reactos/include/ndk/zwtypes.h
Modified: branches/new_headers/reactos/include/winnt.h
Modified: branches/new_headers/reactos/lib/rtl/access.c
Modified: branches/new_headers/reactos/lib/rtl/acl.c
Modified: branches/new_headers/reactos/lib/rtl/bit.c
Modified: branches/new_headers/reactos/lib/rtl/bitmap.c
Modified: branches/new_headers/reactos/lib/rtl/bootdata.c
Modified: branches/new_headers/reactos/lib/rtl/compress.c
Modified: branches/new_headers/reactos/lib/rtl/dos8dot3.c
Modified: branches/new_headers/reactos/lib/rtl/encode.c
Modified: branches/new_headers/reactos/lib/rtl/env.c
Modified: branches/new_headers/reactos/lib/rtl/error.c
Modified: branches/new_headers/reactos/lib/rtl/exception.c
Modified: branches/new_headers/reactos/lib/rtl/generictable.c
Modified: branches/new_headers/reactos/lib/rtl/heap.c
Modified: branches/new_headers/reactos/lib/rtl/image.c
Modified: branches/new_headers/reactos/lib/rtl/largeint.c
Modified: branches/new_headers/reactos/lib/rtl/luid.c
Modified: branches/new_headers/reactos/lib/rtl/mem.c
Modified: branches/new_headers/reactos/lib/rtl/network.c
Modified: branches/new_headers/reactos/lib/rtl/nls.c
Modified: branches/new_headers/reactos/lib/rtl/ppb.c
Modified: branches/new_headers/reactos/lib/rtl/process.c
Modified: branches/new_headers/reactos/lib/rtl/random.c
Modified: branches/new_headers/reactos/lib/rtl/registry.c
Modified: branches/new_headers/reactos/lib/rtl/sd.c
Modified: branches/new_headers/reactos/lib/rtl/security.c
Modified: branches/new_headers/reactos/lib/rtl/sid.c
Modified: branches/new_headers/reactos/lib/rtl/splaytree.c
Modified: branches/new_headers/reactos/lib/rtl/thread.c
Modified: branches/new_headers/reactos/lib/rtl/time.c
Modified: branches/new_headers/reactos/lib/rtl/timezone.c
Modified: branches/new_headers/reactos/lib/rtl/unicode.c
Modified: branches/new_headers/reactos/lib/rtl/unicodeprefix.c
Modified: branches/new_headers/reactos/lib/rtl/version.c

Modified: branches/new_headers/reactos/include/ddk/ntifs.h
--- branches/new_headers/reactos/include/ddk/ntifs.h	2005-05-08 05:14:46 UTC (rev 15115)
+++ branches/new_headers/reactos/include/ddk/ntifs.h	2005-05-08 06:22:12 UTC (rev 15116)
@@ -1169,6 +1169,56 @@
     ULONG   LastIndexValue;
 } GENERATE_NAME_CONTEXT, *PGENERATE_NAME_CONTEXT;
 
+typedef enum _RTL_GENERIC_COMPARE_RESULTS
+{
+    GenericLessThan,
+    GenericGreaterThan,
+    GenericEqual
+} RTL_GENERIC_COMPARE_RESULTS;
+
+typedef
+RTL_GENERIC_COMPARE_RESULTS STDCALL
+(*PRTL_GENERIC_COMPARE_ROUTINE)(
+    struct _RTL_GENERIC_TABLE *Table,
+    PVOID FirstStruct,
+    PVOID SecondStruct
+);
+
+typedef
+PVOID STDCALL
+(*PRTL_GENERIC_ALLOCATE_ROUTINE)(
+    struct _RTL_GENERIC_TABLE *Table,
+    LONG ByteSize
+);
+
+typedef
+VOID STDCALL
+(*PRTL_GENERIC_FREE_ROUTINE)(
+    struct _RTL_GENERIC_TABLE *Table,
+    PVOID Buffer
+);
+
+typedef struct _RTL_SPLAY_LINKS {
+    struct _RTL_SPLAY_LINKS *Parent;
+    struct _RTL_SPLAY_LINKS *LeftChild;
+    struct _RTL_SPLAY_LINKS *RightChild;
+} RTL_SPLAY_LINKS;
+typedef RTL_SPLAY_LINKS *PRTL_SPLAY_LINKS;
+
+typedef struct _RTL_GENERIC_TABLE 
+{
+    PRTL_SPLAY_LINKS TableRoot;
+    LIST_ENTRY InsertOrderList;
+    PLIST_ENTRY OrderedPointer;
+    ULONG WhichOrderedElement;
+    ULONG NumberGenericTableElements;
+    PRTL_GENERIC_COMPARE_ROUTINE CompareRoutine;
+    PRTL_GENERIC_ALLOCATE_ROUTINE AllocateRoutine;
+    PRTL_GENERIC_FREE_ROUTINE FreeRoutine;
+    PVOID TableContext;
+} RTL_GENERIC_TABLE;
+typedef RTL_GENERIC_TABLE *PRTL_GENERIC_TABLE;
+    
 typedef struct _HANDLE_TABLE_ENTRY_INFO {
     ULONG AuditMask;
 } HANDLE_TABLE_ENTRY_INFO, *PHANDLE_TABLE_ENTRY_INFO;
@@ -1444,28 +1494,6 @@
 
 } SE_EXPORTS, *PSE_EXPORTS;
 
-typedef struct _SECTION_BASIC_INFORMATION {
-    PVOID           BaseAddress;
-    ULONG           Attributes;
-    LARGE_INTEGER   Size;
-} SECTION_BASIC_INFORMATION, *PSECTION_BASIC_INFORMATION;
-
-typedef struct _SECTION_IMAGE_INFORMATION {
-    ULONG     EntryPoint;
-    ULONG     Unknown1;
-    ULONG_PTR StackReserve;
-    ULONG_PTR StackCommit;
-    ULONG     Subsystem;
-    USHORT    MinorSubsystemVersion;
-    USHORT    MajorSubsystemVersion;
-    ULONG     Unknown2;
-    ULONG     Characteristics;
-    USHORT    ImageNumber;
-    BOOLEAN   Executable;
-    UCHAR     Unknown3;
-    ULONG     Unknown4[3];
-} SECTION_IMAGE_INFORMATION, *PSECTION_IMAGE_INFORMATION;
-
 #if (VER_PRODUCTBUILD >= 2600)
 
 typedef struct _SHARED_CACHE_MAP {

Modified: branches/new_headers/reactos/include/ddk/winddk.h
--- branches/new_headers/reactos/include/ddk/winddk.h	2005-05-08 05:14:46 UTC (rev 15115)
+++ branches/new_headers/reactos/include/ddk/winddk.h	2005-05-08 06:22:12 UTC (rev 15116)
@@ -4130,6 +4130,33 @@
 extern  HAL_DISPATCH   HalDispatchTable;
 #define HALDISPATCH     HalDispatchTable
 
+/* Security */
+#define ACCESS_MIN_MS_ACE_TYPE                  (0x0)
+#define ACCESS_ALLOWED_ACE_TYPE                 (0x0)
+#define ACCESS_DENIED_ACE_TYPE                  (0x1)
+#define SYSTEM_AUDIT_ACE_TYPE                   (0x2)
+#define SYSTEM_ALARM_ACE_TYPE                   (0x3)
+#define ACCESS_MAX_MS_V2_ACE_TYPE               (0x3)
+#define ACCESS_ALLOWED_COMPOUND_ACE_TYPE        (0x4)
+#define ACCESS_MAX_MS_V3_ACE_TYPE               (0x4)
+#define ACCESS_MIN_MS_OBJECT_ACE_TYPE           (0x5)
+#define ACCESS_ALLOWED_OBJECT_ACE_TYPE          (0x5)
+#define ACCESS_DENIED_OBJECT_ACE_TYPE           (0x6)
+#define SYSTEM_AUDIT_OBJECT_ACE_TYPE            (0x7)
+#define SYSTEM_ALARM_OBJECT_ACE_TYPE            (0x8)
+#define ACCESS_MAX_MS_OBJECT_ACE_TYPE           (0x8)
+#define ACCESS_MAX_MS_V4_ACE_TYPE               (0x8)
+#define ACCESS_MAX_MS_ACE_TYPE                  (0x8)
+#define ACCESS_ALLOWED_CALLBACK_ACE_TYPE        (0x9)
+#define ACCESS_DENIED_CALLBACK_ACE_TYPE         (0xA)
+#define ACCESS_ALLOWED_CALLBACK_OBJECT_ACE_TYPE (0xB)
+#define ACCESS_DENIED_CALLBACK_OBJECT_ACE_TYPE  (0xC)
+#define SYSTEM_AUDIT_CALLBACK_ACE_TYPE          (0xD)
+#define SYSTEM_ALARM_CALLBACK_ACE_TYPE          (0xE)
+#define SYSTEM_AUDIT_CALLBACK_OBJECT_ACE_TYPE   (0xF)
+#define SYSTEM_ALARM_CALLBACK_OBJECT_ACE_TYPE   (0x10)
+#define ACCESS_MAX_MS_V5_ACE_TYPE               (0x10)
+
 /*
 ** Storage structures
 */

Modified: branches/new_headers/reactos/include/ndk/rtlfuncs.h
--- branches/new_headers/reactos/include/ndk/rtlfuncs.h	2005-05-08 05:14:46 UTC (rev 15115)
+++ branches/new_headers/reactos/include/ndk/rtlfuncs.h	2005-05-08 06:22:12 UTC (rev 15116)
@@ -109,6 +109,16 @@
   InsertTailList(current, &((NewEntry)->ListEntryField));\
 }
 
+ULONG
+STDCALL
+DbgPrint(
+  IN PCH  Format,
+  IN ...);
+
+VOID
+STDCALL
+DbgBreakPoint(VOID);
+
 NTSTATUS
 STDCALL
 RtlAbsoluteToSelfRelativeSD (
@@ -168,6 +178,22 @@
     PVOID* RemainingSidArea,
     PULONG RemainingSidAreaSize
 );
+
+LONG
+STDCALL
+RtlCompareUnicodeString (
+    PUNICODE_STRING String1,
+    PUNICODE_STRING String2,
+    BOOLEAN CaseInsensitive
+);
+    
+BOOLEAN
+STDCALL
+RtlEqualUnicodeString (
+    PUNICODE_STRING String1,
+    PUNICODE_STRING String2,
+    BOOLEAN CaseInsensitive
+);
                  
 VOID
 STDCALL
@@ -225,6 +251,21 @@
     IN OUT PRTL_ATOM_TABLE *AtomTable
 );
 
+NTSTATUS
+STDCALL
+RtlCreateUserThread (
+    IN HANDLE ProcessHandle,
+    IN PSECURITY_DESCRIPTOR SecurityDescriptor,
+    IN BOOLEAN CreateSuspended,
+    IN LONG StackZeroBits,
+    IN OUT PULONG StackReserve,
+    IN OUT PULONG StackCommit,
+    IN PTHREAD_START_ROUTINE StartAddress,
+    IN PVOID Parameter,
+    IN OUT PHANDLE ThreadHandle,
+    IN OUT PCLIENT_ID ClientId
+);
+
 BOOLEAN
 STDCALL
 RtlCreateUnicodeString(
@@ -243,6 +284,18 @@
     OUT PULONG  FinalUncompressedSize
 );
 
+PRTL_USER_PROCESS_PARAMETERS
+STDCALL
+RtlDeNormalizeProcessParams (
+    IN PRTL_USER_PROCESS_PARAMETERS ProcessParameters
+);
+
+PRTL_USER_PROCESS_PARAMETERS
+STDCALL
+RtlNormalizeProcessParams (
+    IN PRTL_USER_PROCESS_PARAMETERS ProcessParameters
+);
+
 NTSTATUS
 STDCALL
 RtlDeleteAtomFromAtomTable (
@@ -288,7 +341,7 @@
     IN PSID Sid2
 );
 
-NTSTATUS
+VOID
 STDCALL
 RtlFillMemoryUlong (
     IN PVOID    Destination,
@@ -493,6 +546,14 @@
     OUT PLARGE_INTEGER  Time
 );
 
+VOID
+STDCALL
+RtlSetBits (
+    PRTL_BITMAP BitMapHeader,
+    ULONG StartingIndex,
+    ULONG NumberToSet
+);
+    
 #if (VER_PRODUCTBUILD >= 2195)
 
 NTSTATUS

Modified: branches/new_headers/reactos/include/ndk/rtltypes.h
--- branches/new_headers/reactos/include/ndk/rtltypes.h	2005-05-08 05:14:46 UTC (rev 15115)
+++ branches/new_headers/reactos/include/ndk/rtltypes.h	2005-05-08 06:22:12 UTC (rev 15116)
@@ -28,6 +28,8 @@
 #ifndef _RTLTYPES_H
 #define _RTLTYPES_H
 
+#include "zwtypes.h"
+
 #define MAXIMUM_LEADBYTES 12
 #define PPF_NORMALIZED (1)
 #define PEB_BASE        (0x7FFDF000)
@@ -128,7 +130,30 @@
 
 typedef EXCEPTION_REGISTRATION EXCEPTION_REGISTRATION_RECORD;
 typedef PEXCEPTION_REGISTRATION PEXCEPTION_REGISTRATION_RECORD;
+
+typedef struct _RTL_PROCESS_INFO
+{
+   ULONG Size;
+   HANDLE ProcessHandle;
+   HANDLE ThreadHandle;
+   CLIENT_ID ClientId;
+   SECTION_IMAGE_INFORMATION ImageInfo;
+} RTL_PROCESS_INFO, *PRTL_PROCESS_INFO;
        
+typedef struct _RTL_BITMAP 
+{
+    ULONG SizeOfBitMap;
+    PULONG Buffer;
+} RTL_BITMAP;
+typedef RTL_BITMAP *PRTL_BITMAP;
+
+typedef struct _RTL_BITMAP_RUN
+{
+    ULONG StartingIndex;
+    ULONG NumberOfBits;
+} RTL_BITMAP_RUN;
+typedef RTL_BITMAP_RUN *PRTL_BITMAP_RUN;
+
 typedef unsigned short RTL_ATOM;
 typedef unsigned short *PRTL_ATOM;
 

Modified: branches/new_headers/reactos/include/ndk/umtypes.h
--- branches/new_headers/reactos/include/ndk/umtypes.h	2005-05-08 05:14:46 UTC (rev 15115)
+++ branches/new_headers/reactos/include/ndk/umtypes.h	2005-05-08 06:22:12 UTC (rev 15116)
@@ -284,7 +284,16 @@
 typedef ULONG WAIT_TYPE;
 typedef struct _PEB                             *PPEB;
 typedef CONST char *PCSZ;
+typedef ULONG KPROCESSOR_MODE;
+typedef PVOID PTHREAD_START_ROUTINE;
 
+typedef enum _MODE 
+{
+    KernelMode,
+    UserMode,
+    MaximumMode
+} MODE;
+
 typedef struct _UNICODE_STRING {
   USHORT Length;
   USHORT MaximumLength;
@@ -743,9 +752,32 @@
     };
 } KUSER_SHARED_DATA, *PKUSER_SHARED_DATA;
 
-typedef struct _CPTABLEINFO *PCPTABLEINFO;
-typedef struct _NLSTABLEINFO *PNLSTABLEINFO;
+#define MAXIMUM_LEADBYTES 12
 
+typedef struct _CPTABLEINFO 
+{
+    USHORT CodePage;                    
+    USHORT MaximumCharacterSize;
+    USHORT DefaultChar;
+    USHORT UniDefaultChar;
+    USHORT TransDefaultChar;
+    USHORT TransUniDefaultChar;
+    USHORT DBCSCodePage;
+    UCHAR  LeadByte[MAXIMUM_LEADBYTES];
+    PUSHORT MultiByteTable;
+    PVOID   WideCharTable;
+    PUSHORT DBCSRanges;
+    PUSHORT DBCSOffsets;
+} CPTABLEINFO, *PCPTABLEINFO;
+
+typedef struct _NLSTABLEINFO 
+{
+    CPTABLEINFO OemTableInfo;
+    CPTABLEINFO AnsiTableInfo;
+    PUSHORT UpperCaseTable;
+    PUSHORT LowerCaseTable;
+} NLSTABLEINFO, *PNLSTABLEINFO;
+
 typedef struct _VM_COUNTERS 
 {
     SIZE_T PeakVirtualSize;
@@ -779,5 +811,142 @@
 } VM_COUNTERS_EX;
 typedef VM_COUNTERS_EX *PVM_COUNTERS_EX;
 
+typedef struct _COMPRESSED_DATA_INFO 
+{
+    USHORT  CompressionFormatAndEngine;
+    UCHAR   CompressionUnitShift;
+    UCHAR   ChunkShift;
+    UCHAR   ClusterShift;
+    UCHAR   Reserved;
+    USHORT  NumberOfChunks;
+    ULONG   CompressedChunkSizes[ANYSIZE_ARRAY];
+} COMPRESSED_DATA_INFO, *PCOMPRESSED_DATA_INFO;
+
+typedef struct _GENERATE_NAME_CONTEXT 
+{
+    USHORT  Checksum;
+    BOOLEAN CheckSumInserted;
+    UCHAR   NameLength;
+    WCHAR   NameBuffer[8];
+    ULONG   ExtensionLength;
+    WCHAR   ExtensionBuffer[4];
+    ULONG   LastIndexValue;
+} GENERATE_NAME_CONTEXT, *PGENERATE_NAME_CONTEXT;
+
+typedef struct _RTL_SPLAY_LINKS {
+    struct _RTL_SPLAY_LINKS *Parent;
+    struct _RTL_SPLAY_LINKS *LeftChild;
+    struct _RTL_SPLAY_LINKS *RightChild;
+} RTL_SPLAY_LINKS;
+typedef RTL_SPLAY_LINKS *PRTL_SPLAY_LINKS;
+
+struct _RTL_AVL_TABLE;
+struct _RTL_GENERIC_TABLE;
+
+typedef enum _TABLE_SEARCH_RESULT{
+    TableEmptyTree,
+    TableFoundNode,
+    TableInsertAsLeft,
+    TableInsertAsRight
+} TABLE_SEARCH_RESULT;
+
+typedef
+NTSTATUS STDCALL (*PRTL_AVL_MATCH_FUNCTION)(
+    struct _RTL_AVL_TABLE *Table,
+    PVOID UserData,
+    PVOID MatchData
+);
+
+typedef enum _RTL_GENERIC_COMPARE_RESULTS 
+{
+    GenericLessThan,
+    GenericGreaterThan,
+    GenericEqual
+} RTL_GENERIC_COMPARE_RESULTS;
+
+typedef
+RTL_GENERIC_COMPARE_RESULTS STDCALL
+(*PRTL_AVL_COMPARE_ROUTINE) (
+    struct _RTL_AVL_TABLE *Table,
+    PVOID FirstStruct,
+    PVOID SecondStruct
+);
+
+typedef
+RTL_GENERIC_COMPARE_RESULTS STDCALL
+(*PRTL_GENERIC_COMPARE_ROUTINE)(
+    struct _RTL_GENERIC_TABLE *Table,
+    PVOID FirstStruct,
+    PVOID SecondStruct
+);
+
+typedef
+PVOID STDCALL
+(*PRTL_GENERIC_ALLOCATE_ROUTINE) (
+    struct _RTL_GENERIC_TABLE *Table,
+    LONG ByteSize
+);
+
+typedef
+VOID STDCALL
+(*PRTL_GENERIC_FREE_ROUTINE) (
+    struct _RTL_GENERIC_TABLE *Table,
+    PVOID Buffer
+);
+    
+typedef
+VOID STDCALL
+(*PRTL_AVL_ALLOCATE_ROUTINE) (
+    struct _RTL_AVL_TABLE *Table,
+    LONG ByteSize
+);
+
+typedef
+VOID STDCALL
+(*PRTL_AVL_FREE_ROUTINE) (
+    struct _RTL_AVL_TABLE *Table,
+    PVOID Buffer
+);
+
+typedef struct _RTL_GENERIC_TABLE 
+{
+    PRTL_SPLAY_LINKS TableRoot;
+    LIST_ENTRY InsertOrderList;
+    PLIST_ENTRY OrderedPointer;
+    ULONG WhichOrderedElement;
+    ULONG NumberGenericTableElements;
+    PRTL_GENERIC_COMPARE_ROUTINE CompareRoutine;
+    PRTL_GENERIC_ALLOCATE_ROUTINE AllocateRoutine;
+    PRTL_GENERIC_FREE_ROUTINE FreeRoutine;
+    PVOID TableContext;
+} RTL_GENERIC_TABLE;
+typedef RTL_GENERIC_TABLE *PRTL_GENERIC_TABLE;
+
+typedef struct _RTL_BALANCED_LINKS 
+{
+    struct _RTL_BALANCED_LINKS *Parent;
+    struct _RTL_BALANCED_LINKS *LeftChild;
+    struct _RTL_BALANCED_LINKS *RightChild;
+    CHAR Balance;
+    UCHAR Reserved[3];
+} RTL_BALANCED_LINKS;
+typedef RTL_BALANCED_LINKS *PRTL_BALANCED_LINKS;
+   
+typedef struct _RTL_AVL_TABLE 
+{
+    RTL_BALANCED_LINKS BalancedRoot;
+    PVOID OrderedPointer;
+    ULONG WhichOrderedElement;
+    ULONG NumberGenericTableElements;
+    ULONG DepthOfTree;
+    PRTL_BALANCED_LINKS RestartKey;
+    ULONG DeleteCount;
+    PRTL_AVL_COMPARE_ROUTINE CompareRoutine;
+    PRTL_AVL_ALLOCATE_ROUTINE AllocateRoutine;
+    PRTL_AVL_FREE_ROUTINE FreeRoutine;
+    PVOID TableContext;
+} RTL_AVL_TABLE;
+typedef RTL_AVL_TABLE *PRTL_AVL_TABLE;
+
 #endif
 

Modified: branches/new_headers/reactos/include/ndk/zwtypes.h
--- branches/new_headers/reactos/include/ndk/zwtypes.h	2005-05-08 05:14:46 UTC (rev 15115)
+++ branches/new_headers/reactos/include/ndk/zwtypes.h	2005-05-08 06:22:12 UTC (rev 15116)
@@ -696,7 +696,7 @@
 
 typedef struct _ATOM_TABLE_INFORMATION {
 	ULONG NumberOfAtoms;
-	RTL_ATOM Atoms[1];
+	USHORT Atoms[1];
 } ATOM_TABLE_INFORMATION, *PATOM_TABLE_INFORMATION;
 
 // mutant information
@@ -933,6 +933,28 @@
 // SystemAddVerifier (52)
 // UNKNOWN
 
+typedef struct _SECTION_BASIC_INFORMATION {
+    PVOID           BaseAddress;
+    ULONG           Attributes;
+    LARGE_INTEGER   Size;
+} SECTION_BASIC_INFORMATION, *PSECTION_BASIC_INFORMATION;
+
+typedef struct _SECTION_IMAGE_INFORMATION {
+    ULONG     EntryPoint;
+    ULONG     Unknown1;
+    ULONG_PTR StackReserve;
+    ULONG_PTR StackCommit;
+    ULONG     Subsystem;
+    USHORT    MinorSubsystemVersion;
+    USHORT    MajorSubsystemVersion;
+    ULONG     Unknown2;
+    ULONG     Characteristics;
+    USHORT    ImageNumber;
+    BOOLEAN   Executable;
+    UCHAR     Unknown3;
+    ULONG     Unknown4[3];
+} SECTION_IMAGE_INFORMATION, *PSECTION_IMAGE_INFORMATION;
+
 // wait type
 
 #define WaitAll					0

Modified: branches/new_headers/reactos/include/winnt.h
--- branches/new_headers/reactos/include/winnt.h	2005-05-08 05:14:46 UTC (rev 15115)
+++ branches/new_headers/reactos/include/winnt.h	2005-05-08 06:22:12 UTC (rev 15116)
@@ -1343,6 +1343,9 @@
 } GUID, *REFGUID, *LPGUID;
 #define SYSTEM_LUID { QuadPart:999 }
 #endif /* GUID_DEFINED */
+
+#define ACCESS_ALLOWED_COMPOUND_ACE_TYPE        (0x4)
+
 typedef struct _GENERIC_MAPPING {
 	ACCESS_MASK GenericRead;
 	ACCESS_MASK GenericWrite;
@@ -1416,12 +1419,12 @@
 } ACL,*PACL;
 typedef struct _ACL_REVISION_INFORMATION {
 	DWORD AclRevision;
-} ACL_REVISION_INFORMATION;
+} ACL_REVISION_INFORMATION, *PACL_REVISION_INFORMATION;
 typedef struct _ACL_SIZE_INFORMATION {
 	DWORD   AceCount;
 	DWORD   AclBytesInUse;
 	DWORD   AclBytesFree;
-} ACL_SIZE_INFORMATION;
+} ACL_SIZE_INFORMATION, *PACL_SIZE_INFORMATION;
 
 /* FIXME: add more machines */
 #ifdef _X86_

Modified: branches/new_headers/reactos/lib/rtl/access.c
--- branches/new_headers/reactos/lib/rtl/access.c	2005-05-08 05:14:46 UTC (rev 15115)
+++ branches/new_headers/reactos/lib/rtl/access.c	2005-05-08 06:22:12 UTC (rev 15116)
@@ -9,8 +9,7 @@
 
 /* INCLUDES *****************************************************************/
 
-#include <ddk/ntddk.h>
-#include <ntdll/rtl.h>
+#include "rtl.h"
 
 #define NDEBUG
 #include <debug.h>

Modified: branches/new_headers/reactos/lib/rtl/acl.c
--- branches/new_headers/reactos/lib/rtl/acl.c	2005-05-08 05:14:46 UTC (rev 15115)
+++ branches/new_headers/reactos/lib/rtl/acl.c	2005-05-08 06:22:12 UTC (rev 15116)
@@ -11,8 +11,7 @@
 
 /* INCLUDES *****************************************************************/
 
-#include <ddk/ntddk.h>
-#include <ntdll/rtl.h>
+#include "rtl.h"
 
 #define NDEBUG
 #include <debug.h>

Modified: branches/new_headers/reactos/lib/rtl/bit.c
--- branches/new_headers/reactos/lib/rtl/bit.c	2005-05-08 05:14:46 UTC (rev 15115)
+++ branches/new_headers/reactos/lib/rtl/bit.c	2005-05-08 06:22:12 UTC (rev 15116)
@@ -26,9 +26,12 @@
 
 /* INCLUDES *****************************************************************/
 
-#include <ddk/ntddk.h>
+#include "rtl.h"
 
+#define NDEBUG
+#include <debug.h>
 
+
 /* FUNCTIONS ****************************************************************/
 
 /*

Modified: branches/new_headers/reactos/lib/rtl/bitmap.c
--- branches/new_headers/reactos/lib/rtl/bitmap.c	2005-05-08 05:14:46 UTC (rev 15115)
+++ branches/new_headers/reactos/lib/rtl/bitmap.c	2005-05-08 06:22:12 UTC (rev 15116)
@@ -28,7 +28,7 @@
 
 /* INCLUDES *****************************************************************/
 
-#include <ddk/ntddk.h>
+#include "rtl.h"
 
 #define NDEBUG
 #include <debug.h>

Modified: branches/new_headers/reactos/lib/rtl/bootdata.c
--- branches/new_headers/reactos/lib/rtl/bootdata.c	2005-05-08 05:14:46 UTC (rev 15115)
+++ branches/new_headers/reactos/lib/rtl/bootdata.c	2005-05-08 06:22:12 UTC (rev 15116)
@@ -24,7 +24,7 @@
  * FILE:              lib/rtl/bootdata.c
  */
 
-#include <ddk/ntddk.h>
+#include "rtl.h"
 
 #define NDEBUG
 #include <debug.h>

Modified: branches/new_headers/reactos/lib/rtl/compress.c
--- branches/new_headers/reactos/lib/rtl/compress.c	2005-05-08 05:14:46 UTC (rev 15115)
+++ branches/new_headers/reactos/lib/rtl/compress.c	2005-05-08 06:22:12 UTC (rev 15116)
@@ -27,12 +27,11 @@
 
 /* INCLUDES *****************************************************************/
 
-#include <ddk/ntddk.h>
+#include "rtl.h"
 
 #define NDEBUG
 #include <debug.h>
 
-
 /* MACROS *******************************************************************/
 
 #define COMPRESSION_FORMAT_MASK  0x00FF

Modified: branches/new_headers/reactos/lib/rtl/dos8dot3.c
--- branches/new_headers/reactos/lib/rtl/dos8dot3.c	2005-05-08 05:14:46 UTC (rev 15115)
+++ branches/new_headers/reactos/lib/rtl/dos8dot3.c	2005-05-08 06:22:12 UTC (rev 15116)
@@ -27,8 +27,7 @@
 
 /* INCLUDES ******************************************************************/
 
-#include <ddk/ntddk.h>
-#include <ntos/minmax.h>
+#include "rtl.h"
 
 #define NDEBUG
 #include <debug.h>

Modified: branches/new_headers/reactos/lib/rtl/encode.c
--- branches/new_headers/reactos/lib/rtl/encode.c	2005-05-08 05:14:46 UTC (rev 15115)
+++ branches/new_headers/reactos/lib/rtl/encode.c	2005-05-08 06:22:12 UTC (rev 15116)
@@ -12,9 +12,10 @@
 
 /* INCLUDES *****************************************************************/
 
-#include <ddk/ntddk.h>
+#include "rtl.h"
 
-#include <ntdll/ntdll.h>
+#define NDEBUG
+#include <debug.h>
 
 /* FUNCTIONS ***************************************************************/
 

Modified: branches/new_headers/reactos/lib/rtl/env.c
--- branches/new_headers/reactos/lib/rtl/env.c	2005-05-08 05:14:46 UTC (rev 15115)
+++ branches/new_headers/reactos/lib/rtl/env.c	2005-05-08 06:22:12 UTC (rev 15116)
@@ -11,14 +11,10 @@
 
 /* INCLUDES ******************************************************************/
 
-#include <ddk/ntddk.h>
-#include <ntdll/rtl.h>
-#include <napi/teb.h>
-#include <ntos/minmax.h>
-#include <string.h>
+#include "rtl.h"
 
 #define NDEBUG
-#include <ntdll/ntdll.h>
+#include <debug.h>
 
 PPEB STDCALL RtlpCurrentPeb(VOID);
 /* FUNCTIONS *****************************************************************/

Modified: branches/new_headers/reactos/lib/rtl/error.c
--- branches/new_headers/reactos/lib/rtl/error.c	2005-05-08 05:14:46 UTC (rev 15115)
+++ branches/new_headers/reactos/lib/rtl/error.c	2005-05-08 06:22:12 UTC (rev 15116)
@@ -19,19 +19,11 @@
 
 /* INCLUDES *****************************************************************/
 
-#include <ddk/ntddk.h>
-#include <winerror.h>
+#include "rtl.h"
 
 #define NDEBUG
 #include <debug.h>
 
-#ifndef HIWORD
-#define HIWORD(l) ((WORD)(((DWORD)(l) >> 16) & 0xFFFF))
-#endif
-#ifndef LOWORD
-#define LOWORD(l) ((WORD)(l))
-#endif
-
 /* TYPES *******************************************************************/
 
 typedef struct _ERROR_TABLE

Modified: branches/new_headers/reactos/lib/rtl/exception.c
--- branches/new_headers/reactos/lib/rtl/exception.c	2005-05-08 05:14:46 UTC (rev 15115)
+++ branches/new_headers/reactos/lib/rtl/exception.c	2005-05-08 06:22:12 UTC (rev 15116)
@@ -15,10 +15,7 @@
 
 /* INCLUDES *****************************************************************/
 
-#include <ddk/ntddk.h>
-#include <windows.h>
-#include <string.h>
-#include <napi/teb.h>
+#include "rtl.h"
 
 #define NDEBUG
 #include <debug.h>

Modified: branches/new_headers/reactos/lib/rtl/generictable.c
--- branches/new_headers/reactos/lib/rtl/generictable.c	2005-05-08 05:14:46 UTC (rev 15115)
+++ branches/new_headers/reactos/lib/rtl/generictable.c	2005-05-08 06:22:12 UTC (rev 15116)
@@ -24,7 +24,7 @@
  * FILE:              lib/rtl/genertictbl.c
  */
 
-#include <ddk/ntddk.h>
+#include "rtl.h"
 
 #define NDEBUG
 #include <debug.h>

Modified: branches/new_headers/reactos/lib/rtl/heap.c
--- branches/new_headers/reactos/lib/rtl/heap.c	2005-05-08 05:14:46 UTC (rev 15115)
+++ branches/new_headers/reactos/lib/rtl/heap.c	2005-05-08 06:22:12 UTC (rev 15116)
@@ -12,11 +12,7 @@
  * require it.
  */
 
-#include <string.h>
-#include <ddk/ntddk.h>
-#include <ntdll/rtl.h>
-#include <ntos/heap.h>
-#include <ntos/minmax.h>
+#include "rtl.h"
 
 #define NDEBUG
 #include <debug.h>
@@ -29,7 +25,6 @@
 #define TRACE_ON(x) (1)
 #endif
 
-
 static RTL_CRITICAL_SECTION RtlpProcessHeapsListLock;
 
 

Modified: branches/new_headers/reactos/lib/rtl/image.c
--- branches/new_headers/reactos/lib/rtl/image.c	2005-05-08 05:14:46 UTC (rev 15115)
+++ branches/new_headers/reactos/lib/rtl/image.c	2005-05-08 06:22:12 UTC (rev 15116)
@@ -9,11 +9,10 @@
  *                  17/03/2000 Created
  */
 
-#include <ddk/ntddk.h>
-#include <ntdll/rtl.h>
+#include "rtl.h"
 
 #define NDEBUG
-#include <ntdll/ntdll.h>
+#include <debug.h>
 
 /* FUNCTIONS ****************************************************************/
 

Modified: branches/new_headers/reactos/lib/rtl/largeint.c
--- branches/new_headers/reactos/lib/rtl/largeint.c	2005-05-08 05:14:46 UTC (rev 15115)
+++ branches/new_headers/reactos/lib/rtl/largeint.c	2005-05-08 06:22:12 UTC (rev 15116)
@@ -11,7 +11,7 @@
 
 /* INCLUDES *****************************************************************/
 
-#include <ddk/ntddk.h>
+#include "rtl.h"
 
 #define NDEBUG
 #include <debug.h>

Modified: branches/new_headers/reactos/lib/rtl/luid.c
--- branches/new_headers/reactos/lib/rtl/luid.c	2005-05-08 05:14:46 UTC (rev 15115)
+++ branches/new_headers/reactos/lib/rtl/luid.c	2005-05-08 06:22:12 UTC (rev 15116)
@@ -11,8 +11,7 @@
 
 /* INCLUDES *****************************************************************/
 
-#include <ddk/ntddk.h>
-#include <ntdll/rtl.h>
+#include "rtl.h"
 
 #define NDEBUG
 #include <debug.h>

Modified: branches/new_headers/reactos/lib/rtl/mem.c
--- branches/new_headers/reactos/lib/rtl/mem.c	2005-05-08 05:14:46 UTC (rev 15115)
+++ branches/new_headers/reactos/lib/rtl/mem.c	2005-05-08 06:22:12 UTC (rev 15116)
@@ -12,8 +12,7 @@
 
 /* INCLUDES *****************************************************************/
 
-#include <ddk/ntddk.h>
-#include <string.h>
+#include "rtl.h"
 
 #define NDEBUG
 #include <debug.h>
@@ -84,7 +83,7 @@
    return (ULONG)((PCHAR)ptr - (PCHAR)Source);
 }
 
-
+#undef RtlFillMemory
 /*
  * @implemented
  */
@@ -100,7 +99,6 @@
 }
 
 
-
 /*
  * @implemented
  */
@@ -124,7 +122,7 @@
 }
 
 
-
+#undef RtlMoveMemory
 /*
  * @implemented
  */
@@ -156,6 +154,7 @@
 	UNIMPLEMENTED;
 }
 
+#undef RtlZeroMemory
 /*
  * @implemented
  */

Modified: branches/new_headers/reactos/lib/rtl/network.c
--- branches/new_headers/reactos/lib/rtl/network.c	2005-05-08 05:14:46 UTC (rev 15115)
+++ branches/new_headers/reactos/lib/rtl/network.c	2005-05-08 06:22:12 UTC (rev 15116)
@@ -24,8 +24,7 @@
  * FILE:              lib/rtl/network.c
  */
 
-#include <ddk/ntddk.h>
-#include <stdio.h>
+#include "rtl.h"
 
 #define NDEBUG
 #include <debug.h>

Modified: branches/new_headers/reactos/lib/rtl/nls.c
--- branches/new_headers/reactos/lib/rtl/nls.c	2005-05-08 05:14:46 UTC (rev 15115)
+++ branches/new_headers/reactos/lib/rtl/nls.c	2005-05-08 06:22:12 UTC (rev 15116)
@@ -13,7 +13,7 @@
  */
 
 
-#include <ddk/ntddk.h>
+#include "rtl.h"
 
 #define NDEBUG
 #include <debug.h>

Modified: branches/new_headers/reactos/lib/rtl/ppb.c
--- branches/new_headers/reactos/lib/rtl/ppb.c	2005-05-08 05:14:46 UTC (rev 15115)
+++ branches/new_headers/reactos/lib/rtl/ppb.c	2005-05-08 06:22:12 UTC (rev 15116)
@@ -11,14 +11,10 @@
 
 /* INCLUDES ****************************************************************/
 
-#include <ddk/ntddk.h>
-#include <ntdll/ldr.h>
-#include <napi/teb.h>
-#include <ntdll/base.h>
-#include <ntdll/rtl.h>
+#include "rtl.h"
 
 #define NDEBUG
-#include <ntdll/ntdll.h>
+#include <debug.h>
 
 /* MACROS ****************************************************************/
 

Modified: branches/new_headers/reactos/lib/rtl/process.c
--- branches/new_headers/reactos/lib/rtl/process.c	2005-05-08 05:14:46 UTC (rev 15115)
+++ branches/new_headers/reactos/lib/rtl/process.c	2005-05-08 06:22:12 UTC (rev 15116)
@@ -11,14 +11,10 @@
 
 /* INCLUDES ****************************************************************/
 
-#include <ddk/ntddk.h>
-#include <napi/i386/segment.h>
-#include <ntdll/ldr.h>
-#include <ntdll/base.h>
-#include <ntdll/rtl.h>
+#include "rtl.h"
 
 #define NDEBUG
-#include <ntdll/ntdll.h>
+#include <debug.h>
 
 /* FUNCTIONS ****************************************************************/
 

Modified: branches/new_headers/reactos/lib/rtl/random.c
--- branches/new_headers/reactos/lib/rtl/random.c	2005-05-08 05:14:46 UTC (rev 15115)
+++ branches/new_headers/reactos/lib/rtl/random.c	2005-05-08 06:22:12 UTC (rev 15116)
@@ -26,8 +26,7 @@
 
 /* INCLUDES *****************************************************************/
 
-#include <ddk/ntddk.h>
-#include <ntdll/rtl.h>
+#include "rtl.h"
 
 #define NDEBUG
 #include <debug.h>

Modified: branches/new_headers/reactos/lib/rtl/registry.c
--- branches/new_headers/reactos/lib/rtl/registry.c	2005-05-08 05:14:46 UTC (rev 15115)
+++ branches/new_headers/reactos/lib/rtl/registry.c	2005-05-08 06:22:12 UTC (rev 15116)
@@ -18,12 +18,10 @@
 /* INCLUDES ****************************************************************/
 
 #define __NTDRIVER__
-#include <ddk/ntddk.h>
-#include <ntdll/rtl.h>
-#include <ntos/minmax.h>
+#include "rtl.h"
 
 #define NDEBUG
-#include <ntdll/ntdll.h>
+#include <debug.h>
 
 
 /* FUNCTIONS ***************************************************************/

Modified: branches/new_headers/reactos/lib/rtl/sd.c
--- branches/new_headers/reactos/lib/rtl/sd.c	2005-05-08 05:14:46 UTC (rev 15115)
+++ branches/new_headers/reactos/lib/rtl/sd.c	2005-05-08 06:22:12 UTC (rev 15116)
@@ -11,9 +11,10 @@
 
 /* INCLUDES *****************************************************************/
 
-#include <ddk/ntddk.h>
+#include "rtl.h"
 
-#include <ntdll/ntdll.h>
+#define NDEBUG
+#include <debug.h>
 
 /* FUNCTIONS ***************************************************************/
 

Modified: branches/new_headers/reactos/lib/rtl/security.c
--- branches/new_headers/reactos/lib/rtl/security.c	2005-05-08 05:14:46 UTC (rev 15115)
+++ branches/new_headers/reactos/lib/rtl/security.c	2005-05-08 06:22:12 UTC (rev 15116)
@@ -9,8 +9,7 @@
  *                  21/11/2001 Created
  */
 
-#include <ddk/ntddk.h>
-#include <ntdll/rtl.h>
+#include "rtl.h"
 
 #define NDEBUG
 #include <debug.h>

Modified: branches/new_headers/reactos/lib/rtl/sid.c
--- branches/new_headers/reactos/lib/rtl/sid.c	2005-05-08 05:14:46 UTC (rev 15115)
[truncated at 1001 lines; 135 more skipped]