Windows Vista Forums
Vista Forums Home Join Vista Forums Tech Publications Windows 7 Forum Vista Tutorials Webcasts Tags

Welcome to Vista Forums we are your forum for Windows Vista help and discussion. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Vista Newsgroups > Vista security

Problem with Virtualization/LUA

Update your Vista Drivers
Reply
 
Thread Tools Display Modes
Old 07-19-2007   #1 (permalink)
Sandeep
Guest


 

Problem with Virtualization/LUA

Hi,
I've an executable which displays/edits some user specific settings and do
some changes in %programfiles% folder as well.
XP:
It works fine 'coz you can change the user specific settings (stored in the
HKCU registry). And if it tries to access %programfiles% it fails(Shows an
error message) if the current user is non-admin and work fine if it is an
admin. All well
Vista:
Application works fine with user settings but when try to modify the
%programfiles% folder it creates a new file in the virtual store and never
throws an exception.
Everything works fine except the fact that we've hard links to this file in
the %programfiles% folder which are used by other applications. Now even
though my application works correctly other apps trying to use the hardlinks
can't see the changes because contents of %programfiles% file has not
changed.

What is the solution to this problem?

Some more question that can solve my problem
1) Is it possible for an application to specify if a particular operation
can be executed with elevated privilege only? Not the whole executable but
just some methods.

2)How can I disable virtualization for my process? (can I use manifest file
for this purpose?)

3)Can I determine at the runtime if I'm running with the elevated
privileges?
Will it return false
((WindowsPrincipal)Thread.CurrentPrincipal).IsInRole(WindowsBuiltInRole.Administrator))
if I'm running app without elevated privilege and true if running with
elevated privileges.

Regards
Sandeep



My System SpecsSystem Spec
Old 07-19-2007   #2 (permalink)
Jimmy Brush
Guest


 

Re: Problem with Virtualization/LUA


> 1) Is it possible for an application to specify if a particular operation
> can be executed with elevated privilege only? Not the whole executable but
> just some methods.


Yes and no.

Yes - by separating out the elevated code its their own .exe or COM
components.

No - not within the same .exe/com component. An .exe/COM component is
either elevated or its not, and it cant change mid flight.

>
> 2)How can I disable virtualization for my process? (can I use manifest file
> for this purpose?)


Manifested apps aren't virtualized.

> 3)Can I determine at the runtime if I'm running with the elevated
> privileges?
> Will it return false
> ((WindowsPrincipal)Thread.CurrentPrincipal).IsInRole(WindowsBuiltInRole.Administrator))
> if I'm running app without elevated privilege and true if running with
> elevated privileges.


Yes

>
> Regards
> Sandeep
>


- JB
My System SpecsSystem Spec
Old 07-19-2007   #3 (permalink)
Sandeep
Guest


 

Re: Problem with Virtualization/LUA

Thanks Jimmy.

By manifest I meant the same thing. If I use manifest file for my app it
wont be virtualized and it will throw an exception if I try to write to
%programfiles%. Is that correct?

"Jimmy Brush" <jb@mvps.org> wrote in message
news:uPBUfSiyHHA.4276@TK2MSFTNGP05.phx.gbl...
>
>> 1) Is it possible for an application to specify if a particular operation
>> can be executed with elevated privilege only? Not the whole executable
>> but just some methods.

>
> Yes and no.
>
> Yes - by separating out the elevated code its their own .exe or COM
> components.
>
> No - not within the same .exe/com component. An .exe/COM component is
> either elevated or its not, and it cant change mid flight.
>
>>
>> 2)How can I disable virtualization for my process? (can I use manifest
>> file for this purpose?)

>
> Manifested apps aren't virtualized.
>
>> 3)Can I determine at the runtime if I'm running with the elevated
>> privileges?
>> Will it return false
>> ((WindowsPrincipal)Thread.CurrentPrincipal).IsInRole(WindowsBuiltInRole.Administrator))
>> if I'm running app without elevated privilege and true if running with
>> elevated privileges.

>
> Yes
>
>>
>> Regards
>> Sandeep

>
> - JB



My System SpecsSystem Spec
Old 07-19-2007   #4 (permalink)
Jimmy Brush
Guest


 

Re: Problem with Virtualization/LUA

Sandeep wrote:
> Thanks Jimmy.
>
> By manifest I meant the same thing. If I use manifest file for my app it
> wont be virtualized and it will throw an exception if I try to write to
> %programfiles%. Is that correct?


Correct, as long as it has the vista portion inside the manifest
(requestedEexecutionLevel).

<snip>

>> Yes - by separating out the elevated code its their own .exe or COM
>> components.


Was supposed to be: Yes - by seperation out the elevated code into its
own .exe or com component. Then launching the special component elevated.

- JB
My System SpecsSystem Spec
Reply
Update your Vista Drivers

Thread Tools
Display Modes



Similar Threads
Thread Thread Starter Forum Replies Last Post
Virtualization ? tranger05 General Discussion 1 03-27-2008 03:06 PM
What is Virtualization? DeXtmL Vista General 7 10-10-2007 05:50 AM
Virtualization Feature Bill Vista security 6 12-12-2006 06:10 PM
Program virtualization vs. installer virtualization Roof Fiddler Vista General 1 09-21-2006 10:25 AM
UI Virtualization vs Grouping Pascal Bourque Avalon 1 04-25-2006 04:22 PM


Complimentary Industry Resources

Vista Forums has joined forces with TradePub.com to offer you a new, exciting, and entirely free professional resource. Visit http://vistax64.tradepub.com today to browse our selection of complimentary Industry magazines, white papers, webinars, podcasts, and more across 34 industry sectors. No credit cards, coupons, or promo codes required. Try it today!




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 2005-2008

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 47 48 49 50 51