Commit in reactos/drivers/video/videoprt on videoprt_pnp_14032004
dispatch.c+24-11.1.2.10 -> 1.1.2.11
interrupt.c+8-101.1.2.4 -> 1.1.2.5
resource.c+52-371.1.2.4 -> 1.1.2.5
timer.c+1-51.1.2.4 -> 1.1.2.5
videoprt.c+7-41.21.2.6 -> 1.21.2.7
videoprt.h+6-11.6.2.5 -> 1.6.2.6
+98-58
6 modified files
- Implemented handling of cleanup IRP.
- Fixed handling of interrupts (Never believe DDK!).
- Complete correctly the PnP IRPs.
- Fixed VideoPortGetAccessRanges to work more correctly with W2K+ drivers.

reactos/drivers/video/videoprt
dispatch.c 1.1.2.10 -> 1.1.2.11
diff -u -r1.1.2.10 -r1.1.2.11
--- dispatch.c	19 Mar 2004 17:37:55 -0000	1.1.2.10
+++ dispatch.c	19 Mar 2004 20:51:47 -0000	1.1.2.11
@@ -18,11 +18,13 @@
  * If not, write to the Free Software Foundation,
  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  *
- * $Id: dispatch.c,v 1.1.2.10 2004/03/19 17:37:55 navaraf Exp $
+ * $Id: dispatch.c,v 1.1.2.11 2004/03/19 20:51:47 navaraf Exp $
  */
 
 #include "videoprt.h"
 
+/* EXTERNAL FUNCTIONS *********************************************************/
+
 typedef PVOID PHAL_RESET_DISPLAY_PARAMETERS;
 VOID STDCALL HalAcquireDisplayOwnership(IN PHAL_RESET_DISPLAY_PARAMETERS ResetDisplayParameters);
 VOID STDCALL HalReleaseDisplayOwnership();
@@ -273,6 +275,10 @@
       case IRP_MN_STOP_DEVICE:
       case IRP_MN_QUERY_STOP_DEVICE:
       case IRP_MN_CANCEL_STOP_DEVICE:
+         Irp->IoStatus.Status = STATUS_SUCCESS;
+         Irp->IoStatus.Information = 0;
+         IoCompleteRequest(Irp, IO_NO_INCREMENT);
+
          return STATUS_SUCCESS;
    }
    
@@ -280,6 +286,23 @@
 }
 
 NTSTATUS STDCALL
+IntVideoPortDispatchCleanup(
+   IN PDEVICE_OBJECT DeviceObject,
+   IN PIRP Irp)
+{
+   PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension;
+
+   DeviceExtension = DeviceObject->DeviceExtension;
+   RtlFreeUnicodeString(&DeviceExtension->RegistryPath);
+
+   Irp->IoStatus.Status = STATUS_SUCCESS;
+   Irp->IoStatus.Information = 0;
+   IoCompleteRequest(Irp, IO_NO_INCREMENT);
+
+   return STATUS_SUCCESS;
+}
+
+NTSTATUS STDCALL
 IntVideoPortDispatchPower(
    IN PDEVICE_OBJECT DeviceObject,
    IN PIRP Irp)

reactos/drivers/video/videoprt
interrupt.c 1.1.2.4 -> 1.1.2.5
diff -u -r1.1.2.4 -r1.1.2.5
--- interrupt.c	19 Mar 2004 17:37:55 -0000	1.1.2.4
+++ interrupt.c	19 Mar 2004 20:51:47 -0000	1.1.2.5
@@ -18,7 +18,7 @@
  * If not, write to the Free Software Foundation,
  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  *
- * $Id: interrupt.c,v 1.1.2.4 2004/03/19 17:37:55 navaraf Exp $
+ * $Id: interrupt.c,v 1.1.2.5 2004/03/19 20:51:47 navaraf Exp $
  */
 
 #include "videoprt.h"
