CoQueryAuthenticationServices

[This is preliminary documentation and subject to change.]

Retrieves a list of the authentication services registered when the process called CoInitializeSecurity.

HRESULT CoQueryAuthenticationServices(
  DWORD * pcAuthSvc,  //Pointer to the number of entries returned in 
                      // the array
  SOLE_AUTHENTICATION_SERVICE** asAuthSvc
                      //Pointer to an array of structures
);
 

Parameters

pcAuthSvc
[out] Pointer to return the number of entries returned in the rgAuthSvc array. May not be NULL.
asAuthSvc
[out] Pointer to an array of SOLE_AUTHENTICATION_SERVICE structures. The list is allocated through a call to CoTaskMemAlloc. The caller must free the list when finished with it by calling CoTaskMemFree.

Return Values

This function supports the standard return values E_INVALIDARG and E_OUTOFMEMORY, as well as the following:

S_OK
Indicates success.

Remarks

CoQueryAuthenticationServices retrieves a list of the authentication services currently registered. If the process calls CoInitializeSecurity, these are the services registered through that call. If the application does not call it, CoInitializeSecurity is called automatically by COM, registering the default security package, the first time an interface is marshaled or unmarshaled.

This function returns only the authentication services registered with CoInitializeSecurity. It does not return all of the authentication services installed on the machine, but EnumerateSecurityPackages does. CoQueryAuthenticationServices is primarily useful for custom marshalers, to determine which principal names an application can use.

Different authentication services support different levels of security. For example, NTLMSSP does not support delegation or mutual authentication while Kerberos does. The application is responsible only for registering authentication services that provide the features the application needs. This function provides a way to find out which services have been registered with CoInitializeSecurity.

QuickInfo

  Windows NT: Use version 4.0 or later.
  Windows: Use Windows 95 or later. Available as a redistributable for Windows 95.
  Windows CE: Unsupported.
  Header: Declared in objbase.h.
  Import Library: Included as a resource in ole32.dll.

See Also

CoInitializeSecurity, SOLE_AUTHENTICATION_SERVICE structure, Security in COM