File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -99,8 +99,15 @@ enum literal_string_type
9999
100100#if defined(WIN_NT)
101101#include <windows.h>
102+
103+ // Check if Windows SDK version is above v7
104+ #include <sdkddkver.h>
105+ #ifdef _WIN32_WINNT_WIN8
102106#include <VersionHelpers.h>
103107#endif
108+
109+ #endif
110+
104111#include "ibase.h"
105112#include "../isql/isql.h"
106113#include "../yvalve/perf.h"
@@ -352,7 +359,12 @@ static int win32ReadConsole(FILE* file, CharBuffer& mbBuffer)
352359 // buffers and set ERROR_NOT_ENOUGH_MEMORY error. Thus, use initial buffer size
353360 // twice less than for Windows 10 and handle error by reducing the buffer size.
354361
362+ #ifdef _WIN32_WINNT_WIN8
355363 static size_t maxLineLength = IsWindows10OrGreater() ? MAX_USHORT : MAX_SSHORT;
364+ #else
365+ static size_t maxLineLength = MAX_SSHORT;
366+ #endif
367+
356368 WCHAR* wideBuf = wideBuffer->getBuffer(maxLineLength, false);
357369
358370 DWORD charsRead;
You can’t perform that action at this time.
0 commit comments