亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

Delphi修改操作注冊(cè)表權(quán)限的代碼

 更新時(shí)間:2011年09月29日 22:05:59   作者:  
Delphi修改操作注冊(cè)表權(quán)限的代碼,使用Delphi的朋友可以參考下。
需要uses jclwin32, AccCtrl; 此文件需要安裝JCL
復(fù)制代碼 代碼如下:

function AllowRegKeyForEveryone(Key: HKEY; Path: string): Boolean;
var
WidePath: PWideChar;
Len: Integer;
begin
case Key of
HKEY_LOCAL_MACHINE:
Path := 'MACHINE\' + Path;
HKEY_CURRENT_USER:
Path := 'CURRENT_USER\' + Path;
HKEY_CLASSES_ROOT:
Path := 'CLASSES_ROOT\' + Path;
HKEY_USERS:
Path := 'USERS\' + Path;
end;
Len := (Length(Path)+1)*SizeOf(WideChar);
GetMem(WidePath,Len);
MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, PChar(Path), -1, WidePath, Len);
Result := SetNamedSecurityInfoW(WidePath, SE_REGISTRY_KEY,
DACL_SECURITY_INFORMATION, nil, nil, nil, nil) = ERROR_SUCCESS;
FreeMem(WidePath);
end;

相關(guān)文章

最新評(píng)論