3.14.4.1.2 Next (Opnum 8)

The Next method is received by the server in an RPC_REQUEST packet. In response, the server returns an MSMQQueueInfo4 object that represents a public queue in the ResultQueueCollection.

 HRESULT Next(
   [out, retval] IMSMQQueueInfo4** ppqinfoNext
 );

ppqinfoNext: A pointer to an MSMQQueueInfo4 interface pointer that upon successful completion contains an initialized MSMQQueueInfo object representing the next public queue within the collection represented by the ResultQueueCollection instance variable.

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:

  • If the IsInitialized instance variable equals False:

    • Return an error HRESULT.

  • If the CollectionCursor instance variable is at the end of the collection represented by the ResultQueueCollection instance variable:

    • Set the ppqinfoNext output parameter to NULL, and take no further action.

  • Else:

    • Create a new MSMQQueueInfo object instance.

    • Set the QueueFormatName instance variable of the created MSMQQueueInfo object to the format name identifying the public queue identified by the CollectionCursor instance variable in the collection represented by the ResultQueueCollection instance variable.

    • Call MSMQQueueInfo::Refresh on the created MSMQQueueInfo instance.

    • Set the ppqinfoNext output parameter to a pointer to an IMSMQQueryInfo4 interface pointer of the newly created MSMQQueueInfo object.

  • Advance the cursor represented by the CollectionCursor instance variable to the next public queue in the collection represented by the ResultQueueCollection instance variable.