The AttachCurrentSecurityContext method is received by the server in an RPC_REQUEST packet. In response, the server MUST cache the relevant information required to sign a message on behalf of the client, including the Message.SenderIdentifier and Message.SenderCertificate. This method is provided purely as an optimization to allow the client to reduce lookups of the security information about the calling client each time the message is sent. The represented Message.SenderIdentifier and Message.SenderCertificate property values MUST NOT be updated as a result of calling this method. This method is superseded by IMSMQMessage4::AttachSecurityContext2.

 HRESULT AttachCurrentSecurityContext();

This method has no parameters.

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: