Treat ReferenceCount as an atomic
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
parent
6fe055d0e8
commit
20586e37b2
2
wintun.c
2
wintun.c
@ -1467,7 +1467,7 @@ TunWaitForReferencesToDropToZero(_In_ DEVICE_OBJECT *DeviceObject)
|
||||
MaxTries = TotalTime / SleepTime
|
||||
};
|
||||
#pragma warning(suppress : 28175)
|
||||
for (int Try = 0; Try < MaxTries && DeviceObject->ReferenceCount; ++Try)
|
||||
for (INT Try = 0; Try < MaxTries && InterlockedGet(&DeviceObject->ReferenceCount); ++Try)
|
||||
NdisMSleep(SleepTime);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user