<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://msmvps.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>ab origine ... : troubleshooting</title><link>http://msmvps.com/blogs/v_scherbina/archive/tags/troubleshooting/default.aspx</link><description>Tags: troubleshooting</description><dc:language>en</dc:language><generator>CommunityServer 2008.5 SP2 (Build: 40407.4157)</generator><item><title>Norton’s quality of code in drivers</title><link>http://msmvps.com/blogs/v_scherbina/archive/2009/07/07/norton-s-quality-of-code-in-drivers.aspx</link><pubDate>Tue, 07 Jul 2009 08:25:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1698616</guid><dc:creator>V. S.</dc:creator><slash:comments>0</slash:comments><description>Life of every driver developer is complicated by the fact that the code you write should be stable (read: bugs free) and compatible with any other third party drivers. It is very important for any driver to be bugs free, as any error in kernel leads ...(&lt;a href="http://msmvps.com/blogs/v_scherbina/archive/2009/07/07/norton-s-quality-of-code-in-drivers.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1698616" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/v_scherbina/archive/tags/troubleshooting/default.aspx">troubleshooting</category><category domain="http://msmvps.com/blogs/v_scherbina/archive/tags/researches/default.aspx">researches</category></item><item><title>SMB traffic not captured in TDI filter driver</title><link>http://msmvps.com/blogs/v_scherbina/archive/2008/10/09/smb-traffic-not-captured-in-tdi-filter-driver.aspx</link><pubDate>Thu, 09 Oct 2008 06:46:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1650321</guid><dc:creator>V. S.</dc:creator><slash:comments>0</slash:comments><description>Recently I met a problem in one of my TDI filters when filtering SMB traffic. The filter driver was able to see outgoing TDI_CONNECT requests to 137 and 445 ports, but during the heavy file upload there was no TDI_SEND requests issued. Please read the...(&lt;a href="http://msmvps.com/blogs/v_scherbina/archive/2008/10/09/smb-traffic-not-captured-in-tdi-filter-driver.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1650321" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/v_scherbina/archive/tags/troubleshooting/default.aspx">troubleshooting</category><category domain="http://msmvps.com/blogs/v_scherbina/archive/tags/researches/default.aspx">researches</category></item><item><title>Undeletable bug in VS2008?</title><link>http://msmvps.com/blogs/v_scherbina/archive/2008/08/27/undeletable-bug-in-vs2008.aspx</link><pubDate>Wed, 27 Aug 2008 01:33:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1645933</guid><dc:creator>V. S.</dc:creator><slash:comments>0</slash:comments><description>I see this bug for a quite a long time, starting from VS2005. To illustrate the problem: 1. Go to project properties, open some tab 2. Do not close the property dialog windows simply change the focus by clicking in code editor [...] Please read the post...(&lt;a href="http://msmvps.com/blogs/v_scherbina/archive/2008/08/27/undeletable-bug-in-vs2008.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1645933" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/v_scherbina/archive/tags/general/default.aspx">general</category><category domain="http://msmvps.com/blogs/v_scherbina/archive/tags/troubleshooting/default.aspx">troubleshooting</category></item><item><title>Bug in MSDN: TDI_EVENT_RECEIVE_DATAGRAM &amp; it's handler</title><link>http://msmvps.com/blogs/v_scherbina/archive/2008/01/17/bug-in-msdn-tdi-event-receive-datagram-amp-it-s-handler.aspx</link><pubDate>Thu, 17 Jan 2008 18:03:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1467706</guid><dc:creator>V. S.</dc:creator><slash:comments>1</slash:comments><description>If you ever wanted to handle TDI_EVENT_RECEIVE_DATAGRAM ( http://msdn2.microsoft.com/en-us/library/ms801156.aspx ) event handler in TDI, you would notice that it&amp;#39;s declaration is a bit strange( http://msdn2.microsoft.com/en-us/library/ms801622.aspx...(&lt;a href="http://msmvps.com/blogs/v_scherbina/archive/2008/01/17/bug-in-msdn-tdi-event-receive-datagram-amp-it-s-handler.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1467706" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/v_scherbina/archive/tags/troubleshooting/default.aspx">troubleshooting</category><category domain="http://msmvps.com/blogs/v_scherbina/archive/tags/researches/default.aspx">researches</category></item><item><title>DRIVER_VERIFIER_IOMANAGER_VIOLATION in Windows Server 2003 SP2 with latest updates ON</title><link>http://msmvps.com/blogs/v_scherbina/archive/2008/01/16/driver-verifier-iomanager-violation-in-windows-server-2003-sp2-with-latest-updates-on.aspx</link><pubDate>Wed, 16 Jan 2008 20:39:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1466150</guid><dc:creator>V. S.</dc:creator><slash:comments>0</slash:comments><description>Recently, I&amp;#39;ve received following error when trying to test my TDI filter driver on Server 2003 SP2 with latest updates ON: DRIVER_VERIFIER_IOMANAGER_VIOLATION (c9) Arguments: Arg1: 00000208, (Fatal error) This IRP is about to run out of stack locations...(&lt;a href="http://msmvps.com/blogs/v_scherbina/archive/2008/01/16/driver-verifier-iomanager-violation-in-windows-server-2003-sp2-with-latest-updates-on.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1466150" width="1" height="1"&gt;</description><enclosure url="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Components.PostAttachments/00.01.46.61.50/2k03bug_5F00_illustration.zip" length="2521" type="application/x-zip-compressed" /><category domain="http://msmvps.com/blogs/v_scherbina/archive/tags/troubleshooting/default.aspx">troubleshooting</category><category domain="http://msmvps.com/blogs/v_scherbina/archive/tags/researches/default.aspx">researches</category></item><item><title>explorer.exe is in danger :)</title><link>http://msmvps.com/blogs/v_scherbina/archive/2007/12/27/explorer-exe-is-in-danger.aspx</link><pubDate>Thu, 27 Dec 2007 19:41:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1422135</guid><dc:creator>V. S.</dc:creator><slash:comments>0</slash:comments><description>Kaspersky ( http://www.kaspersky.com/ ) recently released a signature update that treats explore.exe as a virus. This false signature may affect those people who set the option &amp;#39;delete virus&amp;#39; ON - it let&amp;#39;s anvtivirus delete the suspicious...(&lt;a href="http://msmvps.com/blogs/v_scherbina/archive/2007/12/27/explorer-exe-is-in-danger.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1422135" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/v_scherbina/archive/tags/general/default.aspx">general</category><category domain="http://msmvps.com/blogs/v_scherbina/archive/tags/troubleshooting/default.aspx">troubleshooting</category></item><item><title>The case of Task Manager that does not kill</title><link>http://msmvps.com/blogs/v_scherbina/archive/2007/12/20/the-case-of-task-manager-that-does-not-kill.aspx</link><pubDate>Thu, 20 Dec 2007 21:42:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1407625</guid><dc:creator>V. S.</dc:creator><slash:comments>2</slash:comments><description>Quite long time ago, my friend Vadym Stetsiak described a bug of Task Manager , which allows to disallow (!) the killing of a process, if it&amp;#39;s name is lsass.exe. In order to test this bug, you can rename any executable file into lsass.exe, run it...(&lt;a href="http://msmvps.com/blogs/v_scherbina/archive/2007/12/20/the-case-of-task-manager-that-does-not-kill.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1407625" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/v_scherbina/archive/tags/reversing/default.aspx">reversing</category><category domain="http://msmvps.com/blogs/v_scherbina/archive/tags/troubleshooting/default.aspx">troubleshooting</category><category domain="http://msmvps.com/blogs/v_scherbina/archive/tags/researches/default.aspx">researches</category></item><item><title>A shame on Kaspersky ...</title><link>http://msmvps.com/blogs/v_scherbina/archive/2007/08/23/a-shame-on-kaspersky.aspx</link><pubDate>Thu, 23 Aug 2007 18:34:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1135128</guid><dc:creator>V. S.</dc:creator><slash:comments>3</slash:comments><description>As one of the stages in my work, I do tests of different antiviruses with components I develop. This allows me to handle incompatibility issues, profiling BSODS and other critical errors that might appear during software lifecycle ;) These days I was...(&lt;a href="http://msmvps.com/blogs/v_scherbina/archive/2007/08/23/a-shame-on-kaspersky.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1135128" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/v_scherbina/archive/tags/general/default.aspx">general</category><category domain="http://msmvps.com/blogs/v_scherbina/archive/tags/troubleshooting/default.aspx">troubleshooting</category></item><item><title>Undefeatable files &amp; folders in Windows XP SP2 - a bug in SHFileOperationW </title><link>http://msmvps.com/blogs/v_scherbina/archive/2007/07/15/undeletable-files-amp-folders-in-windows-xp-sp2.aspx</link><pubDate>Sat, 14 Jul 2007 23:01:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:998059</guid><dc:creator>V. S.</dc:creator><slash:comments>6</slash:comments><description>Recently I was surprised with one interesting behavior of my Windows XP box. I was playing with long name files and noticed that major part of my shell extensions do not work with files, whose path is longer then 260 symbols. I also noticed, that Windows...(&lt;a href="http://msmvps.com/blogs/v_scherbina/archive/2007/07/15/undeletable-files-amp-folders-in-windows-xp-sp2.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://msmvps.com/aggbug.aspx?PostID=998059" width="1" height="1"&gt;</description><enclosure url="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Components.PostAttachments/00.00.99.80.59/test.zip" length="733" type="application/zip" /><category domain="http://msmvps.com/blogs/v_scherbina/archive/tags/reversing/default.aspx">reversing</category><category domain="http://msmvps.com/blogs/v_scherbina/archive/tags/troubleshooting/default.aspx">troubleshooting</category></item><item><title>Bug in wininet: RETR command  is not supported since IE7 release</title><link>http://msmvps.com/blogs/v_scherbina/archive/2007/05/11/bug-in-wininet-retr-command-is-not-supported-since-ie7-release.aspx</link><pubDate>Fri, 11 May 2007 08:32:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:898276</guid><dc:creator>V. S.</dc:creator><slash:comments>3</slash:comments><description>If your FTP client relies on Wininet and supports resuming of downloads then it fail to work under IE7 because RETR command is not working properly when you invoke it using FtpCommand(…) function. The function fails with access violation, outputting the...(&lt;a href="http://msmvps.com/blogs/v_scherbina/archive/2007/05/11/bug-in-wininet-retr-command-is-not-supported-since-ie7-release.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://msmvps.com/aggbug.aspx?PostID=898276" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/v_scherbina/archive/tags/troubleshooting/default.aspx">troubleshooting</category></item><item><title>IE7 release still beats us</title><link>http://msmvps.com/blogs/v_scherbina/archive/2006/12/17/ie7-release-still-beats-us.aspx</link><pubDate>Sun, 17 Dec 2006 11:51:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:428080</guid><dc:creator>V. S.</dc:creator><slash:comments>0</slash:comments><description>I participate in wininet NG from time to time. Since IE7 release, the major part of issues that I read there is connected with the changes introduced by IE7. Fortunatly for us, WNDP team is ready to investigate any bug you'll find. Of course, you can...(&lt;a href="http://msmvps.com/blogs/v_scherbina/archive/2006/12/17/ie7-release-still-beats-us.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://msmvps.com/aggbug.aspx?PostID=428080" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/v_scherbina/archive/tags/general/default.aspx">general</category><category domain="http://msmvps.com/blogs/v_scherbina/archive/tags/troubleshooting/default.aspx">troubleshooting</category></item><item><title>The case of IE7 that would not run</title><link>http://msmvps.com/blogs/v_scherbina/archive/2006/12/02/the-case-of-ie7-that-does-not-start.aspx</link><pubDate>Sat, 02 Dec 2006 00:27:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:362293</guid><dc:creator>V. S.</dc:creator><slash:comments>4</slash:comments><description>Yesterday I met an interesting behavior of IE7. On one of my computer which runs Windows Server 2003 SP1 I was trying to publish a post to my blog ('the power of IDA'). But I failed to do that. IE7 was crashing when I tried to write something in the editor...(&lt;a href="http://msmvps.com/blogs/v_scherbina/archive/2006/12/02/the-case-of-ie7-that-does-not-start.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://msmvps.com/aggbug.aspx?PostID=362293" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/v_scherbina/archive/tags/reversing/default.aspx">reversing</category><category domain="http://msmvps.com/blogs/v_scherbina/archive/tags/troubleshooting/default.aspx">troubleshooting</category></item><item><title>Why does Windows do not provide more flexible API for Shell Context Menu Handlers? </title><link>http://msmvps.com/blogs/v_scherbina/archive/2006/11/17/why-does-windows-do-not-provide-more-flexible-api-for-shell-context-menu-handlers.aspx</link><pubDate>Fri, 17 Nov 2006 00:01:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:297010</guid><dc:creator>V. S.</dc:creator><slash:comments>5</slash:comments><description>&lt;span&gt;Recently, I
came across an interesting situation. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;

