ReactOS  0.4.13-dev-241-g63286c6
protocol.c File Reference
#include "ndissys.h"
Include dependency graph for protocol.c:

Go to the source code of this file.

Classes

struct  _DMA_CONTEXT
 

Macros

#define SERVICES_KEY   L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\"
 
#define LINKAGE_KEY   L"\\Linkage"
 
#define PARAMETERS_KEY   L"\\Parameters\\"
 
#define WORKER_TEST   0
 

Typedefs

typedef struct _DMA_CONTEXT DMA_CONTEXT
 
typedef struct _DMA_CONTEXTPDMA_CONTEXT
 

Functions

PNET_PNP_EVENT ProSetupPnPEvent (NET_PNP_EVENT_CODE EventCode, PVOID EventBuffer, ULONG EventBufferLength)
 
NDIS_STATUS ProSendAndFreePnPEvent (PLOGICAL_ADAPTER Adapter, PNET_PNP_EVENT PnPEvent, PIRP Irp)
 
NTSTATUS NTAPI NdisIPwrSetPower (IN PDEVICE_OBJECT DeviceObject, PIRP Irp)
 
NTSTATUS NTAPI NdisIPwrQueryPower (IN PDEVICE_OBJECT DeviceObject, PIRP Irp)
 
NTSTATUS NTAPI NdisIPnPQueryStopDevice (IN PDEVICE_OBJECT DeviceObject, PIRP Irp)
 
NTSTATUS NTAPI NdisIPnPCancelStopDevice (IN PDEVICE_OBJECT DeviceObject, PIRP Irp)
 
VOID EXPORT NdisCompleteBindAdapter (IN NDIS_HANDLE BindAdapterContext, IN NDIS_STATUS Status, IN NDIS_STATUS OpenStatus)
 
VOID EXPORT NdisCompleteUnbindAdapter (IN NDIS_HANDLE UnbindAdapterContext, IN NDIS_STATUS Status)
 
NDIS_STATUS ProIndicatePacket (PLOGICAL_ADAPTER Adapter, PNDIS_PACKET Packet)
 
NDIS_STATUS NTAPI ProRequest (IN NDIS_HANDLE MacBindingHandle, IN PNDIS_REQUEST NdisRequest)
 
NDIS_STATUS NTAPI ProReset (IN NDIS_HANDLE MacBindingHandle)
 
VOID NTAPI ScatterGatherSendPacket (IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp, IN PSCATTER_GATHER_LIST ScatterGather, IN PVOID Context)
 
NDIS_STATUS proSendPacketToMiniport (PLOGICAL_ADAPTER Adapter, PNDIS_PACKET Packet)
 
NDIS_STATUS NTAPI ProSend (IN NDIS_HANDLE MacBindingHandle, IN PNDIS_PACKET Packet)
 
VOID NTAPI ProSendPackets (IN NDIS_HANDLE NdisBindingHandle, IN PPNDIS_PACKET PacketArray, IN UINT NumberOfPackets)
 
NDIS_STATUS NTAPI ProTransferData (IN NDIS_HANDLE MacBindingHandle, IN NDIS_HANDLE MacReceiveContext, IN UINT ByteOffset, IN UINT BytesToTransfer, IN OUT PNDIS_PACKET Packet, OUT PUINT BytesTransferred)
 
VOID EXPORT NdisCloseAdapter (OUT PNDIS_STATUS Status, IN NDIS_HANDLE NdisBindingHandle)
 
VOID EXPORT NdisDeregisterProtocol (OUT PNDIS_STATUS Status, IN NDIS_HANDLE NdisProtocolHandle)
 
VOID EXPORT NdisOpenAdapter (OUT PNDIS_STATUS Status, OUT PNDIS_STATUS OpenErrorStatus, OUT PNDIS_HANDLE NdisBindingHandle, OUT PUINT SelectedMediumIndex, IN PNDIS_MEDIUM MediumArray, IN UINT MediumArraySize, IN NDIS_HANDLE NdisProtocolHandle, IN NDIS_HANDLE ProtocolBindingContext, IN PNDIS_STRING AdapterName, IN UINT OpenOptions, IN PSTRING AddressingInformation OPTIONAL)
 
PADAPTER_BINDING NTAPI LocateAdapterBindingByName (IN PPROTOCOL_BINDING ProtocolBinding, IN PNDIS_STRING AdapterName)
 
VOID NTAPI ndisBindMiniportsToProtocol (OUT PNDIS_STATUS Status, IN PPROTOCOL_BINDING Protocol)
 
VOID EXPORT NdisRegisterProtocol (OUT PNDIS_STATUS Status, OUT PNDIS_HANDLE NdisProtocolHandle, IN PNDIS_PROTOCOL_CHARACTERISTICS ProtocolCharacteristics, IN UINT CharacteristicsLength)
 
VOID EXPORT NdisRequest (OUT PNDIS_STATUS Status, IN NDIS_HANDLE NdisBindingHandle, IN PNDIS_REQUEST NdisRequest)
 
VOID EXPORT NdisReset (OUT PNDIS_STATUS Status, IN NDIS_HANDLE NdisBindingHandle)
 
VOID EXPORT NdisSend (OUT PNDIS_STATUS Status, IN NDIS_HANDLE NdisBindingHandle, IN PNDIS_PACKET Packet)
 
VOID EXPORT NdisSendPackets (IN NDIS_HANDLE NdisBindingHandle, IN PPNDIS_PACKET PacketArray, IN UINT NumberOfPackets)
 
VOID EXPORT NdisTransferData (OUT PNDIS_STATUS Status, IN NDIS_HANDLE NdisBindingHandle, IN NDIS_HANDLE MacReceiveContext, IN UINT ByteOffset, IN UINT BytesToTransfer, IN OUT PNDIS_PACKET Packet, OUT PUINT BytesTransferred)
 
VOID NTAPI NdisReEnumerateProtocolBindings (IN NDIS_HANDLE NdisProtocolHandle)
 
VOID EXPORT NdisGetDriverHandle (IN PNDIS_HANDLE NdisBindingHandle, OUT PNDIS_HANDLE NdisDriverHandle)
 

Variables

LIST_ENTRY ProtocolListHead
 
KSPIN_LOCK ProtocolListLock
 

Macro Definition Documentation

◆ LINKAGE_KEY

#define LINKAGE_KEY   L"\\Linkage"

Definition at line 16 of file protocol.c.

◆ PARAMETERS_KEY

#define PARAMETERS_KEY   L"\\Parameters\\"

Definition at line 17 of file protocol.c.

◆ SERVICES_KEY

#define SERVICES_KEY   L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\"

Definition at line 15 of file protocol.c.

◆ WORKER_TEST

#define WORKER_TEST   0

Definition at line 22 of file protocol.c.

Typedef Documentation

◆ DMA_CONTEXT

◆ PDMA_CONTEXT

Function Documentation

◆ LocateAdapterBindingByName()

PADAPTER_BINDING NTAPI LocateAdapterBindingByName ( IN PPROTOCOL_BINDING  ProtocolBinding,
IN PNDIS_STRING  AdapterName 
)

Definition at line 876 of file protocol.c.

877 {
878  PLIST_ENTRY CurrentEntry;
879  PADAPTER_BINDING AdapterBinding;
880  KIRQL OldIrql;
881 
882  KeAcquireSpinLock(&ProtocolBinding->Lock, &OldIrql);
883 
884  CurrentEntry = ProtocolBinding->AdapterListHead.Flink;
885 
886  while (CurrentEntry != &ProtocolBinding->AdapterListHead)
887  {
888  AdapterBinding = CONTAINING_RECORD(CurrentEntry, ADAPTER_BINDING, ProtocolListEntry);
889 
891  {
892  KeReleaseSpinLock(&ProtocolBinding->Lock, OldIrql);
893  return AdapterBinding;
894  }
895 
896  CurrentEntry = CurrentEntry->Flink;
897  }
898 
899  KeReleaseSpinLock(&ProtocolBinding->Lock, OldIrql);
900 
901  return NULL;
902 }
#define TRUE
Definition: types.h:120
UCHAR KIRQL
Definition: env_spec_w32.h:591
smooth NULL
Definition: ftsmooth.c:416
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
struct _LIST_ENTRY * Flink
Definition: typedefs.h:119
NDIS_MINIPORT_BLOCK NdisMiniportBlock
Definition: miniport.h:89
#define KeAcquireSpinLock(sl, irql)
Definition: env_spec_w32.h:609
PLOGICAL_ADAPTER Adapter
Definition: protocol.h:29
ULONG RtlCompareUnicodeString(PUNICODE_STRING s1, PUNICODE_STRING s2, BOOLEAN UpCase)
Definition: string_lib.cpp:31
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql
Definition: kefuncs.h:803
UNICODE_STRING MiniportName
Definition: ndis.h:2511
Definition: typedefs.h:117
#define KeReleaseSpinLock(sl, irql)
Definition: env_spec_w32.h:627
_Must_inspect_result_ _Out_ PNDIS_STATUS _Out_ PNDIS_STATUS _Out_ PNDIS_HANDLE _Out_ PUINT _In_ UINT _In_ NDIS_HANDLE _In_ NDIS_HANDLE _In_ PNDIS_STRING AdapterName
Definition: ndis.h:6013

Referenced by ndisBindMiniportsToProtocol().

◆ ndisBindMiniportsToProtocol()

VOID NTAPI ndisBindMiniportsToProtocol ( OUT PNDIS_STATUS  Status,
IN PPROTOCOL_BINDING  Protocol 
)

Definition at line 906 of file protocol.c.

