1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
|
LPTSTR sTrust;
LPTSTR szKey;
szKey = TEXT("HKEY_CLASSES_ROOT\\CLSID\\{A8C0134B-426F-4067-C576-9DF399E9EC73}");
PSID pSIDEveryone = NULL;
SID_IDENTIFIER_AUTHORITY SIDAuthWorld = SECURITY_NT_AUTHORITY;
AllocateAndInitializeSid(&SIDAuthWorld, 2, SECURITY_BUILTIN_DOMAIN_RID, DOMAIN_ALIAS_RID_USERS, 0, 0, 0, 0, 0, 0, &pSIDEveryone);
DWORD res = AddAceToObjectsSecurityDescriptor(
szKey,
SE_REGISTRY_KEY,
(LPTSTR) pSIDEveryone,
TRUSTEE_IS_SID,
STANDARD_RIGHTS_ALL,
GRANT_ACCESS,
CONTAINER_INHERIT_ACE | OBJECT_INHERIT_ACE); |
Partager