This function retrieves the authentication information the client uses to make calls on the specified proxy.
HRESULT CoQueryProxyBlanket( IUnknown* pProxy, DWORD* pAuthnSvc, DWORD* pAuthzSvc, OLECHAR** pServerPrincName, DWORD* pAuthnLevel, DWORD* pImpLevel, RPC_AUTH_IDENTITY_HANDLE* ppAuthInfo, DWORD* pCapabilities );
[in] Pointer indicating the proxy to query. For more information, see the Remarks section.
[out] Pointer to a DWORD value defining the current authentication service. This will be a single value taken from the list of RPC_C_AUTHN_XXX constants.
Can be NULL, in which case the current authentication service is not retrieved.
[out] Pointer to a DWORD value defining the current authorization service. This will be a single value taken from the list of RPC_C_AUTHZ_XXX constants.
Can be NULL, in which case the current authorization service is not retrieved.
[out] Pointer to the current principal name. The string will be allocated by the callee using CoTaskMemAlloc and must be freed by the caller using CoTaskMemFree when they are done with it. Notice that the actual principal name is returned. The EOAC_MAKE_FULLSIC flag is not accepted to convert the principal name.
Can be NULL, in which case the principal name is not retrieved.
[out] Pointer to a DWORD value defining the current authentication level. This will be a single value taken from the list of RPC_C_AUTHN_LEVEL_XXX constants.
Can be NULL, in which case the current authentication level is not retrieved.
[out] Pointer to a DWORD value defining the current impersonation level. This will be a single value taken from the list of RPC_C_IMP_LEVEL_XXX constants.
Can be NULL, in which case the current impersonation level is not retrieved. When using NTLMSSP, this value could be RPC_IMP_LEVEL_IDENTIFY or RPC_IMP_LEVEL_IMPERSONATE.
When using Kerberos, it will be RPC_IMP_LEVEL_IDENTIFY, RPC_IMP_LEVEL_IMPERSONATE, or RPC_C_IMP_LEVEL_DELEGATE.
[out] Pointer to the pointer value indicating the identity of the client that was passed to the last IClientSecurity::SetBlanket call (or the default value).
Default values are only valid until the proxy is released.
If no SetBlanket call replaced the default security blanket, and if the client specified a structure for the current authentication service in the pAuthInfo parameter to CoInitializeSecurity, that value is returned.
Because this points to the value itself and is not a copy, it should not be manipulated or freed.
[out] Pointer to a DWORD of flags indicating the capabilities of the proxy.
Can be NULL, in which case the flags are not retrieved.
CoQueryProxyBlanket is called by the client to retrieve the authentication information COM will use on calls made from the specified proxy. This function encapsulates the following sequence of common calls (error handling excluded).
pProxy->QueryInterface(IID_IClientSecurity, (void**)&pcs); pcs->QueryBlanket(pProxy, pAuthnSvc, pAuthzSvc, pServerPrincName, pAuthnLevel, pImpLevel, ppAuthInfo, pCapabilities); pcs->Release();
Your application uses pProxy to pass any proxy, such as a proxy obtained through a call to CoCreateInstance, CoUnmarshalInterface, or to pass a pointer to any interface. The application cannot pass a pointer to something that is not a proxy. Therefore, it cannot pass a pointer to an interface that has the local keyword in its interface definition, because no proxy is created for such an interface. A pointer to IUnknown is the exception to this rule.
To determine whether the platform supports this function, see Determining Supported COM APIs.