In order to install a new property page into the Active Directory SnapIn, I need to write into the following registry key of W2K8 R2 (as documented by Microsoft)
HKEY_LO
If you run program as an administrator (don't forget to enable 'requireAdministrator'
as the UAC execution level in the manifest) or any other user having SE_RESTORE_NAME
privilege you can enable the privilage and then use RegCreateKeyEx with REG_OPTION_BACKUP_RESTORE
flag. You can use the same flag in RegOpenKeyEx (see ulOptions
parameter), but it is undocumented and I would recommend you better to use RegCreateKeyEx instead. The key handle returned can be used to set the value with respect of RegSetValueEx
for example. In the way you will be able to set any registry key. If you additionally enable SE_BACKUP_NAME
privilege you will be able to read any registry key (for example from HKEY_LOCAL_MACHINE\SECURITY
or HKEY_LOCAL_MACHINE\SAM\SAM
).