Hello,
I am developing a registry filter driver that uses Registry Callback (**CmRegisterCallback(Ex)**) to achieve its goal. I am encountering some problems when implementing RegNtPreCreateKeyEx/RegNtPreOpenKeyEx and related post-notifications.
My question is: how to determine access rights that are really granted to the caller when a registry key is created/opened? I know the access rights desired by the caller, however, they can quite differ from the rights actually granted.
* The mask can contain generic rights which is not really a problem since I can manually (and easily) translate them.
* The MAXIMUM_ALLOWED "access rights" seems to be a bigger issue. In theory, I can obtain a security descriptor of the registry key in question during the post-notification callback. Then, I can try the **SeAccessCheck**.
* The caller can have **SeBackupPrivilege** and/or **SeRestorePrivilege** enabled in her access token. When the key is created/opened with **REG_OPTION_BACKUP_RESTORE** flag set, GENERIC_READ and/or GENERIC_WRITE access rights are automatically granted to the caller.
I thought that the **GrantedAccess** member of the **REG_CREATE_KEY_INFORMATION** can help me to avoid to manually solve all three cases above. However, it seems that the member is not used in general, and the documentation suggests that it can be used by drivers taht modifies the registry operation in some way.
So, is there a way how to determine the granted access rights without doing that manual work?
Thanks in advance
Vrtule
I am developing a registry filter driver that uses Registry Callback (**CmRegisterCallback(Ex)**) to achieve its goal. I am encountering some problems when implementing RegNtPreCreateKeyEx/RegNtPreOpenKeyEx and related post-notifications.
My question is: how to determine access rights that are really granted to the caller when a registry key is created/opened? I know the access rights desired by the caller, however, they can quite differ from the rights actually granted.
* The mask can contain generic rights which is not really a problem since I can manually (and easily) translate them.
* The MAXIMUM_ALLOWED "access rights" seems to be a bigger issue. In theory, I can obtain a security descriptor of the registry key in question during the post-notification callback. Then, I can try the **SeAccessCheck**.
* The caller can have **SeBackupPrivilege** and/or **SeRestorePrivilege** enabled in her access token. When the key is created/opened with **REG_OPTION_BACKUP_RESTORE** flag set, GENERIC_READ and/or GENERIC_WRITE access rights are automatically granted to the caller.
I thought that the **GrantedAccess** member of the **REG_CREATE_KEY_INFORMATION** can help me to avoid to manually solve all three cases above. However, it seems that the member is not used in general, and the documentation suggests that it can be used by drivers taht modifies the registry operation in some way.
So, is there a way how to determine the granted access rights without doing that manual work?
Thanks in advance
Vrtule