参考资料来源:http://msdn.microsoft.com/en-us/library/aa379583(VS.85).aspx
此函数用来设置DACL中的信息。如果一个DACL已经在security descriptor中存在,那么此DACL将被替换。
函数原型如下:
要想使用第三、四两个参数,那么参数二需要设置为TRUE;如果参数二设置为FALSE,那么参数三、四被忽略。
值得注意的是MSDN中的Remarks中有这样的描述:
There is an important difference between an empty and a nonexistent DACL.
- When a DACL is empty, it contains no access control entries (ACEs); therefore, no access rights are explicitly granted. As a result, access to the object is implicitly denied.
- When an object has no DACL (when the pDacl parameter is NULL), no protection is assigned to the object, and all access requests are granted. To help maintain security, restrict access by using a DACL.把参数三设置为NULL,其实相当于将object的安全级别降到了最低,所有的访问请求都将成功。
SetSecurityDescriptorDacl函数详解
本文详细介绍了SetSecurityDescriptorDacl函数的功能及其使用方法。该函数用于设置或替换安全描述符中的DACL信息,通过调整DACL可以实现对对象访问权限的控制,包括完全开放或隐式拒绝访问。
2632

被折叠的 条评论
为什么被折叠?