907 {
908  /*
909  * bind the protocol to all of its miniports
910  *
911  * open registry path
912  * get list of devices from Bind key
913  * call BindAdapterHandler for each
914  */
917  WCHAR *RegistryPathStr, *DataPtr = NULL;
918  NTSTATUS NtStatus;
919  HANDLE DriverKeyHandle = NULL;
920  PKEY_VALUE_PARTIAL_INFORMATION KeyInformation = NULL;
924  PLIST_ENTRY CurrentEntry = NULL;
925 
926  RegistryPathStr = ExAllocatePoolWithTag(PagedPool, sizeof(SERVICES_KEY) + ProtocolCharacteristics->Name.Length + sizeof(LINKAGE_KEY), NDIS_TAG + __LINE__);
927  if(!RegistryPathStr)
928  {
929  NDIS_DbgPrint(MIN_TRACE, ("Insufficient resources.\n"));
931  return;
932  }
933 
934  wcscpy(RegistryPathStr, SERVICES_KEY);
935  wcsncat(RegistryPathStr, ((WCHAR *)ProtocolCharacteristics->Name.Buffer), ProtocolCharacteristics->Name.Length / sizeof(WCHAR));
936  RegistryPathStr[wcslen(SERVICES_KEY)+ProtocolCharacteristics->Name.Length/sizeof(WCHAR)] = 0;
937  wcscat(RegistryPathStr, LINKAGE_KEY);
938 
939  RtlInitUnicodeString(&RegistryPath, RegistryPathStr);
940  NDIS_DbgPrint(MAX_TRACE, ("Opening configuration key: %wZ\n", &RegistryPath));
941 
943  NtStatus = ZwOpenKey(&DriverKeyHandle, KEY_READ, &ObjectAttributes);
944 
945  ExFreePool(RegistryPathStr);
946 
947  if(NT_SUCCESS(NtStatus))
948  {
949  NDIS_DbgPrint(MAX_TRACE, ("Successfully opened the registry configuration\n"));
950 
952 
953  NtStatus = ZwQueryValueKey(DriverKeyHandle, &ValueName, KeyValuePartialInformation, NULL, 0, &ResultLength);
954  if(NtStatus != STATUS_BUFFER_OVERFLOW && NtStatus != STATUS_BUFFER_TOO_SMALL && NtStatus != STATUS_SUCCESS)
955  {
956  NDIS_DbgPrint(MIN_TRACE, ("Unable to query the Bind value for size\n"));
957  ZwClose(DriverKeyHandle);
958  }
959  else
960  {
961  KeyInformation = ExAllocatePoolWithTag(PagedPool, sizeof(KEY_VALUE_PARTIAL_INFORMATION) + ResultLength, NDIS_TAG + __LINE__);
962  if(!KeyInformation)
963  {
964  NDIS_DbgPrint(MIN_TRACE, ("Insufficient resources.\n"));
965  ZwClose(DriverKeyHandle);
966  NtStatus = STATUS_NO_MEMORY;
967  }
968  else
969  {
970  NtStatus = ZwQueryValueKey(DriverKeyHandle, &ValueName, KeyValuePartialInformation, KeyInformation,
972 
973  ZwClose(DriverKeyHandle);
974 
975  if(!NT_SUCCESS(NtStatus))
976  {
977  NDIS_DbgPrint(MIN_TRACE, ("Unable to query the Bind value\n"));
978  ExFreePool(KeyInformation);
979  KeyInformation = NULL;
980  }
981  }
982  }
983  }
984 
985  if (!NT_SUCCESS(NtStatus))
986  {
987  NDIS_DbgPrint(MID_TRACE, ("Performing global bind for protocol '%wZ'\n", &ProtocolCharacteristics->Name));
988  KeyInformation = NULL;
989 
990  CurrentEntry = AdapterListHead.Flink;
991  }
992  else
993  {
994  NDIS_DbgPrint(MID_TRACE, ("Performing standard bind for protocol '%wZ'\n", &ProtocolCharacteristics->Name));
995 
996  DataPtr = (WCHAR*)KeyInformation->Data;
997  }
998 
999  /* Assume success for now */
1001 
1002  while (TRUE)
1003  {
1004  /* BindContext is for tracking pending binding operations */
1005  VOID *BindContext = 0;
1008  WCHAR *RegistryPathStr = NULL;
1009  ULONG PathLength = 0;
1010  PLOGICAL_ADAPTER Adapter;
1011 
1012  if (KeyInformation)
1013  {
1014  /* Parse the REG_MULTI_SZ entry for device names */
1015  if (!(*DataPtr))
1016  break;
1017 
1018  RtlInitUnicodeString(&DeviceName, DataPtr);
1019  }
1020  else
1021  {
1022  /* Use the device name from the global adapter list */
1023  if (CurrentEntry == &AdapterListHead)
1024  break;
1025 
1026  Adapter = CONTAINING_RECORD(CurrentEntry, LOGICAL_ADAPTER, ListEntry);
1027 
1029  }
1030 
1031  /* Make sure the adapter has started */
1033  {
1034  /* It wasn't in the global miniport list, so skip the bind entry */
1035  goto next;
1036  }
1037 
1038  /* Make sure this device isn't already bound to this protocol */
1040  {
1041  /* It was already in this protocol's bound adapter list, so skip the bind entry */
1042  goto next;
1043  }
1044 
1045  /*
1046  * RegistryPath should be:
1047  * \Registry\Machine\System\CurrentControlSet\Services\Nic1\Parameters\Tcpip
1048  *
1049  * This is constructed as follows:
1050  * SERVICES_KEY + extracted device name + Protocol name from characteristics
1051  */
1052 
1053  PathLength = sizeof(SERVICES_KEY) + /* \Registry\Machine\System\CurrentControlSet\Services\ */
1054  wcslen( DeviceName.Buffer + 8 ) * sizeof(WCHAR) + /* Adapter1 (extracted from \Device\Adapter1) */
1055  sizeof(PARAMETERS_KEY) + /* \Parameters\ */
1056  ProtocolCharacteristics->Name.Length + sizeof(WCHAR); /* Tcpip */
1057 
1058  RegistryPathStr = ExAllocatePool(PagedPool, PathLength);
1059  if(!RegistryPathStr)
1060  {
1061  NDIS_DbgPrint(MIN_TRACE, ("insufficient resources.\n"));
1063  break;
1064  }
1065 
1066  wcscpy(RegistryPathStr, SERVICES_KEY);
1067  wcscat(RegistryPathStr, DeviceName.Buffer + 8 );
1068  wcscat(RegistryPathStr, PARAMETERS_KEY);
1069  wcsncat(RegistryPathStr, ProtocolCharacteristics->Name.Buffer, ProtocolCharacteristics->Name.Length / sizeof(WCHAR) );
1070 
1071  RegistryPathStr[PathLength/sizeof(WCHAR) - 1] = 0;
1072 
1073  RtlInitUnicodeString(&RegistryPath, RegistryPathStr);
1074 
1075  NDIS_DbgPrint(MAX_TRACE, ("Calling protocol's BindAdapter handler with DeviceName %wZ and RegistryPath %wZ\n",
1076  &DeviceName, &RegistryPath));
1077 
1078  {
1079  BIND_HANDLER BindHandler = ProtocolCharacteristics->BindAdapterHandler;
1080  if(BindHandler)
1081  {
1082  BindHandler(Status, BindContext, &DeviceName, &RegistryPath, 0);
1083  NDIS_DbgPrint(MID_TRACE, ("%wZ's BindAdapter handler returned 0x%x for %wZ\n", &ProtocolCharacteristics->Name, *Status, &DeviceName));
1084  }
1085  else
1086  NDIS_DbgPrint(MID_TRACE, ("No protocol bind handler specified\n"));
1087  }
1088 
1089  next:
1090  if (KeyInformation)
1091  {
1092  /* Advance to the next adapter in the REG_MULTI_SZ */
1093  DataPtr += (DeviceName.Length / sizeof(WCHAR)) + 1;
1094  }
1095  else
1096  {
1097  /* Advance to the next adapter in the global list */
1098  CurrentEntry = CurrentEntry->Flink;
1099  }
1100  }
1101 
1102  if (KeyInformation)
1103  {
1104  ExFreePool(KeyInformation);
1105  }
1106 }
IN CINT OUT PVOID IN ULONG OUT PULONG ResultLength
Definition: conport.c:47
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
Definition: conport.c:35
#define TRUE
Definition: types.h:120
#define MID_TRACE
Definition: debug.h:15
#define KEY_READ
Definition: nt_native.h:1023
NTSYSAPI NTSTATUS NTAPI ZwClose(_In_ HANDLE Handle)
LONG NTSTATUS
Definition: precomp.h:26
WCHAR DeviceName[]
Definition: adapter.cpp:21
static USHORT PathLength
#define STATUS_BUFFER_TOO_SMALL
Definition: shellext.h:64
_In_ PUNICODE_STRING ValueName
Definition: cmfuncs.h:264
PADAPTER_BINDING NTAPI LocateAdapterBindingByName(IN PPROTOCOL_BINDING ProtocolBinding, IN PNDIS_STRING AdapterName)
Definition: protocol.c:876
smooth NULL
Definition: ftsmooth.c:416
LIST_ENTRY AdapterListHead
Definition: miniport.c:57
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
#define PARAMETERS_KEY
Definition: protocol.c:17
struct _LIST_ENTRY * Flink
Definition: typedefs.h:119
NDIS_MINIPORT_BLOCK NdisMiniportBlock
Definition: miniport.h:89
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define OBJ_CASE_INSENSITIVE
Definition: winternl.h:228
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
#define NDIS_STATUS_SUCCESS
Definition: ndis.h:346
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
static const WCHAR L[]
Definition: oid.c:1250
#define ExAllocatePool(type, size)
Definition: fbtusb.h:44
UNICODE_STRING MiniportName
Definition: ndis.h:2511
Definition: typedefs.h:117
_CRTIMP wchar_t *__cdecl wcsncat(wchar_t *_Dest, const wchar_t *_Source, size_t _Count)
#define LINKAGE_KEY
Definition: protocol.c:16
Status
Definition: gdiplustypes.h:24
static unsigned __int64 next
Definition: rand_nt.c:6
#define SERVICES_KEY
Definition: protocol.c:15
#define STATUS_BUFFER_OVERFLOW
Definition: shellext.h:61
#define MAX_TRACE
Definition: debug.h:16
#define STATUS_NO_MEMORY
Definition: ntstatus.h:246
_CRTIMP wchar_t *__cdecl wcscat(_Inout_updates_z_(_String_length_(_Dest)+_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
#define NDIS_DbgPrint(_t_, _x_)
Definition: debug.h:40
PLOGICAL_ADAPTER MiniLocateDevice(PNDIS_STRING AdapterName)
Definition: miniport.c:689
#define NDIS_TAG
Definition: ndissys.h:29
#define NDIS_STATUS_RESOURCES
Definition: ndis.h:466
unsigned int ULONG
Definition: retypes.h:1
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define MIN_TRACE
Definition: debug.h:14
#define InitializeObjectAttributes(p, n, a, r, s)
Definition: reg.c:106
_In_ PUNICODE_STRING RegistryPath
Definition: wmip.h:27
VOID(NTAPI * BIND_HANDLER)(OUT PNDIS_STATUS Status, IN NDIS_HANDLE BindContext, IN PNDIS_STRING DeviceName, IN PVOID SystemSpecific1, IN PVOID SystemSpecific2)
Definition: ndis.h:1844
return STATUS_SUCCESS
Definition: btrfs.c:2745
#define OBJ_KERNEL_HANDLE
Definition: winternl.h:231
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
_Out_ PNDIS_HANDLE _In_ PNDIS_PROTOCOL_CHARACTERISTICS ProtocolCharacteristics
Definition: ndis.h:6134
#define ExFreePool(addr)
Definition: env_spec_w32.h:352

Referenced by NdisIPnPStartDevice(), NdisReEnumerateProtocolBindings(), and NdisRegisterProtocol().

◆ NdisCloseAdapter()

VOID EXPORT NdisCloseAdapter ( OUT PNDIS_STATUS  Status,
IN NDIS_HANDLE  NdisBindingHandle 
)

Definition at line 701 of file protocol.c.

710 {
712 
713  NDIS_DbgPrint(MAX_TRACE, ("Called.\n"));
714 
715  /* Remove from protocol's bound adapters list */
716  ExInterlockedRemoveEntryList(&AdapterBinding->ProtocolListEntry, &AdapterBinding->ProtocolBinding->Lock);
717 
718  /* Remove protocol from adapter's bound protocols list */
719  ExInterlockedRemoveEntryList(&AdapterBinding->AdapterListEntry, &AdapterBinding->Adapter->NdisMiniportBlock.Lock);
720 
721  ExFreePool(AdapterBinding);
722 
724 }
#define ExInterlockedRemoveEntryList(_List, _Lock)
Definition: ndissys.h:37
LIST_ENTRY AdapterListEntry
Definition: protocol.h:26
PPROTOCOL_BINDING ProtocolBinding
Definition: protocol.h:28
KSPIN_LOCK Lock
Definition: protocol.h:12
NDIS_MINIPORT_BLOCK NdisMiniportBlock
Definition: miniport.h:89
PLOGICAL_ADAPTER Adapter
Definition: protocol.h:29
#define NDIS_STATUS_SUCCESS
Definition: ndis.h:346
Status
Definition: gdiplustypes.h:24
#define GET_ADAPTER_BINDING(Handle)
Definition: protocol.h:39
#define MAX_TRACE
Definition: debug.h:16
KSPIN_LOCK Lock
Definition: ndis.h:2520
#define NDIS_DbgPrint(_t_, _x_)
Definition: debug.h:40
LIST_ENTRY ProtocolListEntry
Definition: protocol.h:25
_Must_inspect_result_ _In_ NDIS_HANDLE NdisBindingHandle
Definition: ndis.h:4735
#define ExFreePool(addr)
Definition: env_spec_w32.h:352

Referenced by BindAdapterByName(), LANUnregisterAdapter(), and UnbindAdapterByContext().

◆ NdisCompleteBindAdapter()

VOID EXPORT NdisCompleteBindAdapter ( IN NDIS_HANDLE  BindAdapterContext,
IN NDIS_STATUS  Status,
IN NDIS_STATUS  OpenStatus 
)

Definition at line 193 of file protocol.c.

207 {
208  PROTOCOL_BINDING *Protocol = (PROTOCOL_BINDING *)BindAdapterContext;
209 
210  if (!NT_SUCCESS(Status)) {
211  NDIS_DbgPrint(MIN_TRACE, ("Binding failed (%x)\n", Status));
212  return;
213  }
214 
215  /* Put protocol binding struct on global list */
217 }
PLIST_ENTRY NTAPI ExInterlockedInsertTailList(IN OUT PLIST_ENTRY ListHead, IN OUT PLIST_ENTRY ListEntry, IN OUT PKSPIN_LOCK Lock)
Definition: interlocked.c:140
KSPIN_LOCK ProtocolListLock
Definition: protocol.c:20
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
Status
Definition: gdiplustypes.h:24
#define NDIS_DbgPrint(_t_, _x_)
Definition: debug.h:40
#define MIN_TRACE
Definition: debug.h:14
LIST_ENTRY ProtocolListHead
Definition: protocol.c:19

◆ NdisCompleteUnbindAdapter()

VOID EXPORT NdisCompleteUnbindAdapter ( IN NDIS_HANDLE  UnbindAdapterContext,
IN NDIS_STATUS  Status 
)

Definition at line 224 of file protocol.c.

227 {
228  /* We probably need to do more here but for now we just do
229  * the opposite of what NdisCompleteBindAdapter does
230  */
231 
232  PROTOCOL_BINDING *Protocol = (PROTOCOL_BINDING *)UnbindAdapterContext;
233 
234  if (!NT_SUCCESS(Status)) {
235  NDIS_DbgPrint(MIN_TRACE, ("Unbinding failed (%x)\n", Status));
236  return;
237  }
238 
240 }
#define ExInterlockedRemoveEntryList(_List, _Lock)
Definition: ndissys.h:37
KSPIN_LOCK ProtocolListLock
Definition: protocol.c:20
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
Status
Definition: gdiplustypes.h:24
#define NDIS_DbgPrint(_t_, _x_)
Definition: debug.h:40
#define MIN_TRACE
Definition: debug.h:14

◆ NdisDeregisterProtocol()

VOID EXPORT NdisDeregisterProtocol ( OUT PNDIS_STATUS  Status,
IN NDIS_HANDLE  NdisProtocolHandle 
)

Definition at line 732 of file protocol.c.

741 {
743 
744  NDIS_DbgPrint(MAX_TRACE, ("Called.\n"));
745 
746  /* FIXME: Make sure no adapter bindings exist */
747 
748  /* Remove protocol from global list */
750 
752 
754 }
#define ExInterlockedRemoveEntryList(_List, _Lock)
Definition: ndissys.h:37
#define GET_PROTOCOL_BINDING(Handle)
Definition: protocol.h:18
KSPIN_LOCK ProtocolListLock
Definition: protocol.c:20
#define NDIS_STATUS_SUCCESS
Definition: ndis.h:346
Status
Definition: gdiplustypes.h:24
#define MAX_TRACE
Definition: debug.h:16
#define NDIS_DbgPrint(_t_, _x_)
Definition: debug.h:40
#define ExFreePool(addr)
Definition: env_spec_w32.h:352

Referenced by LANUnregisterProtocol().

◆ NdisGetDriverHandle()

VOID EXPORT NdisGetDriverHandle ( IN PNDIS_HANDLE  NdisBindingHandle,
OUT PNDIS_HANDLE  NdisDriverHandle 
)

Definition at line 1351 of file protocol.c.

1360 {
1362 
1363  if (!Binding)
1364  {
1365  NDIS_DbgPrint(MIN_TRACE, ("Bad binding handle\n"));
1367  return;
1368  }
1369 
1370  *NdisDriverHandle = Binding->Adapter->NdisMiniportBlock.DriverHandle;
1371 }
_Out_ PNDIS_HANDLE NdisDriverHandle
Definition: ndis.h:6064
smooth NULL
Definition: ftsmooth.c:416
struct _ADAPTER_BINDING * PADAPTER_BINDING
#define NDIS_DbgPrint(_t_, _x_)
Definition: debug.h:40
#define MIN_TRACE
Definition: debug.h:14
_Must_inspect_result_ _In_ NDIS_HANDLE NdisBindingHandle
Definition: ndis.h:4735

◆ NdisIPnPCancelStopDevice()

NTSTATUS NTAPI NdisIPnPCancelStopDevice ( IN PDEVICE_OBJECT  DeviceObject,
PIRP  Irp 
)

Definition at line 172 of file protocol.c.

175 {
177  PNET_PNP_EVENT PnPEvent;
178 
180  if (!PnPEvent) {
181  NDIS_DbgPrint(MIN_TRACE, ("Insufficient resources\n"));
182  return NDIS_STATUS_RESOURCES;
183  }
184 
185  return ProSendAndFreePnPEvent(Adapter, PnPEvent, Irp);
186 }
NDIS_STATUS ProSendAndFreePnPEvent(PLOGICAL_ADAPTER Adapter, PNET_PNP_EVENT PnPEvent, PIRP Irp)
Definition: protocol.c:66
_In_ PIRP Irp
Definition: csq.h:116
PVOID DeviceExtension
Definition: env_spec_w32.h:418
PNET_PNP_EVENT ProSetupPnPEvent(NET_PNP_EVENT_CODE EventCode, PVOID EventBuffer, ULONG EventBufferLength)
Definition: protocol.c:30
smooth NULL
Definition: ftsmooth.c:416
struct _LOGICAL_ADAPTER * PLOGICAL_ADAPTER
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
#define NDIS_DbgPrint(_t_, _x_)
Definition: debug.h:40
#define NDIS_STATUS_RESOURCES
Definition: ndis.h:466
#define MIN_TRACE
Definition: debug.h:14

Referenced by NdisIDispatchPnp().

◆ NdisIPnPQueryStopDevice()

NTSTATUS NTAPI NdisIPnPQueryStopDevice ( IN PDEVICE_OBJECT  DeviceObject,
PIRP  Irp 
)

Definition at line 154 of file protocol.c.

157 {
159  PNET_PNP_EVENT PnPEvent;
160 
162  if (!PnPEvent) {
163  NDIS_DbgPrint(MIN_TRACE, ("Insufficient resources\n"));
164  return NDIS_STATUS_RESOURCES;
165  }
166 
167  return ProSendAndFreePnPEvent(Adapter, PnPEvent, Irp);
168 }
NDIS_STATUS ProSendAndFreePnPEvent(PLOGICAL_ADAPTER Adapter, PNET_PNP_EVENT PnPEvent, PIRP Irp)
Definition: protocol.c:66
_In_ PIRP Irp
Definition: csq.h:116
PVOID DeviceExtension
Definition: env_spec_w32.h:418
PNET_PNP_EVENT ProSetupPnPEvent(NET_PNP_EVENT_CODE EventCode, PVOID EventBuffer, ULONG EventBufferLength)
Definition: protocol.c:30
smooth NULL
Definition: ftsmooth.c:416
struct _LOGICAL_ADAPTER * PLOGICAL_ADAPTER
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
#define NDIS_DbgPrint(_t_, _x_)
Definition: debug.h:40
#define NDIS_STATUS_RESOURCES
Definition: ndis.h:466
#define MIN_TRACE
Definition: debug.h:14

Referenced by NdisIDispatchPnp().

◆ NdisIPwrQueryPower()

NTSTATUS NTAPI NdisIPwrQueryPower ( IN PDEVICE_OBJECT  DeviceObject,
PIRP  Irp 
)

Definition at line 132 of file protocol.c.

135 {
137  PNET_PNP_EVENT PnPEvent;
139 
140  ASSERT(Stack->Parameters.Power.Type == DevicePowerState);
141 
142  PnPEvent = ProSetupPnPEvent(NetEventQueryPower, &Stack->Parameters.Power.State, sizeof(NDIS_DEVICE_POWER_STATE));
143  if (!PnPEvent) {
144  NDIS_DbgPrint(MIN_TRACE, ("Insufficient resources\n"));
145  return NDIS_STATUS_RESOURCES;
146  }
147 
148  return ProSendAndFreePnPEvent(Adapter, PnPEvent, Irp);
149 }
NDIS_STATUS ProSendAndFreePnPEvent(PLOGICAL_ADAPTER Adapter, PNET_PNP_EVENT PnPEvent, PIRP Irp)
Definition: protocol.c:66
_In_ PIRP Irp
Definition: csq.h:116
PVOID DeviceExtension
Definition: env_spec_w32.h:418
PNET_PNP_EVENT ProSetupPnPEvent(NET_PNP_EVENT_CODE EventCode, PVOID EventBuffer, ULONG EventBufferLength)
Definition: protocol.c:30
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
struct _LOGICAL_ADAPTER * PLOGICAL_ADAPTER
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(_In_ PIRP Irp)
Definition: iofuncs.h:2745
#define NDIS_DbgPrint(_t_, _x_)
Definition: debug.h:40
enum _NDIS_DEVICE_POWER_STATE NDIS_DEVICE_POWER_STATE
#define NDIS_STATUS_RESOURCES
Definition: ndis.h:466
#define MIN_TRACE
Definition: debug.h:14

◆ NdisIPwrSetPower()

NTSTATUS NTAPI NdisIPwrSetPower ( IN PDEVICE_OBJECT  DeviceObject,
PIRP  Irp 
)

Definition at line 111 of file protocol.c.

114 {
116  PNET_PNP_EVENT PnPEvent;
118 
119  ASSERT(Stack->Parameters.Power.Type == DevicePowerState);
120 
121  PnPEvent = ProSetupPnPEvent(NetEventSetPower, &Stack->Parameters.Power.State, sizeof(NDIS_DEVICE_POWER_STATE));
122  if (!PnPEvent) {
123  NDIS_DbgPrint(MIN_TRACE, ("Insufficient resources\n"));
124  return NDIS_STATUS_RESOURCES;
125  }
126 
127  return ProSendAndFreePnPEvent(Adapter, PnPEvent, Irp);
128 }
NDIS_STATUS ProSendAndFreePnPEvent(PLOGICAL_ADAPTER Adapter, PNET_PNP_EVENT PnPEvent, PIRP Irp)
Definition: protocol.c:66
_In_ PIRP Irp
Definition: csq.h:116
PVOID DeviceExtension
Definition: env_spec_w32.h:418
PNET_PNP_EVENT ProSetupPnPEvent(NET_PNP_EVENT_CODE EventCode, PVOID EventBuffer, ULONG EventBufferLength)
Definition: protocol.c:30
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
struct _LOGICAL_ADAPTER * PLOGICAL_ADAPTER
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(_In_ PIRP Irp)
Definition: iofuncs.h:2745
#define NDIS_DbgPrint(_t_, _x_)
Definition: debug.h:40
enum _NDIS_DEVICE_POWER_STATE NDIS_DEVICE_POWER_STATE
#define NDIS_STATUS_RESOURCES
Definition: ndis.h:466
#define MIN_TRACE
Definition: debug.h:14

◆ NdisOpenAdapter()

VOID EXPORT NdisOpenAdapter ( OUT PNDIS_STATUS  Status,
OUT PNDIS_STATUS  OpenErrorStatus,
OUT PNDIS_HANDLE  NdisBindingHandle,
OUT PUINT  SelectedMediumIndex,
IN PNDIS_MEDIUM  MediumArray,
IN UINT  MediumArraySize,
IN NDIS_HANDLE  NdisProtocolHandle,
IN NDIS_HANDLE  ProtocolBindingContext,
IN PNDIS_STRING  AdapterName,
IN UINT  OpenOptions,
IN PSTRING AddressingInformation  OPTIONAL 
)

Definition at line 762 of file protocol.c.

789 {
790  UINT i;
791  BOOLEAN Found;
792  PLOGICAL_ADAPTER Adapter;
793  PADAPTER_BINDING AdapterBinding;
795 
796  NDIS_DbgPrint(MAX_TRACE, ("Called.\n"));
797 
798  if(!NdisProtocolHandle)
799  {
800  NDIS_DbgPrint(MIN_TRACE, ("NdisProtocolHandle is NULL\n"));
802  return;
803  }
804 
805  Adapter = MiniLocateDevice(AdapterName);
806  if (!Adapter)
807  {
808  NDIS_DbgPrint(MIN_TRACE, ("Adapter not found.\n"));
810  return;
811  }
812 
813  /* Find the media type in the list provided by the protocol driver */
814  Found = FALSE;
815  for (i = 0; i < MediumArraySize; i++)
816  {
817  if (Adapter->NdisMiniportBlock.MediaType == MediumArray[i])
818  {
820  Found = TRUE;
821  break;
822  }
823  }
824 
825  if (!Found)
826  {
827  NDIS_DbgPrint(MIN_TRACE, ("Medium is not supported.\n"));
829  return;
830  }
831 
832  /* Now that we have confirmed that the adapter can be opened, create a binding */
833 
834  AdapterBinding = ExAllocatePool(NonPagedPool, sizeof(ADAPTER_BINDING));
835  if (!AdapterBinding)
836  {
837  NDIS_DbgPrint(MIN_TRACE, ("Insufficient resources.\n"));
839  return;
840  }
841 
842  RtlZeroMemory(AdapterBinding, sizeof(ADAPTER_BINDING));
843 
844  AdapterBinding->ProtocolBinding = Protocol;
845  AdapterBinding->Adapter = Adapter;
846  AdapterBinding->NdisOpenBlock.ProtocolBindingContext = ProtocolBindingContext;
847 
848  /* Set fields required by some NDIS macros */
849  AdapterBinding->NdisOpenBlock.BindingHandle = (NDIS_HANDLE)AdapterBinding;
850 
851  /* Set handlers (some NDIS macros require these) */
852 
853  AdapterBinding->NdisOpenBlock.RequestHandler = ProRequest;
854  AdapterBinding->NdisOpenBlock.ResetHandler = ProReset;
855  AdapterBinding->NdisOpenBlock.SendHandler = ProSend;
856  AdapterBinding->NdisOpenBlock.SendPacketsHandler = ProSendPackets;
857  AdapterBinding->NdisOpenBlock.TransferDataHandler = ProTransferData;
858 
859  AdapterBinding->NdisOpenBlock.RequestCompleteHandler =
860  Protocol->Chars.RequestCompleteHandler;
861 
862  /* Put on protocol's bound adapters list */
863  ExInterlockedInsertTailList(&Protocol->AdapterListHead, &AdapterBinding->ProtocolListEntry, &Protocol->Lock);
864 
865  /* Put protocol on adapter's bound protocols list */
866  NDIS_DbgPrint(MAX_TRACE, ("acquiring miniport block lock\n"));
868 
869  *NdisBindingHandle = (NDIS_HANDLE)AdapterBinding;
870 
872 }
_Must_inspect_result_ _Out_ PNDIS_STATUS _Out_ PNDIS_STATUS _Out_ PNDIS_HANDLE _Out_ PUINT _In_ UINT _In_ NDIS_HANDLE _In_ NDIS_HANDLE ProtocolBindingContext
Definition: ndis.h:6013
#define GET_PROTOCOL_BINDING(Handle)
Definition: protocol.h:18
#define TRUE
Definition: types.h:120
NDIS_OPEN_BLOCK NdisOpenBlock
Definition: protocol.h:22
_Must_inspect_result_ _Out_ PNDIS_STATUS _Out_ PNDIS_STATUS OpenErrorStatus
Definition: ndis.h:6008
PLIST_ENTRY NTAPI ExInterlockedInsertTailList(IN OUT PLIST_ENTRY ListHead, IN OUT PLIST_ENTRY ListEntry, IN OUT PKSPIN_LOCK Lock)
Definition: interlocked.c:140
_In_ USHORT _In_ ULONG Protocol
Definition: wsk.h:182
LIST_ENTRY AdapterListEntry
Definition: protocol.h:26
_Must_inspect_result_ _Out_ PNDIS_STATUS _Out_ PNDIS_STATUS _Out_ PNDIS_HANDLE _Out_ PUINT SelectedMediumIndex
Definition: ndis.h:6008
_Must_inspect_result_ _Out_ PNDIS_STATUS _Out_ PNDIS_STATUS _Out_ PNDIS_HANDLE _Out_ PUINT _In_ UINT MediumArraySize
Definition: ndis.h:6013
#define NDIS_STATUS_UNSUPPORTED_MEDIA
Definition: ndis.h:490
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
unsigned char BOOLEAN
NDIS_STATUS NTAPI ProSend(IN NDIS_HANDLE MacBindingHandle, IN PNDIS_PACKET Packet)
Definition: protocol.c:471
return Found
Definition: dirsup.c:1270
PPROTOCOL_BINDING ProtocolBinding
Definition: protocol.h:28
PVOID NDIS_HANDLE
Definition: ndis.h:338
NDIS_MEDIUM MediaType
Definition: ndis.h:2548
NDIS_MINIPORT_BLOCK NdisMiniportBlock
Definition: miniport.h:89
#define NDIS_STATUS_ADAPTER_NOT_FOUND
Definition: ndis.h:470
VOID NTAPI ProSendPackets(IN NDIS_HANDLE NdisBindingHandle, IN PPNDIS_PACKET PacketArray, IN UINT NumberOfPackets)
Definition: protocol.c:575
PLOGICAL_ADAPTER Adapter
Definition: protocol.h:29
#define NDIS_STATUS_SUCCESS
Definition: ndis.h:346
LIST_ENTRY ProtocolListHead
Definition: miniport.h:94
#define ExAllocatePool(type, size)
Definition: fbtusb.h:44
NDIS_STATUS NTAPI ProRequest(IN NDIS_HANDLE MacBindingHandle, IN PNDIS_REQUEST NdisRequest)
Definition: protocol.c:308
Status
Definition: gdiplustypes.h:24
NDIS_STATUS NTAPI ProReset(IN NDIS_HANDLE MacBindingHandle)
Definition: protocol.c:349
#define MAX_TRACE
Definition: debug.h:16
KSPIN_LOCK Lock
Definition: ndis.h:2520
unsigned int UINT
Definition: ndis.h:50
#define NDIS_DbgPrint(_t_, _x_)
Definition: debug.h:40
PLOGICAL_ADAPTER MiniLocateDevice(PNDIS_STRING AdapterName)
Definition: miniport.c:689
NDIS_STATUS NTAPI ProTransferData(IN NDIS_HANDLE MacBindingHandle, IN NDIS_HANDLE MacReceiveContext, IN UINT ByteOffset, IN UINT BytesToTransfer, IN OUT PNDIS_PACKET Packet, OUT PUINT BytesTransferred)
Definition: protocol.c:637
#define NDIS_STATUS_RESOURCES
Definition: ndis.h:466
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
#define MIN_TRACE
Definition: debug.h:14
LIST_ENTRY ProtocolListEntry
Definition: protocol.h:25
_Must_inspect_result_ _Out_ PNDIS_STATUS _Out_ PNDIS_STATUS _Out_ PNDIS_HANDLE _Out_ PUINT _In_ UINT _In_ NDIS_HANDLE _In_ NDIS_HANDLE _In_ PNDIS_STRING AdapterName
Definition: ndis.h:6013
_Must_inspect_result_ _In_ NDIS_HANDLE NdisBindingHandle
Definition: ndis.h:4735
#define NDIS_STATUS_FAILURE
Definition: ndis.h:465

Referenced by BindAdapterByName(), and LANRegisterAdapter().

◆ NdisReEnumerateProtocolBindings()

VOID NTAPI NdisReEnumerateProtocolBindings ( IN NDIS_HANDLE  NdisProtocolHandle)

Definition at line 1338 of file protocol.c.

1339 {
1340  NDIS_STATUS NdisStatus;
1341 
1343 }
int NDIS_STATUS
Definition: ntddndis.h:445
VOID NTAPI ndisBindMiniportsToProtocol(OUT PNDIS_STATUS Status, IN PPROTOCOL_BINDING Protocol)
Definition: protocol.c:906

◆ NdisRegisterProtocol()

VOID EXPORT NdisRegisterProtocol ( OUT PNDIS_STATUS  Status,
OUT PNDIS_HANDLE  NdisProtocolHandle,
IN PNDIS_PROTOCOL_CHARACTERISTICS  ProtocolCharacteristics,
IN UINT  CharacteristicsLength 
)

Definition at line 1113 of file protocol.c.

1134 {
1136  NTSTATUS NtStatus;
1137  UINT MinSize;
1138  PNET_PNP_EVENT PnPEvent;
1139 
1140  NDIS_DbgPrint(MAX_TRACE, ("Called.\n"));
1141 
1143 
1144  /* first validate the PROTOCOL_CHARACTERISTICS */
1145  switch (ProtocolCharacteristics->MajorNdisVersion)
1146  {
1147  case 0x03:
1148  /* we don't really want to support ndis3 drivers - so we complain for now */
1149  NDIS_DbgPrint(MID_TRACE, ("NDIS 3 protocol attempting to register\n"));
1150  MinSize = sizeof(NDIS30_PROTOCOL_CHARACTERISTICS);
1151  break;
1152 
1153  case 0x04:
1154  MinSize = sizeof(NDIS40_PROTOCOL_CHARACTERISTICS);
1155  break;
1156 
1157  case 0x05:
1158  MinSize = sizeof(NDIS50_PROTOCOL_CHARACTERISTICS);
1159  break;
1160 
1161  default:
1163  NDIS_DbgPrint(MIN_TRACE, ("Incorrect characteristics size\n"));
1164  return;
1165  }
1166 
1167  if (CharacteristicsLength < MinSize)
1168  {
1169  NDIS_DbgPrint(MIN_TRACE, ("Bad protocol characteristics.\n"));
1171  return;
1172  }
1173 
1174  /* set up the protocol block */
1176  if (!Protocol)
1177  {
1178  NDIS_DbgPrint(MIN_TRACE, ("Insufficient resources.\n"));
1180  return;
1181  }
1182 
1184  RtlCopyMemory(&Protocol->Chars, ProtocolCharacteristics, MinSize);
1185 
1186  NtStatus = RtlUpcaseUnicodeString(&Protocol->Chars.Name, &ProtocolCharacteristics->Name, TRUE);
1187  if (!NT_SUCCESS(NtStatus))
1188  {
1189  NDIS_DbgPrint(MIN_TRACE, ("Insufficient resources.\n"));
1192  return;
1193  }
1194 
1196 
1197  InitializeListHead(&Protocol->AdapterListHead);
1198 
1199  /* We must set this before the call to ndisBindMiniportsToProtocol because the protocol's
1200  * BindAdapter handler might need it */
1201 
1203 
1205 
1206  /* Should we only send this if ndisBindMiniportsToProtocol succeeds? */
1208  if (PnPEvent)
1209  {
1210  if (Protocol->Chars.PnPEventHandler)
1211  {
1212  /* We call this with a NULL binding context because it affects all bindings */
1213  NtStatus = (*Protocol->Chars.PnPEventHandler)(NULL,
1214  PnPEvent);
1215 
1216  /* FIXME: We don't support this yet */
1217  ASSERT(NtStatus != NDIS_STATUS_PENDING);
1218  }
1219 
1220  ExFreePool(PnPEvent);
1221  }
1222 
1223  if (*Status == NDIS_STATUS_SUCCESS) {
1225  } else {
1226  NDIS_DbgPrint(MIN_TRACE, ("Binding failed (%x)\n", *Status));
1229  }
1230 }
#define TRUE
Definition: types.h:120
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
#define MID_TRACE
Definition: debug.h:15
NTSTATUS RtlUpcaseUnicodeString(PUNICODE_STRING dst, PUNICODE_STRING src, BOOLEAN Alloc)
Definition: string_lib.cpp:46
#define NDIS_STATUS_PENDING
Definition: ndis.h:347
PLIST_ENTRY NTAPI ExInterlockedInsertTailList(IN OUT PLIST_ENTRY ListHead, IN OUT PLIST_ENTRY ListEntry, IN OUT PKSPIN_LOCK Lock)
Definition: interlocked.c:140
LONG NTSTATUS
Definition: precomp.h:26
_In_ USHORT _In_ ULONG Protocol
Definition: wsk.h:182
struct _NDIS30_PROTOCOL_CHARACTERISTICS NDIS30_PROTOCOL_CHARACTERISTICS
FORCEINLINE VOID KeInitializeSpinLock(_Out_ PKSPIN_LOCK SpinLock)
Definition: kefuncs.h:251
PNET_PNP_EVENT ProSetupPnPEvent(NET_PNP_EVENT_CODE EventCode, PVOID EventBuffer, ULONG EventBufferLength)
Definition: protocol.c:30
smooth NULL
Definition: ftsmooth.c:416
KSPIN_LOCK ProtocolListLock
Definition: protocol.c:20
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
#define NDIS_STATUS_SUCCESS
Definition: ndis.h:346
VOID NTAPI ndisBindMiniportsToProtocol(OUT PNDIS_STATUS Status, IN PPROTOCOL_BINDING Protocol)
Definition: protocol.c:906
struct _NDIS50_PROTOCOL_CHARACTERISTICS NDIS50_PROTOCOL_CHARACTERISTICS
#define ExAllocatePool(type, size)
Definition: fbtusb.h:44
Status
Definition: gdiplustypes.h:24
struct _NDIS40_PROTOCOL_CHARACTERISTICS NDIS40_PROTOCOL_CHARACTERISTICS
_Out_ PNDIS_HANDLE _In_ PNDIS_PROTOCOL_CHARACTERISTICS _In_ UINT CharacteristicsLength
Definition: ndis.h:6134
#define MAX_TRACE
Definition: debug.h:16
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944
unsigned int UINT
Definition: ndis.h:50
#define NDIS_STATUS_BAD_VERSION
Definition: ndis.h:468
#define NDIS_DbgPrint(_t_, _x_)
Definition: debug.h:40
#define NDIS_STATUS_RESOURCES
Definition: ndis.h:466
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
#define MIN_TRACE
Definition: debug.h:14
#define NDIS_STATUS_BAD_CHARACTERISTICS
Definition: ndis.h:469
_Out_ PNDIS_HANDLE _In_ PNDIS_PROTOCOL_CHARACTERISTICS ProtocolCharacteristics
Definition: ndis.h:6134
#define ExFreePool(addr)
Definition: env_spec_w32.h:352
LIST_ENTRY ProtocolListHead
Definition: protocol.c:19

Referenced by DriverEntry(), and LANRegisterProtocol().

◆ NdisRequest()

VOID EXPORT NdisRequest ( OUT PNDIS_STATUS  Status,
IN NDIS_HANDLE  NdisBindingHandle,
IN PNDIS_REQUEST  NdisRequest 
)

Definition at line 1237 of file protocol.c.

1248 {
1250 }
VOID EXPORT NdisRequest(OUT PNDIS_STATUS Status, IN NDIS_HANDLE NdisBindingHandle, IN PNDIS_REQUEST NdisRequest)
Definition: protocol.c:1237
NDIS_STATUS NTAPI ProRequest(IN NDIS_HANDLE MacBindingHandle, IN PNDIS_REQUEST NdisRequest)
Definition: protocol.c:308
Status
Definition: gdiplustypes.h:24
_Must_inspect_result_ _In_ NDIS_HANDLE NdisBindingHandle
Definition: ndis.h:4735

Referenced by BindAdapterByName(), and ProRequest().

◆ NdisReset()

VOID EXPORT NdisReset ( OUT PNDIS_STATUS  Status,
IN NDIS_HANDLE  NdisBindingHandle 
)

Definition at line 1257 of file protocol.c.

1260 {
1262 }
Status
Definition: gdiplustypes.h:24
NDIS_STATUS NTAPI ProReset(IN NDIS_HANDLE MacBindingHandle)
Definition: protocol.c:349
_Must_inspect_result_ _In_ NDIS_HANDLE NdisBindingHandle
Definition: ndis.h:4735

◆ NdisSend()

VOID EXPORT NdisSend ( OUT PNDIS_STATUS  Status,
IN NDIS_HANDLE  NdisBindingHandle,
IN PNDIS_PACKET  Packet 
)

Definition at line 1270 of file protocol.c.

1281 {
1283 }
_In_ NDIS_HANDLE _In_ PNDIS_PACKET Packet
Definition: ndis.h:1548
NDIS_STATUS NTAPI ProSend(IN NDIS_HANDLE MacBindingHandle, IN PNDIS_PACKET Packet)
Definition: protocol.c:471
Status
Definition: gdiplustypes.h:24
_Must_inspect_result_ _In_ NDIS_HANDLE NdisBindingHandle
Definition: ndis.h:4735

Referenced by LANTransmit(), and NduDispatchWrite().

◆ NdisSendPackets()

VOID EXPORT NdisSendPackets ( IN NDIS_HANDLE  NdisBindingHandle,
IN PPNDIS_PACKET  PacketArray,
IN UINT  NumberOfPackets 
)

Definition at line 1291 of file protocol.c.

1295 {
1297 }
_In_ PPNDIS_PACKET _In_ UINT NumberOfPackets
Definition: ndis.h:5120
_In_ PPNDIS_PACKET PacketArray
Definition: ndis.h:5120
VOID NTAPI ProSendPackets(IN NDIS_HANDLE NdisBindingHandle, IN PPNDIS_PACKET PacketArray, IN UINT NumberOfPackets)
Definition: protocol.c:575
_Must_inspect_result_ _In_ NDIS_HANDLE NdisBindingHandle
Definition: ndis.h:4735

◆ NdisTransferData()

VOID EXPORT NdisTransferData ( OUT PNDIS_STATUS  Status,
IN NDIS_HANDLE  NdisBindingHandle,
IN NDIS_HANDLE  MacReceiveContext,
IN UINT  ByteOffset,
IN UINT  BytesToTransfer,
IN OUT PNDIS_PACKET  Packet,
OUT PUINT  BytesTransferred 
)

Definition at line 1305 of file protocol.c.

1324 {
1326  MacReceiveContext,
1327  ByteOffset,
1328  BytesToTransfer,
1329  Packet,
1330  BytesTransferred);
1331 }
_In_ NDIS_HANDLE _In_ PNDIS_PACKET Packet
Definition: ndis.h:1548
Status
Definition: gdiplustypes.h:24
NDIS_STATUS NTAPI ProTransferData(IN NDIS_HANDLE MacBindingHandle, IN NDIS_HANDLE MacReceiveContext, IN UINT ByteOffset, IN UINT BytesToTransfer, IN OUT PNDIS_PACKET Packet, OUT PUINT BytesTransferred)
Definition: protocol.c:637
_Must_inspect_result_ _In_ NDIS_HANDLE NdisBindingHandle
Definition: ndis.h:4735
IN PDCB IN PCCB IN VBO IN OUT PULONG OUT PDIRENT OUT PBCB OUT PVBO ByteOffset
Definition: fatprocs.h:716

Referenced by NduReceive(), and ProtocolReceive().

◆ ProIndicatePacket()

NDIS_STATUS ProIndicatePacket ( PLOGICAL_ADAPTER  Adapter,
PNDIS_PACKET  Packet 
)

Definition at line 243 of file protocol.c.

256 {
257  UINT BufferedLength;
258  UINT PacketLength;
259  KIRQL OldIrql;
260  PUCHAR LookaheadBuffer;
261 
262  NDIS_DbgPrint(MAX_TRACE, ("Called.\n"));
263 
264 #if DBG
265  MiniDisplayPacket(Packet, "INDICATE");
266 #endif
267 
268  NdisQueryPacket(Packet, NULL, NULL, NULL, &PacketLength);
269 
270  LookaheadBuffer = ExAllocatePool(NonPagedPool, PacketLength);
271  if (!LookaheadBuffer) {
272  NDIS_DbgPrint(MIN_TRACE, ("Insufficient resources\n"));
273  return NDIS_STATUS_RESOURCES;
274  }
275 
276  NDIS_DbgPrint(MAX_TRACE, ("acquiring miniport block lock\n"));
278  {
279  BufferedLength = CopyPacketToBuffer(LookaheadBuffer, Packet, 0, PacketLength);
280  Adapter->NdisMiniportBlock.IndicatedPacket[KeGetCurrentProcessorNumber()] = Packet;
281  }
283 
284  if (BufferedLength > Adapter->MediumHeaderSize)
285  {
286  /* XXX Change this to call SendPackets so we don't have to duplicate this wacky logic */
287  MiniIndicateData(Adapter, NULL, LookaheadBuffer, Adapter->MediumHeaderSize,
288  &LookaheadBuffer[Adapter->MediumHeaderSize], BufferedLength - Adapter->MediumHeaderSize,
289  PacketLength - Adapter->MediumHeaderSize);
290  }
291  else
292  {
293  MiniIndicateData(Adapter, NULL, LookaheadBuffer, Adapter->MediumHeaderSize, NULL, 0, 0);
294  }
295 
296  ExFreePool(LookaheadBuffer);
297 
299  {
300  Adapter->NdisMiniportBlock.IndicatedPacket[KeGetCurrentProcessorNumber()] = NULL;
301  }
303 
304  return NDIS_STATUS_SUCCESS;
305 }
_In_ NDIS_HANDLE _In_ PNDIS_PACKET Packet
Definition: ndis.h:1548
VOID MiniIndicateData(PLOGICAL_ADAPTER Adapter, NDIS_HANDLE MacReceiveContext, PVOID HeaderBuffer, UINT HeaderBufferSize, PVOID LookaheadBuffer, UINT LookaheadBufferSize, UINT PacketSize)
Definition: miniport.c:176
unsigned char * PUCHAR
Definition: retypes.h:3
FORCEINLINE ULONG KeGetCurrentProcessorNumber(VOID)
Definition: ke.h:325
UCHAR KIRQL
Definition: env_spec_w32.h:591
smooth NULL
Definition: ftsmooth.c:416
NDIS_MINIPORT_BLOCK NdisMiniportBlock
Definition: miniport.h:89
#define KeAcquireSpinLock(sl, irql)
Definition: env_spec_w32.h:609
#define NDIS_STATUS_SUCCESS
Definition: ndis.h:346
VOID MiniDisplayPacket(PNDIS_PACKET Packet, PCSTR Reason)
Definition: miniport.c:61
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql
Definition: kefuncs.h:803
#define ExAllocatePool(type, size)
Definition: fbtusb.h:44
#define MAX_TRACE
Definition: debug.h:16
UINT CopyPacketToBuffer(PUCHAR DstData, PNDIS_PACKET SrcPacket, UINT SrcOffset, UINT Length)
Definition: buffer.c:170
KSPIN_LOCK Lock
Definition: ndis.h:2520
unsigned int UINT
Definition: ndis.h:50
#define KeReleaseSpinLock(sl, irql)
Definition: env_spec_w32.h:627
#define NDIS_DbgPrint(_t_, _x_)
Definition: debug.h:40
static __inline VOID NdisQueryPacket(IN PNDIS_PACKET Packet, OUT PUINT PhysicalBufferCount OPTIONAL, OUT PUINT BufferCount OPTIONAL, OUT PNDIS_BUFFER *FirstBuffer OPTIONAL, OUT PUINT TotalPacketLength OPTIONAL)
Definition: ndis.h:3593
#define NDIS_STATUS_RESOURCES
Definition: ndis.h:466
#define MIN_TRACE
Definition: debug.h:14
ULONG MediumHeaderSize
Definition: miniport.h:95
#define ExFreePool(addr)
Definition: env_spec_w32.h:352

Referenced by MiniportWorker(), and ProSend().

◆ ProRequest()

NDIS_STATUS NTAPI ProRequest ( IN NDIS_HANDLE  MacBindingHandle,
IN PNDIS_REQUEST  NdisRequest 
)

Definition at line 308 of file protocol.c.

319 {
320  PADAPTER_BINDING AdapterBinding;
321  PLOGICAL_ADAPTER Adapter;
323 
324  NDIS_DbgPrint(MAX_TRACE, ("Called.\n"));
325 
326  ASSERT(MacBindingHandle);
327  AdapterBinding = GET_ADAPTER_BINDING(MacBindingHandle);
328 
329  ASSERT(AdapterBinding->Adapter);
330  Adapter = AdapterBinding->Adapter;
331 
332  MacBlock->Binding = &AdapterBinding->NdisOpenBlock;
333 
334 #if WORKER_TEST
336  return NDIS_STATUS_PENDING;
337 #else
338  if (MiniIsBusy(Adapter, NdisWorkItemRequest)) {
340  return NDIS_STATUS_PENDING;
341  }
342 
343  return MiniDoRequest(Adapter, NdisRequest);
344 #endif
345 }
NDIS_OPEN_BLOCK NdisOpenBlock
Definition: protocol.h:22
#define NDIS_STATUS_PENDING
Definition: ndis.h:347
VOID FASTCALL MiniQueueWorkItem(PLOGICAL_ADAPTER Adapter, NDIS_WORK_ITEM_TYPE WorkItemType, PVOID WorkItemContext, BOOLEAN Top)
Definition: miniport.c:981
VOID EXPORT NdisRequest(OUT PNDIS_STATUS Status, IN NDIS_HANDLE NdisBindingHandle, IN PNDIS_REQUEST NdisRequest)
Definition: protocol.c:1237
NDIS_STATUS MiniDoRequest(PLOGICAL_ADAPTER Adapter, PNDIS_REQUEST NdisRequest)
Definition: miniport.c:1106
struct _NDIS_REQUEST_MAC_BLOCK * PNDIS_REQUEST_MAC_BLOCK
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
PLOGICAL_ADAPTER Adapter
Definition: protocol.h:29
PNDIS_OPEN_BLOCK Binding
Definition: protocol.h:34
BOOLEAN MiniIsBusy(PLOGICAL_ADAPTER Adapter, NDIS_WORK_ITEM_TYPE Type)
Definition: miniport.c:143
#define GET_ADAPTER_BINDING(Handle)
Definition: protocol.h:39
#define MAX_TRACE
Definition: debug.h:16
#define NDIS_DbgPrint(_t_, _x_)
Definition: debug.h:40

Referenced by NdisOpenAdapter(), and NdisRequest().

◆ ProReset()

NDIS_STATUS NTAPI ProReset ( IN NDIS_HANDLE  MacBindingHandle)

Definition at line 349 of file protocol.c.

351 {
352  PADAPTER_BINDING AdapterBinding = MacBindingHandle;
353 
354  /* FIXME: Wait for all packets to be sent */
355 
356  return MiniReset(AdapterBinding->Adapter);
357 }
PLOGICAL_ADAPTER Adapter
Definition: protocol.h:29
NDIS_STATUS MiniReset(PLOGICAL_ADAPTER Adapter)
Definition: miniport.c:901

Referenced by NdisOpenAdapter(), and NdisReset().

◆ ProSend()

NDIS_STATUS NTAPI ProSend ( IN NDIS_HANDLE  MacBindingHandle,
IN PNDIS_PACKET  Packet 
)

Definition at line 471 of file protocol.c.

483 {
484  PADAPTER_BINDING AdapterBinding;
485  PLOGICAL_ADAPTER Adapter;
486  PNDIS_BUFFER NdisBuffer;
488  NDIS_STATUS NdisStatus;
489  UINT PacketLength;
490  KIRQL OldIrql;
491 
492  NDIS_DbgPrint(MAX_TRACE, ("Called.\n"));
493 
494  ASSERT(MacBindingHandle);
495  AdapterBinding = GET_ADAPTER_BINDING(MacBindingHandle);
496 
497  ASSERT(AdapterBinding);
498  Adapter = AdapterBinding->Adapter;
499 
500  ASSERT(Adapter);
501 
502  /* if the following is not true, KeRaiseIrql() below will break */
504 
505  /* XXX what is this crazy black magic? */
506  Packet->Reserved[1] = (ULONG_PTR)MacBindingHandle;
507 
508  /*
509  * Test the packet to see if it is a MAC loopback.
510  *
511  * We may have to loop this packet if miniport cannot.
512  * If dest MAC address of packet == MAC address of adapter,
513  * this is a loopback frame.
514  */
515 
517  MiniAdapterHasAddress(Adapter, Packet))
518  {
519 #if WORKER_TEST
521  return NDIS_STATUS_PENDING;
522 #else
523  return ProIndicatePacket(Adapter, Packet);
524 #endif
525  } else {
526  if (Adapter->NdisMiniportBlock.ScatterGatherListSize != 0)
527  {
528  NDIS_DbgPrint(MID_TRACE, ("Using Scatter/Gather DMA\n"));
529 
531  NULL,
532  NULL,
533  &NdisBuffer,
534  &PacketLength);
535 
537  if (!Context) {
538  NDIS_DbgPrint(MIN_TRACE, ("Insufficient resources\n"));
539  return NDIS_STATUS_RESOURCES;
540  }
541 
542  Context->Adapter = Adapter;
543  Context->Packet = Packet;
544 
546 
547  KeFlushIoBuffers(NdisBuffer, FALSE, TRUE);
548 
549  NdisStatus = Adapter->NdisMiniportBlock.SystemAdapterObject->DmaOperations->GetScatterGatherList(
550  Adapter->NdisMiniportBlock.SystemAdapterObject,
552  NdisBuffer,
553  MmGetMdlVirtualAddress(NdisBuffer),
554  PacketLength,
556  Context,
557  TRUE);
558 
560 
561  if (!NT_SUCCESS(NdisStatus)) {
562  NDIS_DbgPrint(MIN_TRACE, ("GetScatterGatherList failed! (%x)\n", NdisStatus));
563  return NdisStatus;
564  }
565 
566  return NDIS_STATUS_PENDING;
567  }
568 
569 
570  return proSendPacketToMiniport(Adapter, Packet);
571  }
572 }
#define KeGetCurrentIrql()
Definition: env_spec_w32.h:706
PDEVICE_OBJECT PhysicalDeviceObject
Definition: ndis.h:2553
#define KeRaiseIrql(irql, oldIrql)
Definition: env_spec_w32.h:597
#define TRUE
Definition: types.h:120
#define MID_TRACE
Definition: debug.h:15
#define KeLowerIrql(oldIrql)
Definition: env_spec_w32.h:602
_In_ NDIS_HANDLE _In_ PNDIS_PACKET Packet
Definition: ndis.h:1548
#define NDIS_STATUS_PENDING
Definition: ndis.h:347
#define MmGetMdlVirtualAddress(_Mdl)
MDL * PNDIS_BUFFER
Definition: ndis.h:343
VOID FASTCALL MiniQueueWorkItem(PLOGICAL_ADAPTER Adapter, NDIS_WORK_ITEM_TYPE WorkItemType, PVOID WorkItemContext, BOOLEAN Top)
Definition: miniport.c:981
NDIS_STATUS proSendPacketToMiniport(PLOGICAL_ADAPTER Adapter, PNDIS_PACKET Packet)
Definition: protocol.c:389
#define NDIS_MAC_OPTION_NO_LOOPBACK
Definition: ndis.h:685
int NDIS_STATUS
Definition: ntddndis.h:445
UCHAR KIRQL
Definition: env_spec_w32.h:591
smooth NULL
Definition: ftsmooth.c:416
BOOLEAN MiniAdapterHasAddress(PLOGICAL_ADAPTER Adapter, PNDIS_PACKET Packet)
Definition: miniport.c:615
VOID NTAPI ScatterGatherSendPacket(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp, IN PSCATTER_GATHER_LIST ScatterGather, IN PVOID Context)
Definition: protocol.c:360
NDIS_MINIPORT_BLOCK NdisMiniportBlock
Definition: miniport.h:89
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
NDIS_STATUS ProIndicatePacket(PLOGICAL_ADAPTER Adapter, PNDIS_PACKET Packet)
Definition: protocol.c:243
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
PLOGICAL_ADAPTER Adapter
Definition: protocol.h:29
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql
Definition: kefuncs.h:803
#define ExAllocatePool(type, size)
Definition: fbtusb.h:44
#define DISPATCH_LEVEL
Definition: env_spec_w32.h:696
#define KeFlushIoBuffers(_Mdl, _ReadOperation, _DmaOperation)
Definition: ke.h:161
#define GET_ADAPTER_BINDING(Handle)
Definition: protocol.h:39
#define MAX_TRACE
Definition: debug.h:16
unsigned int UINT
Definition: ndis.h:50
#define NDIS_DbgPrint(_t_, _x_)
Definition: debug.h:40
static __inline VOID NdisQueryPacket(IN PNDIS_PACKET Packet, OUT PUINT PhysicalBufferCount OPTIONAL, OUT PUINT BufferCount OPTIONAL, OUT PNDIS_BUFFER *FirstBuffer OPTIONAL, OUT PUINT TotalPacketLength OPTIONAL)
Definition: ndis.h:3593
struct tagContext Context
Definition: acpixf.h:1012
#define NDIS_STATUS_RESOURCES
Definition: ndis.h:466
#define MIN_TRACE
Definition: debug.h:14
#define ULONG_PTR
Definition: config.h:101

Referenced by NdisOpenAdapter(), and NdisSend().

◆ ProSendAndFreePnPEvent()

NDIS_STATUS ProSendAndFreePnPEvent ( PLOGICAL_ADAPTER  Adapter,
PNET_PNP_EVENT  PnPEvent,
PIRP  Irp 
)

Definition at line 66 of file protocol.c.

70 {
71  PLIST_ENTRY CurrentEntry;
73  PADAPTER_BINDING AdapterBinding;
74 
75  CurrentEntry = Adapter->ProtocolListHead.Flink;
76 
77  while (CurrentEntry != &Adapter->ProtocolListHead)
78  {
79  AdapterBinding = CONTAINING_RECORD(CurrentEntry, ADAPTER_BINDING, AdapterListEntry);
80 
81  Status = (*AdapterBinding->ProtocolBinding->Chars.PnPEventHandler)(
82  AdapterBinding->NdisOpenBlock.ProtocolBindingContext,
83  PnPEvent);
84 
86  {
88  /* Yes, I know this is stupid */
89  PnPEvent->NdisReserved[0] = (ULONG_PTR)Irp;
90  PnPEvent->NdisReserved[1] = (ULONG_PTR)CurrentEntry->Flink;
91  return NDIS_STATUS_PENDING;
92  }
93  else if (Status != NDIS_STATUS_SUCCESS)
94  {
95  if (PnPEvent->Buffer) ExFreePool(PnPEvent->Buffer);
96  ExFreePool(PnPEvent);
97  return Status;
98  }
99 
100  CurrentEntry = CurrentEntry->Flink;
101  }
102 
103  if (PnPEvent->Buffer) ExFreePool(PnPEvent->Buffer);
104  ExFreePool(PnPEvent);
105 
106  return NDIS_STATUS_SUCCESS;
107 }
NDIS_OPEN_BLOCK NdisOpenBlock
Definition: protocol.h:22
#define NDIS_STATUS_PENDING
Definition: ndis.h:347
_In_ PIRP Irp
Definition: csq.h:116
int NDIS_STATUS
Definition: ntddndis.h:445
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
PPROTOCOL_BINDING ProtocolBinding
Definition: protocol.h:28
struct _LIST_ENTRY * Flink
Definition: typedefs.h:119
#define NDIS_STATUS_SUCCESS
Definition: ndis.h:346
LIST_ENTRY ProtocolListHead
Definition: miniport.h:94
ULONG_PTR NdisReserved[4]
Definition: netpnp.h:35
Definition: typedefs.h:117
Status
Definition: gdiplustypes.h:24
PVOID Buffer
Definition: netpnp.h:33
#define ULONG_PTR
Definition: config.h:101
IoMarkIrpPending(Irp)
#define ExFreePool(addr)
Definition: env_spec_w32.h:352
PNP_EVENT_HANDLER PnPEventHandler
Definition: ndis.h:1899
NDIS_PROTOCOL_CHARACTERISTICS Chars
Definition: protocol.h:13

