CoRegisterAuthenticationService

HRESULT CoRegisterAuthenticationServices(cbauthSvc, asAuthSvc);

This API sets the list of authentication services COM will use to authenticate incoming calls. If a call arrives with a different authentication service, the call will fail. Registering authentication services does not prevent the arrival of unsecure calls (for example, calls with no authentication service). This API can only be called before any interfaces are marshaled. Thus servers must call this if they want security. This call is not useful for clients (unless they are also servers).

This API can only be called once.

An application cannot call both CoInitializeSecurity and CoRegisterAuthenticationService.

Argument

Type

Description

cbAuthSvc

DWORD

Specify the number of authentication services in the list asAuthSvc.

asAuthSvc

SOLE_AUTHENTICATION
_SERVICE*

An array of authentication services to register. The authentication services are enumerated in rpcdce.h. COM copies the list. If the principal name is NULL, COM will assume the current user ID. A NULL principal name will work for NTLMSSP and Kerberos. It may or may not work for other authentication services.

Returns

S_OK

Success.

E_INVALIDARG

One or more arguments are invalid.