Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Vista Newsgroups > Vista security

Vista - app data in HKEY_LOCAL_MACHINE

Reply
 
Old 03-17-2007   #1 (permalink)
Jens Müller


 
 

app data in HKEY_LOCAL_MACHINE

Hell,

I write an app that stores data for all users into the
HKEY_LOCAL_MACHINE\Software\... path. In Vista, somehow the data is
stored but not visible in regedit under this path. What happens to it?

Also, I used to let it run for all users with the
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run entry.
This seems not to work any more. What can I do here to start an app for
all users?

Thanks,
Jens


My System SpecsSystem Spec
Old 03-17-2007   #2 (permalink)
Jesper


 
 

RE: app data in HKEY_LOCAL_MACHINE

It got virtualized:
http://msdn2.microsoft.com/en-us/library/aa965884.aspx

"Jens Müller" wrote:

> Hell,
>
> I write an app that stores data for all users into the
> HKEY_LOCAL_MACHINE\Software\... path. In Vista, somehow the data is
> stored but not visible in regedit under this path. What happens to it?
>
> Also, I used to let it run for all users with the
> HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run entry.
> This seems not to work any more. What can I do here to start an app for
> all users?
>
> Thanks,
> Jens
>
>

My System SpecsSystem Spec
Old 03-18-2007   #3 (permalink)
Jens Müller


 
 

Re: app data in HKEY_LOCAL_MACHINE

Hello,

> It got virtualized:
> http://msdn2.microsoft.com/en-us/library/aa965884.aspx


Ok thanks. Now I have the problem that sometimes my app is run as
administrator and sometimes not. Both times, the values that are read
from the registry are different.

How can I find out if my app has full rights or not?

Thanks,
Jens

My System SpecsSystem Spec
Old 03-19-2007   #4 (permalink)
Jesper


 
 

Re: app data in HKEY_LOCAL_MACHINE

You will need to inspect the token used to launch the app. Specificallly, you
need to enumerate token groups and find out if the Administrator's group is
present and not set to deny only. If so, you can write to HKLM. If not, you
need to write elsewhere.

"Jens Müller" wrote:

> Hello,
>
> > It got virtualized:
> > http://msdn2.microsoft.com/en-us/library/aa965884.aspx

>
> Ok thanks. Now I have the problem that sometimes my app is run as
> administrator and sometimes not. Both times, the values that are read
> from the registry are different.
>
> How can I find out if my app has full rights or not?
>
> Thanks,
> Jens
>
>

My System SpecsSystem Spec
Old 03-19-2007   #5 (permalink)
Phil Wilson


 
 

Re: app data in HKEY_LOCAL_MACHINE

IIRC, the IsUserAnAdmin API returns the right answer, true if you're
elevated, false otherwise. In .NET, I suspect that WindowsPrincipal.IsInRole
("Administrators") does the right thing, although I haven't tested that one.
--
Phil Wilson
[Microsoft MVP Windows Installer]

"Jens Müller" <jens_0.no.-spam@hotmail.com> wrote in message
news:%23aqeViZaHHA.3612@TK2MSFTNGP04.phx.gbl...
> Hello,
>
>> It got virtualized:
>> http://msdn2.microsoft.com/en-us/library/aa965884.aspx

>
> Ok thanks. Now I have the problem that sometimes my app is run as
> administrator and sometimes not. Both times, the values that are read from
> the registry are different.
>
> How can I find out if my app has full rights or not?
>
> Thanks,
> Jens



My System SpecsSystem Spec
Old 03-19-2007   #6 (permalink)
Jesper


 
 

Re: app data in HKEY_LOCAL_MACHINE

I don't think that will work. The problem is that in Vista you have admins
that are currently admins, and admins that can become admins by accepting a
UAC dialog. The IsUserAnAdmin API does not distinguish between the two.

"Phil Wilson" wrote:

> IIRC, the IsUserAnAdmin API returns the right answer, true if you're
> elevated, false otherwise. In .NET, I suspect that WindowsPrincipal.IsInRole
> ("Administrators") does the right thing, although I haven't tested that one.
> --
> Phil Wilson
> [Microsoft MVP Windows Installer]
>
> "Jens Müller" <jens_0.no.-spam@hotmail.com> wrote in message
> news:%23aqeViZaHHA.3612@TK2MSFTNGP04.phx.gbl...
> > Hello,
> >
> >> It got virtualized:
> >> http://msdn2.microsoft.com/en-us/library/aa965884.aspx

> >
> > Ok thanks. Now I have the problem that sometimes my app is run as
> > administrator and sometimes not. Both times, the values that are read from
> > the registry are different.
> >
> > How can I find out if my app has full rights or not?
> >
> > Thanks,
> > Jens

>
>
>

My System SpecsSystem Spec
Old 03-20-2007   #7 (permalink)
Jens Müller


 
 

Re: app data in HKEY_LOCAL_MACHINE

> I don't think that will work. The problem is that in Vista you have
> admins that are currently admins, and admins that can become admins
> by accepting a UAC dialog. The IsUserAnAdmin API does not distinguish
> between the two.


That's ecactly the issue. Thanks anyway.
Jens

My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
HKEY_LOCAL_MACHINE problem Vista performance & maintenance
No rights on HKEY_Local_Machine registry map 'optionalcomponents' Vista General
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Contro l\Lsa Vista General
Hkey_local_machine\components Vista General
HKEY_LOCAL_MACHINE\BCD00000000 ? Vista General


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46