| Previous | Next |
| STATUS_LOGON_SESSION_COLLISION | STATUS_FILES_OPEN |
STATUS_NAME_TOO_LONG
Find the limit for the exact name field instead of assuming every failure is MAX_PATH
STATUS_NAME_TOO_LONG says a name string is too long for its intended use. The intended use matters. Windows path handling has well-known MAX_PATH compatibility limits and long-path support, while individual file-system path components can have their own limits. Other object, protocol, or resource names can use completely different maximum lengths.
Do not automatically prepend the extended-length path prefix or enable long paths when the failing value is not a Win32 file path. Capture the API, information class or request structure and identify which field received the string. For file operations, distinguish the full path length from the length of a single component; Microsoft's file-system comparison documents component limits separately from overall path limits.
Measure the input in the units used by the receiving interface. A UTF-16 API typically works in wide characters or bytes derived from them, while a protocol field might impose an octet limit after encoding. Blind truncation is dangerous because it can create collisions or cut a surrogate pair, escape sequence, extension, or security-sensitive suffix.
What to inspect
- The exact API or request field receiving the name and whether it expects a path, path component, object name, or protocol identifier.
- The original UTF-16 length, encoded byte length when applicable, and the first limit exceeded.
- Whether truncation, normalization, prefix expansion, or path canonicalization changed the value before the failing call.
References
- Microsoft: Maximum Path Length Limitation
- Microsoft: File System Functionality Comparison
- Microsoft Open Specifications: NTSTATUS values
Looking for a different code? Search another status or error code.