Re: Vista registry programming

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



I'm just guessing here, because I've finally stopped using VC6 (alas). But I think you
need to get a manifest resource attached to your executable that makes the appropriate
Vista-like noises (it's easy...you just go to the manifest section of the MSDN, and it
tells you everything you need to know...whoops, no, that's some alternative reality we
don't have access to...)

But if there's a Vista-aware manifest attached, then it won't virtualize. This means it
will use whatever the Registry protections are, instead of trying to pretend it is an
older app.

But exactly what has to appear there is a Deep Mystery.

Sorry, that's the best I can do right now.
joe

On Thu, 03 Apr 2008 11:53:42 +0100, Bob Moore <> wrote:

Oh, this just keeps on getting worse...

I produced a new application (using VC6, because its a
currently-shipping system even though its a new app). The app uses our
normal method of storing per-machine settings in HKLM,as you'd expect
for this system.

As luck would have it, I chose to test on a Vista machine with UAC
enabled. The root key of our registry tree had modified security to
allow us to write to it as per normal. All appeared to be OK.

After I'd run the application, I went to HKLM via regedit, only to
find our keys missing. Huh? This disagrees with Microsoft's stated
approach as per the Technet article. The fact that the app ran OK
seems to indicate that we're being virtualized _irrespective_ of the
registry security settings. Indeed, not only are the registry security
settings relaxed for our root key, but the account I ran the app under
was an admin account, as evidenced by the fact that I tried doing an
admin task, got an elevation dialog, but _wasn't_ asked for
credentials. So attempts to access HKLM _couldn't_ have been denied
on security grounds.

So I disabled UAC and ran the app again. Now the keys appeared in
regedit. QED. Looks to me like the Technet article is wrong (or is
making some assumption it isn't telling us about).

Now I'm thoroughly confused, and don't know what to do for the best.
Do we continue with our current strategy, but demand that target
systems must have UAC disabled? Seems draconian and some customers may
object. Abandon HKLM as a target for per-machine settings? Fine, but
we haven't budgeted for replacing that code, so our effort estimates
are now toast. Believe anything MS tells us ? Well that's worked real
well so far...

UAC. Such a victory.

Bob Moore
http://bobmoore.mvps.org/
Joseph M. Newcomer [MVP]
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
.



Relevant Pages

  • Manifest Files
    ... I'm fairly new to app security and manifests. ... confused - if the manifest file is embedded into the assembly, ... intended recipient, please inform the sender and delete all copies. ...
    (microsoft.public.dotnet.security)
  • Re: Some interesting things about XML...
    ... Each APRD Chain may contain a variable number of entries. ... > gdi.dll does some interesting things with .manifest files. ... > Microsoft has also programmed Internet Explorer to read the ... > same folder the app resides in, so if you had an app titled ...
    (alt.lang.asm)
  • Re: Manifest+MFC80.dll = neue DLL-Hölle?
    ... Meiner Meinung nach beseitigt gerade das Manifest das DLL Problem. ... dann startet die App nicht. ... dass die CRT aei der 8.0 verwendet. ...
    (microsoft.public.de.vc)
  • Re: Problem with manifest file under vista basic home
    ... Your manifest looks similar to mine. ... I don't have an answer for you, but FWIW I have a small app that I just ... I can understand the need for the elevation prompt. ... allow the app to run as an admin. ...
    (microsoft.public.vb.general.discussion)
  • Re: Using mandatory libraries (custom class loading vs. expanding libraries)
    ... There's absolutely nothing special about my app setup really. ... the 2007 "Ant in Action" is just about to be ... The author makes some good points about using an index file ... don't use index="true" alone when using a manifest that has ...
    (comp.lang.java.programmer)