阅读:2121回复:0
最简单的方法创建安全描述符
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; } |
|
|