ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
August 2005
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
23 participants
669 discussions
Start a n
N
ew thread
[royce] 17499: fix to not crash when built with msvc6 ( bad calling convention on imports ).
by royce@svn.reactos.com
fix to not crash when built with msvc6 ( bad calling convention on imports ). fix error-handling bugs, added missing error-handling Modified: trunk/reactos/tools/rbuild/backend/msvc/genguid.cpp _____ Modified: trunk/reactos/tools/rbuild/backend/msvc/genguid.cpp --- trunk/reactos/tools/rbuild/backend/msvc/genguid.cpp 2005-08-24 02:20:41 UTC (rev 17498) +++ trunk/reactos/tools/rbuild/backend/msvc/genguid.cpp 2005-08-24 02:55:08 UTC (rev 17499) @@ -24,41 +24,55 @@ #include <objbase.h> #include <stdio.h> -static HRESULT (*pCoInitialize)(PVOID); -static void (*pCoUninitialize)(void); -static HRESULT (*pCoCreateGuid)(GUID*); +typedef HRESULT _stdcall CoInitializeFunc ( PVOID ); +typedef void _stdcall CoUninitializeFunc ( void ); +typedef HRESULT _stdcall CoCreateGuidFunc ( GUID* ); +static CoInitializeFunc *pCoInitialize = NULL; +static CoUninitializeFunc *pCoUninitialize = NULL; +static CoCreateGuidFunc *pCoCreateGuid = NULL; + void gen_guid() { GUID m_guid; HRESULT result; - char *strfmt = ""; - HMODULE olelib; + bool good_guid = false; - /* Load ole32. We will need it later on */ - olelib = LoadLibraryA( "ole32.dll" ); - - if (olelib != NULL) - pCoInitialize = (HRESULT (*)(void*))GetProcAddress( olelib, "CoInitialize" ); - pCoUninitialize = (void (*)())GetProcAddress( olelib, "CoUninitialize" ); - pCoCreateGuid = (HRESULT (*)(GUID*))GetProcAddress( olelib, "CoCreateGuid" ); - - if (pCoInitialize(NULL) != S_OK) + // Load ole32. We will need it later on + HMODULE olelib = LoadLibrary ( "ole32.dll" ); + if ( olelib != NULL ) { - printf("Unable to initalize OLE libraries\n"); + pCoInitialize = (CoInitializeFunc *)GetProcAddress( olelib, "CoInitialize" ); + pCoUninitialize = (CoUninitializeFunc *)GetProcAddress( olelib, "CoUninitialize" ); + pCoCreateGuid = (CoCreateGuidFunc *)GetProcAddress( olelib, "CoCreateGuid" ); + if ( !pCoInitialize || !pCoUninitialize || !pCoCreateGuid ) + printf ( "Missing exports from ole32.dll\n" ); + else + { + if (pCoInitialize(NULL) != S_OK) + printf("Unable to initalize OLE libraries\n"); + else + { + result = pCoCreateGuid(&m_guid); + if (result != S_OK) + printf("Unable to create GUID\n"); + else + good_guid = true; + pCoUninitialize(); + } + } + FreeLibrary ( olelib ); } - result = pCoCreateGuid(&m_guid); - if (result != S_OK) { - printf("Unable to create GUID\n"); - pCoUninitialize(); + if ( !good_guid ) + { + // TODO FIXME - fall-back to random #'s } - strfmt = "%08lX-%04X-%04x-%02X%02X-%02X%02X%02X%02X%02X%02X\r\n"; + const char* strfmt = "%08lX-%04X-%04x-%02X%02X-%02X%02X%02X%02X%02X%02X\r\n"; printf(strfmt,m_guid.Data1,m_guid.Data2,m_guid.Data3,m_guid.Data4[0], - m_guid.Data4[1],m_guid.Data4[2],m_guid.Data4[3],m_guid.Data4[4],m_guid.D ata4[5], - m_guid.Data4[6],m_guid.Data4[7],m_guid.Data1,m_guid.Data2,m_guid.Data3,m _guid.Data4[0], - m_guid.Data4[1],m_guid.Data4[2],m_guid.Data4[3],m_guid.Data4[4],m_guid.D ata4[5], - m_guid.Data4[6],m_guid.Data4[7]); - pCoUninitialize(); + m_guid.Data4[1],m_guid.Data4[2],m_guid.Data4[3],m_guid.Data4[4],m_guid.D ata4[5], + m_guid.Data4[6],m_guid.Data4[7],m_guid.Data1,m_guid.Data2,m_guid.Data3,m _guid.Data4[0], + m_guid.Data4[1],m_guid.Data4[2],m_guid.Data4[3],m_guid.Data4[4],m_guid.D ata4[5], + m_guid.Data4[6],m_guid.Data4[7]); } #else /* Linux, etc */
19 years, 4 months
1
0
0
0
[navaraf] 17498: Get rid of one memory leak and two more ROS-only fields in LOGICAL_ADAPTER structure.
by navaraf@svn.reactos.com
Get rid of one memory leak and two more ROS-only fields in LOGICAL_ADAPTER structure. Modified: trunk/reactos/drivers/net/ndis/include/miniport.h Modified: trunk/reactos/drivers/net/ndis/ndis/miniport.c _____ Modified: trunk/reactos/drivers/net/ndis/include/miniport.h --- trunk/reactos/drivers/net/ndis/include/miniport.h 2005-08-24 01:51:49 UTC (rev 17497) +++ trunk/reactos/drivers/net/ndis/include/miniport.h 2005-08-24 02:20:41 UTC (rev 17498) @@ -80,8 +80,6 @@ LIST_ENTRY ListEntry; /* Entry on global list */ LIST_ENTRY MiniportListEntry; /* Entry on miniport driver list */ LIST_ENTRY ProtocolListHead; /* List of bound protocols */ - PVOID QueryBuffer; /* Buffer to use for queries */ - ULONG QueryBufferLength; /* Length of QueryBuffer */ ULONG MediumHeaderSize; /* Size of medium header */ HARDWARE_ADDRESS Address; /* Hardware address of adapter */ ULONG AddressLength; /* Length of hardware address */ @@ -128,6 +126,7 @@ PLOGICAL_ADAPTER Adapter, NDIS_OID Oid, ULONG Size, + PVOID Buffer, PULONG BytesWritten); NDIS_STATUS _____ Modified: trunk/reactos/drivers/net/ndis/ndis/miniport.c --- trunk/reactos/drivers/net/ndis/ndis/miniport.c 2005-08-24 01:51:49 UTC (rev 17497) +++ trunk/reactos/drivers/net/ndis/ndis/miniport.c 2005-08-24 02:20:41 UTC (rev 17498) @@ -548,13 +548,15 @@ PLOGICAL_ADAPTER Adapter, NDIS_OID Oid, ULONG Size, + PVOID Buffer, PULONG BytesWritten) /* * FUNCTION: Queries a logical adapter for properties * ARGUMENTS: * Adapter = Pointer to the logical adapter object to query * Oid = Specifies the Object ID to query for - * Size = If non-zero overrides the length in the adapter object + * Size = Size of the passed buffer + * Buffer = Buffer for the output * BytesWritten = Address of buffer to place number of bytes written * NOTES: * If the specified buffer is too small, a new buffer is allocated, @@ -570,33 +572,17 @@ NDIS_DbgPrint(DEBUG_MINIPORT, ("Called.\n")); - if (Adapter->QueryBufferLength == 0) - { - /* XXX is 32 the right number? */ - Adapter->QueryBuffer = ExAllocatePool(NonPagedPool, (Size == 0)? 32 : Size); - - if (!Adapter->QueryBuffer) - { - NDIS_DbgPrint(MIN_TRACE, ("Insufficient resources.\n")); - return NDIS_STATUS_RESOURCES; - } - - /* ditto */ - Adapter->QueryBufferLength = (Size == 0)? 32 : Size; - } - - /* this is the third time i've seen this conditional */ - BytesNeeded = (Size == 0)? Adapter->QueryBufferLength : Size; - /* call the miniport's queryinfo handler */ NdisStatus = (*Adapter->NdisMiniportBlock.DriverHandle->MiniportCharacteristics.Query InformationHandler)( Adapter->NdisMiniportBlock.MiniportAdapterContext, Oid, - Adapter->QueryBuffer, - BytesNeeded, + Buffer, + Size, BytesWritten, &BytesNeeded); + /* FIXME: Wait in pending case! */ + /* XXX is status_pending part of success macro? */ if ((NT_SUCCESS(NdisStatus)) || (NdisStatus == NDIS_STATUS_PENDING)) { @@ -604,28 +590,6 @@ return NdisStatus; } - if (NdisStatus == NDIS_STATUS_INVALID_LENGTH) - { - ExFreePool(Adapter->QueryBuffer); - - Adapter->QueryBufferLength += BytesNeeded; - Adapter->QueryBuffer = ExAllocatePool(NonPagedPool, Adapter->QueryBufferLength); - - if (!Adapter->QueryBuffer) - { - NDIS_DbgPrint(MIN_TRACE, ("Insufficient resources.\n")); - return NDIS_STATUS_RESOURCES; - } - - NdisStatus = (*Adapter->NdisMiniportBlock.DriverHandle->MiniportCharacteristics.Query InformationHandler)( - Adapter->NdisMiniportBlock.MiniportAdapterContext, - Oid, - Adapter->QueryBuffer, - Adapter->QueryBufferLength, - BytesWritten, - &BytesNeeded); - } - return NdisStatus; } @@ -1167,7 +1131,9 @@ NDIS_DbgPrint(MAX_TRACE, ("Called.\n")); /* Get MAC options for adapter */ - NdisStatus = MiniQueryInformation(Adapter, OID_GEN_MAC_OPTIONS, 0, &BytesWritten); + NdisStatus = MiniQueryInformation(Adapter, OID_GEN_MAC_OPTIONS, sizeof(UINT), + &Adapter->NdisMiniportBlock.MacOptions, + &BytesWritten); if (NdisStatus != NDIS_STATUS_SUCCESS) { @@ -1175,12 +1141,11 @@ return NdisStatus; } - RtlCopyMemory(&Adapter->NdisMiniportBlock.MacOptions, Adapter->QueryBuffer, sizeof(UINT)); - NDIS_DbgPrint(DEBUG_MINIPORT, ("MacOptions (0x%X).\n", Adapter->NdisMiniportBlock.MacOptions)); /* Get current hardware address of adapter */ - NdisStatus = MiniQueryInformation(Adapter, AddressOID, 0, &BytesWritten); + NdisStatus = MiniQueryInformation(Adapter, AddressOID, Adapter->AddressLength, + &Adapter->Address, &BytesWritten); if (NdisStatus != NDIS_STATUS_SUCCESS) { @@ -1188,7 +1153,6 @@ return NdisStatus; } - RtlCopyMemory(&Adapter->Address, Adapter->QueryBuffer, Adapter->AddressLength); #ifdef DBG { /* 802.3 only */ @@ -1200,7 +1164,8 @@ #endif /* DBG */ /* Get maximum lookahead buffer size of adapter */ - NdisStatus = MiniQueryInformation(Adapter, OID_GEN_MAXIMUM_LOOKAHEAD, 0, &BytesWritten); + NdisStatus = MiniQueryInformation(Adapter, OID_GEN_MAXIMUM_LOOKAHEAD, sizeof(ULONG), + &Adapter->NdisMiniportBlock.MaximumLookahead, &BytesWritten); if (NdisStatus != NDIS_STATUS_SUCCESS) { @@ -1208,12 +1173,11 @@ return NdisStatus; } - Adapter->NdisMiniportBlock.MaximumLookahead = *((PULONG)Adapter->QueryBuffer); - NDIS_DbgPrint(DEBUG_MINIPORT, ("MaxLookaheadLength (0x%X).\n", Adapter->NdisMiniportBlock.MaximumLookahead)); /* Get current lookahead buffer size of adapter */ - NdisStatus = MiniQueryInformation(Adapter, OID_GEN_CURRENT_LOOKAHEAD, 0, &BytesWritten); + NdisStatus = MiniQueryInformation(Adapter, OID_GEN_CURRENT_LOOKAHEAD, sizeof(ULONG), + &Adapter->NdisMiniportBlock.CurrentLookahead, &BytesWritten); if (NdisStatus != NDIS_STATUS_SUCCESS) { @@ -1221,8 +1185,6 @@ return NdisStatus; } - Adapter->NdisMiniportBlock.CurrentLookahead = *((PULONG)Adapter->QueryBuffer); - NDIS_DbgPrint(DEBUG_MINIPORT, ("CurLookaheadLength (0x%X).\n", Adapter->NdisMiniportBlock.CurrentLookahead)); if (Adapter->NdisMiniportBlock.MaximumLookahead != 0)
19 years, 4 months
1
0
0
0
[navaraf] 17497: Start removing dead code and ReactOS specific structure fields (the NDIS structures are official, documented and contain all we need).
by navaraf@svn.reactos.com
Start removing dead code and ReactOS specific structure fields (the NDIS structures are official, documented and contain all we need). Modified: trunk/reactos/drivers/net/ndis/include/debug.h Modified: trunk/reactos/drivers/net/ndis/include/miniport.h Modified: trunk/reactos/drivers/net/ndis/include/ndissys.h Modified: trunk/reactos/drivers/net/ndis/include/protocol.h Modified: trunk/reactos/drivers/net/ndis/ndis/hardware.c Modified: trunk/reactos/drivers/net/ndis/ndis/io.c Modified: trunk/reactos/drivers/net/ndis/ndis/memory.c Modified: trunk/reactos/drivers/net/ndis/ndis/miniport.c Modified: trunk/reactos/drivers/net/ndis/ndis/protocol.c _____ Modified: trunk/reactos/drivers/net/ndis/include/debug.h --- trunk/reactos/drivers/net/ndis/include/debug.h 2005-08-24 00:04:21 UTC (rev 17496) +++ trunk/reactos/drivers/net/ndis/include/debug.h 2005-08-24 01:51:49 UTC (rev 17497) @@ -14,7 +14,6 @@ #define MID_TRACE 0x00000002 #define MAX_TRACE 0x00000003 -#define DEBUG_REFCOUNT 0x00000100 #define DEBUG_MINIPORT 0x00000200 #define DEBUG_PROTOCOL 0x00000400 #define DEBUG_PACKET 0x00000800 _____ Modified: trunk/reactos/drivers/net/ndis/include/miniport.h --- trunk/reactos/drivers/net/ndis/include/miniport.h 2005-08-24 00:04:21 UTC (rev 17496) +++ trunk/reactos/drivers/net/ndis/include/miniport.h 2005-08-24 01:51:49 UTC (rev 17497) @@ -19,16 +19,15 @@ } HARDWARE_ADDRESS, *PHARDWARE_ADDRESS; /* Information about a miniport */ -typedef struct _MINIPORT_DRIVER { - LIST_ENTRY ListEntry; /* Entry on global list */ - KSPIN_LOCK Lock; /* Protecting spin lock */ - ULONG RefCount; /* Reference count */ - NDIS_MINIPORT_CHARACTERISTICS Chars; /* Miniport characteristics */ - WORK_QUEUE_ITEM WorkItem; /* Work item */ - PDRIVER_OBJECT DriverObject; /* Driver object of miniport */ - LIST_ENTRY AdapterListHead; /* Adapters created by miniport */ - PUNICODE_STRING RegistryPath; /* SCM Registry key */ -} MINIPORT_DRIVER, *PMINIPORT_DRIVER; +typedef struct _NDIS_M_DRIVER_BLOCK { + LIST_ENTRY ListEntry; /* Entry on global list */ + KSPIN_LOCK Lock; /* Protecting spin lock */ + NDIS_MINIPORT_CHARACTERISTICS MiniportCharacteristics; /* Miniport characteristics */ + WORK_QUEUE_ITEM WorkItem; /* Work item */ + PDRIVER_OBJECT DriverObject; /* Driver object of miniport */ + LIST_ENTRY DeviceList; /* Adapters created by miniport */ + PUNICODE_STRING RegistryPath; /* SCM Registry key */ +} NDIS_M_DRIVER_BLOCK, *PNDIS_M_DRIVER_BLOCK; /* resources allocated on behalf on the miniport */ #define MINIPORT_RESOURCE_TYPE_MEMORY 0 @@ -69,25 +68,18 @@ ULONG BusNumber; } NDIS_WRAPPER_CONTEXT, *PNDIS_WRAPPER_CONTEXT; -#define GET_MINIPORT_DRIVER(Handle)((PMINIPORT_DRIVER)Handle) +#define GET_MINIPORT_DRIVER(Handle)((PNDIS_M_DRIVER_BLOCK)Handle) /* Information about a logical adapter */ typedef struct _LOGICAL_ADAPTER { NDIS_MINIPORT_BLOCK NdisMiniportBlock; /* NDIS defined fields */ - KDPC MiniportDpc; /* DPC routine for adapter */ BOOLEAN MiniportBusy; /* A MiniportXxx routine is executing */ - ULONG WorkQueueLevel; /* Number of used work item buffers */ - INTERNAL_NDIS_MINIPORT_WORK_ITEM WorkQueue[NDIS_MINIPORT_WORK_QUEUE_SIZE]; - PINTERNAL_NDIS_MINIPORT_WORK_ITEM WorkQueueHead; /* Head of work queue */ - PINTERNAL_NDIS_MINIPORT_WORK_ITEM WorkQueueTail; /* Tail of work queue */ + PNDIS_MINIPORT_WORK_ITEM WorkQueueHead; /* Head of work queue */ + PNDIS_MINIPORT_WORK_ITEM WorkQueueTail; /* Tail of work queue */ LIST_ENTRY ListEntry; /* Entry on global list */ LIST_ENTRY MiniportListEntry; /* Entry on miniport driver list */ LIST_ENTRY ProtocolListHead; /* List of bound protocols */ - ULONG RefCount; /* Reference count */ - PMINIPORT_DRIVER Miniport; /* Miniport owning this adapter */ - ULONG Attributes; /* Attributes of adapter */ - BOOLEAN AttributesSet; /* Whether NdisMSetAttributes(Ex) has been called */ PVOID QueryBuffer; /* Buffer to use for queries */ ULONG QueryBufferLength; /* Length of QueryBuffer */ ULONG MediumHeaderSize; /* Size of medium header */ @@ -95,12 +87,7 @@ ULONG AddressLength; /* Length of hardware address */ PUCHAR LookaheadBuffer; /* Pointer to lookahead buffer */ ULONG LookaheadLength; /* Length of lookahead buffer */ - PNDIS_PACKET PacketQueueHead; /* Head of packet queue */ - PNDIS_PACKET PacketQueueTail; /* Head of packet queue */ - PNDIS_PACKET LoopPacket; /* Current packet beeing looped */ PMINIPORT_BUGCHECK_CONTEXT BugcheckContext; /* Adapter's shutdown handler */ - KEVENT DmaEvent; /* Event to support DMA register allocation */ - KSPIN_LOCK DmaLock; /* Spinlock to protect the dma list */ } LOGICAL_ADAPTER, *PLOGICAL_ADAPTER; #define GET_LOGICAL_ADAPTER(Handle)((PLOGICAL_ADAPTER)Handle) @@ -146,7 +133,7 @@ NDIS_STATUS FASTCALL MiniQueueWorkItem( - struct _ADAPTER_BINDING *AdapterBinding, + PLOGICAL_ADAPTER Adapter, NDIS_WORK_ITEM_TYPE WorkItemType, PVOID WorkItemContext); @@ -154,13 +141,12 @@ FASTCALL MiniDequeueWorkItem( PLOGICAL_ADAPTER Adapter, - struct _ADAPTER_BINDING **AdapterBinding, NDIS_WORK_ITEM_TYPE *WorkItemType, PVOID *WorkItemContext); NDIS_STATUS MiniDoRequest( - struct _ADAPTER_BINDING *AdapterBinding, + PNDIS_MINIPORT_BLOCK Adapter, PNDIS_REQUEST NdisRequest); BOOLEAN _____ Modified: trunk/reactos/drivers/net/ndis/include/ndissys.h --- trunk/reactos/drivers/net/ndis/include/ndissys.h 2005-08-24 00:04:21 UTC (rev 17496) +++ trunk/reactos/drivers/net/ndis/include/ndissys.h 2005-08-24 01:51:49 UTC (rev 17497) @@ -30,16 +30,8 @@ #include <ndk/ntndk.h> #endif -#define NDIS_MINIPORT_WORK_QUEUE_SIZE 10 - struct _ADAPTER_BINDING; -typedef struct _INTERNAL_NDIS_MINIPORT_WORK_ITEM { - SINGLE_LIST_ENTRY Link; - struct _ADAPTER_BINDING *AdapterBinding; - NDIS_MINIPORT_WORK_ITEM RealWorkItem; -} INTERNAL_NDIS_MINIPORT_WORK_ITEM, *PINTERNAL_NDIS_MINIPORT_WORK_ITEM; - typedef struct _NDISI_PACKET_POOL { NDIS_SPIN_LOCK SpinLock; struct _NDIS_PACKET *FreeList; @@ -60,50 +52,6 @@ #define TAG(A, B, C, D) (ULONG)(((A)<<0) + ((B)<<8) + ((C)<<16) + ((D)<<24)) #define NDIS_TAG 0x4e4d4953 -#ifdef DBG - -#define DEBUG_REFCHECK(Object) { \ - if ((Object)->RefCount <= 0) { \ - NDIS_DbgPrint(MIN_TRACE, ("Object at (0x%X) has invalid reference count (%d).\n", \ - (Object), (Object)->RefCount)); \ - } \ -} - -#else - -#define DEBUG_REFCHECK(Object) - -#endif - - -/* - * VOID ReferenceObject( - * PVOID Object) - */ -#define ReferenceObject(Object) \ -{ \ - DEBUG_REFCHECK(Object); \ - NDIS_DbgPrint(DEBUG_REFCOUNT, ("Referencing object at (0x%X). RefCount (%d).\n", \ - (Object), (Object)->RefCount)); \ - \ - InterlockedIncrement((PLONG)&((Object)->RefCount)); \ -} - -/* - * VOID DereferenceObject( - * PVOID Object) - */ -#define DereferenceObject(Object) \ -{ \ - DEBUG_REFCHECK(Object); \ - NDIS_DbgPrint(DEBUG_REFCOUNT, ("Dereferencing object at (0x%X). RefCount (%d).\n", \ - (Object), (Object)->RefCount)); \ - \ - if (InterlockedDecrement((PLONG)&((Object)->RefCount)) == 0) \ - PoolFreeBuffer(Object); \ -} - - #define MIN(value1, value2) \ ((value1 < value2)? value1 : value2) _____ Modified: trunk/reactos/drivers/net/ndis/include/protocol.h --- trunk/reactos/drivers/net/ndis/include/protocol.h 2005-08-24 00:04:21 UTC (rev 17496) +++ trunk/reactos/drivers/net/ndis/include/protocol.h 2005-08-24 01:51:49 UTC (rev 17497) @@ -11,7 +11,6 @@ typedef struct _PROTOCOL_BINDING { LIST_ENTRY ListEntry; /* Entry on global list */ KSPIN_LOCK Lock; /* Protecting spin lock */ - ULONG RefCount; /* Reference count */ NDIS_PROTOCOL_CHARACTERISTICS Chars; /* Characteristics */ WORK_QUEUE_ITEM WorkItem; /* Work item */ LIST_ENTRY AdapterListHead; /* List of adapter bindings */ @@ -27,11 +26,17 @@ LIST_ENTRY ProtocolListEntry; /* Entry on protocol binding adapter list */ LIST_ENTRY AdapterListEntry; /* Entry on logical adapter list */ KSPIN_LOCK Lock; /* Protecting spin lock */ - ULONG RefCount; /* Reference count */ PPROTOCOL_BINDING ProtocolBinding; /* Protocol that opened adapter */ PLOGICAL_ADAPTER Adapter; /* Adapter opened by protocol */ } ADAPTER_BINDING, *PADAPTER_BINDING; +typedef struct _NDIS_REQUEST_MAC_BLOCK { + PVOID Unknown1; + PNDIS_OPEN_BLOCK Binding; + PVOID Unknown3; + PVOID Unknown4; +} NDIS_REQUEST_MAC_BLOCK, *PNDIS_REQUEST_MAC_BLOCK; + #define GET_ADAPTER_BINDING(Handle)((PADAPTER_BINDING)Handle) _____ Modified: trunk/reactos/drivers/net/ndis/ndis/hardware.c --- trunk/reactos/drivers/net/ndis/ndis/hardware.c 2005-08-24 00:04:21 UTC (rev 17496) +++ trunk/reactos/drivers/net/ndis/ndis/hardware.c 2005-08-24 01:51:49 UTC (rev 17497) @@ -61,7 +61,7 @@ IN ULONG SlotNumber, OUT PNDIS_RESOURCE_LIST *AssignedResources) { - PNDIS_MINIPORT_BLOCK MiniportBlock = &((PLOGICAL_ADAPTER)MiniportHandle)->NdisMiniportBlock; + PNDIS_MINIPORT_BLOCK MiniportBlock = (PNDIS_MINIPORT_BLOCK)MiniportHandle; if (MiniportBlock->BusType != PCIBus || MiniportBlock->AllocatedResources == NULL) @@ -196,11 +196,10 @@ IN PVOID Buffer, IN ULONG Length) { - PLOGICAL_ADAPTER Adapter = (PLOGICAL_ADAPTER)NdisAdapterHandle; + PNDIS_MINIPORT_BLOCK Adapter = (PNDIS_MINIPORT_BLOCK)NdisAdapterHandle; /* Slot number is ignored since W2K for all NDIS drivers. */ return HalGetBusDataByOffset(PCIConfiguration, - Adapter->NdisMiniportBlock.BusNumber, - Adapter->NdisMiniportBlock.SlotNumber, + Adapter->BusNumber, Adapter->SlotNumber, Buffer, Offset, Length); } @@ -217,11 +216,10 @@ IN PVOID Buffer, IN ULONG Length) { - PLOGICAL_ADAPTER Adapter = (PLOGICAL_ADAPTER)NdisAdapterHandle; + PNDIS_MINIPORT_BLOCK Adapter = (PNDIS_MINIPORT_BLOCK)NdisAdapterHandle; /* Slot number is ignored since W2K for all NDIS drivers. */ return HalSetBusDataByOffset(PCIConfiguration, - Adapter->NdisMiniportBlock.BusNumber, - Adapter->NdisMiniportBlock.SlotNumber, + Adapter->BusNumber, Adapter->SlotNumber, Buffer, Offset, Length); } _____ Modified: trunk/reactos/drivers/net/ndis/ndis/io.c --- trunk/reactos/drivers/net/ndis/ndis/io.c 2005-08-24 00:04:21 UTC (rev 17496) +++ trunk/reactos/drivers/net/ndis/ndis/io.c 2005-08-24 01:51:49 UTC (rev 17497) @@ -44,14 +44,14 @@ KeReleaseSpinLockFromDpcLevel(&Adapter->NdisMiniportBlock.Lock); /* Call the deferred interrupt service handler for this adapter */ - (*Adapter->Miniport->Chars.HandleInterruptHandler)( + (*Adapter->NdisMiniportBlock.DriverHandle->MiniportCharacteristics.Handl eInterruptHandler)( Adapter->NdisMiniportBlock.MiniportAdapterContext); KeAcquireSpinLockAtDpcLevel(&Adapter->NdisMiniportBlock.Lock); { if ((!WasBusy) && (Adapter->WorkQueueHead)) { - KeInsertQueueDpc(&Adapter->MiniportDpc, NULL, NULL); + KeInsertQueueDpc(&Adapter->NdisMiniportBlock.DeferredDpc, NULL, NULL); } else { @@ -62,8 +62,8 @@ /* re-enable the interrupt */ NDIS_DbgPrint(MAX_TRACE, ("re-enabling the interrupt\n")); - if(Adapter->Miniport->Chars.EnableInterruptHandler) - (*Adapter->Miniport->Chars.EnableInterruptHandler)( + if(Adapter->NdisMiniportBlock.DriverHandle->MiniportCharacteristics.Enab leInterruptHandler) + (*Adapter->NdisMiniportBlock.DriverHandle->MiniportCharacteristics.Enabl eInterruptHandler)( Adapter->NdisMiniportBlock.MiniportAdapterContext); NDIS_DbgPrint(MAX_TRACE, ("Leaving.\n")); @@ -84,18 +84,19 @@ { BOOLEAN InterruptRecognized; BOOLEAN QueueMiniportHandleInterrupt; - PLOGICAL_ADAPTER Adapter = GET_LOGICAL_ADAPTER(ServiceContext); + PNDIS_MINIPORT_BLOCK Adapter = (PNDIS_MINIPORT_BLOCK)ServiceContext; NDIS_DbgPrint(MAX_TRACE, ("Called. Adapter (0x%X)\n", Adapter)); - (*Adapter->Miniport->Chars.ISRHandler)(&InterruptRecognized, + (*Adapter->DriverHandle->MiniportCharacteristics.ISRHandler)( + &InterruptRecognized, &QueueMiniportHandleInterrupt, - Adapter->NdisMiniportBlock.MiniportAdapterContext); + Adapter->MiniportAdapterContext); if (QueueMiniportHandleInterrupt) { NDIS_DbgPrint(MAX_TRACE, ("Queueing DPC.\n")); - KeInsertQueueDpc(&Adapter->NdisMiniportBlock.Interrupt->InterruptDpc, NULL, NULL); + KeInsertQueueDpc(&Adapter->Interrupt->InterruptDpc, NULL, NULL); } NDIS_DbgPrint(MAX_TRACE, ("Leaving.\n")); @@ -228,15 +229,15 @@ * - Called at IRQL = DISPATCH_LEVEL */ { - PLOGICAL_ADAPTER Adapter = (PLOGICAL_ADAPTER)Context; + PNDIS_MINIPORT_BLOCK Adapter = (PNDIS_MINIPORT_BLOCK)Context; NDIS_DbgPrint(MAX_TRACE, ("Called.\n")); - Adapter->NdisMiniportBlock.MapRegisters[Adapter->NdisMiniportBlock.Curre ntMapRegister].MapRegister = MapRegisterBase; + Adapter->MapRegisters[Adapter->CurrentMapRegister].MapRegister = MapRegisterBase; NDIS_DbgPrint(MAX_TRACE, ("setting event and leaving.\n")); - KeSetEvent(&Adapter->DmaEvent, 0, FALSE); + KeSetEvent(Adapter->AllocationEvent, 0, FALSE); /* this is only the thing to do for busmaster NICs */ return DeallocateObjectKeepRegisters; @@ -284,33 +285,34 @@ * map registers to 32. */ { - DEVICE_DESCRIPTION Description; - PDMA_ADAPTER AdapterObject = 0; - UINT MapRegistersPerBaseRegister = 0; - ULONG AvailableMapRegisters; - NTSTATUS NtStatus; - PLOGICAL_ADAPTER Adapter = 0; - PDEVICE_OBJECT DeviceObject = 0; - KIRQL OldIrql; + DEVICE_DESCRIPTION Description; + PDMA_ADAPTER AdapterObject = 0; + UINT MapRegistersPerBaseRegister = 0; + ULONG AvailableMapRegisters; + NTSTATUS NtStatus; + PNDIS_MINIPORT_BLOCK Adapter = 0; + PDEVICE_OBJECT DeviceObject = 0; + KEVENT AllocationEvent; + KIRQL OldIrql; NDIS_DbgPrint(MAX_TRACE, ("called: Handle 0x%x, DmaChannel 0x%x, DmaSize 0x%x, BaseMapRegsNeeded: 0x%x, MaxBuffer: 0x%x.\n", MiniportAdapterHandle, DmaChannel, DmaSize, BaseMapRegistersNeeded, MaximumBufferSize)); memset(&Description,0,sizeof(Description)); - Adapter = (PLOGICAL_ADAPTER)MiniportAdapterHandle; + Adapter = (PNDIS_MINIPORT_BLOCK)MiniportAdapterHandle; ASSERT(Adapter); /* only bus masters may call this routine */ - ASSERT(Adapter->NdisMiniportBlock.Flags & NDIS_ATTRIBUTE_BUS_MASTER); - if(!(Adapter->NdisMiniportBlock.Flags & NDIS_ATTRIBUTE_BUS_MASTER)) + ASSERT(Adapter->Flags & NDIS_ATTRIBUTE_BUS_MASTER); + if(!(Adapter->Flags & NDIS_ATTRIBUTE_BUS_MASTER)) return NDIS_STATUS_SUCCESS; - DeviceObject = Adapter->NdisMiniportBlock.DeviceObject; + DeviceObject = Adapter->DeviceObject; - KeInitializeEvent(&Adapter->DmaEvent, NotificationEvent, FALSE); - KeInitializeSpinLock(&Adapter->DmaLock); + KeInitializeEvent(&AllocationEvent, NotificationEvent, FALSE); + Adapter->AllocationEvent = &AllocationEvent; /* * map registers correlate to physical pages. ndis documents a @@ -330,12 +332,12 @@ Description.Master = TRUE; /* implied by calling this function */ Description.ScatterGather = TRUE; /* XXX UNTRUE: All BM DMA are S/G (ms seems to do this) */ Description.Dma32BitAddresses = DmaSize; - Description.BusNumber = Adapter->NdisMiniportBlock.BusNumber; - Description.InterfaceType = Adapter->NdisMiniportBlock.BusType; + Description.BusNumber = Adapter->BusNumber; + Description.InterfaceType = Adapter->BusType; Description.DmaChannel = DmaChannel; Description.MaximumLength = MaximumBufferSize; - if(Adapter->NdisMiniportBlock.AdapterType == Isa) + if(Adapter->AdapterType == Isa) { /* system dma */ if(DmaChannel < 4) @@ -345,7 +347,7 @@ Description.DmaSpeed = Compatible; } - else if(Adapter->NdisMiniportBlock.AdapterType == PCIBus) + else if(Adapter->AdapterType == PCIBus) { if(DmaSize == NDIS_DMA_64BITS) Description.Dma64BitAddresses = TRUE; @@ -359,8 +361,7 @@ } AdapterObject = IoGetDmaAdapter( - Adapter->NdisMiniportBlock.PhysicalDeviceObject, - &Description, &AvailableMapRegisters); + Adapter->PhysicalDeviceObject, &Description, &AvailableMapRegisters); if(!AdapterObject) { @@ -368,7 +369,7 @@ return NDIS_STATUS_RESOURCES; } - Adapter->NdisMiniportBlock.SystemAdapterObject = AdapterObject; + Adapter->SystemAdapterObject = AdapterObject; if(AvailableMapRegisters < MapRegistersPerBaseRegister) { @@ -379,22 +380,22 @@ } /* allocate & zero space in the miniport block for the registers */ - Adapter->NdisMiniportBlock.MapRegisters = ExAllocatePool(NonPagedPool, BaseMapRegistersNeeded * sizeof(MAP_REGISTER_ENTRY)); - if(!Adapter->NdisMiniportBlock.MapRegisters) + Adapter->MapRegisters = ExAllocatePool(NonPagedPool, BaseMapRegistersNeeded * sizeof(MAP_REGISTER_ENTRY)); + if(!Adapter->MapRegisters) { NDIS_DbgPrint(MIN_TRACE, ("insufficient resources.\n")); return NDIS_STATUS_RESOURCES; } - memset(Adapter->NdisMiniportBlock.MapRegisters, 0, BaseMapRegistersNeeded * sizeof(MAP_REGISTER_ENTRY)); - Adapter->NdisMiniportBlock.BaseMapRegistersNeeded = (USHORT)BaseMapRegistersNeeded; + memset(Adapter->MapRegisters, 0, BaseMapRegistersNeeded * sizeof(MAP_REGISTER_ENTRY)); + Adapter->BaseMapRegistersNeeded = (USHORT)BaseMapRegistersNeeded; while(BaseMapRegistersNeeded) { NDIS_DbgPrint(MAX_TRACE, ("iterating, basemapregistersneeded = %d\n", BaseMapRegistersNeeded)); BaseMapRegistersNeeded--; - Adapter->NdisMiniportBlock.CurrentMapRegister = (USHORT)BaseMapRegistersNeeded; + Adapter->CurrentMapRegister = (USHORT)BaseMapRegistersNeeded; KeRaiseIrql(DISPATCH_LEVEL, &OldIrql); { NtStatus = AdapterObject->DmaOperations->AllocateAdapterChannel( @@ -411,7 +412,7 @@ NDIS_DbgPrint(MAX_TRACE, ("waiting on event\n")); - NtStatus = KeWaitForSingleObject(&Adapter->DmaEvent, Executive, KernelMode, FALSE, 0); + NtStatus = KeWaitForSingleObject(&AllocationEvent, Executive, KernelMode, FALSE, 0); if(!NT_SUCCESS(NtStatus)) { @@ -421,7 +422,7 @@ NDIS_DbgPrint(MAX_TRACE, ("resetting event\n")); - KeResetEvent(&Adapter->DmaEvent); + KeResetEvent(&AllocationEvent); } NDIS_DbgPrint(MAX_TRACE, ("returning success\n")); @@ -458,7 +459,7 @@ * - The caller supplies storage for the physical address array. */ { - PLOGICAL_ADAPTER Adapter = 0; + PNDIS_MINIPORT_BLOCK Adapter; PVOID CurrentVa; ULONG TotalLength; PHYSICAL_ADDRESS ReturnedAddress; @@ -467,7 +468,7 @@ ASSERT(KeGetCurrentIrql() <= DISPATCH_LEVEL); ASSERT(MiniportAdapterHandle && Buffer && PhysicalAddressArray && ArraySize); - Adapter = (PLOGICAL_ADAPTER)MiniportAdapterHandle; + Adapter = (PNDIS_MINIPORT_BLOCK)MiniportAdapterHandle; CurrentVa = MmGetMdlVirtualAddress(Buffer); TotalLength = MmGetMdlByteCount(Buffer); @@ -475,12 +476,12 @@ { ULONG Length = TotalLength; - ReturnedAddress = Adapter->NdisMiniportBlock.SystemAdapterObject->DmaOperations->MapTransf er( - Adapter->NdisMiniportBlock.SystemAdapterObject, Buffer, - Adapter->NdisMiniportBlock.MapRegisters[PhysicalMapRegister].MapRegister , + ReturnedAddress = Adapter->SystemAdapterObject->DmaOperations->MapTransfer( + Adapter->SystemAdapterObject, Buffer, + Adapter->MapRegisters[PhysicalMapRegister].MapRegister, CurrentVa, &Length, WriteToDevice); - Adapter->NdisMiniportBlock.MapRegisters[PhysicalMapRegister].WriteToDevi ce = WriteToDevice; + Adapter->MapRegisters[PhysicalMapRegister].WriteToDevice = WriteToDevice; PhysicalAddressArray[LoopCount].PhysicalAddress = ReturnedAddress; PhysicalAddressArray[LoopCount].Length = Length; @@ -514,22 +515,22 @@ * - May be called at IRQL <= DISPATCH_LEVEL */ { - PLOGICAL_ADAPTER Adapter = 0; + PNDIS_MINIPORT_BLOCK Adapter; VOID *CurrentVa; ULONG Length; ASSERT(KeGetCurrentIrql() <= DISPATCH_LEVEL); ASSERT(MiniportAdapterHandle && Buffer); - Adapter = (PLOGICAL_ADAPTER)MiniportAdapterHandle; + Adapter = (PNDIS_MINIPORT_BLOCK)MiniportAdapterHandle; CurrentVa = MmGetMdlVirtualAddress(Buffer); Length = MmGetMdlByteCount(Buffer); - Adapter->NdisMiniportBlock.SystemAdapterObject->DmaOperations->FlushAdap terBuffers( - Adapter->NdisMiniportBlock.SystemAdapterObject, Buffer, - Adapter->NdisMiniportBlock.MapRegisters[PhysicalMapRegister].MapRegister , + Adapter->SystemAdapterObject->DmaOperations->FlushAdapterBuffers( + Adapter->SystemAdapterObject, Buffer, + Adapter->MapRegisters[PhysicalMapRegister].MapRegister, CurrentVa, Length, - Adapter->NdisMiniportBlock.MapRegisters[PhysicalMapRegister].WriteToDevi ce); + Adapter->MapRegisters[PhysicalMapRegister].WriteToDevice); } @@ -600,42 +601,42 @@ * NOTES: */ { - KIRQL OldIrql; - PLOGICAL_ADAPTER Adapter = (PLOGICAL_ADAPTER)MiniportAdapterHandle; - PDMA_ADAPTER AdapterObject; - UINT MapRegistersPerBaseRegister; - UINT i; + KIRQL OldIrql; + PNDIS_MINIPORT_BLOCK Adapter = (PNDIS_MINIPORT_BLOCK)MiniportAdapterHandle; + PDMA_ADAPTER AdapterObject; + UINT MapRegistersPerBaseRegister; + UINT i; NDIS_DbgPrint(MAX_TRACE, ("Called.\n")); ASSERT(Adapter); /* only bus masters may call this routine */ - ASSERT(Adapter->NdisMiniportBlock.Flags & NDIS_ATTRIBUTE_BUS_MASTER); - if(!(Adapter->NdisMiniportBlock.Flags & NDIS_ATTRIBUTE_BUS_MASTER) || - Adapter->NdisMiniportBlock.SystemAdapterObject == NULL) + ASSERT(Adapter->Flags & NDIS_ATTRIBUTE_BUS_MASTER); + if(!(Adapter->Flags & NDIS_ATTRIBUTE_BUS_MASTER) || + Adapter->SystemAdapterObject == NULL) return; - MapRegistersPerBaseRegister = ((Adapter->NdisMiniportBlock.MaximumPhysicalMapping - 2) / PAGE_SIZE) + 2; + MapRegistersPerBaseRegister = ((Adapter->MaximumPhysicalMapping - 2) / PAGE_SIZE) + 2; - AdapterObject = Adapter->NdisMiniportBlock.SystemAdapterObject; + AdapterObject = Adapter->SystemAdapterObject; KeRaiseIrql(DISPATCH_LEVEL, &OldIrql); { - for(i = 0; i < Adapter->NdisMiniportBlock.BaseMapRegistersNeeded; i++) + for(i = 0; i < Adapter->BaseMapRegistersNeeded; i++) { AdapterObject->DmaOperations->FreeMapRegisters( - Adapter->NdisMiniportBlock.SystemAdapterObject, - Adapter->NdisMiniportBlock.MapRegisters[i].MapRegister, + Adapter->SystemAdapterObject, + Adapter->MapRegisters[i].MapRegister, MapRegistersPerBaseRegister); } } KeLowerIrql(OldIrql); AdapterObject->DmaOperations->PutDmaAdapter(AdapterObject); - Adapter->NdisMiniportBlock.SystemAdapterObject = NULL; + Adapter->SystemAdapterObject = NULL; - ExFreePool(Adapter->NdisMiniportBlock.MapRegisters); + ExFreePool(Adapter->MapRegisters); } @@ -771,7 +772,7 @@ ULONG MappedIRQ; KIRQL DIrql; KAFFINITY Affinity; - PLOGICAL_ADAPTER Adapter = GET_LOGICAL_ADAPTER(MiniportAdapterHandle); + PNDIS_MINIPORT_BLOCK Adapter = (PNDIS_MINIPORT_BLOCK)MiniportAdapterHandle; NDIS_DbgPrint(MAX_TRACE, ("Called. InterruptVector (0x%X) InterruptLevel (0x%X) " "SharedInterrupt (%d) InterruptMode (0x%X)\n", @@ -787,10 +788,9 @@ Interrupt->SharedInterrupt = SharedInterrupt; - Adapter->NdisMiniportBlock.Interrupt = Interrupt; + Adapter->Interrupt = Interrupt; - MappedIRQ = HalGetInterruptVector(Adapter->NdisMiniportBlock.BusType, - Adapter->NdisMiniportBlock.BusNumber, + MappedIRQ = HalGetInterruptVector(Adapter->BusType, Adapter->BusNumber, InterruptLevel, InterruptVector, &DIrql, &Affinity); @@ -837,9 +837,9 @@ * Status of operation */ { - PHYSICAL_ADDRESS PortAddress, TranslatedAddress; - PLOGICAL_ADAPTER Adapter = GET_LOGICAL_ADAPTER(MiniportAdapterHandle); - ULONG AddressSpace = 1; /* FIXME The HAL handles this wrong atm */ + PHYSICAL_ADDRESS PortAddress, TranslatedAddress; + PNDIS_MINIPORT_BLOCK Adapter = (PNDIS_MINIPORT_BLOCK)MiniportAdapterHandle; + ULONG AddressSpace = 1; /* FIXME The HAL handles this wrong atm */ NDIS_DbgPrint(MAX_TRACE, ("Called - InitialPort 0x%x, NumberOfPorts 0x%x\n", InitialPort, NumberOfPorts)); @@ -858,8 +858,7 @@ NDIS_DbgPrint(MAX_TRACE, ("Translating address 0x%x 0x%x\n", PortAddress.u.HighPart, PortAddress.u.LowPart)); - if(!HalTranslateBusAddress(Adapter->NdisMiniportBlock.BusType, - Adapter->NdisMiniportBlock.BusNumber, + if(!HalTranslateBusAddress(Adapter->BusType, Adapter->BusNumber, PortAddress, &AddressSpace, &TranslatedAddress)) { NDIS_DbgPrint(MIN_TRACE, ("Unable to translate address\n")); _____ Modified: trunk/reactos/drivers/net/ndis/ndis/memory.c --- trunk/reactos/drivers/net/ndis/ndis/memory.c 2005-08-24 00:04:21 UTC (rev 17496) +++ trunk/reactos/drivers/net/ndis/ndis/memory.c 2005-08-24 01:51:49 UTC (rev 17497) @@ -189,12 +189,12 @@ * - Cached is ignored; we always allocate non-cached */ { - PLOGICAL_ADAPTER Adapter = (PLOGICAL_ADAPTER)MiniportAdapterHandle; + PNDIS_MINIPORT_BLOCK Adapter = (PNDIS_MINIPORT_BLOCK)MiniportAdapterHandle; NDIS_DbgPrint(MAX_TRACE,("Called.\n")); - *VirtualAddress = Adapter->NdisMiniportBlock.SystemAdapterObject->DmaOperations->AllocateC ommonBuffer( - Adapter->NdisMiniportBlock.SystemAdapterObject, Length, PhysicalAddress, Cached); + *VirtualAddress = Adapter->SystemAdapterObject->DmaOperations->AllocateCommonBuffer( + Adapter->SystemAdapterObject, Length, PhysicalAddress, Cached); } @@ -267,7 +267,7 @@ */ { HANDLE ThreadHandle; - PLOGICAL_ADAPTER Adapter = (PLOGICAL_ADAPTER)MiniportAdapterHandle; + PNDIS_MINIPORT_BLOCK Adapter = (PNDIS_MINIPORT_BLOCK)MiniportAdapterHandle; PMINIPORT_SHARED_MEMORY Memory; NDIS_DbgPrint(MAX_TRACE,("Called.\n")); @@ -283,7 +283,7 @@ return; } - Memory->AdapterObject = Adapter->NdisMiniportBlock.SystemAdapterObject; + Memory->AdapterObject = Adapter->SystemAdapterObject; Memory->Length = Length; Memory->PhysicalAddress = PhysicalAddress; Memory->VirtualAddress = VirtualAddress; _____ Modified: trunk/reactos/drivers/net/ndis/ndis/miniport.c --- trunk/reactos/drivers/net/ndis/ndis/miniport.c 2005-08-24 00:04:21 UTC (rev 17496) +++ trunk/reactos/drivers/net/ndis/ndis/miniport.c 2005-08-24 01:51:49 UTC (rev 17497) @@ -330,15 +330,17 @@ VOID NTAPI MiniRequestComplete( - IN PADAPTER_BINDING AdapterBinding, + IN PNDIS_MINIPORT_BLOCK Adapter, IN PNDIS_REQUEST Request, - IN NDIS_STATUS Status) + IN NDIS_STATUS Status) { + PNDIS_REQUEST_MAC_BLOCK MacBlock = (PNDIS_REQUEST_MAC_BLOCK)Request->MacReserved; + NDIS_DbgPrint(DEBUG_MINIPORT, ("Called.\n")); - if( AdapterBinding->ProtocolBinding->Chars.RequestCompleteHandler ) { - (*AdapterBinding->ProtocolBinding->Chars.RequestCompleteHandler)( - AdapterBinding->NdisOpenBlock.ProtocolBindingContext, + if( MacBlock->Binding->RequestCompleteHandler ) { + (*MacBlock->Binding->RequestCompleteHandler)( + MacBlock->Binding->ProtocolBindingContext, Request, Status); } @@ -518,7 +520,6 @@ if (RtlCompareUnicodeString(AdapterName, &Adapter->NdisMiniportBlock.MiniportName, TRUE) == 0) { - ReferenceObject(Adapter); break; } @@ -588,7 +589,7 @@ BytesNeeded = (Size == 0)? Adapter->QueryBufferLength : Size; /* call the miniport's queryinfo handler */ - NdisStatus = (*Adapter->Miniport->Chars.QueryInformationHandler)( + NdisStatus = (*Adapter->NdisMiniportBlock.DriverHandle->MiniportCharacteristics.Query InformationHandler)( Adapter->NdisMiniportBlock.MiniportAdapterContext, Oid, Adapter->QueryBuffer, @@ -616,7 +617,7 @@ return NDIS_STATUS_RESOURCES; } - NdisStatus = (*Adapter->Miniport->Chars.QueryInformationHandler)( + NdisStatus = (*Adapter->NdisMiniportBlock.DriverHandle->MiniportCharacteristics.Query InformationHandler)( Adapter->NdisMiniportBlock.MiniportAdapterContext, Oid, Adapter->QueryBuffer, @@ -632,9 +633,9 @@ NDIS_STATUS FASTCALL MiniQueueWorkItem( - PADAPTER_BINDING AdapterBinding, - NDIS_WORK_ITEM_TYPE WorkItemType, - PVOID WorkItemContext) + PLOGICAL_ADAPTER Adapter, + NDIS_WORK_ITEM_TYPE WorkItemType, + PVOID WorkItemContext) /* * FUNCTION: Queues a work item for execution at a later time * ARGUMENTS: @@ -647,34 +648,22 @@ * Status of operation */ { - PINTERNAL_NDIS_MINIPORT_WORK_ITEM Item; - PLOGICAL_ADAPTER Adapter = AdapterBinding->Adapter; + PNDIS_MINIPORT_WORK_ITEM Item; NDIS_DbgPrint(MAX_TRACE, ("Called.\n")); ASSERT(Adapter); ASSERT(KeGetCurrentIrql() >= DISPATCH_LEVEL); -#if 0 - if (Adapter->WorkQueueLevel < NDIS_MINIPORT_WORK_QUEUE_SIZE - 1) + Item = ExAllocatePool(NonPagedPool, sizeof(NDIS_MINIPORT_WORK_ITEM)); + if (Item == NULL) { - Item = &Adapter->WorkQueue[Adapter->WorkQueueLevel]; - Adapter->WorkQueueLevel++; + NDIS_DbgPrint(MIN_TRACE, ("Insufficient resources.\n")); + return NDIS_STATUS_RESOURCES; } - else -#endif - { - Item = ExAllocatePool(NonPagedPool, sizeof(INTERNAL_NDIS_MINIPORT_WORK_ITEM)); - if (Item == NULL) - { - NDIS_DbgPrint(MIN_TRACE, ("Insufficient resources.\n")); - return NDIS_STATUS_RESOURCES; - } - } - Item->AdapterBinding = AdapterBinding; - Item->RealWorkItem.WorkItemType = WorkItemType; - Item->RealWorkItem.WorkItemContext = WorkItemContext; + Item->WorkItemType = WorkItemType; + Item->WorkItemContext = WorkItemContext; /* safe due to adapter lock held */ Item->Link.Next = NULL; @@ -689,7 +678,7 @@ Adapter->WorkQueueTail = Item; } - KeInsertQueueDpc(&Adapter->MiniportDpc, NULL, NULL); + KeInsertQueueDpc(&Adapter->NdisMiniportBlock.DeferredDpc, NULL, NULL); return NDIS_STATUS_SUCCESS; } @@ -699,7 +688,6 @@ FASTCALL MiniDequeueWorkItem( PLOGICAL_ADAPTER Adapter, - PADAPTER_BINDING *AdapterBinding, NDIS_WORK_ITEM_TYPE *WorkItemType, PVOID *WorkItemContext) /* @@ -715,7 +703,7 @@ * Status of operation */ { - PINTERNAL_NDIS_MINIPORT_WORK_ITEM Item; + PNDIS_MINIPORT_WORK_ITEM Item; NDIS_DbgPrint(MAX_TRACE, ("Called.\n")); @@ -724,14 +712,13 @@ if (Item) { /* safe due to adapter lock held */ - Adapter->WorkQueueHead = (PINTERNAL_NDIS_MINIPORT_WORK_ITEM)Item->Link.Next; + Adapter->WorkQueueHead = (PNDIS_MINIPORT_WORK_ITEM)Item->Link.Next; if (Item == Adapter->WorkQueueTail) Adapter->WorkQueueTail = NULL; - *AdapterBinding = Item->AdapterBinding; - *WorkItemType = Item->RealWorkItem.WorkItemType; - *WorkItemContext = Item->RealWorkItem.WorkItemContext; + *WorkItemType = Item->WorkItemType; + *WorkItemContext = Item->WorkItemContext; ExFreePool(Item); @@ -744,7 +731,7 @@ NDIS_STATUS MiniDoRequest( - PADAPTER_BINDING AdapterBinding, + PNDIS_MINIPORT_BLOCK Adapter, PNDIS_REQUEST NdisRequest) /* * FUNCTION: Sends a request to a miniport @@ -755,17 +742,15 @@ * Status of operation */ { - PLOGICAL_ADAPTER Adapter = AdapterBinding->Adapter; - NDIS_DbgPrint(DEBUG_MINIPORT, ("Called.\n")); - Adapter->NdisMiniportBlock.MediaRequest = NdisRequest; + Adapter->MediaRequest = NdisRequest; switch (NdisRequest->RequestType) { case NdisRequestQueryInformation: - return (*Adapter->Miniport->Chars.QueryInformationHandler)( - Adapter->NdisMiniportBlock.MiniportAdapterContext, + return (*Adapter->DriverHandle->MiniportCharacteristics.QueryInformationHandler )( + Adapter->MiniportAdapterContext, NdisRequest->DATA.QUERY_INFORMATION.Oid, NdisRequest->DATA.QUERY_INFORMATION.InformationBuffer, NdisRequest->DATA.QUERY_INFORMATION.InformationBufferLength, @@ -774,8 +759,8 @@ break; case NdisRequestSetInformation: - return (*Adapter->Miniport->Chars.SetInformationHandler)( - Adapter->NdisMiniportBlock.MiniportAdapterContext, + return (*Adapter->DriverHandle->MiniportCharacteristics.SetInformationHandler)( + Adapter->MiniportAdapterContext, NdisRequest->DATA.SET_INFORMATION.Oid, NdisRequest->DATA.SET_INFORMATION.InformationBuffer, NdisRequest->DATA.SET_INFORMATION.InformationBufferLength, @@ -824,14 +809,13 @@ NDIS_STATUS NdisStatus; PVOID WorkItemContext; NDIS_WORK_ITEM_TYPE WorkItemType; - PADAPTER_BINDING AdapterBinding; PLOGICAL_ADAPTER Adapter = GET_LOGICAL_ADAPTER(DeferredContext); NDIS_DbgPrint(DEBUG_MINIPORT, ("Called.\n")); NdisStatus = MiniDequeueWorkItem - (Adapter, &AdapterBinding, &WorkItemType, &WorkItemContext); + (Adapter, &WorkItemType, &WorkItemContext); if (NdisStatus == NDIS_STATUS_SUCCESS) { @@ -844,7 +828,7 @@ #ifdef DBG MiniDisplayPacket((PNDIS_PACKET)WorkItemContext); #endif - if(Adapter->Miniport->Chars.SendPacketsHandler) + if(Adapter->NdisMiniportBlock.DriverHandle->MiniportCharacteristics.Send PacketsHandler) { NDIS_DbgPrint(MAX_TRACE, ("Calling miniport's SendPackets handler\n")); @@ -852,7 +836,7 @@ * XXX assumes single-packet - prolly OK since we'll call something * different on multi-packet sends */ - (*Adapter->Miniport->Chars.SendPacketsHandler)( + (*Adapter->NdisMiniportBlock.DriverHandle->MiniportCharacteristics.SendP acketsHandler)( Adapter->NdisMiniportBlock.MiniportAdapterContext, (PPNDIS_PACKET)&WorkItemContext, 1); NdisStatus = NDIS_GET_PACKET_STATUS((PNDIS_PACKET)WorkItemContext); @@ -863,7 +847,7 @@ { NDIS_DbgPrint(MAX_TRACE, ("Calling miniport's Send handler\n")); - NdisStatus = (*Adapter->Miniport->Chars.SendHandler)( + NdisStatus = (*Adapter->NdisMiniportBlock.DriverHandle->MiniportCharacteristics.SendH andler)( Adapter->NdisMiniportBlock.MiniportAdapterContext, (PNDIS_PACKET)WorkItemContext, 0); NDIS_DbgPrint(MAX_TRACE, ("back from miniport's Send handler\n")); @@ -897,7 +881,7 @@ break; case NdisWorkItemRequest: - NdisStatus = MiniDoRequest(AdapterBinding, (PNDIS_REQUEST)WorkItemContext); + NdisStatus = MiniDoRequest(&Adapter->NdisMiniportBlock, (PNDIS_REQUEST)WorkItemContext); if (NdisStatus == NDIS_STATUS_PENDING) break; @@ -906,12 +890,12 @@ { case NdisRequestQueryInformation: NdisMQueryInformationComplete((NDIS_HANDLE)Adapter, NdisStatus); - MiniRequestComplete( AdapterBinding, (PNDIS_REQUEST)WorkItemContext, NdisStatus ); + MiniRequestComplete( &Adapter->NdisMiniportBlock, (PNDIS_REQUEST)WorkItemContext, NdisStatus ); break; case NdisRequestSetInformation: NdisMSetInformationComplete((NDIS_HANDLE)Adapter, NdisStatus); - MiniRequestComplete( AdapterBinding, (PNDIS_REQUEST)WorkItemContext, NdisStatus ); + MiniRequestComplete( &Adapter->NdisMiniportBlock, (PNDIS_REQUEST)WorkItemContext, NdisStatus ); break; default: @@ -1037,7 +1021,7 @@ * - SystemSpecific2 goes invalid so we copy it */ { - PMINIPORT_DRIVER Miniport; + PNDIS_M_DRIVER_BLOCK Miniport; PUNICODE_STRING RegistryPath; WCHAR *RegistryBuffer; @@ -1051,7 +1035,7 @@ __asm__ ("int $3\n"); #endif - Miniport = ExAllocatePool(NonPagedPool, sizeof(MINIPORT_DRIVER)); + Miniport = ExAllocatePool(NonPagedPool, sizeof(NDIS_M_DRIVER_BLOCK)); if (!Miniport) { @@ -1059,12 +1043,10 @@ return; } - RtlZeroMemory(Miniport, sizeof(MINIPORT_DRIVER)); + RtlZeroMemory(Miniport, sizeof(NDIS_M_DRIVER_BLOCK)); KeInitializeSpinLock(&Miniport->Lock); - Miniport->RefCount = 1; - Miniport->DriverObject = (PDRIVER_OBJECT)SystemSpecific1; /* set the miniport's driver registry path */ @@ -1091,7 +1073,7 @@ RegistryPath->Buffer = RegistryBuffer; Miniport->RegistryPath = RegistryPath; - InitializeListHead(&Miniport->AdapterListHead); + InitializeListHead(&Miniport->DeviceList); /* Put miniport in global miniport list */ ExInterlockedInsertTailList(&MiniportListHead, &Miniport->ListEntry, &MiniportListLock); @@ -1438,7 +1420,7 @@ */ NDIS_DbgPrint(MID_TRACE, ("calling MiniportInitialize\n")); - NdisStatus = (*Adapter->Miniport->Chars.InitializeHandler)( + NdisStatus = (*Adapter->NdisMiniportBlock.DriverHandle->MiniportCharacteristics.Initi alizeHandler)( &OpenErrorStatus, &SelectedMediumIndex, &MediaArray[0], MEDIA_ARRAY_SIZE, Adapter, (NDIS_HANDLE)&WrapperContext); @@ -1505,7 +1487,7 @@ Adapter->NdisMiniportBlock.PnPDeviceState = NdisPnPDeviceStarted; /* Put adapter in adapter list for this miniport */ - ExInterlockedInsertTailList(&Adapter->Miniport->AdapterListHead, &Adapter->MiniportListEntry, &Adapter->Miniport->Lock); + ExInterlockedInsertTailList(&Adapter->NdisMiniportBlock.DriverHandle->De viceList, &Adapter->MiniportListEntry, &Adapter->NdisMiniportBlock.DriverHandle->Lock); /* Put adapter in global adapter list */ ExInterlockedInsertTailList(&AdapterListHead, &Adapter->ListEntry, &AdapterListLock); @@ -1532,16 +1514,16 @@ KIRQL OldIrql; /* Remove adapter from adapter list for this miniport */ - KeAcquireSpinLock(&Adapter->Miniport->Lock, &OldIrql); + KeAcquireSpinLock(&Adapter->NdisMiniportBlock.DriverHandle->Lock, &OldIrql); RemoveEntryList(&Adapter->MiniportListEntry); - KeReleaseSpinLock(&Adapter->Miniport->Lock, OldIrql); + KeReleaseSpinLock(&Adapter->NdisMiniportBlock.DriverHandle->Lock, OldIrql); [truncated at 1000 lines; 289 more skipped]
19 years, 4 months
1
0
0
0
[navaraf] 17496: Fix few macros to work with the corrected declarations.
by navaraf@svn.reactos.com
Fix few macros to work with the corrected declarations. Modified: trunk/reactos/w32api/include/ddk/ndis.h _____ Modified: trunk/reactos/w32api/include/ddk/ndis.h --- trunk/reactos/w32api/include/ddk/ndis.h 2005-08-23 23:20:23 UTC (rev 17495) +++ trunk/reactos/w32api/include/ddk/ndis.h 2005-08-24 00:04:21 UTC (rev 17496) @@ -4413,11 +4413,7 @@ USHORT CFHangCurrentTick; NDIS_STATUS ResetStatus; NDIS_HANDLE ResetOpen; -#ifdef __cplusplus - FILTERDBS FilterDbs; -#else FILTERDBS_S -#endif FILTER_PACKET_INDICATION_HANDLER PacketIndicateHandler; NDIS_M_SEND_COMPLETE_HANDLER SendCompleteHandler; NDIS_M_SEND_RESOURCES_HANDLER SendResourcesHandler; @@ -4705,7 +4701,7 @@ Length) \ { \ ArcFilterDprIndicateReceive( \ - (((PNDIS_MINIPORT_BLOCK)(MiniportAdapterHandle))->FilterDbs.ArcDB), \ + (((PNDIS_MINIPORT_BLOCK)(MiniportAdapterHandle))->ArcDB), \ (HeaderBuffer), \ (DataBuffer), \ (Length)); \ @@ -4782,7 +4778,7 @@ PacketSize) \ { \ (*((PNDIS_MINIPORT_BLOCK)(MiniportAdapterHandle))->EthRxIndicateHandler) ( \ - ((PNDIS_MINIPORT_BLOCK)(MiniportAdapterHandle))->FilterDbs.EthDB, \ + ((PNDIS_MINIPORT_BLOCK)(MiniportAdapterHandle))->EthDB, \ (MiniportReceiveContext), \ (HeaderBuffer), \ (HeaderBuffer), \ @@ -4800,7 +4796,7 @@ #define NdisMEthIndicateReceiveComplete(MiniportAdapterHandle) \ { \ (*((PNDIS_MINIPORT_BLOCK)(MiniportAdapterHandle))->EthRxCompleteHandler) ( \ - ((PNDIS_MINIPORT_BLOCK)MiniportAdapterHandle)->FilterDbs.EthDB); \ + ((PNDIS_MINIPORT_BLOCK)MiniportAdapterHandle)->EthDB); \ } /* @@ -4823,7 +4819,7 @@ PacketSize) \ { \ (*((PNDIS_MINIPORT_BLOCK)(MiniportAdapterHandle))->FddiRxIndicateHandler )( \ - (((PNDIS_MINIPORT_BLOCK)(MiniportAdapterHandle))->FilterDbs.FddiDB), \ + (((PNDIS_MINIPORT_BLOCK)(MiniportAdapterHandle))->FddiDB), \ (MiniportReceiveContext), \ (PUCHAR)(HeaderBuffer) + 1, \ (((*(PUCHAR*)(HeaderBuffer)) & 0x40) ? \ @@ -4846,7 +4842,7 @@ #define NdisMFddiIndicateReceiveComplete(MiniportAdapterHandle) \ { \ (*((PNDIS_MINIPORT_BLOCK)(MiniportAdapterHandle))->FddiRxCompleteHandler )( \ - ((PNDIS_MINIPORT_BLOCK)MiniportAdapterHandle)->FilterDbs.FddiDB); \ + ((PNDIS_MINIPORT_BLOCK)MiniportAdapterHandle)->FddiDB); \ } NDISAPI @@ -5122,7 +5118,7 @@ PacketSize) \ { \ (*((PNDIS_MINIPORT_BLOCK)(MiniportAdapterHandle))->TrRxIndicateHandler)( \ - (((PNDIS_MINIPORT_BLOCK)(MiniportAdapterHandle))->FilterDbs.TrDB), \ + (((PNDIS_MINIPORT_BLOCK)(MiniportAdapterHandle))->TrDB), \ (MiniportReceiveContext), \ (HeaderBuffer), \ (HeaderBuffer), \ @@ -5140,7 +5136,7 @@ #define NdisMTrIndicateReceiveComplete(MiniportAdapterHandle) \ { \ (*((PNDIS_MINIPORT_BLOCK)(MiniportAdapterHandle))->TrRxCompleteHandler)( \ - ((PNDIS_MINIPORT_BLOCK)MiniportAdapterHandle)->FilterDbs.TrDB); \ + ((PNDIS_MINIPORT_BLOCK)MiniportAdapterHandle)->TrDB); \ } NDISAPI
19 years, 4 months
1
0
0
0
[royce] 17495: remove incorrect comment (copy/paste error)
by royce@svn.reactos.com
remove incorrect comment (copy/paste error) Modified: trunk/reactos/tools/rbuild/makefile _____ Modified: trunk/reactos/tools/rbuild/makefile --- trunk/reactos/tools/rbuild/makefile 2005-08-23 23:08:40 UTC (rev 17494) +++ trunk/reactos/tools/rbuild/makefile 2005-08-23 23:20:23 UTC (rev 17495) @@ -1,5 +1,3 @@ -# This file is automatically generated. - TOP = ../.. DEFAULT = rbuild include $(TOP)/proxy.mak
19 years, 4 months
1
0
0
0
[navaraf] 17494: Get rid of NdisWorkItemHalt.
by navaraf@svn.reactos.com
Get rid of NdisWorkItemHalt. Modified: trunk/reactos/drivers/net/ndis/include/ndissys.h Modified: trunk/reactos/drivers/net/ndis/ndis/miniport.c _____ Modified: trunk/reactos/drivers/net/ndis/include/ndissys.h --- trunk/reactos/drivers/net/ndis/include/ndissys.h 2005-08-23 23:06:58 UTC (rev 17493) +++ trunk/reactos/drivers/net/ndis/include/ndissys.h 2005-08-23 23:08:40 UTC (rev 17494) @@ -17,8 +17,7 @@ #if _MSC_VER /* FIXME: These were removed and are no longer used! */ -#define NdisWorkItemHalt NdisMaxWorkItems -#define NdisWorkItemSendLoopback (NdisMaxWorkItems + 1) +#define NdisWorkItemSendLoopback NdisWorkItemReserved #else /* _MSC_VER */ /* FIXME: We miss the ATM headers. */ typedef struct _ATM_ADDRESS *PATM_ADDRESS; _____ Modified: trunk/reactos/drivers/net/ndis/ndis/miniport.c --- trunk/reactos/drivers/net/ndis/ndis/miniport.c 2005-08-23 23:06:58 UTC (rev 17493) +++ trunk/reactos/drivers/net/ndis/ndis/miniport.c 2005-08-23 23:08:40 UTC (rev 17494) @@ -893,9 +893,6 @@ case NdisWorkItemResetInProgress: break; - case NdisWorkItemHalt: - break; - case NdisWorkItemMiniportCallback: break;
19 years, 4 months
1
0
0
0
[royce] 17493: msvc6 compatibility
by royce@svn.reactos.com
msvc6 compatibility Modified: trunk/reactos/tools/rbuild/automaticdependency.cpp Modified: trunk/reactos/tools/rbuild/backend/mingw/mingw.cpp Modified: trunk/reactos/tools/rbuild/stubbedcomponent.cpp _____ Modified: trunk/reactos/tools/rbuild/automaticdependency.cpp --- trunk/reactos/tools/rbuild/automaticdependency.cpp 2005-08-23 23:06:19 UTC (rev 17492) +++ trunk/reactos/tools/rbuild/automaticdependency.cpp 2005-08-23 23:06:58 UTC (rev 17493) @@ -376,11 +376,12 @@ Include& currentDirectory, bool searchCurrentDirectory ) { + size_t i; if ( searchCurrentDirectory ) includes.push_back( ¤tDirectory ); - for ( size_t i = 0; i < module.non_if_data.includes.size (); i++ ) + for ( i = 0; i < module.non_if_data.includes.size (); i++ ) includes.push_back( module.non_if_data.includes[i] ); - for ( size_t i = 0; i < module.project.non_if_data.includes.size (); i++ ) + for ( i = 0; i < module.project.non_if_data.includes.size (); i++ ) includes.push_back( module.project.non_if_data.includes[i] ); } @@ -469,11 +470,12 @@ AutomaticDependency::CheckAutomaticDependenciesForModule ( Module& module, bool verbose ) { + size_t mi; vector<const Module*> modules; GetModulesToCheck ( module, modules ); - for ( size_t mi = 0; mi < modules.size (); mi++ ) + for ( mi = 0; mi < modules.size (); mi++ ) ParseFiles ( *modules[mi] ); - for ( size_t mi = 0; mi < modules.size (); mi++ ) + for ( mi = 0; mi < modules.size (); mi++ ) CheckAutomaticDependencies ( *modules[mi], verbose ); } _____ Modified: trunk/reactos/tools/rbuild/backend/mingw/mingw.cpp --- trunk/reactos/tools/rbuild/backend/mingw/mingw.cpp 2005-08-23 23:06:19 UTC (rev 17492) +++ trunk/reactos/tools/rbuild/backend/mingw/mingw.cpp 2005-08-23 23:06:58 UTC (rev 17493) @@ -19,7 +19,9 @@ #include "mingw.h" #include <assert.h> +#ifndef _MSC_VER #include <dirent.h> +#endif//_MSC_VER #include "modulehandler.h" #ifdef WIN32 @@ -88,6 +90,7 @@ bool Directory::mkdir_p ( const char* path ) { +#ifndef _MSC_VER DIR *directory; directory = opendir ( path ); if ( directory != NULL ) @@ -95,9 +98,16 @@ closedir ( directory ); return false; } +#endif//_MSC_VER if ( MKDIR ( path ) != 0 ) + { +#ifdef _MSC_VER + if ( errno == EEXIST ) + return false; +#endif//_MSC_VER throw AccessDeniedException ( string ( path ) ); + } return true; } _____ Modified: trunk/reactos/tools/rbuild/stubbedcomponent.cpp --- trunk/reactos/tools/rbuild/stubbedcomponent.cpp 2005-08-23 23:06:19 UTC (rev 17492) +++ trunk/reactos/tools/rbuild/stubbedcomponent.cpp 2005-08-23 23:06:58 UTC (rev 17493) @@ -107,7 +107,7 @@ size_t end = symbol.length () - 1; while ( end > 0 && isdigit ( symbol[end] ) ) end--; - if ( end > 0 and symbol[end] == '@' ) + if ( end > 0 && symbol[end] == '@' ) end--; if ( end > 0 ) return symbol.substr ( start, end - start + 1 );
19 years, 4 months
1
0
0
0
[royce] 17492: proxy makefile for rbuild
by royce@svn.reactos.com
proxy makefile for rbuild Added: trunk/reactos/tools/rbuild/makefile _____ Added: trunk/reactos/tools/rbuild/makefile --- trunk/reactos/tools/rbuild/makefile 2005-08-23 23:02:35 UTC (rev 17491) +++ trunk/reactos/tools/rbuild/makefile 2005-08-23 23:06:19 UTC (rev 17492) @@ -0,0 +1,5 @@ +# This file is automatically generated. + +TOP = ../.. +DEFAULT = rbuild +include $(TOP)/proxy.mak
19 years, 4 months
1
0
0
0
[navaraf] 17491: Remove buffer pool implementation and replace buffer allocation with binary compatible functions (since some of them are macroized in DDK headers), other cosmetic changes.
by navaraf@svn.reactos.com
Remove buffer pool implementation and replace buffer allocation with binary compatible functions (since some of them are macroized in DDK headers), other cosmetic changes. Modified: trunk/reactos/drivers/net/ndis/ndis/50gone.c Modified: trunk/reactos/drivers/net/ndis/ndis/buffer.c Modified: trunk/reactos/drivers/net/ndis/ndis/miniport.c _____ Modified: trunk/reactos/drivers/net/ndis/ndis/50gone.c --- trunk/reactos/drivers/net/ndis/ndis/50gone.c 2005-08-23 22:25:35 UTC (rev 17490) +++ trunk/reactos/drivers/net/ndis/ndis/50gone.c 2005-08-23 23:02:35 UTC (rev 17491) @@ -385,7 +385,7 @@ /* - * @unimplemented + * @implemented */ #undef NdisUpdateSharedMemory VOID @@ -402,7 +402,7 @@ * NDIS 4.0 */ { - UNIMPLEMENTED + /* No-op. */ } /* EOF */ _____ Modified: trunk/reactos/drivers/net/ndis/ndis/buffer.c --- trunk/reactos/drivers/net/ndis/ndis/buffer.c 2005-08-23 22:25:35 UTC (rev 17490) +++ trunk/reactos/drivers/net/ndis/ndis/buffer.c 2005-08-23 23:02:35 UTC (rev 17491) @@ -348,49 +348,16 @@ * Length = Number of bytes in data buffer */ { - KIRQL OldIrql; - PNETWORK_HEADER Temp; - PNDIS_BUFFER_POOL Pool = (PNDIS_BUFFER_POOL)PoolHandle; - - NDIS_DbgPrint(MAX_TRACE, ("Status (0x%X) Buffer (0x%X) PoolHandle (0x%X) " - "VirtualAddress (0x%X) Length (%d)\n", - Status, Buffer, PoolHandle, VirtualAddress, Length)); - -#if 0 - Temp = Pool->FreeList; - while( Temp ) { - NDIS_DbgPrint(MID_TRACE,("Free buffer -> %x\n", Temp)); - Temp = Temp->Next; - } - - NDIS_DbgPrint(MID_TRACE,("|:. <- End free buffers")); -#endif - - if(!VirtualAddress && !Length) return; - - KeAcquireSpinLock(&Pool->SpinLock, &OldIrql); - - if (Pool->FreeList) { - Temp = Pool->FreeList; - Pool->FreeList = Temp->Next; - - KeReleaseSpinLock(&Pool->SpinLock, OldIrql); - - Temp->Next = NULL; - - MmInitializeMdl(&Temp->Mdl, VirtualAddress, Length); - Temp->Mdl.MdlFlags |= (MDL_SOURCE_IS_NONPAGED_POOL | MDL_ALLOCATED_FIXED_SIZE); - Temp->Mdl.MappedSystemVa = VirtualAddress; - - Temp->BufferPool = Pool; - - *Buffer = (PNDIS_BUFFER)Temp; + ASSERT(VirtualAddress != NULL); + ASSERT(Length > 0); + + *Buffer = IoAllocateMdl(VirtualAddress, Length, FALSE, FALSE, NULL); + if (*Buffer != NULL) { + MmBuildMdlForNonPagedPool(*Buffer); + (*Buffer)->Next = NULL; *Status = NDIS_STATUS_SUCCESS; } else { - KeReleaseSpinLock(&Pool->SpinLock, OldIrql); *Status = NDIS_STATUS_FAILURE; - NDIS_DbgPrint(MID_TRACE, ("Can't get another packet.\n")); - KeBugCheck(0); } } @@ -412,38 +379,8 @@ * NumberOfDescriptors = Size of buffer pool in number of descriptors */ { - UINT i; - PNDIS_BUFFER_POOL Pool; - PNETWORK_HEADER Buffer; - - NDIS_DbgPrint(MAX_TRACE, ("Status (0x%X) PoolHandle (0x%X) NumberOfDescriptors (%d).\n", - Status, PoolHandle, NumberOfDescriptors)); - - Pool = ExAllocatePool(NonPagedPool, - sizeof(NDIS_BUFFER_POOL) + - sizeof(NETWORK_HEADER) * - NumberOfDescriptors); - if (Pool) { - KeInitializeSpinLock(&Pool->SpinLock); - - if (NumberOfDescriptors > 0) { - Buffer = &Pool->Buffers[0]; - NDIS_DbgPrint(MAX_TRACE, ("NDIS BUFFER ADDRESS << %x >>\n", Buffer)); - Pool->FreeList = Buffer; - for (i = 1; i < NumberOfDescriptors; i++) { - Buffer->Next = &Pool->Buffers[i]; - Buffer = Buffer->Next; - NDIS_DbgPrint(MAX_TRACE, ("NDIS BUFFER ADDRESS << %x >>\n", - Buffer)); - } - Buffer->Next = NULL; - } else - Pool->FreeList = NULL; - - *Status = NDIS_STATUS_SUCCESS; - *PoolHandle = (PNDIS_HANDLE)Pool; - } else - *Status = NDIS_STATUS_RESOURCES; + *Status = NDIS_STATUS_SUCCESS; + *PoolHandle = 0; } @@ -616,12 +553,12 @@ * Length of NDIS buffer */ { - return Buffer->ByteCount; + return MmGetMdlByteCount(Buffer); } /* - * @unimplemented + * @implemented */ #undef NdisBufferVirtualAddress PVOID @@ -635,9 +572,7 @@ * NDIS 5.0 */ { - UNIMPLEMENTED - - return NULL; + return MmGetSystemAddressForMdl(Buffer); } @@ -839,7 +774,6 @@ * PoolHandle = Handle returned by NdisAllocateBufferPool */ { - ExFreePool((PVOID)PoolHandle); } @@ -874,18 +808,7 @@ * Buffer = Pointer to buffer descriptor */ { - KIRQL OldIrql; - PNDIS_BUFFER_POOL Pool; - PNETWORK_HEADER Temp = (PNETWORK_HEADER)Buffer; - - NDIS_DbgPrint(MAX_TRACE, ("Buffer (0x%X).\n", Buffer)); - - Pool = Temp->BufferPool; - - KeAcquireSpinLock(&Pool->SpinLock, &OldIrql); - Temp->Next = (PNETWORK_HEADER)Pool->FreeList; - Pool->FreeList = (PNETWORK_HEADER)Temp; - KeReleaseSpinLock(&Pool->SpinLock, OldIrql); + IoFreeMdl(Buffer); } _____ Modified: trunk/reactos/drivers/net/ndis/ndis/miniport.c --- trunk/reactos/drivers/net/ndis/ndis/miniport.c 2005-08-23 22:25:35 UTC (rev 17490) +++ trunk/reactos/drivers/net/ndis/ndis/miniport.c 2005-08-23 23:02:35 UTC (rev 17491) @@ -789,10 +789,10 @@ } -#undef NdisMQueryInformationComplete /* * @implemented */ +#undef NdisMQueryInformationComplete VOID EXPORT NdisMQueryInformationComplete(
19 years, 4 months
1
0
0
0
[hpoussin] 17490: Remove incorrect definition of NLS_MB_CODE_PAGE_TAG. The correct definition is 2 lines above.
by hpoussin@svn.reactos.com
Remove incorrect definition of NLS_MB_CODE_PAGE_TAG. The correct definition is 2 lines above. Modified: trunk/reactos/w32api/include/ddk/ntifs.h _____ Modified: trunk/reactos/w32api/include/ddk/ntifs.h --- trunk/reactos/w32api/include/ddk/ntifs.h 2005-08-23 22:24:54 UTC (rev 17489) +++ trunk/reactos/w32api/include/ddk/ntifs.h 2005-08-23 22:25:35 UTC (rev 17490) @@ -2532,7 +2532,6 @@ #define NLS_MB_CODE_PAGE_TAG NlsMbCodePageTag #define NLS_MB_OEM_CODE_PAGE_TAG NlsMbOemCodePageTag -#define NLS_MB_CODE_PAGE_TAG NlsMbOemCodePageTag #define NLS_OEM_LEAD_BYTE_INFO NlsOemLeadByteInfo extern BOOLEAN NlsMbCodePageTag;
19 years, 4 months
1
0
0
0
← Newer
1
...
8
9
10
11
12
13
14
...
67
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
Results per page:
10
25
50
100
200