求RegGetKeySecurity和RegSetKeySecurity的用法(急,在线等待)

liotion 2003-12-10 02:36:18
如题,困惑中,望高手指点。
...全文
448 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
lanstar200 2004-01-13
  • 打赏
  • 举报
回复
RegSetKeySecurity设置安全信息
RegGetKeySecurity获得安全信息

看MSDN
liotion 2004-01-13
  • 打赏
  • 举报
回复
块来人解答啊
liotion 2003-12-17
  • 打赏
  • 举报
回复
快来人解答呀,目的是能够将system权限给everyone
liotion 2003-12-13
  • 打赏
  • 举报
回复
不会用,访问被拒绝,则么用?
haowh 2003-12-12
  • 打赏
  • 举报
回复
2000的内核对象都有一个安全级别,这个函数就是用来设置你的hkey 的安全级别的
先用惹RegOpenKey 或者 RegCreateKey 得到一个 hkey 句柄,然后定义一个 PSECURITY_DESCR 结构....
自己看msdn 呀
////////////////////////////////
LONG RegSetKeySecurity(
HKEY hKey, // handle to key
SECURITY_INFORMATION SecurityInformation, // request
PSECURITY_DESCRIPTOR pSecurityDescriptor // SD
);
Parameters
hKey
[in] Handle to an open key for which the security descriptor is set.
SecurityInformation
[in] Specifies the components of the security descriptor to set. The value can be a combination of the following values. Value Meaning
DACL_SECURITY_INFORMATION Sets the key's discretionary access control list (DACL). The hKey handle must have WRITE_DAC access, or the calling process must be the object's owner.
GROUP_SECURITY_INFORMATION Sets the key's primary group SID. The hKey handle must have WRITE_OWNER access, or the calling process must be the object's owner.
OWNER_SECURITY_INFORMATION Sets the key's owner security identifier (SID). The hKey handle must have WRITE_OWNER access, or the calling process must be the object's owner or have the SE_TAKE_OWNERSHIP_NAME privilege enabled.
SACL_SECURITY_INFORMATION Sets the key's system access control list (SACL). The hKey handle must have ACCESS_SYSTEM_SECURITY access. The proper way to get this access is to enable the SE_SECURITY_NAME privilege in the caller's current access token, open the handle for ACCESS_SYSTEM_SECURITY access, and then disable the privilege.


pSecurityDescriptor
[in] Pointer to a SECURITY_DESCRIPTOR structure that specifies the security attributes to set for the specified key

2,643

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 硬件/系统
社区管理员
  • 硬件/系统社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