<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Jigar Mehta's Blog : Vista</title><link>http://blogs.msdn.com/jigarme/archive/tags/Vista/default.aspx</link><description>Tags: Vista</description><dc:language>en</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>VirtualStore in Windows Vista</title><link>http://blogs.msdn.com/jigarme/archive/2007/09/12/virtualstore-in-windows-vista.aspx</link><pubDate>Tue, 11 Sep 2007 22:49:05 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4869156</guid><dc:creator>Jigar Mehta</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/jigarme/comments/4869156.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jigarme/commentrss.aspx?PostID=4869156</wfw:commentRss><description>&lt;p&gt;I was researching on one of the issues for my customer and got to read about this registry key.&lt;/p&gt; &lt;p&gt;HKCU\Software\Classes\VirtualStore&lt;/p&gt; &lt;p&gt;This key will be given to applications on vista who tries to do registry operations which requires admin privileges which it does not have. So, the key,&lt;/p&gt; &lt;p&gt;HKCU\Software\Classes\VirtualStore\MACHINE&lt;/p&gt; &lt;p&gt;will be HKLM for such interactive applications. This virtualization is done in order to stop lots of legacy application from breaking on vista. Make note of the fact that all new applications developed for vista should take care of rights given to normal applications and program accordingly (I mean, new applications should not use this virtualstore thing).&lt;/p&gt; &lt;p&gt;Another thing to keep in mind is, this virtualstore is given in HKCU so, if two users runs the same application, they will be getting different virtualstore and will not be sharing the values written by application, so, thats a strong reason not to use this thing for newly developed application.&lt;/p&gt; &lt;p&gt;Stay tuned.. &lt;img alt="Wave" src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/103.gif"&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=4869156" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jigarme/archive/tags/Vista/default.aspx">Vista</category></item><item><title>A referral was returned from the server.</title><link>http://blogs.msdn.com/jigarme/archive/2007/05/23/a-referral-was-returned-from-the-server.aspx</link><pubDate>Tue, 22 May 2007 23:41:11 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2799736</guid><dc:creator>Jigar Mehta</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/jigarme/comments/2799736.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jigarme/commentrss.aspx?PostID=2799736</wfw:commentRss><description>&lt;p&gt;I encountered this strange error while playing with a sample to elevate the executable from the starting. Just imagine, that you require your application to run in admin mode to work successfully; in windows vista, we have the functionality of adding the elevation manifest embedded inside the executable and give user the prompt that elevate the executable otherwise application can not run.&lt;/p&gt; &lt;p&gt;Following is a very good article on how to do this,&lt;br&gt;&lt;a href="http://blogs.msdn.com/shawnfa/archive/2006/04/06/568563.aspx"&gt;http://blogs.msdn.com/shawnfa/archive/2006/04/06/568563.aspx&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Following is the whitepaper which might also help,&lt;br&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=BA73B169-A648-49AF-BC5E-A2EEBB74C16B&amp;amp;displaylang=en"&gt;http://www.microsoft.com/downloads/details.aspx?FamilyID=BA73B169-A648-49AF-BC5E-A2EEBB74C16B&amp;amp;displaylang=en&lt;/a&gt;&lt;/p&gt; &lt;p&gt;But while modifying it and playing with my sample code, I got following error.&lt;/p&gt; &lt;p&gt;&lt;img src="http://img522.imageshack.us/img522/5015/shot0010vg9.jpg"&gt; &lt;/p&gt; &lt;p&gt;After little bit of more research, found that GUI applications do not require,&lt;/p&gt; &lt;p&gt;uiAccess=""true"" line.. and if it is there, it would not work.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Solution&lt;/strong&gt;: So, Solution to this problem is, either remove the line uiAccess=""true"" or else, make the modification and set it to ""false"". After doing the modification, could get it to working properly.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=2799736" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jigarme/archive/tags/Vista/default.aspx">Vista</category></item><item><title>Changes to COM in Windows Vista</title><link>http://blogs.msdn.com/jigarme/archive/2007/05/04/changes-to-com-in-windows-vista.aspx</link><pubDate>Fri, 04 May 2007 04:07:20 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2402799</guid><dc:creator>Jigar Mehta</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/jigarme/comments/2402799.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jigarme/commentrss.aspx?PostID=2402799</wfw:commentRss><description>&lt;p&gt;&lt;/p&gt; &lt;p&gt;The following changes appear in COM in Windows Vista: &lt;ul&gt; &lt;li&gt; &lt;p&gt;The COM elevation moniker allows applications that are running under a limited user account (LUA) to activate COM classes with elevated functionality. For more information, please see &lt;a href="http://msdn2.microsoft.com/ms679687.aspx"&gt;The COM Elevation Moniker&lt;/a&gt;.&lt;/p&gt; &lt;li&gt; &lt;p&gt;When you install an application that makes COM calls on a Windows Vista computer, and you plan to run the application as an administrator, you must install the application per-machine, rather than per-user, or it will not function properly.&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;[Note : Content is from MSDN]&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=2402799" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jigarme/archive/tags/COM/default.aspx">COM</category><category domain="http://blogs.msdn.com/jigarme/archive/tags/Vista/default.aspx">Vista</category></item><item><title>How to programmatically determine whether UAC is enabled or not</title><link>http://blogs.msdn.com/jigarme/archive/2007/04/28/how-to-programmatically-determine-whether-uac-is-enabled-or-not.aspx</link><pubDate>Sat, 28 Apr 2007 18:59:27 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2313146</guid><dc:creator>Jigar Mehta</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/jigarme/comments/2313146.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jigarme/commentrss.aspx?PostID=2313146</wfw:commentRss><description>&lt;p&gt;The moth says,&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;This is a question I get often: &lt;/p&gt; &lt;p&gt;"How can I determine if User Account Control is on or off via code?"&lt;/p&gt; &lt;p&gt;The answer I always give: &lt;/p&gt; &lt;p&gt;"You are asking the wrong question. Who cares?"&lt;/p&gt; &lt;p&gt;The point being that, regardless of whether the user has turned off UAC or not, your application should still be partitioned and work correctly for both admins and non-admin users. It is irrelevant if UAC is on or off. You should still display the shields, you should still gracefully fail if the user is not an admin (same as you would if the elevation prompt came up and the user cancelled, same as you should if you were running on XP). The academic answer to the original question is that you can read it from the registry (much like the built-in Security Centre does). Since there is no genuine requirement to know this stuff from code, there is no API for it.&lt;br&gt;&lt;br&gt;So the only question to answer programmatically is how to know if the user has admin rights. I have shown how to do this before but here goes again:&lt;/p&gt;&lt;pre&gt; // using System.Security.Principle;&lt;br&gt;  private bool IsAdmin()&lt;br&gt;  {&lt;br&gt;    WindowsIdentity id = WindowsIdentity.GetCurrent();&lt;br&gt;    WindowsPrincipal p = new WindowsPrincipal(id);&lt;br&gt;&lt;br&gt;    return p.IsInRole("Administrators");&lt;br&gt;  }&lt;/pre&gt;
&lt;p&gt;I have &lt;a href="http://blogs.msdn.com/cjacks/archive/2006/10/09/How-to-Determine-if-a-User-is-a-Member-of-the-Administrators-Group-with-UAC-Enabled-on-Windows-Vista.aspx" target="_blank"&gt;&lt;font color="#0000ff"&gt;read blogs&lt;/font&gt;&lt;/a&gt; where others get further information regarding elevation about the user's account by pinvoking native APIs, but again, I remain totally unconvinced about that need. Your app shouldn't care about anything else: all that matters is if the user has admin rights at the moment your admin code is about to execute, nothing else.&lt;br&gt;&lt;br&gt;If you disagree and think you have a genuine reason for knowing more than what I describe above, then please post your scenario to the relevant &lt;a href="http://www.danielmoth.com/Blog/2006/11/uac-get-your-links-here.html" target="_blank"&gt;&lt;font color="#0000ff"&gt;forum linked to from here&lt;/font&gt;&lt;/a&gt;.&lt;/p&gt;&lt;/blockquote&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=2313146" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jigarme/archive/tags/Vista/default.aspx">Vista</category></item></channel></rss>