- Remove some public APIs from internal headers.
- Remove some internal APIs/types from public headers.
- Make PSECTION_OBJECT a PVOID unless really needed (which should only be inside \mm)
- Make hal buildable on msvc.
- Fix some other misc. various msvc/ddk incompatibilities.
Modified: trunk/reactos/hal/halx86/generic/beep.c
Modified: trunk/reactos/hal/halx86/generic/dma.c
Modified: trunk/reactos/hal/halx86/generic/halinit.c
Modified: trunk/reactos/hal/halx86/generic/isa.c
Modified: trunk/reactos/hal/halx86/generic/kdbg.c
Modified: trunk/reactos/hal/halx86/generic/misc.c
Modified: trunk/reactos/hal/halx86/generic/pci.c
Modified: trunk/reactos/hal/halx86/generic/timer.c
Modified: trunk/reactos/hal/halx86/include/hal.h
Modified: trunk/reactos/hal/halx86/include/haldma.h
Modified: trunk/reactos/hal/halx86/include/ioapic.h
Modified: trunk/reactos/hal/halx86/include/mps.h
Modified: trunk/reactos/include/ndk/iofuncs.h
Modified: trunk/reactos/include/ndk/mmtypes.h
Modified: trunk/reactos/ntoskrnl/cm/regfile.c
Modified: trunk/reactos/ntoskrnl/include/internal/ke.h
Modified: trunk/reactos/ntoskrnl/include/internal/mm.h
Modified: trunk/reactos/ntoskrnl/include/internal/rtl.h
Modified: trunk/reactos/ntoskrnl/lpc/connect.c
Modified: trunk/reactos/ntoskrnl/mm/anonmem.c
Modified: trunk/reactos/ntoskrnl/mm/i386/page.c
Modified: trunk/reactos/ntoskrnl/mm/marea.c
Modified: trunk/reactos/ntoskrnl/mm/pageop.c
Modified: trunk/reactos/ntoskrnl/mm/rmap.c
Modified: trunk/reactos/ntoskrnl/mm/section.c
Modified: trunk/reactos/ntoskrnl/mm/virtual.c
Modified: trunk/reactos/ntoskrnl/rtl/nls.c
Modified: trunk/reactos/w32api/include/ddk/ntifs.h
Modified: trunk/reactos/w32api/include/ddk/winddk.h
Modified: trunk/reactos/w32api/include/ntdef.h
Modified: trunk/reactos/w32api/include/winnt.h

