mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
Fixed wrong STATUS_BUFFER_TOO_SMALL return to documented success return
in the buffer too small case. svn path=/trunk/; revision=15253
This commit is contained in:
parent
dcb2ef8cd7
commit
5510552add
2 changed files with 10 additions and 4 deletions
|
@ -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. */
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
*/
|
||||
#include "precomp.h"
|
||||
|
||||
#define NDEBUG
|
||||
//#define NDEBUG
|
||||
|
||||
#ifndef NDEBUG
|
||||
DWORD DebugTraceLevel = DEBUG_ULTRA & ~(DEBUG_LOCK | DEBUG_PBUFFER);
|
||||
|
|
Loading…
Reference in a new issue