From 5510552add8d4a7118b590e64266ba36661808ee Mon Sep 17 00:00:00 2001 From: Art Yerkes Date: Fri, 13 May 2005 02:05:15 +0000 Subject: [PATCH] Fixed wrong STATUS_BUFFER_TOO_SMALL return to documented success return in the buffer too small case. svn path=/trunk/; revision=15253 --- reactos/drivers/net/tcpip/tcpip/info.c | 12 +++++++++--- reactos/drivers/net/tcpip/tcpip/main.c | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/reactos/drivers/net/tcpip/tcpip/info.c b/reactos/drivers/net/tcpip/tcpip/info.c index bd853c78b1c..7bcc5c77ae2 100644 --- a/reactos/drivers/net/tcpip/tcpip/info.c +++ b/reactos/drivers/net/tcpip/tcpip/info.c @@ -16,8 +16,11 @@ TDI_STATUS InfoCopyOut( PCHAR DataOut, UINT SizeOut, PNDIS_BUFFER ClientBuf, PUINT ClientBufSize ) { UINT RememberedCBSize = *ClientBufSize; *ClientBufSize = SizeOut; + + /* The driver returns success even when it couldn't fit every available + * byte. */ if( RememberedCBSize < SizeOut ) - return TDI_BUFFER_TOO_SMALL; + return TDI_SUCCESS; else { CopyBufferToBufferChain( ClientBuf, 0, (PCHAR)DataOut, SizeOut ); return TDI_SUCCESS; @@ -88,11 +91,14 @@ TDI_STATUS InfoTdiQueryListEntities(PNDIS_BUFFER Buffer, Size = EntityCount * sizeof(TDIEntityID); *BufferSize = Size; + TI_DbgPrint(DEBUG_INFO,("BufSize: %d, NeededSize: %d\n", BufSize, Size)); + if (BufSize < Size) { TcpipReleaseSpinLock( &EntityListLock, OldIrql ); - /* The buffer is too small to contain requested data */ - return TDI_BUFFER_TOO_SMALL; + /* The buffer is too small to contain requested data, but we return + * success anyway, as we did everything we wanted. */ + return TDI_SUCCESS; } /* Return entity list -- Copy only the TDIEntityID parts. */ diff --git a/reactos/drivers/net/tcpip/tcpip/main.c b/reactos/drivers/net/tcpip/tcpip/main.c index 7320dce043c..75051a8d387 100644 --- a/reactos/drivers/net/tcpip/tcpip/main.c +++ b/reactos/drivers/net/tcpip/tcpip/main.c @@ -9,7 +9,7 @@ */ #include "precomp.h" -#define NDEBUG +//#define NDEBUG #ifndef NDEBUG DWORD DebugTraceLevel = DEBUG_ULTRA & ~(DEBUG_LOCK | DEBUG_PBUFFER);