&lt;p class="MsoNormal"&gt;&lt;span&gt;&lt;o:p&gt;&lt;/o:p&gt;My PC (XP
SP2) was making some calculations. CPU activity was high. I was surfing through
my folders and clicked on one of them using right button of the mouse. The
context menu appeared after 10-20 seconds … “Why does it takes so long” -&lt;span&gt;&amp;nbsp; &lt;/span&gt;I asked myself? This question leaded me to
investigations …&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;


&lt;p class="MsoNormal" style="margin-right:-42.5pt;"&gt;&lt;span&gt;&lt;o:p&gt;&lt;/o:p&gt;Windows Shell supports so called ‘shell
extensions’ which allow extending the functionality of shell. It allows 3&lt;sup&gt;rd&lt;/sup&gt;
party products to write custom menu handlers that append own menu items to shell
menu and help user easily use some feature of the product. Typical example of
such approach is WinRar, WinZip applications. Shell extension is represented as
COM component that implements several COM interfaces. I will concentrate here
on IShellExtInit interface mostly.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;


&lt;p class="MsoNormal" style="margin-right:-42.5pt;"&gt;&lt;span&gt;&lt;o:p&gt;&lt;/o:p&gt;So, when I click on my folders I see the
following picture: &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;
&lt;img src="http://msmvps.com/photos/v_scherbina/images/292513/335x375.aspx" align="middle" height="375" width="335"&gt;f&lt;/p&gt;

&lt;p class="MsoNormal" style="margin-right:-42.5pt;"&gt;&lt;span&gt;As you can see on screenshot I have WinRar
shell extension installed on my PC. Seems like there is something inside it’s handler
that cause delays.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;


&lt;p class="MsoNormal" style="margin-right:-42.5pt;"&gt;&lt;span&gt;&lt;o:p&gt;&lt;/o:p&gt;Each shell extension object implements
IShellExtInit interface. According to documentation, IShellExtInit has method
named Initialize with the following params:&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style="margin-right:-42.5pt;font-weight:bold;font-style:italic;"&gt;HRESULT Initialize(LPCITEMIDLIST pidlFolder, IDataObject *pdtobj,&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; HKEY hkeyProgID);&lt;/p&gt;
&lt;span style="font-style:italic;"&gt;&lt;span style="font-weight:bold;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;i&gt;&lt;span style="font-size:8pt;font-family:Courier;"&gt;&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;

&lt;p class="MsoNormal" style="margin-right:-42.5pt;"&gt;
&lt;/p&gt;

&lt;p class="MsoNormal" style="margin-right:-42.5pt;"&gt;&lt;span&gt;The IDataObject object passed to the method
allows obtaining the path of folder user clicked on. One is able to get the handle to structure that contains file names and finally pass that handle to DragQueryFile
function to get the path. DragQueryFile function is defined with following
parameters:&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style="margin-right:-42.5pt;font-weight:bold;font-style:italic;"&gt;INT DragQueryFile(HDROP hDrop, UINT iFile, LPTSTR lpszFile,&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; UINT cch);&amp;nbsp; &amp;nbsp;&lt;/p&gt;

