Hello all,
I am developing a native mode application (which runs in the same environment as autochk.exe) and I have some problems reseting a file’s permissions.
To reset the permissions I use this functional call:
status = NtSetSecurityObject(handle, DACL_SECURITY_INFORMATION,&SecurDescript);
The problem I am encountering is when I am trying too obtain a handle to the file. I get the status value STATUS_ACCESS_DENIED (0xC0000022) after the call:
status = NtOpenFile(&handle, WRITE_DAC, &ObjectAttributes, &IoStatBlock, FILE_SHARE_VALID_FLAGS, FILE_OPEN_REPARSE_POINT);
The target file has all permissions removed using windows explorer on winxp sp3. The owner of the file is Administrator. The native application I think it runs under the user SYSTEM.
If someone has a better idea on what parameters should I use in this case for NtOpenFile, please feel free to offer your oppinion.
Thank you,
Mihai