3.1.5.8.5 Determining Message Destination
Let iTargetQueue be a Queue ([MS-MQDMPR] section 3.1.1.2) ADM element instance reference initialized to NULL.
If the value of the UserMessage.UserHeader.QueueManagerAddress field is equal to the Identifier ADM attribute of the local QueueManager element instance or is filled with the value 0x00, set iTargetQueue to the Queue ADM element instance reference in the QueueCollection ADM attribute of the local QueueManager ADM element instance that corresponds to the queue address specified in the UserMessage.UserHeader.DestinationQueue field.
If the value of the UserMessage.UserHeader.QueueManagerAddress field is not equal to the Identifier ADM attribute of the local QueueManager ADM element instance and is not filled with the value 0x00, perform the following steps:
Open the outgoing queue by raising an Open Queue ([MS-MQDMPR] section 3.1.7.1.5) event with the following arguments:
iFormatName := UserMessage.UserHeader.DestinationQueue.
iRequiredAccess := QueueAccessType.SendAccess.
iSharedMode := QueueShareMode.DenyNone.
Set iTargetQueue to rOpenQueueDescriptor.QueueReference.