<?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>What were ShellExecute hooks designed for?</title><link>http://blogs.msdn.com/oldnewthing/archive/2008/09/10/8938051.aspx</link><description>And what they weren't.</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>re: What were ShellExecute hooks designed for?</title><link>http://blogs.msdn.com/oldnewthing/archive/2008/09/10/8938051.aspx#8940644</link><pubDate>Wed, 10 Sep 2008 17:29:06 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8940644</guid><dc:creator>asf</dc:creator><description>&lt;p&gt;I'm using them in my UAC like thing I created for XP, I was hoping to bring it along when/if I move to Vista, guess not (UAC on Vista removes my control, if a exe is marked as requireAdmin, there is NO WAY for me to run it non elevated,)&lt;/p&gt;
</description></item><item><title>re: What were ShellExecute hooks designed for?</title><link>http://blogs.msdn.com/oldnewthing/archive/2008/09/10/8938051.aspx#8940805</link><pubDate>Wed, 10 Sep 2008 18:13:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8940805</guid><dc:creator>godzila</dc:creator><description>&lt;p&gt;Apparently your implementation wasn't correct either. If another hook was installed and fired before your UAC like thing and returned S_OK. Then you're UAC thing would be circumvented. Sounds like it's a good thing they got rid of this hook.&lt;/p&gt;
</description></item><item><title>re: What were ShellExecute hooks designed for?</title><link>http://blogs.msdn.com/oldnewthing/archive/2008/09/10/8938051.aspx#8940836</link><pubDate>Wed, 10 Sep 2008 18:19:44 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8940836</guid><dc:creator>John</dc:creator><description>
&lt;p&gt;Is there any kind of detection of infinite loops? &amp;nbsp;I.e. calling ShellExecute inside of a ShellExecute hook? &amp;nbsp;Also, while the order of hook execution is "unspecified", is it safe to say that the order is consistent (assuming no modifications are made between successive calls to ShellExecute)?&lt;/p&gt;
&lt;div class="post"&gt;[&lt;i&gt;Some shell execute hooks call ShellExecute on purpose because they want to convert one type of execution into another. (And I see no value in knowing the answer to the second question given that it's all unspecified anyway. It's an oddly-phrased question. "If nothing changes, will things be the same?") -Raymond&lt;/i&gt;]&lt;/div&gt;</description></item><item><title>re: What were ShellExecute hooks designed for?</title><link>http://blogs.msdn.com/oldnewthing/archive/2008/09/10/8938051.aspx#8941250</link><pubDate>Wed, 10 Sep 2008 20:12:04 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8941250</guid><dc:creator>John</dc:creator><description>&lt;P&gt;I was just wondering if the hooks will always be called in the same (unspecified) order. &amp;nbsp;Perhaps the Security or Audit example hooks are written in such a way that calling them in one order "succeeds" and calling them in another order "fails". &amp;nbsp;If the order in which they are invoked can change between calls to ShellExecute than you would see only intermittent "failure". &amp;nbsp;I would guess the hooks are stored in a list container, so they are probably always called in the same (unspecified) order.&lt;/P&gt;
&lt;DIV class=post&gt;[&lt;I&gt;Different versions of the shell have done it differently. Some cache the hooks in a per-process list (so the order remains the same within a process). Others recalculate the hooks each time (so the order can change even within a process). -Raymond&lt;/I&gt;]&lt;/DIV&gt;</description></item><item><title>re: What were ShellExecute hooks designed for?</title><link>http://blogs.msdn.com/oldnewthing/archive/2008/09/10/8938051.aspx#8941377</link><pubDate>Wed, 10 Sep 2008 20:50:37 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8941377</guid><dc:creator>Gabe</dc:creator><description>&lt;p&gt;I can't wait to find out the reasoning behind removing them in Vista.&lt;/p&gt;
&lt;p&gt;I would assume that it's because nobody used them for their intended purpose, and they just created a security hole.&lt;/p&gt;
</description></item><item><title>re: What were ShellExecute hooks designed for?</title><link>http://blogs.msdn.com/oldnewthing/archive/2008/09/10/8938051.aspx#8941478</link><pubDate>Wed, 10 Sep 2008 21:12:17 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8941478</guid><dc:creator>Yuhong Bao</dc:creator><description>&lt;p&gt;I feel COM is overkill for just one function.&lt;/p&gt;
</description></item><item><title>re: What were ShellExecute hooks designed for?</title><link>http://blogs.msdn.com/oldnewthing/archive/2008/09/10/8938051.aspx#8941684</link><pubDate>Wed, 10 Sep 2008 22:09:51 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8941684</guid><dc:creator>asf</dc:creator><description>&lt;p&gt;godzila: its not about circumventing &amp;quot;my UAC&amp;quot;, its just used to detect stuff that &amp;quot;needs&amp;quot; elevation (control panel applets etc) so, if someone hooked in before me, the only thing that would happen is that you would not get the elevation dialog and the process would start with a restricted token...&lt;/p&gt;
</description></item><item><title>re: What were ShellExecute hooks designed for?</title><link>http://blogs.msdn.com/oldnewthing/archive/2008/09/10/8938051.aspx#8941776</link><pubDate>Wed, 10 Sep 2008 22:38:40 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8941776</guid><dc:creator>jon</dc:creator><description>&lt;p&gt;You can actually get them back on Vista by adding a registry key, no doubt even this will be gone in Windows 7. So much for the &amp;quot;backwards compatibility above all else&amp;quot; mantra :(&lt;/p&gt;
</description></item><item><title>re: What were ShellExecute hooks designed for?</title><link>http://blogs.msdn.com/oldnewthing/archive/2008/09/10/8938051.aspx#8941905</link><pubDate>Wed, 10 Sep 2008 23:21:53 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8941905</guid><dc:creator>Brandon Paddock</dc:creator><description>&lt;p&gt;Right. &amp;nbsp;It's backward-compatibilty above all else, except security. &amp;nbsp;And maybe reliability. &amp;nbsp;It's like that Dilbert comic, where he says something like &amp;quot;Quality comes first.&amp;quot; &amp;nbsp;And then someone says, &amp;quot;What about security?&amp;quot; &amp;nbsp;and then &amp;quot;What about the shareholders? &amp;nbsp;and then &amp;quot;What about legal compliance?&amp;quot;&lt;/p&gt;
&lt;p&gt;&amp;quot;Okay, quality comes fourth.&amp;quot;&lt;/p&gt;
</description></item><item><title>Another Dilbert and Quality joke</title><link>http://blogs.msdn.com/oldnewthing/archive/2008/09/10/8938051.aspx#8941997</link><pubDate>Wed, 10 Sep 2008 23:54:17 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8941997</guid><dc:creator>Matt</dc:creator><description>
&lt;p&gt;I guess the "Q" stands for "uality". &amp;nbsp;&lt;a href="http://books.google.com/books?id=-hUPgZK4rjMC&amp;amp;pg=PA222&amp;amp;lpg=PA222&amp;amp;ots=z-JvQvMvbq&amp;amp;sig=Ash7Px1nUvg5fvDOMCihEoxBt4M" rel="nofollow" target="_new"&gt;http://books.google.com/books?id=-hUPgZK4rjMC&amp;amp;pg=PA222&amp;amp;lpg=PA222&amp;amp;ots=z-JvQvMvbq&amp;amp;sig=Ash7Px1nUvg5fvDOMCihEoxBt4M&lt;/a&gt; (scroll up to the bottom of page 222)&lt;/p&gt;</description></item><item><title>re: What were ShellExecute hooks designed for?</title><link>http://blogs.msdn.com/oldnewthing/archive/2008/09/10/8938051.aspx#8942123</link><pubDate>Thu, 11 Sep 2008 00:45:56 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8942123</guid><dc:creator>recursivelyenumerable</dc:creator><description>&lt;p&gt;reminds me of how subclassing is often abused.&lt;/p&gt;
</description></item><item><title>re: What were ShellExecute hooks designed for?</title><link>http://blogs.msdn.com/oldnewthing/archive/2008/09/10/8938051.aspx#8942356</link><pubDate>Thu, 11 Sep 2008 02:14:10 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8942356</guid><dc:creator>Yuhong Bao</dc:creator><description>&lt;p&gt;&amp;quot;Internet Explorer 1&amp;quot;&lt;/p&gt;
&lt;p&gt;And 2 also.&lt;/p&gt;
</description></item><item><title>re: What were ShellExecute hooks designed for?</title><link>http://blogs.msdn.com/oldnewthing/archive/2008/09/10/8938051.aspx#8942494</link><pubDate>Thu, 11 Sep 2008 03:06:34 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8942494</guid><dc:creator>Bob</dc:creator><description>&lt;p&gt;Yes, asf, you're very clever.&lt;/p&gt;
&lt;p&gt;And therefore the behaviour of your clever little system will silently change and confuse the users the moment someone installs a completely unrelated application.&lt;/p&gt;
&lt;p&gt;Oh, wait, that's why you're doing it wrong and why every smart person has now found a good reason to praise Microsoft for creating Vista.&lt;/p&gt;
&lt;p&gt;Microsoft is being backward compatable - with every other OS version, all ShellExecute hook based hacks would break silently and at random for no obvious reason, and that feature has been retained. &amp;nbsp;;)&lt;/p&gt;
</description></item><item><title>re: What were ShellExecute hooks designed for?</title><link>http://blogs.msdn.com/oldnewthing/archive/2008/09/10/8938051.aspx#8942773</link><pubDate>Thu, 11 Sep 2008 05:29:31 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8942773</guid><dc:creator>dsn</dc:creator><description>&lt;p&gt;Another problem that occurred to me with ShellExecute hooks - what if two programs both register hooks for the same type of item? &amp;nbsp;For example, if both Firefox and IE had a hook to detect urls, it sounds like you would randomly get either IE or Firefox handling them, with no way to predict or control which it would be.&lt;/p&gt;
</description></item><item><title>re: What were ShellExecute hooks designed for?</title><link>http://blogs.msdn.com/oldnewthing/archive/2008/09/10/8938051.aspx#8944233</link><pubDate>Thu, 11 Sep 2008 13:09:31 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8944233</guid><dc:creator>asf</dc:creator><description>&lt;p&gt;Bob: I never said it was for use by other people, this thing is for my own use. Now tell me, on your precious Vista, when a exe is marked as requireAdmin, how can you run it non elevated when UAC is on?&lt;/p&gt;
</description></item><item><title>re: What were ShellExecute hooks designed for?</title><link>http://blogs.msdn.com/oldnewthing/archive/2008/09/10/8938051.aspx#8944415</link><pubDate>Thu, 11 Sep 2008 14:12:18 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8944415</guid><dc:creator>Phylyp</dc:creator><description>&lt;p&gt;I know Raymond doesn't name names, but were there are &amp;quot;big name&amp;quot; programs that actually did this? Any hints, clues? &lt;/p&gt;
</description></item><item><title>re: What were ShellExecute hooks designed for?</title><link>http://blogs.msdn.com/oldnewthing/archive/2008/09/10/8938051.aspx#8944954</link><pubDate>Thu, 11 Sep 2008 20:23:44 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8944954</guid><dc:creator>Richard</dc:creator><description>&lt;p&gt;A while back, I was investigating integrating an additional executable file format into Windows (note, this format has no associated extension, and is detected by filesystem attributes instead). As far as I could tell, that's impossible (though I'd love it if someone would say, &amp;quot;you're wrong, here's how...&amp;quot;). A ShellExecute hook was as close as I could get.&lt;/p&gt;
&lt;p&gt;So, my software is broken in Vista? What should I do instead?&lt;/p&gt;
</description></item><item><title>re: What were ShellExecute hooks designed for?</title><link>http://blogs.msdn.com/oldnewthing/archive/2008/09/10/8938051.aspx#8948120</link><pubDate>Fri, 12 Sep 2008 23:47:10 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8948120</guid><dc:creator>Greg D</dc:creator><description>&lt;p&gt;Richard: &lt;/p&gt;
&lt;p&gt;Write your own shell?&lt;/p&gt;
</description></item><item><title>re: What were ShellExecute hooks designed for?</title><link>http://blogs.msdn.com/oldnewthing/archive/2008/09/10/8938051.aspx#8951948</link><pubDate>Mon, 15 Sep 2008 01:59:13 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8951948</guid><dc:creator>Yuhong Bao</dc:creator><description>&lt;p&gt;&amp;quot;A while back, I was investigating integrating an additional executable file format into Windows (note, this format has no associated extension, and is detected by filesystem attributes instead). As far as I could tell, that's impossible (though I'd love it if someone would say, &amp;quot;you're wrong, here's how...&amp;quot;). A ShellExecute hook was as close as I could get.&amp;quot;&lt;/p&gt;
&lt;p&gt;As I remember, CreateProcess launches a process in another subsystem by retrieving the path to the EXE launcher for that subsystem from the registry, then launches that EXE passing the original path as a command-line parameter.&lt;/p&gt;
</description></item><item><title>re: What were ShellExecute hooks designed for?</title><link>http://blogs.msdn.com/oldnewthing/archive/2008/09/10/8938051.aspx#8951984</link><pubDate>Mon, 15 Sep 2008 03:24:42 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8951984</guid><dc:creator>Yuhong Bao</dc:creator><description>&lt;p&gt;&amp;quot;So much for &amp;quot;auditing&amp;quot; and &amp;quot;security&amp;quot;. &amp;quot;&lt;/p&gt;
&lt;p&gt;Yep, don't reinvent the wheel. NT already has auditing and security features, use them.&lt;/p&gt;
</description></item><item><title>re: What were ShellExecute hooks designed for?</title><link>http://blogs.msdn.com/oldnewthing/archive/2008/09/10/8938051.aspx#8952011</link><pubDate>Mon, 15 Sep 2008 04:09:15 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8952011</guid><dc:creator>Not Yuhong Bao</dc:creator><description>&lt;p&gt;&amp;gt; Yep, don't reinvent the wheel. NT already has auditing and security features, use them.&lt;/p&gt;
&lt;p&gt;And if you need compatibility with Windows 95 using the same codebase?&lt;/p&gt;
</description></item><item><title>re: What were ShellExecute hooks designed for?</title><link>http://blogs.msdn.com/oldnewthing/archive/2008/09/10/8938051.aspx#8952061</link><pubDate>Mon, 15 Sep 2008 05:48:50 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8952061</guid><dc:creator>Alexander Grigoriev</dc:creator><description>&lt;p&gt;Not Yuhong Bao:&lt;/p&gt;
&lt;p&gt;&amp;quot;And if you need compatibility with Windows 95 using the same codebase?&amp;quot;&lt;/p&gt;
&lt;p&gt;And what if you need compatibility with DOS? &lt;/p&gt;
&lt;p&gt;Sometimes the compatibility has to end.&lt;/p&gt;
</description></item></channel></rss>