From bce44d30e4c61f3bb5460f3da0f990cac3384ec5 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Wed, 12 Jun 2019 15:26:19 +0200 Subject: [PATCH] Use more appropriate status when rejecting NBLs with no client connected Signed-off-by: Simon Rozman --- wintun.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wintun.c b/wintun.c index 5eb558b..3786dc4 100644 --- a/wintun.c +++ b/wintun.c @@ -166,7 +166,7 @@ static NTSTATUS TunCheckForPause(_Inout_ TUN_CTX *ctx) !(flags & TUN_FLAGS_PRESENT) ? STATUS_NDIS_ADAPTER_REMOVED : !(flags & TUN_FLAGS_POWERED) ? STATUS_NDIS_LOW_POWER_STATE : !(flags & TUN_FLAGS_ENABLED) ? STATUS_NDIS_PAUSED : - InterlockedGet64(&ctx->Device.RefCount) <= 0 ? NDIS_STATUS_SEND_ABORTED : + InterlockedGet64(&ctx->Device.RefCount) <= 0 ? STATUS_NDIS_MEDIA_DISCONNECTED : STATUS_SUCCESS; } @@ -852,7 +852,7 @@ static NTSTATUS TunDispatch(DEVICE_OBJECT *DeviceObject, IRP *Irp) if (last_handle) { if (ctx->MiniportAdapterHandle) TunIndicateStatus(ctx->MiniportAdapterHandle, MediaConnectStateDisconnected); - TunQueueClear(ctx, NDIS_STATUS_SEND_ABORTED); + TunQueueClear(ctx, STATUS_NDIS_MEDIA_DISCONNECTED); } IoReleaseRemoveLock(&ctx->Device.RemoveLock, stack->FileObject);