Sets the authentication information that will be used to make calls on the specified proxy.
HRESULT SetBlanket(
void * pProxy , |
//Indicates the proxy to set |
DWORD dwAuthnSvc , |
//Authentication service to use |
DWORD dwAuthzSvc , |
//Authorization service to use |
WCHAR * pServerPrincName , |
//The server principal name to use with the authentication service |
DWORD dwAuthnLevel , |
//The authentication level to use |
DWORD dwImpLevel , |
//The impersonation level to use |
RPC_AUTH_IDENTITY_HANDLE * pAuthInfo , |
//The identity of the client |
DWORD dwCapabilities |
//Undefined &emdash; capability flags |
); |
Parameter
The caller should specify EOAC_NONE. EOAC_MUTUAL_AUTH is defined and may be used by other security providers, but is not supported by NTLMSSP. Thus, NTLMSSP will accept this flag without generating an error but without providing mutual authentication.
Return Values
Remarks
IClientSecurity::SetBlanket sets the authentication information that will be used to make calls on the specified proxy. The values specified here override the values chosen by automatic security. Calling this method changes the security values for all other users of the specified proxy. Call IClientSecurity::CopyProxy to make a private copy of the proxy.
By default, COM will choose the first available authentication service and authorization service available on both the client and server machines and the principal name which the server registered for that authentication service. Currently, COM will not try another authentication service if the first fails.
If pAuthInfo is NULL, it defaults to the current process token. dwAuthnLevel and dwImpLevel default to the values specified to CoInitializeSecurity. If CoInitializeSecurity is not called, the defaults are taken from the registry. The initial value for dwAuthnLevel on a proxy will be the higher of the value set on the client’s call to CoInitializeSecurity and the server’s call to CoInitializeSecurity .
Security information cannot be set on local interfaces. For example, it is illegal to set security on the IClientSecurity interface. However, since that interface is supported locally, there is no need for security. IUnknown is a special case. There are several cases. First, IUnknown cannot be copied. Thus all users of an object get the same security. Second, SetBlanket can be used to set the security used for calls to QueryInterface. However, since QueryInterface is heavily cached, the server might not see the call. Third, AddRef and Release always use the security set with CoInitializeSecurity, never the values set with SetBlanket.
See Also
CoSetProxyBlanket, CoQueryProxyBlanket, RPC_C_AUTHN_xxx, RPC_C_AUTHZ_xxx, RPC_C_AUTHN_LEVEL_xxx, RPC_C_IMP_LEVEL_xxx