Reuse Device.RefCount value to prevent duplicate status indications
Signed-off-by: Simon Rozman <simon@rozman.si>
This commit is contained in:
parent
54ee02ae34
commit
e3dfeeb2be
2
wintun.c
2
wintun.c
@ -820,7 +820,7 @@ static NTSTATUS TunDispatchCreate(_Inout_ TUN_CTX *ctx, _Inout_ IRP *Irp)
|
||||
if (!NT_SUCCESS(status = IoAcquireRemoveLock(&ctx->Device.RemoveLock, stack->FileObject)))
|
||||
goto cleanup_ExReleaseSpinLockShared;
|
||||
|
||||
if (InterlockedIncrement64(&ctx->Device.RefCount) > 0)
|
||||
if (InterlockedIncrement64(&ctx->Device.RefCount) == 1)
|
||||
TunIndicateStatus(ctx->MiniportAdapterHandle, MediaConnectStateConnected);
|
||||
|
||||
status = STATUS_SUCCESS;
|
||||
|
Loading…
Reference in New Issue
Block a user