3.2.4.1 Opening a Queue
The client MUST supply a queue name, an access mode, and a share mode. Opening a queue consists of the following sequence of operations:
The client MUST construct an RPC binding handle to the server, as specified in [C706] section 2.3.
The client MAY<32> call the R_GetServerPort (Opnum 0) (section 3.1.4.1) method by using the RPC handle from the previous step. This method returns the RPC endpoint port on which subsequent method calls to this interface are to be invoked.
The client MAY<33> construct a new RPC binding handle to the server by using the RPC endpoint port determined in the previous step and replacing it with it the initial RPC binding handle to the server.
The client MUST call the R_OpenQueue (Opnum 2) (section 3.1.4.2) method and MUST specify the following parameter values:
The RPC binding handle constructed in previous steps.
pQueueFormat set to the queue format name.
dwAccess mode set to the access mode.
dwShareMode set to the share mode.
Other parameters are as specified in section 3.1.4.2.
If the previous step returns an error code of EPT_S_NOT_REGISTERED (0x000006D9), the client SHOULD try instead to use the Message Queuing (MSMQ): Queue Manager to Queue Manager Protocol specified in [MS-MQQP].
The client MUST record the returned QUEUE_CONTEXT_HANDLE_SERIALIZE (section 2.2.4.2) handle.