QueryCredentialsAttributes

The QueryCredentialsAttributes function retrieves the attributes of a credential, such as the name associated with the credential.

SECURITY_STATUS QueryCredentialsAttributes(
  PCredHandle phCredential,  // credential to query
  ULONG ulAttribute,         // attribute to query
  PVOID pBuffer              // buffer that receives attributes
);
 

Parameters

phCredential
Handle to the credentials to be queried.
ulAttribute
Specifies the attribute to query. This parameter must be SECPKG_CRED_ATTR_NAMES.
pBuffer
Pointer to a buffer that receives the requested attribute. For the SECPKG_CRED_ATTR_NAMES attribute, pBuffer must point to a SecPkgCredentials_Names structure.

Return Values

If the function succeeds, the return value is SEC_E_OK.

If the function fails, the return value may be one of the following error codes.

Value Meaning
SEC_E_INVALID_HANDLE The handle passed to the function is invalid.
SEC_E_INSUFFICIENT_MEMORY Insufficient memory.

Remarks

The QueryCredentialsAttributes function allows a customer of the security services to determine the name associated with the specified credentials.

The caller must allocate the structure pointed to by the pBuffer parameter. The security provider allocates the buffer for any pointer returned in the pBuffer structure. The caller can call the FreeContextBuffer function to free any pointers allocated by the security provider.

See Also

FreeContextBuffer