craziscoth Posted July 30, 2005 Share Posted July 30, 2005 Hello all,I am trying to change the security permissions for a file/folder to allow or deny full control to a specific user. However I get an access denied in setting the security info for the following code:hFile = CreateFile(filename, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_BACKUP_SEMANTICS, NULL);rc = GetSecurityInfo(hFile, SE_FILE_OBJECT, DACL_SECURITY_INFORMATION, NULL, NULL, &pDACL, NULL, &pSD);rc = SetEntriesInAcl(1, &eb, pDACL, &pNewDACL);rc = SetSecurityInfo(hFile, SE_FILE_OBJECT, DACL_SECURITY_INFORMATION, NULL, NULL, pNewDACL, NULL); I don't get any errors until the SetSecurityInfo call and it returns 'Access is denied'.Any ideas on what I am doing wrong?Thanks. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now