3.12.4.1.1 Open (Opnum 7)

The Open method is received by the server in an RPC_REQUEST packet. In response, the server opens the Queues identified by the QueueFormatName instance variable for sending messages.

 HRESULT Open();

This method has no parameters.

Return Values: The method MUST return S_OK (0x00000000) on success, S_FALSE (0x00000001) if the object is already opened, or an implementation-specific error HRESULT on failure.

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

  • If the DestinationOpenQueueDescriptor instance variable is not equal to NULL:

    • Return S_FALSE (0x00000001), and take no further action.

  • If the DestinationOpenQueueDescriptor instance variable is NULL:

    • Generate the Open Queue event as described in [MS-MQDMPR] section 3.1.7.1.5 with the following parameters:

      • iFormatName = QueueFormatName

      • iRequiredAccess = SendAccess

      • iSharedMode = DenyNone

    • If the rStatus returned from the Open Queue Event is not MQ_OK (0x00000000):

      • Return an error HRESULT, and take no further action.

  • Set the DestinationOpenQueueDescriptor instance variable to rOpenQueueDescriptor returned by the Open Queue event.

  • Return S_OK (0x00000000), and take no further action.