CryptCATPutCatAttrInfo function

[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* WINAPI CryptCATPutCatAttrInfo(
  _In_ HANDLE hCatalog,
  _In_ LPWSTR pwszReferenceTag,
  _In_ DWORD  dwAttrTypeAndAction,
  _In_ DWORD  cbData,
  _In_ BYTE   *pbData
);

Parameters

hCatalog [in]

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

pwszReferenceTag [in]

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

dwAttrTypeAndAction [in]

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

ValueMeaning
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.

 

cbData [in]

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

pbData [in]

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 codeDescription
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

Minimum supported client

Windows XP [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]

Header

Mscat.h

Library

Wintrust.lib

DLL

Wintrust.dll

 

 

Show: