WriteConsoleW fails for strings larger than about 26000 characters - by David-Sarah Hopwood

Status : 

  External<br /><br />
		This item may be valid but belongs to an external system out of the direct control of this product team.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.


1
0
Sign in
to vote
ID 635230 Comments
Status Closed Workarounds
Type Bug Repros 0
Opened 1/9/2011 12:52:25 AM
Access Restriction Public

Description

This is an issue in the Win32 API implementation, not in Visual Studio or .NET framework, but there appeared to be no more appropriate place to submit it. It appears to be a long-standing bug that was present in Windows XP and is still present in Windows 7.

The documentation for WriteConsoleW (http://msdn.microsoft.com/en-us/library/ms687401%28v=vs.85%29) claims that up to 65536 bytes can be written -- presumably that means 32767 UTF-16 characters + NUL. The actual limit is smaller -- it varies between machines, but typically is between 26000 and 32000 characters. Attempting to write more than this in a single call to WriteConsoleW will fail; see for example http://www.mail-archive.com/log4net-dev@logging.apache.org/msg00661.html and http://tahoe-lafs.org/trac/tahoe-lafs/ticket/1232 . It's not clear whether this also applies to WriteConsoleA.
Sign in to post a comment.
Posted by Microsoft on 2/23/2011 at 10:38 PM
Thank you for your bug submission. The issue you reported appears to be on a released Windows Product. If this issue is severe, causing critical business situations or blocking your product development or deployment, please go to http://support.microsoft.com or call 1-800-MICROSOFT for assistance. For Microsoft premier customers, please contact your administrator, your Technical Account Manager, or your Microsoft premier account representative.
Other Support links - http://support.microsoft.com/ph/14019#tab13
Posted by Microsoft on 1/9/2011 at 12:59 AM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)