win-pvdrivers

changeset 522:fe846ad6de4d

Dereference device_objects so that the driver can unload.
author James Harper <james.harper@bendigoit.com.au>
date Fri Dec 26 22:59:42 2008 +1100 (2008-12-26)
parents 2b7f8973a41b
children 331f861accf0
files xenpci/xenpci_pdo.c
line diff
     1.1 --- a/xenpci/xenpci_pdo.c	Thu Dec 25 23:36:19 2008 +1100
     1.2 +++ b/xenpci/xenpci_pdo.c	Fri Dec 26 22:59:42 2008 +1100
     1.3 @@ -968,7 +968,7 @@ XenConfig_MakeConfigPage(PDEVICE_OBJECT 
     1.4    //PXENPCI_DEVICE_DATA xpdd = xppdd->bus_fdo->DeviceExtension;
     1.5    PMDL mdl;
     1.6    PUCHAR ptr;
     1.7 -  PDEVICE_OBJECT curr;
     1.8 +  PDEVICE_OBJECT curr, prev;
     1.9    PDRIVER_OBJECT fdo_driver_object;
    1.10    PUCHAR fdo_driver_extension;
    1.11    
    1.12 @@ -986,10 +986,13 @@ XenConfig_MakeConfigPage(PDEVICE_OBJECT 
    1.13        if (fdo_driver_extension)
    1.14        {
    1.15          memcpy(ptr, fdo_driver_extension, PAGE_SIZE);
    1.16 +        ObDereferenceObject(curr);
    1.17          break;
    1.18        }
    1.19      }
    1.20 +    prev = curr;
    1.21      curr = IoGetLowerDeviceObject(curr);
    1.22 +    ObDereferenceObject(prev);
    1.23    }
    1.24    return mdl;
    1.25  }