[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [win-pv-devel] [PATCH] Fix missing imports for NTDDI < WIN7
Some APIs are used that are not available before Win7. Use preprocessor to substitute equivilent calls when NTDDI_VERSION is less than NTDDI_WIN7 Signed-off-by: Owen Smith <owen.smith@xxxxxxxxxx> --- src/xeniface/fdo.c | 13 +++++++++++++ src/xeniface/ioctl_evtchn.c | 9 +++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/xeniface/fdo.c b/src/xeniface/fdo.c index 71ffbe2..d6b006e 100644 --- a/src/xeniface/fdo.c +++ b/src/xeniface/fdo.c @@ -2385,7 +2385,11 @@ FdoCreate( if (!NT_SUCCESS(status)) goto fail14; +#if (NTDDI_VERSION >= NTDDI_WIN7) ProcessorCount = KeQueryMaximumProcessorCountEx(ALL_PROCESSOR_GROUPS); +#else // NTDDI_VISTA / NTDDI_VISTASP1 / NTDDI_WS08 + ProcessorCount = KeQueryMaximumProcessorCount(); +#endif status = STATUS_NO_MEMORY; Fdo->EvtchnDpc = __FdoAllocate(sizeof (KDPC) * ProcessorCount); @@ -2393,6 +2397,7 @@ FdoCreate( goto fail15; for (Index = 0; Index < ProcessorCount; Index++) { +#if (NTDDI_VERSION >= NTDDI_WIN7) PROCESSOR_NUMBER ProcNumber; status = KeGetProcessorNumberFromIndex(Index, &ProcNumber); @@ -2401,6 +2406,10 @@ FdoCreate( KeInitializeDpc(&Fdo->EvtchnDpc[Index], EvtchnNotificationDpc, NULL); status = KeSetTargetProcessorDpcEx(&Fdo->EvtchnDpc[Index], &ProcNumber); ASSERT(NT_SUCCESS(status)); +#else // NTDDI_VISTA / NTDDI_VISTASP1 / NTDDI_WS08 + KeInitializeDpc(&Fdo->EvtchnDpc[Index], EvtchnNotificationDpc, NULL); + KeSetTargetProcessorDpc(&Fdo->EvtchnDpc[Index], (CCHAR)Index); +#endif } Info("%p (%s)\n", @@ -2525,7 +2534,11 @@ FdoDestroy( Dx->Fdo = NULL; +#if (NTDDI_VERSION >= NTDDI_WIN7) ProcessorCount = KeQueryMaximumProcessorCountEx(ALL_PROCESSOR_GROUPS); +#else // NTDDI_VISTA / NTDDI_VISTASP1 / NTDDI_WS08 + ProcessorCount = KeQueryMaximumProcessorCount(); +#endif RtlZeroMemory(Fdo->EvtchnDpc, sizeof (KDPC) * ProcessorCount); __FdoFree(Fdo->EvtchnDpc); diff --git a/src/xeniface/ioctl_evtchn.c b/src/xeniface/ioctl_evtchn.c index 93f1931..1501157 100644 --- a/src/xeniface/ioctl_evtchn.c +++ b/src/xeniface/ioctl_evtchn.c @@ -51,7 +51,7 @@ EvtchnNotificationDpc( UNREFERENCED_PARAMETER(_Context); UNREFERENCED_PARAMETER(Argument2); - ASSERT(Context); + ASSERT(Context != NULL); #if DBG XenIfaceDebugPrint(INFO, "Channel %p, LocalPort %d, Cpu %lu\n", @@ -80,10 +80,15 @@ EvtchnInterruptHandler( ULONG ProcIndex; UNREFERENCED_PARAMETER(Interrupt); - ASSERT(Context); + ASSERT(Context != NULL); +#if (NTDD_VERSION >= NTDDI_WIN7) KeGetCurrentProcessorNumberEx(&ProcNumber); ProcIndex = KeGetProcessorIndexFromNumber(&ProcNumber); +#else // NTDDI_VISTA / NTDDI_VISTASP1 / NTDDI_WS08 + UNREFERENCED_PARAMETER(ProcNumber); // keep compiler happy + ProcIndex = KeGetCurrentProcessorNumber(); +#endif if (!KeInsertQueueDpc(&Context->Fdo->EvtchnDpc[ProcIndex], Context, NULL)) { XenIfaceDebugPrint(TRACE, "NOT INSERTED: Context %p, Port %lu, FO %p, Cpu %lu\n", Context, Context->LocalPort, Context->FileObject, ProcIndex); -- 1.9.4.msysgit.1 _______________________________________________ win-pv-devel mailing list win-pv-devel@xxxxxxxxxxxxxxxxxxxx http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |