Author: cgutman
Date: Thu Nov 13 18:54:26 2008
New Revision: 37348
URL:
http://svn.reactos.org/svn/reactos?rev=37348&view=rev
Log:
- Fix protocol binding
Modified:
branches/aicom-network-fixes/drivers/network/ndis/ndis/protocol.c
Modified: branches/aicom-network-fixes/drivers/network/ndis/ndis/protocol.c
URL:
http://svn.reactos.org/svn/reactos/branches/aicom-network-fixes/drivers/net…
==============================================================================
--- branches/aicom-network-fixes/drivers/network/ndis/ndis/protocol.c [iso-8859-1]
(original)
+++ branches/aicom-network-fixes/drivers/network/ndis/ndis/protocol.c [iso-8859-1] Thu Nov
13 18:54:26 2008
@@ -610,7 +610,8 @@
}
VOID
-ndisBindMiniportsToProtocol(OUT PNDIS_STATUS Status, IN PPROTOCOL_BINDING Protocol, IN
PNDIS_PROTOCOL_CHARACTERISTICS ProtocolCharacteristics)
+NTAPI
+ndisBindMiniportsToProtocol(OUT PNDIS_STATUS Status, IN PNDIS_PROTOCOL_CHARACTERISTICS
ProtocolCharacteristics)
{
/*
* bind the protocol to all of its miniports
@@ -845,13 +846,19 @@
InitializeListHead(&Protocol->AdapterListHead);
- ndisBindMiniportsToProtocol(Status, Protocol, ProtocolCharacteristics);
+ /* We must set this before the call to ndisBindMiniportsToProtocol because the
protocol's
+ * BindAdapter handler might need it */
+
+ *NdisProtocolHandle = Protocol;
+
+ ndisBindMiniportsToProtocol(Status, &Protocol->Chars);
if (*Status == NDIS_STATUS_SUCCESS) {
ExInterlockedInsertTailList(&ProtocolListHead, &Protocol->ListEntry,
&ProtocolListLock);
- *NdisProtocolHandle = Protocol;
- } else
+ } else {
ExFreePool(Protocol);
+ *NdisProtocolHandle = NULL;
+ }
}
@@ -970,7 +977,7 @@
PPROTOCOL_BINDING Protocol = NdisProtocolHandle;
NDIS_STATUS NdisStatus;
- ndisBindMiniportsToProtocol(&NdisStatus, Protocol, &Protocol->Chars);
+ ndisBindMiniportsToProtocol(&NdisStatus, &Protocol->Chars);
}
/* EOF */