I need to programmatically create a directory that grants "Full Control" to the group "Everyone". If I use
CreateDirectory(path, NULL);
This will, according to the Win32 SDK documentation, create a directory that inherits from its parent directory. I do not want to inherit the access rights of the parent directory I need to ensure that "Everyone" has full control over the directory.
Obviously, this will require setting up the SECURITY_ATTRIBUTES
structure with the appropriate security descriptor. How do I do that?
Here's one technique that seems to work:
Note that this sample code has absolutely no error checking -- you'll have to supply that yourself.