#include "stdafx.h" #include <windows.h> #include <sddl.h> int main(int argc, char* argv[]) { SECURITY_ATTRIBUTES sa; sa.nLength=sizeof(SECURITY_ATTRIBUTES); sa.bInheritHandle=false; char *szSD = "D:P" "(D;OICI;GA;;;BG)" //встроенная группа guests "(D;OICI;GA;;;SY)" //local system "(D;OICI;GA;;;BA)" //builtin admininstrators "(D;OICI;GA;;;IU)" //interactive "(D;OICI;GA;;;BU)"; //builtin users if (ConvertStringSecurityDescriptorToSecurityDescriptor(szSD,SDDL_REVISION_1,&(sa.lpSecurityDescriptor),NULL)){ if (!CreateDirectory("C:\\DACL",&sa))DWORD err=GetLastError(); } LocalFree(sa.lpSecurityDescriptor); return 0; }