znsoft
管理员
管理员
  • 注册日期2001-03-23
  • 最后登录2023-10-25
  • 粉丝300
  • 关注6
  • 积分910分
  • 威望14796点
  • 贡献值7点
  • 好评度2410点
  • 原创分5分
  • 专家分100分
  • 社区居民
  • 最爱沙发
  • 社区明星
阅读:2087回复:0

最简单的方法创建安全描述符

楼主#
更多 发布于:2009-01-22 12:50
static VOID BuildSecurityAttributes(PSECURITY_ATTRIBUTES SecurityAttributes)
{
    LPTSTR sd = L"D:P(A;;GA;;;SY)(A;;GRGWGX;;;BA)(A;;GRGW;;;WD)(A;;GR;;;RC)";

    ZeroMemory(SecurityAttributes, sizeof(SECURITY_ATTRIBUTES));
    
    ConvertStringSecurityDescriptorToSecurityDescriptor(
        sd,
        SDDL_REVISION_1,
        &SecurityAttributes->lpSecurityDescriptor,
        NULL);

    SecurityAttributes->nLength = sizeof(SECURITY_ATTRIBUTES);
    SecurityAttributes->bInheritHandle = TRUE;
}
http://www.zndev.com 免费源码交换网 ----------------------------- 软件创造价值,驱动提供力量! 淡泊以明志,宁静以致远。 ---------------------------------- 勤用搜索,多查资料,先搜再问。
游客

返回顶部