IGetSecurityCallContext::GetSecurityCallContext method (comsvcs.h)
Retrieves a reference to an object created from the SecurityCallContext class that is associated with the current call.
Instead of using this method, C++ developers should use the CoGetCallContext function, supplying IID_ISecurityCallContext for the riid parameter.
Syntax
HRESULT GetSecurityCallContext(
[out] ISecurityCallContext **ppObject
);
Parameters
[out] ppObject
A reference to ISecurityCallContext on the object's context.
Return value
This method can return the standard return values E_INVALIDARG, E_OUTOFMEMORY, E_UNEXPECTED, and E_FAIL, as well as the following values.
Return code | Description |
---|---|
|
The method completed successfully. |
|
The current object does not have a context associated with it because either the component wasn't imported into an application or the object was not created with one of the COM+ CreateInstance methods. This error is also returned if the GetObjectContext method was called from a constructor or from an IUnknown method. |
Remarks
With an object's security call context, you can retrieve items in the security call context collection, such as the minimum authentication level, the direct caller, the original caller, the chain of callers, and the number of callers. You can also call the IsSecurityEnabled and IsCallerInRole methods to ensure that a particular section of code is executed. However, you can call these methods only if role-based security is enabled and if the direct caller is a member of a specified role.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows 2000 Professional [desktop apps only] |
Minimum supported server | Windows 2000 Server [desktop apps only] |
Target Platform | Windows |
Header | comsvcs.h |