&lt;p class="MsoNormal" style="margin-right:-42.5pt;"&gt;&lt;span&gt;I can set breakpoint in WinDbg to DrawQueryFileA/ DrawQueryFileW functions to see where they are called. This gives me ability to check what extensions are calling this function, and what is going on in Initialize method of each extension.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;
&lt;/p&gt;

&lt;p class="MsoNormal" style="margin-right:-42.5pt;"&gt;&lt;span&gt;Following commands do that:&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style="margin-right:-42.5pt;"&gt;&lt;span style="font-weight:bold;font-style:italic;"&gt;0:001&amp;gt; bp DragQueryFileA&lt;/span&gt;&lt;br style="font-weight:bold;font-style:italic;"&gt;&lt;span style="font-weight:bold;font-style:italic;"&gt;0:001&amp;gt; bp DragQueryFileW &lt;/span&gt;&lt;br&gt;&lt;/p&gt;


&lt;p class="MsoNormal" style="margin-right:-42.5pt;"&gt;&lt;span&gt;&lt;/span&gt;&lt;b&gt;&lt;i&gt;&lt;span style="font-size:11pt;font-family:Courier;"&gt;&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;span&gt;&lt;o:p&gt;&lt;/o:p&gt;Here is what I see in command line after
executing “bl”: &lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;

