Restores the security attributes for a COM object that is running on COM+ and impersonating the client.
TransactionServer objects
transactionserver.RevertToSelf ( )
Argument |
Description |
---|---|
transactionserver |
Reference to the TransactionServer service instance |
Integer. Returns 1 if it succeeds and -1 if an error occurs.
COM objects running on COM+ can use the ImpersonateClient function to run in the client's security context so that the object has access to the same resources as the client. Use RevertToSelf to restore the object’s security context.
The following example creates an instance of the TransactionServer service and checks whether the COM object is currently running in the client’s security context. If it is, it reverts to the object’s security context:
TransactionServer txninfo_test
integer li_rc
li_rc = GetContextService( "TransactionServer", &
txninfo_test )
IF txninfo_test.IsImpersonating() THEN &
txninfo_test.RevertToSelf()