Article View: borland.public.cppbuilder.nativeapi
Article #6308Re: registry permissions
From: Remy Lebeau (TeamB)
Date: Tue, 24 May 2005 21:56
Date: Tue, 24 May 2005 21:56
46 lines
2474 bytes
2474 bytes
"Ted" <ttripp@rankexec.com> wrote in message
news:42938ff8$1@newsgroups.borland.com...
> I'm looking through Tamarack and not seeing any snippets
> or other useful information.
Deja is a much better place to search, as it has a larger newsgroup archive.
In any case, I did a search on Tamarack and found a couple of tidbits pretty
quickly:
1)
use RegGetKeySecurity() to retreive the current SECURITY_DESCRIPTOR for
the desired key, then call SetSecurityDescriptorDacl() to set the DACL to
NULL, and then call RegSetKeySecurity() to assign the SECURITY_DESCRIPTOR
back to the key.
2)
regedit.exe has the same bug that people's Delphi programs tend to... It
tries to open the registry with KEY_ALL_ACCESS - which fails. KEY_ALL_ACCESS
includes KEY_CREATE_LINK, but HKLM\Software by default has 'Everyone's'
security set to exclude 'Create Link', although it allows reading and
writing.
regedt32 doesn't have the problem.
That's all true for NT4, anyway - but maybe Win2000 is subtley
different. To find out, log in as an Administrator, run regedt32, select
HKLM\SOFTWARE, select Security\Permissions from the menu, and see what it's
set to. On NT4 it's
CREATOR OWNER Full Control
Administrators Full Control
SYSTEM Full Control
Everyone Special (Includes read, write, create key, delete)
Also, a search at MSDN shows the following:
Registry Key Security and Access Rights
http://msdn.microsoft.com/library/en-us/sysinfo/base/registry_key_security_and_access_rights.asp
Gambit
Technical Details
Message-ID:
<4293a306$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!newshub.sdsu.edu!logbridge.uoregon.edu!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<42936611$1@newsgroups.borland.com> <42937619$1@newsgroups.borland.com> <42938ff8$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,d491f30b619dc98c X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <42936611$1@newsgroups.borland.com> <42937619$1@newsgroups.borland.com> <42938ff8$1@newsgroups.borland.com> Subject: Re: registry permissions Date: Tue, 24 May 2005 14:56:27 -0700 Lines: 48 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 NNTP-Posting-Host: 68.69.17.41 Message-ID: <4293a306$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1116971782 68.69.17.41 (24 May 2005 14:56:22 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!newshub.sdsu.edu!logbridge.uoregon.edu!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail