ERROR_CANCEL_VIOLATION - 173 (0xAD)

A lock request was not outstanding for the supplied cancel region.

Updated: Feb 21, 2026

Technical Meaning

The ERROR_CANCEL_VIOLATION error code indicates that a lock request was not outstanding for the supplied cancel region. This typically occurs when an attempt is made to cancel or terminate a lock operation, but no such lock request exists in the system.

Error Details

This error can arise in various scenarios where operations involving locks are performed. Locks are used to ensure data integrity and prevent concurrent access issues, especially in multi-threaded environments or when dealing with shared resources.

Usage Context

The ERROR_CANCEL_VIOLATION is commonly encountered in the context of file system operations, device drivers, or any application that manages locks for critical sections of code. It can also appear in scenarios where asynchronous operations are being managed and canceled.

Developer Interpretation

When this error occurs, it suggests that the operation to cancel a lock was initiated without an existing lock request. This could be due to several reasons such as incorrect parameter values, invalid object types, or misuse of the API functions related to locks.

Common Causes

  • Invalid parameter values: The supplied cancel region may not correspond to any outstanding lock requests.
  • Incorrect object type: The operation might have been attempted on an object that does not support locking mechanisms.
  • Exceeding limits: There could be a limit on the number of concurrent lock requests, and attempting to cancel beyond this limit would result in this error.

Related Errors

  • ERROR_LOCK_VIOLATION: Indicates that a lock was requested but cannot be acquired due to conflicting locks or other issues.
  • ERROR_INVALID_PARAMETER: Suggests that the parameters passed to the API function were incorrect, which could lead to the ERROR_CANCEL_VIOLATION error.

FAQ

Q: What does the ERROR_CANCEL_VIOLATION mean?

A: It indicates that a lock request was not outstanding for the supplied cancel region. This typically occurs when an attempt is made to cancel or terminate a lock operation, but no such lock request exists in the system.

Q: How can I avoid this error?

A: Ensure that all lock requests are properly managed and that the parameters passed to functions related to locks are correct. Always check for existing lock requests before attempting to cancel them.

Summary

The ERROR_CANCEL_VIOLATION is a specific technical error indicating an attempt to cancel a non-existent lock request. Developers should ensure proper management of locks and validate parameters to avoid this error.