Share via


PROPID_M_SIGNATURE_LEN

 

Applies To: Windows 10, Windows 7, Windows 8, Windows 8.1, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows Server 2012 R2, Windows Server Technical Preview, Windows Vista

(Read-only.) The PROPID_M_SIGNATURE_LEN property indicates the length of the MSMQ 1.0 signature or application-generated signature that is attached to the message.

Property ID

PROPID_M_SIGNATURE_LEN

Type Indicator

VT_UI4

MQPROPVARIANT Field

ulVal

Property Value

Length (in bytes) of the digital signature.

Remarks

PROPID_M_SIGNATURE_LEN is used when retrieving the digital signature of a message, or by connector applications when they attach a digital signature to a message.

To set the digital signature length, the connector application must specify PROPID_M_SIGNATURE and PROPID_M_SIGNATURE_LEN in the MQMSGPROPS structure and call MQSendMessage.

To retrieve the digital signature, specify PROPID_M_SIGNATURE and PROPID_M_SIGNATURE_LEN in the MQMSGPROPS structure. Then call MQReceiveMessage or MQReceiveMessageByLookupId and examine the returned value. When retrieving this property, the type indicator can be set to VT_UI4 or VT_NULL. If you set the type indicator to VT_NULL, Message Queuing automatically changes the type indicator to VT_UI4 during the function call.

Equivalent COM Property

This property is not needed when you are using COM components.

Example Code

The following code fragment shows how PROPID_M_SIGNATURE_LEN is specified in arrays that can be used to initialize an MQMSGPROPS structure for retrieving a digital signature.

ULONG ulSignatureBufferSize = 1024;  
UCHAR *pucSignatureBuffer = NULL;  
pucSignatureBuffer = (UCHAR *)malloc(ulSignatureBufferSize);  
if (pucSignatureBuffer == NULL)  
{  
  return MQ_ERROR_INSUFFICIENT_RESOURCES;  
}  
memset(pucSignatureBuffer, 0, ulSignatureBufferSize);  
aMsgPropId[i] = PROPID_M_SIGNATURE;         // Property ID.  
aMsgPropVar[i].vt = VT_VECTOR | VT_UI1;     // Type indicator.  
aMsgPropVar[i].caub.pElems = pucSignatureBuffer;  
aMsgPropVar[i].caub.cElems = ulSignatureBufferSize;  
i++;  
  
aMsgPropId[i] = PROPID_M_SIGNATURE_LEN;     // Property ID.  
aMsgPropVar[i].vt = VT_UI4;                 // Type indicator.  
i++;  

See Also

Message Properties
MQMSGPROPS
MQReceiveMessage
MQReceiveMessageByLookupId
PROPID_M_SIGNATURE