The LookupQueue_v2 method is received by the server in an RPC_REQUEST packet. In response, the server MUST return a pointer to an IMSMQQueueInfos4 interface pointer. The returned interface allows the client to enumerate over a collection of Queues. The queue query represents search criteria based on any combination of Queue.Identifier, Queue.Type, Queue.Label, Queue.CreateTime, or Queue.ModifyTime  properties.

 HRESULT LookupQueue_v2(
   [in, optional] VARIANT* QueueGuid,
   [in, optional] VARIANT* ServiceTypeGuid,
   [in, optional] VARIANT* Label,
   [in, optional] VARIANT* CreateTime,
   [in, optional] VARIANT* ModifyTime,
   [in, optional] VARIANT* RelServiceType,
   [in, optional] VARIANT* RelLabel,
   [in, optional] VARIANT* RelCreateTime,
   [in, optional] VARIANT* RelModifyTime,
   [out, retval] IMSMQQueueInfos4** ppqinfos
 );

QueueGuid: Pointer to a VARIANT containing a BSTR that contains a string representation of a Queue.Identifier. The string MUST adhere to the following format, specified using ABNF.

 guid = "{" dword-part "-" word-part "-" word-part "-" 
                   2byte-part "-" 6byte-part "}"
 dword-part = 2word-part
 word-part = 2byte-part
 byte-part = 2hex-digit
 hex-digit = %x30-39 / %x41-46 / %x61-66

ServiceTypeGuid: Pointer to a VARIANT containing a BSTR that contains a string representation of a Queue.Type. The string MUST adhere to the same format defined for the QueueGuid input parameter.

Label: Pointer to a VARIANT containing a BSTR that is used to query against the Queue.Label.

CreateTime: Pointer to a VARIANT that contains a DATE value that is used to query against Queue.CreateTime.

ModifyTime: Pointer to a VARIANT that contains a DATE value that is used to query against Queue.ModifyTime.

RelServiceType: Pointer to a VARIANT that contains a VT_I4 that specifies a logical comparison operator against the ServiceTypeGuid input parameter. This parameter corresponds to the RELOPS (section 2.2.2.20) enum. If this value is not specified by the client, the server MUST use the default value REL_EQ (0x00000001) in place of the unspecified value.

RelLabel: Pointer to a VARIANT that contains a VT_I4 that specifies a logical comparison operator against the Label input parameter. This parameter corresponds to the RELOPS enum. If this value is not specified by the client, the server MUST use the default value REL_EQ (0x00000001) in place of the unspecified value.

RelCreateTime: Pointer to a VARIANT that contains a VT_I4 that specifies a logical comparison operator against the CreateTime input parameter. This parameter corresponds to the RELOPS enum. If this value is not specified by the client, the server MUST use the default value REL_EQ (0x00000001) in place of the unspecified value.

RelModifyTime: Pointer to a VARIANT that contains a VT_I4 that specifies a logical comparison operator against the ModifyTime input parameter. This parameter corresponds to the RELOPS enum. If this value is not specified by the client, the server MUST use the default value REL_EQ (0x00000001) in place of the unspecified value.

ppqinfos: Pointer to an IMSMQQueueInfos4 interface pointer, which upon successful completion contains a pointer to an MSMQQueueInfos instance. This MSMQQueueInfos instance contains the query definition that can be used by the client to enumerate a collection of Directory Queues that match the specified criteria.

Return Values: The method MUST return S_OK (0x00000000) on success or an implementation-specific error HRESULT on failure.

When processing this call, the server MUST follow these guidelines: