- Videoprt should only use the error codes provided in dderror.h, fix that. Also...
authorStefan Ginsberg <stefanginsberg@gmail.com>
Thu, 27 Nov 2008 20:05:12 +0000 (20:05 +0000)
committerStefan Ginsberg <stefanginsberg@gmail.com>
Thu, 27 Nov 2008 20:05:12 +0000 (20:05 +0000)
- Include dderror.h in vbemp/vgamp/xboxvmp too, and make sure vbemp gets its precious HIWORD/LOWORD

svn path=/trunk/; revision=37691

reactos/drivers/video/miniport/vbe/vbemp.c
reactos/drivers/video/miniport/vbe/vbemp.h
reactos/drivers/video/miniport/vga/vgamp.h
reactos/drivers/video/miniport/xboxvmp/xboxvmp.h
reactos/drivers/video/videoprt/interrupt.c
reactos/drivers/video/videoprt/resource.c
reactos/drivers/video/videoprt/services.c
reactos/drivers/video/videoprt/videoprt.c
reactos/drivers/video/videoprt/videoprt.h

index 72ab4f2..103fe07 100644 (file)
 
 #include "vbemp.h"
 
+#undef LOWORD
+#undef HIWORD
+#define LOWORD(l)      ((USHORT)((ULONG_PTR)(l)))
+#define HIWORD(l)      ((USHORT)(((ULONG_PTR)(l)>>16)&0xFFFF))
+
 /* PUBLIC AND PRIVATE FUNCTIONS ***********************************************/
 
 VP_STATUS STDCALL
index 0923340..b607309 100644 (file)
@@ -30,6 +30,7 @@
 #include <ntddk.h>
 #endif
 
+#include "dderror.h"
 #include "miniport.h"
 #include "ntddvdeo.h"
 #include "video.h"
index 3084dad..8c96e80 100644 (file)
@@ -30,6 +30,7 @@
 #include <ntddk.h>
 #endif
 
+#include "dderror.h"
 #include "miniport.h"
 #include "ntddvdeo.h"
 #include "video.h"
index 0357551..de8e28e 100644 (file)
@@ -33,6 +33,7 @@
 #include <ntddk.h>
 #endif
 
+#include "dderror.h"
 #include "miniport.h"
 #include "ntddvdeo.h"
 #include "video.h"
index f27bb84..46aee32 100644 (file)
@@ -123,7 +123,7 @@ VideoPortEnableInterrupt(IN PVOID HwDeviceExtension)
       0,
       DeviceExtension->InterruptLevel);
 
-   return Status ? NO_ERROR : ERROR_INVALID_ACCESS;
+   return Status ? NO_ERROR : ERROR_INVALID_PARAMETER;
 }
 
 /*
@@ -144,5 +144,5 @@ VideoPortDisableInterrupt(IN PVOID HwDeviceExtension)
       DeviceExtension->InterruptVector,
       0);
 
-   return Status ? NO_ERROR : ERROR_INVALID_ACCESS;
+   return Status ? NO_ERROR : ERROR_INVALID_PARAMETER;
 }
index 4341496..f967943 100644 (file)
@@ -332,7 +332,7 @@ VideoPortMapBankedMemory(
 {
    TRACE_(VIDEOPRT, "VideoPortMapBankedMemory\n");
    UNIMPLEMENTED;
-   return ERROR_CALL_NOT_IMPLEMENTED;
+   return ERROR_INVALID_FUNCTION;
 }
 
 
@@ -437,7 +437,7 @@ VideoPortGetAccessRanges(
 
             if (ReturnedLength != sizeof(PCI_COMMON_CONFIG))
             {
-               return ERROR_NO_SYSTEM_RESOURCES;
+               return ERROR_NOT_ENOUGH_MEMORY;
             }
          }
          else
@@ -504,7 +504,7 @@ VideoPortGetAccessRanges(
          DeviceExtension->AllocatedResources = AllocatedResources;
       }
       if (AllocatedResources == NULL)
-         return ERROR_NO_SYSTEM_RESOURCES;
+         return ERROR_NOT_ENOUGH_MEMORY;
 
       AssignedCount = 0;
       for (FullList = AllocatedResources->List;
@@ -524,14 +524,14 @@ VideoPortGetAccessRanges(
                 AssignedCount >= NumAccessRanges)
             {
                WARN_(VIDEOPRT, "Too many access ranges found\n");
-               return ERROR_NO_SYSTEM_RESOURCES;
+               return ERROR_NOT_ENOUGH_MEMORY;
             }
             if (Descriptor->Type == CmResourceTypeMemory)
             {
                if (NumAccessRanges <= AssignedCount)
                {
                   WARN_(VIDEOPRT, "Too many access ranges found\n");
-                  return ERROR_NO_SYSTEM_RESOURCES;
+                  return ERROR_NOT_ENOUGH_MEMORY;
                }
                INFO_(VIDEOPRT, "Memory range starting at 0x%08x length 0x%08x\n",
                       Descriptor->u.Memory.Start.u.LowPart, Descriptor->u.Memory.Length);
@@ -667,7 +667,7 @@ VideoPortGetDeviceData(
 {
    TRACE_(VIDEOPRT, "VideoPortGetDeviceData\n");
    UNIMPLEMENTED;
-   return ERROR_CALL_NOT_IMPLEMENTED;
+   return ERROR_INVALID_FUNCTION;
 }
 
 /*
index 7b6b5e9..de326ae 100644 (file)
@@ -77,11 +77,11 @@ VideoPortQueryServices(
 
       case VideoPortServicesI2C:
           UNIMPLEMENTED;
-          return ERROR_CALL_NOT_IMPLEMENTED;
+          return ERROR_INVALID_FUNCTION;
 
       case VideoPortServicesHeadless:
          UNIMPLEMENTED;
-         return ERROR_CALL_NOT_IMPLEMENTED;
+         return ERROR_INVALID_FUNCTION;
 
       default:
          break;
index 636b712..cd24e74 100644 (file)
@@ -856,7 +856,7 @@ VideoPortGetRegistryParameters(
       UNIMPLEMENTED;
    }
 
-   return ERROR_SUCCESS;
+   return NO_ERROR;
 }
 
 /*
@@ -884,7 +884,7 @@ VideoPortSetRegistryParameters(
       ValueData,
       ValueLength);
 
-   if (Status != ERROR_SUCCESS)
+   if (Status != NO_ERROR)
      WARN_(VIDEOPRT, "VideoPortSetRegistryParameters error 0x%x\n", Status);
 
    return Status;
index 870092c..e249f00 100644 (file)
@@ -32,6 +32,8 @@
 #include <ntifs.h>
 #include <ndk/ntndk.h>
 #include <reactos/helper.h>
+#include <dderror.h>
+#include <windef.h>
 
 #include <debug.h>