Modified: trunk/reactos/hal/halx86/generic/beep.c
--- trunk/reactos/hal/halx86/generic/beep.c	2006-01-08 04:36:33 UTC (rev 20695)
+++ trunk/reactos/hal/halx86/generic/beep.c	2006-01-08 06:23:17 UTC (rev 20696)
@@ -50,7 +50,7 @@
 
     if (Frequency)
     {
-        DWORD Divider = CLOCKFREQ / Frequency;
+        ULONG Divider = CLOCKFREQ / Frequency;
 
         if (Divider > 0x10000)
         {

Modified: trunk/reactos/hal/halx86/generic/dma.c
--- trunk/reactos/hal/halx86/generic/dma.c	2006-01-08 04:36:33 UTC (rev 20695)
+++ trunk/reactos/hal/halx86/generic/dma.c	2006-01-08 06:23:17 UTC (rev 20696)
@@ -252,7 +252,7 @@
    
    if (MapRegisterCount > 0)
    {
-      PMAP_REGISTER_ENTRY CurrentEntry, PreviousEntry;
+      PROS_MAP_REGISTER_ENTRY CurrentEntry, PreviousEntry;
 
       CurrentEntry = AdapterObject->MapRegisterBase +
                      AdapterObject->NumberOfMapRegisters;
@@ -351,7 +351,7 @@
 
    MasterAdapter->MapRegisterBase = ExAllocatePoolWithTag(
       NonPagedPool,
-      SizeOfBitmap * sizeof(MAP_REGISTER_ENTRY),
+      SizeOfBitmap * sizeof(ROS_MAP_REGISTER_ENTRY),
       TAG_DMA);
    if (MasterAdapter->MapRegisterBase == NULL)
    {
@@ -360,7 +360,7 @@
    }
 
    RtlZeroMemory(MasterAdapter->MapRegisterBase,
-                 SizeOfBitmap * sizeof(MAP_REGISTER_ENTRY));
+                 SizeOfBitmap * sizeof(ROS_MAP_REGISTER_ENTRY));
    if (!HalpGrowMapBuffers(MasterAdapter, 0x10000))
    {
       ExFreePool(MasterAdapter);
@@ -455,8 +455,8 @@
    PDEVICE_DESCRIPTION DeviceDescription)
 {
    UCHAR Controller;
-   DMA_MODE DmaMode = { Byte: 0 };
-   DMA_EXTENDED_MODE ExtendedMode = { Byte: 0 };
+   DMA_MODE DmaMode = {{0 }};
+   DMA_EXTENDED_MODE ExtendedMode = {{ 0 }};
    PVOID AdapterBaseVa;
 
    Controller = (DeviceDescription->DmaChannel & 4) ? 2 : 1;
@@ -1127,7 +1127,7 @@
             if (!AdapterObject->ScatterGather)
             {
                AdapterObject->MapRegisterBase =
-                  (PMAP_REGISTER_ENTRY)(
+                  (PROS_MAP_REGISTER_ENTRY)(
                      (ULONG_PTR)AdapterObject->MapRegisterBase |
                      MAP_BASE_SW_SG);
             }
@@ -1285,7 +1285,7 @@
                if (!AdapterObject->ScatterGather)
                {
                   AdapterObject->MapRegisterBase =
-                     (PMAP_REGISTER_ENTRY)(
+                     (PROS_MAP_REGISTER_ENTRY)(
                         (ULONG_PTR)AdapterObject->MapRegisterBase |
                         MAP_BASE_SW_SG);
                }
@@ -1371,10 +1371,10 @@
 
    if (NumberOfMapRegisters != 0)
    {
-      PMAP_REGISTER_ENTRY RealMapRegisterBase;
+      PROS_MAP_REGISTER_ENTRY RealMapRegisterBase;
 
       RealMapRegisterBase =
-         (PMAP_REGISTER_ENTRY)((ULONG_PTR)MapRegisterBase & ~MAP_BASE_SW_SG);
+         (PROS_MAP_REGISTER_ENTRY)((ULONG_PTR)MapRegisterBase & ~MAP_BASE_SW_SG);
       RtlClearBits(MasterAdapter->MapRegisters,
                    RealMapRegisterBase - MasterAdapter->MapRegisterBase,
                    NumberOfMapRegisters);
@@ -1408,7 +1408,7 @@
       if (!AdapterObject->ScatterGather)
       {
          AdapterObject->MapRegisterBase =
-            (PMAP_REGISTER_ENTRY)(
+            (PROS_MAP_REGISTER_ENTRY)(
                (ULONG_PTR)AdapterObject->MapRegisterBase |
                MAP_BASE_SW_SG);
       }
@@ -1459,7 +1459,7 @@
 VOID STDCALL
 HalpCopyBufferMap(
    PMDL Mdl,
-   PMAP_REGISTER_ENTRY MapRegisterBase,
+   PROS_MAP_REGISTER_ENTRY MapRegisterBase,
    PVOID CurrentVa,
    ULONG Length,
    BOOLEAN WriteToDevice)
@@ -1555,7 +1555,7 @@
    BOOLEAN WriteToDevice)
 {
    BOOLEAN SlaveDma = FALSE;
-   PMAP_REGISTER_ENTRY RealMapRegisterBase;
+   PROS_MAP_REGISTER_ENTRY RealMapRegisterBase;
 
    ASSERT_IRQL(DISPATCH_LEVEL);  
 
@@ -1582,7 +1582,7 @@
       return TRUE;
 
    RealMapRegisterBase =
-      (PMAP_REGISTER_ENTRY)((ULONG_PTR)MapRegisterBase & ~MAP_BASE_SW_SG);
+      (PROS_MAP_REGISTER_ENTRY)((ULONG_PTR)MapRegisterBase & ~MAP_BASE_SW_SG);
 
    if (!WriteToDevice)
    {
@@ -1655,7 +1655,7 @@
    ULONG TransferOffset;
    ULONG TransferLength;
    BOOLEAN UseMapRegisters;
-   PMAP_REGISTER_ENTRY RealMapRegisterBase;
+   PROS_MAP_REGISTER_ENTRY RealMapRegisterBase;
    PHYSICAL_ADDRESS PhysicalAddress;
    PHYSICAL_ADDRESS HighestAcceptableAddress;
    ULONG Counter;
@@ -1722,7 +1722,7 @@
     */
 
    RealMapRegisterBase =
-      (PMAP_REGISTER_ENTRY)((ULONG_PTR)MapRegisterBase & ~MAP_BASE_SW_SG);
+      (PROS_MAP_REGISTER_ENTRY)((ULONG_PTR)MapRegisterBase & ~MAP_BASE_SW_SG);
 
    /*
     * Try to calculate the size of the transfer. We can only transfer

Modified: trunk/reactos/hal/halx86/generic/halinit.c
--- trunk/reactos/hal/halx86/generic/halinit.c	2006-01-08 04:36:33 UTC (rev 20695)
+++ trunk/reactos/hal/halx86/generic/halinit.c	2006-01-08 06:23:17 UTC (rev 20696)
@@ -52,10 +52,12 @@
    }
   else if (BootPhase == 2)
     {
+      PHYSICAL_ADDRESS Null = {{0}};
+
       /* Go to blue screen */
       HalClearDisplay (0x17); /* grey on blue */
       
-      HalpZeroPageMapping = MmMapIoSpace((LARGE_INTEGER)0LL, PAGE_SIZE, MmNonCached);
+      HalpZeroPageMapping = MmMapIoSpace(Null, PAGE_SIZE, MmNonCached);
     }
 
   return TRUE;

Modified: trunk/reactos/hal/halx86/generic/isa.c
--- trunk/reactos/hal/halx86/generic/isa.c	2006-01-08 04:36:33 UTC (rev 20695)
+++ trunk/reactos/hal/halx86/generic/isa.c	2006-01-08 06:23:17 UTC (rev 20696)
@@ -17,7 +17,7 @@
 
 /* FUNCTIONS *****************************************************************/
 
-BOOL HalIsaProbe(VOID)
+BOOLEAN HalIsaProbe(VOID)
 /*
  * FUNCTION: Probes for an ISA bus
  * RETURNS: True if detected

Modified: trunk/reactos/hal/halx86/generic/kdbg.c
--- trunk/reactos/hal/halx86/generic/kdbg.c	2006-01-08 04:36:33 UTC (rev 20695)
+++ trunk/reactos/hal/halx86/generic/kdbg.c	2006-01-08 06:23:17 UTC (rev 20696)
@@ -87,8 +87,8 @@
 KdpDoesComPortExist (PUCHAR BaseAddress)
 {
         BOOLEAN found;
-        BYTE mcr;
-        BYTE msr;
+        UCHAR mcr;
+        UCHAR msr;
 
         found = FALSE;
 
@@ -149,14 +149,14 @@
 STDCALL
 KdPortInitialize (
 	PKD_PORT_INFORMATION	PortInformation,
-	DWORD	Unknown1,
-	DWORD	Unknown2
+	ULONG	Unknown1,
+	ULONG	Unknown2
 	)
 {
         ULONG BaseArray[5] = {0, 0x3F8, 0x2F8, 0x3E8, 0x2E8};
         char buffer[80];
         ULONG divisor;
-        BYTE lcr;
+        UCHAR lcr;
 
         if (PortInitialized == FALSE)
         {
@@ -282,15 +282,15 @@
 STDCALL
 KdPortInitializeEx (
 	PKD_PORT_INFORMATION	PortInformation,
-	DWORD	Unknown1,
-	DWORD	Unknown2
+	ULONG	Unknown1,
+	ULONG	Unknown2
 	)
 {
         ULONG BaseArray[5] = {0, 0x3F8, 0x2F8, 0x3E8, 0x2E8};
 		PUCHAR ComPortBase;
         char buffer[80];
         ULONG divisor;
-        BYTE lcr;
+        UCHAR lcr;
 
 		if (PortInformation->BaudRate == 0)
 		{

Modified: trunk/reactos/hal/halx86/generic/misc.c
--- trunk/reactos/hal/halx86/generic/misc.c	2006-01-08 04:36:33 UTC (rev 20695)
+++ trunk/reactos/hal/halx86/generic/misc.c	2006-01-08 06:23:17 UTC (rev 20696)
@@ -16,14 +16,12 @@
 
 /* FUNCTIONS ****************************************************************/
 
-
-VOID
-NTAPI
-HalAllocateCrashDumpRegisters(
-  ULONG Unknown1,
-  ULONG Unknown2)
+PVOID STDCALL
+HalAllocateCrashDumpRegisters(IN PADAPTER_OBJECT AdapterObject,
+                              IN OUT PULONG NumberOfMapRegisters)
 {
   UNIMPLEMENTED;
+  return NULL;
 }
 
 

Modified: trunk/reactos/hal/halx86/generic/pci.c
--- trunk/reactos/hal/halx86/generic/pci.c	2006-01-08 04:36:33 UTC (rev 20695)
+++ trunk/reactos/hal/halx86/generic/pci.c	2006-01-08 06:23:17 UTC (rev 20696)
@@ -601,8 +601,8 @@
 {
   ULONG DataSize;
   PCI_COMMON_CONFIG PciConfig;
-  UINT Address;
-  UINT ResourceCount;
+  SIZE_T Address;
+  SIZE_T ResourceCount;
   ULONG Size[PCI_TYPE0_ADDRESSES];
   NTSTATUS Status = STATUS_SUCCESS;
   UCHAR Offset;

Modified: trunk/reactos/hal/halx86/generic/timer.c
--- trunk/reactos/hal/halx86/generic/timer.c	2006-01-08 04:36:33 UTC (rev 20695)
+++ trunk/reactos/hal/halx86/generic/timer.c	2006-01-08 06:23:17 UTC (rev 20696)
@@ -96,7 +96,7 @@
  * For supported compilers we use inline assembler. For the others,
  * portable plain C.
  */
-VOID STDCALL __attribute__((noinline))
+DECLSPEC_NOINLINE VOID STDCALL
 __KeStallExecutionProcessor(ULONG Loops)
 {
   if (!Loops)
@@ -121,7 +121,9 @@
 #endif
 }
 
-VOID STDCALL KeStallExecutionProcessor(ULONG Microseconds)
+VOID
+STDCALL
+KeStallExecutionProcessor(ULONG Microseconds)
 {
    PKIPCR Pcr = (PKIPCR)KeGetCurrentKPCR();
 
@@ -305,7 +307,8 @@
 }
 
 
-LARGE_INTEGER STDCALL
+LARGE_INTEGER
+STDCALL
 KeQueryPerformanceCounter(PLARGE_INTEGER PerformanceFreq)
 /*
  * FUNCTION: Queries the finest grained running count available in the system

Modified: trunk/reactos/hal/halx86/include/hal.h
--- trunk/reactos/hal/halx86/include/hal.h	2006-01-08 04:36:33 UTC (rev 20695)
+++ trunk/reactos/hal/halx86/include/hal.h	2006-01-08 06:23:17 UTC (rev 20696)
@@ -12,8 +12,8 @@
 #include <stdio.h>
 
 /* IFS/DDK/NDK Headers */
+#include <ntifs.h>
 #include <ntddk.h>
-#include <ntifs.h>
 #include <ndk/ntndk.h>
 
 /* Internal Kernel Headers */

Modified: trunk/reactos/hal/halx86/include/haldma.h
--- trunk/reactos/hal/halx86/include/haldma.h	2006-01-08 04:36:33 UTC (rev 20695)
+++ trunk/reactos/hal/halx86/include/haldma.h	2006-01-08 06:23:17 UTC (rev 20696)
@@ -310,12 +310,12 @@
    DMA_CHANNEL_STOP DmaChannelStop[8];  /* 4E0h-4FFh */
 } EISA_CONTROL, *PEISA_CONTROL;
 
-typedef struct _MAP_REGISTER_ENTRY
+typedef struct _ROS_MAP_REGISTER_ENTRY
 {
    PVOID VirtualAddress;
    PHYSICAL_ADDRESS PhysicalAddress;
    ULONG Counter;
-} MAP_REGISTER_ENTRY, *PMAP_REGISTER_ENTRY;
+} ROS_MAP_REGISTER_ENTRY, *PROS_MAP_REGISTER_ENTRY;
 
 struct _ADAPTER_OBJECT {
    /*
@@ -333,7 +333,7 @@
 
    ULONG MapRegistersPerChannel;
    PVOID AdapterBaseVa;
-   PMAP_REGISTER_ENTRY MapRegisterBase;
+   PROS_MAP_REGISTER_ENTRY MapRegisterBase;
 
    ULONG NumberOfMapRegisters;
    ULONG CommittedMapRegisters;
@@ -376,20 +376,21 @@
    IN PDEVICE_DESCRIPTION DeviceDescription,
    OUT PULONG NumberOfMapRegisters);
 
-VOID STDCALL
-HalPutDmaAdapter(
-   PADAPTER_OBJECT AdapterObject);
+/* FIXME: I added the definition to winddk.h but gcc wants it -HERE-. WHY?? */
+#ifndef _MSC_VER
+NTSTATUS
+NTAPI
+IoAllocateAdapterChannel(
+    IN PADAPTER_OBJECT AdapterObject,
+    IN PDEVICE_OBJECT DeviceObject,
+    IN ULONG NumberOfMapRegisters,
+    IN PDRIVER_CONTROL ExecutionRoutine,
+    IN PVOID Context
+);
+#endif
 
 ULONG STDCALL
 HalpDmaGetDmaAlignment(
    PADAPTER_OBJECT AdapterObject);
 
-NTSTATUS STDCALL
-IoAllocateAdapterChannel(
-   IN PADAPTER_OBJECT AdapterObject,
-   IN PDEVICE_OBJECT DeviceObject,
-   IN ULONG NumberOfMapRegisters,
-   IN PDRIVER_CONTROL ExecutionRoutine,
-   IN PVOID Context);
-
 #endif /* HALDMA_H */

Modified: trunk/reactos/hal/halx86/include/ioapic.h
--- trunk/reactos/hal/halx86/include/ioapic.h	2006-01-08 04:36:33 UTC (rev 20695)
+++ trunk/reactos/hal/halx86/include/ioapic.h	2006-01-08 06:23:17 UTC (rev 20696)
@@ -37,6 +37,7 @@
 #define IOAPIC_TBL_DF1      (0xFF<< 56) /* Destination Field (logical mode) */
 #define IOAPIC_TBL_VECTOR   (0xFF << 0) /* Vector (10h - FEh) */
 
+#include <pshpack1.h>
 typedef struct _IOAPIC_ROUTE_ENTRY {
    ULONG vector	    :  8,
    delivery_mode    :  3,   /* 000: FIXED
@@ -62,7 +63,8 @@
                logical_dest  :  8;
       } logical;
    } dest;
-} __attribute__ ((packed)) IOAPIC_ROUTE_ENTRY, *PIOAPIC_ROUTE_ENTRY;
+} IOAPIC_ROUTE_ENTRY, *PIOAPIC_ROUTE_ENTRY;
+#include <poppack.h>
 
 typedef struct _IOAPIC_INFO
 {

Modified: trunk/reactos/hal/halx86/include/mps.h
--- trunk/reactos/hal/halx86/include/mps.h	2006-01-08 04:36:33 UTC (rev 20695)
+++ trunk/reactos/hal/halx86/include/mps.h	2006-01-08 06:23:17 UTC (rev 20696)
@@ -22,7 +22,8 @@
 /* MP Floating Pointer Structure */
 #define MPF_SIGNATURE (('_' << 24) | ('P' << 16) | ('M' << 8) | '_')
 
-typedef struct __attribute__((packed)) _MP_FLOATING_POINTER
+#include <pshpack1.h>
+typedef struct _MP_FLOATING_POINTER
 {
 	ULONG Signature;     /* _MP_ */
 	ULONG Address;          /* Physical Address Pointer (0 means no configuration table exist) */
@@ -34,14 +35,15 @@
 	UCHAR Feature3;         /* Unused (0) */
 	UCHAR Feature4;         /* Unused (0) */
 	UCHAR Feature5;         /* Unused (0) */
-} __attribute__((packed)) MP_FLOATING_POINTER, *PMP_FLOATING_POINTER;
+} MP_FLOATING_POINTER, *PMP_FLOATING_POINTER;
 
+
 #define FEATURE2_IMCRP  0x80
 
 /* MP Configuration Table Header */
 #define MPC_SIGNATURE (('P' << 24) | ('M' << 16) | ('C' << 8) | 'P')
 
-typedef struct __attribute__((packed)) _MP_CONFIGURATION_TABLE
+typedef struct _MP_CONFIGURATION_TABLE
 {
   ULONG Signature;     /* PCMP */
   USHORT Length;	        /* Size of configuration table */
@@ -56,7 +58,7 @@
   USHORT ExtTableLength;  /* Extended Table Length */
   UCHAR ExtTableChecksum; /* Extended Table Checksum */
   UCHAR Reserved;         /* Reserved */
-} __attribute__((packed)) MP_CONFIGURATION_TABLE, *PMP_CONFIGURATION_TABLE;
+} MP_CONFIGURATION_TABLE, *PMP_CONFIGURATION_TABLE;
 
 /* MP Configuration Table Entries */
 #define MPCTE_PROCESSOR 0   /* One entry per processor */
@@ -66,7 +68,7 @@
 #define MPCTE_LINTSRC   4   /* One entry per system interrupt source */
 
 
-typedef struct __attribute__((packed)) _MP_CONFIGURATION_PROCESSOR
+typedef struct _MP_CONFIGURATION_PROCESSOR
 {
   UCHAR Type;         /* 0 */
   UCHAR ApicId;       /* Local APIC ID for the processor */
@@ -75,17 +77,16 @@
   ULONG CpuSignature; /* CPU signature */
   ULONG FeatureFlags; /* CPUID feature value */
   ULONG Reserved[2];  /* Reserved (0) */
-} __attribute__((packed)) MP_CONFIGURATION_PROCESSOR, 
-  *PMP_CONFIGURATION_PROCESSOR;
+}  MP_CONFIGURATION_PROCESSOR, *PMP_CONFIGURATION_PROCESSOR;
 
 
 
-typedef struct __attribute__((packed)) _MP_CONFIGURATION_BUS
+typedef struct  _MP_CONFIGURATION_BUS
 {
 	UCHAR Type;         /* 1 */
 	UCHAR BusId;        /* Bus ID */
 	CHAR BusType[6];   /* Bus type */
-} __attribute__((packed)) MP_CONFIGURATION_BUS, *PMP_CONFIGURATION_BUS;
+}  MP_CONFIGURATION_BUS, *PMP_CONFIGURATION_BUS;
 
 #define MAX_BUS 32
 
@@ -114,21 +115,21 @@
 #define BUSTYPE_XPRESS	"XPRESS"
 
 
-typedef struct __attribute__((packed)) _MP_CONFIGURATION_IOAPIC
+typedef struct _MP_CONFIGURATION_IOAPIC
 {
 	UCHAR Type;         /* 2 */
 	UCHAR ApicId;       /* I/O APIC ID */
 	UCHAR ApicVersion;  /* I/O APIC version */
 	UCHAR ApicFlags;    /* I/O APIC flags */
 	ULONG ApicAddress;  /* I/O APIC base address */
-} __attribute__((packed)) MP_CONFIGURATION_IOAPIC, *PMP_CONFIGURATION_IOAPIC;
+} MP_CONFIGURATION_IOAPIC, *PMP_CONFIGURATION_IOAPIC;
 
 #define MAX_IOAPIC  2
 
 #define MP_IOAPIC_USABLE  0x01
 
 
-typedef struct __attribute__((packed)) _MP_CONFIGURATION_INTSRC
+typedef struct _MP_CONFIGURATION_INTSRC
 {
 	UCHAR Type;         /* 3 */
 	UCHAR IrqType;      /* Interrupt type */
@@ -137,7 +138,7 @@
 	UCHAR SrcBusIrq;    /* Source bus interrupt */
 	UCHAR DstApicId;    /* Destination APIC ID */
 	UCHAR DstApicInt;   /* Destination interrupt */
-} __attribute__((packed)) MP_CONFIGURATION_INTSRC, *PMP_CONFIGURATION_INTSRC;
+}  MP_CONFIGURATION_INTSRC, *PMP_CONFIGURATION_INTSRC;
 
 #define MAX_IRQ_SOURCE  128
 
@@ -151,7 +152,7 @@
 #define IRQDIR_LOW      3
 
 
-typedef struct __attribute__((packed)) _MP_CONFIGURATION_INTLOCAL
+typedef struct _MP_CONFIGURATION_INTLOCAL
 {
 	UCHAR Type;         /* 4 */
 	UCHAR IrqType;      /* Interrupt type */
@@ -161,6 +162,7 @@
 	UCHAR DstApicId;    /* Destination local APIC ID */
 	UCHAR DstApicLInt;  /* Destination local APIC interrupt */
 } MP_CONFIGURATION_INTLOCAL, *PMP_CONFIGURATION_INTLOCAL;
+#include <poppack.h>
 
 #define MP_APIC_ALL	0xFF
   

Modified: trunk/reactos/include/ndk/iofuncs.h
--- trunk/reactos/include/ndk/iofuncs.h	2006-01-08 04:36:33 UTC (rev 20695)
+++ trunk/reactos/include/ndk/iofuncs.h	2006-01-08 06:23:17 UTC (rev 20696)
@@ -592,6 +592,7 @@
     IN ULONG Unknown2
 );
 
+#ifdef NTOS_MODE_USER
 NTSYSAPI
 NTSTATUS
 NTAPI
@@ -599,6 +600,7 @@
     IN HANDLE FileHandle,
     OUT PIO_STATUS_BLOCK IoStatusBlock
 );
