# CoQueryClientBlanket

Called by the server to find out about the client that invoked the method executing on the current thread.

HRESULT CoQueryClientBlanket(

DWORD* pAuthnSvc, | //Pointer to the current authentication service
DWORD* pAuthzSvc, | //Pointer to the current authorization service
OLECHAR ** pServerPrincName, | //Pointer to the current principal name
DWORD * pAuthnLevel, | //Pointer to the current authentication level
DWORD * pImpLevel, | //Must be NULL
void ** ppPrivs, | //Pointer to unicode string identifying client
DWORD ** pCapabilities | //Pointer to flags indicating further capabilities of the proxy
); |

Parameters

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 returned.
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 returned.
pServerPrincName
  [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. May be NULL, in which case the principal name is not returned.
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 returned.
pImpLevel
  [out] Must be NULL; does not supplythe current impersonation level is not returned.
pPrivs
  [out] Pointer to a unicode string identifying the client. This string is not a copy, the user must not change it or free it. The string is not valid past the end of the call. For NTLMSSP the string is of the form domain\user.
pCapabilities
  [out] Pointer to flags indicating further capabilities of the call. Currently, no flags are defined for this parameter and the value retrieved is EOAC_NONE. May be NULL, in which case no value is retrieved. EOAC_MUTUAL_AUTH is defined but not used by NTLMSSP. Third party security providers may return that flag.

Return Values

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

Remarks

CoQueryClientBlanket is called by the server to get security information about the client that invoked the method executing on the current thread. This function encapsulates the following sequence of common calls (error handling excluded):

        CoGetCallContext(IID_IServerSecurity, (void**)&pss);
        pss->QueryBlanket(pAuthnSvc, pAuthzSvc, pServerPrincName,
                    pAuthnLevel, pImpLevel, pPrivs, pCapabilities);
        pss->Release();

See Also

IServerSecurity::QueryBlanket, Security in COM