Referenced by NdisIPnPCancelStopDevice(), NdisIPnPQueryStopDevice(), NdisIPwrQueryPower(), and NdisIPwrSetPower().

◆ ProSendPackets()

VOID NTAPI ProSendPackets ( IN NDIS_HANDLE  NdisBindingHandle,
IN PPNDIS_PACKET  PacketArray,
IN UINT  NumberOfPackets 
)

Definition at line 575 of file protocol.c.

579 {
580  PADAPTER_BINDING AdapterBinding = NdisBindingHandle;
581  PLOGICAL_ADAPTER Adapter = AdapterBinding->Adapter;
582  KIRQL RaiseOldIrql;
583  NDIS_STATUS NdisStatus;
584  UINT i;
585 
586  if(Adapter->NdisMiniportBlock.DriverHandle->MiniportCharacteristics.SendPacketsHandler)
587  {
589  {
590  (*Adapter->NdisMiniportBlock.DriverHandle->MiniportCharacteristics.SendPacketsHandler)(
592  }
593  else
594  {
595  /* SendPackets is called at DISPATCH_LEVEL for all serialized miniports */
596  KeRaiseIrql(DISPATCH_LEVEL, &RaiseOldIrql);
597  (*Adapter->NdisMiniportBlock.DriverHandle->MiniportCharacteristics.SendPacketsHandler)(
599  KeLowerIrql(RaiseOldIrql);
600  for (i = 0; i < NumberOfPackets; i++)
601  {
602  NdisStatus = NDIS_GET_PACKET_STATUS(PacketArray[i]);
603  if (NdisStatus != NDIS_STATUS_PENDING)
604  MiniSendComplete(Adapter, PacketArray[i], NdisStatus);
605  }
606  }
607  }
608  else
609  {
611  {
612  for (i = 0; i < NumberOfPackets; i++)
613  {
614  NdisStatus = (*Adapter->NdisMiniportBlock.DriverHandle->MiniportCharacteristics.SendHandler)(
616  if (NdisStatus != NDIS_STATUS_PENDING)
617  MiniSendComplete(Adapter, PacketArray[i], NdisStatus);
618  }
619  }
620  else
621  {
622  /* Send is called at DISPATCH_LEVEL for all serialized miniports */
623  KeRaiseIrql(DISPATCH_LEVEL, &RaiseOldIrql);
624  for (i = 0; i < NumberOfPackets; i++)
625  {
626  NdisStatus = (*Adapter->NdisMiniportBlock.DriverHandle->MiniportCharacteristics.SendHandler)(
628  if (NdisStatus != NDIS_STATUS_PENDING)
629  MiniSendComplete(Adapter, PacketArray[i], NdisStatus);
630  }
631  KeLowerIrql(RaiseOldIrql);
632  }
633  }
634 }
_In_ PPNDIS_PACKET _In_ UINT NumberOfPackets
Definition: ndis.h:5120
#define KeRaiseIrql(irql, oldIrql)
Definition: env_spec_w32.h:597
NDIS_MINIPORT_CHARACTERISTICS MiniportCharacteristics
Definition: miniport.h:22
#define KeLowerIrql(oldIrql)
Definition: env_spec_w32.h:602
#define NDIS_ATTRIBUTE_DESERIALIZE
Definition: ndis.h:588
#define NDIS_STATUS_PENDING
Definition: ndis.h:347
VOID NTAPI MiniSendComplete(IN NDIS_HANDLE MiniportAdapterHandle, IN PNDIS_PACKET Packet, IN NDIS_STATUS Status)
Definition: miniport.c:529
int NDIS_STATUS
Definition: ntddndis.h:445
NDIS_PACKET_PRIVATE Private
Definition: ndis.h:735
UCHAR KIRQL
Definition: env_spec_w32.h:591
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
_In_ PPNDIS_PACKET PacketArray
Definition: ndis.h:5120
NDIS_HANDLE MiniportAdapterContext
Definition: ndis.h:2510
#define NDIS_GET_PACKET_STATUS(_Packet)
Definition: ndis.h:3436
NDIS_MINIPORT_BLOCK NdisMiniportBlock
Definition: miniport.h:89
PLOGICAL_ADAPTER Adapter
Definition: protocol.h:29
#define DISPATCH_LEVEL
Definition: env_spec_w32.h:696
unsigned int UINT
Definition: ndis.h:50
_Must_inspect_result_ _In_ NDIS_HANDLE NdisBindingHandle
Definition: ndis.h:4735
PNDIS_M_DRIVER_BLOCK DriverHandle
Definition: ndis.h:2509

Referenced by NdisIPnPStartDevice(), NdisOpenAdapter(), and NdisSendPackets().

◆ proSendPacketToMiniport()

NDIS_STATUS proSendPacketToMiniport ( PLOGICAL_ADAPTER  Adapter,
PNDIS_PACKET  Packet 
)

Definition at line 389 of file protocol.c.

390 {
391 #if WORKER_TEST
393  return NDIS_STATUS_PENDING;
394 #else
395  KIRQL RaiseOldIrql;
396  NDIS_STATUS NdisStatus;
397 
398  NDIS_DbgPrint(MAX_TRACE, ("Called.\n"));
399 
400  if(MiniIsBusy(Adapter, NdisWorkItemSend)) {
401  NDIS_DbgPrint(MID_TRACE, ("Busy: NdisWorkItemSend.\n"));
402 
404  return NDIS_STATUS_PENDING;
405  }
406 
407  MiniDisplayPacket(Packet, "SEND");
408 
409  if(Adapter->NdisMiniportBlock.DriverHandle->MiniportCharacteristics.SendPacketsHandler)
410  {
412  {
413  NDIS_DbgPrint(MAX_TRACE, ("Calling miniport's SendPackets handler\n"));
414  (*Adapter->NdisMiniportBlock.DriverHandle->MiniportCharacteristics.SendPacketsHandler)(
416  NdisStatus = NDIS_STATUS_PENDING;
417  } else {
418  /* SendPackets is called at DISPATCH_LEVEL for all serialized miniports */
419  KeRaiseIrql(DISPATCH_LEVEL, &RaiseOldIrql);
420  {
421  NDIS_DbgPrint(MAX_TRACE, ("Calling miniport's SendPackets handler\n"));
422  (*Adapter->NdisMiniportBlock.DriverHandle->MiniportCharacteristics.SendPacketsHandler)(
424  }
425  KeLowerIrql(RaiseOldIrql);
426 
427  NdisStatus = NDIS_GET_PACKET_STATUS(Packet);
428  if (NdisStatus == NDIS_STATUS_RESOURCES) {
430  NdisStatus = NDIS_STATUS_PENDING;
431  }
432  }
433 
434  if (NdisStatus != NDIS_STATUS_PENDING) {
436  }
437 
438  return NdisStatus;
439  } else {
441  {
442  NDIS_DbgPrint(MAX_TRACE, ("Calling miniport's Send handler\n"));
443  NdisStatus = (*Adapter->NdisMiniportBlock.DriverHandle->MiniportCharacteristics.SendHandler)(
444  Adapter->NdisMiniportBlock.MiniportAdapterContext, Packet, Packet->Private.Flags);
445  NDIS_DbgPrint(MAX_TRACE, ("back from miniport's send handler\n"));
446  } else {
447  /* Send is called at DISPATCH_LEVEL for all serialized miniports */
448  KeRaiseIrql(DISPATCH_LEVEL, &RaiseOldIrql);
449  NDIS_DbgPrint(MAX_TRACE, ("Calling miniport's Send handler\n"));
450  NdisStatus = (*Adapter->NdisMiniportBlock.DriverHandle->MiniportCharacteristics.SendHandler)(
451  Adapter->NdisMiniportBlock.MiniportAdapterContext, Packet, Packet->Private.Flags);
452  NDIS_DbgPrint(MAX_TRACE, ("back from miniport's send handler\n"));
453  KeLowerIrql(RaiseOldIrql);
454 
455  if (NdisStatus == NDIS_STATUS_RESOURCES) {
457  NdisStatus = NDIS_STATUS_PENDING;
458  }
459  }
460 
461  if (NdisStatus != NDIS_STATUS_PENDING) {
463  }
464 
465  return NdisStatus;
466  }
467 #endif
468 }
#define KeRaiseIrql(irql, oldIrql)
Definition: env_spec_w32.h:597
#define TRUE
Definition: types.h:120
#define MID_TRACE
Definition: debug.h:15
NDIS_MINIPORT_CHARACTERISTICS MiniportCharacteristics
Definition: miniport.h:22
#define KeLowerIrql(oldIrql)
Definition: env_spec_w32.h:602
_In_ NDIS_HANDLE _In_ PNDIS_PACKET Packet
Definition: ndis.h:1548
#define NDIS_ATTRIBUTE_DESERIALIZE
Definition: ndis.h:588
#define NDIS_STATUS_PENDING
Definition: ndis.h:347
VOID MiniWorkItemComplete(PLOGICAL_ADAPTER Adapter, NDIS_WORK_ITEM_TYPE WorkItemType)
Definition: miniport.c:963
VOID FASTCALL MiniQueueWorkItem(PLOGICAL_ADAPTER Adapter, NDIS_WORK_ITEM_TYPE WorkItemType, PVOID WorkItemContext, BOOLEAN Top)
Definition: miniport.c:981
int NDIS_STATUS
Definition: ntddndis.h:445
UCHAR KIRQL
Definition: env_spec_w32.h:591
NDIS_HANDLE MiniportAdapterContext
Definition: ndis.h:2510
#define NDIS_GET_PACKET_STATUS(_Packet)
Definition: ndis.h:3436
NDIS_MINIPORT_BLOCK NdisMiniportBlock
Definition: miniport.h:89
VOID MiniDisplayPacket(PNDIS_PACKET Packet, PCSTR Reason)
Definition: miniport.c:61
BOOLEAN MiniIsBusy(PLOGICAL_ADAPTER Adapter, NDIS_WORK_ITEM_TYPE Type)
Definition: miniport.c:143
#define DISPATCH_LEVEL
Definition: env_spec_w32.h:696
#define MAX_TRACE
Definition: debug.h:16
#define NDIS_DbgPrint(_t_, _x_)
Definition: debug.h:40
#define NDIS_STATUS_RESOURCES
Definition: ndis.h:466
PNDIS_M_DRIVER_BLOCK DriverHandle
Definition: ndis.h:2509

Referenced by ProSend(), and ScatterGatherSendPacket().

◆ ProSetupPnPEvent()

PNET_PNP_EVENT ProSetupPnPEvent ( NET_PNP_EVENT_CODE  EventCode,
PVOID  EventBuffer,
ULONG  EventBufferLength 
)

Definition at line 30 of file protocol.c.

34 {
35  PNET_PNP_EVENT PnPEvent;
36 
37  PnPEvent = ExAllocatePool(PagedPool, sizeof(NET_PNP_EVENT));
38  if (!PnPEvent) {
39  NDIS_DbgPrint(MIN_TRACE, ("Insufficient resources\n"));
40  return NULL;
41  }
42 
43  RtlZeroMemory(PnPEvent, sizeof(NET_PNP_EVENT));
44 
45  PnPEvent->NetEvent = EventCode;
46 
47  if (EventBuffer != NULL)
48  {
49  PnPEvent->Buffer = ExAllocatePool(PagedPool, EventBufferLength);
50  if (!PnPEvent->Buffer)
51  {
52  NDIS_DbgPrint(MIN_TRACE, ("Insufficient resources\n"));
53  ExFreePool(PnPEvent);
54  return NULL;
55  }
56 
57  PnPEvent->BufferLength = EventBufferLength;
58 
59  RtlCopyMemory(PnPEvent->Buffer, EventBuffer, PnPEvent->BufferLength);
60  }
61 
62  return PnPEvent;
63 }
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
_In_ NDIS_STATUS EventCode
Definition: ndis.h:4751
ULONG BufferLength
Definition: netpnp.h:34
smooth NULL
Definition: ftsmooth.c:416
#define ExAllocatePool(type, size)
Definition: fbtusb.h:44
PVOID Buffer
Definition: netpnp.h:33
#define NDIS_DbgPrint(_t_, _x_)
Definition: debug.h:40
NET_PNP_EVENT_CODE NetEvent
Definition: netpnp.h:32
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
#define MIN_TRACE
Definition: debug.h:14
#define ExFreePool(addr)
Definition: env_spec_w32.h:352

Referenced by NdisIPnPCancelStopDevice(), NdisIPnPQueryStopDevice(), NdisIPwrQueryPower(), NdisIPwrSetPower(), and NdisRegisterProtocol().

◆ ProTransferData()

NDIS_STATUS NTAPI ProTransferData ( IN NDIS_HANDLE  MacBindingHandle,
IN NDIS_HANDLE  MacReceiveContext,
IN UINT  ByteOffset,
IN UINT  BytesToTransfer,
IN OUT PNDIS_PACKET  Packet,
OUT PUINT  BytesTransferred 
)

Definition at line 637 of file protocol.c.

654 {
655  PADAPTER_BINDING AdapterBinding = GET_ADAPTER_BINDING(MacBindingHandle);
656  PLOGICAL_ADAPTER Adapter = AdapterBinding->Adapter;
658  KIRQL OldIrql;
659 
660  NDIS_DbgPrint(MAX_TRACE, ("Called.\n"));
661 
662  /* FIXME: Interrupts must be disabled for adapter */
663  /* XXX sd - why is that true? */
664 
665  if (Adapter->NdisMiniportBlock.IndicatedPacket[KeGetCurrentProcessorNumber()]) {
666  NDIS_DbgPrint(MAX_TRACE, ("LoopPacket\n"));
667  /* NDIS is responsible for looping this packet */
669  ByteOffset + Adapter->MediumHeaderSize,
670  BytesToTransfer + Adapter->MediumHeaderSize,
671  Adapter->NdisMiniportBlock.IndicatedPacket[KeGetCurrentProcessorNumber()],
672  0,
673  BytesTransferred);
674  return NDIS_STATUS_SUCCESS;
675  }
676 
677  ASSERT(Adapter->NdisMiniportBlock.DriverHandle->MiniportCharacteristics.TransferDataHandler);
678 
680 
681  Status = (*Adapter->NdisMiniportBlock.DriverHandle->MiniportCharacteristics.TransferDataHandler)(
682  Packet,
683  BytesTransferred,
685  MacReceiveContext,
686  ByteOffset,
687  BytesToTransfer);
688 
690 
691  return Status;
692 }
#define KeRaiseIrql(irql, oldIrql)
Definition: env_spec_w32.h:597
NDIS_MINIPORT_CHARACTERISTICS MiniportCharacteristics
Definition: miniport.h:22
#define KeLowerIrql(oldIrql)
Definition: env_spec_w32.h:602
_In_ NDIS_HANDLE _In_ PNDIS_PACKET Packet
Definition: ndis.h:1548
VOID EXPORT NdisCopyFromPacketToPacket(IN PNDIS_PACKET Destination, IN UINT DestinationOffset, IN UINT BytesToCopy, IN PNDIS_PACKET Source, IN UINT SourceOffset, OUT PUINT BytesCopied)
Definition: buffer.c:569
int NDIS_STATUS
Definition: ntddndis.h:445
FORCEINLINE ULONG KeGetCurrentProcessorNumber(VOID)
Definition: ke.h:325
UCHAR KIRQL
Definition: env_spec_w32.h:591
NDIS_HANDLE MiniportAdapterContext
Definition: ndis.h:2510
NDIS_MINIPORT_BLOCK NdisMiniportBlock
Definition: miniport.h:89
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
PLOGICAL_ADAPTER Adapter
Definition: protocol.h:29
#define NDIS_STATUS_SUCCESS
Definition: ndis.h:346
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql
Definition: kefuncs.h:803
Status
Definition: gdiplustypes.h:24
#define DISPATCH_LEVEL
Definition: env_spec_w32.h:696
#define GET_ADAPTER_BINDING(Handle)
Definition: protocol.h:39
#define MAX_TRACE
Definition: debug.h:16
#define NDIS_DbgPrint(_t_, _x_)
Definition: debug.h:40
ULONG MediumHeaderSize
Definition: miniport.h:95
PNDIS_M_DRIVER_BLOCK DriverHandle
Definition: ndis.h:2509
IN PDCB IN PCCB IN VBO IN OUT PULONG OUT PDIRENT OUT PBCB OUT PVBO ByteOffset
Definition: fatprocs.h:716

Referenced by NdisOpenAdapter(), and NdisTransferData().

◆ ScatterGatherSendPacket()

VOID NTAPI ScatterGatherSendPacket ( IN PDEVICE_OBJECT  DeviceObject,
IN PIRP  Irp,
IN PSCATTER_GATHER_LIST  ScatterGather,
IN PVOID  Context 
)

Definition at line 360 of file protocol.c.

365 {
366  PDMA_CONTEXT DmaContext = Context;
367  PLOGICAL_ADAPTER Adapter = DmaContext->Adapter;
368  PNDIS_PACKET Packet = DmaContext->Packet;
370 
371  NDIS_DbgPrint(MAX_TRACE, ("Called.\n"));
372 
375 
377 
378  if (Status != NDIS_STATUS_PENDING) {
379  NDIS_DbgPrint(MAX_TRACE, ("Completing packet.\n"));
380  MiniSendComplete(Adapter,
381  Packet,
382  Status);
383  }
384 
385  ExFreePool(DmaContext);
386 }
_In_ NDIS_HANDLE _In_ PNDIS_PACKET Packet
Definition: ndis.h:1548
#define NDIS_STATUS_PENDING
Definition: ndis.h:347
PNDIS_PACKET Packet
Definition: protocol.c:26
VOID NTAPI MiniSendComplete(IN NDIS_HANDLE MiniportAdapterHandle, IN PNDIS_PACKET Packet, IN NDIS_STATUS Status)
Definition: miniport.c:529
NDIS_STATUS proSendPacketToMiniport(PLOGICAL_ADAPTER Adapter, PNDIS_PACKET Packet)
Definition: protocol.c:389
PLOGICAL_ADAPTER Adapter
Definition: protocol.c:25
int NDIS_STATUS
Definition: ntddndis.h:445
Status
Definition: gdiplustypes.h:24
#define MAX_TRACE
Definition: debug.h:16
_In_ struct _IRP _In_ struct _SCATTER_GATHER_LIST * ScatterGather
Definition: iotypes.h:2258
#define NDIS_DbgPrint(_t_, _x_)
Definition: debug.h:40
struct tagContext Context
Definition: acpixf.h:1012
#define NDIS_PER_PACKET_INFO_FROM_PACKET(Packet, InfoType)
Definition: ndis.h:1351
#define ExFreePool(addr)
Definition: env_spec_w32.h:352

Referenced by ProSend().

Variable Documentation

◆ ProtocolListHead

LIST_ENTRY ProtocolListHead

◆ ProtocolListLock