win-pvdrivers

changeset 509:87aba6fc3a82

fixed problem under dump mode
author James Harper <james.harper@bendigoit.com.au>
date Tue Dec 23 14:28:30 2008 +1100 (2008-12-23)
parents c8824436c717
children d3e4b4d5606e
files xenvbd/xenvbd.c
line diff
     1.1 --- a/xenvbd/xenvbd.c	Tue Dec 23 14:28:02 2008 +1100
     1.2 +++ b/xenvbd/xenvbd.c	Tue Dec 23 14:28:30 2008 +1100
     1.3 @@ -1486,23 +1486,27 @@ DriverEntry(PDRIVER_OBJECT DriverObject,
     1.4    KdPrint((__DRIVER_NAME "     IRQL = %d\n", KeGetCurrentIrql()));
     1.5    KdPrint((__DRIVER_NAME "     DriverObject = %p\n", DriverObject));
     1.6  
     1.7 -  IoAllocateDriverObjectExtension(DriverObject, UlongToPtr(XEN_INIT_DRIVER_EXTENSION_MAGIC), PAGE_SIZE, &driver_extension);
     1.8 -  ptr = driver_extension;
     1.9 -  ADD_XEN_INIT_REQ(&ptr, XEN_INIT_TYPE_RUN, NULL, NULL);
    1.10 -  ADD_XEN_INIT_REQ(&ptr, XEN_INIT_TYPE_RING, "ring-ref", NULL);
    1.11 -  ADD_XEN_INIT_REQ(&ptr, XEN_INIT_TYPE_EVENT_CHANNEL_IRQ, "event-channel", NULL);
    1.12 -  ADD_XEN_INIT_REQ(&ptr, XEN_INIT_TYPE_READ_STRING_FRONT, "device-type", NULL);
    1.13 -  ADD_XEN_INIT_REQ(&ptr, XEN_INIT_TYPE_READ_STRING_BACK, "mode", NULL);
    1.14 -  ADD_XEN_INIT_REQ(&ptr, XEN_INIT_TYPE_READ_STRING_BACK, "sectors", NULL);
    1.15 -  ADD_XEN_INIT_REQ(&ptr, XEN_INIT_TYPE_READ_STRING_BACK, "sector-size", NULL);
    1.16 -  ADD_XEN_INIT_REQ(&ptr, XEN_INIT_TYPE_GRANT_ENTRIES, NULL, UlongToPtr(144));
    1.17 -  ADD_XEN_INIT_REQ(&ptr, XEN_INIT_TYPE_END, NULL, NULL);       
    1.18 -
    1.19    /* RegistryPath == NULL when we are invoked as a crash dump driver */
    1.20    if (!RegistryPath)
    1.21    {
    1.22      dump_mode = TRUE;
    1.23    }
    1.24 +  
    1.25 +  if (!dump_mode)
    1.26 +  {
    1.27 +    IoAllocateDriverObjectExtension(DriverObject, UlongToPtr(XEN_INIT_DRIVER_EXTENSION_MAGIC), PAGE_SIZE, &driver_extension);
    1.28 +    ptr = driver_extension;
    1.29 +    ADD_XEN_INIT_REQ(&ptr, XEN_INIT_TYPE_RUN, NULL, NULL);
    1.30 +    ADD_XEN_INIT_REQ(&ptr, XEN_INIT_TYPE_RING, "ring-ref", NULL);
    1.31 +    ADD_XEN_INIT_REQ(&ptr, XEN_INIT_TYPE_EVENT_CHANNEL_IRQ, "event-channel", NULL);
    1.32 +    ADD_XEN_INIT_REQ(&ptr, XEN_INIT_TYPE_READ_STRING_FRONT, "device-type", NULL);
    1.33 +    ADD_XEN_INIT_REQ(&ptr, XEN_INIT_TYPE_READ_STRING_BACK, "mode", NULL);
    1.34 +    ADD_XEN_INIT_REQ(&ptr, XEN_INIT_TYPE_READ_STRING_BACK, "sectors", NULL);
    1.35 +    ADD_XEN_INIT_REQ(&ptr, XEN_INIT_TYPE_READ_STRING_BACK, "sector-size", NULL);
    1.36 +    ADD_XEN_INIT_REQ(&ptr, XEN_INIT_TYPE_GRANT_ENTRIES, NULL, UlongToPtr(144));
    1.37 +    ADD_XEN_INIT_REQ(&ptr, XEN_INIT_TYPE_END, NULL, NULL);       
    1.38 +  }
    1.39 +
    1.40    RtlZeroMemory(&HwInitializationData, sizeof(HW_INITIALIZATION_DATA));
    1.41  
    1.42    HwInitializationData.HwInitializationDataSize = sizeof(HW_INITIALIZATION_DATA);