+#endif
 
 NTSTATUS
 NTAPI
@@ -716,6 +718,7 @@
     IN BOOLEAN RestartScan
 );
 
+#ifdef NTOS_MODE_USER
 NTSTATUS
 NTAPI
 ZwQueryEaFile(
@@ -729,6 +732,7 @@
     IN PULONG EaIndex OPTIONAL,
     IN BOOLEAN RestartScan
 );
+#endif
 
 NTSTATUS
 NTAPI
@@ -837,6 +841,7 @@
     ULONG Unknown2
 );
 
+#ifdef NTOS_MODE_USER
 NTSTATUS
 NTAPI
 ZwSetEaFile(
@@ -845,6 +850,7 @@
     PVOID EaBuffer,
     ULONG EaBufferSize
 );
+#endif
 
 NTSYSCALLAPI
 NTSTATUS

Modified: trunk/reactos/include/ndk/mmtypes.h
--- trunk/reactos/include/ndk/mmtypes.h	2006-01-08 04:36:33 UTC (rev 20695)
+++ trunk/reactos/include/ndk/mmtypes.h	2006-01-08 06:23:17 UTC (rev 20696)
@@ -343,6 +343,20 @@
     ULONG GrowthSinceLastEstimate;
 } MMSUPPORT, *PMMSUPPORT;
 