&lt;img src="http://msmvps.com/photos/v_scherbina/images/297019/500x356.aspx"&gt;
&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;br&gt;Now I am going to click on folder and see where DrawQueryFile is called. I click on a folder, and I see the following places where the rarext.dll calls DrawQueryFile:&lt;span&gt;&lt;/span&gt;
&lt;/p&gt;&lt;p class="MsoNormal" style="margin-right:-42.5pt;"&gt;; first call&lt;br&gt;&lt;b&gt;&lt;span style="font-size:11pt;font-family:Courier;"&gt;02d0c44d 6a00&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt; &lt;/span&gt;push&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;0&lt;o:p&gt;&lt;/o:p&gt;&lt;br&gt;02d0c44f 6a00&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;push&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;0&lt;o:p&gt;&lt;/o:p&gt;&lt;br&gt;02d0c451 6aff&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;push&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;0FFFFFFFFh&lt;o:p&gt;&lt;/o:p&gt;&lt;br&gt;02d0c453 ff75d4&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;span&gt;&lt;/span&gt;push&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;dword ptr [ebp-2Ch]&lt;o:p&gt;&lt;/o:p&gt;&lt;br&gt;02d0c456 e881a90000&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt; &lt;/span&gt;call&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;rarext!DllCanUnloadNow+0xc0ac (02d16ddc)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;



