Add extra ASSERT to check PoweredTransactionCount is 0 on power-on

Signed-off-by: Simon Rozman <simon@rozman.si>
This commit is contained in:
Simon Rozman 2019-04-03 03:45:16 +02:00
parent e7d5cdc4f0
commit b6056b95d3

View File

@ -1313,6 +1313,8 @@ static NDIS_STATUS TunOidSet(_Inout_ TUN_CTX *ctx, _Inout_ NDIS_OID_REQUEST *Oid
if (InterlockedCompareExchange((LONG *)&ctx->Power, TUN_POWER_RESUMING, TUN_POWER_SUSPENDED) != TUN_POWER_SUSPENDED)
return NDIS_STATUS_FAILURE;
ASSERT(!InterlockedGet64(&ctx->PoweredTransactionCount));
InterlockedExchange((LONG *)&ctx->Power, TUN_POWER_RUNNING);
}
return NDIS_STATUS_SUCCESS;