Вниз
Скачать: CL | DM;

Principal = Everyone   Найти похожие ветки 

 
Марат   (2001-11-13 20:26) [0]

В русских NT "Все", в английских "Everyone". Можно ли узнать Principal для everyone у самих Windows. Или мне нужно смотреть какие NT стоят и в зависимости от этого использовать либо "Все", либо "Everyone".


 
Марат   (2001-11-13 22:28) [1]

const
SECURITY_WORLD_SID_AUTHORITY: TSIDIdentifierAuthority =
(Value: (0, 0, 0, 0, 0, 1));
SECURITY_WORLD_RID = $00000000;

// use FreeSid
function GetEveryoneSid: PSID;
begin
Result := nil;
if not AllocateAndInitializeSid(SECURITY_WORLD_SID_AUTHORITY, 1,
SECURITY_WORLD_RID,
0, 0, 0, 0, 0, 0, 0,
Result) then RaiseLastWin32Error;
if not IsValidSid(Result) then RaiseLastWin32Error;
end;

procedure TForm1.Button2Click(Sender: TObject);
var
userName: array [0.. 255] of char;
domainName: array[0.. 255] of char;
nameLength: DWORD;
snu: SID_NAME_USE;
sid: PSID;
begin
sid := GetEveryoneSid;
try
if sid <> nil then
begin
nameLength := SizeOf(userName);
if not LookupAccountSid(nil, sid, userName, nameLength,
domainName, nameLength, snu) then RaiseLastWin32Error;
with Application do
MessageBox(PChar(@userName), PChar(Title), mb_IconInformation or mb_Ok);
end;
finally
if sid <> nil then FreeSid(sid);
end;
end;




Страницы: 1 вся ветка

Скачать: CL | DM;



Память: 0.45 MB
Время: 0.006 c
4-42616
Kyd
2001-11-13 11:18
2002.01.14
SendMessage(MyHandle, WM_SetText, 0, Integer(TextToSet));


3-42375
Venus
2001-12-13 11:12
2002.01.14
DBLookupListBox


1-42415
d()c666
2001-12-27 02:08
2002.01.14
символ эквивалентный переходу на другую строку...


14-42548
apav
2001-11-13 18:31
2002.01.14
ABC


7-42585
fsp
2001-09-29 21:15
2002.01.14
sender:Tobject




   Наверх