# IClientSecurity::QueryBlanket

Retrieves authentication information.

HRESULT QueryBlanket(

void* pProxy , | //Location for the proxy to query
DWORD* pAuthnSvc , | //Location for the current authentication service
DWORD* pAuthzSvc , | //Location for the current authorization service
OLECHAR ** pServerPrincName , | //Location for the current principal name
DWORD * pAuthnLevel , | //Location for the current authentication level
DWORD * pImpLevel , | //Location for the current impersonation level
RPC_AUTH_IDENTITY_HANDLE ** ppAuthInfo , | //Location for the value passed to IClientSecurity::SetBlanket
DWORD ** pCapabilities | //Location for flags indicating further capabilities of the proxy
); |

Parameter

pProxy
  [in] Pointer to the proxy to query.pAuthnSvc

  [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. May be NULL, in which case the current authentication service is not retrieved.

pAuthzSvc
  [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. May be NULL, in which case the current authorization service is not retrieved.
pServerPrincName
  [out] Pointer to the current principal name. The string will be allocated by the one called using CoTaskMemAlloc and must be freed by the caller using CoTaskMemFree when they are done with it. May be NULL, in which case the principal name is not retrieved.
pAuthnLevel
  [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. May be NULL, in which case the current authentication level is not retrieved.
pImpLevel
  [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. May be NULL, in which case the current authentication level is not retrieved.
ppAuthInfo
  [out] Pointer to the pointer value passed to IClientSecurity::SetBlanket indicating the identity of the client. Because this points to the value itself and is not a copy, it should not be manipulated. May be NULL, in which case the information is not retrieved.
pCapabilities
  [out] Pointer to a DWORD of flags indicating further capabilities of the proxy. Currently, no flags are defined for this parameter and it will only return zero. May be NULL, in which case the flags indicating further capabilities are not retrieved.

Return Values

S_OK
  Success.
E_INVALIDARG
  One or more arguments are invalid.
E_OUTOFMEMORY
  Insufficient memory to create the pServerPrincName out-parameter.

Remarks

IClientSecurity::QueryBlanket is called by the client to retrieve the authentication information COM will use on calls made from the specified proxy. With a pointer to an interface on the proxy, the client would first call QueryInterface for a pointer to IClientSecurity, then, with this pointer, would call IClientSecurity::QueryBlanket, followed by releasing the pointer. This sequence of calls is encapsulated in the helper function CoQueryProxyBlanket.

In pProxy, you can pass any proxy, such as a proxy you get through a call to CoCreateInstance, CoUnmarshalInterface, or just passing an interface pointer as a parameter. It can be any interface. You cannot pass a pointer to something that is not a proxy. Thus you can’t pass a pointer to an interface that has the local keyword in its interface definition since no proxy is created for such an interface. IUnknown is the exception.

See Also

CoQueryProxyBlanket