I've created a virtual registry key and would like to set a security descriptor for this new key by calling RegSetKeySecurity(). This function returns with 0.
But when calling RegGetKeySecurity() the returned security descriptor doesn't match against the parameter in RegSetKeySecurity().
my pseudo code:
- Code: Select all
HKEY keyRes;
DWORD disposition = 0;
LONG ret = BoxedAppSDK_CreateVirtualRegKeyA( HKEY_CURRENT_USER,
"Software\\MyTestKey123",
0,
NULL,
REG_OPTION_NON_VOLATILE,
KEY_ALL_ACCESS,
NULL,
&keyRes,
&disposition );
ret = RegSetKeySecurity( keyRes, GROUP_SECURITY_INFORMATION, desc );
PSECURITY_DESCRIPTOR tmpDesc = new unsigned char [ 200 ];
DWORD tmpSize = 200;
ret = RegGetKeySecurity( keyRes,
GROUP_SECURITY_INFORMATION,
tmpDesc,
&tmpSize
);
Thanking you in anticipation.
