I keep having to Google this, so I thought it’d just put it up here. This piece of code creates a SECURITY_ATTRIBUTES (and SECURITY_DESCRIPTOR) for the Everyone group. Handy for some quick-n-dirty hacking, but probably A Bad Idea for anything else.

SECURITY_DESCRIPTOR SD;
InitializeSecurityDescriptor(&SD, SECURITY_DESCRIPTOR_REVISION);
SetSecurityDescriptorDacl(&SD, TRUE,(PACL)NULL, FALSE);

SECURITY_ATTRIBUTES sa = {0};
sa.nLength = sizeof(sa);
sa.bInheritHandle = FALSE;
sa.lpSecurityDescriptor = &SD;