MSMQ can report errors for the properties an application passes to a call as well as an error for the call itself. When an error occurs, MSMQ generates an error value that is returned to the application.
For properties, error values are returned to the application in the optional aStatus array of MQQUEUEPROPS, MQMSGPROPS, and MQQMPROPS. The aStatus array is always optional: if the application specifies a NULL array in the property structure, MSMQ does not report errors to the application.
If the application does supply a status array when an error condition is encountered at index n of the property array (such as an illegal property tag or insufficient access rights to set a property), MSMQ stores the appropriate error value in entry n of the status array (if no error was encountered with this property, MSMQ stores the value MQ_OK). This means that if the application passes a status array, it must be the same size as the list of properties.
The returned value of any call corresponds to the highest-severity error it encounters. For example, if the error is caused by a property, MSMQ can either return an error code or an information code. To determine which property caused the error (and why), the application must examine the property status array.
For a list of error and information codes, see MSMQ Error and Information Codes. For information on the error codes returned by a specific call, refer to the appropriate API function or ActiveX method reference page.