none
Registry Permissions RRS feed

  • Question

  • Hi,

    To grant full control to HKEY LOCAL MACHINE (All Application Packages, Administrators, Users, SYSTEM), what routines should I be using to do it programmatically?

    Currently, I'm doing this, but does not seem to work.

    PSECURITY_DESCRIPTOR pSD;
    pSD = LocalAlloc(LPTR,SECURITY_DESCRIPTOR_MIN_LENGTH);
    InitializeSecurityDescriptor(pSD,SECURITY_DESCRIPTOR_REVISION);
    SetSecurityDescriptorDacl(pSD,TRUE,NULL,FALSE);
    status = RegSetKeySecurity(HKEY_LOCAL_MACHINE,DACL_SECURITY_INFORMATION,pSD);

    It works only if I do Edit->Permissions in REGEDIT.

    Am I missing something here?

    Wednesday, June 22, 2016 5:59 PM

Answers

  • why are you opening up HKLM to nearly everyone? ...what bigger problem are you trying to solve? it is locked down for a reason and opening it up is a very bad idea.

    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Wednesday, June 22, 2016 9:27 PM

All replies

  • why are you opening up HKLM to nearly everyone? ...what bigger problem are you trying to solve? it is locked down for a reason and opening it up is a very bad idea.

    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Wednesday, June 22, 2016 9:27 PM
  • I'm trying to write a registry value in HKLM\SYSTEM\Platform\ from my UMDF driver. 
    Wednesday, June 22, 2016 10:07 PM