MSMQGETSCONTEXT

Retrieves security information that is needed to authenticate messages.

Syntax

CALL MSMQGETSCONTEXT(certStor, hContext, rc);

Required Arguments

certStor
Character, input
Specifies the name of the system certificate store to use to locate the desired external certificate. If NULL, then the internal security certificate that is provided by MSMQ is used. Generally, MY is used. The corresponding registry entry is:
HKEY_CURRENTUSER\Software\Microsoft\SystemCertificates\MY\Certificates
hContext
Numeric, output
Returns a handle to the security context buffer that is allocated by MSMQ.
rc
Numeric, output
Provides the return code from the CALL routine. If an error occurs, then the return code is nonzero. A return code of -1 reflects a SAS internal error. Otherwise, it represents an MSMQ error code. You can use the SAS function SYSMSG() to obtain a textual description of the return code.

Example: Example

This example gets the security context from internal MSMQ certificate.
length msg $ 200;
hContext=0;
rc=0;
CALL MSMQGETSCONTEXT("", hContext, rc);
if rc ^= 0 then do;
   put 'MSMQGetSContext: failed';
   msg = sysmsg();
   put msg;
end;
else put 'MSMQGetSContext: succeeded';