| Previous | Next |
| MQ_ERROR_ILLEGAL_RELATION | MQ_ERROR_ILLEGAL_RESTRICTION_PROPID |
MQ_ERROR_ILLEGAL_PROPERTY_SIZE
Why the exact HRESULT matters
The important part of MQ_ERROR_ILLEGAL_PROPERTY_SIZE is not only whether the call failed, but which MSMQ subsystem had enough information to return this specific result. In this case the decisive subject is fixed-width message identifier supplied with wrong size. Message IDs and correlation IDs have protocol-defined lengths and are not arbitrary byte strings.
For MQ_ERROR_ILLEGAL_PROPERTY_SIZE, validation occurs in layers: identifier recognition, variant type, buffer shape, value range, required companions, and operation eligibility. When diagnosing MQ_ERROR_ILLEGAL_PROPERTY_SIZE, these layers correspond to different MSMQ HRESULTs and different fixes.
When diagnosing MQ_ERROR_ILLEGAL_PROPERTY_SIZE, MSMQ uses arrays whose indexes bind a property identifier, an MQPROPVARIANT value, and optionally a status result. In the MQ_ERROR_ILLEGAL_PROPERTY_SIZE path, misaligned counts or reordered arrays can make the logged property differ from the one actually rejected.
Subsystem context
| Subsystem | MSMQ property arrays and their parallel identifier, value, and status elements |
|---|---|
| Decisive boundary | the property identifier, VARTYPE, value, operation, and buffer ownership are validated separately |
| Code-specific focus | fixed-width message identifier supplied with wrong size |
| Primary recovery rule | Allocate exactly the documented size and preserve binary data without text conversion. |
When diagnosing MQ_ERROR_ILLEGAL_PROPERTY_SIZE, do not merge this result with other property failures: identifier, VARTYPE, value, size, required companions, and operation eligibility are diagnosed by different codes. For MQ_ERROR_ILLEGAL_PROPERTY_SIZE, the code-specific boundary is fixed-width message identifier supplied with wrong size.
Minimum useful telemetry
- The first failing property rather than only the aggregate hresult; associate it explicitly with
MQ_ERROR_ILLEGAL_PROPERTY_SIZE. - When diagnosing
MQ_ERROR_ILLEGAL_PROPERTY_SIZE, the complete apropid/apropvar/astatus triples in original order; capture the value before cleanup or retry changes it. - In the
MQ_ERROR_ILLEGAL_PROPERTY_SIZEpath, the api name and whether the structure was input, output, or both; compare it with a known-good call using the same account and queue type. - For this
MQ_ERROR_ILLEGAL_PROPERTY_SIZEresult, record the queue path or format name, local/remote placement, transactional flag, caller SID, process build, and UTC correlation ID when they apply.
For MQ_ERROR_ILLEGAL_PROPERTY_SIZE, log certificate thumbprints, provider names, SIDs, GUIDs, lengths, and hashes where useful, but do not log private keys, symmetric keys, credentials, or confidential message bodies.
Step-by-step diagnosis
- Record the unsigned HRESULT,
MQ_ERROR_ILLEGAL_PROPERTY_SIZE, and the native API or COM method before a framework replaces it with a generic exception. - When diagnosing
MQ_ERROR_ILLEGAL_PROPERTY_SIZE, capture the first failing property rather than only the aggregate HRESULT. - In the
MQ_ERROR_ILLEGAL_PROPERTY_SIZEpath, capture the complete aPropID/aPropVar/aStatus triples in original order. - Reproduce with the smallest queue/message/property set that still returns
MQ_ERROR_ILLEGAL_PROPERTY_SIZE; change one precondition at a time. - For
MQ_ERROR_ILLEGAL_PROPERTY_SIZE, verify the postcondition after the failed call: queue existence, message presence, directory object state, transaction outcome, or generated output may differ by result. - When diagnosing
MQ_ERROR_ILLEGAL_PROPERTY_SIZE, apply the code-specific recovery rule: Allocate exactly the documented size and preserve binary data without text conversion.
Retry and cleanup
Allocate exactly the documented size and preserve binary data without text conversion.
When diagnosing MQ_ERROR_ILLEGAL_PROPERTY_SIZE, an immediate loop around the same call is not recovery. In the MQ_ERROR_ILLEGAL_PROPERTY_SIZE path, define who owns cancellation, handle recreation, transaction reconciliation, and duplicate suppression before another attempt is issued.
Avoiding a false diagnosis
In the MQ_ERROR_ILLEGAL_PROPERTY_SIZE path, changing a queue ACL or restarting the service does not correct an invalid identifier, VARTYPE, value, structure, or property combination. The specific focus for MQ_ERROR_ILLEGAL_PROPERTY_SIZE remains fixed-width message identifier supplied with wrong size.
- In the
MQ_ERROR_ILLEGAL_PROPERTY_SIZEpath, A successful test under an interactive administrator account does not prove that the production service account has the same profile, token, directory access, or key permissions. - For this
MQ_ERROR_ILLEGAL_PROPERTY_SIZEresult, restarting MSMQ before collecting evidence can invalidate handles and erase the first useful event; it is a containment action, not a root-cause diagnosis.
Example
A wrapper building mqpropvariant arrays encounters MQ_ERROR_ILLEGAL_PROPERTY_SIZE. For MQ_ERROR_ILLEGAL_PROPERTY_SIZE, it logs the rejected property index and rebuilds the request from a typed schema instead of retrying the same arrays. When diagnosing MQ_ERROR_ILLEGAL_PROPERTY_SIZE, the acceptance test then changes only the decisive precondition and confirms both the HRESULT and the actual queue/message state.
Automated coverage should preserve the original arrays/identities, confirm that cleanup is safe after MQ_ERROR_ILLEGAL_PROPERTY_SIZE, and test that a retry does not duplicate messages or directory objects.
References
- Microsoft: Message Queuing error and information codes — source used for the
MQ_ERROR_ILLEGAL_PROPERTY_SIZEanalysis. - Microsoft: queue properties and MQQUEUEPROPS — source used for the
MQ_ERROR_ILLEGAL_PROPERTY_SIZEanalysis. - Microsoft: MSMQ message properties — source used for the
MQ_ERROR_ILLEGAL_PROPERTY_SIZEanalysis. - Microsoft: MQCreateQueue — source used for the
MQ_ERROR_ILLEGAL_PROPERTY_SIZEanalysis.
Looking for a different code? Search another status or error code.