Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

About the caller's account name

Status
Not open for further replies.

zallen

Programmer
Aug 10, 2000
227
CN
Hi,friend
Can i use the following method in delphi to get the Caller's account name?

procedure TLog.get_who(out who: WideString);
const
IID_SECURITY : TGUID = '{51372AEA-CAE7-11CF-BE81-00AA00A2FA25}';
var
SID : PSID;
Security : ISecurityProperty;
pName,pDomain : array[0..128] of Char;
cbName,cbDomain,peUse : Cardinal;
begin
SID := nil;
if Assigned(ObjectContext) then begin
ObjectContext.QueryInterface(IID_SECURITY,Security);
Security.GetDirectCreatorSID(SID);
Security.GetDirectCallerSID(SID);

Security.GetOriginalCreatorSID(SID);
Security.GetOriginalCallerSID(SID);
LookupAccountSid('',SID,pName,cbName,pDomain,cbDomain,peUse);
who := string(pDomain) + ':' + string(pName);
end;
end;

The method is a MTS component's method!

Any suggestions are appreicated!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top