win-pvdrivers

changeset 795:340f4430ab07 0.11.0.215

Fix compile error - XP doesn't support MmAllocatePagesForMdlEx
author James Harper <james.harper@bendigoit.com.au>
date Thu May 20 16:03:45 2010 +1000 (2010-05-20)
parents aee3767c191d
children 086eab4d57e3
files xenpci/xenpci_fdo.c
line diff
     1.1 --- a/xenpci/xenpci_fdo.c	Thu May 20 15:49:59 2010 +1000
     1.2 +++ b/xenpci/xenpci_fdo.c	Thu May 20 16:03:45 2010 +1000
     1.3 @@ -289,7 +289,7 @@ XenPci_BalloonThreadProc(PVOID StartCont
     1.4          ret = HYPERVISOR_memory_op(xpdd, XENMEM_populate_physmap, &reservation);
     1.5          ExFreePoolWithTag(pfns, XENPCI_POOL_TAG);
     1.6          KdPrint((__DRIVER_NAME "     populated %d pages\n", ret));
     1.7 -        /* TODO: what do we do if less than the required number of pages were populated??? */
     1.8 +        /* TODO: what do we do if less than the required number of pages were populated??? can this happen??? */
     1.9          
    1.10          MmFreePagesFromMdl(mdl);
    1.11          ExFreePool(mdl);
    1.12 @@ -307,7 +307,11 @@ XenPci_BalloonThreadProc(PVOID StartCont
    1.13          alloc_low.QuadPart = 0;
    1.14          alloc_high.QuadPart = 0xFFFFFFFFFFFFFFFFULL;
    1.15          alloc_skip.QuadPart = 0;
    1.16 +        #if (NTDDI_VERSION >= NTDDI_WS03SP1)
    1.17          mdl = MmAllocatePagesForMdlEx(alloc_low, alloc_high, alloc_skip, BALLOON_UNITS, MmCached, MM_DONT_ZERO_ALLOCATION);
    1.18 +        #else
    1.19 +        mdl = MmAllocatePagesForMdl(alloc_low, alloc_high, alloc_skip, BALLOON_UNITS);
    1.20 +        #endif
    1.21          if (!mdl)
    1.22          {
    1.23            KdPrint((__DRIVER_NAME "     Allocation failed - try again in 1 second\n"));