Author: cgutman
Date: Sun Nov 13 06:02:08 2011
New Revision: 54372
URL:
http://svn.reactos.org/svn/reactos?rev=54372&view=rev
Log:
[NDIS]
- Fix a critical bug in NdisMGetDmaAlignment which was causing every NIC driver calling
this function to crash because we thought we were passed an NDIS_DMA_BLOCK handle when in
fact we receive an NDIS_MINIPORT_BLOCK handle
- Fixes RTL8169 and 3Com NICs (and probably several more) [bug 6651 and bug 4330]
Modified:
trunk/reactos/drivers/network/ndis/ndis/io.c
Modified: trunk/reactos/drivers/network/ndis/ndis/io.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/ndis/ndis/…
==============================================================================
--- trunk/reactos/drivers/network/ndis/ndis/io.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/ndis/ndis/io.c [iso-8859-1] Sun Nov 13 06:02:08 2011
@@ -831,6 +831,7 @@
NdisMReadDmaCounter(
IN NDIS_HANDLE MiniportDmaHandle)
{
+ /* NOTE: Unlike NdisMGetDmaAlignment() below, this is a handle to the DMA block */
PNDIS_DMA_BLOCK DmaBlock = MiniportDmaHandle;
PDMA_ADAPTER AdapterObject = (PDMA_ADAPTER)DmaBlock->SystemAdapterObject;
@@ -846,10 +847,11 @@
ULONG
EXPORT
NdisMGetDmaAlignment(
- IN NDIS_HANDLE MiniportDmaHandle)
-{
- PNDIS_DMA_BLOCK DmaBlock = MiniportDmaHandle;
- PDMA_ADAPTER AdapterObject = (PDMA_ADAPTER)DmaBlock->SystemAdapterObject;
+ IN NDIS_HANDLE MiniportAdapterHandle)
+{
+ /* NOTE: Unlike NdisMReadDmaCounter() above, this is a handle to the NDIS miniport
block */
+ PLOGICAL_ADAPTER Adapter = MiniportAdapterHandle;
+ PDMA_ADAPTER AdapterObject =
(PDMA_ADAPTER)Adapter->NdisMiniportBlock.SystemAdapterObject;
NDIS_DbgPrint(MAX_TRACE, ("Called.\n"));