Z
zhsh200
Unregistered / Unconfirmed
GUEST, unregistred user!
在下面的函数中,每次执行到isp.GetDirectCallerSID(SID);时,系统总是报“灾难性错误”
function TCoolObject.GetDirectCaller: String;
var
isp : ISecurityProperty;
SID : PSID;
bResult : Boolean;
sName : array[0..255] of char;
sDomainName : array[0..255] of char;
NameUse : SID_NAME_USE;
NameLength : DWORD;
do
mainLength : DWORD;
begin
try
isp := ObjectContext as ISecurityProperty;
/////////////////////////////////
/////////////////////////////////
isp.GetDirectCallerSID(SID);
NameLength := 255;
do
mainLength := 255;
bResult := LookupAccountSid(nil, SID, sName, NameLength,sDomainName,do
mainLength, NameUse);
if (bREsult) then
Result := sName;
finally
isp.ReleaseSID(SID);
end;
end;
function TCoolObject.GetDirectCaller: String;
var
isp : ISecurityProperty;
SID : PSID;
bResult : Boolean;
sName : array[0..255] of char;
sDomainName : array[0..255] of char;
NameUse : SID_NAME_USE;
NameLength : DWORD;
do
mainLength : DWORD;
begin
try
isp := ObjectContext as ISecurityProperty;
/////////////////////////////////
/////////////////////////////////
isp.GetDirectCallerSID(SID);
NameLength := 255;
do
mainLength := 255;
bResult := LookupAccountSid(nil, SID, sName, NameLength,sDomainName,do
mainLength, NameUse);
if (bREsult) then
Result := sName;
finally
isp.ReleaseSID(SID);
end;
end;