+//
+// Memory Information Types
+//
+typedef struct _MEMORY_BASIC_INFORMATION
+{
+    PVOID BaseAddress;
+    PVOID AllocationBase;
+    ULONG AllocationProtect;
+    ULONG RegionSize;
+    ULONG State;
+    ULONG Protect;
+    ULONG Type;
+} MEMORY_BASIC_INFORMATION,*PMEMORY_BASIC_INFORMATION;
+
 #endif // !NTOS_MODE_USER
 
 #endif // _MMTYPES_H

Modified: trunk/reactos/ntoskrnl/cm/regfile.c
--- trunk/reactos/ntoskrnl/cm/regfile.c	2006-01-08 04:36:33 UTC (rev 20695)
+++ trunk/reactos/ntoskrnl/cm/regfile.c	2006-01-08 06:23:17 UTC (rev 20696)
@@ -848,7 +848,7 @@
   ULONG CreateDisposition;
   IO_STATUS_BLOCK IoSB;
   HANDLE FileHandle;
-  PSECTION_OBJECT SectionObject;
+  PVOID SectionObject;
   PUCHAR ViewBase;
   ULONG ViewSize;
   NTSTATUS Status;

Modified: trunk/reactos/ntoskrnl/include/internal/ke.h
--- trunk/reactos/ntoskrnl/include/internal/ke.h	2006-01-08 04:36:33 UTC (rev 20695)
+++ trunk/reactos/ntoskrnl/include/internal/ke.h	2006-01-08 06:23:17 UTC (rev 20696)
@@ -304,13 +304,6 @@
     ULONG IpiRequest
 );
 
