From 7ac5c57d41ee33ae92498edb70f6ec7655e47b14 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Wed, 3 Jul 2019 12:15:48 +0200 Subject: [PATCH] Cleanup Signed-off-by: Simon Rozman --- wintun.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/wintun.c b/wintun.c index 3b878ab..5a3a7cd 100644 --- a/wintun.c +++ b/wintun.c @@ -1074,14 +1074,13 @@ TunDispatchPnP(DEVICE_OBJECT *DeviceObject, IRP *Irp) switch (Stack->MinorFunction) { case IRP_MN_QUERY_REMOVE_DEVICE: - case IRP_MN_SURPRISE_REMOVAL: { + case IRP_MN_SURPRISE_REMOVAL: InterlockedAnd(&Ctx->Flags, ~TUN_FLAGS_PRESENT); ExReleaseSpinLockExclusive( &Ctx->TransitionLock, ExAcquireSpinLockExclusive(&Ctx->TransitionLock)); /* Ensure above change is visible to all readers. */ TunQueueClear(Ctx, NDIS_STATUS_ADAPTER_REMOVED); break; - } case IRP_MN_CANCEL_REMOVE_DEVICE: InterlockedOr(&Ctx->Flags, TUN_FLAGS_PRESENT); @@ -1143,13 +1142,13 @@ TunInitializeEx( /* Register device first. Having only one device per adapter allows us to store * adapter context inside device extension. */ - WCHAR DeviceName[sizeof(L"\\Device\\" TUN_DEVICE_NAME "4294967295") / sizeof(WCHAR) + 1] = { 0 }; + WCHAR DeviceName[sizeof(L"\\Device\\" TUN_DEVICE_NAME L"4294967295") / sizeof(WCHAR) + 1] = { 0 }; UNICODE_STRING UnicodeDeviceName; TunInitUnicodeString(&UnicodeDeviceName, DeviceName); RtlUnicodeStringPrintf( &UnicodeDeviceName, L"\\Device\\" TUN_DEVICE_NAME, (ULONG)MiniportInitParameters->NetLuid.Info.NetLuidIndex); - WCHAR SymbolicName[sizeof(L"\\DosDevices\\" TUN_DEVICE_NAME "4294967295") / sizeof(WCHAR) + 1] = { 0 }; + WCHAR SymbolicName[sizeof(L"\\DosDevices\\" TUN_DEVICE_NAME L"4294967295") / sizeof(WCHAR) + 1] = { 0 }; UNICODE_STRING UnicodeSymbolicName; TunInitUnicodeString(&UnicodeSymbolicName, SymbolicName); RtlUnicodeStringPrintf(