From 6b0293b18b123cead8fbbaf652ad0265bd88d013 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Thu, 20 Jun 2019 10:15:26 +0200 Subject: [PATCH] Distinguish NDIS_STATUS and NTSTATUS Signed-off-by: Simon Rozman --- wintun.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/wintun.c b/wintun.c index 9d746a4..015c732 100644 --- a/wintun.c +++ b/wintun.c @@ -573,9 +573,9 @@ static void TunSendNetBufferLists(NDIS_HANDLE MiniportAdapterContext, NET_BUFFER KIRQL irql = ExAcquireSpinLockShared(&ctx->TransitionLock); LONG flags = InterlockedGet(&ctx->Flags); NDIS_STATUS status; - if ((status = STATUS_NDIS_ADAPTER_REMOVED , !(flags & TUN_FLAGS_PRESENT)) || - (status = STATUS_NDIS_PAUSED , !(flags & TUN_FLAGS_RUNNING)) || - (status = STATUS_NDIS_MEDIA_DISCONNECTED, InterlockedGet64(&ctx->Device.RefCount) <= 0)) + if ((status = NDIS_STATUS_ADAPTER_REMOVED , !(flags & TUN_FLAGS_PRESENT)) || + (status = NDIS_STATUS_PAUSED , !(flags & TUN_FLAGS_RUNNING)) || + (status = NDIS_STATUS_MEDIA_DISCONNECTED, InterlockedGet64(&ctx->Device.RefCount) <= 0)) { TunSetNBLStatus(NetBufferLists, status); NdisMSendNetBufferListsComplete(ctx->MiniportAdapterHandle, NetBufferLists, NDIS_SEND_COMPLETE_FLAGS_DISPATCH_LEVEL); @@ -874,7 +874,7 @@ static NTSTATUS TunDispatch(DEVICE_OBJECT *DeviceObject, IRP *Irp) if (last_handle) { if (ctx->MiniportAdapterHandle) TunIndicateStatus(ctx->MiniportAdapterHandle, MediaConnectStateDisconnected); - TunQueueClear(ctx, STATUS_NDIS_MEDIA_DISCONNECTED); + TunQueueClear(ctx, NDIS_STATUS_MEDIA_DISCONNECTED); } IoReleaseRemoveLock(&ctx->Device.RemoveLock, stack->FileObject); @@ -920,7 +920,7 @@ static NDIS_STATUS TunPause(NDIS_HANDLE MiniportAdapterContext, PNDIS_MINIPORT_P KIRQL irql = ExAcquireSpinLockExclusive(&ctx->TransitionLock); InterlockedAnd(&ctx->Flags, ~TUN_FLAGS_RUNNING); ExReleaseSpinLockExclusive(&ctx->TransitionLock, irql); - TunQueueClear(ctx, STATUS_NDIS_PAUSED); + TunQueueClear(ctx, NDIS_STATUS_PAUSED); return TunCompletePause(ctx, FALSE); }