mirror of
https://github.com/reactos/reactos.git
synced 2025-06-28 10:20:08 +00:00
[KMTESTS]
- Handle WriteConsole's inability to write large buffers svn path=/branches/GSoC_2011/KMTestSuite/; revision=53175
This commit is contained in:
parent
72ddf854a5
commit
b65e65ac17
1 changed files with 11 additions and 2 deletions
|
@ -219,11 +219,20 @@ OutputResult(
|
||||||
{
|
{
|
||||||
DWORD Error = ERROR_SUCCESS;
|
DWORD Error = ERROR_SUCCESS;
|
||||||
DWORD BytesWritten;
|
DWORD BytesWritten;
|
||||||
|
DWORD LogBufferLength;
|
||||||
|
DWORD Offset = 0;
|
||||||
|
/* WriteConsole seems to handle at most ~32kB */
|
||||||
|
const DWORD BlockSize = 8 * 1024;
|
||||||
|
|
||||||
KmtFinishTest(TestName);
|
KmtFinishTest(TestName);
|
||||||
|
|
||||||
if (!WriteConsoleA(GetStdHandle(STD_OUTPUT_HANDLE), ResultBuffer->LogBuffer, ResultBuffer->LogBufferLength, &BytesWritten, NULL))
|
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);
|
error(Error);
|
||||||
|
}
|
||||||
|
|
||||||
return Error;
|
return Error;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue