<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-8643966532123751496</id><updated>2024-09-05T10:25:03.789+02:00</updated><category term=".NET Profiling API"/><category term="Windows"/><category term=".NETCF"/><category term="C++"/><category term=".NET"/><category term="dotTrace"/><category term="x64"/><category term="C#"/><category term="Windows Mobile"/><category term="x86"/><category term="VS2008"/><category term="VS2012"/><category term="Exception"/><category term="VS2010"/><category term="WinRT"/><category term="Алгоритмы"/><category term="VS2005"/><category term="ARM"/><category term="Authentication"/><category term="CLR v4.0 Attach"/><category term="IL"/><category term="Lock Free"/><category term="MSBuild"/><category term="Remoting"/><category term="Silverlight"/><category term="Stack Walker"/><category term="UAC"/><category term="VS2003"/><category term="VS2013"/><category term="ARM64"/><category term="Apple"/><category term="AppleSIlicon"/><category term="C++11"/><category term="Development Server"/><category term="ETW"/><category term="Hg"/><category term="IE"/><category term="M1"/><category term="MSDN"/><category term="Mercurial"/><category term="Metadata"/><category term="PowerShell"/><category term="Structured Exception"/><category term="SyntaxHighlighter"/><category term="Trampoline"/><category term="WinDbg"/><category term="Windows Services"/><category term="XAML"/><category term="dotCover"/><title type='text'>I work without regaining consciousness</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://workblog.pilin.name/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8643966532123751496/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://workblog.pilin.name/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/8643966532123751496/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>94</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8643966532123751496.post-7519009442627417414</id><published>2020-11-25T17:24:00.006+01:00</published><updated>2020-11-25T17:42:51.371+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Apple"/><category scheme="http://www.blogger.com/atom/ns#" term="AppleSIlicon"/><category scheme="http://www.blogger.com/atom/ns#" term="ARM64"/><category scheme="http://www.blogger.com/atom/ns#" term="M1"/><title type='text'>How to revive Apple Silicon M1 after the &quot;Failed to personalize the software update&quot; error.</title><content type='html'>&lt;p&gt;I was tried to reset Apple Silicon M1 computers. I have both MacBook Pro and Mac Mini. Unexpectedly, I always got the &quot;Failed to personalize the software update&quot; error every time at the end of clean Big Sur 11.0.1 installation. I tried to user all ways to recover:
&lt;ul&gt;
&lt;li&gt;The recovery mode&lt;/li&gt;
&lt;li&gt;The bootable USB installer. See &lt;a href=&quot;https://support.apple.com/en-us/HT201372&quot; target=&quot;_blank&quot;&gt;link #1&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;The device firmware update (DFU) with Apple Configurator 2 on an another Mac. See &lt;a href=&quot;https://support.apple.com/guide/apple-configurator-2/revive-or-restore-a-mac-with-apple-silicon-apdd5f3c75ad/mac&quot; target=&quot;_blank&quot;&gt;link #1&lt;/a&gt;, &lt;a href=&quot;https://mrmacintosh.com/restore-macos-firmware-on-an-apple-silicon-mac-boot-to-dfu-mode/&quot; target=&quot;_blank&quot;&gt;link #2&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
Unfortunately, Nothing above helped.&lt;/p&gt;
&lt;p&gt;I got a piece of progress when I disconnect my MacBook Pro from Apple Id. I got the &quot;Erase Mac&quot; dialog which really helps to recover my MacBook Pro. I failed when I did the reset again because no &quot;Erase Mac&quot; dialog was appeared. The problem is that i can&#39;t find the &quot;Erase Mac&quot; menu item in recovery.&lt;/p&gt;
&lt;p&gt;The question is how to induce &quot;Erase Mac&quot; dialog. After a day of investigations I found the way on ... apple website: &lt;a href=&quot;https://support.apple.com/en-us/HT211983&quot; target=&quot;_blank&quot;&gt;https://support.apple.com/en-us/HT211983&lt;/a&gt; on items from #1 to #9.&lt;/p&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjG6lVRQIYslS25zzn6ZNMR2YK3_6RE-oQ_BLG4K528lWCVAzUQv1sUJbgFbQpKr1Txt4M4vf2A2Ewla4cvauXdS-5xLjf9R76-BtBMkENXYlo7xfgYUhsM3kJh726YphuSmApHchn7Ngem/s2048/IMG_20201125_125736.jpg&quot; style=&quot;display: block; padding: 1em 0; text-align: center; &quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; width=&quot;320&quot; data-original-height=&quot;1536&quot; data-original-width=&quot;2048&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjG6lVRQIYslS25zzn6ZNMR2YK3_6RE-oQ_BLG4K528lWCVAzUQv1sUJbgFbQpKr1Txt4M4vf2A2Ewla4cvauXdS-5xLjf9R76-BtBMkENXYlo7xfgYUhsM3kJh726YphuSmApHchn7Ngem/s320/IMG_20201125_125736.jpg&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOZaG8uugx0zJpRLHJIMbsODNMjXpjptnh-CfHlFjrz2e204tHGmSSTAaqZ2zeHNvyB11HP7U-HUrYaoBcyH8vftNcL7h__qzzq-kORdsQRKDPhnaJCR35ICVE7oE5AO7mqWW37cuIoru2/s2048/IMG_20201125_125813.jpg&quot; style=&quot;display: block; padding: 1em 0; text-align: center; &quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; width=&quot;320&quot; data-original-height=&quot;1536&quot; data-original-width=&quot;2048&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOZaG8uugx0zJpRLHJIMbsODNMjXpjptnh-CfHlFjrz2e204tHGmSSTAaqZ2zeHNvyB11HP7U-HUrYaoBcyH8vftNcL7h__qzzq-kORdsQRKDPhnaJCR35ICVE7oE5AO7mqWW37cuIoru2/s320/IMG_20201125_125813.jpg&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHhV_TZEh06CHEGioVpAF1BR3hPbrXrT-jSczsVKbYLcH4lBU5UlvdjyNDax-VeTpxJayGX4rxiMTMO1YzFXI9SfL-R57xXj-Z1lR5EpJNM8O85xJlcVjoruvplC97yb6qtRd9ee8FBaWu/s2048/IMG_20201125_125837.jpg&quot; style=&quot;display: block; padding: 1em 0; text-align: center; &quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; width=&quot;320&quot; data-original-height=&quot;1536&quot; data-original-width=&quot;2048&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHhV_TZEh06CHEGioVpAF1BR3hPbrXrT-jSczsVKbYLcH4lBU5UlvdjyNDax-VeTpxJayGX4rxiMTMO1YzFXI9SfL-R57xXj-Z1lR5EpJNM8O85xJlcVjoruvplC97yb6qtRd9ee8FBaWu/s320/IMG_20201125_125837.jpg&quot;/&gt;&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://workblog.pilin.name/feeds/7519009442627417414/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8643966532123751496/7519009442627417414' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8643966532123751496/posts/default/7519009442627417414'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8643966532123751496/posts/default/7519009442627417414'/><link rel='alternate' type='text/html' href='http://workblog.pilin.name/2020/11/how-to-revive-apple-silicon-m1-after.html' title='How to revive Apple Silicon M1 after the &quot;Failed to personalize the software update&quot; error.'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjG6lVRQIYslS25zzn6ZNMR2YK3_6RE-oQ_BLG4K528lWCVAzUQv1sUJbgFbQpKr1Txt4M4vf2A2Ewla4cvauXdS-5xLjf9R76-BtBMkENXYlo7xfgYUhsM3kJh726YphuSmApHchn7Ngem/s72-c/IMG_20201125_125736.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8643966532123751496.post-2724679674985519302</id><published>2017-01-18T11:21:00.002+01:00</published><updated>2017-02-09T12:14:22.268+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C++"/><category scheme="http://www.blogger.com/atom/ns#" term="VS2013"/><category scheme="http://www.blogger.com/atom/ns#" term="Windows"/><title type='text'>The unexpected behavior of std::mutex</title><content type='html'>Hi there, this time I would like to tell about the issue in Microsoft implementation of &lt;i&gt;std::mutex&lt;/i&gt; for VS2013. This night I spent in deep debugging trying to understand why my test is failing with &lt;i&gt;std::mutex&lt;/i&gt;. but isn&amp;#39;t failing with &lt;i&gt;boost::mutex&lt;/i&gt;. The only difference was in calling &lt;i&gt;DllMain()&lt;/i&gt; for my DLL. It was looked like somebody secretly called &lt;i&gt;LoadLibrary()&lt;/i&gt; during &lt;i&gt;std::mutex::lock()&lt;/i&gt;. I was very surprised when found that it&amp;#39;s truth (Important: our product has static linking with Microsoft CRT):
&lt;a href=&quot;http://workblog.pilin.name/2017/01/the-unexpected-behavior-of-stdmutex.html#more&quot;&gt;Read more »&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://workblog.pilin.name/feeds/2724679674985519302/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8643966532123751496/2724679674985519302' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8643966532123751496/posts/default/2724679674985519302'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8643966532123751496/posts/default/2724679674985519302'/><link rel='alternate' type='text/html' href='http://workblog.pilin.name/2017/01/the-unexpected-behavior-of-stdmutex.html' title='The unexpected behavior of std::mutex'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8643966532123751496.post-6292354361738430896</id><published>2016-10-26T00:13:00.002+02:00</published><updated>2016-10-31T12:46:58.856+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Trampoline"/><category scheme="http://www.blogger.com/atom/ns#" term="x64"/><category scheme="http://www.blogger.com/atom/ns#" term="x86"/><title type='text'>Trampolines for hooking</title><content type='html'>&lt;p&gt;Here I would like to show all variants of trampolines which I know.&lt;/p&gt;
&lt;h3&gt;32-bits Intel architecture (x86):&lt;/h3&gt;
&lt;pre class=&quot;brush:windbg_x86&quot;&gt;
; 5 code bytes
; relative addressing
; no registers modification
; EIP+78563412h == 0019fa9ah+78563412h == 78702each
0019fa95 e912345678 jmp 78702each
0019fa9a
&lt;/pre&gt;
&lt;pre class=&quot;brush:windbg_x86&quot;&gt;
; 6 code bytes
; absolute addressing
; no registers modification
0019fa95 6812345678 push 78563412h
0019fa9a c3         ret
0019fa9b
&lt;/pre&gt;
&lt;pre class=&quot;brush:windbg_x86&quot;&gt;
; 8 code bytes
; absolute addressing
; EAX value lost
0019fa95 c7c012345678 mov eax,78563412h
0019fa9b ffe0         jmp eax
0019fa9d
&lt;/pre&gt;
&lt;pre class=&quot;brush:windbg_x86&quot;&gt;
; 6 code bytes + 4 data bytes
; absolute addressing
; no registers modification
; data in execution code
; absolute data addressing
0019fa95 ff259bfa1900 jmp dword ptr ds:[19FA9Bh]
0019fa9b 12345678     dd  78563412h
0019fa9f
&lt;/pre&gt;

