| 147 | } |
| 148 | } |
| 149 | BOOL InstallR77Config() |
| 150 | { |
| 151 | HKEY key; |
| 152 | if (RegCreateKeyExW(HKEY_LOCAL_MACHINE, L"SOFTWARE\\" HIDE_PREFIX L"config", 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS | KEY_WOW64_64KEY, NULL, &key, NULL) == ERROR_SUCCESS) |
| 153 | { |
| 154 | // Return TRUE, even if setting the DACL fails. |
| 155 | // If DACL creation failed, only elevated processes will be able to write to the configuration system. |
| 156 | |
| 157 | PSECURITY_DESCRIPTOR securityDescriptor = NULL; |
| 158 | ULONG securityDescriptorSize = 0; |
| 159 | if (ConvertStringSecurityDescriptorToSecurityDescriptorW(L"D:(A;OICI;GA;;;AU)(A;OICI;GA;;;BA)", SDDL_REVISION_1, &securityDescriptor, &securityDescriptorSize)) |
| 160 | { |
| 161 | RegSetKeySecurity(key, DACL_SECURITY_INFORMATION, securityDescriptor); |
| 162 | LocalFree(securityDescriptor); |
| 163 | } |
| 164 | |
| 165 | RegCloseKey(key); |
| 166 | return TRUE; |
| 167 | } |
| 168 | |
| 169 | return FALSE; |
| 170 | } |
| 171 | VOID UninstallR77Config() |
| 172 | { |
| 173 | // Delete subkeys in HKEY_LOCAL_MACHINE\SOFTWARE\$77config |
no outgoing calls
no test coverage detected