Build Generic HAL with w32api
Modified: trunk/reactos/hal/halx86/generic/adapter.c
Modified: trunk/reactos/hal/halx86/generic/beep.c
Modified: trunk/reactos/hal/halx86/generic/bus.c
Modified: trunk/reactos/hal/halx86/generic/display.c
Modified: trunk/reactos/hal/halx86/generic/dma.c
Modified: trunk/reactos/hal/halx86/generic/drive.c
Modified: trunk/reactos/hal/halx86/generic/enum.c
Modified: trunk/reactos/hal/halx86/generic/fmutex.c
Modified: trunk/reactos/hal/halx86/generic/generic.xml
Modified: trunk/reactos/hal/halx86/generic/halinit.c
Modified: trunk/reactos/hal/halx86/generic/ipi.c
Modified: trunk/reactos/hal/halx86/generic/irql.c
Modified: trunk/reactos/hal/halx86/generic/isa.c
Modified: trunk/reactos/hal/halx86/generic/kdbg.c
Modified: trunk/reactos/hal/halx86/generic/mca.c
Modified: trunk/reactos/hal/halx86/generic/misc.c
Modified: trunk/reactos/hal/halx86/generic/pci.c
Modified: trunk/reactos/hal/halx86/generic/portio.c
Modified: trunk/reactos/hal/halx86/generic/processor.c
Modified: trunk/reactos/hal/halx86/generic/reboot.c
Modified: trunk/reactos/hal/halx86/generic/resource.c
Modified: trunk/reactos/hal/halx86/generic/spinlock.c
Modified: trunk/reactos/hal/halx86/generic/sysbus.c
Modified: trunk/reactos/hal/halx86/generic/sysinfo.c
Modified: trunk/reactos/hal/halx86/generic/time.c
Modified: trunk/reactos/hal/halx86/generic/timer.c

Modified: trunk/reactos/hal/halx86/generic/adapter.c
--- trunk/reactos/hal/halx86/generic/adapter.c	2005-06-18 14:29:17 UTC (rev 16038)
+++ trunk/reactos/hal/halx86/generic/adapter.c	2005-06-18 14:29:31 UTC (rev 16039)
@@ -13,15 +13,11 @@
 
 /* INCLUDES *****************************************************************/
 
-#include <ddk/ntddk.h>
-#include <ddk/iotypes.h>
-#include <internal/ob.h>
-#include <internal/ps.h>
 #define NDEBUG
-#include <internal/debug.h>
 #include <hal.h>
 
 /* Hmm, needed for KDBG := 1. Why? */
+extern POBJECT_TYPE IMPORTED IoAdapterObjectType;
 #undef KeGetCurrentIrql
 
 /* FUNCTIONS *****************************************************************/

Modified: trunk/reactos/hal/halx86/generic/beep.c
--- trunk/reactos/hal/halx86/generic/beep.c	2005-06-18 14:29:17 UTC (rev 16038)
+++ trunk/reactos/hal/halx86/generic/beep.c	2005-06-18 14:29:31 UTC (rev 16039)
@@ -10,13 +10,10 @@
 
 /* INCLUDES *****************************************************************/
 
-#include <ddk/ntddk.h>
+#define NDEBUG
 #include <hal.h>
 
-#define NDEBUG
-#include <internal/debug.h>
 
-
 /* CONSTANTS *****************************************************************/
 
 #define TIMER2     0x42

Modified: trunk/reactos/hal/halx86/generic/bus.c
--- trunk/reactos/hal/halx86/generic/bus.c	2005-06-18 14:29:17 UTC (rev 16038)
+++ trunk/reactos/hal/halx86/generic/bus.c	2005-06-18 14:29:31 UTC (rev 16039)
@@ -15,13 +15,9 @@
 
 /* INCLUDES *****************************************************************/
 
-#include <ddk/ntddk.h>
+#define NDEBUG
 #include <hal.h>
-#include <bus.h>
 
-#define NDEBUG
-#include <internal/debug.h>
-
 /* GLOBALS *******************************************************************/
 
 #define TAG_BUS  TAG('B', 'U', 'S', 'H')

