<?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>Junfeng Zhang's Windows Programming Notes : Win32</title><link>http://blogs.msdn.com/junfeng/archive/tags/Win32/default.aspx</link><description>Tags: Win32</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Windows Performance Tools Kit</title><link>http://blogs.msdn.com/junfeng/archive/2008/02/11/windows-performance-tools-kit.aspx</link><pubDate>Mon, 11 Feb 2008 19:00:40 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7564135</guid><dc:creator>junfeng</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/junfeng/comments/7564135.aspx</comments><wfw:commentRss>http://blogs.msdn.com/junfeng/commentrss.aspx?PostID=7564135</wfw:commentRss><wfw:comment>http://blogs.msdn.com/junfeng/rsscomments.aspx?PostID=7564135</wfw:comment><description>&lt;p&gt;Windows Performance Team has released Windows Performance Tools Kit to the Windows SDK for Windows Server 2008 and .NET Framework 3.5. &lt;/p&gt; &lt;p&gt;&lt;a title="http://www.microsoft.com/whdc/system/sysperf/perftools.mspx" href="http://www.microsoft.com/whdc/system/sysperf/perftools.mspx"&gt;http://www.microsoft.com/whdc/system/sysperf/perftools.mspx&lt;/a&gt;&lt;/p&gt; &lt;p&gt;This is the same tool Windows team uses to diagnose Windows performance problem. Along with the tool comes with a 60-page Quick Start Guide. It offers significant details how the system works.&lt;/p&gt; &lt;p&gt;Having a performance problem lately? Fire up Xperf and look at the pretty chart.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=7564135" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/junfeng/archive/tags/Win32/default.aspx">Win32</category></item><item><title>From Unhandled Exception to Debugger Attach</title><link>http://blogs.msdn.com/junfeng/archive/2007/11/19/from-unhandled-exception-to-debugger-attach.aspx</link><pubDate>Mon, 19 Nov 2007 19:00:45 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6324082</guid><dc:creator>junfeng</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/junfeng/comments/6324082.aspx</comments><wfw:commentRss>http://blogs.msdn.com/junfeng/commentrss.aspx?PostID=6324082</wfw:commentRss><wfw:comment>http://blogs.msdn.com/junfeng/rsscomments.aspx?PostID=6324082</wfw:comment><description>&lt;p&gt;I was always wondering what is happening between an application throws an unhandled exception, and a debugger attached to the process. Apparently the information is right under my nose, but I was blind. &lt;/p&gt;  &lt;p&gt;Windows Debugger's documentation about post-mortem debugging has all the details you want to know. &lt;/p&gt;  &lt;h3&gt;&lt;a name="r04_setup_3_40cc08bd-c0da-4d75-90cd-f677b4f63d68.xml"&gt;&lt;/a&gt;Enabling Postmortem Debugging&lt;/h3&gt;  &lt;p&gt;The most common application errors are called &lt;i&gt;exceptions&lt;/i&gt;. These include access violations, division-by-zero errors, numerical overflows, and many other kinds of errors.&lt;/p&gt;  &lt;p&gt;Applications can also cause &lt;i&gt;breakpoint interrupts&lt;/i&gt;. These occur when Windows is unable to run the application (for example, when a necessary module cannot be loaded) or when a breakpoint is encountered. Breakpoints can be inserted into the code by a debugger, or invoked through a function such as &lt;b&gt;DbgBreakPoint&lt;/b&gt;. In assembly language, a breakpoint interrupt is generated by an &lt;b&gt;int 3&lt;/b&gt; instruction.&lt;/p&gt;  &lt;p&gt;Windows can handle user-mode errors in a variety of ways. The following sequence shows the precedence used for error handling:&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;If a user-mode debugger is currently attached to the faulting process, all errors will cause the target to break into this debugger.      &lt;p&gt;As long as the user-mode debugger is attached, no other error-handling methods will be used &amp;#8212; even if the &lt;a href="r16_cmds_c_3254135f-8902-45ee-a2dc-a52049ea903c.xml.htm"&gt;&lt;b&gt;gn (Go With Exception Not Handled)&lt;/b&gt;&lt;/a&gt; command is used. &lt;/p&gt;   &lt;/li&gt;    &lt;li&gt;If no user-mode debugger is attached and the executing code has its own exception handling routines (for example, &lt;b&gt;try - except&lt;/b&gt;), this exception handling routine will attempt to deal with the error. &lt;/li&gt;    &lt;li&gt;If no user-mode debugger is attached, &lt;i&gt;and&lt;/i&gt; Windows has an open kernel-debugging connection, &lt;i&gt;and&lt;/i&gt; the error is a breakpoint interrupt, Windows will attempt to contact the kernel debugger.       &lt;p&gt;Kernel debugging connections must be opened during Windows' boot process. If you are using Windows Server 2003 or a later version of Windows and wish to prevent a user-mode interrupt from breaking into the kernel debugger, you can use the KDbgCtrl utility with the &lt;b&gt;-du&lt;/b&gt; parameter. For details on how to configure kernel-debugging connections and how to use KDbgCtrl, see &lt;a href="bootini_pageone_dbg_06095f76-d8a9-4397-880e-d9d461b84904.xml.htm"&gt;Configuring Software on the Target Computer&lt;/a&gt;.&lt;/p&gt;      &lt;p&gt;If Windows does attempt to contact a kernel debugger but there is no debugger running at the other end of the connection, Windows will freeze until kernel debugger is activated.&lt;/p&gt;      &lt;p&gt;In the kernel debugger, you can use &lt;a href="r16_cmds_c_bb7ab8a9-efe6-4feb-b234-e94d27848769.xml.htm"&gt;&lt;b&gt;gh (Go With Exception Handled)&lt;/b&gt;&lt;/a&gt; to disregard the error and continue running the target. You can use &lt;a href="r16_cmds_c_3254135f-8902-45ee-a2dc-a52049ea903c.xml.htm"&gt;&lt;b&gt;gn (Go With Exception Not Handled)&lt;/b&gt;&lt;/a&gt; to bypass the kernel debugger and go on to step 4. &lt;/p&gt;   &lt;/li&gt;    &lt;li&gt;If the conditions in steps 1, 2, and 3 do not apply, Windows will activate a debugging tool. Any program can be selected in advance as the tool to use in this situation. The chosen program is referred to as the &lt;i&gt;postmortem debugger&lt;/i&gt;. This is also known as the &lt;i&gt;just-in-time debugger&lt;/i&gt; or the &lt;i&gt;JIT debugger&lt;/i&gt;.       &lt;p&gt;If the postmortem debugger is a standard user-mode debugger (such as CDB, WinDbg, or Microsoft Visual Studio), this debugger will start up and break into your application.&lt;/p&gt;      &lt;p&gt;If the postmortem debugger is a tool for writing dump files (such as &lt;a href="drwatson_92d60a12-6577-4cd5-a02f-a1ea8204719a.xml.htm"&gt;Dr. Watson&lt;/a&gt;), a memory dump file will be created, and then the application will be terminated.&lt;/p&gt;   &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;&lt;b&gt;Note&lt;/b&gt;&amp;#160; If Dr. Watson is activated on Windows XP or a later version of Windows, a message box will appear. This window gives you the option of sending an error report to Microsoft. If you choose &lt;b&gt;Don't Send&lt;/b&gt;, a dump file will created and stored on your hard disk. If you choose &lt;b&gt;Send Error Report&lt;/b&gt;, a dump file will be created and stored on your hard disk, and will also be transmitted to Microsoft over the internet.&lt;/p&gt;  &lt;p&gt;If you have not reconfigured Windows' postmortem settings, Dr. Watson is used as the default postmortem debugger. This setting can be changed programmatically or through the registry; any changes take effect immediately.&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;To change the postmortem debugger to WinDbg, run &lt;b&gt;windbg -I&lt;/b&gt;. (The &lt;b&gt;I&lt;/b&gt; must be capitalized.) This command will display a success or failure message after it is used. When WinDbg is the postmortem debugger, it will be activated whenever an application crashes. &lt;/li&gt;    &lt;li&gt;To change the postmortem debugger to CDB, run &lt;b&gt;cdb -iae&lt;/b&gt; or &lt;b&gt;cdb -iaec &lt;/b&gt;&lt;i&gt;&lt;b&gt;KeyString&lt;/b&gt;&lt;/i&gt;.. When the &lt;b&gt;-iaec&lt;/b&gt; switch is used, &lt;i&gt;KeyString&lt;/i&gt; specifies a string to be added to the end of the &lt;b&gt;AeDebug&lt;/b&gt; registry key. This command will display no message if it succeeds, but will display a failure message if it fails. When CDB is the postmortem debugger, it will be activated whenever an application crashes. &lt;/li&gt;    &lt;li&gt;To change the postmortem debugger to NTSD, run &lt;b&gt;ntsd -iae&lt;/b&gt; or &lt;b&gt;ntsd -iaec &lt;/b&gt;&lt;i&gt;&lt;b&gt;KeyString&lt;/b&gt;&lt;/i&gt;.. When the &lt;b&gt;-iaec&lt;/b&gt; switch is used, &lt;i&gt;KeyString&lt;/i&gt; specifies a string to be added to the end of the &lt;b&gt;AeDebug&lt;/b&gt; registry key. If &lt;i&gt;KeyString&lt;/i&gt; contains spaces, it must be enclosed in quotation marks. This command will display no message if it succeeds, but will display a failure message if it fails. When NTSD is the postmortem debugger, it will be activated whenever an application crashes. &lt;/li&gt;    &lt;li&gt;To change the postmortem debugger back to Dr. Watson, run &lt;b&gt;drwtsn32 -i&lt;/b&gt;. When Dr. Watson is the postmortem debugger, a memory dump file will be written to disk if an application crashes. See &lt;a href="drwatson_6f519ccd-bd31-4d9a-8949-1134db5beda9.xml.htm"&gt;Dr. Watson Command-Line Options&lt;/a&gt; for details. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Only a system administrator can alter the postmortem settings.&lt;/p&gt;  &lt;p&gt;If a postmortem debugger has been installed, you can deliberately break into the debugger from a user-mode application by calling the &lt;b&gt;DebugBreak&lt;/b&gt; function.&lt;/p&gt;  &lt;h6&gt;Editing the Registry&lt;/h6&gt;  &lt;p&gt;The postmortem debugging settings are stored in the registry. If you wish to control these settings, it is recommended that you use the WinDbg, CDB, NTSD, or Dr. Watson commands described above; these will automatically change the relevant registry keys. If you do need to manually edit the registy, do so very carefully, since improper changes to the registry may render Windows unusable.&lt;/p&gt;  &lt;p&gt;On an x86 computer, the postmortem settings are stored in the &lt;b&gt;\\HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\AeDebug&lt;/b&gt; key.&lt;/p&gt;  &lt;p&gt;On an Intel Itanium computer, there are two registry keys used for postmortem debugging:&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;A failing 64-bit application will be debugged according to the settings stored in the &lt;b&gt;\\HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\AeDebug&lt;/b&gt; key. &lt;/li&gt;    &lt;li&gt;A failing 32-bit application will be debugged according to the settings stored in the &lt;b&gt;\\HKEY_LOCAL_MACHINE\Software\Wow6432Node\Microsoft\Windows NT\CurrentVersion\AeDebug&lt;/b&gt; key. However, if the &lt;b&gt;Debugger&lt;/b&gt; value in this key specifies an application in the &lt;i&gt;%windir%\system32&lt;/i&gt; directory, Windows will look in &lt;i&gt;%windir%\syswow64&lt;/i&gt; instead. &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;When using an Itanium computer, it is often simplest to place identical values in each of these keys. In particular, if you are using WinDbg, CDB, or NTSD as your postmortem debugger, the same version will work for 32-bit and 64-bit user-mode applications on an Itanium computer. See &lt;a href="r02_setup_1_bec62139-3e78-4a5a-9ff0-b525fe703d98.xml.htm"&gt;Choosing a 32-bit or 64-bit Debugger Package&lt;/a&gt; for details.&lt;/p&gt;  &lt;p&gt;There are two registry values that should appear in these keys:&lt;/p&gt; &lt;dl&gt;&lt;dt&gt;&lt;b&gt;Debugger&lt;/b&gt;&lt;/dt&gt;&lt;dd&gt;This REG_SZ value specifies the debugger that will handle postmortem debugging. The &lt;i&gt;full path&lt;/i&gt; to the debugger must be listed, unless the debugger is located in a directory that is in the default path. &lt;/dd&gt;&lt;dt&gt;&lt;b&gt;Auto&lt;/b&gt;&lt;/dt&gt;&lt;dd&gt;This REG_SZ value is always either &lt;b&gt;0&lt;/b&gt; or &lt;b&gt;1&lt;/b&gt;. If &lt;b&gt;Auto&lt;/b&gt; is set to &lt;b&gt;0&lt;/b&gt;, a message box will be displayed prior to postmortem debugging. &lt;/dd&gt;&lt;/dl&gt;  &lt;p&gt;When an unhandled application error occurs, Windows checks to see if the &lt;b&gt;Debugger&lt;/b&gt; and &lt;b&gt;Auto&lt;/b&gt; registry values exist.&lt;/p&gt;  &lt;p&gt;If the &lt;b&gt;Auto&lt;/b&gt; value is 0, a message box will appear.&lt;/p&gt;  &lt;p&gt;In Windows NT and Windows 2000, the message box will have one of the following formats:&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;If the &lt;b&gt;Debugger&lt;/b&gt; value contains the name of a valid debugger or Dr. Watson, the message box will have two buttons: &lt;b&gt;OK&lt;/b&gt; and &lt;b&gt;Cancel&lt;/b&gt;. If the &lt;b&gt;OK&lt;/b&gt; button is pressed, the application will be terminated. If the &lt;b&gt;Cancel&lt;/b&gt; button is pressed, the tool specified in the &lt;b&gt;Debugger&lt;/b&gt; value will be started. &lt;/li&gt;    &lt;li&gt;If the &lt;b&gt;Debugger&lt;/b&gt; value is empty, the message box will have only an &lt;b&gt;OK&lt;/b&gt; button and no debugger will start. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;In Windows XP and later versions of Windows, the message box will have one of the following formats:&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;If the &lt;b&gt;Debugger&lt;/b&gt; value contains the name of a valid debugger or Dr. Watson, the message box will have three buttons: &lt;b&gt;Send Error Report&lt;/b&gt;, &lt;b&gt;Don't Send&lt;/b&gt;, and &lt;b&gt;Debug&lt;/b&gt;. If the &lt;b&gt;Don't Send&lt;/b&gt; button is pressed, the application will be terminated. If the &lt;b&gt;Send Error Report&lt;/b&gt; button is pressed, a minidump file will be sent to Microsoft and the application will be terminated. If the &lt;b&gt;Debug&lt;/b&gt; button is pressed, the tool specified in the &lt;b&gt;Debugger&lt;/b&gt; value will be started. (Note that all of these buttons have different effects than the buttons on the message window for Dr. Watson when the &lt;b&gt;Auto&lt;/b&gt; value does not equal 0.) &lt;/li&gt;    &lt;li&gt;If the &lt;b&gt;Debugger&lt;/b&gt; value is empty, the message box will have only the &lt;b&gt;Send Error Report&lt;/b&gt; and &lt;b&gt;Don't Send&lt;/b&gt; buttons. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;If the &lt;b&gt;Auto&lt;/b&gt; value equals 1, no message box appears. The debugger referred to in the &lt;b&gt;Debugger&lt;/b&gt; value is automatically started.&lt;/p&gt;  &lt;h6&gt;Registry Examples&lt;/h6&gt;  &lt;p&gt;The following registry values can be used to set Dr. Watson as the postmortem debugger (this is the default):&lt;/p&gt;  &lt;p&gt;Debugger = &amp;quot;&lt;b&gt;drwtsn32 -p %ld -e %ld -g&lt;/b&gt;&amp;quot;    &lt;br /&gt;Auto = &lt;b&gt;1&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;The following values can be used to set WinDbg as the postmortem debugger:&lt;/p&gt;  &lt;p&gt;Debugger = &amp;quot;&lt;i&gt;Path&lt;/i&gt;&lt;b&gt;\WinDbg -p %ld -e %ld&lt;/b&gt;&amp;quot;    &lt;br /&gt;Auto = &lt;b&gt;1&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;The following values can be used to set CDB as the postmortem debugger:&lt;/p&gt;  &lt;p&gt;Debugger = &amp;quot;&lt;i&gt;Path&lt;/i&gt;&lt;b&gt;\CDB -p %ld -e %ld -g&lt;/b&gt;&amp;quot;    &lt;br /&gt;Auto = &lt;b&gt;1&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;In these examples, &lt;i&gt;Path&lt;/i&gt; is the directory where the debugger is located, -&lt;b&gt;p %ld&lt;/b&gt; specifies the process ID that will be debugged, -&lt;b&gt;e %ld&lt;/b&gt; provides the event that caused the exception, and -&lt;b&gt;g&lt;/b&gt; causes the debugger to skip the initial breakpoint. (Dr. Watson ignores the -&lt;b&gt;g&lt;/b&gt; option.)&lt;/p&gt;  &lt;p&gt;Security Vulnerabilities&lt;/p&gt;  &lt;p&gt;If you are considering enabling postmortem debugging on a computer that you share with other people, see &lt;a href="r11_security_c83dce6a-da9f-4b42-abb9-72afbb12bc7c.xml.htm"&gt;Security During Postmortem Debugging&lt;/a&gt;.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=6324082" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/junfeng/archive/tags/Win32/default.aspx">Win32</category><category domain="http://blogs.msdn.com/junfeng/archive/tags/Debugging/default.aspx">Debugging</category></item><item><title>Windows Vista Sxs Activation Context Cache</title><link>http://blogs.msdn.com/junfeng/archive/2007/10/01/vista-activation-context-cache.aspx</link><pubDate>Mon, 01 Oct 2007 18:00:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4183798</guid><dc:creator>junfeng</dc:creator><slash:comments>6</slash:comments><comments>http://blogs.msdn.com/junfeng/comments/4183798.aspx</comments><wfw:commentRss>http://blogs.msdn.com/junfeng/commentrss.aspx?PostID=4183798</wfw:commentRss><wfw:comment>http://blogs.msdn.com/junfeng/rsscomments.aspx?PostID=4183798</wfw:comment><description>&lt;P&gt;Sxs activation model is built on top of Actication Context. To create an activation context, use the API CreateActCtx. 
&lt;P&gt;Activation Context is used very frequently in Windows. For example, a simple operation like start notepad, open the common file dialog, select a file, will call CreateActCtx many times (I measured 18 times in Vista). With the adoption of Sxs model in VC++ libraries, the usage of activation context will certainly be much higher. 
&lt;P&gt;However, creating an activation context is a very expensive operation. It has to resolve the full assembly binding closure, which includes probing for policies for all the assemblies, probing for each assembly, and parse each manifest. If you have read the output of sxstrace, you will certainly understand there are a lot work during CreateActCtx. 
&lt;P&gt;Fortunately, activation context is fairly static. Given a steady state, it is likely the same input to CreateActCtx will always create an activation context with exactly the same content. This makes it an attractively target for caching. 
&lt;P&gt;In Windows Vista, Sxs implements an activation context cache. The article discusses some detail of the Vista activation context cache. 
&lt;P&gt;&lt;STRONG&gt;1. What to cache&lt;/STRONG&gt; 
&lt;P&gt;Only applications from local disk are cached. For applications running&amp;nbsp;off network or CD, the cache has no effect. 
&lt;P&gt;&lt;STRONG&gt;2. Location of the cache&lt;/STRONG&gt; 
&lt;P&gt;From this article (&lt;A href="http://blogs.msdn.com/junfeng/archive/2007/06/12/activation-context-creation-flow.aspx" mce_href="http://blogs.msdn.com/junfeng/archive/2007/06/12/activation-context-creation-flow.aspx"&gt;http://blogs.msdn.com/junfeng/archive/2007/06/12/activation-context-creation-flow.aspx&lt;/A&gt;) , we understand that the real work of CreateActCtx is done in CSRSS.exe. And this is where the cache is. The main reason is so that the activation context can be shared with multiple processes. 
&lt;P&gt;Since each session has a copy of CSRSS.exe, the cache is not shared across use login sessions. 
&lt;P&gt;&lt;STRONG&gt;3. Life time of the cache&lt;/STRONG&gt; 
&lt;P&gt;The cache is only stored in memory. The first time CreateActCtx is called, it adds an entry to the cache. Next time when the same CreateActCtx is called, the result is returned from the cache immediately, saving the expensive probing and xml parsing. The cache is lost when the machine reboots. 
&lt;P&gt;&lt;STRONG&gt;4. size of the cache&lt;/STRONG&gt; 
&lt;P&gt;The cache in Vista RTM has a fixed size, with a Least Recently Used (LRU) replacement algorithm. This may change in the future. 
&lt;P&gt;&lt;STRONG&gt;5. Cache Key&lt;/STRONG&gt; 
&lt;P&gt;The activation context stores the parsed content of all manifests in the full assembly binding closure. Ideally, the cache key should be the path of all the manifests, and their last modified time. 
&lt;P&gt;However, if Sxs uses that as the key to the cache, it means Sxs will have to do all the expensive probing, parsing, which makes the cache useless. 
&lt;P&gt;To make a compromise, Sxs chooses the path of the entry manifest of CreateActCtx and its last modified time as the key. &lt;STRONG&gt;&lt;FONT color=#ff0000&gt;This means, if one of its dependent assemblies has changed, it is necessary to "touch" (i.e. change the last modified time of) the entry manifest for Sxs to see the change. &lt;/FONT&gt;&lt;/STRONG&gt;
&lt;P&gt;Here is an example. You may have a manifest myapp.exe.manifest depending on VC80, and you decides to deploy vc80 privately. So you have a private Microsoft.VC80.CRT.manifest. In Vista, when you change Microsoft.VC80.CRT.manifest, in order for Sxs to see the change in this manifest, you need to change the last modified time of myapp.exe.manifest. 
&lt;P&gt;&lt;STRONG&gt;5. WinSxs&lt;/STRONG&gt; 
&lt;P&gt;If the dependent manifests are part of the application, this update requirement is very reasonable. However, if the assembly you depend on is in the global WinSxs store, you may not get a chance to update your manifest when the assembly in Winsxs changes.&amp;nbsp; 
&lt;P&gt;Thus in Vista, Sxs adds a WinSxs store timestamp. Whenever a publisher policy assembly is installed to Winsxs store, Sxs updates the timestamp. The activation context cache saves the Winsxs store timestamp in the cache when the cache is created. When Sxs processes a CreateActCtx request, it checks to see if the cached Winsxs store timestamp matches the real Winsxs store timestamp. If it does not, Sxs throws out the cache, and re-creates it from scratch. 
&lt;P&gt;The reason that the timestamp is updated only when a publisher policy assembly is installed, is because Sxs requires a publisher policy when update an assembly in Winsxs store. &lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;6. Disable the SxS Cache&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Remember in the post &lt;A class="" title=DotLocal href="http://blogs.msdn.com/junfeng/archive/2006/01/24/517221.aspx" mce_href="http://blogs.msdn.com/junfeng/archive/2006/01/24/517221.aspx"&gt;DotLocal (.local) Dll Redirection&lt;/A&gt;, we know that for private testing, we can use registry &lt;B style="mso-bidi-font-weight: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT color=#0000ff&gt;HKLM\Software\Microsoft\WindowsNT\CurrentVersion\Image File Execution Options!DevOverrideEnable:REG_DWORD&lt;/FONT&gt;&lt;/I&gt;&lt;/B&gt; to enable DotLocal Dll redirection for applications with SxS manifest. Since disabling the SxS cache&amp;nbsp;should&amp;nbsp;be really for testing only, the same registry key is used to disable the SxS cache.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=4183798" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/junfeng/archive/tags/Fusion/default.aspx">Fusion</category><category domain="http://blogs.msdn.com/junfeng/archive/tags/Win32/default.aspx">Win32</category><category domain="http://blogs.msdn.com/junfeng/archive/tags/Vista/default.aspx">Vista</category></item><item><title>advantages and disadvantages of delay load (LoadLibrary)</title><link>http://blogs.msdn.com/junfeng/archive/2007/08/01/advantages-and-disadvantages-of-delay-load-loadlibrary.aspx</link><pubDate>Wed, 01 Aug 2007 18:00:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4073888</guid><dc:creator>junfeng</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/junfeng/comments/4073888.aspx</comments><wfw:commentRss>http://blogs.msdn.com/junfeng/commentrss.aspx?PostID=4073888</wfw:commentRss><wfw:comment>http://blogs.msdn.com/junfeng/rsscomments.aspx?PostID=4073888</wfw:comment><description>&lt;P class=MsoNormal&gt;&lt;SPAN style="FONT-SIZE: 11pt; COLOR: #7030a0; FONT-FAMILY: 'Calibri','sans-serif'"&gt;&lt;FONT color=#000000&gt;Some knowledgeable people posted the following wisdom about delay load. Archived here to share.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN style="FONT-SIZE: 11pt; COLOR: #7030a0; FONT-FAMILY: 'Calibri','sans-serif'"&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;EM&gt;&lt;SPAN style="FONT-SIZE: 11pt; COLOR: #7030a0; FONT-FAMILY: 'Calibri','sans-serif'"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 11pt; COLOR: #7030a0; FONT-FAMILY: 'Calibri','sans-serif'"&gt;The advantages are that dlls get loaded only when they are used, and you can “statically” bind to an i&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 11pt; COLOR: #7030a0; FONT-FAMILY: 'Calibri','sans-serif'"&gt;mport that may not exist at runtime, and as long as you are careful not to call it, the program will still work downlevel.&lt;/SPAN&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN style="FONT-SIZE: 11pt; COLOR: #7030a0; FONT-FAMILY: 'Calibri','sans-serif'"&gt;&lt;EM&gt;&lt;/EM&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN style="FONT-SIZE: 11pt; COLOR: #7030a0; FONT-FAMILY: 'Calibri','sans-serif'"&gt;&lt;EM&gt;The disadvantage is:&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoListParagraph style="MARGIN-LEFT: 24.75pt; TEXT-INDENT: -0.25in"&gt;&lt;EM&gt;&lt;SPAN style="FONT-SIZE: 11pt; COLOR: #7030a0; FONT-FAMILY: 'Calibri','sans-serif'"&gt;&lt;SPAN&gt;1)&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 11pt; COLOR: #7030a0; FONT-FAMILY: 'Calibri','sans-serif'"&gt;Some DLLs don’t work DelayLoaded (as mentioned in the limitations of LoadLibrary).&amp;nbsp; In particular, any dll that uses __declspec(thread), or any dll that you want to import data from.&lt;/SPAN&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P class=MsoListParagraph style="MARGIN-LEFT: 24.75pt; TEXT-INDENT: -0.25in"&gt;&lt;EM&gt;&lt;SPAN style="FONT-SIZE: 11pt; COLOR: #7030a0; FONT-FAMILY: 'Calibri','sans-serif'"&gt;&lt;SPAN&gt;2)&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 11pt; COLOR: #7030a0; FONT-FAMILY: 'Calibri','sans-serif'"&gt;You can’t call any API that might be delay loaded in your DllMain (since you can’t call LoadLibrary during DllMain).&amp;nbsp; Probably not a big deal since you’re generally not supposed to call any APIs in DllMain. &lt;/SPAN&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P class=MsoListParagraph style="MARGIN-LEFT: 24.75pt; TEXT-INDENT: -0.25in"&gt;&lt;EM&gt;&lt;SPAN style="FONT-SIZE: 11pt; COLOR: #7030a0; FONT-FAMILY: 'Calibri','sans-serif'"&gt;&lt;SPAN&gt;3)&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 11pt; COLOR: #7030a0; FONT-FAMILY: 'Calibri','sans-serif'"&gt;The DLLs in your process are now initialized in random order.&amp;nbsp; There may be some orders that cause bizarre bugs.&lt;/SPAN&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P class=MsoListParagraph style="MARGIN-LEFT: 24.75pt; TEXT-INDENT: -0.25in"&gt;&lt;EM&gt;&lt;SPAN style="FONT-SIZE: 11pt; COLOR: #7030a0; FONT-FAMILY: 'Calibri','sans-serif'"&gt;&lt;SPAN&gt;4)&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 11pt; COLOR: #7030a0; FONT-FAMILY: 'Calibri','sans-serif'"&gt;In particular, if you “statically” bind to a dll, then your dll is uninitialized before that other dll.&amp;nbsp; If you delayload, then you will be uninitialized after your delayloaded dlls.&lt;/SPAN&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P class=MsoListParagraph style="MARGIN-LEFT: 24.75pt; TEXT-INDENT: -0.25in"&gt;&lt;EM&gt;&lt;SPAN style="FONT-SIZE: 11pt; COLOR: #7030a0; FONT-FAMILY: 'Calibri','sans-serif'"&gt;&lt;SPAN&gt;5)&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 11pt; COLOR: #7030a0; FONT-FAMILY: 'Calibri','sans-serif'"&gt;Since DLLs may be loaded “late”, their preferred base address may be used already by stack or heap data, resulting in a rebasing performance penalty that wouldn’t happen if the Dll was loaded at boot.&lt;/SPAN&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P class=MsoListParagraph style="MARGIN-LEFT: 24.75pt; TEXT-INDENT: -0.25in"&gt;&lt;EM&gt;&lt;SPAN style="FONT-SIZE: 11pt; COLOR: #7030a0; FONT-FAMILY: 'Calibri','sans-serif'"&gt;&lt;SPAN&gt;6)&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 11pt; COLOR: #7030a0; FONT-FAMILY: 'Calibri','sans-serif'"&gt;If the LoadLibrary fails for some reason (at the delay loading site), then your program just crashes.&amp;nbsp; You can catch this exception, but it is difficult to recover from and definitely the API callsite that was expecting to make a call into this delayed dll will have no direct way of detecting failures.&lt;/SPAN&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN style="FONT-SIZE: 11pt; COLOR: #7030a0; FONT-FAMILY: 'Calibri','sans-serif'"&gt;&lt;EM&gt;&lt;/EM&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN style="FONT-SIZE: 11pt; COLOR: #7030a0; FONT-FAMILY: 'Calibri','sans-serif'"&gt;&lt;EM&gt;The last one is the biggest burden. &amp;nbsp;It can mean random crashes when your app is under stress (because you’re out of memory to load that DLL).&amp;nbsp; Unless your feature is specifically designed to deal with that DLL not loading (and you’d have to put this code around every place where you call a delayed API), you run this random crash risk.&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN style="FONT-SIZE: 11pt; COLOR: #7030a0; FONT-FAMILY: 'Calibri','sans-serif'"&gt;&lt;EM&gt;&lt;/EM&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN style="FONT-SIZE: 11pt; COLOR: #7030a0; FONT-FAMILY: 'Calibri','sans-serif'"&gt;&lt;EM&gt;Delay Loading definitely has its uses and its benefits, but the limitations means it is not correct to blindly delayload everything.&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN style="FONT-SIZE: 11pt; COLOR: #7030a0; FONT-FAMILY: 'Calibri','sans-serif'"&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=4073888" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/junfeng/archive/tags/Win32/default.aspx">Win32</category></item><item><title>RT_MANIFEST resource, and ISOLATION_AWARE_ENABLED</title><link>http://blogs.msdn.com/junfeng/archive/2007/06/26/rt-manifest-resource-and-isolation-aware-enabled.aspx</link><pubDate>Tue, 26 Jun 2007 18:00:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3494040</guid><dc:creator>junfeng</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/junfeng/comments/3494040.aspx</comments><wfw:commentRss>http://blogs.msdn.com/junfeng/commentrss.aspx?PostID=3494040</wfw:commentRss><wfw:comment>http://blogs.msdn.com/junfeng/rsscomments.aspx?PostID=3494040</wfw:comment><description>&lt;H6&gt;&lt;FONT size=3&gt;RT_MANIFEST&lt;/FONT&gt;&lt;/H6&gt;
&lt;P&gt;Since Windows XP, Windows reserves a new type of resource RT_MANIFEST for SxS manifests. &lt;/P&gt;
&lt;P&gt;Within the RT_MANIFEST resource, Windows reserves ID 1-16. A binary cannot have two IDs of resource type RT_MANIFEST within 1-16. Windows will refuse to load such binary in Windows XP/Windows Server 2003. &lt;/P&gt;
&lt;P&gt;Only three IDs are used today in Windows. &lt;/P&gt;
&lt;P&gt;excerpt from Winuser.h&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;FONT color=#0000ff&gt;#define RT_MANIFEST&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;&amp;nbsp; MAKEINTRESOURCE(24)&lt;BR&gt;#define CREATEPROCESS_MANIFEST_RESOURCE_ID MAKEINTRESOURCE( 1)&lt;BR&gt;#define ISOLATIONAWARE_MANIFEST_RESOURCE_ID MAKEINTRESOURCE(2)&lt;BR&gt;#define ISOLATIONAWARE_NOSTATICIMPORT_MANIFEST_RESOURCE_ID MAKEINTRESOURCE(3)&lt;BR&gt;#define MINIMUM_RESERVED_MANIFEST_RESOURCE_ID MAKEINTRESOURCE( 1 /*inclusive*/)&lt;BR&gt;#define MAXIMUM_RESERVED_MANIFEST_RESOURCE_ID MAKEINTRESOURCE(16 /*inclusive*/)&lt;/FONT&gt; &lt;/EM&gt;
&lt;H6&gt;&lt;FONT size=3&gt;CREATEPROCESS_MANIFEST_RESOURCE_ID&lt;/FONT&gt;&lt;/H6&gt;
&lt;P&gt;CREATEPROCESS_MANIFEST_RESOURCE_ID is used primarily for EXEs. If an executable has a resource of type RT_MANIFEST, ID CREATEPROCESS_MANIFEST_RESOURCE_ID, Windows will create a process default activation context for the process. The process default activation context will be used by all components running in the process. &lt;/P&gt;
&lt;P&gt;CREATEPROCESS_MANIFEST_RESOURCE_ID can also used by DLLs. When Windows probe for dependencies, if the dll has a resource of type RT_MANIFEST, ID CREATEPROCESS_MANIFEST_RESOURCE_ID, Windows will use that manifest as the dependency. &lt;/P&gt;
&lt;H6&gt;&lt;STRONG&gt;&lt;FONT size=3&gt;ISOLATIONAWARE_MANIFEST_RESOURCE_ID&lt;/FONT&gt;&lt;/STRONG&gt; &lt;/H6&gt;
&lt;P&gt;ISOLATIONAWARE_MANIFEST_RESOURCE_ID is used primarily for DLLs. It should be used if the dll wants private dependencies other than the process default. For example, if an dll depends on comctl32.dll version 6.0.0.0. It should have a resource of type RT_MANIFEST, ID ISOLATIONAWARE_MANIFEST_RESOURCE_ID to depend on comctl32.dll version 6.0.0.0, so that even if the process executable wants comctl32.dll version 5.1, the dll itself will still use the right version of comctl32.dll. &lt;/P&gt;
&lt;P&gt;When LoadLibrary is called, before loading the dependencies of the dll, the NT library loader checks to see if the dll has a resource of type RT_MANIFEST, ID ISOLATIONAWARE_MANIFEST_RESOURCE_ID. If it does, the loader calls CreateActCtx with the resource, and use the generated activation context to probe the dll's static dependencies. This is reason why the dll can have private dependencies with the ISOLATIONAWARE_MANIFEST_RESOURCE_ID resource. &lt;/P&gt;
&lt;P&gt;The activation context created during LoadLibrary is stored in the loader data structure tracking the dll. &lt;/P&gt;
&lt;P&gt;Normally this activation context is used only during LoadLibrary, for the dll's static dependencies. &lt;/P&gt;
&lt;P&gt;Sometimes, you want to use the activation context outside of probing the dll's static dependencies. You can define macro ISOLATION_AWARE_ENABLED when you compile the module. &lt;/P&gt;
&lt;H6&gt;&lt;STRONG&gt;&lt;FONT size=3&gt;ISOLATION_AWARE_ENABLED&lt;/FONT&gt;&lt;/STRONG&gt; &lt;/H6&gt;
&lt;P&gt;When ISOLATION_AWARE_ENABLED is defined, Windows re-defines certain APIs. For example LoadLibraryExW is redefined to IsolationAwareLoadLibraryExW. &lt;/P&gt;
&lt;P&gt;When IsolationAwareLoadLibraryExW is first called, it tries to retrieve the activation context stored in the loader data structure when the calling library is loaded. If the library does not have such activation context (for example, the library does not have a manifest of id ISOLATIONAWARE_MANIFEST_RESOURCE_ID), IsolationAwareLoadLibraryExW tries to create a new activation context with the calling library with id ISOLATIONAWARE_NOSTATICIMPORT_MANIFEST_RESOURCE_ID MAKEINTRESOURCE. If the creation fails, IsolationAwareLoadLibraryExW will use the process default activation context. &lt;/P&gt;
&lt;P&gt;Once the activation context is determined, IsolationAwareLoadLibraryExW will call ActivateActCtx on the activation context, call the real API (LoadLibraryExW), and on return, it calls DeactivationActCtx. This way, the correct activation context is automatically used. &lt;/P&gt;
&lt;P&gt;Not all APIs affected by activation context are wrapped. For example, GetModuleHandleEx is not wrapped, and neither is any of the COM APIs. For a complete list of APIs wrapped by ISOLATION_AWARE_ENABLED, check your copy of Windows SDK. &lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;FONT color=#0000ff&gt;C:\Program Files\Microsoft SDKs\Windows\v6.0\Include&amp;gt;dir *.inl&lt;BR&gt;Volume in drive C has no label.&lt;BR&gt;Volume Serial Number is ECD1-6DB0 &lt;/FONT&gt;&lt;/EM&gt;
&lt;P&gt;&lt;EM&gt;&lt;FONT color=#0000ff&gt;Directory of C:\Program Files\Microsoft SDKs\Windows\v6.0\Include &lt;/FONT&gt;&lt;/EM&gt;
&lt;P&gt;&lt;FONT color=#0000ff&gt;&lt;EM&gt;10/30/2006&amp;nbsp; 01:44 AM&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 159,222 commctrl.inl&lt;BR&gt;10/30/2006&amp;nbsp; 01:44 AM&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 32,836 commdlg.inl&lt;BR&gt;10/30/2006&amp;nbsp; 01:44 AM&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 12,065 prsht.inl&lt;BR&gt;10/30/2006&amp;nbsp; 01:44 AM&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 23,430 WinBase.Inl&lt;BR&gt;10/30/2006&amp;nbsp; 01:44 AM&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 36,308 WinUser.Inl&lt;/EM&gt; &lt;/FONT&gt;
&lt;P&gt;If the APIs you use are not wrapped by ISOLATION_AWARE_ENABLED, you have to do the activation/deactivation yourself properly. You can use the C++ helper class described in MSDN &lt;A title=http://msdn2.microsoft.com/en-us/library/aa375197.aspx href="http://msdn2.microsoft.com/en-us/library/aa375197.aspx" target=_blank mce_href="http://msdn2.microsoft.com/en-us/library/aa375197.aspx"&gt;http://msdn2.microsoft.com/en-us/library/aa375197.aspx&lt;/A&gt;. &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For more information, please see MSDN section about Sxs &lt;A href="http://msdn2.microsoft.com/en-us/library/aa375193.aspx" target=_blank mce_href="http://msdn2.microsoft.com/en-us/library/aa375193.aspx"&gt;Isolated Applications and Side-by-side Assemblies&lt;/A&gt;.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=3494040" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/junfeng/archive/tags/Fusion/default.aspx">Fusion</category><category domain="http://blogs.msdn.com/junfeng/archive/tags/Win32/default.aspx">Win32</category></item><item><title>Diagnose SideBySide failures in Windows XP/Windows Server 2003</title><link>http://blogs.msdn.com/junfeng/archive/2007/06/12/diagnose-sidebyside-failures-in-windows-xp-windows-server-2003.aspx</link><pubDate>Tue, 12 Jun 2007 22:00:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3234999</guid><dc:creator>junfeng</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/junfeng/comments/3234999.aspx</comments><wfw:commentRss>http://blogs.msdn.com/junfeng/commentrss.aspx?PostID=3234999</wfw:commentRss><wfw:comment>http://blogs.msdn.com/junfeng/rsscomments.aspx?PostID=3234999</wfw:comment><description>&lt;P&gt;&lt;FONT size=3&gt;Since I published my article on &lt;/FONT&gt;&lt;A href="http://blogs.msdn.com/junfeng/archive/2006/04/14/576314.aspx" mce_href="http://blogs.msdn.com/junfeng/archive/2006/04/14/576314.aspx"&gt;&lt;FONT size=3&gt;how to diagnose SideBySide failures&lt;/FONT&gt;&lt;/A&gt;&lt;FONT size=3&gt;, I have received many feedbacks that&amp;nbsp;since Sxstrace is not available in Windows XP/Windows Server 2003, it is hard to&amp;nbsp;figure out what is wrong in Windows XP/Windows Server 2003. &amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=3&gt;This article&amp;nbsp;intends to help people diagnose SideBySide failures in Windows XP/Windows Server 2003. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=3&gt;SideBySide failures usually results in error code Win32 error &lt;STRONG&gt;&lt;FONT color=#0000ff&gt;ERROR_SXS_CANT_GEN_ACTCTX&lt;/FONT&gt;&lt;/STRONG&gt; (or HRESULT 0x800736B1), or ntstatus code &lt;STRONG&gt;&lt;FONT color=#0000ff&gt;STATUS_SXS_CANT_GEN_ACTCTX&lt;/FONT&gt; &lt;/STRONG&gt;(0xc0150002). You may see it when launching a process with Sxs manifest, or loading a dll with sxs manifest. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=3&gt;From this &lt;/FONT&gt;&lt;A href="http://blogs.msdn.com/junfeng/archive/2007/06/12/activation-context-creation-flow.aspx" mce_href="http://blogs.msdn.com/junfeng/archive/2007/06/12/activation-context-creation-flow.aspx"&gt;&lt;FONT size=3&gt;article&lt;/FONT&gt;&lt;/A&gt;&lt;FONT size=3&gt;, we learned that the real work is done by CSRSS.exe. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=3&gt;Since most of the work in Creating Activation Context is probing, we can use the sysinternals tool &lt;/FONT&gt;&lt;A href="http://www.microsoft.com/technet/sysinternals/utilities/filemon.mspx" mce_href="http://www.microsoft.com/technet/sysinternals/utilities/filemon.mspx"&gt;&lt;FONT size=3&gt;FileMon.exe&lt;/FONT&gt;&lt;/A&gt;&lt;FONT size=3&gt; to understand what is going on. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=3&gt;Let's run an example. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=3&gt;I am running on Windows Server 2003.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;F:\tools&amp;gt;ver &lt;/EM&gt;
&lt;P&gt;&lt;EM&gt;Microsoft Windows [Version 5.2.3790]&lt;/EM&gt; 
&lt;P&gt;&lt;FONT size=3&gt;There is&amp;nbsp;a tool CoCreate.exe. It has a Sxs manifest depends on common control.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;F:\tools&amp;gt;more cocreate.exe.manifest&lt;BR&gt;&amp;lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&amp;gt;&lt;BR&gt;&amp;lt;assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;assemblyIdentity&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; name="CoCreate"&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; version="1.0.0.0"&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /&amp;gt; &lt;/EM&gt;
&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;dependency&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;dependentAssembly&amp;gt;&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;lt;assemblyIdentity&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; type="win32"&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; name="Microsoft.Windows.Common-Controls"&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; version="6.1.0.0"&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; processorArchitecture="*"&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; publicKeyToken="6595b64144ccf1df"&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; language="*"&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;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/dependentAssembly&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/dependency&amp;gt; &lt;/EM&gt;
&lt;P&gt;&lt;EM&gt;&amp;lt;/assembly&amp;gt;&lt;/EM&gt; 
&lt;P&gt;&lt;FONT size=3&gt;Unfortunately it says it depends on common control version 6.1.0.0, which does not exist anywhere currently. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=3&gt;Let's run the tool anyway. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;F:\tools&amp;gt;cocreate&lt;BR&gt;The system cannot execute the specified program.&lt;/EM&gt; 
&lt;P&gt;&lt;FONT size=3&gt;Just as expected, the tool refuses to run. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=3&gt;Let's look at what event log tells us. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/junfeng/WindowsLiveWriter/DiagnoseSideBySidefailuresinWindowsXPWin_BC8A/sxsevent.jpg" mce_href="http://blogs.msdn.com/blogfiles/junfeng/WindowsLiveWriter/DiagnoseSideBySidefailuresinWindowsXPWin_BC8A/sxsevent.jpg" atomicselection="true"&gt;&lt;FONT size=3&gt;&lt;IMG style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=448 alt=sxsevent src="http://blogs.msdn.com/blogfiles/junfeng/WindowsLiveWriter/DiagnoseSideBySidefailuresinWindowsXPWin_BC8A/sxsevent_thumb.jpg" width=405 border=0 mce_src="http://blogs.msdn.com/blogfiles/junfeng/WindowsLiveWriter/DiagnoseSideBySidefailuresinWindowsXPWin_BC8A/sxsevent_thumb.jpg"&gt;&lt;/FONT&gt;&lt;/A&gt;&lt;FONT size=3&gt; &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=3&gt;The message is accurate. But it is not really helpful here. What referenced assembly is not installed on my system? &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=3&gt;Let's see if Filemon can help us here or not. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=3&gt;Launch filemon, and set the filter to CSRSS, as we want to monitor file access from the process CSRSS.exe. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=3&gt;Re-run CoCreate.exe. Now we have this in FileMon:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/junfeng/WindowsLiveWriter/DiagnoseSideBySidefailuresinWindowsXPWin_BC8A/csrss_1.jpg" mce_href="http://blogs.msdn.com/blogfiles/junfeng/WindowsLiveWriter/DiagnoseSideBySidefailuresinWindowsXPWin_BC8A/csrss_1.jpg" atomicselection="true"&gt;&lt;FONT size=3&gt;&lt;IMG style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=860 alt=csrss src="http://blogs.msdn.com/blogfiles/junfeng/WindowsLiveWriter/DiagnoseSideBySidefailuresinWindowsXPWin_BC8A/csrss_thumb_1.jpg" width=1373 border=0 mce_src="http://blogs.msdn.com/blogfiles/junfeng/WindowsLiveWriter/DiagnoseSideBySidefailuresinWindowsXPWin_BC8A/csrss_thumb_1.jpg"&gt;&lt;/FONT&gt;&lt;/A&gt;&lt;FONT size=3&gt; &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=3&gt;Ok. CSRSS.exe did a lot probing for Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.1.0.0.xxx. Given that CoCreate.exe.manifest says it depends on common control version 6.1.0.0, it is pretty clear that the missing referenced assembly is common control version 6.1.0.0. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT size=3&gt;&lt;FONT color=#ff0000&gt;Warning!!! Please do not attempt to copy files to the Winsxs directories shown in filemon output to workaround the Sxs activation context creation problem. Sxs keeps other metadata about the assembly besides the files in %windir%\Winsxs. Please always use the documented way to install Sxs assemblies.&lt;/FONT&gt; &lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=3234999" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/junfeng/archive/tags/Fusion/default.aspx">Fusion</category><category domain="http://blogs.msdn.com/junfeng/archive/tags/Win32/default.aspx">Win32</category></item><item><title>Activation Context Creation flow</title><link>http://blogs.msdn.com/junfeng/archive/2007/06/12/activation-context-creation-flow.aspx</link><pubDate>Tue, 12 Jun 2007 18:00:10 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3234261</guid><dc:creator>junfeng</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/junfeng/comments/3234261.aspx</comments><wfw:commentRss>http://blogs.msdn.com/junfeng/commentrss.aspx?PostID=3234261</wfw:commentRss><wfw:comment>http://blogs.msdn.com/junfeng/rsscomments.aspx?PostID=3234261</wfw:comment><description>&lt;p&gt;The following describes how activation context is created currently in Windows XP/Windows Server 2003/Windows Vista.&lt;/p&gt; &lt;p&gt;1. CreateProcess/CreateActCtx is called. &lt;/p&gt; &lt;p&gt;2. CreateProcess/CreateActCtx does some validation, constructs a message, sends the message to CSRSS.exe, and waits for CSRSS.exe to return.&lt;/p&gt; &lt;p&gt;3. CSRSS.exe receives the message, and creates the activation context as described in &lt;a title="http://blogs.msdn.com/junfeng/archive/2006/04/22/580482.aspx" href="http://blogs.msdn.com/junfeng/archive/2006/04/22/580482.aspx"&gt;http://blogs.msdn.com/junfeng/archive/2006/04/22/580482.aspx&lt;/a&gt;. &lt;/p&gt; &lt;p&gt;4. Once the activation context is created, CSRSS returns it to the client. &lt;/p&gt; &lt;p&gt;5. CreateProcess/CreateActCtx proceeds. &lt;/p&gt; &lt;p&gt;The getaway from the flow above is: &lt;strong&gt;most work is done in CSRSS.exe.&lt;/strong&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=3234261" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/junfeng/archive/tags/Fusion/default.aspx">Fusion</category><category domain="http://blogs.msdn.com/junfeng/archive/tags/Win32/default.aspx">Win32</category></item><item><title>Genman32 – A tool to generate Sxs manifest for managed assembly for Registration Free COM/.Net Interop</title><link>http://blogs.msdn.com/junfeng/archive/2007/04/14/genman32-a-tool-to-generate-sxs-manifest-for-managed-assembly-for-registration-free-com-net-interop.aspx</link><pubDate>Sat, 14 Apr 2007 18:00:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2111091</guid><dc:creator>junfeng</dc:creator><slash:comments>12</slash:comments><comments>http://blogs.msdn.com/junfeng/comments/2111091.aspx</comments><wfw:commentRss>http://blogs.msdn.com/junfeng/commentrss.aspx?PostID=2111091</wfw:commentRss><wfw:comment>http://blogs.msdn.com/junfeng/rsscomments.aspx?PostID=2111091</wfw:comment><description>&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;Attached to this article is GenMan32, a tool to generate sxs manifest for managed assembly to use in registration free COM/.Net Interop scenario. &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;(For more information about registration free COM/.Net interop, please read &lt;/FONT&gt;&lt;A href="http://blogs.msdn.com/junfeng/archive/2006/05/17/595140.aspx" mce_href="http://blogs.msdn.com/junfeng/archive/2006/05/17/595140.aspx"&gt;&lt;FONT face=Calibri size=3&gt;http://blogs.msdn.com/junfeng/archive/2006/05/17/595140.aspx&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Calibri size=3&gt;.)&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;GenMan32&amp;nbsp;uses reflection API to enumerate all the types in the assembly. For each type, if it requires registration (as determined by &lt;/FONT&gt;&lt;A href="http://msdn2.microsoft.com/en-us/library/system.runtime.interopservices.registrationservices.typerequiresregistration.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/system.runtime.interopservices.registrationservices.typerequiresregistration.aspx"&gt;&lt;FONT face=Calibri size=3&gt;System.Runtime.InteropServices.RegistrationServices.TypeRequiresRegistraton&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Calibri size=3&gt;), depending on what kind of type it is, the tool generates either a clrClass element, or a clrSurrogate element. &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;For most basic scenarios, the sxs manifest generated by the tool is sufficient. For more complex scenarios, we may have to edit the generated manifest file before add the manifest to the assembly. &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;Here is the usage of the tool.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;&lt;FONT face=Calibri&gt;D:\tools&amp;gt;genman32&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;Microsoft (R) .NET Framework Win32 Manifest File Generation Utility 2.0.60120.0&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;Copyright (C) Microsoft Corporation 1998-2004.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;All rights reserved.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;o:p&gt;&lt;FONT face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;Syntax: GenMan32 AssemblyName [Options]&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;Options:&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;/add&lt;SPAN style="mso-spacerun: yes"&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; &lt;/SPAN&gt;Add manifest file to the assembly as a resource.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;If /manifest option is provided, use the filename a&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;s input.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;Otherwise generate one from the assembly.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;/remove&lt;SPAN style="mso-spacerun: yes"&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; &lt;/SPAN&gt;Remove an embedded manifest from the assembly.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;/replace&lt;SPAN style="mso-spacerun: yes"&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; &lt;/SPAN&gt;Replace embedded manifest with new manifest.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;New manifest is specified by /manifest option.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;/manifest:filename&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;Specify the manifest file to add or replace.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;Used together with option /add or /replace.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;/typelib&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;Generate typelib and record all the interfaces in&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;manifest. This option cannot be used with interop&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;assemblies.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;/reference:filename&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;Specify the dependency of the assembly. To specify&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;multiple dependencies, specify the /reference optio&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;n multiple time.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;/asmpath:directory&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;Look for assembly references here.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;/out:filename&lt;SPAN style="mso-spacerun: yes"&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;Generate manifest. If filename is omitted, the&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;manifest is generated as AssemblyName.manifest.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;/nologo&lt;SPAN style="mso-spacerun: yes"&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; &lt;/SPAN&gt;Prevents GenMan32 from displaying logo.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;/silent&lt;SPAN style="mso-spacerun: yes"&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; &lt;/SPAN&gt;Silent mode. Success messages not displayed.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;/? or /help&lt;SPAN style="mso-spacerun: yes"&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;Display this usage message.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;FONT face=Calibri size=3&gt;We can use the tool to generate a Sxs manifest for managed assembly. &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;&lt;FONT face=Calibri&gt;D:\tools&amp;gt;more testlib.cs&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;using System;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;using System.Runtime.InteropServices;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;o:p&gt;&lt;FONT face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;[ComVisible(true)]&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;public class TestClass&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;public void TestAPI()&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;o:p&gt;&lt;FONT face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;[ComVisible(true)]&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;public struct TestStruct&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;int testField;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;o:p&gt;&lt;FONT face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;&lt;FONT face=Calibri&gt;D:\tools&amp;gt;genman32 testlib.dll /out:1.man&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;Microsoft (R) .NET Framework Win32 Manifest File Generation Utility 2.0.60120.0&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;Copyright (C) Microsoft Corporation 1998-2004.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;All rights reserved.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;o:p&gt;&lt;FONT face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;Win32 Manifest file D:\tools\1.man is created successfully&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal; tab-stops: 54.75pt"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&lt;FONT face=Calibri size=3&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; &lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;FONT face=Calibri size=3&gt;Let’s look at the generated manifest. &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;&lt;FONT face=Calibri&gt;D:\tools&amp;gt;more 1.man&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&amp;lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&amp;lt;assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;assemblyIdentity&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;name="testlib"&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;version="0.0.0.0"&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;processorArchitecture="MSIL" /&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;clrClass&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;clsid="{ED653D53-DA9A-35A8-B16E-6C8704AC432D}"&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;progid="TestClass"&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;threadingModel="Both"&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;name="TestClass"&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;runtimeVersion="v2.0.50727"&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;/clrClass&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;clrSurrogate&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;clsid="{D250790F-F50A-33FD-990F-FF5DC3E26E9B}"&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;name="TestStruct"&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;/clrSurrogate&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;file name="testlib.dll"&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;/file&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&amp;lt;/assembly&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;FONT face=Calibri size=3&gt;We can also use this tool to add the manifest to the managed assembly. &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;&lt;FONT face=Calibri&gt;D:\tools&amp;gt;genman32 testlib.dll /add /manifest:1.man&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;Microsoft (R) .NET Framework Win32 Manifest File Generation Utility 2.0.60120.0&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;Copyright (C) Microsoft Corporation 1998-2004.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;All rights reserved.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;o:p&gt;&lt;FONT face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;Win32 Manifest added to assembly 'D:\tools\testlib.dll' successfully&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;FONT face=Calibri size=3&gt;We can verify the manifest is indeed successfully embedded to the managed assembly. &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;&lt;FONT face=Calibri&gt;D:\tools&amp;gt;dumpmanifest -f testlib.dll 1&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&amp;lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&amp;lt;assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;assemblyIdentity&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;name="testlib"&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;version="0.0.0.0"&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;processorArchitecture="MSIL" /&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;clrClass&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;clsid="{ED653D53-DA9A-35A8-B16E-6C8704AC432D}"&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;progid="TestClass"&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;threadingModel="Both"&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;name="TestClass"&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;runtimeVersion="v2.0.50727"&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;/clrClass&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;clrSurrogate&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;clsid="{D250790F-F50A-33FD-990F-FF5DC3E26E9B}"&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;name="TestStruct"&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;/clrSurrogate&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;file name="testlib.dll"&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;/file&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&amp;lt;/assembly&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;FONT face=Calibri size=3&gt;Let’s prove ourselves that this is indeed working. &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;FONT face=Calibri size=3&gt;CoCreate.exe simply calls CoCreateInstance. If it fails, CoCreate.exe prints an error message, else it prints success. &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;&lt;FONT face=Calibri&gt;D:\tools&amp;gt;more cocreate.exe.manifest&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&amp;lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&amp;lt;assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&amp;lt;assemblyIdentity&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;name="CoCreate"&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;version="0.0.0.0"&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;type="win32"/&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&amp;lt;/assembly&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;o:p&gt;&lt;FONT face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;&lt;FONT face=Calibri&gt;D:\tools&amp;gt;cocreate {ED653D53-DA9A-35A8-B16E-6C8704AC432D}&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;Error: CoCreateInstance({ED653D53-DA9A-35A8-B16E-6C8704AC432D}) failed with hr=&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;0x80040154.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;FONT face=Calibri size=3&gt;Let’s add TestLib to CoCreate.exe’s dependency. &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;&lt;FONT face=Calibri&gt;D:\tools&amp;gt;more cocreate.exe.manifest&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&amp;lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&amp;lt;assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&amp;lt;assemblyIdentity&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;name="CoCreate"&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;version="0.0.0.0"&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;type="win32"/&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&amp;lt;dependency&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;dependentAssembly&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;assemblyIdentity&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;name="testlib"&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;version="0.0.0.0"&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;processorArchitecture="MSIL" /&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;/dependentAssembly&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&amp;lt;/dependency&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;&amp;lt;/assembly&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;o:p&gt;&lt;FONT face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;&lt;FONT face=Calibri&gt;D:\tools&amp;gt;cocreate {ED653D53-DA9A-35A8-B16E-6C8704AC432D}&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT face=Calibri&gt;Success!&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 9pt; LINE-HEIGHT: normal"&gt;&lt;FONT face=Calibri size=3&gt;Good job!&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=2111091" width="1" height="1"&gt;</description><enclosure url="http://blogs.msdn.com/junfeng/attachment/2111091.ashx" length="15418" type="application/x-zip-compressed" /><category domain="http://blogs.msdn.com/junfeng/archive/tags/.NetFramework/default.aspx">.NetFramework</category><category domain="http://blogs.msdn.com/junfeng/archive/tags/Fusion/default.aspx">Fusion</category><category domain="http://blogs.msdn.com/junfeng/archive/tags/Win32/default.aspx">Win32</category></item><item><title>How to tell if the current user is in administrators group programmatically</title><link>http://blogs.msdn.com/junfeng/archive/2007/01/26/how-to-tell-if-the-current-user-is-in-administrators-group-programmatically.aspx</link><pubDate>Sat, 27 Jan 2007 02:00:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1538904</guid><dc:creator>junfeng</dc:creator><slash:comments>7</slash:comments><comments>http://blogs.msdn.com/junfeng/comments/1538904.aspx</comments><wfw:commentRss>http://blogs.msdn.com/junfeng/commentrss.aspx?PostID=1538904</wfw:commentRss><wfw:comment>http://blogs.msdn.com/junfeng/rsscomments.aspx?PostID=1538904</wfw:comment><description>&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;You can use &lt;/FONT&gt;&lt;A href="http://msdn2.microsoft.com/en-us/library/aa376389.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/aa376389.aspx"&gt;&lt;FONT face=Calibri size=3&gt;CheckTokenMembership&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Calibri size=3&gt; (&lt;/FONT&gt;&lt;A href="http://msdn2.microsoft.com/en-us/library/aa376389.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/aa376389.aspx"&gt;&lt;FONT face=Calibri size=3&gt;http://msdn2.microsoft.com/en-us/library/aa376389.aspx&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Calibri size=3&gt;) to check whether a user is in administrators group. &lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;There is an example in the MSDN document. &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;The example will not work in Windows Vista. In Windows Vista, even if the user is in administrators group, the OS will create a filtered user token when user log on. The SID of administrators group is not included in the filtered user token. The full token is linked to the filtered user token, and can be retrieved with API &lt;/FONT&gt;&lt;A href="http://msdn2.microsoft.com/en-us/library/aa446671.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/aa446671.aspx"&gt;&lt;FONT face=Calibri size=3&gt;GetTokenInformation&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Calibri size=3&gt; with the new TokenLinkedToken information type. &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;The following is&amp;nbsp;the sample code. You need to download Vista SDK to compile it. Please make sure you read the article in the reference section.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;HRESULT IsUserAdmin(BOOL *pIsAdmin)&lt;BR&gt;{&lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;int b;&lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;HANDLE hProcess = NULL;&lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;HANDLE hProcessToken = NULL;&lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;HANDLE hLinkedToken = NULL;&lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;BOOL fIsAdmin = FALSE;&lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;DWORD dwLength = 0;&lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;OSVERSIONINFO osver = {sizeof(OSVERSIONINFO)};&lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;HRESULT hr = S_OK;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;*pIsAdmin = FALSE;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;// get handle to our process token&lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;hProcess = GetCurrentProcess();&lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;if (!OpenProcessToken(hProcess, TOKEN_QUERY, &amp;amp;hProcessToken))&lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;hr = HRESULT_FROM_WIN32(GetLastError());&lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;goto Exit;&lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;// get admin SID &lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;char AdminSID[SECURITY_MAX_SID_SIZE];&lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;dwLength = sizeof(AdminSID);&lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;if(!CreateWellKnownSid(WinBuiltinAdministratorsSid, NULL, &amp;amp;AdminSID, &amp;amp;dwLength)) &lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;hr = HRESULT_FROM_WIN32(GetLastError());&lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;goto Exit;&lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;} &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;// check to see if the current token contains admin SID&lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;if (!CheckTokenMembership( NULL, &amp;amp;AdminSID, &amp;amp;fIsAdmin)) &lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;hr = HRESULT_FROM_WIN32(GetLastError());&lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;goto Exit;&lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;if (fIsAdmin) &lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;// printf("The user is in admin group, and the process is elevated.\n");&lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;*pIsAdmin = TRUE;&lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;goto Exit;&lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;// if the current token does not contain admin SID, it does not mean &lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;// that the current user is not admin. In Vista by default the token of &lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;// users in administrator group has the the admin SID filtered. We nee&lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;// to use the unfiltered token to do the check. &lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;if (!GetVersionEx(&amp;amp;osver))&lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;hr = HRESULT_FROM_WIN32(GetLastError());&lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;goto Exit;&lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;// XP and below, we are done.&lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;if (osver.dwMajorVersion &amp;lt; 6) &lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;// printf("The user is not in admin group.\n");&lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;goto Exit;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-INDENT: 9pt"&gt;&lt;FONT face=Calibri size=3&gt;// get handle to linked token (will have one if we are lua)&lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;if (!GetTokenInformation(&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;hProcessToken,&lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;TokenLinkedToken,&lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;(VOID*) &amp;amp;hLinkedToken,&lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;sizeof(HANDLE),&lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;amp;dwLength) )&lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;b = GetLastError();&lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;if&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;(&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;b == ERROR_NO_SUCH_LOGON_SESSION&lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&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 style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;b == ERROR_PRIVILEGE_NOT_HELD)&lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&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;// printf("The user is not in admin group.\n");&lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&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;goto Exit;&lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;hr = HRESULT_FROM_WIN32(b); // a real error&lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;goto Exit;&lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;} &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;if (!CheckTokenMembership(&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;hLinkedToken, &amp;amp;AdminSID, &amp;amp;fIsAdmin))&lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;hr = HRESULT_FROM_WIN32(GetLastError());&lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;goto Exit;&lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;if (fIsAdmin)&lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;// printf("The user is in admin group, and the process is not elevated.\n");&lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;*pIsAdmin = TRUE;&lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;else &lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;// printf("The user is not in admin group.\n");&lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;Exit:&lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;if (hProcess) &lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;CloseHandle(hProcess);&lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;if (hProcessToken)&lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;CloseHandle(hProcessToken);&lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;if (hLinkedToken)&lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;CloseHandle(hLinkedToken);&lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;return hr;&lt;BR&gt;}&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;Reference:&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;SPAN style="COLOR: black"&gt;&lt;A href="http://msdn.microsoft.com/msdnmag/issues/07/01/UAC/default.aspx"&gt;&lt;FONT face=Calibri size=3&gt;Teach Your Apps To Play Nicely With Windows Vista User Account Control&lt;/FONT&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1538904" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/junfeng/archive/tags/Win32/default.aspx">Win32</category></item><item><title>Debugging LoadLibrary Failures</title><link>http://blogs.msdn.com/junfeng/archive/2006/11/20/debugging-loadlibrary-failures.aspx</link><pubDate>Mon, 20 Nov 2006 19:00:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1092363</guid><dc:creator>junfeng</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/junfeng/comments/1092363.aspx</comments><wfw:commentRss>http://blogs.msdn.com/junfeng/commentrss.aspx?PostID=1092363</wfw:commentRss><wfw:comment>http://blogs.msdn.com/junfeng/rsscomments.aspx?PostID=1092363</wfw:comment><description>&lt;P&gt;LoadLibrary is one of the mostly used yet unbelieveably complex APIs in Windows, if not the one. Russ Osterlund&amp;nbsp;has a full MSDN article &lt;A href="http://msdn.microsoft.com/msdnmag/issues/02/03/Loader/"&gt;&lt;FONT color=#003399&gt;discussing LoadLibrary&lt;/FONT&gt;&lt;/A&gt;, yet he only touches the surface of the problem (how it works under normal condition.) &lt;A href="http://blogs.msdn.com/mgrier"&gt;&lt;FONT color=#003399&gt;Mike Grier&lt;/FONT&gt;&lt;/A&gt; is one of the most talented developers I have worked with in Microsoft. He devoted a full series on &lt;A href="http://blogs.msdn.com/mgrier/archive/2005/06/18/430402.aspx"&gt;&lt;FONT color=#003399&gt;the intricacy&amp;nbsp;of LoadLibrary&lt;/FONT&gt;&lt;/A&gt;. Yet he has to put it to a halt due to the complexity of the problem. &lt;/P&gt;
&lt;P&gt;For developers that outside of the loader team, they don't have to understand all the intricacy of LoadLibrary (though they do need to understand how it works, the dos and don'ts of LoadLibrary, etc.). But then LoadLibrary fails, they do need to figure out why it fails. There are times that this is just hard to figure out why, especially when the binary depends on other dlls that they don't have source code available. &lt;/P&gt;
&lt;P&gt;Fortunately, the loader team recognized the problem, and provided a built-in trace log to debug obsure LoadLibrary failures. The trace log is called "loader snaps" internally. &lt;/P&gt;
&lt;P&gt;You can turn on loader snaps using gflags.exe. gflags.exe is part of Debugging Tools for Windows. You can download it from &lt;A title=http://www.microsoft.com/whdc/devtools/debugging/default.mspx href="http://www.microsoft.com/whdc/devtools/debugging/default.mspx"&gt;&lt;FONT color=#003399&gt;http://www.microsoft.com/whdc/devtools/debugging/default.mspx&lt;/FONT&gt;&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;To enable loader snaps, run "gflags.exe -i your-app-without-path.exe +sls"&lt;/P&gt;
&lt;P&gt;You have to run your application under debugger to see the loader snaps. You can use debuggers in the Debugging Tools for Windows package. An example is shown at the bottom of this article. &lt;/P&gt;
&lt;P&gt;If there is any failures, you will see "failed" in loader snaps. &lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT color=#0000cc&gt;Be warned that loader snaps may have enormous output. You may want to isolate the problem before turning on loader snaps. &lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;gflags.exe can also turn on all kinds of debugging capabilities, please refer to MSDN &lt;A title=http://technet2.microsoft.com/WindowsServer/en/library/00d4872f-eeb3-4a6e-910a-299ad55aed631033.mspx?mfr=true href="http://technet2.microsoft.com/WindowsServer/en/library/00d4872f-eeb3-4a6e-910a-299ad55aed631033.mspx?mfr=true"&gt;&lt;FONT color=#003399&gt;http://technet2.microsoft.com/WindowsServer/en/library/00d4872f-eeb3-4a6e-910a-299ad55aed631033.mspx?mfr=true&lt;/FONT&gt;&lt;/A&gt;&amp;nbsp;for more information. &lt;/P&gt;
&lt;P&gt;An example of loader snaps:&lt;/P&gt;
&lt;P&gt;D:\Tools&amp;gt;c:\debuggers\cdb loadlib svn-win32-1.4.2\bin\ssleay32.dll 
&lt;P&gt;Microsoft (R) Windows Debugger Version 6.6.0007.5&lt;BR&gt;Copyright (c) Microsoft Corporation. All rights reserved. 
&lt;P&gt;CommandLine: loadlib svn-win32-1.4.2\bin\ssleay32.dll&lt;BR&gt;Symbol search path is: *** Invalid ***&lt;BR&gt;****************************************************************************&lt;BR&gt;* Symbol loading may be unreliable without a symbol search path. *&lt;BR&gt;* Use .symfix to have the debugger choose a symbol path. *&lt;BR&gt;* After setting your symbol path, use .reload to refresh symbol locations. *&lt;BR&gt;****************************************************************************&lt;BR&gt;Executable search path is:&lt;BR&gt;ModLoad: 00400000 0040a000 image00400000&lt;BR&gt;ModLoad: 7c900000 7c9b0000 ntdll.dll&lt;BR&gt;ModLoad: 7c800000 7c8f4000 C:\WINDOWS\system32\kernel32.dll&lt;BR&gt;(b1c.f94): Break instruction exception - code 80000003 (first chance)&lt;BR&gt;eax=00241ea4 ebx=7ffd3000 ecx=00000000 edx=00000001 esi=00241f18 edi=00241ea4&lt;BR&gt;eip=7c901230 esp=0012fb20 ebp=0012fc94 iopl=0 nv up ei pl nz na po nc&lt;BR&gt;cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=00000202&lt;BR&gt;*** ERROR: Symbol file could not be found. Defaulted to export symbols for ntdl&lt;BR&gt;l.dll -&lt;BR&gt;ntdll!DbgBreakPoint:&lt;BR&gt;7c901230 cc int 3&lt;BR&gt;0:000&amp;gt; g&lt;BR&gt;[b1c,f94] LDR: Real INIT LIST for process D:\Tools\loadlib.exe pid 2844 0xb1c&lt;BR&gt;Loading library svn-win32-1.4.2\bin\ssleay32.dll...&lt;BR&gt;LDR: LdrLoadDll, loading svn-win32-1.4.2\bin\ssleay32.dll from D:\Tools;C:\WINDO&lt;BR&gt;WS\system32;C:\WINDOWS\system;C:\WINDOWS;.;c:\debuggers\winext\arcade;C:\WINDOWS&lt;BR&gt;\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\PROGRA~1\CA\SHARED~1\SCANEN~1;C&lt;BR&gt;:\PROGRA~1\CA\ETRUST~1;C:\Program Files\ATI Technologies\ATI Control Panel;C:\Pr&lt;BR&gt;ogram Files\Common Files\Roxio Shared\DLLShared;C:\WINDOWS\system32\WindowsPower&lt;BR&gt;Shell\v1.0&lt;BR&gt;LDR: Loading (DYNAMIC, NON_REDIRECTED) D:\Tools\svn-win32-1.4.2\bin\ssleay32.dll 
&lt;P&gt;ModLoad: 10000000 10031000 D:\Tools\svn-win32-1.4.2\bin\ssleay32.dll&lt;BR&gt;&lt;STRONG&gt;&lt;FONT color=#ff0000&gt;LDR: LIBEAY32.dll used by ssleay32.dll&lt;BR&gt;LDR: LdrpResolveDllName - call to RtlDosSearchPath_U failed&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR&gt;DllName: "LIBEAY32.dll"&lt;BR&gt;Path: "D:\Tools;C:\WINDOWS\system32;C:\WINDOWS\system;C:\WINDOWS;.;c:\debugge&lt;BR&gt;rs\winext\arcade;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\PROG&lt;BR&gt;RA~1\CA\SHARED~1\SCANEN~1;C:\PROGRA~1\CA\ETRUST~1;C:\Program Files\ATI Technolog&lt;BR&gt;ies\ATI Control Panel;C:\Program Files\Common Files\Roxio Shared\DLLShared;C:\WI&lt;BR&gt;NDOWS\system32\WindowsPowerShell\v1.0"&lt;BR&gt;LDR: LdrpLoadImportModule - LdrpMapDll(00143278, LIBEAY32.dll, NULL, TRUE, 0, 00&lt;BR&gt;12F658) failed with status c0000135&lt;BR&gt;&lt;FONT color=#ff0000&gt;&lt;STRONG&gt;LDR: LdrpWalkImportTable - LdrpLoadImportModule failed on import LIBEAY32.dll wi&lt;BR&gt;th status c0000135&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR&gt;LDR: Unloading svn-win32-1.4.2\bin\ssleay32.dll due to error c0000135 walking im&lt;BR&gt;port descriptors&lt;BR&gt;LDR: UNINIT LIST&lt;BR&gt;(1) [ssleay32.dll] D:\Tools\svn-win32-1.4.2\bin\ssleay32.dll (0) deini&lt;BR&gt;t 0&lt;BR&gt;LDR: Unmapping [ssleay32.dll]&lt;BR&gt;LoadLibrary failed with GetLastError() = 126&lt;BR&gt;LDR: LdrGetDllHandle, searching for mscoree.dll from&lt;BR&gt;LDR: LdrGetDllHandle, searching for mscoree.dll from D:\Tools;C:\WINDOWS\system3&lt;BR&gt;2;C:\WINDOWS\system;C:\WINDOWS;.;c:\debuggers\winext\arcade;C:\WINDOWS\system32;&lt;BR&gt;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\PROGRA~1\CA\SHARED~1\SCANEN~1;C:\PROGRA~1&lt;BR&gt;\CA\ETRUST~1;C:\Program Files\ATI Technologies\ATI Control Panel;C:\Program File&lt;BR&gt;s\Common Files\Roxio Shared\DLLShared;C:\WINDOWS\system32\WindowsPowerShell\v1.0 
&lt;P&gt;LDR: PID: 0xb1c finished - 'loadlib svn-win32-1.4.2\bin\ssleay32.dll'&lt;BR&gt;eax=0012faa0 ebx=00000000 ecx=0000e6dc edx=0012fb4d esi=7c90e88e edi=00000001&lt;BR&gt;eip=7c90eb94 esp=0012fdb8 ebp=0012feb4 iopl=0 nv up ei pl zr na pe nc&lt;BR&gt;cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=00000246&lt;BR&gt;ntdll!KiFastSystemCallRet:&lt;BR&gt;7c90eb94 c3 ret&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1092363" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/junfeng/archive/tags/Win32/default.aspx">Win32</category></item><item><title>Touch the exe, after you added a manifest for it, in Vista</title><link>http://blogs.msdn.com/junfeng/archive/2006/10/25/touch-the-exe-after-you-added-a-manifest-for-it-in-vista.aspx</link><pubDate>Wed, 25 Oct 2006 18:00:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:871518</guid><dc:creator>junfeng</dc:creator><slash:comments>6</slash:comments><comments>http://blogs.msdn.com/junfeng/comments/871518.aspx</comments><wfw:commentRss>http://blogs.msdn.com/junfeng/commentrss.aspx?PostID=871518</wfw:commentRss><wfw:comment>http://blogs.msdn.com/junfeng/rsscomments.aspx?PostID=871518</wfw:comment><description>&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;SPAN style="FONT-SIZE: 12pt; LINE-HEIGHT: 115%"&gt;&lt;FONT face=Calibri&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;SPAN style="FONT-SIZE: 12pt; LINE-HEIGHT: 115%"&gt;&lt;FONT face=Calibri&gt;You are an enthusiastic and responsible developer. You love programming, and you love programming the right way. &lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;SPAN style="FONT-SIZE: 12pt; LINE-HEIGHT: 115%"&gt;&lt;FONT face=Calibri&gt;So you get the latest and greatest Windows Vista. You try your hard-worked amazing.exe application in Vista. Did not work. Apparently, amazing.exe needs admin privilege to do wonderful things. But in Vista, the user by default does not have admin privilege. &lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;SPAN style="FONT-SIZE: 12pt; LINE-HEIGHT: 115%"&gt;&lt;FONT face=Calibri&gt;You did your research. You understand that you need to add a manifest to your application, and declare that the application requires administrator in the manifest. So you added amazing.exe.manifest, and put it next to amazing.exe. &lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;SPAN style="FONT-SIZE: 12pt; LINE-HEIGHT: 115%"&gt;&lt;FONT face=Calibri&gt;Did not work. Amazing.exe did not get admin privilege. &lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;SPAN style="FONT-SIZE: 12pt; LINE-HEIGHT: 115%"&gt;&lt;FONT face=Calibri&gt;You double checked the syntax of the manifest. Yes, it is right. You compared it to another working example. Yes, they are the same. You run amazing.exe again. Still did not work. &lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;SPAN style="FONT-SIZE: 12pt; LINE-HEIGHT: 115%"&gt;&lt;FONT face=Calibri&gt;You are angry. What is going on, Microsoft?&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;SPAN style="FONT-SIZE: 12pt; COLOR: #0070c0; LINE-HEIGHT: 115%"&gt;&lt;FONT face=Calibri&gt;The truth is, in Windows Vista, in order to improve CreateProcess performance, we cache the fact that an exe has manifest or not. The key to this cache, are the full path of the exe, and the last modified time of the exe file. &lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;SPAN style="FONT-SIZE: 12pt; LINE-HEIGHT: 115%"&gt;&lt;FONT face=Calibri&gt;After you execute the exe without manifest, when you add a manifest to the exe, in order for the OS to see the manifest, you need to change the last modified time of the exe (or simply say, &lt;/FONT&gt;&lt;A href="http://www.helge.mynetcologne.de/touch/index.htm"&gt;&lt;FONT face=Calibri&gt;touch&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Calibri&gt; the exe), to invalidate the cache entry for the exe. &lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;SPAN style="FONT-SIZE: 12pt; LINE-HEIGHT: 115%"&gt;&lt;FONT face=Calibri&gt;The cache only exists in memory, and is never flushed to disk. On reboot the cache starts clean.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;SPAN style="FONT-SIZE: 12pt; LINE-HEIGHT: 115%"&gt;&lt;FONT face=Calibri&gt;At the time we did the work, our measurement shows that the cache improved CreateProcess performance by 10-15% in warm case, when the application does not have manifest. &lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="FONT-SIZE: 12pt; COLOR: red; LINE-HEIGHT: 115%"&gt;&lt;FONT face=Calibri&gt;So remember, touch the exe, after you added a manifest for it, in Vista.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=871518" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/junfeng/archive/tags/Fusion/default.aspx">Fusion</category><category domain="http://blogs.msdn.com/junfeng/archive/tags/Win32/default.aspx">Win32</category><category domain="http://blogs.msdn.com/junfeng/archive/tags/Vista/default.aspx">Vista</category></item><item><title>Application Shutdown Changes in Windows Vista</title><link>http://blogs.msdn.com/junfeng/archive/2006/10/19/application-shutdown-changes-in-windows-vista.aspx</link><pubDate>Thu, 19 Oct 2006 22:00:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:845325</guid><dc:creator>junfeng</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/junfeng/comments/845325.aspx</comments><wfw:commentRss>http://blogs.msdn.com/junfeng/commentrss.aspx?PostID=845325</wfw:commentRss><wfw:comment>http://blogs.msdn.com/junfeng/rsscomments.aspx?PostID=845325</wfw:comment><description>&lt;P&gt;MSDN documented the Windows Vista changes regarding application shutdown. &lt;/P&gt;
&lt;P&gt;&lt;A href="http://windowssdk.msdn.microsoft.com/en-us/library/ms700677(VS.80).aspx" mce_href="http://windowssdk.msdn.microsoft.com/en-us/library/ms700677(VS.80).aspx"&gt;http://windowssdk.msdn.microsoft.com/en-us/library/ms700677(VS.80).aspx&lt;/A&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=845325" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/junfeng/archive/tags/Win32/default.aspx">Win32</category><category domain="http://blogs.msdn.com/junfeng/archive/tags/Vista/default.aspx">Vista</category></item><item><title>Programmatically determine if an application requires elevation in Windows Vista</title><link>http://blogs.msdn.com/junfeng/archive/2006/10/18/programmatically-determine-if-an-application-requires-elevation-in-windows-vista.aspx</link><pubDate>Wed, 18 Oct 2006 18:00:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:838030</guid><dc:creator>junfeng</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/junfeng/comments/838030.aspx</comments><wfw:commentRss>http://blogs.msdn.com/junfeng/commentrss.aspx?PostID=838030</wfw:commentRss><wfw:comment>http://blogs.msdn.com/junfeng/rsscomments.aspx?PostID=838030</wfw:comment><description>&lt;P&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'; mso-bidi-font-family: Arial; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin"&gt;In Windows Vista, by default, application will execute without administrator privilege, even when the user launching the application is part of the administrators group. &lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'; mso-bidi-font-family: Arial; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin"&gt;You can explicitly&amp;nbsp;elevate the application with administrator privilege using the shell "Runas" verb. &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'; mso-bidi-font-family: Arial; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin"&gt;There are some cases the OS will decide to launch the application as elevated by default. The decision points are:&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'; mso-bidi-font-family: Arial; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin"&gt;1. If the application has a manifest that explicitly asks for&amp;nbsp;administrator privilege.&amp;nbsp;&lt;BR&gt;2. The application is one of the well known setup installers.&amp;nbsp;&amp;nbsp;&lt;BR&gt;3. Application Compatibility testing reveals that the application requires admin privilege. &lt;BR&gt;4. A certain heuristics to determine if the application is an installer. For example, if the application name contains "setup" or "installer", it is a good indication that the application is an installer, thus requires administrator privilege. &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;There are times you may want to know if the OS will decide to launch the application elevated. For example, you may want to warn user before launch the application. &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;There is no direct API for this. But there is an alternative way to determine so:&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;Call &lt;SPAN style="COLOR: #0070c0"&gt;CreateProcess&lt;/SPAN&gt;() with dwCreationFlags as CREATE_SUSPENDED. If the application requires elevation, CreateProcess will fail, and GetLastError() will return &lt;SPAN style="COLOR: red"&gt;ERROR_ELEVATION_REQUIRED&lt;/SPAN&gt;. &lt;/FONT&gt;&lt;/FONT&gt;&lt;/B&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=838030" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/junfeng/archive/tags/Win32/default.aspx">Win32</category><category domain="http://blogs.msdn.com/junfeng/archive/tags/Vista/default.aspx">Vista</category></item><item><title>Run/RunOnce/RunOnceEx Registry Key</title><link>http://blogs.msdn.com/junfeng/archive/2006/09/19/761765.aspx</link><pubDate>Wed, 20 Sep 2006 01:00:41 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:761765</guid><dc:creator>junfeng</dc:creator><slash:comments>5</slash:comments><comments>http://blogs.msdn.com/junfeng/comments/761765.aspx</comments><wfw:commentRss>http://blogs.msdn.com/junfeng/commentrss.aspx?PostID=761765</wfw:commentRss><wfw:comment>http://blogs.msdn.com/junfeng/rsscomments.aspx?PostID=761765</wfw:comment><description>&lt;p&gt;Run\RunOnce\RunOnceEx are documented ways to automatically run certain tasks when system startup or a user logs in. &lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Run\RunOnce keys are documented here:&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&lt;em&gt;Run and RunOnce Registry Keys&lt;br&gt;&lt;/em&gt;&lt;a href="http://windowssdk.msdn.microsoft.com/en-us/library/ms723554.aspx"&gt;&lt;em&gt;http://windowssdk.msdn.microsoft.com/en-us/library/ms723554.aspx&lt;/em&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;RunOnceEx is documented here:&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&lt;em&gt;Syntax for the RunOnceEx Registry Key&lt;br&gt;&lt;/em&gt;&lt;a href="http://support.microsoft.com/default.aspx?kbid=232509"&gt;&lt;em&gt;http://support.microsoft.com/default.aspx?kbid=232509&lt;/em&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;&lt;em&gt;&amp;nbsp;&lt;/em&gt;&lt;/p&gt; &lt;p&gt;&lt;em&gt;Description of the RunOnceEx Registry Key&lt;br&gt;&lt;/em&gt;&lt;a href="http://support.microsoft.com/kb/310593"&gt;&lt;em&gt;http://support.microsoft.com/kb/310593&lt;/em&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;You can also specify RunOnce when install device drivers&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&lt;em&gt;KB 281820: INFO: Specifying RunOnce in Device INF Files&lt;br&gt;&lt;/em&gt;&lt;a href="http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q281820"&gt;&lt;em&gt;http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q281820&lt;/em&gt;&lt;/a&gt;&lt;em&gt; &lt;/em&gt; &lt;p&gt;&amp;nbsp;  &lt;p&gt;&lt;strong&gt;&lt;font color="#ff0000"&gt;Be careful about RunOnce registry key: It may run before system restart. &lt;/font&gt;&lt;/strong&gt; &lt;p&gt;&amp;nbsp;  &lt;p&gt;According to KB 281829, RunOnce registry key will run in the following cases:  &lt;p&gt;&amp;nbsp;  &lt;p&gt;&lt;em&gt;1. At the end of installation through &lt;b&gt;InstallFromHinfSection&lt;/b&gt; even in the cases where you must restart the computer.&lt;/em&gt;  &lt;p&gt;&lt;em&gt;2. After the default processing of DIF_INSTALLDEVICE even if you must restart the computer (with the exception of server-side processing). &lt;/em&gt; &lt;p&gt;&lt;em&gt;3. After the system has been restarted.&lt;/em&gt;  &lt;p&gt;&amp;nbsp;  &lt;p&gt;This means, RunOnce registry key entries may be executed immediately after a device driver installation, which may happen at any given time.  &lt;p&gt;&amp;nbsp;  &lt;p&gt;If your RunOnce entry needs to be executed after certain event, make sure you write the RunOnce registry key after the event, or if you cannot do so, use RunOnceEx. Otherwise you may experience random failures.  &lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=761765" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/junfeng/archive/tags/Win32/default.aspx">Win32</category></item><item><title>Windows XP may reboot when encounter certain manifest files</title><link>http://blogs.msdn.com/junfeng/archive/2006/09/14/753563.aspx</link><pubDate>Thu, 14 Sep 2006 11:11:53 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:753563</guid><dc:creator>junfeng</dc:creator><slash:comments>4</slash:comments><comments>http://blogs.msdn.com/junfeng/comments/753563.aspx</comments><wfw:commentRss>http://blogs.msdn.com/junfeng/commentrss.aspx?PostID=753563</wfw:commentRss><wfw:comment>http://blogs.msdn.com/junfeng/rsscomments.aspx?PostID=753563</wfw:comment><description>&lt;p&gt;If you are developing applications for Windows Vista using Visual Studio 2005, and you are adding Vista UAC manifest to your application, when your application runs on Windows XP with Service Pack 2 or Windows Server 2003 RTM (without SP1), Windows may reboot unexpectly. &lt;/p&gt; &lt;p&gt;This is due to a bug in Sxs.dll that it improperly handles duplicated namespaces in the same XML element. The following is an example of the problematic XML file:&lt;/p&gt; &lt;p&gt;&lt;em&gt;&lt;font color="#0000ff"&gt;&amp;lt;assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"&amp;gt; &lt;br&gt;&amp;lt;assemblyIdentity version="1.0.0.0" processorArchitecture="X86" name="MyApp" type="win32"&amp;gt; &amp;lt;/assemblyIdentity&amp;gt; &lt;br&gt;&amp;lt;dependency&amp;gt; &lt;br&gt;&amp;lt;dependentAssembly&amp;gt; &lt;br&gt;&amp;lt;assemblyIdentity type="win32" name="Microsoft.VC80.CRT" version="8.0.50608.0" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"&amp;gt; &amp;lt;/assemblyIdentity&amp;gt; &lt;br&gt;&amp;lt;/dependentAssembly&amp;gt; &lt;br&gt;&amp;lt;/dependency&amp;gt;&lt;br&gt;&amp;lt;ms_asmv3:trustInfo xmlns:ms_asmv3="urn:schemas-microsoft-com:asm.v3" &lt;font color="#ff0000"&gt;xmlns="urn:schemas-microsoft-com:asm.v3"&lt;/font&gt;&amp;gt; &lt;br&gt;&amp;lt;ms_asmv3:security xmlns:ms_asmv3="urn:schemas-microsoft-com:asm.v3"&amp;gt; &lt;br&gt;&amp;lt;requestedPrivileges&amp;gt; &lt;br&gt;&amp;lt;requestedExecutionLevel level="requireAdministrator" uiAccess="false"&amp;gt; &lt;br&gt;&amp;lt;/requestedExecutionLevel&amp;gt; &lt;br&gt;&amp;lt;/requestedPrivileges&amp;gt; &lt;br&gt;&amp;lt;/ms_asmv3:security&amp;gt; &lt;br&gt;&amp;lt;/ms_asmv3:trustInfo&amp;gt; &lt;br&gt;&amp;lt;/assembly&amp;gt;&lt;/font&gt;&lt;/em&gt;&lt;/p&gt; &lt;p&gt;Notice there are two namespaces for element trustInfo, and they are duplicate. &lt;/p&gt; &lt;p&gt;To workaround this bug, remove one of the duplicated namespaces (for example, remove the namespace in red). &lt;/p&gt; &lt;p&gt;A hotfix is available in &lt;a href="http://support.microsoft.com/kb/921337"&gt;http://support.microsoft.com/kb/921337&lt;/a&gt;. &lt;/p&gt; &lt;p&gt;This bug is fixed in Windows Server 2003 SP1 and Windows Vista. &lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=753563" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/junfeng/archive/tags/Fusion/default.aspx">Fusion</category><category domain="http://blogs.msdn.com/junfeng/archive/tags/Win32/default.aspx">Win32</category></item></channel></rss>