mirror of
https://github.com/reactos/reactos.git
synced 2025-06-27 16:59:51 +00:00
- Register the unload handler so it gets called by NDIS
svn path=/trunk/; revision=40806
This commit is contained in:
parent
bc49f505ef
commit
816a0d3ae7
2 changed files with 39 additions and 38 deletions
|
@ -1266,6 +1266,42 @@ NDIS_STATUS LANUnregisterAdapter(
|
||||||
return NdisStatus;
|
return NdisStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
VOID
|
||||||
|
NTAPI
|
||||||
|
LANUnregisterProtocol(VOID)
|
||||||
|
/*
|
||||||
|
* FUNCTION: Unregisters this protocol driver with NDIS
|
||||||
|
* NOTES: Does not care wether we are already registered
|
||||||
|
*/
|
||||||
|
{
|
||||||
|
TI_DbgPrint(DEBUG_DATALINK, ("Called.\n"));
|
||||||
|
|
||||||
|
if (ProtocolRegistered) {
|
||||||
|
NDIS_STATUS NdisStatus;
|
||||||
|
PLIST_ENTRY CurrentEntry;
|
||||||
|
PLIST_ENTRY NextEntry;
|
||||||
|
PLAN_ADAPTER Current;
|
||||||
|
KIRQL OldIrql;
|
||||||
|
|
||||||
|
TcpipAcquireSpinLock(&AdapterListLock, &OldIrql);
|
||||||
|
|
||||||
|
/* Search the list and remove every adapter we find */
|
||||||
|
CurrentEntry = AdapterListHead.Flink;
|
||||||
|
while (CurrentEntry != &AdapterListHead) {
|
||||||
|
NextEntry = CurrentEntry->Flink;
|
||||||
|
Current = CONTAINING_RECORD(CurrentEntry, LAN_ADAPTER, ListEntry);
|
||||||
|
/* Unregister it */
|
||||||
|
LANUnregisterAdapter(Current);
|
||||||
|
CurrentEntry = NextEntry;
|
||||||
|
}
|
||||||
|
|
||||||
|
TcpipReleaseSpinLock(&AdapterListLock, OldIrql);
|
||||||
|
|
||||||
|
NdisDeregisterProtocol(&NdisStatus, NdisProtocolHandle);
|
||||||
|
ProtocolRegistered = FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
NTAPI
|
NTAPI
|
||||||
ProtocolUnbindAdapter(
|
ProtocolUnbindAdapter(
|
||||||
|
@ -1315,6 +1351,7 @@ NTSTATUS LANRegisterProtocol(
|
||||||
ProtChars.BindAdapterHandler = ProtocolBindAdapter;
|
ProtChars.BindAdapterHandler = ProtocolBindAdapter;
|
||||||
ProtChars.PnPEventHandler = ProtocolPnPEvent;
|
ProtChars.PnPEventHandler = ProtocolPnPEvent;
|
||||||
ProtChars.UnbindAdapterHandler = ProtocolUnbindAdapter;
|
ProtChars.UnbindAdapterHandler = ProtocolUnbindAdapter;
|
||||||
|
ProtChars.UnloadHandler = LANUnregisterProtocol;
|
||||||
|
|
||||||
/* Try to register protocol */
|
/* Try to register protocol */
|
||||||
NdisRegisterProtocol(&NdisStatus,
|
NdisRegisterProtocol(&NdisStatus,
|
||||||
|
@ -1332,40 +1369,4 @@ NTSTATUS LANRegisterProtocol(
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
VOID LANUnregisterProtocol(
|
|
||||||
VOID)
|
|
||||||
/*
|
|
||||||
* FUNCTION: Unregisters this protocol driver with NDIS
|
|
||||||
* NOTES: Does not care wether we are already registered
|
|
||||||
*/
|
|
||||||
{
|
|
||||||
TI_DbgPrint(DEBUG_DATALINK, ("Called.\n"));
|
|
||||||
|
|
||||||
if (ProtocolRegistered) {
|
|
||||||
NDIS_STATUS NdisStatus;
|
|
||||||
PLIST_ENTRY CurrentEntry;
|
|
||||||
PLIST_ENTRY NextEntry;
|
|
||||||
PLAN_ADAPTER Current;
|
|
||||||
KIRQL OldIrql;
|
|
||||||
|
|
||||||
TcpipAcquireSpinLock(&AdapterListLock, &OldIrql);
|
|
||||||
|
|
||||||
/* Search the list and remove every adapter we find */
|
|
||||||
CurrentEntry = AdapterListHead.Flink;
|
|
||||||
while (CurrentEntry != &AdapterListHead) {
|
|
||||||
NextEntry = CurrentEntry->Flink;
|
|
||||||
Current = CONTAINING_RECORD(CurrentEntry, LAN_ADAPTER, ListEntry);
|
|
||||||
/* Unregister it */
|
|
||||||
LANUnregisterAdapter(Current);
|
|
||||||
CurrentEntry = NextEntry;
|
|
||||||
}
|
|
||||||
|
|
||||||
TcpipReleaseSpinLock(&AdapterListLock, OldIrql);
|
|
||||||
|
|
||||||
NdisDeregisterProtocol(&NdisStatus, NdisProtocolHandle);
|
|
||||||
ProtocolRegistered = FALSE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* EOF */
|
/* EOF */
|
||||||
|
|
|
@ -92,8 +92,8 @@ NDIS_STATUS LANUnregisterAdapter(
|
||||||
NTSTATUS LANRegisterProtocol(
|
NTSTATUS LANRegisterProtocol(
|
||||||
PNDIS_STRING Name);
|
PNDIS_STRING Name);
|
||||||
|
|
||||||
VOID LANUnregisterProtocol(
|
VOID NTAPI
|
||||||
VOID);
|
LANUnregisterProtocol(VOID);
|
||||||
|
|
||||||
VOID LANStartup();
|
VOID LANStartup();
|
||||||
VOID LANShutdown();
|
VOID LANShutdown();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue