Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SECURITY_DESCRIPTOR sd;
- ACL dacl;
- SID_IDENTIFIER_AUTHORITY ntauth = SECURITY_NT_AUTHORITY;
- PSID owner;
- assert(InitializeAcl(&dacl, sizeof dacl, ACL_REVISION));
- assert(AllocateAndInitializeSid(&ntauth, 1, SECURITY_LOCAL_SYSTEM_RID, 0,0,0,0,0,0,0, &owner));
- assert(InitializeSecurityDescriptor(&sd, SECURITY_DESCRIPTOR_REVISION));
- assert(SetSecurityDescriptorDacl(&sd, TRUE, &dacl, FALSE));
- assert(SetSecurityDescriptorOwner(&sd, owner, FALSE));
- assert(SetKernelObjectSecurity(GetCurrentProcess(), DACL_SECURITY_INFORMATION | OWNER_SECURITY_INFORMATION, &sd));
- assert(FreeSid(owner) == NULL);
Add Comment
Please, Sign In to add comment