- PCHify vgamp.
- fix some definition problems.
- make it build with msvc.
Modified: trunk/reactos/drivers/video/miniport/vga/initvga.c
Modified: trunk/reactos/drivers/video/miniport/vga/vgamp.c
Modified: trunk/reactos/drivers/video/miniport/vga/vgamp.h
Modified: trunk/reactos/drivers/video/miniport/vga/vgamp.xml
Modified: trunk/reactos/drivers/video/miniport/vga/vgavideo.h

Modified: trunk/reactos/drivers/video/miniport/vga/initvga.c
--- trunk/reactos/drivers/video/miniport/vga/initvga.c	2006-01-07 22:03:31 UTC (rev 20676)
+++ trunk/reactos/drivers/video/miniport/vga/initvga.c	2006-01-07 22:34:25 UTC (rev 20677)
@@ -1,11 +1,5 @@
-#include <ntddk.h>
-#include <miniport.h>
-#include <video.h>
-#include "vgavideo.h"
+#include "vgamp.h"
 
-#define NDEBUG
-#include <debug.h>
-
 static VGA_REGISTERS Mode12Regs =
 {
    /* CRT Controller Registers */
@@ -24,10 +18,10 @@
 
 VGA_REGISTERS TextModeRegs;
 
-STATIC VOID FASTCALL
+static VOID FASTCALL
 vgaSaveRegisters(PVGA_REGISTERS Registers)
 {
-   UINT i;
+   SIZE_T i;
 
    for (i = 0; i < sizeof(Registers->CRT); i++)
    {
@@ -57,10 +51,10 @@
    Registers->Misc = VideoPortReadPortUchar(MISC);
 }
 
-STATIC VOID FASTCALL
+static VOID FASTCALL
 vgaSetRegisters(PVGA_REGISTERS Registers)
 {
-   UINT i;
+   SIZE_T i;
 
    /* Update misc output register */
    VideoPortWritePortUchar(MISC, Registers->Misc);

Modified: trunk/reactos/drivers/video/miniport/vga/vgamp.c
--- trunk/reactos/drivers/video/miniport/vga/vgamp.c	2006-01-07 22:03:31 UTC (rev 20676)
+++ trunk/reactos/drivers/video/miniport/vga/vgamp.c	2006-01-07 22:34:25 UTC (rev 20677)
@@ -72,7 +72,7 @@
 //  RETURNS:
 //    VP_STATUS
 
-static VP_STATUS STDCALL
+VP_STATUS STDCALL
 VGAFindAdapter(PVOID DeviceExtension,
                PVOID Context,
                PWSTR ArgumentString,
@@ -82,7 +82,7 @@
   /* FIXME: Determine if the adapter is present  */
   *Again = FALSE;
 
-  return  STATUS_SUCCESS;
+  return  NO_ERROR;
 
   /* FIXME: Claim any necessary memory/IO resources for the adapter  */
   /* FIXME: Map resources into system memory for the adapter  */
@@ -104,7 +104,7 @@
 //    PVOID  DeviceExtension
 //  RETURNS:
 //    BOOLEAN  Success or failure
-static BOOLEAN STDCALL
+BOOLEAN STDCALL
 VGAInitialize(PVOID DeviceExtension)
 {
   return  TRUE;
@@ -161,13 +161,13 @@
 //    BOOLEAN  This function must return TRUE, and complete the work or
 //             set an error status in the VRP.
 
-static BOOLEAN STDCALL
+BOOLEAN STDCALL
 VGAStartIO(PVOID DeviceExtension,
            PVIDEO_REQUEST_PACKET RequestPacket)
 {
-  BOOL Result;
+  BOOLEAN Result;
 
-  RequestPacket->StatusBlock->Status = STATUS_UNSUCCESSFUL;
+  RequestPacket->StatusBlock->Status = ERROR_INVALID_FUNCTION;
 
   switch (RequestPacket->IoControlCode)
     {
@@ -216,7 +216,8 @@
       break;
 
     case  IOCTL_VIDEO_RESET_DEVICE:
-      Result = VGAResetDevice(RequestPacket->StatusBlock);
+      VGAResetDevice(RequestPacket->StatusBlock);
+      Result = TRUE;
       break;
 
     case  IOCTL_VIDEO_SET_COLOR_REGISTERS:
@@ -275,7 +276,7 @@
                             RequestPacket->StatusBlock);
       break;
     case  IOCTL_VIDEO_SET_PALETTE_REGISTERS:
-      Result = VGASetPaletteRegisters((PWORD) RequestPacket->InputBuffer,
+      Result = VGASetPaletteRegisters((PUSHORT) RequestPacket->InputBuffer,
                              RequestPacket->StatusBlock);
       break;
 
@@ -318,12 +319,12 @@
 #endif
 
     default:
-      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;
 }
@@ -367,7 +368,7 @@
 //    BOOLEAN  TRUE if no further action is necessary, FALSE if the system
 //             needs to still do a BIOS int 10 reset.
 
-static BOOLEAN STDCALL
+BOOLEAN STDCALL
 VGAResetHw(PVOID DeviceExtension,
 	   ULONG Columns,
 	   ULONG Rows)
@@ -397,7 +398,7 @@
 
 #endif
 
-BOOL  VGAMapVideoMemory(IN PVOID DeviceExtension,
+BOOLEAN  VGAMapVideoMemory(IN PVOID DeviceExtension,
 			IN PVIDEO_MEMORY  RequestedAddress,
                         OUT PVIDEO_MEMORY_INFORMATION  MapInformation,
                         OUT PSTATUS_BLOCK  StatusBlock)
@@ -428,14 +429,14 @@
   return TRUE;
 }
 
-BOOL  VGAQueryAvailModes(OUT PVIDEO_MODE_INFORMATION  ReturnedModes,
+BOOLEAN  VGAQueryAvailModes(OUT PVIDEO_MODE_INFORMATION  ReturnedModes,
                          OUT PSTATUS_BLOCK  StatusBlock)
 {
   /* Only one mode exists in VGA (640x480), so use VGAQueryCurrentMode */
   return VGAQueryCurrentMode(ReturnedModes, StatusBlock);
 }
 
-BOOL  VGAQueryCurrentMode(OUT PVIDEO_MODE_INFORMATION  CurrentMode,
+BOOLEAN  VGAQueryCurrentMode(OUT PVIDEO_MODE_INFORMATION  CurrentMode,
                           OUT PSTATUS_BLOCK  StatusBlock)
 {
   CurrentMode->Length = sizeof(VIDEO_MODE_INFORMATION);
@@ -464,7 +465,7 @@
   return TRUE;
 }
 
-BOOL  VGAQueryNumAvailModes(OUT PVIDEO_NUM_MODES  NumberOfModes,
+BOOLEAN  VGAQueryNumAvailModes(OUT PVIDEO_NUM_MODES  NumberOfModes,
                             OUT PSTATUS_BLOCK  StatusBlock)
 {
   NumberOfModes->NumModes = 1;
@@ -473,7 +474,7 @@
   return TRUE;
 }
 
-BOOL  VGASetPaletteRegisters(IN PWORD  PaletteRegisters,
+BOOLEAN  VGASetPaletteRegisters(IN PUSHORT  PaletteRegisters,
                              OUT PSTATUS_BLOCK  StatusBlock)
 {
   ;
@@ -502,7 +503,7 @@
   return TRUE;
 }
 
-BOOL  VGASetColorRegisters(IN PVIDEO_CLUT  ColorLookUpTable,
+BOOLEAN  VGASetColorRegisters(IN PVIDEO_CLUT  ColorLookUpTable,
                            OUT PSTATUS_BLOCK  StatusBlock)
 {
   int i;
@@ -518,7 +519,7 @@
   return TRUE;
 }
 
-BOOL  VGASetCurrentMode(IN PVIDEO_MODE  RequestedMode,
+BOOLEAN  VGASetCurrentMode(IN PVIDEO_MODE  RequestedMode,
                         OUT PSTATUS_BLOCK  StatusBlock)
 {
   if(RequestedMode->RequestedMode == 12)
@@ -531,17 +532,17 @@
   }
 }
 
-BOOL  VGAShareVideoMemory(IN PVIDEO_SHARE_MEMORY  RequestedMemory,
+BOOLEAN  VGAShareVideoMemory(IN PVIDEO_SHARE_MEMORY  RequestedMemory,
                           OUT PVIDEO_MEMORY_INFORMATION  ReturnedMemory,
                           OUT PSTATUS_BLOCK  StatusBlock)
 {
   UNIMPLEMENTED;
 
-  StatusBlock->Status = STATUS_NOT_IMPLEMENTED;
+  StatusBlock->Status = ERROR_INVALID_FUNCTION;
   return FALSE;
 }
 
-BOOL  VGAUnmapVideoMemory(IN PVOID DeviceExtension,
+BOOLEAN  VGAUnmapVideoMemory(IN PVOID DeviceExtension,
 			  IN PVIDEO_MEMORY  MemoryToUnmap,
                           OUT PSTATUS_BLOCK  StatusBlock)
 {
@@ -553,11 +554,11 @@
     return FALSE;
 }
 
-BOOL  VGAUnshareVideoMemory(IN PVIDEO_MEMORY  MemoryToUnshare,
+BOOLEAN  VGAUnshareVideoMemory(IN PVIDEO_MEMORY  MemoryToUnshare,
                             OUT PSTATUS_BLOCK  StatusBlock)
 {
   UNIMPLEMENTED;
 
-  StatusBlock->Status = STATUS_NOT_IMPLEMENTED;
+  StatusBlock->Status = ERROR_INVALID_FUNCTION;
   return FALSE;
 }

Modified: trunk/reactos/drivers/video/miniport/vga/vgamp.h
--- trunk/reactos/drivers/video/miniport/vga/vgamp.h	2006-01-07 22:03:31 UTC (rev 20676)
+++ trunk/reactos/drivers/video/miniport/vga/vgamp.h	2006-01-07 22:34:25 UTC (rev 20677)
@@ -23,17 +23,25 @@
 
 /* INCLUDES *******************************************************************/
 
+#ifdef _MSC_VER
+#include "dderror.h"
+#include "devioctl.h"
+#else
 #include <ntddk.h>
-#include <miniport.h>
-#include <video.h>
+#endif
 
+#include "miniport.h"
+#include "ntddvdeo.h"
+#include "video.h"
+#include "vgavideo.h"
+
 #define UNIMPLEMENTED \
    VideoPortDebugPrint(Error, "WARNING:  %s at %s:%d is UNIMPLEMENTED!\n",__FUNCTION__,__FILE__,__LINE__);
 
 void
 InitVGAMode();
 
-static VP_STATUS STDCALL
+VP_STATUS STDCALL
 VGAFindAdapter(
    PVOID DeviceExtension,
    PVOID Context,
@@ -41,11 +49,11 @@
    PVIDEO_PORT_CONFIG_INFO ConfigInfo,
    PUCHAR Again);
 
-static BOOLEAN STDCALL
+BOOLEAN STDCALL
 VGAInitialize(
    PVOID DeviceExtension);
 
-static BOOLEAN STDCALL
+BOOLEAN STDCALL
 VGAStartIO(
    PVOID DeviceExtension,
    PVIDEO_REQUEST_PACKET RequestPacket);
@@ -53,7 +61,7 @@
 /*static BOOLEAN STDCALL
 VGAInterrupt(PVOID DeviceExtension);*/
 
-static BOOLEAN STDCALL
+BOOLEAN STDCALL
 VGAResetHw(
    PVOID DeviceExtension,
    ULONG Columns,
@@ -63,59 +71,59 @@
 VGATimer(PVOID DeviceExtension);*/
 
 /* Mandatory IoControl routines */
-BOOL
+BOOLEAN
 VGAMapVideoMemory(
    IN PVOID DeviceExtension,
    IN PVIDEO_MEMORY RequestedAddress,
    OUT PVIDEO_MEMORY_INFORMATION MapInformation,
    OUT PSTATUS_BLOCK StatusBlock);
 
-BOOL
+BOOLEAN
 VGAQueryAvailModes(
    OUT PVIDEO_MODE_INFORMATION ReturnedModes,
    OUT PSTATUS_BLOCK StatusBlock);
 
-BOOL
+BOOLEAN
 VGAQueryCurrentMode(
    OUT PVIDEO_MODE_INFORMATION CurrentMode,
    OUT PSTATUS_BLOCK StatusBlock);
 
-BOOL
+BOOLEAN
 VGAQueryNumAvailModes(
    OUT PVIDEO_NUM_MODES NumberOfModes,
    OUT PSTATUS_BLOCK StatusBlock);
 
-BOOL
+VOID
 VGAResetDevice(OUT PSTATUS_BLOCK StatusBlock);
 
-BOOL
+BOOLEAN
 VGASetColorRegisters(
    IN PVIDEO_CLUT ColorLookUpTable,
    OUT PSTATUS_BLOCK StatusBlock);
 
-BOOL
+BOOLEAN
 VGASetPaletteRegisters(
-   IN PWORD PaletteRegisters,
+   IN PUSHORT PaletteRegisters,
    OUT PSTATUS_BLOCK StatusBlock);
 
-BOOL
+BOOLEAN
 VGASetCurrentMode(
    IN PVIDEO_MODE RequestedMode,
    OUT PSTATUS_BLOCK StatusBlock);
 
-BOOL
+BOOLEAN
 VGAShareVideoMemory(
    IN PVIDEO_SHARE_MEMORY RequestedMemory,
    OUT PVIDEO_MEMORY_INFORMATION ReturnedMemory,
    OUT PSTATUS_BLOCK StatusBlock);
 
-BOOL
+BOOLEAN
 VGAUnmapVideoMemory(
    IN PVOID DeviceExtension,
    IN PVIDEO_MEMORY MemoryToUnmap,
    OUT PSTATUS_BLOCK StatusBlock);
 
-BOOL
+BOOLEAN
 VGAUnshareVideoMemory(
    IN PVIDEO_MEMORY MemoryToUnshare,
    OUT PSTATUS_BLOCK StatusBlock);

Modified: trunk/reactos/drivers/video/miniport/vga/vgamp.xml
--- trunk/reactos/drivers/video/miniport/vga/vgamp.xml	2006-01-07 22:03:31 UTC (rev 20676)
+++ trunk/reactos/drivers/video/miniport/vga/vgamp.xml	2006-01-07 22:34:25 UTC (rev 20677)
@@ -5,4 +5,5 @@
 	<file>initvga.c</file>
 	<file>vgamp.c</file>
 	<file>vgamp.rc</file>
+	<pch>vgamp.h</pch>
 </module>

Modified: trunk/reactos/drivers/video/miniport/vga/vgavideo.h
--- trunk/reactos/drivers/video/miniport/vga/vgavideo.h	2006-01-07 22:03:31 UTC (rev 20676)
+++ trunk/reactos/drivers/video/miniport/vga/vgavideo.h	2006-01-07 22:34:25 UTC (rev 20677)
@@ -1,5 +1,3 @@
-#include <ntddk.h>
-#include <ntddvdeo.h>
 
 #define VGA_NORMAL 0
 #define VGA_AND    8