Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

Setting permissions on directories

I have tried to set permissions on a directory in Windows NT 4 using the standard
Access Control APIs - the source code is below - unfortunately it only adds
Special Directory Access, and not Special File Access to the directory.
Does anyone know where I'm going wrong.

EXPLICIT_ACCESS * expAccess = new EXPLICIT_ACCESS[2];
BuildExplicitAccessWithName(&expAccess[0], "olaves\\Luke",
1180095, GRANT_ACCESS, CONTAINER_INHERIT_ACE);
BuildExplicitAccessWithName(&expAccess[1], "olaves\\Bobby", GENERIC_ALL,
GRANT_ACCESS, OBJECT_INHERIT_ACE);
errVal = SetEntriesInAcl(2, expAccess, NULL, &dacl);
[636 byte] By [Luke Alexander] at [2007-11-10 12:52:39]