When UAC is enabled a process created by a user account that is a member of the Administrators group receives a filtered token without Administrator privileges. An elevated process that is running as Administrator will have the Administrator privileges in its token.
AdjustTokenPrivileges Error if not Administrator
Hi,
I'm currently trying to make a mimic of chown by building a chown.exe using C language.
When running my app from command prompt as Administrator , it runs fine.
But when running it from "normal command prompt , it fails with AdjustTokenPrivileges Error Code 1300 when trying to set SE_RESTORE_NAME and SE_TAKE_OWNERSHIP_NAME privileges.
Despite the fact I added , in global policies, ability to take file ownership , the process has only this privileges :
PrivilegeCount(5)
name (SeShutdownPrivilege) Attributes(0)
name (SeChangeNotifyPrivilege) Attributes(3)
name (SeUndockPrivilege) Attributes(0)
name (SeIncreaseWorkingSetPrivilege) Attributes(0)
name (SeTimeZonePrivilege) Attributes(0)
Did I misunderstand something to be able to change owner o a file by this way ?
Thx for help
J.P.