CryptCATPutCatAttrInfo function (mscat.h)

[The CryptCATPutCatAttrInfo function is available for use in the operating systems specified in the Requirements section. It may be altered or unavailable in subsequent versions.]

The CryptCATPutCatAttrInfo function allocates memory for a catalog file attribute and adds it to the catalog.

Syntax

CRYPTCATATTRIBUTE * CryptCATPutCatAttrInfo(
  [in] HANDLE hCatalog,
  [in] LPWSTR pwszReferenceTag,
  [in] DWORD  dwAttrTypeAndAction,
  [in] DWORD  cbData,
  [in] BYTE   *pbData
);

Parameters

[in] hCatalog

A handle to the catalog obtained from the CryptCATOpen or CryptCATHandleFromStore functions.

[in] pwszReferenceTag

A pointer to a null-terminated string for the name of the attribute.

[in] dwAttrTypeAndAction

A value that represents a bitwise combination of the following flags. The caller must at least specify CRYPTCAT_ATTR_DATAASCII or CRYPTCAT_ATTR_DATABASE64.

Value Meaning
CRYPTCAT_ATTR_AUTHENTICATED
0x10000000
The attribute is authenticated.
CRYPTCAT_ATTR_UNAUTHENTICATED
0x20000000
The attribute is unauthenticated.
CRYPTCAT_ATTR_NAMEASCII
0x00000001
The attribute is an ASCII string.
CRYPTCAT_ATTR_NAMEOBJID
0x00000002
The attribute is a cryptographic object identifier (OID).
CRYPTCAT_ATTR_DATAASCII
0x00010000
The attribute contains simple ASCII characters that should not be decoded.
CRYPTCAT_ATTR_DATABASE64
0x00020000
The attribute is in base 64 format.
CRYPTCAT_ATTR_DATAREPLACE
0x00040000
The attribute replaces the value for an existing attribute.

[in] cbData

A value that specifies the number of bytes in the pbData buffer.

[in] pbData

A pointer to a memory buffer that contains the attribute value.

Return value

A pointer to a CRYPTCATATTRIBUTE structure that contains the catalog attribute. The caller must not free this pointer or any of its members.

If this function returns NULL, additional error information can be obtained by calling the GetLastError function. GetLastError will return one of the following error codes.

Return code Description
ERROR_INVALID_PARAMETER
One or more of the parameters are not valid.
ERROR_NOT_ENOUGH_MEMORY
The operating system ran out of memory during the operation.

Requirements

Requirement Value
Minimum supported client Windows XP [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Target Platform Windows
Header mscat.h
Library Wintrust.lib
DLL Wintrust.dll