Author: tfaber
Date: Thu Aug 11 08:50:46 2011
New Revision: 53175
URL:
http://svn.reactos.org/svn/reactos?rev=53175&view=rev
Log:
[KMTESTS]
- Handle WriteConsole's inability to write large buffers
Modified:
branches/GSoC_2011/KMTestSuite/kmtests/kmtest/kmtest.c
Modified: branches/GSoC_2011/KMTestSuite/kmtests/kmtest/kmtest.c
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/KMTestSuite/kmtests/k…
==============================================================================
--- branches/GSoC_2011/KMTestSuite/kmtests/kmtest/kmtest.c [iso-8859-1] (original)
+++ branches/GSoC_2011/KMTestSuite/kmtests/kmtest/kmtest.c [iso-8859-1] Thu Aug 11
08:50:46 2011
@@ -219,11 +219,20 @@
{
DWORD Error = ERROR_SUCCESS;
DWORD BytesWritten;
+ DWORD LogBufferLength;
+ DWORD Offset = 0;
+ /* WriteConsole seems to handle at most ~32kB */
+ const DWORD BlockSize = 8 * 1024;
KmtFinishTest(TestName);
- if (!WriteConsoleA(GetStdHandle(STD_OUTPUT_HANDLE), ResultBuffer->LogBuffer,
ResultBuffer->LogBufferLength, &BytesWritten, NULL))
- error(Error);
+ LogBufferLength = ResultBuffer->LogBufferLength;
+ for (Offset = 0; Offset < LogBufferLength; Offset += BlockSize)
+ {
+ DWORD Length = min(LogBufferLength - Offset, BlockSize);
+ if (!WriteConsoleA(GetStdHandle(STD_OUTPUT_HANDLE), ResultBuffer->LogBuffer +
Offset, Length, &BytesWritten, NULL))
+ error(Error);
+ }
return Error;
}