@@ -49,20 +49,18 @@
 
    DeviceExtension = (PVIDEO_PORT_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
 
-   if ((ConfigInfo->BusInterruptVector != 0 ||
-        ConfigInfo->BusInterruptLevel != 0) &&
-       DriverExtension->InitializationData.HwInterrupt != NULL)
+   if (ConfigInfo->BusInterruptVector == 0)
+      ConfigInfo->BusInterruptVector = DeviceExtension->InterruptVector;
+
+   if (ConfigInfo->BusInterruptLevel == 0)
+      ConfigInfo->BusInterruptLevel = DeviceExtension->InterruptLevel;
+
+   if (DriverExtension->InitializationData.HwInterrupt != NULL)
    {
       ULONG InterruptVector;
       KIRQL Irql;
       KAFFINITY Affinity;
 
-      if (ConfigInfo->BusInterruptVector == 0)
-         ConfigInfo->BusInterruptVector = DeviceExtension->InterruptVector;
-
-      if (ConfigInfo->BusInterruptLevel == 0)
-         ConfigInfo->BusInterruptLevel = DeviceExtension->InterruptLevel;
-
       InterruptVector = HalGetInterruptVector(
          ConfigInfo->AdapterInterfaceType,
          ConfigInfo->SystemIoBusNumber,

reactos/drivers/video/videoprt
resource.c 1.1.2.4 -> 1.1.2.5
diff -u -r1.1.2.4 -r1.1.2.5
--- resource.c	17 Mar 2004 20:16:22 -0000	1.1.2.4
+++ resource.c	19 Mar 2004 20:51:47 -0000	1.1.2.5
@@ -18,7 +18,7 @@
  * If not, write to the Free Software Foundation,
  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  *
- * $Id: resource.c,v 1.1.2.4 2004/03/17 20:16:22 navaraf Exp $
+ * $Id: resource.c,v 1.1.2.5 2004/03/19 20:51:47 navaraf Exp $
  */
 
 #include "videoprt.h"
@@ -234,6 +234,7 @@
 /*
  * @implemented
  */
+
 VP_STATUS STDCALL
 VideoPortMapMemory(
    IN PVOID HwDeviceExtension,
@@ -304,6 +305,7 @@
    USHORT VendorIdToFind;
    USHORT DeviceIdToFind;
    ULONG SlotIdToFind;
+   ULONG ReturnedLength;
 
    DPRINT("VideoPortGetAccessRanges\n");
 
@@ -312,57 +314,70 @@
    if (NumRequestedResources == 0 && 
        DeviceExtension->AdapterInterfaceType == PCIBus)
    {
-      VendorIdToFind = VendorId != NULL ? *(PUSHORT)VendorId : 0;
-      DeviceIdToFind = DeviceId != NULL ? *(PUSHORT)DeviceId : 0;
       if (DeviceExtension->PhysicalDeviceObject != NULL)
-         SlotIdToFind = DeviceExtension->SystemIoSlotNumber;
-      else
-         SlotIdToFind = Slot != NULL ? *Slot : 0;
-
-      DPRINT("Looking for VendorId 0x%04x DeviceId 0x%04x SlotId 0x%04x\n", 
-	     VendorIdToFind, DeviceIdToFind, SlotIdToFind);
-
-      PciSlotNumber.u.AsULONG = SlotIdToFind;
-
-      /*
-       * Search for the device id and vendor id on this bus.
-       */
-
-      for (FunctionNumber = 0; FunctionNumber < 8; FunctionNumber++)
       {
-         ULONG ReturnedLength;
+         PciSlotNumber.u.AsULONG = DeviceExtension->SystemIoSlotNumber;
 
-         DPRINT("- Function number: %d\n", FunctionNumber);
-         PciSlotNumber.u.bits.FunctionNumber = FunctionNumber;
          ReturnedLength = HalGetBusData(
             PCIConfiguration, 
             DeviceExtension->SystemIoBusNumber,
             PciSlotNumber.u.AsULONG,
             &Config,
             sizeof(PCI_COMMON_CONFIG));
-         DPRINT("- Length of data: %x\n", ReturnedLength);
-         if (ReturnedLength == sizeof(PCI_COMMON_CONFIG))
+
+         if (ReturnedLength != sizeof(PCI_COMMON_CONFIG))
          {
-            DPRINT("- Slot 0x%02x (Device %d Function %d) VendorId 0x%04x "
-                   "DeviceId 0x%04x\n",
-                   PciSlotNumber.u.AsULONG, 
-                   PciSlotNumber.u.bits.DeviceNumber,
-                   PciSlotNumber.u.bits.FunctionNumber,
-                   Config.VendorID,
-                   Config.DeviceID);
+            return ERROR_NO_SYSTEM_RESOURCES;
+         }
+      }
+      else
+      {
+         VendorIdToFind = VendorId != NULL ? *(PUSHORT)VendorId : 0;
+         DeviceIdToFind = DeviceId != NULL ? *(PUSHORT)DeviceId : 0;
+         SlotIdToFind = Slot != NULL ? *Slot : 0;
+         PciSlotNumber.u.AsULONG = SlotIdToFind;
+
+         DPRINT("Looking for VendorId 0x%04x DeviceId 0x%04x\n", 
+                VendorIdToFind, DeviceIdToFind);
+
+         /*
+          * Search for the device id and vendor id on this bus.
+          */
 
-            if ((VendorIdToFind == 0 || Config.VendorID == VendorIdToFind) &&
-                (DeviceIdToFind == 0 || Config.DeviceID == DeviceIdToFind))
+         for (FunctionNumber = 0; FunctionNumber < 8; FunctionNumber++)
+         {
+            DPRINT("- Function number: %d\n", FunctionNumber);
+            PciSlotNumber.u.bits.FunctionNumber = FunctionNumber;
+            ReturnedLength = HalGetBusData(
+               PCIConfiguration, 
+               DeviceExtension->SystemIoBusNumber,
+               PciSlotNumber.u.AsULONG,
+               &Config,
+               sizeof(PCI_COMMON_CONFIG));
+            DPRINT("- Length of data: %x\n", ReturnedLength);
+            if (ReturnedLength == sizeof(PCI_COMMON_CONFIG))
             {
-               break;
+               DPRINT("- Slot 0x%02x (Device %d Function %d) VendorId 0x%04x "
+                      "DeviceId 0x%04x\n",
+                      PciSlotNumber.u.AsULONG, 
+                      PciSlotNumber.u.bits.DeviceNumber,
+                      PciSlotNumber.u.bits.FunctionNumber,
+                      Config.VendorID,
+                      Config.DeviceID);
+
+               if ((VendorIdToFind == 0 || Config.VendorID == VendorIdToFind) &&
+                   (DeviceIdToFind == 0 || Config.DeviceID == DeviceIdToFind))
+               {
+                  break;
+               }
             }
          }
-      }
 
-      if (FunctionNumber == 8)
-      {
-         DPRINT("Didn't find device.\n");
-         return ERROR_NO_SYSTEM_RESOURCES;
+         if (FunctionNumber == 8)
+         {
+            DPRINT("Didn't find device.\n");
+            return ERROR_NO_SYSTEM_RESOURCES;
+         }
       }
 
       Status = HalAssignSlotResources(

reactos/drivers/video/videoprt
timer.c 1.1.2.4 -> 1.1.2.5
diff -u -r1.1.2.4 -r1.1.2.5
--- timer.c	19 Mar 2004 17:37:55 -0000	1.1.2.4
+++ timer.c	19 Mar 2004 20:51:47 -0000	1.1.2.5
@@ -18,7 +18,7 @@
  * If not, write to the Free Software Foundation,
  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  *
- * $Id: timer.c,v 1.1.2.4 2004/03/19 17:37:55 navaraf Exp $
+ * $Id: timer.c,v 1.1.2.5 2004/03/19 20:51:47 navaraf Exp $
  */
 
 #include "videoprt.h"
@@ -77,9 +77,7 @@
 VideoPortStartTimer(IN PVOID HwDeviceExtension)
 {
    DPRINT("VideoPortStartTimer\n");
-/*
    IoStartTimer(VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension)->FunctionalDeviceObject);
-*/
 }
 
 /*
@@ -90,7 +88,5 @@
 VideoPortStopTimer(IN PVOID HwDeviceExtension)
 {
    DPRINT("VideoPortStopTimer\n");
-/*
    IoStopTimer(VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension)->FunctionalDeviceObject);
-*/
 }

reactos/drivers/video/videoprt
videoprt.c 1.21.2.6 -> 1.21.2.7
diff -u -r1.21.2.6 -r1.21.2.7
--- videoprt.c	19 Mar 2004 17:37:55 -0000	1.21.2.6
+++ videoprt.c	19 Mar 2004 20:51:47 -0000	1.21.2.7
@@ -18,7 +18,7 @@
  * If not, write to the Free Software Foundation,
  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  *
- * $Id: videoprt.c,v 1.21.2.6 2004/03/19 17:37:55 navaraf Exp $
+ * $Id: videoprt.c,v 1.21.2.7 2004/03/19 20:51:47 navaraf Exp $
  */
 
 #include "videoprt.h"
@@ -349,6 +349,9 @@
          DeviceExtension->SystemIoBusNumber =
          ConfigInfo.SystemIoBusNumber = BusNumber;
 
+         RtlZeroMemory(&DeviceExtension->MiniPortDeviceExtension, 
+                       DriverExtension->InitializationData.HwDeviceExtensionSize);
+   
          /* FIXME: Need to figure out what string to pass as param 3. */
          Status = DriverExtension->InitializationData.HwFindAdapter(
             &DeviceExtension->MiniPortDeviceExtension,
@@ -637,9 +640,9 @@
 
 typedef struct QueryRegistryCallbackContext
 {
-  PVOID HwDeviceExtension;
-  PVOID HwContext;
-  PMINIPORT_GET_REGISTRY_ROUTINE HwGetRegistryRoutine;
+   PVOID HwDeviceExtension;
+   PVOID HwContext;
+   PMINIPORT_GET_REGISTRY_ROUTINE HwGetRegistryRoutine;
 } QUERY_REGISTRY_CALLBACK_CONTEXT, *PQUERY_REGISTRY_CALLBACK_CONTEXT;
 
 static NTSTATUS STDCALL

reactos/drivers/video/videoprt
videoprt.h 1.6.2.5 -> 1.6.2.6
diff -u -r1.6.2.5 -r1.6.2.6
--- videoprt.h	19 Mar 2004 17:37:55 -0000	1.6.2.5
+++ videoprt.h	19 Mar 2004 20:51:47 -0000	1.6.2.6
@@ -18,7 +18,7 @@
  * If not, write to the Free Software Foundation,
  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  *
- * $Id: videoprt.h,v 1.6.2.5 2004/03/19 17:37:55 navaraf Exp $
+ * $Id: videoprt.h,v 1.6.2.6 2004/03/19 20:51:47 navaraf Exp $
  */
 
 #ifndef VIDEOPRT_H
@@ -99,6 +99,11 @@
    IN PIRP Irp);
 
 NTSTATUS STDCALL
+IntVideoPortDispatchCleanup(
+   IN PDEVICE_OBJECT DeviceObject,
+   IN PIRP Irp);
+
+NTSTATUS STDCALL
 IntVideoPortDispatchDeviceControl(
    IN PDEVICE_OBJECT DeviceObject,
    IN PIRP Irp);
CVSspam 0.2.8