craziscoth Posted July 30, 2005 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.
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now