-VOID
-NTAPI
-KeIpiGenericCall(
-    VOID (STDCALL *WorkerRoutine)(PVOID),
-    PVOID Argument
-);
-
 /* next file ***************************************************************/
 
 VOID 
@@ -480,14 +473,6 @@
     LARGE_INTEGER DueTime
 );
 
-BOOLEAN
-__inline
-FASTCALL
-KiIsObjectSignaled(
-    PDISPATCHER_HEADER Object,
-    PKTHREAD Thread
-);
-
 VOID
 FASTCALL
 KiWaitTest(
@@ -585,10 +570,6 @@
 FASTCALL
 KiWakeQueue(IN PKQUEUE Queue);
 
-PLIST_ENTRY
-STDCALL
-KeRundownQueue(IN PKQUEUE Queue);
-
 /* INITIALIZATION FUNCTIONS *************************************************/
 
 VOID

Modified: trunk/reactos/ntoskrnl/include/internal/mm.h
--- trunk/reactos/ntoskrnl/include/internal/mm.h	2006-01-08 04:36:33 UTC (rev 20695)
+++ trunk/reactos/ntoskrnl/include/internal/mm.h	2006-01-08 06:23:17 UTC (rev 20696)
@@ -205,7 +205,7 @@
         PMM_IMAGE_SECTION_OBJECT ImageSection;
         PMM_SECTION_SEGMENT Segment;
     };
