FreeCredentialsHandle function (sspi.h)

The FreeCredentialsHandle function notifies the security system that the credentials are no longer needed. An application calls this function to free the credential handle acquired in the call to the AcquireCredentialsHandle (General) function after calling the DeleteSecurityContext function to free any context handles associated with the credential. When all references to this credential set have been removed, the credentials themselves can be removed.

Failure to free credentials handles will result in memory leaks.

Syntax

KSECDDDECLSPEC SECURITY_STATUS SEC_ENTRY FreeCredentialsHandle(
  [in] PCredHandle phCredential
);

Parameters

[in] phCredential

A pointer to the CredHandle handle obtained by using the AcquireCredentialsHandle (General) function.

Return value

If the function succeeds, the function returns SEC_E_OK.

If the function fails, it returns the following error code.

Return code Description
SEC_E_INVALID_HANDLE
The handle passed to the function is not valid.

Requirements

Requirement Value
Minimum supported client Windows XP [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Target Platform Windows
Header sspi.h (include Security.h)
Library Secur32.lib
DLL Secur32.dll

See also

AcquireCredentialsHandle (General)

SSPI Functions