| Previous | Next |
| STATUS_OBJECT_NAME_NOT_FOUND | STATUS_PORT_DO_NOT_DISTURB |
STATUS_OBJECT_NAME_COLLISION
STATUS_OBJECT_NAME_COLLISION means that a caller asked to create a new named object where one already exists. In file-system code, the result commonly depends on the requested creation disposition: a create-only request should fail on an existing file, while an open-or-create workflow may legitimately open the existing object instead.
Why it is useful to keep this status distinct
A collision is a namespace race or an intentional uniqueness check. It is not the same as a sharing violation: the existing object may be closed and fully accessible, but the operation explicitly required a new name. It is also not the same as STATUS_OBJECT_NAME_NOT_FOUND, which indicates absence rather than presence.
How to handle it safely
- Choose the creation disposition that matches the business rule: create-only, open-existing, create-or-open, replace, or overwrite are different operations.
- For generated names, use an atomic create attempt rather than checking whether the name exists and then creating it later.
- When the existing object is acceptable, inspect its type and ownership before reusing it; do not assume it belongs to the current operation.
- For a directory request, make sure that file-versus-directory expectations are explicit.
On SMB, the protocol specification uses this status when a create-only request encounters an existing non-directory file. This makes it especially important to log both the requested disposition and the resolved object type.
See CreateFile, Creating and Opening Files, and the SMB2 CREATE specification.
Looking for a different code? Search another status or error code.
