- Make VBEMP compile with msvc/ddk.
authorAlex Ionescu <aionescu@gmail.com>
Sat, 7 Jan 2006 22:36:56 +0000 (22:36 +0000)
committerAlex Ionescu <aionescu@gmail.com>
Sat, 7 Jan 2006 22:36:56 +0000 (22:36 +0000)
svn path=/trunk/; revision=20678

reactos/drivers/video/miniport/vbe/vbemp.c
reactos/drivers/video/miniport/vbe/vbemp.h

index b3d3610..07c0b70 100644 (file)
@@ -110,7 +110,7 @@ VBESortModes(PVBE_DEVICE_EXTENSION DeviceExtension)
    ULONG Pos;
    int Result;
    VBE_MODEINFO TempModeInfo;
    ULONG Pos;
    int Result;
    VBE_MODEINFO TempModeInfo;
-   WORD TempModeNumber;
+   USHORT TempModeNumber;
 
    while (!Finished)
    {
 
    while (!Finished)
    {
@@ -301,7 +301,7 @@ VBEInitialize(PVOID HwDeviceExtension)
    VBEDeviceExtension->ModeInfo =
       VideoPortAllocatePool(HwDeviceExtension, VpPagedPool, ModeCount * sizeof(VBE_MODEINFO), TAG_VBE);
    VBEDeviceExtension->ModeNumbers =
    VBEDeviceExtension->ModeInfo =
       VideoPortAllocatePool(HwDeviceExtension, VpPagedPool, ModeCount * sizeof(VBE_MODEINFO), TAG_VBE);
    VBEDeviceExtension->ModeNumbers =
-      VideoPortAllocatePool(HwDeviceExtension, VpPagedPool, ModeCount * sizeof(WORD), TAG_VBE);
+      VideoPortAllocatePool(HwDeviceExtension, VpPagedPool, ModeCount * sizeof(USHORT), TAG_VBE);
 
    /*
     * Get the actual mode infos.
 
    /*
     * Get the actual mode infos.
@@ -404,9 +404,9 @@ VBEStartIO(
    PVOID HwDeviceExtension,
    PVIDEO_REQUEST_PACKET RequestPacket)
 {
    PVOID HwDeviceExtension,
    PVIDEO_REQUEST_PACKET RequestPacket)
 {
-   BOOL Result;
+   BOOLEAN Result;
 
 
-   RequestPacket->StatusBlock->Status = STATUS_UNSUCCESSFUL;
+   RequestPacket->StatusBlock->Status = ERROR_INVALID_FUNCTION;
 
    switch (RequestPacket->IoControlCode)
    {
 
    switch (RequestPacket->IoControlCode)
    {
@@ -507,12 +507,12 @@ VBEStartIO(
          break;
 
       default:
          break;
 
       default:
-         RequestPacket->StatusBlock->Status = STATUS_NOT_IMPLEMENTED;
+         RequestPacket->StatusBlock->Status = ERROR_INVALID_FUNCTION;
          return FALSE;
    }
 
    if (Result)
          return FALSE;
    }
 
    if (Result)
-      RequestPacket->StatusBlock->Status = STATUS_SUCCESS;
+      RequestPacket->StatusBlock->Status = NO_ERROR;
 
    return TRUE;
 }
 
    return TRUE;
 }
@@ -615,7 +615,7 @@ VBEGetPowerState(
       &BiosRegisters);
 
    if (BiosRegisters.Eax == VBE_NOT_SUPPORTED)
       &BiosRegisters);
 
    if (BiosRegisters.Eax == VBE_NOT_SUPPORTED)
-      return ERROR_NOT_SUPPORTED;
+      return ERROR_DEV_NOT_EXIST;
    if (BiosRegisters.Eax != VBE_SUCCESS)
       return ERROR_INVALID_FUNCTION;
 
    if (BiosRegisters.Eax != VBE_SUCCESS)
       return ERROR_INVALID_FUNCTION;
 
@@ -648,7 +648,7 @@ VBEGetPowerState(
       return NO_ERROR;
    }
 
       return NO_ERROR;
    }
 
-   return ERROR_NOT_SUPPORTED;
+   return ERROR_DEV_NOT_EXIST;
 }
 
 /*
 }
 
 /*
@@ -697,7 +697,7 @@ VBESetPowerState(
       &BiosRegisters);
 
    if (BiosRegisters.Eax == VBE_NOT_SUPPORTED)
       &BiosRegisters);
 
    if (BiosRegisters.Eax == VBE_NOT_SUPPORTED)
-      return ERROR_NOT_SUPPORTED;
+      return ERROR_DEV_NOT_EXIST;
    if (BiosRegisters.Eax != VBE_SUCCESS)
       return ERROR_INVALID_FUNCTION;
 
    if (BiosRegisters.Eax != VBE_SUCCESS)
       return ERROR_INVALID_FUNCTION;
 
@@ -710,7 +710,7 @@ VBESetPowerState(
  * Sets the adapter to the specified operating mode.
  */
 
  * Sets the adapter to the specified operating mode.
  */
 
-BOOL FASTCALL
+BOOLEAN FASTCALL
 VBESetCurrentMode(
    PVBE_DEVICE_EXTENSION DeviceExtension,
    PVIDEO_MODE RequestedMode,
 VBESetCurrentMode(
    PVBE_DEVICE_EXTENSION DeviceExtension,
    PVIDEO_MODE RequestedMode,
@@ -750,7 +750,7 @@ VBESetCurrentMode(
  * at system boot.
  */
 
  * at system boot.
  */
 
-BOOL FASTCALL
+BOOLEAN FASTCALL
 VBEResetDevice(
    PVBE_DEVICE_EXTENSION DeviceExtension,
    PSTATUS_BLOCK StatusBlock)
 VBEResetDevice(
    PVBE_DEVICE_EXTENSION DeviceExtension,
    PSTATUS_BLOCK StatusBlock)
@@ -774,7 +774,7 @@ VBEResetDevice(
  * space of the requestor.
  */
 
  * space of the requestor.
  */
 
-BOOL FASTCALL
+BOOLEAN FASTCALL
 VBEMapVideoMemory(
    PVBE_DEVICE_EXTENSION DeviceExtension,
    PVIDEO_MEMORY RequestedAddress,
 VBEMapVideoMemory(
    PVBE_DEVICE_EXTENSION DeviceExtension,
    PVIDEO_MEMORY RequestedAddress,
@@ -831,7 +831,7 @@ VBEMapVideoMemory(
  * frame buffer and video RAM.
  */
 
  * frame buffer and video RAM.
  */
 
-BOOL FASTCALL
+BOOLEAN FASTCALL
 VBEUnmapVideoMemory(
    PVBE_DEVICE_EXTENSION DeviceExtension,
    PVIDEO_MEMORY VideoMemory,
 VBEUnmapVideoMemory(
    PVBE_DEVICE_EXTENSION DeviceExtension,
    PVIDEO_MEMORY VideoMemory,
@@ -850,7 +850,7 @@ VBEUnmapVideoMemory(
  * buffer for an IOCTL_VIDEO_QUERY_AVAIL_MODES request.
  */
 
  * buffer for an IOCTL_VIDEO_QUERY_AVAIL_MODES request.
  */
 
-BOOL FASTCALL
+BOOLEAN FASTCALL
 VBEQueryNumAvailModes(
    PVBE_DEVICE_EXTENSION DeviceExtension,
    PVIDEO_NUM_MODES Modes,
 VBEQueryNumAvailModes(
    PVBE_DEVICE_EXTENSION DeviceExtension,
    PVIDEO_NUM_MODES Modes,
@@ -942,7 +942,7 @@ VBEQueryMode(
  * Returns information about each video mode supported by the adapter.
  */
 
  * Returns information about each video mode supported by the adapter.
  */
 
-BOOL FASTCALL
+BOOLEAN FASTCALL
 VBEQueryAvailModes(
    PVBE_DEVICE_EXTENSION DeviceExtension,
    PVIDEO_MODE_INFORMATION ReturnedModes,
 VBEQueryAvailModes(
    PVBE_DEVICE_EXTENSION DeviceExtension,
    PVIDEO_MODE_INFORMATION ReturnedModes,
@@ -972,7 +972,7 @@ VBEQueryAvailModes(
  * Returns information about current video mode.
  */
 
  * Returns information about current video mode.
  */
 
-BOOL FASTCALL
+BOOLEAN FASTCALL
 VBEQueryCurrentMode(
    PVBE_DEVICE_EXTENSION DeviceExtension,
    PVIDEO_MODE_INFORMATION VideoModeInfo,
 VBEQueryCurrentMode(
    PVBE_DEVICE_EXTENSION DeviceExtension,
    PVIDEO_MODE_INFORMATION VideoModeInfo,
@@ -997,7 +997,7 @@ VBEQueryCurrentMode(
  * yet implemented.
  */
 
  * yet implemented.
  */
 
-BOOL FASTCALL
+BOOLEAN FASTCALL
 VBESetColorRegisters(
    PVBE_DEVICE_EXTENSION DeviceExtension,
    PVIDEO_CLUT ColorLookUpTable,
 VBESetColorRegisters(
    PVBE_DEVICE_EXTENSION DeviceExtension,
    PVIDEO_CLUT ColorLookUpTable,
index 9c5edd9..52efd40 100644 (file)
 
 /* INCLUDES *******************************************************************/
 
 
 /* INCLUDES *******************************************************************/
 
+#ifdef _MSC_VER
+#include "dderror.h"
+#include "devioctl.h"
+#else
 #include <ntddk.h>
 #include <ntddk.h>
-#include <miniport.h>
-#include <video.h>
+#endif
+
+#include "miniport.h"
+#include "ntddvdeo.h"
+#include "video.h"
 
 #define TAG(A, B, C, D) (ULONG)(((A)<<0) + ((B)<<8) + ((C)<<16) + ((D)<<24))
 #define TAG_VBE TAG('V', 'B', 'E', ' ')
 
 #define TAG(A, B, C, D) (ULONG)(((A)<<0) + ((B)<<8) + ((C)<<16) + ((D)<<24))
 #define TAG_VBE TAG('V', 'B', 'E', ' ')
 typedef struct
 {
    CHAR Signature[4];
 typedef struct
 {
    CHAR Signature[4];
-   WORD Version;
-   DWORD OemStringPtr;
+   USHORT Version;
+   ULONG OemStringPtr;
    LONG Capabilities;
    LONG Capabilities;
-   DWORD VideoModePtr;
-   WORD TotalMemory;
-   WORD OemSoftwareRevision;
-   DWORD OemVendorNamePtr;
-   DWORD OemProductNamePtr;
-   DWORD OemProductRevPtr;
+   ULONG VideoModePtr;
+   USHORT TotalMemory;
+   USHORT OemSoftwareRevision;
+   ULONG OemVendorNamePtr;
+   ULONG OemProductNamePtr;
+   ULONG OemProductRevPtr;
    CHAR Reserved[222];
    CHAR OemData[256];
 } VBE_INFO, *PVBE_INFO;
    CHAR Reserved[222];
    CHAR OemData[256];
 } VBE_INFO, *PVBE_INFO;
@@ -112,58 +119,58 @@ typedef struct
 typedef struct
 {
    /* Mandatory information for all VBE revisions */
 typedef struct
 {
    /* Mandatory information for all VBE revisions */
-   WORD ModeAttributes;
-   BYTE WinAAttributes;
-   BYTE WinBAttributes;
-   WORD WinGranularity;
-   WORD WinSize;
-   WORD WinASegment;
-   WORD WinBSegment;
-   DWORD WinFuncPtr;
-   WORD BytesPerScanLine;
+   USHORT ModeAttributes;
+   UCHAR WinAAttributes;
+   UCHAR WinBAttributes;
+   USHORT WinGranularity;
+   USHORT WinSize;
+   USHORT WinASegment;
+   USHORT WinBSegment;
+   ULONG WinFuncPtr;
+   USHORT BytesPerScanLine;
 
    /* Mandatory information for VBE 1.2 and above */
 
    /* Mandatory information for VBE 1.2 and above */
-   WORD XResolution;
-   WORD YResolution;
-   BYTE XCharSize;
-   BYTE YCharSize;
-   BYTE NumberOfPlanes;
-   BYTE BitsPerPixel;
-   BYTE NumberOfBanks;
-   BYTE MemoryModel;
-   BYTE BankSize;
-   BYTE NumberOfImagePages;
-   BYTE Reserved1;
+   USHORT XResolution;
+   USHORT YResolution;
+   UCHAR XCharSize;
+   UCHAR YCharSize;
+   UCHAR NumberOfPlanes;
+   UCHAR BitsPerPixel;
+   UCHAR NumberOfBanks;
+   UCHAR MemoryModel;
+   UCHAR BankSize;
+   UCHAR NumberOfImagePages;
+   UCHAR Reserved1;
 
    /* Direct Color fields (required for Direct/6 and YUV/7 memory models) */
 
    /* Direct Color fields (required for Direct/6 and YUV/7 memory models) */
-   BYTE RedMaskSize;
-   BYTE RedFieldPosition;
-   BYTE GreenMaskSize;
-   BYTE GreenFieldPosition;
-   BYTE BlueMaskSize;
-   BYTE BlueFieldPosition;
-   BYTE ReservedMaskSize;
-   BYTE ReservedFieldPosition;
-   BYTE DirectColorModeInfo;
+   UCHAR RedMaskSize;
+   UCHAR RedFieldPosition;
+   UCHAR GreenMaskSize;
+   UCHAR GreenFieldPosition;
+   UCHAR BlueMaskSize;
+   UCHAR BlueFieldPosition;
+   UCHAR ReservedMaskSize;
+   UCHAR ReservedFieldPosition;
+   UCHAR DirectColorModeInfo;
 
    /* Mandatory information for VBE 2.0 and above */
 
    /* Mandatory information for VBE 2.0 and above */
-   DWORD PhysBasePtr;
-   DWORD Reserved2;
-   WORD Reserved3;
+   ULONG PhysBasePtr;
+   ULONG Reserved2;
+   USHORT Reserved3;
 
    /* Mandatory information for VBE 3.0 and above */
 
    /* Mandatory information for VBE 3.0 and above */
-   WORD LinBytesPerScanLine;
-   BYTE BnkNumberOfImagePages;
-   BYTE LinNumberOfImagePages;
-   BYTE LinRedMaskSize;
-   BYTE LinRedFieldPosition;
-   BYTE LinGreenMaskSize;
-   BYTE LinGreenFieldPosition;
-   BYTE LinBlueMaskSize;
-   BYTE LinBlueFieldPosition;
-   BYTE LinReservedMaskSize;
-   BYTE LinReservedFieldPosition;
-   DWORD MaxPixelClock;
+   USHORT LinBytesPerScanLine;
+   UCHAR BnkNumberOfImagePages;
+   UCHAR LinNumberOfImagePages;
+   UCHAR LinRedMaskSize;
+   UCHAR LinRedFieldPosition;
+   UCHAR LinGreenMaskSize;
+   UCHAR LinGreenFieldPosition;
+   UCHAR LinBlueMaskSize;
+   UCHAR LinBlueFieldPosition;
+   UCHAR LinReservedMaskSize;
+   UCHAR LinReservedFieldPosition;
+   ULONG MaxPixelClock;
 
    CHAR Reserved4[189];
 } VBE_MODEINFO, *PVBE_MODEINFO;
 
    CHAR Reserved4[189];
 } VBE_MODEINFO, *PVBE_MODEINFO;
@@ -184,9 +191,9 @@ typedef struct
 
    /* Saved information about video modes */
    ULONG ModeCount;
 
    /* Saved information about video modes */
    ULONG ModeCount;
-   WORD *ModeNumbers;
+   USHORT *ModeNumbers;
    PVBE_MODEINFO ModeInfo;
    PVBE_MODEINFO ModeInfo;
-   WORD CurrentMode;
+   USHORT CurrentMode;
 } VBE_DEVICE_EXTENSION, *PVBE_DEVICE_EXTENSION;
 
 VP_STATUS STDCALL
 } VBE_DEVICE_EXTENSION, *PVBE_DEVICE_EXTENSION;
 
 VP_STATUS STDCALL
@@ -223,49 +230,49 @@ VBESetPowerState(
    ULONG HwId,
    PVIDEO_POWER_MANAGEMENT VideoPowerControl);
 
    ULONG HwId,
    PVIDEO_POWER_MANAGEMENT VideoPowerControl);
 
-BOOL FASTCALL
+BOOLEAN FASTCALL
 VBESetCurrentMode(
    PVBE_DEVICE_EXTENSION DeviceExtension,
    PVIDEO_MODE RequestedMode,
    PSTATUS_BLOCK StatusBlock);
 
 VBESetCurrentMode(
    PVBE_DEVICE_EXTENSION DeviceExtension,
    PVIDEO_MODE RequestedMode,
    PSTATUS_BLOCK StatusBlock);
 
-BOOL FASTCALL
+BOOLEAN FASTCALL
 VBEResetDevice(
    PVBE_DEVICE_EXTENSION DeviceExtension,
    PSTATUS_BLOCK StatusBlock);
 
 VBEResetDevice(
    PVBE_DEVICE_EXTENSION DeviceExtension,
    PSTATUS_BLOCK StatusBlock);
 
-BOOL FASTCALL
+BOOLEAN FASTCALL
 VBEMapVideoMemory(
    PVBE_DEVICE_EXTENSION DeviceExtension,
    PVIDEO_MEMORY RequestedAddress,
    PVIDEO_MEMORY_INFORMATION MapInformation,
    PSTATUS_BLOCK StatusBlock);
 
 VBEMapVideoMemory(
    PVBE_DEVICE_EXTENSION DeviceExtension,
    PVIDEO_MEMORY RequestedAddress,
    PVIDEO_MEMORY_INFORMATION MapInformation,
    PSTATUS_BLOCK StatusBlock);
 
-BOOL FASTCALL
+BOOLEAN FASTCALL
 VBEUnmapVideoMemory(
    PVBE_DEVICE_EXTENSION DeviceExtension,
    PVIDEO_MEMORY VideoMemory,
    PSTATUS_BLOCK StatusBlock);
 
 VBEUnmapVideoMemory(
    PVBE_DEVICE_EXTENSION DeviceExtension,
    PVIDEO_MEMORY VideoMemory,
    PSTATUS_BLOCK StatusBlock);
 
-BOOL FASTCALL
+BOOLEAN FASTCALL
 VBEQueryNumAvailModes(
    PVBE_DEVICE_EXTENSION DeviceExtension,
    PVIDEO_NUM_MODES Modes,
    PSTATUS_BLOCK StatusBlock);
 
 VBEQueryNumAvailModes(
    PVBE_DEVICE_EXTENSION DeviceExtension,
    PVIDEO_NUM_MODES Modes,
    PSTATUS_BLOCK StatusBlock);
 
-BOOL FASTCALL
+BOOLEAN FASTCALL
 VBEQueryAvailModes(
    PVBE_DEVICE_EXTENSION DeviceExtension,
    PVIDEO_MODE_INFORMATION ReturnedModes,
    PSTATUS_BLOCK StatusBlock);
 
 VBEQueryAvailModes(
    PVBE_DEVICE_EXTENSION DeviceExtension,
    PVIDEO_MODE_INFORMATION ReturnedModes,
    PSTATUS_BLOCK StatusBlock);
 
-BOOL FASTCALL
+BOOLEAN FASTCALL
 VBEQueryCurrentMode(
    PVBE_DEVICE_EXTENSION DeviceExtension,
    PVIDEO_MODE_INFORMATION VideoModeInfo,
    PSTATUS_BLOCK StatusBlock);
 
 VBEQueryCurrentMode(
    PVBE_DEVICE_EXTENSION DeviceExtension,
    PVIDEO_MODE_INFORMATION VideoModeInfo,
    PSTATUS_BLOCK StatusBlock);
 
-BOOL FASTCALL
+BOOLEAN FASTCALL
 VBESetColorRegisters(
    PVBE_DEVICE_EXTENSION DeviceExtension,
    PVIDEO_CLUT ColorLookUpTable,
 VBESetColorRegisters(
    PVBE_DEVICE_EXTENSION DeviceExtension,
    PVIDEO_CLUT ColorLookUpTable,