Modified: trunk/reactos/hal/halx86/generic/display.c
--- trunk/reactos/hal/halx86/generic/display.c	2005-06-18 14:29:17 UTC (rev 16038)
+++ trunk/reactos/hal/halx86/generic/display.c	2005-06-18 14:29:31 UTC (rev 16039)
@@ -121,9 +121,10 @@
  * since there is already support for them via the VideoPortInt10 routine.
  */
 
-#include <ddk/ntddk.h>
+#define NDEBUG
 #include <hal.h>
 
+
 #define SCREEN_SYNCHRONIZATION
 
 #define VGA_GRAPH_MEM 0xa0000

Modified: trunk/reactos/hal/halx86/generic/dma.c
--- trunk/reactos/hal/halx86/generic/dma.c	2005-06-18 14:29:17 UTC (rev 16038)
+++ trunk/reactos/hal/halx86/generic/dma.c	2005-06-18 14:29:31 UTC (rev 16039)
@@ -11,9 +11,7 @@
 
 /* INCLUDES *****************************************************************/
 
-#include <ddk/ntddk.h>
 #define NDEBUG
-#include <internal/debug.h>
 #include <hal.h>
 
 /* Adapters for each channel */

Modified: trunk/reactos/hal/halx86/generic/drive.c
--- trunk/reactos/hal/halx86/generic/drive.c	2005-06-18 14:29:17 UTC (rev 16038)
+++ trunk/reactos/hal/halx86/generic/drive.c	2005-06-18 14:29:31 UTC (rev 16039)
@@ -11,18 +11,19 @@
 
 /* INCLUDES *****************************************************************/
 
-#include <ddk/ntddk.h>
-#include <internal/debug.h>
+#define NDEBUG
+#include <hal.h>
 
 /* FUNCTIONS *****************************************************************/
 
 VOID STDCALL
-IoAssignDriveLetters(IN PLOADER_PARAMETER_BLOCK LoaderBlock,
+IoAssignDriveLetters(IN struct _LOADER_PARAMETER_BLOCK *LoaderBlock,
 		     IN PSTRING NtDeviceName,
 		     OUT PUCHAR NtSystemPath,
 		     OUT PSTRING NtSystemPathString)
 {
-  HalIoAssignDriveLetters(LoaderBlock,
+  /* FIXME FIXME FIXME FUCK SOMEONE FIXME*/
+  HalIoAssignDriveLetters(NULL,
 			  NtDeviceName,
 			  NtSystemPath,
 			  NtSystemPathString);

Modified: trunk/reactos/hal/halx86/generic/enum.c
--- trunk/reactos/hal/halx86/generic/enum.c	2005-06-18 14:29:17 UTC (rev 16038)
+++ trunk/reactos/hal/halx86/generic/enum.c	2005-06-18 14:29:31 UTC (rev 16039)
@@ -11,10 +11,8 @@
 
 /* INCLUDES *****************************************************************/
 
-#include <ddk/ntddk.h>
-
 #define NDEBUG
-#include <internal/debug.h>
+#include <hal.h>
 
 VOID
 HalpStartEnumerator (VOID)

Modified: trunk/reactos/hal/halx86/generic/fmutex.c
--- trunk/reactos/hal/halx86/generic/fmutex.c	2005-06-18 14:29:17 UTC (rev 16038)
+++ trunk/reactos/hal/halx86/generic/fmutex.c	2005-06-18 14:29:31 UTC (rev 16039)
@@ -12,10 +12,9 @@
 
 /* INCLUDES *****************************************************************/
 
-#include <ddk/ntddk.h>
+#define NDEBUG
+#include <hal.h>
 
-#include <internal/debug.h>
-
 /* FUNCTIONS *****************************************************************/
 
 #undef KeEnterCriticalRegion

Modified: trunk/reactos/hal/halx86/generic/generic.xml
--- trunk/reactos/hal/halx86/generic/generic.xml	2005-06-18 14:29:17 UTC (rev 16038)
+++ trunk/reactos/hal/halx86/generic/generic.xml	2005-06-18 14:29:31 UTC (rev 16039)
@@ -2,7 +2,8 @@
 	<include base="hal_generic">../include</include>
 	<include base="ntoskrnl">include</include>
 	<define name="_DISABLE_TIDENTS" />
-	<define name="__NTHAL__" />
+	<define name="__USE_W32API" />
+	<define name="_NTHAL_" />
 	<file>adapter.c</file>
 	<file>beep.c</file>
 	<file>bus.c</file>
@@ -28,7 +29,8 @@
 	<include base="hal_generic_up">../include</include>
 	<include base="ntoskrnl">include</include>
 	<define name="_DISABLE_TIDENTS" />
-	<define name="__NTHAL__" />
+	<define name="_NTHAL_" />
+	<define name="__USE_W32API" />
 	<file>ipi.c</file>
 	<file>irql.c</file>
 	<file>processor.c</file>
@@ -38,6 +40,7 @@
 	<include base="hal_generic_pc">../include</include>
 	<include base="ntoskrnl">include</include>
 	<define name="_DISABLE_TIDENTS" />
-	<define name="__NTHAL__" />
+	<define name="_NTHAL_" />
+	<define name="__USE_W32API" />
 	<file>display.c</file>
 </module>

Modified: trunk/reactos/hal/halx86/generic/halinit.c
--- trunk/reactos/hal/halx86/generic/halinit.c	2005-06-18 14:29:17 UTC (rev 16038)
+++ trunk/reactos/hal/halx86/generic/halinit.c	2005-06-18 14:29:31 UTC (rev 16039)
@@ -11,12 +11,9 @@
 
 /* INCLUDES *****************************************************************/
 
-#include <ddk/ntddk.h>
+#define NDEBUG
 #include <hal.h>
 
-#define NDEBUG
-#include <internal/debug.h>
-
 /* GLOBALS *****************************************************************/
 
 PVOID HalpZeroPageMapping = NULL;

Modified: trunk/reactos/hal/halx86/generic/ipi.c
--- trunk/reactos/hal/halx86/generic/ipi.c	2005-06-18 14:29:17 UTC (rev 16038)
+++ trunk/reactos/hal/halx86/generic/ipi.c	2005-06-18 14:29:31 UTC (rev 16039)
@@ -9,12 +9,9 @@
 
 /* INCLUDES *****************************************************************/
 
-#include <ddk/ntddk.h>
+#define NDEBUG
 #include <hal.h>
 
-#define NDEBUG
-#include <internal/debug.h>
-
 /* FUNCTIONS ****************************************************************/
 
 VOID STDCALL

Modified: trunk/reactos/hal/halx86/generic/irql.c
--- trunk/reactos/hal/halx86/generic/irql.c	2005-06-18 14:29:17 UTC (rev 16038)
+++ trunk/reactos/hal/halx86/generic/irql.c	2005-06-18 14:29:31 UTC (rev 16039)
@@ -9,16 +9,9 @@
 
 /* INCLUDES *****************************************************************/
 
-#include <ddk/ntddk.h>
-#include <internal/ob.h>
-#include <internal/ps.h>
-#include <ntos/minmax.h>
+#define NDEBUG
 #include <hal.h>
-#include <halirq.h>
 
-#define NDEBUG
-#include <internal/debug.h>
-
 /* GLOBALS ******************************************************************/
 
 /*
@@ -174,9 +167,9 @@
       return;
     }
   KeGetCurrentKPCR()->Irql = DISPATCH_LEVEL;
-  if (KeGetCurrentKPCR()->HalReserved[HAL_DPC_REQUEST])
+  if (((PKIPCR)KeGetCurrentKPCR())->HalReserved[HAL_DPC_REQUEST])
     {
-      KeGetCurrentKPCR()->HalReserved[HAL_DPC_REQUEST] = FALSE;
+      ((PKIPCR)KeGetCurrentKPCR())->HalReserved[HAL_DPC_REQUEST] = FALSE;
       KiDispatchInterrupt();
     }
   KeGetCurrentKPCR()->Irql = APC_LEVEL;
@@ -240,7 +233,7 @@
  *
  * NOTES
  */
-
+#undef KeLowerIrql
 VOID STDCALL
 KeLowerIrql (KIRQL NewIrql)
 {
@@ -303,6 +296,7 @@
  * NOTES
  *	Calls KfRaiseIrql
  */
+#undef KeRaiseIrql
 VOID STDCALL
 KeRaiseIrql (KIRQL	NewIrql,
 	     PKIRQL	OldIrql)
@@ -466,11 +460,11 @@
   switch (Request)
   {
     case APC_LEVEL:
-      KeGetCurrentKPCR()->HalReserved[HAL_APC_REQUEST] = TRUE;
+      ((PKIPCR)KeGetCurrentKPCR())->HalReserved[HAL_APC_REQUEST] = TRUE;
       break;
 
     case DISPATCH_LEVEL:
-      KeGetCurrentKPCR()->HalReserved[HAL_DPC_REQUEST] = TRUE;
+      ((PKIPCR)KeGetCurrentKPCR())->HalReserved[HAL_DPC_REQUEST] = TRUE;
       break;
       
     default:

Modified: trunk/reactos/hal/halx86/generic/isa.c
--- trunk/reactos/hal/halx86/generic/isa.c	2005-06-18 14:29:17 UTC (rev 16038)
+++ trunk/reactos/hal/halx86/generic/isa.c	2005-06-18 14:29:31 UTC (rev 16039)
@@ -11,12 +11,8 @@
 
 /* INCLUDES ***************************************************************/
 
-#include <ddk/ntddk.h>
-#include <bus.h>
-#include <halirq.h>
-
 #define NDEBUG
-#include <internal/debug.h>
+#include <hal.h>
 
 /* FUNCTIONS *****************************************************************/
 

Modified: trunk/reactos/hal/halx86/generic/kdbg.c
--- trunk/reactos/hal/halx86/generic/kdbg.c	2005-06-18 14:29:17 UTC (rev 16038)
+++ trunk/reactos/hal/halx86/generic/kdbg.c	2005-06-18 14:29:31 UTC (rev 16039)
@@ -12,10 +12,8 @@
 
 /* INCLUDES *****************************************************************/
 
-#include <ddk/ntddk.h>
-
 #define NDEBUG
-#include <internal/debug.h>
+#include <hal.h>
 
 
 #define DEFAULT_BAUD_RATE    19200

Modified: trunk/reactos/hal/halx86/generic/mca.c
--- trunk/reactos/hal/halx86/generic/mca.c	2005-06-18 14:29:17 UTC (rev 16038)
+++ trunk/reactos/hal/halx86/generic/mca.c	2005-06-18 14:29:31 UTC (rev 16039)
@@ -32,13 +32,9 @@
 
 /* INCLUDES *****************************************************************/
 
-#include <ddk/ntddk.h>
-#include <bus.h>
-
 #define NDEBUG
-#include <internal/debug.h>
+#include <hal.h>
 
-
 /* FUNCTIONS ****************************************************************/
 
 ULONG STDCALL

Modified: trunk/reactos/hal/halx86/generic/misc.c
--- trunk/reactos/hal/halx86/generic/misc.c	2005-06-18 14:29:17 UTC (rev 16038)
+++ trunk/reactos/hal/halx86/generic/misc.c	2005-06-18 14:29:31 UTC (rev 16039)
@@ -9,11 +9,9 @@
 
 /* INCLUDES *****************************************************************/
 
-#include <ddk/ntddk.h>
+#define NDEBUG
 #include <hal.h>
 
-#define NDEBUG
-#include <internal/debug.h>
 
 /* FUNCTIONS ****************************************************************/
 

Modified: trunk/reactos/hal/halx86/generic/pci.c
--- trunk/reactos/hal/halx86/generic/pci.c	2005-06-18 14:29:17 UTC (rev 16038)
+++ trunk/reactos/hal/halx86/generic/pci.c	2005-06-18 14:29:31 UTC (rev 16039)
@@ -18,17 +18,10 @@
 
 /* INCLUDES *****************************************************************/
 
-#include <ddk/ntddk.h>
-#include <bus.h>
-#include <halirq.h>
+#define NDEBUG
 #include <hal.h>
-#include <internal/ob.h>
-#include <internal/ps.h>
 
-#define NDEBUG
-#include <internal/debug.h>
 
-
 /* MACROS ******************************************************************/
 
 /* FIXME These are also defined in drivers/bus/pci/pcidef.h.
@@ -639,7 +632,7 @@
       if (0 != PciConfig.u.type0.BaseAddresses[Address])
 	{
 	  ResourceCount++;
-          Offset = offsetof(PCI_COMMON_CONFIG, u.type0.BaseAddresses[Address]);
+          Offset = FIELD_OFFSET(PCI_COMMON_CONFIG, u.type0.BaseAddresses[Address]);
 	  Status = WritePciConfigUlong((UCHAR)BusNumber, (UCHAR)SlotNumber, Offset, 0xffffffff);
 	  if (! NT_SUCCESS(Status))
 	    {

Modified: trunk/reactos/hal/halx86/generic/portio.c
--- trunk/reactos/hal/halx86/generic/portio.c	2005-06-18 14:29:17 UTC (rev 16038)
+++ trunk/reactos/hal/halx86/generic/portio.c	2005-06-18 14:29:31 UTC (rev 16039)
@@ -9,9 +9,9 @@
  *                  Created 18/10/99
  */
 
-#include <ddk/ntddk.h>
+#define NDEBUG
+#include <hal.h>
 
-
 /* FUNCTIONS ****************************************************************/
 
 /*

Modified: trunk/reactos/hal/halx86/generic/processor.c
--- trunk/reactos/hal/halx86/generic/processor.c	2005-06-18 14:29:17 UTC (rev 16038)
+++ trunk/reactos/hal/halx86/generic/processor.c	2005-06-18 14:29:31 UTC (rev 16039)
@@ -14,13 +14,9 @@
 
 /* INCLUDES *****************************************************************/
 
-#include <ddk/ntddk.h>
+#define NDEBUG
 #include <hal.h>
 
-#define NDEBUG
-#include <internal/debug.h>
-
-
 /* FUNCTIONS *****************************************************************/
 
 VOID STDCALL

Modified: trunk/reactos/hal/halx86/generic/reboot.c
--- trunk/reactos/hal/halx86/generic/reboot.c	2005-06-18 14:29:17 UTC (rev 16038)
+++ trunk/reactos/hal/halx86/generic/reboot.c	2005-06-18 14:29:31 UTC (rev 16039)
@@ -9,8 +9,7 @@
  *                  Created 11/10/99
  */
 
-
-#include <ddk/ntddk.h>
+#define NDEBUG
 #include <hal.h>
 
 

Modified: trunk/reactos/hal/halx86/generic/resource.c
--- trunk/reactos/hal/halx86/generic/resource.c	2005-06-18 14:29:17 UTC (rev 16038)
+++ trunk/reactos/hal/halx86/generic/resource.c	2005-06-18 14:29:31 UTC (rev 16039)
@@ -9,11 +9,9 @@
 
 /* INCLUDES *****************************************************************/
 
-#include <ddk/ntddk.h>
+#define NDEBUG
 #include <hal.h>
 
-#define NDEBUG
-#include <internal/debug.h>
 
 /* FUNCTIONS ****************************************************************/
 

Modified: trunk/reactos/hal/halx86/generic/spinlock.c
--- trunk/reactos/hal/halx86/generic/spinlock.c	2005-06-18 14:29:17 UTC (rev 16038)
+++ trunk/reactos/hal/halx86/generic/spinlock.c	2005-06-18 14:29:31 UTC (rev 16039)
@@ -17,17 +17,15 @@
 
 /* INCLUDES ****************************************************************/
 
-#include <ddk/ntddk.h>
-#include <internal/ob.h>
-#include <internal/ps.h>
+#define NDEBUG
+#include <hal.h>
 
-#include <internal/debug.h>
-
 /* Hmm, needed for KDBG := 1. Why? */
 #undef KeGetCurrentIrql
 
 /* FUNCTIONS ***************************************************************/
 
+#undef KeAcquireSpinLock
 VOID STDCALL
 KeAcquireSpinLock (
 	PKSPIN_LOCK	SpinLock,
@@ -56,6 +54,7 @@
   return OldIrql;
 }
 
+#undef KeReleaseSpinLock
 VOID STDCALL
 KeReleaseSpinLock (
 	PKSPIN_LOCK	SpinLock,

Modified: trunk/reactos/hal/halx86/generic/sysbus.c
--- trunk/reactos/hal/halx86/generic/sysbus.c	2005-06-18 14:29:17 UTC (rev 16038)
+++ trunk/reactos/hal/halx86/generic/sysbus.c	2005-06-18 14:29:31 UTC (rev 16039)
@@ -11,12 +11,8 @@
 
 /* INCLUDES *****************************************************************/
 
-#include <ddk/ntddk.h>
-#include <bus.h>
-#include <halirq.h>
-
 #define NDEBUG
-#include <internal/debug.h>
+#include <hal.h>
 
 
 /* FUNCTIONS ****************************************************************/

Modified: trunk/reactos/hal/halx86/generic/sysinfo.c
--- trunk/reactos/hal/halx86/generic/sysinfo.c	2005-06-18 14:29:17 UTC (rev 16038)
+++ trunk/reactos/hal/halx86/generic/sysinfo.c	2005-06-18 14:29:31 UTC (rev 16039)
@@ -10,12 +10,9 @@
 
 /* INCLUDES *****************************************************************/
 
-#include <ddk/ntddk.h>
+#define NDEBUG
 #include <hal.h>
-#include <bus.h>
 
-#define NDEBUG
-#include <internal/debug.h>
 
 
 /* FUNCTIONS ****************************************************************/

Modified: trunk/reactos/hal/halx86/generic/time.c
--- trunk/reactos/hal/halx86/generic/time.c	2005-06-18 14:29:17 UTC (rev 16038)
+++ trunk/reactos/hal/halx86/generic/time.c	2005-06-18 14:29:31 UTC (rev 16039)
@@ -8,13 +8,9 @@
 
 /* INCLUDES *****************************************************************/
 
-#include <ddk/ntddk.h>
-#include <string.h>
+#define NDEBUG
 #include <hal.h>
-#include <bus.h>
 
-#define NDEBUG
-#include <internal/debug.h>
 
 /* MACROS and CONSTANTS ******************************************************/
 

Modified: trunk/reactos/hal/halx86/generic/timer.c
--- trunk/reactos/hal/halx86/generic/timer.c	2005-06-18 14:29:17 UTC (rev 16038)
+++ trunk/reactos/hal/halx86/generic/timer.c	2005-06-18 14:29:31 UTC (rev 16039)
@@ -32,14 +32,9 @@
 
 /* INCLUDES ***************************************************************/
 
-#include <ddk/ntddk.h>
-#include <internal/ob.h>
-#include <internal/ps.h>
+#define NDEBUG
 #include <hal.h>
 
-#define NDEBUG
-#include <internal/debug.h>
-
 /* GLOBALS ******************************************************************/
 
 #define 	TMR_CTRL	0x43	/*	I/O for control		*/
@@ -127,7 +122,7 @@
 
 VOID STDCALL KeStallExecutionProcessor(ULONG Microseconds)
 {
-   PKPCR Pcr = KeGetCurrentKPCR();
+   PKIPCR Pcr = (PKIPCR)KeGetCurrentKPCR();
 
    if (Pcr->PrcbData.FeatureBits & X86_FEATURE_TSC)
    {
@@ -194,7 +189,7 @@
   ULONG i;
   ULONG calib_bit;
   ULONG CurCount;
-  PKPCR Pcr;
+  PKIPCR Pcr;
   LARGE_INTEGER StartCount, EndCount;
 
   if (UdelayCalibrated)
@@ -203,7 +198,7 @@
     }
 
   UdelayCalibrated = TRUE;
-  Pcr = KeGetCurrentKPCR();
+  Pcr = (PKIPCR)KeGetCurrentKPCR();
 
   /* Initialise timer interrupt with MILLISEC ms interval        */
   WRITE_PORT_UCHAR((PUCHAR) TMR_CTRL, TMR_SC0 | TMR_BOTH | TMR_MD2);  /* binary, mode 2, LSB/MSB, ch 0 */
@@ -319,14 +314,14 @@
  * RETURNS: The number of performance counter ticks since boot
  */
 {
-  PKPCR Pcr;
+  PKIPCR Pcr;
   LARGE_INTEGER Value;
   ULONG Flags;
 
   Ki386SaveFlags(Flags);
   Ki386DisableInterrupts();
 
-  Pcr = KeGetCurrentKPCR();
+  Pcr = (PKIPCR)KeGetCurrentKPCR();
 
   if (Pcr->PrcbData.FeatureBits & X86_FEATURE_TSC)
   {