RegGetKeySecurity and RegSetKeySecurity - result missmatch?

Questions, Support, etc.

RegGetKeySecurity and RegSetKeySecurity - result missmatch?

Postby Marco on Thu Feb 23, 2012 4:05 pm

Hello,

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.
Marco
 
Posts: 3
Joined: Thu Feb 23, 2012 3:48 pm

Re: RegGetKeySecurity and RegSetKeySecurity - result missmatch?

Postby Artem A. Razin on Mon Feb 27, 2012 2:05 pm

Hello,

Thank you for your question.

Actually, setting a security descriptor for a virtual key doesn't affect, because boxedapp doesn't support security information for virtual keys.

Do you really need it?

Thank you!
Artem A. Razin
Site Admin
 
Posts: 746
Joined: Mon Jul 28, 2008 5:04 pm
Location: St.Petersburg, Russia


Return to BoxedApp SDK

cron