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!
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!