Lines Matching refs:AdapterContext
20 PNDISUIO_ADAPTER_CONTEXT AdapterContext = ProtocolBindingContext; in NduOpenAdapterComplete() local
25 AdapterContext->AsyncStatus = Status; in NduOpenAdapterComplete()
26 KeSetEvent(&AdapterContext->AsyncEvent, IO_NO_INCREMENT, FALSE); in NduOpenAdapterComplete()
34 PNDISUIO_ADAPTER_CONTEXT AdapterContext = ProtocolBindingContext; in NduCloseAdapterComplete() local
39 AdapterContext->AsyncStatus = Status; in NduCloseAdapterComplete()
40 KeSetEvent(&AdapterContext->AsyncEvent, IO_NO_INCREMENT, FALSE); in NduCloseAdapterComplete()
110 PNDISUIO_ADAPTER_CONTEXT AdapterContext = ProtocolBindingContext; in NduSendComplete() local
115 AdapterContext->AsyncStatus = Status; in NduSendComplete()
116 KeSetEvent(&AdapterContext->AsyncEvent, IO_NO_INCREMENT, FALSE); in NduSendComplete()
126 PNDISUIO_ADAPTER_CONTEXT AdapterContext = ProtocolBindingContext; in NduTransferDataComplete() local
131 AdapterContext->AsyncStatus = Status; in NduTransferDataComplete()
132 KeSetEvent(&AdapterContext->AsyncEvent, IO_NO_INCREMENT, FALSE); in NduTransferDataComplete()
140 PNDISUIO_ADAPTER_CONTEXT AdapterContext = ProtocolBindingContext; in NduResetComplete() local
145 AdapterContext->AsyncStatus = Status; in NduResetComplete()
146 KeSetEvent(&AdapterContext->AsyncEvent, IO_NO_INCREMENT, FALSE); in NduResetComplete()
155 PNDISUIO_ADAPTER_CONTEXT AdapterContext = ProtocolBindingContext; in NduRequestComplete() local
160 AdapterContext->AsyncStatus = Status; in NduRequestComplete()
161 KeSetEvent(&AdapterContext->AsyncEvent, IO_NO_INCREMENT, FALSE); in NduRequestComplete()
174 PNDISUIO_ADAPTER_CONTEXT AdapterContext = ProtocolBindingContext; in NduReceive() local
184 if (AdapterContext->OpenCount == 0) in NduReceive()
193 Packet = CreatePacketFromPoolBuffer(AdapterContext, in NduReceive()
208 AdapterContext->MacOptions); in NduReceive()
214 AdapterContext->BindingHandle, in NduReceive()
222 KeWaitForSingleObject(&AdapterContext->AsyncEvent, in NduReceive()
227 Status = AdapterContext->AsyncStatus; in NduReceive()
261 ExInterlockedInsertTailList(&AdapterContext->PacketList, in NduReceive()
263 &AdapterContext->Spinlock); in NduReceive()
266 KeSetEvent(&AdapterContext->PacketReadEvent, in NduReceive()
299 UnbindAdapterByContext(PNDISUIO_ADAPTER_CONTEXT AdapterContext) in UnbindAdapterByContext() argument
307 DPRINT("Unbinding adapter %wZ\n", &AdapterContext->DeviceName); in UnbindAdapterByContext()
313 RemoveEntryList(&AdapterContext->ListEntry); in UnbindAdapterByContext()
317 RtlFreeUnicodeString(&AdapterContext->DeviceName); in UnbindAdapterByContext()
320 CurrentEntry = AdapterContext->OpenEntryList.Flink; in UnbindAdapterByContext()
321 while (CurrentEntry != &AdapterContext->OpenEntryList) in UnbindAdapterByContext()
329 ASSERT(AdapterContext == OpenEntry->FileObject->FsContext); in UnbindAdapterByContext()
331 AdapterContext->OpenCount--; in UnbindAdapterByContext()
345 ASSERT(AdapterContext->OpenCount == 0); in UnbindAdapterByContext()
348 CurrentEntry = AdapterContext->PacketList.Flink; in UnbindAdapterByContext()
349 while (CurrentEntry != &AdapterContext->PacketList) in UnbindAdapterByContext()
362 AdapterContext->BindingHandle); in UnbindAdapterByContext()
367 KeWaitForSingleObject(&AdapterContext->AsyncEvent, in UnbindAdapterByContext()
372 Status = AdapterContext->AsyncStatus; in UnbindAdapterByContext()
376 ExFreePool(AdapterContext); in UnbindAdapterByContext()
386 PNDISUIO_ADAPTER_CONTEXT AdapterContext; in BindAdapterByName() local
393 AdapterContext = ExAllocatePool(NonPagedPool, sizeof(*AdapterContext)); in BindAdapterByName()
394 if (!AdapterContext) in BindAdapterByName()
400 RtlZeroMemory(AdapterContext, sizeof(*AdapterContext)); in BindAdapterByName()
401 KeInitializeEvent(&AdapterContext->AsyncEvent, SynchronizationEvent, FALSE); in BindAdapterByName()
402 KeInitializeEvent(&AdapterContext->PacketReadEvent, SynchronizationEvent, FALSE); in BindAdapterByName()
403 KeInitializeSpinLock(&AdapterContext->Spinlock); in BindAdapterByName()
404 InitializeListHead(&AdapterContext->PacketList); in BindAdapterByName()
405 InitializeListHead(&AdapterContext->OpenEntryList); in BindAdapterByName()
406 AdapterContext->OpenCount = 0; in BindAdapterByName()
408 AdapterContext->DeviceName.Length = in BindAdapterByName()
409 AdapterContext->DeviceName.MaximumLength = DeviceName->Length; in BindAdapterByName()
410 AdapterContext->DeviceName.Buffer = ExAllocatePool(NonPagedPool, DeviceName->Length); in BindAdapterByName()
411 if (!AdapterContext->DeviceName.Buffer) in BindAdapterByName()
413 ExFreePool(AdapterContext); in BindAdapterByName()
418 RtlCopyMemory(AdapterContext->DeviceName.Buffer, DeviceName->Buffer, DeviceName->Length); in BindAdapterByName()
420 DPRINT("Binding adapter %wZ\n", &AdapterContext->DeviceName); in BindAdapterByName()
424 &AdapterContext->BufferPoolHandle, in BindAdapterByName()
429 RtlFreeUnicodeString(&AdapterContext->DeviceName); in BindAdapterByName()
430 ExFreePool(AdapterContext); in BindAdapterByName()
436 &AdapterContext->PacketPoolHandle, in BindAdapterByName()
442 NdisFreeBufferPool(AdapterContext->BufferPoolHandle); in BindAdapterByName()
443 RtlFreeUnicodeString(&AdapterContext->DeviceName); in BindAdapterByName()
444 ExFreePool(AdapterContext); in BindAdapterByName()
451 &AdapterContext->BindingHandle, in BindAdapterByName()
456 AdapterContext, in BindAdapterByName()
464 KeWaitForSingleObject(&AdapterContext->AsyncEvent, in BindAdapterByName()
469 Status = AdapterContext->AsyncStatus; in BindAdapterByName()
476 NdisFreePacketPool(AdapterContext->PacketPoolHandle); in BindAdapterByName()
477 NdisFreeBufferPool(AdapterContext->BufferPoolHandle); in BindAdapterByName()
478 RtlFreeUnicodeString(&AdapterContext->DeviceName); in BindAdapterByName()
479 ExFreePool(AdapterContext); in BindAdapterByName()
486 Request.DATA.QUERY_INFORMATION.InformationBuffer = &AdapterContext->MacOptions; in BindAdapterByName()
489 AdapterContext->BindingHandle, in BindAdapterByName()
495 KeWaitForSingleObject(&AdapterContext->AsyncEvent, in BindAdapterByName()
500 Status = AdapterContext->AsyncStatus; in BindAdapterByName()
511 AdapterContext->BindingHandle); in BindAdapterByName()
514 KeWaitForSingleObject(&AdapterContext->AsyncEvent, in BindAdapterByName()
521 NdisFreePacketPool(AdapterContext->PacketPoolHandle); in BindAdapterByName()
522 NdisFreeBufferPool(AdapterContext->BufferPoolHandle); in BindAdapterByName()
523 RtlFreeUnicodeString(&AdapterContext->DeviceName); in BindAdapterByName()
524 ExFreePool(AdapterContext); in BindAdapterByName()
530 &AdapterContext->ListEntry, in BindAdapterByName()