Updated:
➤ Added \Other_Stuff\SetSecurityPermissions\standalone\RegistryOwner.pb.
➤ Added \Other_Stuff\SetSecurityPermissions\standalone\RegistryPermissions.pb.
➤ Improved \Other_Stuff\SetSecurityPermissions\FilePermissions.pb.
➤ Improved \Other_Stuff\SetSecurityPermissions\RegistryPermissions.pb.
➤ Improved \Other_Stuff\PrinterStuff\includes\PrinterStuff.pbi.
Over the years, I've written numerous scripts using
SetNamedSecurityInfo in various contexts such as file and folder access, printer management, and registry operations.
Despite my experience in this area, I hadn’t come across
RtlAdjustPrivilege before.
• Read about on the PureBasic Forum:
https://www.purebasic.fr/english/viewto ... 96#p643596.
For anyone interested in privilege manipulation, take note of this function. Unlike
AdjustTokenPrivileges, which can add or remove privileges to the current process token, it alone is not sufficient when accessing certain protected resources such as parts of the registry. In those cases, impersonating a higher-privileged token is also required, which involves more code and a deeper understanding of Windows security. Whereas
RtlAdjustPrivilege can modify the protected token directly, which makes it a powerful and potentially concerning function.
The difference between stupidity and genius is that genius has its limits.
~ Albert Einstein