| Previous | Next |
| MQ_ERROR_OPERATION_CANCELLED | MQ_ERROR_SERVICE_NOT_AVAILABLE |
MQ_ERROR_SHARING_VIOLATION
MQ_ERROR_SHARING_VIOLATION means that another application has opened the queue with receive-sharing settings incompatible with this open request. An exclusive receive open prevents other MSMQ applications from opening the queue for receive access until it is closed.
How to investigate
- Check the
dwAccessanddwShareModevalues supplied toMQOpenQueue. - Identify processes or services that hold a receive handle with
MQ_DENY_RECEIVE_SHARE. - Use compatible sharing for competing consumers, or deliberately serialize exclusive receive access.
Diagnostic interpretation of MQ_ERROR_SHARING_VIOLATION
MQ_ERROR_SHARING_VIOLATION has the HRESULT value 0xC00E0009. AllStat records the condition as “There is a sharing violation. The queue is already open for exclusive retrieval.”. In practice, interpret that wording at the boundary owned by Message Queuing applications, rather than treating the value as a generic Windows message.
Evidence to capture for MQ_ERROR_SHARING_VIOLATION
- Record the exact COM method or Windows API, its input object, the calling thread, and the full 0xC00E0009 value before a wrapper converts it to an exception or Boolean result.
- Capture any IErrorInfo text, activity identifier, event-log entry, and subsystem trace that mentions MQ_ERROR_SHARING_VIOLATION or the mq / sharing / violation operation.
- Preserve the first failure in the call chain; a later HRESULT can describe cleanup rather than the original mq / sharing / violation condition.
Retry and recovery for MQ_ERROR_SHARING_VIOLATION
Retry MQ_ERROR_SHARING_VIOLATION only when the owning API documents a transient state or after the condition described as “There is a sharing violation. The queue is already open for exclusive retrieval.” has changed. Configuration, policy, format, and authorization failures normally require correction first; an immediate loop can hide the original call site and add secondary errors.
Looking for a different code? Search another status or error code.