&lt;p class="MsoNormal" style="margin-right:-42.5pt;"&gt;&lt;span&gt;&lt;o:p&gt;&lt;/o:p&gt;; second call&lt;br&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-size:11pt;font-family:Courier;"&gt;02d0c491 6800040000&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt; &lt;/span&gt;push&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;400h&lt;o:p&gt;&lt;/o:p&gt;&lt;br&gt;02d0c496 8d85bcfbffff&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;lea&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;eax,[ebp-444h]&lt;o:p&gt;&lt;/o:p&gt;&lt;br&gt;02d0c49c 50&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;push&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;eax&lt;o:p&gt;&lt;/o:p&gt;&lt;br&gt;02d0c49d 8bfb&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;mov&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;edi,ebx&lt;o:p&gt;&lt;/o:p&gt;&lt;br&gt;02d0c49f 57&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;push&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;edi&lt;o:p&gt;&lt;/o:p&gt;&lt;br&gt;02d0c4a0 ff75d4&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt; &lt;/span&gt;push&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;dword ptr [ebp-2Ch]&lt;o:p&gt;&lt;/o:p&gt;&lt;br&gt;02d0c4a3 e834a90000&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;span&gt;&lt;/span&gt;call&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;rarext!DllCanUnloadNow+0xc0ac (02d16ddc)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;



&lt;p class="MsoNormal" style="margin-right:-42.5pt;"&gt;&lt;span&gt;&lt;o:p&gt;&lt;/o:p&gt;; third call&lt;br&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-size:11pt;font-family:Courier;"&gt;02d0c4b1 6800080000&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt; &lt;/span&gt;push&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;800h&lt;o:p&gt;&lt;/o:p&gt;&lt;br&gt;02d0c4b6 8d85bcf3ffff&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt; &lt;/span&gt;lea&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;eax,[ebp-0C44h]&lt;o:p&gt;&lt;/o:p&gt;&lt;br&gt;02d0c4bc 50&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&lt;/span&gt;push&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;eax&lt;o:p&gt;&lt;/o:p&gt;&lt;br&gt;02d0c4bd 57&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt; &lt;/span&gt;push&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;edi&lt;o:p&gt;&lt;/o:p&gt;&lt;br&gt;02d0c4be ff75d4&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt; &lt;/span&gt;push&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;dword ptr [ebp-2Ch]&lt;o:p&gt;&lt;/o:p&gt;&lt;br&gt;02d0c4c1 e81ca90000&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt; &lt;/span&gt;call&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;rarext!DllCanUnloadNow+0xc0b2 (02d16de2)&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin-right:-42.5pt;"&gt;&lt;span&gt;In all cases the intstruction «call
rarext!DllCanUnloadNow+address” is mapped to the call to DragQueryFile(A|W).
Following code at rarext!DllCanUnloadNow+address shows that: &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;


&lt;p class="MsoNormal" style="margin-right:-42.5pt;"&gt;&lt;span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-size:11pt;font-family:Courier;"&gt;02d16ddc jmp dword ptr [rarext!__CPPdebugHook+0xc1bc
(02d233e8)] ds:0023:02d233e8={SHELL32!DragQueryFileA (7ca73fb3)}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;


&lt;p class="MsoNormal" style="margin-right:-42.5pt;"&gt;&lt;i&gt;&lt;span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;b&gt;&lt;span style="font-size:11pt;font-family:Courier;"&gt;02d16de2 jmp dword ptr [rarext!__CPPdebugHook+0xc1c0
(02d233ec)] ds:0023:02d233ec={SHELL32!DragQueryFileW (7ca1fcee)}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;


&lt;p class="MsoNormal" style="margin-right:-42.5pt;"&gt;&lt;b&gt;&lt;span style="font-size:11pt;font-family:Courier;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;span&gt;Let me do some explanations on what is going in
the code mentioned above. The first call is used to obtain the number of files
user selected. It can be seen by the &lt;/span&gt;&lt;b&gt;&lt;span style="font-size:11pt;font-family:Courier;"&gt;0FFFFFFFFh &lt;/span&gt;&lt;/b&gt;&lt;span&gt;value passed to DragQueryFile as iFile
parameter. According to documentation: &lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin-right:-42.5pt;"&gt;
&lt;/p&gt;

