Assert that adapter is always running when client is registering rings
By attaching to NDIS device instead of creating our own device for I/O, the adapter is always running before client is able to connect and register rings. NDIS also won't allow adapter to pause with connected clients. Signed-off-by: Simon Rozman <simon@rozman.si>
This commit is contained in:
parent
7f49a66494
commit
999a6744db
2
wintun.c
2
wintun.c
@ -606,6 +606,8 @@ TunRegisterBuffers(_Inout_ TUN_CTX *Ctx, _Inout_ IRP *Irp)
|
||||
if (InterlockedCompareExchangePointer(&Ctx->Device.Owner, Stack->FileObject, NULL) != NULL)
|
||||
return STATUS_ALREADY_INITIALIZED;
|
||||
|
||||
ASSERT(InterlockedGet(&Ctx->Flags) & TUN_FLAGS_RUNNING);
|
||||
|
||||
TUN_REGISTER_RINGS *Rrb = Irp->AssociatedIrp.SystemBuffer;
|
||||
if (Status = STATUS_INVALID_PARAMETER, Stack->Parameters.DeviceIoControl.InputBufferLength != sizeof(*Rrb))
|
||||
goto cleanupResetOwner;
|
||||
|
Loading…
Reference in New Issue
Block a user