- Update to r53061
[reactos.git] / drivers / video / videoprt / agp.c
index 5d8dbce..54bef7d 100644 (file)
@@ -20,8 +20,6 @@
  */
 
 #include "videoprt.h"
-#include <initguid.h>
-#include <wdmguid.h>
 
 /* PRIVATE FUNCTIONS **********************************************************/
 
@@ -29,7 +27,7 @@ NTSTATUS
 IopInitiatePnpIrp(
   PDEVICE_OBJECT DeviceObject,
   PIO_STATUS_BLOCK IoStatusBlock,
-  ULONG MinorFunction,
+  UCHAR MinorFunction,
   PIO_STACK_LOCATION Stack OPTIONAL)
 {
   PDEVICE_OBJECT TopDeviceObject;
@@ -56,8 +54,8 @@ IopInitiatePnpIrp(
     IoStatusBlock);
 
   /* PNP IRPs are always initialized with a status code of
-     STATUS_NOT_IMPLEMENTED */
-  Irp->IoStatus.Status = STATUS_NOT_IMPLEMENTED;
+     STATUS_NOT_SUPPORTED */
+  Irp->IoStatus.Status = STATUS_NOT_SUPPORTED;
   Irp->IoStatus.Information = 0;
 
   IrpSp = IoGetNextIrpStackLocation(Irp);
@@ -275,7 +273,7 @@ IntAgpCommitVirtual(
    else /* ProcessHandle != NULL */
    {
       /* Release some virtual memory */
-      ULONG Size = Pages * PAGE_SIZE;
+      SIZE_T Size = Pages * PAGE_SIZE;
       ULONG OffsetInBytes = Offset * PAGE_SIZE;
       BaseAddress = (PVOID)((ULONG_PTR)VirtualMapping->MappedAddress +
                                        OffsetInBytes);
@@ -349,7 +347,7 @@ IntAgpFreeVirtual(
    else /* ProcessHandle != NULL */
    {
       /* Unmap the section view */
-      ULONG Size = Pages * PAGE_SIZE;
+      SIZE_T Size = Pages * PAGE_SIZE;
       ULONG OffsetInBytes = Offset * PAGE_SIZE;
       BaseAddress = (PVOID)((ULONG_PTR)VirtualMapping->MappedAddress +
                                        OffsetInBytes);
@@ -400,7 +398,7 @@ IntAgpReleaseVirtual(
    else /* ProcessHandle != NULL */
    {
       /* Release the allocated virtual memory */
-      ULONG Size = VirtualMapping->AgpMapping->NumberOfPages * PAGE_SIZE;
+      SIZE_T Size = VirtualMapping->AgpMapping->NumberOfPages * PAGE_SIZE;
       Status = ZwFreeVirtualMemory(VirtualMapping->ProcessHandle,
                                    &VirtualMapping->MappedAddress,
                                    &Size, MEM_RELEASE);
@@ -452,7 +450,7 @@ IntAgpReserveVirtual(
    else /* ProcessHandle != NULL */
    {
       /* Reserve memory for usermode */
-      ULONG Size = AgpMapping->NumberOfPages * PAGE_SIZE;
+      SIZE_T Size = AgpMapping->NumberOfPages * PAGE_SIZE;
       MappedAddress = NULL;
       Status = ZwAllocateVirtualMemory(ProcessHandle, &MappedAddress, 0, &Size,
                                        MEM_RESERVE, PAGE_NOACCESS);
@@ -507,10 +505,16 @@ IntAgpGetInterface(
    AgpBusInterface = &DeviceExtension->AgpInterface;
    AgpInterface = (PVIDEO_PORT_AGP_INTERFACE_2)Interface;
 
-   ASSERT((Interface->Version == VIDEO_PORT_AGP_INTERFACE_VERSION_2 &&
-           Interface->Size >= sizeof(VIDEO_PORT_AGP_INTERFACE_2)) ||
-          (Interface->Version == VIDEO_PORT_AGP_INTERFACE_VERSION_1 &&
-           Interface->Size >= sizeof(VIDEO_PORT_AGP_INTERFACE)));
+   ASSERT(Interface->Version == VIDEO_PORT_AGP_INTERFACE_VERSION_2 ||
+          Interface->Version == VIDEO_PORT_AGP_INTERFACE_VERSION_1);
+   if (Interface->Version == VIDEO_PORT_AGP_INTERFACE_VERSION_2)
+   {
+       ASSERT(Interface->Size >= sizeof(VIDEO_PORT_AGP_INTERFACE_2));
+   }
+   else if (Interface->Version == VIDEO_PORT_AGP_INTERFACE_VERSION_1)
+   {
+       ASSERT(Interface->Size >= sizeof(VIDEO_PORT_AGP_INTERFACE));
+   }
 
    if (DeviceExtension->NextDeviceObject == NULL)
    {