EnumerateSecurityPackagesA function (sspi.h)

The EnumerateSecurityPackages function returns an array of SecPkgInfo structures that provide information about the security packages available to the client.

Syntax

SECURITY_STATUS SEC_ENTRY EnumerateSecurityPackagesA(
  [in] unsigned long *pcPackages,
  [in] PSecPkgInfoA  *ppPackageInfo
);

Parameters

[in] pcPackages

A pointer to a ULONG variable that receives the number of packages available on the system. This includes packages that are already loaded and packages available on demand.

[in] ppPackageInfo

A pointer to a variable that receives a pointer to an array of SecPkgInfo structures. Each structure contains information from the security support provider (SSP) that describes the capabilities of the security package available within that SSP.

When you have finished using the array, free the memory by calling the FreeContextBuffer function.

Return value

If the function succeeds, the function returns SEC_E_OK.

If the function fails, it returns a nonzero error code. Possible values include, but are not limited to, those in the following table.

Return code/value Description
SEC_E_INSUFFICIENT_MEMORY
0x80090300L
There was not sufficient memory to allocate one or more of the buffers.
SEC_E_INVALID_HANDLE
0x80090301L
An invalid handle was specified.
SEC_E_SECPKG_NOT_FOUND
0x80090305L
The specified package was not found.

Remarks

The caller can use the Name member of a SecPkgInfo structure to specify a security package in a call to the AcquireCredentialsHandle (General) function.

Note

The sspi.h header defines EnumerateSecurityPackages as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.

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 SspiCli.dll

See also

AcquireCredentialsHandle (General)

FreeContextBuffer

SSPI Functions

SecPkgInfo