-} SECTION_OBJECT;
+} SECTION_OBJECT, *PSECTION_OBJECT;
 
 typedef struct _MEMORY_AREA
 {
@@ -776,7 +776,7 @@
     PMM_SECTION_SEGMENT Segment,
     ULONG Offset,
     ULONG OpType,
-    BOOL First
+    BOOLEAN First
 );
 
 PMM_PAGEOP
@@ -892,7 +892,7 @@
 NTAPI
 MmSetDirtyAllRmaps(PFN_TYPE Page);
 
-BOOL
+BOOLEAN
 NTAPI
 MmIsDirtyPageRmap(PFN_TYPE Page);
 
@@ -1041,7 +1041,7 @@
 MmDisableVirtualMapping(
     PEPROCESS Process,
     PVOID Address,
-    BOOL* WasDirty,
+    BOOLEAN* WasDirty,
     PPFN_TYPE Page
 );
 
@@ -1203,8 +1203,8 @@
 MmDeleteVirtualMapping(
     PEPROCESS Process,
     PVOID Address,
-    BOOL FreePage,
-    BOOL* WasDirty,
+    BOOLEAN FreePage,
+    BOOLEAN* WasDirty,
     PPFN_TYPE Page
 );
 
@@ -1248,18 +1248,6 @@
     PULONG NrFreedPages
 );
 
-/* cont.c ********************************************************************/
-
-PVOID
-STDCALL
-MmAllocateContiguousMemorySpecifyCache(
-    IN SIZE_T NumberOfBytes,
-    IN PHYSICAL_ADDRESS LowestAcceptableAddress,
-    IN PHYSICAL_ADDRESS HighestAcceptableAddress,
-    IN PHYSICAL_ADDRESS BoundaryAddressMultiple OPTIONAL,
-    IN MEMORY_CACHING_TYPE CacheType OPTIONAL
-);
-
 /* region.c ************************************************************/
 
 NTSTATUS
@@ -1313,6 +1301,21 @@
 
 NTSTATUS
 NTAPI
+MmMapViewOfSection(
+    IN PVOID SectionObject,
+    IN PEPROCESS Process,
+    IN OUT PVOID *BaseAddress,
+    IN ULONG ZeroBits,
+    IN ULONG CommitSize,
+    IN OUT PLARGE_INTEGER SectionOffset OPTIONAL,
+    IN OUT PULONG ViewSize,
+    IN SECTION_INHERIT InheritDisposition,
+    IN ULONG AllocationType,
+    IN ULONG Protect
+);
+
+NTSTATUS
+NTAPI
 MmProtectSectionView(
     PMADDRESS_SPACE AddressSpace,
     PMEMORY_AREA MemoryArea,
@@ -1335,19 +1338,6 @@
 NTAPI
 MmInitSectionImplementation(VOID);
 
-NTSTATUS 
-STDCALL
-MmCreateSection(
-    OUT PSECTION_OBJECT *SectionObject,
-    IN ACCESS_MASK DesiredAccess,
-    IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL,
-    IN PLARGE_INTEGER MaximumSize,
-    IN ULONG SectionPageProtection,
-    IN ULONG AllocationAttributes,
-    IN HANDLE FileHandle OPTIONAL,
-    IN PFILE_OBJECT File OPTIONAL
-);
-
 NTSTATUS
 NTAPI
 MmNotPresentFaultSectionView(
@@ -1408,7 +1398,7 @@
 MiQueryVirtualMemory(
     IN HANDLE ProcessHandle,
     IN PVOID Address,
-    IN CINT VirtualMemoryInformationClass,
+    IN MEMORY_INFORMATION_CLASS VirtualMemoryInformationClass,
     OUT PVOID VirtualMemoryInformation,
     IN ULONG Length,
     OUT PULONG ResultLength

Modified: trunk/reactos/ntoskrnl/include/internal/rtl.h
--- trunk/reactos/ntoskrnl/include/internal/rtl.h	2006-01-08 04:36:33 UTC (rev 20695)
+++ trunk/reactos/ntoskrnl/include/internal/rtl.h	2006-01-08 06:23:17 UTC (rev 20696)
@@ -1,7 +1,7 @@
 #ifndef __NTOSKRNL_INCLUDE_INTERNAL_NLS_H
 #define __NTOSKRNL_INCLUDE_INTERNAL_NLS_H
 
-extern PSECTION_OBJECT NlsSectionObject;
+extern PVOID NlsSectionObject;
 
 extern ULONG NlsAnsiTableOffset;
 extern ULONG NlsOemTableOffset;

Modified: trunk/reactos/ntoskrnl/lpc/connect.c
--- trunk/reactos/ntoskrnl/lpc/connect.c	2006-01-08 04:36:33 UTC (rev 20695)
+++ trunk/reactos/ntoskrnl/lpc/connect.c	2006-01-08 06:23:17 UTC (rev 20696)
@@ -29,7 +29,7 @@
 NTSTATUS STDCALL
 EiConnectPort(IN PEPORT* ConnectedPort,
 	      IN PEPORT NamedPort,
-	      IN PSECTION_OBJECT Section,
+	      IN PVOID Section,
 	      IN LARGE_INTEGER SectionOffset,
 	      IN ULONG ViewSize,
 	      OUT PVOID* ClientSendViewBase,
@@ -252,7 +252,7 @@
   ULONG MaximumMessageSize;
   PVOID ConnectData = NULL;
   ULONG ConnectDataLength = 0;
-  PSECTION_OBJECT SectionObject;
+  PVOID SectionObject;
   LARGE_INTEGER SectionOffset;
   PEPORT ConnectedPort;
   KPROCESSOR_MODE PreviousMode;
@@ -775,7 +775,7 @@
    */
   if (WriteMap != NULL)
     {
-      PSECTION_OBJECT SectionObject;
+      PVOID SectionObject;
       LARGE_INTEGER SectionOffset;
 
       Status = ObReferenceObjectByHandle(WriteMap->SectionHandle,

Modified: trunk/reactos/ntoskrnl/mm/anonmem.c
--- trunk/reactos/ntoskrnl/mm/anonmem.c	2006-01-08 04:36:33 UTC (rev 20695)
+++ trunk/reactos/ntoskrnl/mm/anonmem.c	2006-01-08 06:23:17 UTC (rev 20696)
@@ -137,7 +137,7 @@
                        PMM_PAGEOP PageOp)
 {
    PFN_TYPE Page;
-   BOOL WasDirty;
+   BOOLEAN WasDirty;
    SWAPENTRY SwapEntry;
    NTSTATUS Status;
 

Modified: trunk/reactos/ntoskrnl/mm/i386/page.c
--- trunk/reactos/ntoskrnl/mm/i386/page.c	2006-01-08 04:36:33 UTC (rev 20695)
+++ trunk/reactos/ntoskrnl/mm/i386/page.c	2006-01-08 06:23:17 UTC (rev 20696)
@@ -796,7 +796,7 @@
 
 VOID
 NTAPI
-MmDisableVirtualMapping(PEPROCESS Process, PVOID Address, BOOL* WasDirty, PPFN_TYPE Page)
+MmDisableVirtualMapping(PEPROCESS Process, PVOID Address, BOOLEAN* WasDirty, PPFN_TYPE Page)
 /*
  * FUNCTION: Delete a virtual mapping
  */
@@ -916,8 +916,8 @@
 
 VOID
 NTAPI
-MmDeleteVirtualMapping(PEPROCESS Process, PVOID Address, BOOL FreePage,
-                       BOOL* WasDirty, PPFN_TYPE Page)
+MmDeleteVirtualMapping(PEPROCESS Process, PVOID Address, BOOLEAN FreePage,
+                       BOOLEAN* WasDirty, PPFN_TYPE Page)
 /*
  * FUNCTION: Delete a virtual mapping
  */

Modified: trunk/reactos/ntoskrnl/mm/marea.c
--- trunk/reactos/ntoskrnl/mm/marea.c	2006-01-08 04:36:33 UTC (rev 20695)
+++ trunk/reactos/ntoskrnl/mm/marea.c	2006-01-08 06:23:17 UTC (rev 20696)
@@ -767,7 +767,7 @@
       }
       else
       {
-         BOOL Dirty = FALSE;
+         BOOLEAN Dirty = FALSE;
          SWAPENTRY SwapEntry = 0;
          PFN_TYPE Page = 0;
 

Modified: trunk/reactos/ntoskrnl/mm/pageop.c
--- trunk/reactos/ntoskrnl/mm/pageop.c	2006-01-08 04:36:33 UTC (rev 20695)
+++ trunk/reactos/ntoskrnl/mm/pageop.c	2006-01-08 06:23:17 UTC (rev 20696)
@@ -136,7 +136,7 @@
 PMM_PAGEOP
 NTAPI
 MmGetPageOp(PMEMORY_AREA MArea, HANDLE Pid, PVOID Address,
-            PMM_SECTION_SEGMENT Segment, ULONG Offset, ULONG OpType, BOOL First)
+            PMM_SECTION_SEGMENT Segment, ULONG Offset, ULONG OpType, BOOLEAN First)
 /*
  * FUNCTION: Get a page operation descriptor corresponding to
  * the memory area and either the segment, offset pair or the

Modified: trunk/reactos/ntoskrnl/mm/rmap.c
--- trunk/reactos/ntoskrnl/mm/rmap.c	2006-01-08 04:36:33 UTC (rev 20695)
+++ trunk/reactos/ntoskrnl/mm/rmap.c	2006-01-08 06:23:17 UTC (rev 20696)
@@ -353,7 +353,7 @@
    ExReleaseFastMutex(&RmapListLock);
 }
 
-BOOL
+BOOLEAN
 NTAPI
 MmIsDirtyPageRmap(PFN_TYPE Page)
 {

Modified: trunk/reactos/ntoskrnl/mm/section.c
--- trunk/reactos/ntoskrnl/mm/section.c	2006-01-08 04:36:33 UTC (rev 20695)
+++ trunk/reactos/ntoskrnl/mm/section.c	2006-01-08 06:23:17 UTC (rev 20696)
@@ -1333,7 +1333,7 @@
 MmPageOutDeleteMapping(PVOID Context, PEPROCESS Process, PVOID Address)
 {
    MM_SECTION_PAGEOUT_CONTEXT* PageOutContext;
-   BOOL WasDirty;
+   BOOLEAN WasDirty;
    PFN_TYPE Page;
 
    PageOutContext = (MM_SECTION_PAGEOUT_CONTEXT*)Context;
@@ -2151,7 +2151,7 @@
                               OBJ_PERMANENT,
                               NULL,
                               NULL);
-   Status = MmCreateSection(&PhysSection,
+   Status = MmCreateSection((PVOID)&PhysSection,
                             SECTION_ALL_ACCESS,
                             &Obj,
                             &SectionSize,
@@ -3363,7 +3363,7 @@
                  IN HANDLE FileHandle OPTIONAL)
 {
    LARGE_INTEGER SafeMaximumSize;
-   PSECTION_OBJECT SectionObject;
+   PVOID SectionObject;
    KPROCESSOR_MODE PreviousMode;
    NTSTATUS Status = STATUS_SUCCESS;
 
@@ -4814,7 +4814,7 @@
  * @implemented
  */
 NTSTATUS STDCALL
-MmCreateSection (OUT PSECTION_OBJECT  * SectionObject,
+MmCreateSection (OUT PVOID  * Section,
                  IN ACCESS_MASK  DesiredAccess,
                  IN POBJECT_ATTRIBUTES ObjectAttributes     OPTIONAL,
                  IN PLARGE_INTEGER  MaximumSize,
@@ -4824,6 +4824,7 @@
                  IN PFILE_OBJECT  File      OPTIONAL)
 {
    ULONG Protection;
+   PSECTION_OBJECT *SectionObject = (PSECTION_OBJECT *)Section;
 
    /*
     * Check the protection

Modified: trunk/reactos/ntoskrnl/mm/virtual.c
--- trunk/reactos/ntoskrnl/mm/virtual.c	2006-01-08 04:36:33 UTC (rev 20695)
+++ trunk/reactos/ntoskrnl/mm/virtual.c	2006-01-08 06:23:17 UTC (rev 20696)
@@ -113,7 +113,7 @@
 NTSTATUS FASTCALL
 MiQueryVirtualMemory (IN HANDLE ProcessHandle,
                       IN PVOID Address,
-                      IN CINT VirtualMemoryInformationClass,
+                      IN MEMORY_INFORMATION_CLASS VirtualMemoryInformationClass,
                       OUT PVOID VirtualMemoryInformation,
                       IN ULONG Length,
                       OUT PULONG ResultLength)

Modified: trunk/reactos/ntoskrnl/rtl/nls.c
--- trunk/reactos/ntoskrnl/rtl/nls.c	2006-01-08 04:36:33 UTC (rev 20695)
+++ trunk/reactos/ntoskrnl/rtl/nls.c	2006-01-08 06:23:17 UTC (rev 20696)
@@ -33,7 +33,7 @@
 static PUSHORT NlsUnicodeCasemapTable = NULL;
 static ULONG NlsUnicodeCasemapTableSize = 0;
 
-PSECTION_OBJECT NlsSectionObject = NULL;
+PVOID NlsSectionObject = NULL;
 static PVOID NlsSectionBase = NULL;
 static ULONG NlsSectionViewSize = 0;
 

Modified: trunk/reactos/w32api/include/ddk/ntifs.h
--- trunk/reactos/w32api/include/ddk/ntifs.h	2006-01-08 04:36:33 UTC (rev 20695)
+++ trunk/reactos/w32api/include/ddk/ntifs.h	2006-01-08 06:23:17 UTC (rev 20696)
@@ -530,7 +530,6 @@
 typedef struct _KQUEUE                          *PKQUEUE;
 typedef struct _KTRAP_FRAME                     *PKTRAP_FRAME;
 typedef struct _OBJECT_DIRECTORY                *POBJECT_DIRECTORY;
-typedef struct _SECTION_OBJECT                  *PSECTION_OBJECT;
 typedef struct _SHARED_CACHE_MAP                *PSHARED_CACHE_MAP;
 typedef struct _VACB                            *PVACB;
 typedef struct _VAD_HEADER                      *PVAD_HEADER;
@@ -3423,21 +3422,6 @@
 
 #endif
 
-NTKERNELAPI
-NTSTATUS
-NTAPI
-MmMapViewOfSection (
-    IN PVOID                SectionObject,
-    IN PEPROCESS            Process,
-    IN OUT PVOID            *BaseAddress,
-    IN ULONG                ZeroBits,
-    IN ULONG                CommitSize,
-    IN OUT PLARGE_INTEGER   SectionOffset OPTIONAL,
-    IN OUT PULONG           ViewSize,
-    IN SECTION_INHERIT      InheritDisposition,
-    IN ULONG                AllocationType,
-    IN ULONG                Protect
-);
 
 NTKERNELAPI
 BOOLEAN

Modified: trunk/reactos/w32api/include/ddk/winddk.h
--- trunk/reactos/w32api/include/ddk/winddk.h	2006-01-08 04:36:33 UTC (rev 20695)
[truncated at 1000 lines; 85 more skipped]