&lt;p class="MsoNormal" style="margin-right:-42.5pt;"&gt;&lt;i&gt;&lt;span&gt;- iFile&lt;o:p&gt;&lt;/o:p&gt;&lt;br&gt;Index of the file to
query. If the value of the iFile parameter is 0xFFFFFFFF, DragQueryFile returns
a count of the files dropped.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style="margin-right:-42.5pt;"&gt;
&lt;/p&gt;
&lt;p class="MsoNormal" style="margin-right:-42.5pt;"&gt;&lt;span&gt;Second call is made to obtain the ANSI version
of path and the third call is made to obtain the UNICODE version of path. So
pity, that developers of WinRar do not know what &lt;i&gt;MultiByteToWideChar&lt;/i&gt; do and that it’s much faster then calling &lt;i&gt;DragQueryFileW&lt;/i&gt; function. However, I want
to concentrate on another issue.&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin-right:-42.5pt;"&gt;
&lt;/p&gt;
&lt;p class="MsoNormal" style="margin-right:-42.5pt;"&gt;&lt;span&gt;In IShellExtInit::Initialize handler any shell
extension almost always does the same things. It calls &lt;i&gt;DragQueryFile &lt;/i&gt;to obtain the number of selected files, and then call
&lt;i&gt;DragQueryFile &lt;/i&gt;to query the path to a
file. Imagine, that I have 10 shell extensions that need to know what file was
selected by the user. Most likely they will implement the same functionality in
its code. The list of following operations will be performed:&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin-right:-42.5pt;"&gt;
&lt;/p&gt;
&lt;p class="MsoNormal" style="margin:0cm -42.5pt 0.0001pt 36pt;text-indent:-18pt;"&gt;&lt;span&gt;&lt;span&gt;-&lt;span style="font-family:'Times New Roman';font-style:normal;font-variant:normal;font-weight:normal;font-size:7pt;line-height:normal;font-size-adjust:none;font-stretch:normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;call
&lt;i&gt;DragQueryFile &lt;/i&gt;to get number of
selected files&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style="margin:0cm -42.5pt 0.0001pt 36pt;text-indent:-18pt;"&gt;&lt;span&gt;&lt;span&gt;-&lt;span style="font-family:'Times New Roman';font-style:normal;font-variant:normal;font-weight:normal;font-size:7pt;line-height:normal;font-size-adjust:none;font-stretch:normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;call
&lt;i&gt;DragQueryFile &lt;/i&gt;in a loop for each file
to get it’s path&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style="margin:0cm -42.5pt 0.0001pt 36pt;text-indent:-18pt;"&gt;&lt;span&gt;&lt;span&gt;-&lt;span style="font-family:'Times New Roman';font-style:normal;font-variant:normal;font-weight:normal;font-size:7pt;line-height:normal;font-size-adjust:none;font-stretch:normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;do
some logics. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style="margin-right:-42.5pt;"&gt;&lt;span&gt;Graphically, this can be represented in the
following way:&lt;/span&gt;&lt;/p&gt;





&lt;p class="MsoNormal" style="margin-right:-42.5pt;"&gt;&amp;nbsp;&lt;img src="http://msmvps.com/photos/v_scherbina/images/297071/500x244.aspx"&gt;&amp;nbsp;&lt;br&gt;&lt;span&gt;From this scheme you can see that most shell
extensions do almost the same steps in order to get the list of selected files.
I wonder, why Shell team did not make some more flexible and
efficient solution that allows to avoid this overhead?&lt;o:p&gt;&lt;br&gt;&lt;/o:p&gt;&lt;br&gt;For example, by passing the list of selected
files into the Initialize function. This will significantly decrease the amount
of code need to be written by shell extensions writers and, on the other side,
it will be more efficient because there will be no need to make a huge amount
of calls to &lt;i&gt;DragQueryFile &lt;/i&gt;for each
shell extension module.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=297010" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/v_scherbina/archive/tags/reversing/default.aspx">reversing</category><category domain="http://msmvps.com/blogs/v_scherbina/archive/tags/troubleshooting/default.aspx">troubleshooting</category></item></channel></rss>