0X000401A0

INPLACE_S_TRUNCATED 0X000401A0: Fix the message truncation error

Windows Errors Intermediate 👁 0 views 📅 May 27, 2026

Your message got cut off because something overflowed a buffer. The fix is to increase the display buffer limit in Windows or trim the source data.

I know it's annoying when Windows just cuts off your output or a log message without telling you what was lost. The 0X000401A0 error, displayed as INPLACE_S_TRUNCATED, means the system tried to show you something—but the buffer wasn't big enough, so it silently chopped off the rest. Let's fix it.

Fix #1: Increase the console buffer size (for cmd or PowerShell)

The most common place you'll see this is in a terminal window. By default, cmd and PowerShell only keep the last 300 lines in the screen buffer. If your command outputs more than that, you get truncation.

  1. Right-click the title bar of your cmd or PowerShell window and select Properties.
  2. Go to the Layout tab.
  3. Under Screen Buffer Size, increase Height from 300 to 9999 (the max).
  4. Click OK.

Why this works: The screen buffer is a circular buffer. When it fills up, the oldest lines are discarded. By setting height to 9999, you effectively eliminate the threshold where truncation happens. The reason step 3 works specifically is because INPLACE_S_TRUNCATED is a warning code from the Win32 API—it's not a fatal error, it's saying “I stopped writing because the buffer was full.” Bumping the buffer size removes the trigger condition.

Fix #2: Change registry value for Event Viewer log display

If you're seeing this in Event Viewer (like when viewing Application or System logs), the truncation happens in the display row. Event Viewer uses a fixed buffer for each row. You can't increase that per-row limit directly, but you can avoid it by using an alternate view method.

  1. Open Event Viewer (eventvwr.msc).
  2. Right-click the log you're viewing (e.g., Application) and choose Save All Events As.
  3. Save as .evtx.
  4. Open the saved file in Event Viewer again—this time, it won't truncate because you're reading it as a file, not streaming from the live buffer.

Why step 4 works: The live event stream in Event Viewer has a hard-coded limit on the message column width. When you open a saved .evtx file, it's parsed differently—the display renderer uses an unbounded buffer for the description field. The reason saving and re-opening avoids INPLACE_S_TRUNCATED is that you're bypassing the live viewer's internal row-buffer constraint.

Fix #3: For custom applications or scripts—use a bigger output buffer

If you're a developer hitting this in your own code (you'd see it as a return value from functions like StringCchPrintf or WideCharToMultiByte), the fix is in your code.

// Example: instead of a fixed 256-byte buffer, use dynamic allocation
wchar_t* buffer = (wchar_t*)malloc(65536 * sizeof(wchar_t));
if (buffer == NULL) { /* handle error */ }
StringCchPrintf(buffer, 65536, L"%s", longMessage);
free(buffer);

Why this fixes it: The INPLACE_S_TRUNCATED is returned by safe string functions when the destination buffer is too small. They don't crash—they truncate and return this warning. The real fix is to allocate a buffer larger than your longest possible message. For log messages or configuration display, 64 KB is usually overkill but safe.

Less common variations of the same issue

  • Remote Desktop session output truncation: If you run a command over RDP and the output is cut off, the RDP client's buffer may be the bottleneck. Re-run the command locally or redirect output to a file with > output.txt.
  • Windows Installer log truncation: MSI logs can get huge. Use msiexec /i package.msi /l*v install.log—the verbose log writes everything to file, no buffer limit.
  • SQL Server output in SSMS: SSMS has a “Maximum Characters Retrieved” setting under Tools > Options > Query Results > SQL Server > Results to Grid. Default is 65535. Bump it to 10485760 for 10 MB limit.

Prevention going forward

You won't get INPLACE_S_TRUNCATED again if you:

  • Set console buffer height to 9999 on every terminal you use.
  • Save event logs to file before reading detailed descriptions.
  • If you write code that builds strings, always use dynamic allocation or a buffer size that's empirically larger than your data. A good rule: MAX_PATH (260) for file paths, 64 KB for log lines, 1 MB for multi-line outputs.
  • Redirect any command that might produce a lot of output to a file. Use > output.txt 2>&1 to capture both stdout and stderr.

This error is a warning, not a crash. Treat it as a signal that something is overflowing. Increase the limits, and you won't see it again.

Was this solution helpful?