- Get xboxvmp to compile.
Modified: trunk/reactos/drivers/video/miniport/xboxvmp/xboxvmp.c
Modified: trunk/reactos/drivers/video/miniport/xboxvmp/xboxvmp.h

Modified: trunk/reactos/drivers/video/miniport/xboxvmp/xboxvmp.c
--- trunk/reactos/drivers/video/miniport/xboxvmp/xboxvmp.c	2006-01-07 22:36:56 UTC (rev 20678)
+++ trunk/reactos/drivers/video/miniport/xboxvmp/xboxvmp.c	2006-01-07 22:49:41 UTC (rev 20679)
@@ -135,9 +135,9 @@
    PVOID HwDeviceExtension,
    PVIDEO_REQUEST_PACKET RequestPacket)
 {
-  BOOL Result;
+  BOOLEAN Result;
 
-  RequestPacket->StatusBlock->Status = STATUS_UNSUCCESSFUL;
+  RequestPacket->StatusBlock->Status = ERROR_INVALID_PARAMETER;
 
   switch (RequestPacket->IoControlCode)
     {
@@ -230,13 +230,13 @@
 
       default:
         VideoPortDebugPrint(Warn, "XboxVmpStartIO 0x%x not implemented\n");
-        RequestPacket->StatusBlock->Status = STATUS_NOT_IMPLEMENTED;
+        RequestPacket->StatusBlock->Status = ERROR_INVALID_FUNCTION;
         return FALSE;
     }
 
   if (Result)
     {
-      RequestPacket->StatusBlock->Status = STATUS_SUCCESS;
+      RequestPacket->StatusBlock->Status = NO_ERROR;
     }
 
   return TRUE;
@@ -278,7 +278,7 @@
 {
   VideoPortDebugPrint(Error, "XboxVmpGetPowerState is not supported\n");
 
-  return ERROR_NOT_SUPPORTED;
+  return ERROR_INVALID_FUNCTION;
 }
 
 /*
@@ -295,7 +295,7 @@
 {
   VideoPortDebugPrint(Error, "XboxVmpSetPowerState not supported\n");
 
-  return ERROR_NOT_SUPPORTED;
+  return ERROR_INVALID_FUNCTION;
 }
 
 /*
@@ -304,7 +304,7 @@
  * Sets the adapter to the specified operating mode.
  */
 
-BOOL FASTCALL
+BOOLEAN FASTCALL
 XboxVmpSetCurrentMode(
    PXBOXVMP_DEVICE_EXTENSION DeviceExtension,
    PVIDEO_MODE RequestedMode,
@@ -327,7 +327,7 @@
  * at system boot.
  */
 
-BOOL FASTCALL
+BOOLEAN FASTCALL
 XboxVmpResetDevice(
    PXBOXVMP_DEVICE_EXTENSION DeviceExtension,
    PSTATUS_BLOCK StatusBlock)
@@ -344,7 +344,7 @@
  * space of the requestor.
  */
 
-BOOL FASTCALL
+BOOLEAN FASTCALL
 XboxVmpMapVideoMemory(
    PXBOXVMP_DEVICE_EXTENSION DeviceExtension,
    PVIDEO_MEMORY RequestedAddress,
@@ -356,13 +356,14 @@
   SYSTEM_BASIC_INFORMATION BasicInfo;
   ULONG Length;
 
+  /* FIXME: this should probably be done differently, without native API */
   StatusBlock->Information = sizeof(VIDEO_MEMORY_INFORMATION);
 
   FrameBuffer.u.HighPart = 0;
-  if (NT_SUCCESS(ZwQuerySystemInformation(SystemBasicInformation,
+  if (ZwQuerySystemInformation(SystemBasicInformation,
                                           (PVOID) &BasicInfo,
                                           sizeof(SYSTEM_BASIC_INFORMATION),
-                                          &Length)))
+                                          &Length) == NO_ERROR)
     {
       FrameBuffer.u.LowPart = BasicInfo.HighestPhysicalPageNumber * PAGE_SIZE;
     }
@@ -398,7 +399,7 @@
  * frame buffer and video RAM.
  */
 
-BOOL FASTCALL
+BOOLEAN FASTCALL
 XboxVmpUnmapVideoMemory(
    PXBOXVMP_DEVICE_EXTENSION DeviceExtension,
    PVIDEO_MEMORY VideoMemory,
@@ -418,7 +419,7 @@
  * buffer for an IOCTL_VIDEO_QUERY_AVAIL_MODES request.
  */
 
-BOOL FASTCALL
+BOOLEAN FASTCALL
 XboxVmpQueryNumAvailModes(
    PXBOXVMP_DEVICE_EXTENSION DeviceExtension,
    PVIDEO_NUM_MODES Modes,
@@ -430,7 +431,7 @@
   return TRUE;
 }
 
-static BOOL
+static BOOLEAN
 ReadfromSMBus(UCHAR Address, UCHAR bRegister, UCHAR Size, ULONG *Data_to_smbus)
 {
   int nRetriesToLive=50;
@@ -508,7 +509,7 @@
 }
 
 
-static BOOL
+static BOOLEAN
 I2CTransmitByteGetReturn(UCHAR bPicAddressI2cFormat, UCHAR bDataToWrite, ULONG *Return)
 {
   return ReadfromSMBus(bPicAddressI2cFormat, bDataToWrite, 1, Return);
@@ -520,7 +521,7 @@
  * Returns information about each video mode supported by the adapter.
  */
 
-BOOL FASTCALL
+BOOLEAN FASTCALL
 XboxVmpQueryAvailModes(
    PXBOXVMP_DEVICE_EXTENSION DeviceExtension,
    PVIDEO_MODE_INFORMATION VideoMode,
@@ -535,7 +536,7 @@
  * Returns information about current video mode.
  */
 
-BOOL FASTCALL
+BOOLEAN FASTCALL
 XboxVmpQueryCurrentMode(
    PXBOXVMP_DEVICE_EXTENSION DeviceExtension,
    PVIDEO_MODE_INFORMATION VideoMode,

Modified: trunk/reactos/drivers/video/miniport/xboxvmp/xboxvmp.h
--- trunk/reactos/drivers/video/miniport/xboxvmp/xboxvmp.h	2006-01-07 22:36:56 UTC (rev 20678)
+++ trunk/reactos/drivers/video/miniport/xboxvmp/xboxvmp.h	2006-01-07 22:49:41 UTC (rev 20679)
@@ -25,11 +25,35 @@
 
 /* INCLUDES *******************************************************************/
 
+#ifdef _MSC_VER
+#include "dderror.h"
+#include "devioctl.h"
+#define PAGE_SIZE 4096
+#else
 #include <ntddk.h>
-#include <miniport.h>
-#include <video.h>
-#include <ndk/exfuncs.h>
+#endif
 
+#include "miniport.h"
+#include "ntddvdeo.h"
+#include "video.h"
+
+/* FIXME: NDK not compatible with miniport drivers */
+#define SystemBasicInformation 0
+typedef struct _SYSTEM_BASIC_INFORMATION
+{
+    ULONG Reserved;
+    ULONG TimerResolution;
+    ULONG PageSize;
+    ULONG NumberOfPhysicalPages;
+    ULONG LowestPhysicalPageNumber;
+    ULONG HighestPhysicalPageNumber;
+    ULONG AllocationGranularity;
+    ULONG MinimumUserModeAddress;
+    ULONG MaximumUserModeAddress;
+    KAFFINITY ActiveProcessorsAffinityMask;
+    CCHAR NumberOfProcessors;
+} SYSTEM_BASIC_INFORMATION, *PSYSTEM_BASIC_INFORMATION;
+
 typedef struct
 {
   PHYSICAL_ADDRESS PhysControlStart;
@@ -72,49 +96,49 @@
    ULONG HwId,
    PVIDEO_POWER_MANAGEMENT VideoPowerControl);
 
-BOOL FASTCALL
+BOOLEAN FASTCALL
 XboxVmpSetCurrentMode(
    PXBOXVMP_DEVICE_EXTENSION DeviceExtension,
    PVIDEO_MODE RequestedMode,
    PSTATUS_BLOCK StatusBlock);
 
-BOOL FASTCALL
+BOOLEAN FASTCALL
 XboxVmpResetDevice(
    PXBOXVMP_DEVICE_EXTENSION DeviceExtension,
    PSTATUS_BLOCK StatusBlock);
 
-BOOL FASTCALL
+BOOLEAN FASTCALL
 XboxVmpMapVideoMemory(
    PXBOXVMP_DEVICE_EXTENSION DeviceExtension,
    PVIDEO_MEMORY RequestedAddress,
    PVIDEO_MEMORY_INFORMATION MapInformation,
    PSTATUS_BLOCK StatusBlock);
 
-BOOL FASTCALL
+BOOLEAN FASTCALL
 XboxVmpUnmapVideoMemory(
    PXBOXVMP_DEVICE_EXTENSION DeviceExtension,
    PVIDEO_MEMORY VideoMemory,
    PSTATUS_BLOCK StatusBlock);
 
-BOOL FASTCALL
+BOOLEAN FASTCALL
 XboxVmpQueryNumAvailModes(
    PXBOXVMP_DEVICE_EXTENSION DeviceExtension,
    PVIDEO_NUM_MODES Modes,
    PSTATUS_BLOCK StatusBlock);
 
-BOOL FASTCALL
+BOOLEAN FASTCALL
 XboxVmpQueryAvailModes(
    PXBOXVMP_DEVICE_EXTENSION DeviceExtension,
    PVIDEO_MODE_INFORMATION ReturnedModes,
    PSTATUS_BLOCK StatusBlock);
 
-BOOL FASTCALL
+BOOLEAN FASTCALL
 XboxVmpQueryCurrentMode(
    PXBOXVMP_DEVICE_EXTENSION DeviceExtension,
    PVIDEO_MODE_INFORMATION VideoModeInfo,
    PSTATUS_BLOCK StatusBlock);
 
-BOOL FASTCALL
+BOOLEAN FASTCALL
 XboxVmpSetColorRegisters(
    PXBOXVMP_DEVICE_EXTENSION DeviceExtension,
    PVIDEO_CLUT ColorLookUpTable,