win-pvdrivers

changeset 907:ca56da6bd99a

KeInitializeCrashDumpHeader is only supported under Windows 2003. Fix for XP and 2K
author James Harper <james.harper@bendigoit.com.au>
date Fri Apr 15 20:05:40 2011 +1000 (2011-04-15)
parents 9be11a753ca2
children 2e723d8f17c0
files xenpci/xenpci.c
line diff
     1.1 --- a/xenpci/xenpci.c	Fri Apr 15 16:01:34 2011 +1000
     1.2 +++ b/xenpci/xenpci.c	Fri Apr 15 20:05:40 2011 +1000
     1.3 @@ -37,6 +37,8 @@ static EVT_WDF_DRIVER_DEVICE_ADD XenPci_
     1.4  static EVT_WDF_DEVICE_USAGE_NOTIFICATION XenPci_EvtDeviceUsageNotification;
     1.5  static EVT_WDF_DEVICE_PREPARE_HARDWARE XenHide_EvtDevicePrepareHardware;
     1.6  
     1.7 +#if (NTDDI_VERSION >= NTDDI_WS03SP1)
     1.8 +
     1.9  /* this is supposed to be defined in wdm.h, but isn't */
    1.10  NTSTATUS 
    1.11    KeInitializeCrashDumpHeader(
    1.12 @@ -46,6 +48,7 @@ NTSTATUS
    1.13      IN ULONG  BufferSize,
    1.14      OUT PULONG  BufferNeeded OPTIONAL
    1.15      );
    1.16 +#endif
    1.17  
    1.18  #define DUMP_TYPE_FULL 1
    1.19  
    1.20 @@ -689,8 +692,10 @@ DriverEntry(PDRIVER_OBJECT DriverObject,
    1.21    DECLARE_CONST_UNICODE_STRING(txt_always_patch_name, L"txt_patch_tpr_always");
    1.22    WDFSTRING wdf_system_start_options;
    1.23    UNICODE_STRING system_start_options;
    1.24 +#if (NTDDI_VERSION >= NTDDI_WS03SP1)  
    1.25    PVOID dump_page;
    1.26    ULONG dump_header_size;
    1.27 +#endif
    1.28    
    1.29    UNREFERENCED_PARAMETER(RegistryPath);
    1.30  
    1.31 @@ -704,10 +709,12 @@ DriverEntry(PDRIVER_OBJECT DriverObject,
    1.32  
    1.33    ASSERT(!balloon_mdl_head);
    1.34    balloon_mdl_head = XenPci_InitialBalloonDown();
    1.35 -    
    1.36 +
    1.37 +#if (NTDDI_VERSION >= NTDDI_WS03SP1)  
    1.38    dump_page = ExAllocatePoolWithTag(NonPagedPool, PAGE_SIZE, XENPCI_POOL_TAG);
    1.39    status = KeInitializeCrashDumpHeader(DUMP_TYPE_FULL, 0, dump_page, PAGE_SIZE, &dump_header_size);
    1.40    KdPrint((__DRIVER_NAME "     KeInitializeCrashDumpHeader status = %08x, size = %d\n", status, dump_header_size));
    1.41 +#endif
    1.42  
    1.43    /* again after enabling DbgPrint hooking */
    1.44    KdPrint((__DRIVER_NAME " " VER_FILEVERSION_STR "\n"));