X-Git-Url: https://git.reactos.org/?p=reactos.git;a=blobdiff_plain;f=drivers%2Fnetwork%2Fndisuio%2Fmisc.c;h=07c342feab62ee9fa0d8bf4dac91a7891839b6f3;hp=e23432375c568aef68999aa022444754b4a91611;hb=81d8d54ecf9d61347f7ca21fe33f16db73695a06;hpb=93d3b91947258ece499d9489a3f7df0fea346116 diff --git a/drivers/network/ndisuio/misc.c b/drivers/network/ndisuio/misc.c index e23432375c5..07c342feab6 100644 --- a/drivers/network/ndisuio/misc.c +++ b/drivers/network/ndisuio/misc.c @@ -27,19 +27,8 @@ FindAdapterContextByName(PNDIS_STRING DeviceName) /* Check if the device name matches */ if (RtlEqualUnicodeString(&AdapterContext->DeviceName, DeviceName, TRUE)) { - KeAcquireSpinLockAtDpcLevel(&AdapterContext->Spinlock); - - /* Check that it's not being destroyed */ - if (AdapterContext->OpenCount > 0) - { - KeReleaseSpinLockFromDpcLevel(&AdapterContext->Spinlock); - KeReleaseSpinLock(&GlobalAdapterListLock, OldIrql); - return AdapterContext; - } - else - { - KeReleaseSpinLockFromDpcLevel(&Adaptercontext->Spinlock); - } + KeReleaseSpinLock(&GlobalAdapterListLock, OldIrql); + return AdapterContext; } CurrentEntry = CurrentEntry->Flink; @@ -50,24 +39,10 @@ FindAdapterContextByName(PNDIS_STRING DeviceName) } VOID -ReferenceAdapterContext(PNDISUIO_ADAPTER_CONTEXT AdapterContext, BOOLEAN Locked) +ReferenceAdapterContext(PNDISUIO_ADAPTER_CONTEXT AdapterContext) { - KIRQL OldIrql; - - /* Lock if needed */ - if (!Locked) - { - KeAcquireSpinLock(&AdapterContext->Spinlock, &OldIrql); - } - /* Increment the open count */ AdapterContext->OpenCount++; - - /* Unlock if needed */ - if (!Locked) - { - KeReleaseSpinLock(&AdapterContext->Spinlock, OldIrql); - } } VOID