&lt;h3&gt;64-bits AMD architecture (amd64 / x86_64 / x64):&lt;/h3&gt;
&lt;pre class=&quot;brush:windbg_x64&quot;&gt;
; 14 code bytes
; absolute addressing
; no registers modification
00000000`0014f605 6812345678       push 78563412h
00000000`0014f60a c74424049abcdef0 mov  dword ptr [rsp+4],0F0DEBC9Ah 
00000000`0014f612 c3               ret
00000000`0014f613
&lt;/pre&gt;
&lt;pre class=&quot;brush:windbg_x64&quot;&gt;
; 6 code bytes
; absolute addressing in lower 4Gb
; no registers modification
00000000`0014f605 6812345678 push 78563412h
00000000`0014f60a c3         ret
00000000`0014f60b
&lt;/pre&gt;
&lt;pre class=&quot;brush:windbg_x64&quot;&gt;
; 12 code bytes
; absolute addressing
; change RAX (return value register)
00000000`0014f605 48b8123456789abcdef0 mov  rax,0F0DEBC9A78563412h
00000000`0014f60f ffe0                 jmp  rax
00000000`0014f611
&lt;/pre&gt;
&lt;pre class=&quot;brush:windbg_x64&quot;&gt;
; 13 code bytes
; absolute addressing
; change R11 (temporary register)
00000000`0014f605 49bb123456789abcdef0 mov r11,0F0DEBC9A78563412h
00000000`0014f60f 41ffe3               jmp r11
00000000`0014f612
&lt;/pre&gt;
&lt;pre class=&quot;brush:windbg_x64&quot;&gt;
; 6 code bytes + 8 data bytes in range RIP±2Gb
; absolute addressing
; no registers modification
; data in execution code
; relative data addressing
; RIP+00000000h == 00000000`0014f60bh+00000000h == 00000000`0014f60bh
00000000`0014f605 ff2500000000     jmp qword ptr [00000000`0014f60bh]
00000000`0014f60b 123456789abcdef0 dq  0F0DEBC9A78563412h
00000000`0014f613
&lt;/pre&gt;
&lt;pre class=&quot;brush:windbg_x64&quot;&gt;
; 5 code bytes
; relative addressing RIP±2Gb
; no registers modification
; EIP+78563412h == 00000000`0014f60ah+78563412h == 00000000`786b2a1ch
00000000`0014f605 e912345678 jmp 00000000`786b2a1ch
00000000`0014f60a
&lt;/pre&gt;
&lt;p&gt;P.S. Please let me know if you have new variant.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://workblog.pilin.name/feeds/6292354361738430896/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8643966532123751496/6292354361738430896' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8643966532123751496/posts/default/6292354361738430896'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8643966532123751496/posts/default/6292354361738430896'/><link rel='alternate' type='text/html' href='http://workblog.pilin.name/2016/10/full-address-space-jumps-for-hooks_26.html' title='Trampolines for hooking'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8643966532123751496.post-2372751433599310849</id><published>2016-07-09T12:21:00.002+02:00</published><updated>2016-07-09T12:45:12.831+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C++"/><category scheme="http://www.blogger.com/atom/ns#" term="C++11"/><title type='text'>Solve the &quot;no GUID has been associated with this object&quot; compiler error for __uuidof in templates instantinations</title><content type='html'>&lt;p&gt;As you know WinRT has C++ interfaces &lt;i&gt;ABI::Windows::Foundation::Collections::IIterable&lt;/i&gt; and &lt;i&gt;ABI::Windows::&lt;/i&gt;&lt;i&gt;Foundation&lt;/i&gt;&lt;i&gt;::Collections::IIterable&lt;/i&gt; to make iteration in collections universal. This is the very good idea, but you got interfaces with templates: (see &lt;i&gt;windows.foundation.collections.h&lt;/i&gt;):&lt;/p&gt;
&lt;pre class=&quot;brush:cpp&quot;&gt;namespace ABI {
namespace Windows {
namespace Foundation {
namespace Collections { 

    template &amp;lt;class T&amp;gt; 
    struct IIterator 
        : IIterator_impl&amp;lt;T&amp;gt;
        , detail::not_yet_specialized&amp;lt;IIterator&amp;lt;T&amp;gt;&amp;gt;
    {
    };

    template &amp;lt;class T&amp;gt; 
    struct IIterable
        : IIterable_impl&amp;lt;T&amp;gt;
        , detail::not_yet_specialized&amp;lt;IIterable&amp;lt;T&amp;gt;&amp;gt;
    {
    };

    template &amp;lt;class T, bool isStruct&amp;gt;
    struct IIterator_impl : IInspectable
    {
    private:
        typedef typename Windows::Foundation::Internal::GetAbiType&amp;lt;T&amp;gt;::type     T_abi;
        typedef typename Windows::Foundation::Internal::GetLogicalType&amp;lt;T&amp;gt;::type T_logical;
    public:
        typedef T                                                               T_complex;

        virtual /* propget */ HRESULT STDMETHODCALLTYPE get_Current(_Out_ T_abi *current) = 0;
        virtual /* propget */ HRESULT STDMETHODCALLTYPE get_HasCurrent(_Out_ boolean *hasCurrent) = 0;
        virtual HRESULT STDMETHODCALLTYPE MoveNext(_Out_ boolean *hasCurrent) = 0;
        virtual HRESULT STDMETHODCALLTYPE GetMany(_In_ unsigned capacity, _Out_writes_to_(capacity,*actual) T_abi *value, _Out_ unsigned *actual) = 0;
    };

    template &amp;lt;class T&amp;gt;
    struct IIterable_impl : IInspectable
    {
    private:
        typedef typename Windows::Foundation::Internal::GetAbiType&amp;lt;T&amp;gt;::type     T_abi;
        typedef typename Windows::Foundation::Internal::GetLogicalType&amp;lt;T&amp;gt;::type T_logical;
    public:
         typedef T                                                               T_complex;

        virtual HRESULT STDMETHODCALLTYPE First(_Outptr_result_maybenull_ IIterator&amp;lt;T_logical&amp;gt; **first) = 0;
    };

}}}}
&lt;/pre&gt;

&lt;a href=&quot;http://workblog.pilin.name/2016/07/solve-no-guid-has-been-associated-with.html#more&quot;&gt;Read more »&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://workblog.pilin.name/feeds/2372751433599310849/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8643966532123751496/2372751433599310849' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8643966532123751496/posts/default/2372751433599310849'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8643966532123751496/posts/default/2372751433599310849'/><link rel='alternate' type='text/html' href='http://workblog.pilin.name/2016/07/solve-no-guid-has-been-associated-with.html' title='Solve the &quot;no GUID has been associated with this object&quot; compiler error for __uuidof in templates instantinations'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8643966532123751496.post-8891268998638328031</id><published>2015-09-18T18:07:00.001+02:00</published><updated>2015-09-18T18:07:50.754+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term=".NET"/><title type='text'>How to load strong named assembly from the location out of application base directory to new application domain</title><content type='html'>I found the only one decision: dynamically generate the configuration file in temporary folder:
&lt;pre class=&quot;brush:xml&quot;&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;
&amp;lt;configuration&amp;gt;
  &amp;lt;runtime&amp;gt;
    &amp;lt;assemblyBinding xmlns=&amp;quot;urn:schemas-microsoft-com:asm.v1&amp;quot;&amp;gt;
      &amp;lt;dependentAssembly&amp;gt;
        &amp;lt;assemblyIdentity name=&amp;quot;YYY&amp;quot; culture=&amp;quot;&amp;quot; publicKeyToken=&amp;quot;0123456789012345&amp;quot; /&amp;gt;
        &amp;lt;codeBase version=&amp;quot;K.L.M.N&amp;quot; href=&amp;quot;file:///X:/XXX/YYY.DLL&amp;quot; /&amp;gt;
      &amp;lt;/dependentAssembly&amp;gt;
      &amp;lt;dependentAssembly&amp;gt;
        &amp;lt;assemblyIdentity name=&amp;quot;ZZZ&amp;quot; culture=&amp;quot;&amp;quot; publicKeyToken=&amp;quot;1234567890123456&amp;quot; /&amp;gt;
        &amp;lt;codeBase version=&amp;quot;A.B.C.D&amp;quot; href=&amp;quot;file:///X:/XXX/ZZZ.DLL&amp;quot; /&amp;gt;
      &amp;lt;/dependentAssembly&amp;gt;
    &amp;lt;/assemblyBinding&amp;gt;
  &amp;lt;/runtime&amp;gt;
&amp;lt;/configuration&amp;gt;
&lt;/pre&gt;

And set it to &lt;i&gt;AppDomainSetup.ConfigurationFile&lt;/i&gt;:
&lt;pre class=&quot;brush:csharp&quot;&gt;
var appDomain = AppDomain.CreateDomain(&quot;MyDomain&quot;, null, new AppDomainSetup
  {
    ConfigurationFile = configFile
  });
&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://workblog.pilin.name/feeds/8891268998638328031/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8643966532123751496/8891268998638328031' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8643966532123751496/posts/default/8891268998638328031'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8643966532123751496/posts/default/8891268998638328031'/><link rel='alternate' type='text/html' href='http://workblog.pilin.name/2015/09/how-to-load-strong-named-assembly-from.html' title='How to load strong named assembly from the location out of application base directory to new application domain'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8643966532123751496.post-1844674900631126100</id><published>2014-09-07T03:24:00.001+02:00</published><updated>2014-09-09T18:14:13.764+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Hg"/><category scheme="http://www.blogger.com/atom/ns#" term="Mercurial"/><category scheme="http://www.blogger.com/atom/ns#" term="PowerShell"/><category scheme="http://www.blogger.com/atom/ns#" term="Windows"/><title type='text'>Powershell script to close mercurial branches older then 60 days</title><content type='html'>GitHub &lt;a href=&quot;https://github.com/ww898/HgCloseOldBranches&quot;&gt;link&lt;/a&gt;
&lt;pre class=&quot;brush:powershell&quot;&gt;
# Close old branches for Mercurial
# Copyright (C) 2014  Mikhail Pilin
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see &amp;lt;http://www.gnu.org/licenses/&amp;gt;.

if ($PSVersionTable.PSVersion.Major -lt 3) {
  throw &amp;quot;PS Version $($PSVersionTable.PSVersion) is below 3.0.&amp;quot;
}

Set-StrictMode -Version Latest
$ErrorActionPreference = [System.Management.Automation.ActionPreference]::Stop
$script:VerbosePreference = &amp;quot;Continue&amp;quot;

$encoding = &amp;quot;cp866&amp;quot;
[System.TimeSpan]$alive = [System.TimeSpan]::FromDays(60)
[System.DateTime]$now = [System.DateTime]::Now

[System.Object]$current = &amp;amp; hg parent --encoding $encoding -T &amp;quot;{node} {branch}&amp;quot; | ForEach-Object {
    $result = $_ | Select-Object -Property node, name
    $parts = $_.Split(&#39; &#39;, 2)
    
    $result.node = $parts[0]
    $result.name = $parts[1]
    $result
  } | Select-Object

Write-Host &amp;quot;Current branch: &amp;quot; -nonewline
Write-Host -foregroundcolor gray $current.name

[System.Object[]]$branches = @(&amp;amp; hg head --encoding $encoding -T &amp;quot;{date(date,&#39;%Y%m%d%H%M%S&#39;)} {node} {branch}\n&amp;quot; | ForEach-Object {
    $result = $_ | Select-Object -Property date, node, name
    $parts = $_.Split(&#39; &#39;, 3)

    [System.DateTime]$result.date = [System.DateTime]::ParseExact($parts[0], &amp;quot;yyyyMMddHHmmss&amp;quot;, [System.Globalization.CultureInfo]::InvariantCulture)
    $result.node = $parts[1]
    $result.name = $parts[2]
    $result
  } | Where-Object { $now - $_.date -gt $alive } | Sort-Object -property date)

function EscapeBranchName
{
  Param([System.String]$name)
  $name.Replace(&#39;&amp;quot;&#39;, &#39;\&amp;quot;&#39;)
}

if ($branches.Length -eq 0) { Write-Host &amp;quot;No old branches were detected&amp;quot; } else {
  Write-Host &amp;quot;Closing $($branches.Length) old branches:&amp;quot;

  $branches | ForEach-Object {
      Write-Host &amp;quot;[$([System.String]::Format(&amp;quot;{0:%d}&amp;quot;, $now - $_.date)) days] &amp;quot; -nonewline
      Write-Host -foregroundcolor gray $_.name

      &amp;amp; hg debugsetparent $_.node | Out-Null
      if ($LastExitCode -ne 0) { Write-Warning &amp;quot;Failed to set node (exit code $LastExitCode).&amp;quot; } else {
        &amp;amp; hg branch $(EscapeBranchName $_.name) | Out-Null
        if ($LastExitCode -ne 0) { Write-Warning &amp;quot;Failed to set branch (exit code $LastExitCode).&amp;quot; } else {
          &amp;amp; hg commit --close-branch -X * -m $(&amp;quot;The branch was not used for {0:%d} days and closed automatically.&amp;quot; -f ($now - $_.date)) | Out-Null
          if ($LastExitCode -ne 0) { Write-Warning &amp;quot;Failed to commit (exit code $LastExitCode).&amp;quot; }
        }
      }
    }

  Write-Host &amp;quot;Restore current branch: &amp;quot; -nonewline
  Write-Host -foregroundcolor gray $current.name

  &amp;amp; hg debugsetparent $current.node | Out-Null
  if ($LastExitCode -ne 0) { Write-Warning &amp;quot;Failed to set node (exit code $LastExitCode).&amp;quot; } else {
    &amp;amp; hg branch $(EscapeBranchName $current.name) | Out-Null
    if ($LastExitCode -ne 0) { Write-Warning &amp;quot;Failed to set branch (exit code $LastExitCode).&amp;quot; }
  }
}&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://workblog.pilin.name/feeds/1844674900631126100/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8643966532123751496/1844674900631126100' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8643966532123751496/posts/default/1844674900631126100'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8643966532123751496/posts/default/1844674900631126100'/><link rel='alternate' type='text/html' href='http://workblog.pilin.name/2014/09/powershell-script-to-close-mercurial.html' title='Powershell script to close mercurial branches older then 60 days'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8643966532123751496.post-2417456654882244972</id><published>2014-03-02T03:12:00.001+01:00</published><updated>2016-07-09T12:26:07.430+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C++"/><category scheme="http://www.blogger.com/atom/ns#" term="Structured Exception"/><category scheme="http://www.blogger.com/atom/ns#" term="VS2012"/><category scheme="http://www.blogger.com/atom/ns#" term="VS2013"/><category scheme="http://www.blogger.com/atom/ns#" term="Windows"/><category scheme="http://www.blogger.com/atom/ns#" term="x64"/><category scheme="http://www.blogger.com/atom/ns#" term="x86"/><title type='text'>Decoding the parameters of a thrown C++ exception (0xE06D7363)</title><content type='html'>&lt;p&gt;I have a lot questions after reading the &lt;a href=&quot;http://blogs.msdn.com/b/oldnewthing/archive/2010/07/30/10044061.aspx&quot; target=&quot;_blank&quot;&gt;post&lt;/a&gt; about decoding structural exception 0xE06D7363 from &lt;a href=&quot;http://blogs.msdn.com/b/oldnewthing/&quot; target=&quot;_blank&quot;&gt;&amp;quot;The Old New Thing&amp;quot;&lt;/a&gt;. I like computer magic like that: take address from here add the constant two and half time and you get it. However, this magic don&amp;#39;t help to understand how it really works and what happened if I do that. So, following code from CRT kill all magic.&lt;/p&gt;&lt;a href=&quot;http://workblog.pilin.name/2014/03/decoding-parameters-of-thrown-c.html#more&quot;&gt;Read more »&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://workblog.pilin.name/feeds/2417456654882244972/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8643966532123751496/2417456654882244972' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8643966532123751496/posts/default/2417456654882244972'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8643966532123751496/posts/default/2417456654882244972'/><link rel='alternate' type='text/html' href='http://workblog.pilin.name/2014/03/decoding-parameters-of-thrown-c.html' title='Decoding the parameters of a thrown C++ exception (0xE06D7363)'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8643966532123751496.post-9096963664197283713</id><published>2013-11-06T17:16:00.002+01:00</published><updated>2013-11-06T17:24:06.724+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term=".NET"/><category scheme="http://www.blogger.com/atom/ns#" term="VS2003"/><category scheme="http://www.blogger.com/atom/ns#" term="Windows"/><title type='text'>How to install .NET Framework 1.1 on Windows 8.1</title><content type='html'>&lt;p&gt;After update from Windows 8.0 to Windows 8.1 I found that .NET Framework 1.1 was unexpectedly disappeared. Here I give you the tested way to return it back:
&lt;ul&gt;
&lt;li&gt;Download .NET Framework Cleanup Tool (product guide &lt;a href=&quot;http://blogs.msdn.com/b/astebner/archive/2008/08/28/8904493.aspx&quot;&gt;here&lt;/a&gt;) from following locations: &lt;a href=&quot;http://cid-27e6a35d1a492af7.skydrive.live.com/self.aspx/Blog_Tools/dotnetfx_cleanup_tool.zip&quot;&gt;here&lt;/a&gt; or &lt;a href=&quot;http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Components-PostAttachments/00-08-90-44-93/dotnetfx_5F00_cleanup_5F00_tool.zip&quot;&gt;here&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Unzip and run following commands:&lt;/br&gt;
&lt;pre class=&quot;brush:plain&quot;&gt;
cleanup_tool.exe /q:a /c:&quot;cleanup.exe /p .NET Framework 1.0&quot;
cleanup_tool.exe /q:a /c:&quot;cleanup.exe /p .NET Framework 1.1&quot;
&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;Following instructions were taken from &lt;a href=&quot;http://saranspot.blogspot.de/2009/02/installing-dotnet-framework-11-on.html&quot;&gt;here&lt;/a&gt;:
&lt;ul&gt;
&lt;li&gt;Create a new folder named DotNet in C:\ drive. (The path i used was C:\DotNet)&lt;/li&gt;
&lt;li&gt;Download &lt;a href=&quot;http://www.microsoft.com/Downloads/details.aspx?FamilyId=262D25E3-F589-4842-8157-034D1E7CF3A3&amp;amp;displaylang=en&quot;&gt;Microsoft .NET Framework 1.1 Redistributable Package&lt;/a&gt; (dotnetfx.exe). Make sure the setup file is saved as dotnetfx.exe.&lt;/li&gt;
&lt;li&gt;Download &lt;a href=&quot;http://www.microsoft.com/downloads/details.aspx?FamilyID=a8f5654f-088e-40b2-bbdb-a83353618b38&amp;amp;displaylang=en&quot;&gt;Microsoft .NET Framework 1.1 Service Pack 1&lt;/a&gt; (NDP1.1sp1-KB867460-X86.exe). Rename the file to dotnetfxsp1.exe.&lt;/li&gt;
&lt;li&gt;Copy both installation files into the same directory (i.e. C:\DotNet),.&lt;/li&gt;
&lt;li&gt;Open Command Prompt as Administrator.&lt;/li&gt;
&lt;li&gt;Change to the directory where the two installation files are stored, ie C:\DotNet.&lt;/li&gt;
&lt;li&gt;Run the following commands one by one:&lt;/br&gt;
&lt;pre class=&quot;brush:plain&quot;&gt;
dotnetfx.exe /c:&quot;msiexec.exe /a netfx.msi TARGETDIR=C:\DotNet&quot;
dotnetfxsp1.exe /Xp:C:\DotNet\netfxsp.msp
msiexec.exe /a c:\DotNet\netfx.msi /p c:\DotNet\netfxsp.msp
&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;Install Microsoft .Net Framework 1.1 with slipstreamed Service Pack 1 by running netfx.msi from the working folder.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/p&gt;
&lt;p&gt;Good luck!&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://workblog.pilin.name/feeds/9096963664197283713/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8643966532123751496/9096963664197283713' title='10 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8643966532123751496/posts/default/9096963664197283713'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8643966532123751496/posts/default/9096963664197283713'/><link rel='alternate' type='text/html' href='http://workblog.pilin.name/2013/11/how-to-install-net-framework-11-on.html' title='How to install .NET Framework 1.1 on Windows 8.1'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>10</thr:total><georss:featurename>Munich, Germany</georss:featurename><georss:point>48.1367203 11.576753999999937</georss:point><georss:box>47.9672328 11.254030499999937 48.3062078 11.899477499999938</georss:box></entry><entry><id>tag:blogger.com,1999:blog-8643966532123751496.post-8820790163130916986</id><published>2013-06-07T17:04:00.000+02:00</published><updated>2016-07-09T12:26:07.499+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C++"/><category scheme="http://www.blogger.com/atom/ns#" term="VS2010"/><category scheme="http://www.blogger.com/atom/ns#" term="VS2012"/><title type='text'>Tricky macro to add file name and line number in C++ operator new</title><content type='html'>&lt;p&gt;
Header file:
&lt;pre class=&quot;brush:cpp&quot;&gt;
#if defined(_DEBUG)
  #define _CRTDBG_MAP_ALLOC

  #include &amp;lt;crtdbg.h&amp;gt;

  extern __declspec(thread) char const * t_File;
  extern __declspec(thread) int t_Line;

  inline void * __CRTDECL operator new  (size_t const size) { return ::operator new  (size, _NORMAL_BLOCK, t_File, t_Line); }
  inline void * __CRTDECL operator new[](size_t const size) { return ::operator new[](size, _NORMAL_BLOCK, t_File, t_Line); }

  #define new (t_File = __FILE__, t_Line = __LINE__, false) ? nullptr : new
#endif
&lt;/pre&gt;
Source file:
&lt;pre class=&quot;brush:cpp&quot;&gt;
#if defined(_DEBUG)
  __declspec(thread) char const * t_File = &quot;???&quot;;
  __declspec(thread) int t_Line = 0;
#endif
&lt;/pre&gt;
&lt;/p&gt;
&lt;p&gt;This macro doesn&#39;t work with direct operator call like &lt;i&gt;&lt;b&gt;operator new(...)&lt;/b&gt;&lt;/i&gt; in code.&lt;/p&gt;
&lt;p&gt;P.S. This macro tested only on Visual Studio 2012&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://workblog.pilin.name/feeds/8820790163130916986/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8643966532123751496/8820790163130916986' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8643966532123751496/posts/default/8820790163130916986'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8643966532123751496/posts/default/8820790163130916986'/><link rel='alternate' type='text/html' href='http://workblog.pilin.name/2013/06/tricky-macro-to-add-file-name-and-line.html' title='Tricky macro to add file name and line number in C++ operator new'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8643966532123751496.post-2107516542780078196</id><published>2013-06-06T19:35:00.002+02:00</published><updated>2013-06-06T19:35:59.647+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ARM"/><category scheme="http://www.blogger.com/atom/ns#" term="VS2012"/><title type='text'>How to enable ARM support for desktop application in Visual Studio 2012?</title><content type='html'>&lt;p&gt;Just add following in your &lt;i&gt;.vcxproj&lt;/i&gt; file, somewhere at the beginning:
&lt;pre class=&quot;bush:xml&quot;&gt;
&amp;lt;PropertyGroup&amp;gt;
  &amp;lt;WindowsSDKDesktopARMSupport&amp;gt;true&amp;lt;/WindowsSDKDesktopARMSupport&amp;gt;
&amp;lt;/PropertyGroup&amp;gt;
&lt;/pre&gt;
&lt;/p&gt;
&lt;p&gt;
P.S. Surely Windows SDK for Windows 8 has to be installed.
&lt;/p&gt;
</content><link rel='replies' type='application/atom+xml' href='http://workblog.pilin.name/feeds/2107516542780078196/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8643966532123751496/2107516542780078196' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8643966532123751496/posts/default/2107516542780078196'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8643966532123751496/posts/default/2107516542780078196'/><link rel='alternate' type='text/html' href='http://workblog.pilin.name/2013/06/how-to-enable-arm-support-for-desktop.html' title='How to enable ARM support for desktop application in Visual Studio 2012?'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8643966532123751496.post-6369357292313237938</id><published>2013-03-26T21:09:00.000+01:00</published><updated>2013-03-26T21:09:29.884+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term=".NET Profiling API"/><title type='text'></title><content type='html'>The important difference between &lt;i&gt;ICorProfilerInfo::GetClassIDInfo()&lt;/i&gt; and &lt;i&gt;ICorProfilerInfo2::GetClassIDInfo2()&lt;/i&gt; is &lt;i&gt;CORPROF_E_CLASSID_IS_ARRAY&lt;/i&gt;. The first method never returns it.</content><link rel='replies' type='application/atom+xml' href='http://workblog.pilin.name/feeds/6369357292313237938/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8643966532123751496/6369357292313237938' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8643966532123751496/posts/default/6369357292313237938'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8643966532123751496/posts/default/6369357292313237938'/><link rel='alternate' type='text/html' href='http://workblog.pilin.name/2013/03/the-important-difference-between.html' title=''/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8643966532123751496.post-3917214273005754299</id><published>2013-03-07T22:02:00.002+01:00</published><updated>2013-03-07T22:12:39.049+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Windows"/><category scheme="http://www.blogger.com/atom/ns#" term="Windows Services"/><title type='text'>Service environment variables</title><content type='html'>&lt;p&gt;As you know &lt;i&gt;service.exe&lt;/i&gt; generates environment variables for service every time when it starts the new service process. It merges it&#39;s own environment with ones from different places such as: 
&lt;ul&gt;
&lt;li&gt;&lt;i&gt;HKLM\System\CurrentControlSet\Control\Session Manager\Environment&lt;/i&gt;&lt;/li&gt;
&lt;li&gt;&lt;i&gt;Environment&lt;/i&gt; key from &lt;i&gt;HKLM\SYSTEM\CurrentControlSet\Services\&lt;b&gt;YourService&lt;/b&gt;&lt;/i&gt;&lt;/li&gt;
&lt;li&gt;&lt;i&gt;AppEnvironment&lt;/i&gt; key from &lt;i&gt;HKLM\SYSTEM\CurrentControlSet\Services\&lt;b&gt;YourService&lt;/b&gt;\Parameters&lt;/i&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/p&gt;
&lt;p&gt;However, there are some not clear things with &lt;i&gt;service.exe&lt;/i&gt;. It doesn&#39;t work correctly with &lt;i&gt;REG_DWORD&lt;/i&gt;, but other part of Windows understand &lt;i&gt;REG_DWORD&lt;/i&gt; correctly. So, newer write &lt;i&gt;REG_DWORD&lt;/i&gt; values in &lt;i&gt;HKLM\System\CurrentControlSet\Control\Session Manager\Environment&lt;/i&gt;. Please use only &lt;i&gt;REG_SZ&lt;/i&gt;.&lt;/p&gt;
&lt;p&gt;
&lt;i&gt;service.exe&lt;/i&gt; got it&#39;s own environment variables at the system startup and doesn&#39;t change till shutdown. So, every service in system get the mix of current environment variables and environment variables from startup. So, it&#39;s impossible to delete environment variable if it was on system startup, but it&#39;s possible to overlap the value.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://workblog.pilin.name/feeds/3917214273005754299/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8643966532123751496/3917214273005754299' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8643966532123751496/posts/default/3917214273005754299'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8643966532123751496/posts/default/3917214273005754299'/><link rel='alternate' type='text/html' href='http://workblog.pilin.name/2013/03/service-environment-variables.html' title='Service environment variables'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8643966532123751496.post-8488394047855040543</id><published>2012-11-22T17:44:00.000+01:00</published><updated>2012-11-25T00:38:51.790+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="VS2003"/><category scheme="http://www.blogger.com/atom/ns#" term="VS2005"/><category scheme="http://www.blogger.com/atom/ns#" term="VS2008"/><category scheme="http://www.blogger.com/atom/ns#" term="VS2010"/><category scheme="http://www.blogger.com/atom/ns#" term="VS2012"/><title type='text'>Visual Studio project type GUIDs</title><content type='html'>&lt;p&gt;I updated the original &lt;a href=&quot;http://www.mztools.com/articles/2008/mz2008017.aspx&quot;&gt;table&lt;/a&gt;.
&lt;table cellpadding=&quot;1&quot; cellspacing=&quot;0&quot; border=&quot;1&quot;&gt;
  &lt;tr align=&quot;left&quot; bgcolor=&quot;lightgray&quot;&gt;
    &lt;th&gt;Project Language&lt;/th&gt;
    &lt;th&gt;Project Type Guid&lt;/th&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;C#&lt;/td&gt;
    &lt;td&gt;{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;F#&lt;/td&gt;
    &lt;td&gt;{F2A71F9B-5D33-465A-A702-920D77279786}&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;J#&lt;/td&gt;
    &lt;td&gt;{E6FDF86B-F3D1-11D4-8576-0002A516ECE8}&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;VB.NET&lt;/td&gt;
    &lt;td&gt;{F184B08F-C81C-45F6-A57F-5ABD9991F28F}&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;C++&lt;/td&gt;
    &lt;td&gt;{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}&lt;/td&gt;
  &lt;/tr&gt;
&lt;/table&gt;
&lt;/br&gt;
&lt;table cellpadding=&quot;1&quot; cellspacing=&quot;0&quot; border=&quot;1&quot;&gt;
  &lt;tr align=&quot;left&quot; bgcolor=&quot;lightgray&quot;&gt;
    &lt;th&gt;Project Type Description&lt;/th&gt;
    &lt;th&gt;Project Type Guid&lt;/th&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;Web Application&lt;/td&gt;
    &lt;td&gt;{349C5851-65DF-11DA-9384-00065B846F21}&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;Web Site&lt;/td&gt;
    &lt;td&gt;{E24C65DC-7377-472B-9ABA-BC803B73C61A}&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;Distributed System&lt;/td&gt;
    &lt;td&gt;{F135691A-BF7E-435D-8960-F99683D2D49C}&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;Windows Communication Foundation (WCF)&lt;/td&gt;
    &lt;td&gt;{3D9AD99F-2412-4246-B90B-4EAA41C64699}&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;Windows Presentation Foundation (WPF)&lt;/td&gt;
    &lt;td&gt;{60DC8134-EBA5-43B8-BCC9-BB4BC16C2548}&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;Visual Database Tools&lt;/td&gt;
    &lt;td&gt;{C252FEB5-A946-4202-B1D4-9916A0590387}&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;Database&lt;/td&gt;
    &lt;td&gt;{A9ACE9BB-CECE-4E62-9AA4-C7E7C5BD2124}&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;Database (other project types)&lt;/td&gt;
    &lt;td&gt;{4F174C21-8C12-11D0-8340-0000F80270F8}&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;Test&lt;/td&gt;
    &lt;td&gt;{3AC096D0-A1C2-E12C-1390-A8335801FDAB}&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;Legacy (2003) Smart Device (C#)&lt;/td&gt;
    &lt;td&gt;{20D4826A-C6FA-45DB-90F4-C717570B9F32}&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;Legacy (2003) Smart Device (VB.NET)&lt;/td&gt;
    &lt;td&gt;{CB4CE8C6-1BDB-4DC7-A4D3-65A1999772F8}&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;Smart Device (C#)&lt;/td&gt;
    &lt;td&gt;{4D628B5B-2FBC-4AA6-8C16-197242AEB884}&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;Smart Device (VB.NET)&lt;/td&gt;
    &lt;td&gt;{68B1623D-7FB9-47D8-8664-7ECEA3297D4F}&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;Workflow Foundation&lt;/td&gt;
    &lt;td&gt;{32F31D43-81CC-4C15-9DE6-3FC5453562B6}&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;Workflow (C#)&lt;/td&gt;
    &lt;td&gt;{14822709-B5A1-4724-98CA-57A101D1B079}&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;Workflow (VB.NET)&lt;/td&gt;
    &lt;td&gt;{D59BE175-2ED0-4C54-BE3D-CDAA9F3214C8}&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;Deployment Merge Module&lt;/td&gt;
    &lt;td&gt;{06A35CCD-C46D-44D5-987B-CF40FF872267}&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;Deployment Cab&lt;/td&gt;
    &lt;td&gt;{3EA9E505-35AC-4774-B492-AD1749C4943A}&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;Deployment Setup&lt;/td&gt;
    &lt;td&gt;{978C614F-708E-4E1A-B201-565925725DBA}&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;Deployment Smart Device Cab&lt;/td&gt;
    &lt;td&gt;{AB322303-2255-48EF-A496-5904EB18DA55}&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;Visual Studio Tools for Applications (VSTA)&lt;/td&gt;
    &lt;td&gt;{A860303F-1F3F-4691-B57E-529FC101A107}&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;Visual Studio Tools for Office (VSTO)&lt;/td&gt;
    &lt;td&gt;{BAA0C2D2-18E2-41B9-852F-F413020CAA33}&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;SharePoint Workflow&lt;/td&gt;
    &lt;td&gt;{F8810EC1-6754-47FC-A15F-DFABD2E3FA90}&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;SharePoint (VB.NET)&lt;/td&gt;
    &lt;td&gt;{EC05E597-79D4-47f3-ADA0-324C4F7C7484}&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;SharePoint (C#)&lt;/td&gt;
    &lt;td&gt;{593B0543-81F6-4436-BA1E-4747859CAAE2}&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;XNA (Windows)&lt;/td&gt;
    &lt;td&gt;{6D335F3A-9D43-41b4-9D22-F6F17C4BE596}&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;XNA (XBox)&lt;/td&gt;
    &lt;td&gt;{2DF5C3F4-5A5F-47a9-8E94-23B4456F55E2}&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;XNA (Zune)&lt;/td&gt;
    &lt;td&gt;{D399B71A-8929-442a-A9AC-8BEC78BB2433}&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;Silverlight&lt;/td&gt;
    &lt;td&gt;{A1591282-1198-4647-A2B1-27E5FF5F6F3B}&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;Model-View-Controller v2 (MVC2)&lt;/td&gt;
    &lt;td&gt;{F85E285D-A4E0-4152-9332-AB1D724D3325}&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;Model-View-Controller v3 (MVC3)&lt;/td&gt;
    &lt;td&gt;{E53F8FEA-EAE0-44A6-8774-FFD645390401}&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;Model-View-Controller v4 (MVC4)&lt;/td&gt;
    &lt;td&gt;{E3E379DF-F4C6-4180-9B81-6769533ABE47}&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;Windows Store Apps (Metro Apps)&lt;/td&gt;
    &lt;td&gt;{BC8A1FFA-BEE3-4634-8014-F334798102B3}&lt;/td&gt;
&lt;/table&gt;
&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://workblog.pilin.name/feeds/8488394047855040543/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8643966532123751496/8488394047855040543' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8643966532123751496/posts/default/8488394047855040543'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8643966532123751496/posts/default/8488394047855040543'/><link rel='alternate' type='text/html' href='http://workblog.pilin.name/2012/11/visual-studio-project-type-guids.html' title='Visual Studio project type GUIDs'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8643966532123751496.post-2219199312223478943</id><published>2012-11-10T16:23:00.001+01:00</published><updated>2012-11-11T09:57:35.627+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="SyntaxHighlighter"/><category scheme="http://www.blogger.com/atom/ns#" term="WinDbg"/><category scheme="http://www.blogger.com/atom/ns#" term="x64"/><category scheme="http://www.blogger.com/atom/ns#" term="x86"/><title type='text'>SyntaxHighlighter brushes for WinDbg disassembler output</title><content type='html'>&lt;p&gt;I spent a lot of time looking for &lt;a href=&quot;http://alexgorbatchev.com/SyntaxHighlighter/&quot;&gt;SyntaxHighlighter&lt;/a&gt; brush for disassembler output. Unfortunately, I didn&amp;#39;t find a good one. So, today I have to write my own brushes for it:
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://pilin.name/scripts/shBrushWinDbgDisasm.js&quot;&gt;WinDbg x86/x64 disassembler output brush&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://pilin.name/scripts/shBrushWinDbgStack.js&quot;&gt;WinDbg x86/x64 stack dump brush&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/p&gt;&lt;a href=&quot;http://workblog.pilin.name/2012/11/syntaxhighlighter-brush-for-windbg.html#more&quot;&gt;Read more »&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://workblog.pilin.name/feeds/2219199312223478943/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8643966532123751496/2219199312223478943' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8643966532123751496/posts/default/2219199312223478943'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8643966532123751496/posts/default/2219199312223478943'/><link rel='alternate' type='text/html' href='http://workblog.pilin.name/2012/11/syntaxhighlighter-brush-for-windbg.html' title='SyntaxHighlighter brushes for WinDbg disassembler output'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total><georss:featurename>Munich, Germany</georss:featurename><georss:point>48.1366069 11.5770851</georss:point><georss:box>47.967062399999996 11.2612281 48.3061514 11.892942099999999</georss:box></entry><entry><id>tag:blogger.com,1999:blog-8643966532123751496.post-4503530888560826945</id><published>2012-10-22T22:49:00.001+02:00</published><updated>2012-10-22T23:30:28.945+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Stack Walker"/><category scheme="http://www.blogger.com/atom/ns#" term="Windows"/><category scheme="http://www.blogger.com/atom/ns#" term="WinRT"/><category scheme="http://www.blogger.com/atom/ns#" term="x64"/><title type='text'>How to get x64 dynamic function table critical section?</title><content type='html'>&lt;p&gt;There is the standard way to walk on stack under Windows x64: &lt;i&gt;RtlLookupFunctionEntry()&lt;/i&gt; and &lt;i&gt;RtlVirtualUnwind()&lt;/i&gt; API calls. These methods use additional information to unwind stack: static and dynamic function tables. Static tables are generated by compilers and stored insight DLLs. Dynamic ones generated by application (CLR in fact is part of application) for dynamically created methods.&lt;/p&gt;
&lt;a href=&quot;http://workblog.pilin.name/2012/10/how-to-get-x64-dynamic-function-table.html#more&quot;&gt;Read more »&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://workblog.pilin.name/feeds/4503530888560826945/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8643966532123751496/4503530888560826945' title='11 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8643966532123751496/posts/default/4503530888560826945'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8643966532123751496/posts/default/4503530888560826945'/><link rel='alternate' type='text/html' href='http://workblog.pilin.name/2012/10/how-to-get-x64-dynamic-function-table.html' title='How to get x64 dynamic function table critical section?'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>11</thr:total><georss:featurename>Munich, Germany</georss:featurename><georss:point>48.1366069 11.5770851</georss:point><georss:box>47.967062399999996 11.2612281 48.3061514 11.892942099999999</georss:box></entry><entry><id>tag:blogger.com,1999:blog-8643966532123751496.post-4202277445418112118</id><published>2012-10-22T15:54:00.002+02:00</published><updated>2012-10-23T23:22:52.169+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Windows"/><category scheme="http://www.blogger.com/atom/ns#" term="x64"/><title type='text'>How RegSvr32 works on x64?</title><content type='html'>&lt;p&gt;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/windows/desktop/aa384187(v=vs.85).aspx&quot;&gt;File system redirection&lt;/a&gt; works in x64 OS. It means that when you are 32-bits application and try to run &lt;i&gt;%WinDir%\&lt;b&gt;System32&lt;/b&gt;\RegSvr32.exe&lt;/i&gt;, you run &lt;i&gt;%WinDir%\&lt;b&gt;SysWOW64&lt;/b&gt;\RegSvr32.exe&lt;/i&gt; in fact. It&#39;s very good for compatibility. However, there is the problem when you want to register 64-bits COM DLL from 32-bits process: &lt;b&gt;32-bits process can&#39;t work with 64-bits DLL&lt;/b&gt;.&lt;/p&gt;
&lt;p&gt;&lt;i&gt;RegSvr32&lt;/i&gt; do the special work to solve this problem. It detects that it works in WOW64 mode and DLL is 64-bit then ... it disable file system redirection for current thread by the &lt;i&gt;Wow64EnableWow64FsRedirection()&lt;/i&gt; call and run itself (the command line contains original path: &lt;i&gt;%WinDir%\System32\RegSvr32.exe&lt;/i&gt;) with the same arguments. Ta-da... It&#39;s beautiful decision!
&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Update:&lt;/b&gt; However, run itself in 64-bits mode will be skipped when 32-bits application loads 64-bits DLL by &lt;i&gt;LoadLibraryEx()&lt;/i&gt; call and get the non-right error code - only the ERROR_BAD_EXE_FORMAT (0xC1) error code is expected.
&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://workblog.pilin.name/feeds/4202277445418112118/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8643966532123751496/4202277445418112118' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8643966532123751496/posts/default/4202277445418112118'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8643966532123751496/posts/default/4202277445418112118'/><link rel='alternate' type='text/html' href='http://workblog.pilin.name/2012/10/how-regsvr32-works-on-x64.html' title='How RegSvr32 works on x64?'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8643966532123751496.post-2233540739748520869</id><published>2012-10-12T12:33:00.000+02:00</published><updated>2012-10-13T12:53:29.463+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Windows"/><category scheme="http://www.blogger.com/atom/ns#" term="WinRT"/><title type='text'>WinRT local network isolation</title><content type='html'>&lt;p&gt;By default only VS2012 deployed applications have the localhost network isolation in disabled state. All other application can&amp;#39;t connect to localhost. There are at least two tools to control which application can connect to localhost which not: &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/windows/apps/hh780593.aspx&quot;&gt;CheckNetIsolation&lt;/a&gt; and &lt;a href=&quot;http://blogs.msdn.com/b/fiddler/archive/2011/12/10/fiddler-windows-8-apps-enable-loopback-network-isolation-exemption.aspx&quot;&gt;EnableLoopback&lt;/a&gt;. Here is the way how to do it from you own program:
&lt;/p&gt;&lt;a href=&quot;http://workblog.pilin.name/2012/10/winrt-local-network-isolation.html#more&quot;&gt;Read more »&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://workblog.pilin.name/feeds/2233540739748520869/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8643966532123751496/2233540739748520869' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8643966532123751496/posts/default/2233540739748520869'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8643966532123751496/posts/default/2233540739748520869'/><link rel='alternate' type='text/html' href='http://workblog.pilin.name/2012/10/winrt-local-network-isolation.html' title='WinRT local network isolation'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8643966532123751496.post-3352404181530588705</id><published>2012-09-21T22:40:00.000+02:00</published><updated>2012-09-25T13:00:12.150+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term=".NET Profiling API"/><category scheme="http://www.blogger.com/atom/ns#" term="ETW"/><title type='text'>Identifiers in ETW and Profiling API</title><content type='html'>&lt;p&gt;CLR v4.0/v4.5 can generate &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/dd264810(v=vs.100).aspx&quot;&gt;ETW CLR events&lt;/a&gt;. There is special section and for &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ff356159(v=vs.100).aspx&quot;&gt;operations relating to loading and unloading application domains, assemblies, and modules&lt;/a&gt;. This article contains a lot of identifiers such as AppDomainID, AssemblyID, ModuleID. Descriptions of them sometimes contains word &amp;quot;unique&amp;quot;. This word is parasite. All identifiers are unique, but unique only during object life. It means that it possible to have two and more different objects with the same identifier, but in different moments of an application life.&lt;/p&gt;
&lt;a href=&quot;http://workblog.pilin.name/2012/09/identifiers-in-etw-and-profiling-api.html#more&quot;&gt;Read more »&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://workblog.pilin.name/feeds/3352404181530588705/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8643966532123751496/3352404181530588705' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8643966532123751496/posts/default/3352404181530588705'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8643966532123751496/posts/default/3352404181530588705'/><link rel='alternate' type='text/html' href='http://workblog.pilin.name/2012/09/identifiers-in-etw-and-profiling-api.html' title='Identifiers in ETW and Profiling API'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8643966532123751496.post-4296659729088102503</id><published>2012-08-17T11:49:00.003+02:00</published><updated>2012-10-12T12:39:33.322+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="VS2012"/><category scheme="http://www.blogger.com/atom/ns#" term="WinRT"/><title type='text'>Windows Store feature</title><content type='html'>&lt;p&gt;Your Windows Store application will be automatically registered if you compile it under Visual Studio 2012 and run/debug. However, &lt;i&gt;get_InstalledLocation()&lt;/i&gt; method of &lt;i&gt;ABI::Windows::ApplicationModel::IPackage&lt;/i&gt; interface will return error if you press Clean Build in Visual Studio.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://workblog.pilin.name/feeds/4296659729088102503/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8643966532123751496/4296659729088102503' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8643966532123751496/posts/default/4296659729088102503'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8643966532123751496/posts/default/4296659729088102503'/><link rel='alternate' type='text/html' href='http://workblog.pilin.name/2012/08/metro.html' title='Windows Store feature'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8643966532123751496.post-1061332695788441594</id><published>2012-06-27T11:39:00.000+02:00</published><updated>2016-07-09T12:26:07.406+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C++"/><category scheme="http://www.blogger.com/atom/ns#" term="UAC"/><category scheme="http://www.blogger.com/atom/ns#" term="Windows"/><title type='text'>How to detect is UAC enabled or not?</title><content type='html'>&lt;p&gt;There are at least three ways to detect UAC (User Access Control) is active or not:&lt;ul&gt;
&lt;li&gt;Check the registry value &lt;i&gt;EnableLUA&lt;/i&gt; at &lt;i&gt;HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\System&lt;/i&gt;. However, there is the one problem: the value can be changed at any time, but it won&#39;t be used by OS until the computer reboot. So, this way is possible, but it isn&#39;t good.&lt;/li&gt;
&lt;li&gt;Call &lt;i&gt;GetTokenInformation()&lt;/i&gt; with &lt;i&gt;TokenElevationType&lt;/i&gt; and &lt;i&gt;TokenElevation&lt;/i&gt;. It doesn&#39;t work in all situations. It&#39;s impossible to detect UAC when an application runs under conventional user (&lt;i&gt;TokenElevationType&lt;/i&gt; returns &lt;i&gt;TokenElevationTypeDefault&lt;/i&gt; and &lt;i&gt;TokenElevation&lt;/i&gt; returns &lt;i&gt;FALSE&lt;/i&gt;).&lt;/li&gt;
&lt;li&gt;Call private API method (valid only for Windows Vista and later):
&lt;pre class=&quot;brush:cpp&quot;&gt;
#pragma comment(lib, &quot;ntdll.lib&quot;)

#define ELEVATION_UAC_ENABLED                 0x1
#define ELEVATION_VIRTUALIZATION_ENABLED      0x2
#define ELEVATION_INSTALLER_DETECTION_ENABLED 0x4

extern &quot;C&quot;
NTSTATUS
NTAPI
RtlQueryElevationFlags(
        DWORD* pFlags);
&lt;/pre&gt;
Unfortunately, there is no declaration of this method in &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/windows/hardware/gg487428.aspx&quot;&gt;Windows Driver Kit (WDK)&lt;/a&gt;, but &lt;i&gt;ntdll.lib&lt;/i&gt; from WDK contains it.
&lt;/li&gt;
&lt;/ul&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://workblog.pilin.name/feeds/1061332695788441594/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8643966532123751496/1061332695788441594' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8643966532123751496/posts/default/1061332695788441594'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8643966532123751496/posts/default/1061332695788441594'/><link rel='alternate' type='text/html' href='http://workblog.pilin.name/2012/06/how-to-detect-is-uac-enabled-or-not.html' title='How to detect is UAC enabled or not?'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8643966532123751496.post-5495690412356821394</id><published>2012-06-24T12:44:00.000+02:00</published><updated>2012-09-23T13:54:37.234+02:00</updated><title type='text'>This blog change the language today</title><content type='html'>&lt;p&gt;Hi everybody. Today I decided to change the language of this blog. So, next messages will be in English. I promise to translate old messages from Russian to English in future.&lt;/p&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhXb_v_fjS_pCupuY6U2wTcHd5eZq0h9yT55u-BH6VCdOAGu3F2V7vcyszb9CWXXWV2NUp6qadPNcePZWfcoJr2EtzmHIjCKcHzVngjmlnjII3vxZpKVTbMMU8FruPy9E1nd-N4dqqTJcap/s1600/EnglishSpokenHere.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left:1em; margin-right:1em&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;78&quot; width=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhXb_v_fjS_pCupuY6U2wTcHd5eZq0h9yT55u-BH6VCdOAGu3F2V7vcyszb9CWXXWV2NUp6qadPNcePZWfcoJr2EtzmHIjCKcHzVngjmlnjII3vxZpKVTbMMU8FruPy9E1nd-N4dqqTJcap/s400/EnglishSpokenHere.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;

</content><link rel='replies' type='application/atom+xml' href='http://workblog.pilin.name/feeds/5495690412356821394/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8643966532123751496/5495690412356821394' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8643966532123751496/posts/default/5495690412356821394'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8643966532123751496/posts/default/5495690412356821394'/><link rel='alternate' type='text/html' href='http://workblog.pilin.name/2012/06/this-blog-change-language-today.html' title='This blog change the language today'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhXb_v_fjS_pCupuY6U2wTcHd5eZq0h9yT55u-BH6VCdOAGu3F2V7vcyszb9CWXXWV2NUp6qadPNcePZWfcoJr2EtzmHIjCKcHzVngjmlnjII3vxZpKVTbMMU8FruPy9E1nd-N4dqqTJcap/s72-c/EnglishSpokenHere.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8643966532123751496.post-337559877840564973</id><published>2012-06-23T09:04:00.001+02:00</published><updated>2016-07-09T12:26:07.441+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C++"/><category scheme="http://www.blogger.com/atom/ns#" term="UAC"/><category scheme="http://www.blogger.com/atom/ns#" term="Windows"/><title type='text'>Запуск non-elevated процесса из под elevated</title><content type='html'>&lt;p&gt;Неожиданно возникла проблема, что некоторые API в Windows 8 работают только из под non-elevated пользователя и только когда UAC включен. Соответственно встал вопрос как прикинуться non-elevated пользователем, если программа запущена под elevated пользователем. Сразу скажу, мы не знаем пользователький пароль.&lt;/p&gt;
&lt;a href=&quot;http://workblog.pilin.name/2012/06/non-elevated-elevated.html#more&quot;&gt;Read more »&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://workblog.pilin.name/feeds/337559877840564973/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8643966532123751496/337559877840564973' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8643966532123751496/posts/default/337559877840564973'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8643966532123751496/posts/default/337559877840564973'/><link rel='alternate' type='text/html' href='http://workblog.pilin.name/2012/06/non-elevated-elevated.html' title='Запуск non-elevated процесса из под elevated'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8643966532123751496.post-1855796948802716349</id><published>2012-06-12T01:20:00.001+02:00</published><updated>2012-10-12T12:39:45.713+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Windows"/><category scheme="http://www.blogger.com/atom/ns#" term="WinRT"/><title type='text'>Репортаж из песочницы</title><content type='html'>&lt;p&gt;&lt;b&gt;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/cc980032(v=prot.10).aspx&quot;&gt;S-1-15-2-1&lt;/a&gt;&lt;/b&gt; (ALL_APP_PACKAGES) - это магический SID позволяет достучатся к любому файлу или каталогу из WinRT песочницы.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Update:&lt;/b&gt; Этот же SID помогает установить соединение через named pipe из песочницы наружу.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Update:&lt;/b&gt; Этот же SID помогает достучаться до реестра.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://workblog.pilin.name/feeds/1855796948802716349/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8643966532123751496/1855796948802716349' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8643966532123751496/posts/default/1855796948802716349'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8643966532123751496/posts/default/1855796948802716349'/><link rel='alternate' type='text/html' href='http://workblog.pilin.name/2012/06/blog-post.html' title='Репортаж из песочницы'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8643966532123751496.post-6124402802995114490</id><published>2012-04-28T23:18:00.011+02:00</published><updated>2012-11-10T15:54:30.288+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term=".NET"/><category scheme="http://www.blogger.com/atom/ns#" term=".NET Profiling API"/><category scheme="http://www.blogger.com/atom/ns#" term=".NETCF"/><category scheme="http://www.blogger.com/atom/ns#" term="Stack Walker"/><category scheme="http://www.blogger.com/atom/ns#" term="x64"/><title type='text'>Stack walker для CLR x64</title><content type='html'>&lt;p&gt;Сразу оговорюсь, что в принципе можно не использовать DoStackSnapshot() вообще для платформы x64 так как в наличии есть RtlLookupFunctionEntry() и RtlVirtualUnwind(). Но, я бы не рекомендовал так делать (хотя некоторые могут со мной не согласиться), потому что во время вызова DoStackSnapshot() происходят дополнительные проверки и синхронизации, которые вы не сможете сделать другими средствами. А как же GetFunctionFromIP() скажете вы? Отвечаю, что это очень простой по устройству метод, который просто не делает весь спектр необходимых проверок.&lt;br&gt;
&lt;/p&gt;&lt;a href=&quot;http://workblog.pilin.name/2012/04/stack-walker-clr-x64.html#more&quot;&gt;Read more »&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://workblog.pilin.name/feeds/6124402802995114490/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8643966532123751496/6124402802995114490' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8643966532123751496/posts/default/6124402802995114490'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8643966532123751496/posts/default/6124402802995114490'/><link rel='alternate' type='text/html' href='http://workblog.pilin.name/2012/04/stack-walker-clr-x64.html' title='Stack walker для CLR x64'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8643966532123751496.post-6901602790945721485</id><published>2012-01-28T18:34:00.003+01:00</published><updated>2012-06-23T09:31:35.602+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term=".NET Profiling API"/><title type='text'>Сюрприз Profiling API</title><content type='html'>&lt;p&gt;На днях, при отладке профайлера, на приложении выделяющим и инициализирующим массив в 2Gb (максимальный размер объекта в CLR), во время очередного GC, был замечен странный кратковременный всплеск потребления памяти - выделялось дополнительно еще 2Gb (итого пиково было 4Gb). После расследования выяснилось, что на время вызова ICorProfilerCallback::ObjectReferences() CLR выделяет массив для передачи в профайлер всех исходящих рефернсов соответствующего объекта. Если референсы занимают эти самые 2Gb, то будут выделен массив в 2Gb. Проблема возникает только тогда, когда ICorProfilerCallback::ObjectReferences() возвращает всегда S_OK и производится полный обход графа для профайлера.&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh5LP29etsJtHxakgOXFpH9blKK-NXTto-429egfyF7iILyYUNt8UojnDWJbX2nKZ95matzaoLdoSUpn5DXLWT3z3ZGEMsFkTLI9G8Mloj44SeVBNpRl3nJ8r2yg0uqhPkC2hJp1YM0DW-c/s1600/Test.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left:1em; margin-right:1em&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;152&quot; width=&quot;392&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh5LP29etsJtHxakgOXFpH9blKK-NXTto-429egfyF7iILyYUNt8UojnDWJbX2nKZ95matzaoLdoSUpn5DXLWT3z3ZGEMsFkTLI9G8Mloj44SeVBNpRl3nJ8r2yg0uqhPkC2hJp1YM0DW-c/s400/Test.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;Собственно приложение (число 9 в коде подобрано для CLR 4.0 x64):&lt;br /&gt;
&lt;pre class=&quot;brush:csharp&quot;&gt;using System;

namespace AllocationTest
{
  internal class Program
  {
    private static void Main()
    {
      var tmp = new object[0x80000000U / (uint) IntPtr.Size - 9];

      for (int n = 0; n &lt; tmp.Length; ++n)
        tmp[n] = tmp;

      Console.Write(&quot;Press any key...&quot;);
      Console.ReadKey();
      Console.WriteLine();

      GC.KeepAlive(tmp);
    }
  }
}
&lt;/pre&gt;
&lt;b&gt;P.S.&lt;/b&gt; Если убрать в примере запонение массива, то эффект наблюдается не будет.&lt;/br&gt;
&lt;b&gt;P.P.S.&lt;/b&gt;CLR v4.5 x64 может выделять массивы больше чем 2Gb! Смотри &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/hh285054(v=vs.110).aspx&quot;&gt;gcAllowVeryLargeObjects&lt;/a&gt;.
&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://workblog.pilin.name/feeds/6901602790945721485/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8643966532123751496/6901602790945721485' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8643966532123751496/posts/default/6901602790945721485'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8643966532123751496/posts/default/6901602790945721485'/><link rel='alternate' type='text/html' href='http://workblog.pilin.name/2012/01/2gb-clr-gc-2gb-4gb.html' title='Сюрприз Profiling API'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh5LP29etsJtHxakgOXFpH9blKK-NXTto-429egfyF7iILyYUNt8UojnDWJbX2nKZ95matzaoLdoSUpn5DXLWT3z3ZGEMsFkTLI9G8Mloj44SeVBNpRl3nJ8r2yg0uqhPkC2hJp1YM0DW-c/s72-c/Test.jpg" height="72" width="72"/><thr:total>0</thr:total></entry></feed>