win-pvdrivers

diff xenpci/xenpci.c @ 800:1d06ba3917d2

Unhook dbgprint on unload so we dont crash
author James Harper <james.harper@bendigoit.com.au>
date Thu Jun 24 12:51:23 2010 +1000 (2010-06-24)
parents eddfbeb4689f
children ff77e2f26a3e
line diff
     1.1 --- a/xenpci/xenpci.c	Sat May 22 20:39:27 2010 +1000
     1.2 +++ b/xenpci/xenpci.c	Thu Jun 24 12:51:23 2010 +1000
     1.3 @@ -388,7 +388,7 @@ VOID
     1.4  XenPci_HideQemuDevices()
     1.5  {
     1.6    WRITE_PORT_USHORT(XEN_IOPORT_DEVICE_MASK, (USHORT)qemu_hide_flags_value); //QEMU_UNPLUG_ALL_IDE_DISKS|QEMU_UNPLUG_ALL_NICS);
     1.7 -  KdPrint((__DRIVER_NAME "     Disabled qemu devices\n"));\
     1.8 +  KdPrint((__DRIVER_NAME "     Disabled qemu devices %02x\n", qemu_hide_flags_value));
     1.9  }
    1.10  
    1.11  static BOOLEAN
    1.12 @@ -540,6 +540,18 @@ XenPci_FixLoadOrder()
    1.13    return;
    1.14  }
    1.15  
    1.16 +EVT_WDF_DRIVER_UNLOAD EvtDriverUnload;
    1.17 +
    1.18 +VOID
    1.19 +XenPci_EvtDriverUnload(WDFDRIVER driver)
    1.20 +{
    1.21 +  UNREFERENCED_PARAMETER(driver);
    1.22 +  
    1.23 +  #if DBG
    1.24 +  XenPci_UnHookDbgPrint();
    1.25 +  #endif  
    1.26 +}
    1.27 +
    1.28  NTSTATUS
    1.29  DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath)
    1.30  {
    1.31 @@ -628,6 +640,7 @@ DriverEntry(PDRIVER_OBJECT DriverObject,
    1.32    }
    1.33    
    1.34    WDF_DRIVER_CONFIG_INIT(&config, XenPci_EvtDeviceAdd);
    1.35 +  config.EvtDriverUnload = XenPci_EvtDriverUnload;
    1.36    status = WdfDriverCreate(DriverObject, RegistryPath, WDF_NO_OBJECT_ATTRIBUTES, &config, &driver);
    1.37  
    1.38    WdfCollectionCreate(WDF_NO_OBJECT_ATTRIBUTES, &qemu_hide_devices);