ISecurityProperty::GetOriginalCreatorSID Method

Retrieves the security ID of the original base process that initiated the activity in which the current object is executing.

Provided By

ISecurityProperty Interface

HRESULT ISecurityProperty::GetOriginalCreatorSID (
    PSID* ppSid
);

Parameters

ppSid
[out] A reference to the security ID of the base process that initiated the activity in which the current object is executing.

Return Values

S_OK
The security ID of the original creator is returned in the parameter ppSid.

E_INVALIDARG
The argument passed in the ppSid parameter is a NULL pointer.

E_FAIL
An unexpected error occurred.

Remarks

You use the GetOriginalCreatorSID method to determine the security ID of the process that initiated the activity in which the current object is executing. The following scenario illustrates the functionality of the GetOriginalCreatorSID method.

A base process running on server A, as user A, creates object X on server B, running as user B. Then object X creates object Y, running on server C. If object Y calls GetOriginalCreatorSID, the the security ID of user A is returned.

Note The path to the original creator is broken if an object is created by some other means than IObjectContext::CreateInstance or ITransactionContext::CreateInstance. For example, if the base process on server A uses CoCreateInstance to create X, when Y calls GetOriginalCreatorSID, the the security ID it gets back will be the the security ID of user B, not user A. This is because the creation sequence is traced back through the objects' context and MTS can only create a context for an object that's created with either IObjectContext::CreateInstance or ITransactionContext::CreateInstance.

You must call ReleaseSID on a security ID when you finish using it.

Example

See Also

Programmatic Security, Advanced Security Methods, IObjectContext Interface