<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>Tony DeVere's (MSFT) Blog</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/tdevere/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/tdevere/feed.xml</link>
    <description>notes from the front line</description>
    <lastBuildDate>Wed, 17 Apr 2019 03:27:15 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Another Case of The RPC server is unavailable - Cross Domain DCOM Call Failure</title>
      <link>https://docs.microsoft.com/archive/blogs/tdevere/another-case-of-the-rpc-server-is-unavailable-cross-domain-dcom-call-failure</link>
      <pubDate>Wed, 03 May 2017 17:59:28 GMT</pubDate>
      <dc:creator><![CDATA[Tony DeVere]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/tdevere/?p=175</guid>
      <description><![CDATA[&nbsp; Visual Overview -   &nbsp; Technical Overview &nbsp; SSMS.exe here successfully calls the...]]></description>
      <content:encoded><![CDATA[<p>&nbsp;</p> <h1>Visual Overview - </h1> <p><a href="https://msdnshared.blob.core.windows.net/media/2017/05/CrossDomainDcom.png"><img title="CrossDomainDcom" style="border-top: 0px;border-right: 0px;border-bottom: 0px;padding-top: 0px;padding-left: 0px;border-left: 0px;padding-right: 0px" border="0" alt="CrossDomainDcom" src="https://msdnshared.blob.core.windows.net/media/2017/05/CrossDomainDcom_thumb.png" width="873" height="485"></a></p> <p>&nbsp;</p> <h1>Technical Overview</h1> <p>&nbsp;</p> <p>SSMS.exe here successfully calls the EndPointMapper on SQL1.Fabrikam.com and is returned the network address SSMS.exe may call back on to work with the DCOM server. </p> <p>This is the successful call to RemoteCreateInstance, after 10 seconds, client then aborts. So why?&nbsp; (shortended) <p>- ScmReply:  <p>- OxidBindings:  <p>- Bindings:  <p>- StringBindings:  <p>TowerId: 7 (0x7) <p>NetworkAddress: <strong>sql1</strong>[49299] <p>- StringBindings:  <p>TowerId: 7 (0x7) <p>NetworkAddress: <strong>192.168.1.100</strong>[49299] <p>&nbsp; <p>SSMS.exe will choose the first address in list of network addreses and so ends up trying to call: SQL1. Now because SQL is the name of a local machine, DNS correct returns the IP 192.168.2.200 and so the next outbound connection will be headed to the wrong SQL instance. This connection must fail.  <p>If you’re looking at the network tracing, it may look like an abrupt end, caused by the client resetting the connection after having several successful calls to the correct server. Between those calls will be the new session with DNS and the local SQL machine.  <p>This example can play out with other DCOM applications however, in my experience this is a rare situation.  <p>Currently, there are only two workarounds:  <blockquote> <p>1. Rename one of the machines <p>2. Use a host file entry to direct the netBIOS name to the address desired</p></blockquote> <h3>General Lesson</h3> <p>Try not to duplicate server names between your domains; though ideally, the FQDN should be returned from the DCOM.</p> <p>&nbsp;</p> <h3>Further Reading</h3> <p>DCOM Servers are responsible for registering calling RpcEpRegister and supplying Binding details or relying on existing Bindings. Control over the Binding name then is due to the DCOM server implementer.  <p>Research Details: <p>[MS-DCOM] 2.2.19.3 <p>STRINGBINDING.aNetworkAddr.servername = MUST BE one of the following{ A NETBIOS Name, <font style="background-color: #ffff00">FQDN</font>, IPv4, IPv6, } *removed other requirements to shorten output for our example. <p><cite>From &lt;<a href="https://msdn.microsoft.com/en-us/library/windows/desktop/aa378456(v=vs.85).aspx">https://msdn.microsoft.com/en-us/library/windows/desktop/aa378456(v=vs.85).aspx</a>&gt; </cite>]]></content:encoded>
    </item>
    <item>
      <title>Microsoft JDBC Driver 4.2 contains a version of sqljdbc_xa which creates a handle leak in SQL Server</title>
      <link>https://docs.microsoft.com/archive/blogs/tdevere/microsoft-jdbc-driver-4-2-contains-a-version-of-sqljdbc_xa-which-creates-a-handle-leak-in-sql-server</link>
      <pubDate>Mon, 13 Jun 2016 16:04:57 GMT</pubDate>
      <dc:creator><![CDATA[Tony DeVere]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/tdevere/?p=155</guid>
      <description><![CDATA[&nbsp;   Recently I worked with a customer who was experiencing a crash in his SQL Server process....]]></description>
      <content:encoded><![CDATA[<p>&nbsp;</p> <h2></h2> <h3></h3> <h3>Recently I worked with a customer who was experiencing a crash in his SQL Server process. He was under the impression that this same code was working in another location but in this envirnonment, they were stressing the box to determine its capacity. That’s when they discovered the crash which eventually led us to find a handle leak in the process.</h3> <p>&nbsp;</p> <h2>Steps To Verify Problem</h2> <h3></h3> <h3>1. Your application uses XA Transactions</h3> <h3>2. The sqljdbc_xa.dll file version is 4.2.6420.100</h3> <h3></h3> <h3>3. Handle count increases with every call [task manager; performance monitor\process\handle count]</h3> <h4></h4> <h3>4. Once you have exhausted kernel resources, you may also notice related errors:<br></h3> <blockquote> <p>Log Name:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Application<br>Source:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Microsoft-Windows-Complus<br>Date:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 6/8/2016 6:36:45 PM<br>Event ID:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4689<br>Task Category: (8)<br>Level:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Error<br>Keywords:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Classic<br>User:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; N/A<br>Computer:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SQL<br>Description:<br>The run-time environment has detected an inconsistency in its internal state. This indicates a potential instability in the process that could be caused by the custom components running in the COM+ application, the components they make use of, or other factors. Error in COM\complus\src\inc\UTSem.H(100), Insufficient system resources exist to complete the requested service.</p> <p>: CreateEvent returned a NULL handle.</p></blockquote> <h3>5. This state of affairs eventually leads to a crash in SQL Server Process<br></h3> <h3>Recommendation:</h3> <h3>Revert to 4.0 version of JDBC Driver: <a title="https://www.microsoft.com/en-us/download/details.aspx?displaylang=en&amp;id=11774" href="https://www.microsoft.com/en-us/download/details.aspx?displaylang=en&amp;id=11774">https://www.microsoft.com/en-us/download/details.aspx?displaylang=en&amp;id=11774</a></h3>]]></content:encoded>
    </item>
    <item>
      <title>How to determine the referenced COM object from System.__ComObject</title>
      <link>https://docs.microsoft.com/archive/blogs/tdevere/how-to-determine-the-referenced-com-object-from-system-__comobject</link>
      <pubDate>Thu, 10 Sep 2015 11:44:00 GMT</pubDate>
      <dc:creator><![CDATA[Tony DeVere]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/tdevere/2015/09/10/how-to-determine-the-referenced-com-object-from-system-__comobject/</guid>
      <description><![CDATA[Perhaps you are debugging your .NET Application and would like to know to which COM component an...]]></description>
      <content:encoded><![CDATA[<p>Perhaps you are debugging your .NET Application and would like to know to which COM component an instance of System.__ComObject refers. Currently, I've only tested these steps in an .NET 2.0 x86 environment. Also, I'm using the incredible debugger extension developed by <a href="https://blogs.msdn.com/b/rodneyviana/">Rodney Viana</a> which you can also<br />use by downloading NetExt from <a href="https://netext.codeplex.com/">https://netext.codeplex.com/</a>. <em><strong>Make sure to leave Rodney <span style="text-decoration: underline;">feedback</span> and encourage him to continue to develop this powerful debugging tool.</strong></em> I'm also using the built in debugger extension (located in your .NET Framework folder for the version of the application you are using) SOS.dll.</p>
<p>Method 1: x86 With Public Symbols mscorwks</p>
<p style="padding-left: 30px;">1. List stack objects and find the System.__ComObject<br />&nbsp;<br />!wstack<br />05cb517c 04a28de4&nbsp;&nbsp; 0&nbsp; 2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 16 System.__ComObject //This is our reference to the COM component<br />&nbsp;<br />2. Now let's get the SyncBlock Address -4 and 1 level deep (to keep our output&nbsp;clean and simple)<br />&nbsp;<br />0:037&gt; dw 04a28de4-4 l1<br />04a28de0&nbsp; <strong>0002</strong><br />&nbsp;<br />3. Now we can get the SyncBlock Address directly:</p>
<p style="padding-left: 30px;">0:037&gt; !sos.syncblk 0002<br />Index SyncBlock MonitorHeld Recursion Owning Thread Info&nbsp; SyncBlock Owner<br />2 <strong>0597007c</strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0 00000000&nbsp;&nbsp;&nbsp;&nbsp; none&nbsp;&nbsp;&nbsp; 05b7eb90 System.__ComObject</p>
<p style="padding-left: 30px;">4. I haven't these steps on x64 so I would expect this to fail. <br />&nbsp;<br />0:037&gt; ?<strong>0597007c+1c</strong><br />Evaluate expression: 93782168 = <strong>05970098</strong></p>
<p style="padding-left: 30px;">0:037&gt; dc <strong>05970098</strong> l1<br />05970098&nbsp; <strong>0053afa0</strong>&nbsp; //<strong><span style="background-color: #ffff99;">InteropSyncInfo</span></strong></p>
<p style="padding-left: 30px;">0:037&gt; ?<strong>0053afa0+c</strong><br />Evaluate expression: 5484460 = <strong>0053afac</strong></p>
<p style="padding-left: 30px;">0:037&gt; dc <strong>0053afac</strong> l1<br />0053afac&nbsp; 004cdfd0&nbsp; //<span style="background-color: #ffff99;"><strong>RCW</strong></span><br />&nbsp;<br />0:037&gt; ?<strong>0x004cdfd0+0x64</strong><br />Evaluate expression: 5038132 = <strong>004ce034</strong><br />&nbsp;<br />0:037&gt; dc <strong>004ce034</strong> l1<br />004ce034&nbsp; 004d9b44&nbsp; //<span style="background-color: #ffff99;"><strong>IUnknown</strong></span><br />&nbsp;<br />0:037&gt; dc <strong>004d9b44</strong> l1<br />004d9b44&nbsp; 68f289a0&nbsp; //<span style="background-color: #ffff99;"><strong>Vtable</strong></span></p>
<p style="padding-left: 30px;"><span style="background-color: #ffffff;">5. You will need symbols for the COM component to know if this is a valid Vtable:</span></p>
<p style="padding-left: 30px;"><span style="background-color: #ffffff;">0:037&gt; dds <strong>68f289a0</strong> <br />68f289a0&nbsp; 68e559f0 example!Com::Component::<strong>QueryInterface</strong><br />68f289a4&nbsp; 68e4ba80 example!Com::Component::<strong>AddRef</strong><br />68f289a8&nbsp; 68e55a20 example!Com::Component::<strong>Release</strong></span></p>
<p><span style="background-color: #ffffff;">Some follow up notes. If you don't have symbols but you see a component listed in the output, you could unassemble one of the functions to determine if it actually looks like the beginning of a function. Also, you could look the component up in the registry and see if it's a registered COM component. Also, depending upon the symbols you have, you may be able to find this information, regardless of the offset values I've used in the example, by noting the types I've highlighted in <strong><span style="background-color: #ffff99;">yellow</span></strong> in the above example. </span></p>]]></content:encoded>
    </item>
    <item>
      <title>Mixed Mode Adapter for Native C++</title>
      <link>https://docs.microsoft.com/archive/blogs/tdevere/mixed-mode-adapter-for-native-c</link>
      <pubDate>Mon, 09 Mar 2015 13:12:02 GMT</pubDate>
      <dc:creator><![CDATA[Tony DeVere]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/tdevere/2015/03/09/mixed-mode-adapter-for-native-c/</guid>
      <description><![CDATA[&#160;  So our customer's goal was to update their native C++ application with support for calling a...]]></description>
      <content:encoded><![CDATA[<p>&#160;</p>  <p>So our customer's goal was to update their native C++ application with support for calling a static instance of a C# class and share that instance with native and managed clients from within the same process space. This is a sample created to demonstrate one method to accomplish this task. (Many thanks to <a href="https://blogs.msdn.com/b/rodneyviana/">Rodney Viana</a> for helping solve several critical problems I ran into making this sample work (if you have not downloaded Rodney's debugging extension - what are you waiting for? <a href="https://netext.codeplex.com/">https://netext.codeplex.com/</a>)</p>  <p>We chose a mixed C++/CLI adapter as a solution:</p>  <p>Visual C++ supports the use of the Standard C++ Library, the Common RunTime library (CRT), ATL, and MFC for applications compiled with /clr (Common Language Runtime Compilation). This allows existing applications that use these libraries to use .NET Framework features as well. From &lt;<a href="https://msdn.microsoft.com/en-us/library/ms173268.aspx">https://msdn.microsoft.com/en-us/library/ms173268.aspx</a>&gt; </p>  <p>Solution contains three projects (Link to Visual Studio Solution: <a href="https://1drv.ms/1A45F7Q">https://1drv.ms/1A45F7Q</a>): </p>  <ol>   <li>shared_object - C# Class project (.Net 4.5.1) </li>    <li>mixedAdapter - C++ CLR project </li>    <li>client - C++ Win32 </li> </ol>  <h3>&#160;</h3>  <h3>shared_object </h3>  <p>This DLL exposes a simple singleton class with one method named Hello_World. It returns a string to the caller. </p>  <h3>&#160;</h3>  <h3>mixedAdapter </h3>  <p>This is the C++ CLR project which acts as an adapter or wrapper. It can been called from C++ natively and it can add managed references. I have a project reference to shared_object. Make sure to add this to your class <a href="https://msdn.microsoft.com/en-us/library/a90k134d.aspx">__declspec(dllexport</a>) so your client project can import later:</p>  <div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: &#39;Courier New&#39;, courier, monospace; border-right: silver 1px solid; width: 97.5%; border-bottom: silver 1px solid; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; max-height: 200px; background-color: #f4f4f4">   <div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4">     <pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum1" style="color: #606060">   1:</span> <span style="color: #cc6633">#include</span> &lt;msclr\marshal_cppstd.h&gt;</pre>
<!--CRLF-->

    <pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum2" style="color: #606060">   2:</span>&#160; </pre>
<!--CRLF-->

    <pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum3" style="color: #606060">   3:</span> <span style="color: #cc6633">#include</span> &lt;string&gt;</pre>
<!--CRLF-->

    <pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum4" style="color: #606060">   4:</span>&#160; </pre>
<!--CRLF-->

    <pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum5" style="color: #606060">   5:</span> <span style="color: #0000ff">using</span> <span style="color: #0000ff">namespace</span> System; </pre>
<!--CRLF-->

    <pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum6" style="color: #606060">   6:</span>&#160; </pre>
<!--CRLF-->

    <pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum7" style="color: #606060">   7:</span> <span style="color: #0000ff">using</span> <span style="color: #0000ff">namespace</span> shared_object;</pre>
<!--CRLF-->

    <pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum8" style="color: #606060">   8:</span>&#160; </pre>
<!--CRLF-->

    <pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum9" style="color: #606060">   9:</span> <span style="color: #cc6633">#pragma</span> native</pre>
<!--CRLF-->

    <pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum10" style="color: #606060">  10:</span>&#160; </pre>
<!--CRLF-->

    <pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum11" style="color: #606060">  11:</span> <span style="color: #0000ff">namespace</span> mixedAdapter </pre>
<!--CRLF-->

    <pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum12" style="color: #606060">  12:</span>&#160; </pre>
<!--CRLF-->

    <pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum13" style="color: #606060">  13:</span> {</pre>
<!--CRLF-->

    <pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum14" style="color: #606060">  14:</span>&#160; </pre>
<!--CRLF-->

    <pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum15" style="color: #606060">  15:</span> <span style="color: #0000ff">class</span> __declspec(dllexport) InTheMix</pre>
<!--CRLF-->

    <pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum16" style="color: #606060">  16:</span>&#160; </pre>
<!--CRLF-->

    <pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum17" style="color: #606060">  17:</span> {</pre>
<!--CRLF-->

    <pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum18" style="color: #606060">  18:</span>&#160; </pre>
<!--CRLF-->

    <pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum19" style="color: #606060">  19:</span> <span style="color: #0000ff">public</span>:</pre>
<!--CRLF-->

    <pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum20" style="color: #606060">  20:</span>&#160; </pre>
<!--CRLF-->

    <pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum21" style="color: #606060">  21:</span> std::string SayHello()</pre>
<!--CRLF-->

    <pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum22" style="color: #606060">  22:</span>&#160; </pre>
<!--CRLF-->

    <pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum23" style="color: #606060">  23:</span> {</pre>
<!--CRLF-->

    <pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum24" style="color: #606060">  24:</span>&#160; </pre>
<!--CRLF-->

    <pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum25" style="color: #606060">  25:</span> SingletonObj^ instance = SingletonObj::GetInstance();</pre>
<!--CRLF-->

    <pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum26" style="color: #606060">  26:</span>&#160; </pre>
<!--CRLF-->

    <pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum27" style="color: #606060">  27:</span> std::string returnValue = msclr::interop::marshal_as&lt;std::string&gt;(instance-&gt;Hello_World());</pre>
<!--CRLF-->

    <pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum28" style="color: #606060">  28:</span>&#160; </pre>
<!--CRLF-->

    <pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum29" style="color: #606060">  29:</span> <span style="color: #0000ff">return</span> returnValue;</pre>
<!--CRLF-->

    <pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum30" style="color: #606060">  30:</span>&#160; </pre>
<!--CRLF-->

    <pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum31" style="color: #606060">  31:</span> }</pre>
<!--CRLF-->

    <pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum32" style="color: #606060">  32:</span>&#160; </pre>
<!--CRLF-->

    <pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum33" style="color: #606060">  33:</span> };</pre>
<!--CRLF-->

    <pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum34" style="color: #606060">  34:</span>&#160; </pre>
<!--CRLF-->

    <pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum35" style="color: #606060">  35:</span> }</pre>
<!--CRLF-->

    <pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum36" style="color: #606060">  36:</span>&#160; </pre>
<!--CRLF--></div>
</div>

<h3>client</h3>

<p>Client has a header file with __declspec(dllimport) to import the definition from the lib file</p>

<div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: &#39;Courier New&#39;, courier, monospace; border-right: silver 1px solid; width: 97.5%; border-bottom: silver 1px solid; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; max-height: 200px; background-color: #f4f4f4">
  <div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4">
    <pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum1" style="color: #606060">   1:</span> <span style="color: #cc6633">#include</span> &lt;string&gt;</pre>
<!--CRLF-->

    <pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum2" style="color: #606060">   2:</span>&#160; </pre>
<!--CRLF-->

    <pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum3" style="color: #606060">   3:</span> <span style="color: #0000ff">namespace</span> mixedAdapter</pre>
<!--CRLF-->

    <pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum4" style="color: #606060">   4:</span>&#160; </pre>
<!--CRLF-->

    <pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum5" style="color: #606060">   5:</span> {</pre>
<!--CRLF-->

    <pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum6" style="color: #606060">   6:</span>&#160; </pre>
<!--CRLF-->

    <pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum7" style="color: #606060">   7:</span> <span style="color: #0000ff">class</span> __declspec(dllimport) InTheMix</pre>
<!--CRLF-->

    <pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum8" style="color: #606060">   8:</span>&#160; </pre>
<!--CRLF-->

    <pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum9" style="color: #606060">   9:</span> {</pre>
<!--CRLF-->

    <pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum10" style="color: #606060">  10:</span>&#160; </pre>
<!--CRLF-->

    <pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum11" style="color: #606060">  11:</span> <span style="color: #0000ff">public</span>:</pre>
<!--CRLF-->

    <pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum12" style="color: #606060">  12:</span>&#160; </pre>
<!--CRLF-->

    <pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum13" style="color: #606060">  13:</span> std::string SayHello();</pre>
<!--CRLF-->

    <pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum14" style="color: #606060">  14:</span>&#160; </pre>
<!--CRLF-->

    <pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum15" style="color: #606060">  15:</span> };</pre>
<!--CRLF-->

    <pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum16" style="color: #606060">  16:</span>&#160; </pre>
<!--CRLF-->

    <pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum17" style="color: #606060">  17:</span> }</pre>
<!--CRLF-->

    <pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum18" style="color: #606060">  18:</span>&#160; </pre>
<!--CRLF--></div>
</div>

<p>And the client.cpp file has #pragma comment (lib,&quot;mixedAdapter&quot;) added which is a hint to the linker to find the correct lib file. To get this working, I opened to project properties of client, under Linker, I selected &quot;Additional Library Directories&quot; and put in the path of my mixedAdapter.lib file. Without this step you may get a complier error. </p>

<div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: &#39;Courier New&#39;, courier, monospace; border-right: silver 1px solid; width: 97.5%; border-bottom: silver 1px solid; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; max-height: 200px; background-color: #f4f4f4">
  <div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4">
    <pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum1" style="color: #606060">   1:</span> <span style="color: #cc6633">#include</span> <span style="color: #006080">&quot;stdafx.h&quot;</span></pre>
<!--CRLF-->

    <pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum2" style="color: #606060">   2:</span>&#160; </pre>
<!--CRLF-->

    <pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum3" style="color: #606060">   3:</span> <span style="color: #cc6633">#include</span> <span style="color: #006080">&quot;mixedAdapter.h&quot;</span></pre>
<!--CRLF-->

    <pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum4" style="color: #606060">   4:</span>&#160; </pre>
<!--CRLF-->

    <pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum5" style="color: #606060">   5:</span> <span style="color: #0000ff">using</span> <span style="color: #0000ff">namespace</span> mixedAdapter;</pre>
<!--CRLF-->

    <pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum6" style="color: #606060">   6:</span>&#160; </pre>
<!--CRLF-->

    <pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum7" style="color: #606060">   7:</span> <span style="color: #cc6633">#pragma</span> <span style="color: #cc6633">comment</span> (lib,<span style="color: #006080">&quot;mixedAdapter&quot;</span>)</pre>
<!--CRLF-->

    <pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum8" style="color: #606060">   8:</span>&#160; </pre>
<!--CRLF-->

    <pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum9" style="color: #606060">   9:</span> <span style="color: #0000ff">int</span> _tmain(<span style="color: #0000ff">int</span> argc, _TCHAR* argv[])</pre>
<!--CRLF-->

    <pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum10" style="color: #606060">  10:</span>&#160; </pre>
<!--CRLF-->

    <pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum11" style="color: #606060">  11:</span> {</pre>
<!--CRLF-->

    <pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum12" style="color: #606060">  12:</span>&#160; </pre>
<!--CRLF-->

    <pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum13" style="color: #606060">  13:</span> std::string str;</pre>
<!--CRLF-->

    <pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum14" style="color: #606060">  14:</span>&#160; </pre>
<!--CRLF-->

    <pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum15" style="color: #606060">  15:</span> InTheMix myClass;</pre>
<!--CRLF-->

    <pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum16" style="color: #606060">  16:</span>&#160; </pre>
<!--CRLF-->

    <pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum17" style="color: #606060">  17:</span> str = myClass.SayHello();</pre>
<!--CRLF-->

    <pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum18" style="color: #606060">  18:</span>&#160; </pre>
<!--CRLF-->

    <pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum19" style="color: #606060">  19:</span> printf(<span style="color: #006080">&quot;%s&quot;</span>, str.c_str());</pre>
<!--CRLF-->

    <pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum20" style="color: #606060">  20:</span>&#160; </pre>
<!--CRLF-->

    <pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum21" style="color: #606060">  21:</span> <span style="color: #0000ff">return</span> 0;</pre>
<!--CRLF-->

    <pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum22" style="color: #606060">  22:</span>&#160; </pre>
<!--CRLF-->

    <pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white"><span id="lnum23" style="color: #606060">  23:</span> }</pre>
<!--CRLF-->

    <pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum24" style="color: #606060">  24:</span>&#160; </pre>
<!--CRLF--></div>
</div>

<h3>&#160;</h3>

<h3>Test:</h3>

<p>C:\Visual Studio 2013\Projects\mixedAdapter\Debug&gt;client.exe</p>

<h3>Hello World</h3>]]></content:encoded>
    </item>
    <item>
      <title>A Tricky “Could not create SSL/TLS secure channel”</title>
      <link>https://docs.microsoft.com/archive/blogs/tdevere/a-tricky-could-not-create-ssltls-secure-channel</link>
      <pubDate>Fri, 27 Feb 2015 13:10:02 GMT</pubDate>
      <dc:creator><![CDATA[Tony DeVere]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/tdevere/2015/02/27/a-tricky-could-not-create-ssltls-secure-channel/</guid>
      <description><![CDATA[&#160;  My customer is attempting to setup a WCF service behind a SSL balancer. The WCF Service will...]]></description>
      <content:encoded><![CDATA[<p>&#160;</p>  <p>My customer is attempting to setup a WCF service behind a SSL balancer. The WCF Service will not have a SSL certificate installed so it will be insecure transport between load balancer and the WCF service. The SSL device requires SSL connection and a client certificate. </p>  <p>Customer wrote a simple client application which could not make even an HTTP GET to the service page. The error was The request was aborted: Could not create SSL/TLS secure channel. </p>  <p>Looking at the Netmon traces I could see the following:</p>  <p>client test.org TLS TLS:TLS Rec Layer-1 HandShake: Client Hello.   <br />test.org client TLS TLS:TLS Rec Layer-1 HandShake: Server Hello.; TLS Rec Layer-2 HandShake: Certificate.    <br />client test.org TLS TLS:TLS Rec Layer-1 HandShake: Certificate. Client Key Exchange.; TLS Rec Layer-2 Cipher Change Spec; TLS Rec Layer-3 HandShake: Encrypted Handshake Message.     <br />test.org 10.53.243.7 TLS TLS:TLS Rec Layer-1 Encrypted Alert // This is a Fatal Error: handshake failure</p>  <p>In our case, the customer was able to make the same request using IE. So I asked for IE traces to compare the differences. </p>  <p>client test.org TLS TLS:TLS Rec Layer-1 HandShake: Client Hello.    <br />test.org client TLS TLS:TLS Rec Layer-1 HandShake: Server Hello.; TLS Rec Layer-2 HandShake: Certificate.    <br />test.org client TLS TLS:Continued Data: 1328 Bytes    <br /><strong>client test.org TLS TLS:TLS Rec Layer-1 HandShake: Certificate // THIS WAS MISSING IN THE FAILING TRACE</strong>    <br />test.org client TLS TLS:TLS Rec Layer-1 Cipher Change Spec; TLS Rec Layer-2 HandShake: Encrypted Handshake Message.</p>  <p>+ Ethernet   <br />+ Ipv4:    <br />+ Tcp    <br />&#160; TLSSSLData: Transport Layer Security (TLS) Payload Data    <br />- TLS: TLS Rec Layer-1 HandShake: Certificate.    <br />&#160; - TlsRecordLayer: TLS Rec Layer-1 HandShake:    <br />&#160;&#160;&#160;&#160; ContentType: HandShake:    <br />&#160;&#160; + Version: TLS 1.0    <br />&#160;&#160; - SSLHandshake: SSL HandShake Certificate(0x0B)    <br />&#160;&#160;&#160;&#160;&#160; HandShakeType: Certificate(0x0B)    <br />&#160;&#160;&#160; - Cert: 0x1    <br />&#160;&#160;&#160;&#160;&#160;&#160; CertLength: 2700 (0xA8C)    <br />&#160;&#160;&#160;&#160; - Certificates:     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; CertificateLength: 1392 (0x570)    <br />&#160;&#160;&#160;&#160;&#160; + X509Cert: Issuer: Entrust Certification Authority    <br />&#160;&#160;&#160;&#160; - Certificates:     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; CertificateLength: 14241015 (0xD94CF7)    <br />&#160;&#160;&#160;&#160;&#160; + X509Cert: Issuer: , Subject: </p>  <p>Here the HandShake: Certificate is a client certificate the IE client had cached and was automatically sending to the SSL load balancer. Earlier that day the customer had selected the certificate so during our investigation I never noticed the requirement for client certificate. </p>  <p>We resolved this by modifying the customer's client.app.config from:</p>  <p>&#160;&#160; &lt;wsHttpBinding&gt;   <br />&#160;&#160;&#160; &lt;binding name=&quot;wsHttpBinding_IUnit&quot;&gt;    <br />&#160;&#160;&#160;&#160; &lt;security mode=&quot;Transport&quot;&gt;    <br />&#160;&#160;&#160;&#160;&#160; &lt;transport clientCredentialType=&quot;None&quot; /&gt;    <br />&#160;&#160;&#160;&#160;&#160; &lt;message clientCredentialType=&quot;Certificate&quot; /&gt;    <br />&#160;&#160;&#160;&#160; &lt;/security&gt;    <br />&#160;&#160;&#160; &lt;/binding&gt;    <br />&#160;&#160; &lt;/wsHttpBinding&gt; </p>  <p>To: </p>  <p>&#160;&#160; &lt;wsHttpBinding&gt;   <br />&#160;&#160;&#160; &lt;binding name=&quot;wsHttpBinding_IUnit&quot;&gt;    <br />&#160;&#160;&#160;&#160; &lt;security mode=&quot;Transport&quot;&gt;    <br />&#160;&#160;&#160;&#160;&#160; &lt;transport clientCredentialType=&quot;Certificate&quot; /&gt;    <br />&#160;&#160;&#160;&#160; &lt;/security&gt;    <br />&#160;&#160;&#160; &lt;/binding&gt;    <br />&#160;&#160; &lt;/wsHttpBinding&gt;</p>  <p>More Details</p>  <p>Here’s the failure from inside the System.Net traces</p>  <p>System.Net.Sockets Verbose: 0 : [4272] 00000005 : 02 28&#160;&#160;&#160;&#160;&#160;&#160; // This is a Fatal Error: handshake failure    <br />&#160;&#160;&#160; DateTime=2015-02-27T17:46:24.5449298Z    <br />System.Net.Sockets Verbose: 0 : [4272] Exiting Socket#19612312::Receive()&#160; -&gt; Int32#2    <br />&#160;&#160;&#160; DateTime=2015-02-27T17:46:24.5459298Z    <br />System.Net Information: 0 : [4272] InitializeSecurityContext(credential = System.Net.SafeFreeCredential_SECURITY, context = 1b2a1360:1e8cf70, targetName = test.org, inFlags = ReplayDetect, SequenceDetect, Confidentiality, AllocateMemory, InitManualCredValidation)    <br />&#160;&#160;&#160; DateTime=2015-02-27T17:46:24.5469298Z    <br />System.Net Information: 0 : [4272] InitializeSecurityContext(In-Buffers count=2, Out-Buffer length=0, returned code=IllegalMessage).    <br />&#160;&#160;&#160; DateTime=2015-02-27T17:46:24.5479298Z    <br />System.Net.Sockets Verbose: 0 : [4272] Socket#19612312::Dispose()    <br />&#160;&#160;&#160; DateTime=2015-02-27T17:46:24.6669298Z    <br />System.Net Error: 0 : [4272] Exception in HttpWebRequest#32615199:: - The request was aborted: Could not create SSL/TLS secure channel..    <br />&#160;&#160;&#160; DateTime=2015-02-27T17:46:24.6679298Z    <br />System.Net Error: 0 : [4272] Exception in HttpWebRequest#32615199::GetResponse - The request was aborted: Could not create SSL/TLS secure channel..    <br />&#160;&#160;&#160; DateTime=2015-02-27T17:46:24.6689298Z</p>]]></content:encoded>
    </item>
    <item>
      <title>Configure ETW Tracing Windows Server AppFabric 1.1 for Multiple Cachehosts</title>
      <link>https://docs.microsoft.com/archive/blogs/tdevere/configure-etw-tracing-windows-server-appfabric-1-1-for-multiple-cachehosts</link>
      <pubDate>Tue, 10 Feb 2015 14:23:14 GMT</pubDate>
      <dc:creator><![CDATA[Tony DeVere]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/tdevere/2015/02/10/configure-etw-tracing-windows-server-appfabric-1-1-for-multiple-cachehosts/</guid>
      <description><![CDATA[&#160;  Enabling ETW tracing across your cluster can be made easier by utilizing this handy guide....]]></description>
      <content:encoded><![CDATA[<p>&#160;</p>  <h2>Enabling ETW tracing across your cluster can be made easier by utilizing this handy guide. Method 1 shows how using PsExec and Method 2 shows how to use native Logman.exe only.</h2>  <p>&#160;</p>  <h2>Method 1: Using PsExec From SysInternals</h2>  <h5>Instructions</h5>  <h5>1. Install PsExec.exe from: <a href="https://technet.microsoft.com/en-us/sysinternals/bb897553.aspx">https://technet.microsoft.com/en-us/sysinternals/bb897553.aspx</a></h5>  <h5>2. Make sure PsExec.exe is in the system path or simply copy PsExec.exe to the c:\windows\system32 directory. </h5>  <h5>3. Edit the computer_name_list.txt to add cachehost to the trace data collections processes</h5>  <h5>4. Enable tracing by executing from the command prompt</h5>  <blockquote>   <h5>for /F %i IN (computer_name_list.txt) DO psexec -accepteula -c appfabric_enable_trace.bat -v <a href="file://\\%i">\\%i</a></h5> </blockquote>  <h5>5. To Start Tracing</h5>  <blockquote>   <h5>for /F %i IN (computer_name_list.txt) DO psexec -accepteula -c appfabric_start_trace.bat -v \\%i</h5> </blockquote>  <h5>5. To Stop Tracing on all Systems run the following command:</h5>  <blockquote>   <h5>for /F %i IN (computer_name_list.txt) DO psexec -accepteula -c appfabric_stop_trace.bat -v \\%i</h5> </blockquote>  <h5>6. To Delete the AppFabric Trace Log run this command:</h5>  <blockquote>   <h5>for /F %i IN (computer_name_list.txt) DO psexec -accepteula -c appfabric_delete_trace.bat -v \\%i</h5> </blockquote>  <h5>7. When tracing is complete, copy each of the AppFabCacheOut.etl from each system and send them to your support professional. You can use these commands to assist in that effort:</h5>  <blockquote>   <h5>for /F %i IN (computer_name_list.txt) DO md %i</h5> </blockquote>  <blockquote>   <h5>for /F %i IN (computer_name_list.txt) DO copy \\%i\c$\temp\AppFabCacheOut*.etl c:\temp\%i</h5> </blockquote>  <h2>Download source files: <a href="https://1drv.ms/1CevAu5" target="_blank">Enable_AppFabric_Tracing.zip</a>&#160;</h2>  <p>&#160;</p>  <h2>Method 2: Using Logman.exe Only</h2>  <h5>Any of the commands we ran from the command line above can be configured to point to a remote server, without the use of PsExec.exe. However, you’ll need to add a firewall rule to allow this traffic to the cachehost. First, let me translate a command then I will show you the firewall rule you need to create. If you have a number of machine to perform this on you can save some time creating a machine list as we did in step three above: (Edit the <u>computer_name_list.txt</u> to add cachehost to the trace data collections processes)</h5>  <h5>Logman example using –s switch</h5>  <blockquote>   <h5>for /F %i IN (computer_name_list.txt) DO logman delete CacheETWTracing -s %I</h5> </blockquote>  <h5>If you receive the error below you need to setup a firewall rule on the target machines to allow logman.exe to run on that remote machine.</h5>  <blockquote>   <h5>Error:</h5>    <h5>The RPC server is unavailable.</h5> </blockquote>  <h5>Create a Rule for the program %SystemRoot%\System32\plasrv.exe tighten down to your requirements from that point. </h5>]]></content:encoded>
    </item>
    <item>
      <title>MSDTC Does Not Correctly Log  All XA Transaction Details</title>
      <link>https://docs.microsoft.com/archive/blogs/tdevere/msdtc-does-not-correctly-log-all-xa-transaction-details</link>
      <pubDate>Wed, 28 Jan 2015 16:10:50 GMT</pubDate>
      <dc:creator><![CDATA[Tony DeVere]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/tdevere/2015/01/28/msdtc-does-not-correctly-log-all-xa-transaction-details/</guid>
      <description><![CDATA[&#160;  If you’re having to work with the Microsoft Distributed Transaction Coordinator transaction...]]></description>
      <content:encoded><![CDATA[<p>&#160;</p>  <p>If you’re having to work with the Microsoft Distributed Transaction Coordinator transaction logs, you must already be having a very fun day. To add to your joy, I’ve recently learned that MSDTC does not correctly log XA transaction details within the Transaction Logs. Let me give you some details that I’ve picked up. </p>  <h2>Two Scenarios for xa_commit </h2>  <h6>With TMONEPHASE</h6>  <p>The TMONEPHASE flag notifies us the caller is using one-phase commit optimizations.&#160; If you want to dump out the transaction logs here you will only find the following entry for a commit (formatted to read more clearly):</p>  <p>pid=5888 tid=5024 time=01/23/2015-12:14:30.098 seq=758 eventid=RM_ENLISTED_IN_TRANSACTION</p>  <p>Compare this to the Transaction::Commit call which utilize one-phase commit optimizations (I’ve bolded what is missing):</p>  <p>pid=5524&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; tid=5404&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; time=01/23/2015-12:11:48.822&#160;&#160;&#160;&#160;&#160;&#160; seq=71&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <strong>TRANSACTION_BEGUN</strong>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />pid=5524&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; tid=5404&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; time=01/23/2015-12:11:48.822&#160;&#160;&#160;&#160;&#160;&#160; seq=72&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; RM_ENLISTED_IN_TRANSACTION&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />pid=5524&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; tid=5404&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; time=01/23/2015-12:11:48.822&#160;&#160;&#160;&#160;&#160;&#160; seq=73&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <strong>RECEIVED_COMMIT_REQUEST_FROM_BEGINNER</strong>    <br />pid=5524&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; tid=5404&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; time=01/23/2015-12:11:48.822&#160;&#160;&#160;&#160;&#160;&#160; seq=74&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <strong>TRANSACTION_COMMITTED</strong>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </p>  <h6>Without TMONEPHASE</h6>  <p>The situation is better when we do use the one-phase optimizations:</p>  <p>pid=5888&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; tid=5808&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; time=01/23/2015-12:14:46.586&#160;&#160;&#160;&#160;&#160;&#160; seq=3473&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; eventid=RM_ENLISTED_IN_TRANSACTION    <br />pid=5888&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; tid=5808&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; time=01/23/2015-12:14:46.586&#160;&#160;&#160;&#160;&#160;&#160; seq=3474&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; eventid=RM_ENLISTED_IN_TRANSACTION     <br />pid=5888&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; tid=5808&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; time=01/23/2015-12:14:46.586&#160;&#160;&#160;&#160;&#160;&#160; seq=3475&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; eventid=RM_ISSUED_PREPARE&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />pid=5888&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; tid=5808&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; time=01/23/2015-12:14:46.586&#160;&#160;&#160;&#160;&#160;&#160; seq=3476&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; eventid=RM_ISSUED_PREPARE&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />pid=5888&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; tid=5808&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; time=01/23/2015-12:14:46.601&#160;&#160;&#160;&#160;&#160;&#160; seq=3477&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; eventid=RM_VOTED_COMMIT&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />pid=5888&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; tid=5808&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; time=01/23/2015-12:14:46.601&#160;&#160;&#160;&#160;&#160;&#160; seq=3478&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; eventid=RM_VOTED_COMMIT&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />pid=5888&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; tid=5808&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; time=01/23/2015-12:14:46.617&#160;&#160;&#160;&#160;&#160;&#160; seq=3479&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; eventid=RM_ISSUED_COMMIT&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />pid=5888&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; tid=5808&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; time=01/23/2015-12:14:46.617&#160;&#160;&#160;&#160;&#160;&#160; seq=3480&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; eventid=RM_ISSUED_COMMIT&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />pid=5888&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; tid=5808&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; time=01/23/2015-12:14:46.617&#160;&#160;&#160;&#160;&#160;&#160; seq=3481&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; eventid=RM_ACKNOWLEDGED_COMMIT&#160;&#160;&#160;&#160; <br />pid=5888&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; tid=5808&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; time=01/23/2015-12:14:46.617&#160;&#160;&#160;&#160;&#160;&#160; seq=3482&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; eventid=RM_ACKNOWLEDGED_COMMIT&#160;&#160;&#160;&#160; </p>  <p>Compare this to the Transaction::Commit call which does not utilize one-phase commit optimizations (I’ve bolded what is missing)::</p>  <p>pid=5524&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; tid=5380&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; time=01/23/2015-12:12:03.348&#160;&#160;&#160;&#160;&#160;&#160; seq=12141&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <strong>TRANSACTION_BEGUN</strong>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />pid=5524&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; tid=5980&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; time=01/23/2015-12:12:03.348&#160;&#160;&#160;&#160;&#160;&#160; seq=12142&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; RM_ENLISTED_IN_TRANSACTION&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />pid=5524&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; tid=5380&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; time=01/23/2015-12:12:03.348&#160;&#160;&#160;&#160;&#160;&#160; seq=12143&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; RM_ENLISTED_IN_TRANSACTION&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />pid=5524&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; tid=5380&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; time=01/23/2015-12:12:03.348&#160;&#160;&#160;&#160;&#160;&#160; seq=12144&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <strong>RECEIVED_COMMIT_REQUEST_FROM_BEGINNER</strong>     <br />pid=5524&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; tid=5380&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; time=01/23/2015-12:12:03.348&#160;&#160;&#160;&#160;&#160;&#160; seq=12145&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; RM_ISSUED_PREPARE&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />pid=5524&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; tid=5380&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; time=01/23/2015-12:12:03.348&#160;&#160;&#160;&#160;&#160;&#160; seq=12146&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; RM_ISSUED_PREPARE&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />pid=5524&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; tid=5380&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; time=01/23/2015-12:12:03.348&#160;&#160;&#160;&#160;&#160;&#160; seq=12147&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; RM_VOTED_COMMIT&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />pid=5524&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; tid=5980&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; time=01/23/2015-12:12:03.348&#160;&#160;&#160;&#160;&#160;&#160; seq=12148&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; RM_VOTED_COMMIT&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />pid=5524&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; tid=5980&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; time=01/23/2015-12:12:03.364&#160;&#160;&#160;&#160;&#160;&#160; seq=12149&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <strong>TRANSACTION_COMMITTED</strong>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />pid=5524&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; tid=5980&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; time=01/23/2015-12:12:03.364&#160;&#160;&#160;&#160;&#160;&#160; seq=12150&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; RM_ISSUED_COMMIT&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />pid=5524&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; tid=5980&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; time=01/23/2015-12:12:03.364&#160;&#160;&#160;&#160;&#160;&#160; seq=12151&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; RM_ISSUED_COMMIT&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />pid=5524&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; tid=5980&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; time=01/23/2015-12:12:03.364&#160;&#160;&#160;&#160;&#160;&#160; seq=12152&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; RM_ACKNOWLEDGED_COMMIT&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />pid=5524&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; tid=5380&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; time=01/23/2015-12:12:03.364&#160;&#160;&#160;&#160;&#160;&#160; seq=12153&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; RM_ACKNOWLEDGED_COMMIT&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </p>  <p>I’ll be following this entry up later with some information about XA performance compared to OleTx transactions. </p>]]></content:encoded>
    </item>
    <item>
      <title>The IObjectControl::Activate() method failed - Error Code = 0x800a01a8</title>
      <link>https://docs.microsoft.com/archive/blogs/tdevere/the-iobjectcontrolactivate-method-failed-error-code-0x800a01a8</link>
      <pubDate>Tue, 25 Nov 2014 13:38:13 GMT</pubDate>
      <dc:creator><![CDATA[Tony DeVere]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/tdevere/2014/11/25/the-iobjectcontrolactivate-method-failed-error-code-0x800a01a8/</guid>
      <description><![CDATA[&#160;  My customer was migrating from Windows 2003 to Windows 2012 R2. Part of the application...]]></description>
      <content:encoded><![CDATA[<p>&#160;</p>  <p><font size="3">My customer was migrating from Windows 2003 to Windows 2012 R2. Part of the application still ran classic ASP and VB6 COM+ components in IIS. Their COM+ component requires ASP sessions state so <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms688285(v=vs.85).aspx#iisintrinsics" target="_blank">IISIntrinsics</a> was enabled for the component. However, in the new Windows 2012 R2 environment, when the VB6 component requested a value from Session the COM application would fail and the COM+ runtime threw this error:</font></p>  <blockquote>   <p style="font-size: 11pt; font-family: calibri; margin: 0in" align="left"><font color="#000000">Server Application ID: {G846F1C5-9A3F-4A78-B513-CDEA1048DB9C}</font></p>    <p style="font-size: 11pt; font-family: calibri; margin: 0in" align="left"><font color="#000000">Server Application Instance ID:</font></p>    <p style="font-size: 11pt; font-family: calibri; margin: 0in" align="left"><font color="#000000">{10232175-0BC5-404A-8440-A8EE01644BAD}</font></p>    <p style="font-size: 11pt; font-family: calibri; margin: 0in" align="left"><font color="#000000">Server Application Name: myCOMPlusServer</font></p>    <p style="font-size: 11pt; font-family: calibri; margin: 0in" align="left"><font color="#000000">Error Code = 0x800a01a8 : </font></p>    <p style="font-size: 11pt; font-family: calibri; margin: 0in" align="left"><font color="#000000">COM+ Services Internals Information:</font></p>    <p style="font-size: 11pt; font-family: calibri; margin: 0in" align="left"><font color="#000000">File: com\complus\src\comsvcs\jit\jit.cpp, Line: 538</font></p>    <p style="font-size: 11pt; font-family: calibri; margin: 0in" align="left"><font color="#000000">Comsvcs.dll file version: ENU 2001.12.10530.16384 shp</font></p> </blockquote>  <p><font size="3">So why is the Session not available for the COM+ application even though IISIntrinsics was enabled for the COM+ component? </font></p>  <h1><font size="3">Debugging Notes</font></h1>  <p><font size="3">The thread handling the ASP call was marked as MULTITHREADED but the VB6 component was compiled with APARTMENTTHREADED. The effect of this combination forces the thread handling the incoming ASP call to switch threads and allow COM marshalling to call into a different COM apartment. The call to the APARTMENTTHREADED context though, does not pass the IISIntrinsics along which is why it’s unavailable to our COM object despite having IISIntrinsics enabled. </font></p>  <p><font size="3">So was this <em>the</em> default behavior? And can we control the apartment type IIS uses to launch ASP applications? The answers are No and Yes. Inside the IIS Service manager, the <a href="https://msdn.microsoft.com/en-us/library/ms691449(v=vs.90).aspx" target="_blank">executeInMta</a> was set to ‘true’ for my customer and by default it should be false. </font></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/67/37/metablogapi/4722.clip_image001_51FD15A8.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-67-37-metablogapi/4722.clip_5F00_image001_5F00_51FD15A8.png"><font color="#333333" size="3"><img title="clip_image001" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; margin-left: 0px; display: inline; border-top-width: 0px; margin-right: 0px" border="0" alt="clip_image001" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/67/37/metablogapi/7506.clip_image001_thumb_6CC93BB4.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-67-37-metablogapi/7506.clip_5F00_image001_5F00_thumb_5F00_6CC93BB4.png" width="442" align="left" height="303" /></font></a></p>  <p><font size="3"></font></p>  <p><font size="3"></font></p>  <p><font size="3"></font></p>  <p><font size="3"></font></p>  <p><font size="3"></font></p>  <p><font size="3"></font></p>  <p><font size="3"></font></p>  <p><font size="3"></font></p>  <p><font size="3"></font></p>]]></content:encoded>
    </item>
    <item>
      <title>SSL HandShake ClientHello receives Encrypted Alert</title>
      <link>https://docs.microsoft.com/archive/blogs/tdevere/ssl-handshake-clienthello-receives-encrypted-alert</link>
      <pubDate>Tue, 11 Nov 2014 09:47:00 GMT</pubDate>
      <dc:creator><![CDATA[Tony DeVere]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/tdevere/2014/11/11/ssl-handshake-clienthello-receives-encrypted-alert/</guid>
      <description><![CDATA[My customer recently ran into a problem worth recounting. He had several machines which had a WCF...]]></description>
      <content:encoded><![CDATA[<p><span style="font-size: small">My customer recently ran into a problem worth recounting. He had several machines which had a WCF application which made a secure SSL connection to a remote Web Service. However, a new set of machines built could not connect to the same endpoint using SSL. The new machines received the error: Could not create SSL/TLS secure channel</span></p>  <p><span style="font-size: small">We took network traces on the failing system and found the Client Hello call received an Encrypted Alert from the remote web service:</span></p>  <blockquote>   <p><span style="font-size: small">- TLS: TLS Rec Layer-1 HandShake: Client Hello.</span></p>    <p style="font-size: 11pt; font-family: calibri; margin: 0in"><span style="font-size: small"><span style="mso-spacerun: yes">&#160;&#160; </span>- SSLHandshake: SSL HandShake ClientHello(0x01)</span></p>    <p style="font-size: 11pt; font-family: calibri; margin: 0in"><span style="font-size: small"><span style="mso-spacerun: yes">&#160;&#160;&#160;&#160;&#160; </span>HandShakeType: ClientHello(0x01)</span></p>    <p style="font-size: 11pt; font-family: calibri; margin: 0in"><span style="font-size: small"><span style="mso-spacerun: yes">&#160;&#160;&#160;&#160;&#160; </span>Length: 111 (0x6F)</span></p>    <p style="font-size: 11pt; font-family: calibri; margin: 0in"><span style="font-size: small"><span style="mso-spacerun: yes">&#160;&#160;&#160; </span>+ ClientHello: TLS 1.0</span></p>    <p style="font-size: 11pt; font-family: calibri; margin: 0in"><span style="font-size: small">&#160;</span></p>    <p style="font-size: 11pt; font-family: calibri; margin: 0in"><span style="font-size: small">- TLS: TLS Rec Layer-1 Encrypted Alert</span></p>    <p style="font-size: 11pt; font-family: calibri; margin: 0in"><span style="font-size: small"><span style="mso-spacerun: yes">&#160; </span>- TlsRecordLayer: TLS Rec Layer-1 Encrypted Alert</span></p>    <p style="font-size: 11pt; font-family: calibri; margin: 0in"><span style="font-size: small"><span style="mso-spacerun: yes">&#160;&#160;&#160;&#160; </span>ContentType: Encrypted Alert</span></p>    <p style="font-size: 11pt; font-family: calibri; margin: 0in"><span style="font-size: small"><span style="mso-spacerun: yes">&#160;&#160; </span>+ Version: TLS 1.0</span></p>    <p style="font-size: 11pt; font-family: calibri; margin: 0in"><span style="font-size: small"><span style="mso-spacerun: yes">&#160;&#160;&#160;&#160; </span>Length: 2 (0x2)</span></p>    <p style="font-size: 11pt; font-family: calibri; margin: 0in"><span style="font-size: small"><span style="mso-spacerun: yes">&#160;&#160;&#160;&#160; </span>EncryptedData: Binary Large Object (2 Bytes)</span></p> </blockquote>  <p><span style="font-size: small">The Encrypted Alert value can be seen with Netmon in the Hex Details:</span></p>  <blockquote>   <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/67/37/metablogapi/6521.clip_image0017_372EE6B3.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-67-37-metablogapi/6521.clip_5F00_image0017_5F00_372EE6B3.png"><span style="font-size: small"><img title="clip_image001[7]" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="clip_image001[7]" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/67/37/metablogapi/7115.clip_image0017_thumb_3B3BC536.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-67-37-metablogapi/7115.clip_5F00_image0017_5F00_thumb_5F00_3B3BC536.png" width="244" height="153" /></span></a></p> </blockquote>  <p><span style="font-size: small">We can convert the hex data to a meaningful message using the specification for TLS 1.0 from </span><a href="https://www.ietf.org/rfc/rfc2246.txt"><span style="font-size: small">https://www.ietf.org/rfc/rfc2246.txt</span></a></p>  <blockquote>   <p style="font-size: 11pt; font-family: calibri; margin: 0in"><span style="font-size: small">7.2. Alert protocol</span></p>    <p style="font-size: 11pt; font-family: calibri; margin: 0in"><span style="font-weight: bold"><span style="font-size: small">fatal(2)</span></span></p>    <p style="font-size: 11pt; font-family: calibri; margin: 0in"><span style="font-weight: bold"><span style="font-size: small">handshake_failure(40) (28 to hex is 40)</span></span></p> </blockquote>  <p><span style="font-size: small">So the remote server is reporting a handshake failure. So we asked, what is different about this client request and our working clients? The answer was our failing client was missing any RC4 ciphers:</span></p>  <blockquote>   <p style="font-size: 11pt; font-family: calibri; margin: 0in"><span style="font-size: small"><span style="mso-spacerun: yes">&#160;&#160;&#160;&#160;&#160;&#160; </span>CipherSuitesLength: 20</span></p>    <p style="font-size: 11pt; font-family: calibri; margin: 0in"><span style="font-size: small"><span style="mso-spacerun: yes">&#160;&#160;&#160;&#160; </span>+ TLSCipherSuites: TLS_RSA_WITH_AES_128_CBC_SHA<span style="mso-spacerun: yes">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span></p>    <p style="font-size: 11pt; font-family: calibri; margin: 0in"><span style="font-size: small"><span style="mso-spacerun: yes">&#160;&#160;&#160;&#160; </span>+ TLSCipherSuites: TLS_RSA_WITH_AES_256_CBC_SHA<span style="mso-spacerun: yes">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span></p>    <p style="font-size: 11pt; font-family: calibri; margin: 0in"><span style="font-size: small"><span style="mso-spacerun: yes">&#160;&#160;&#160;&#160; </span>+ TLSCipherSuites: TLS_RSA_WITH_3DES_EDE_CBC_SHA<span style="mso-spacerun: yes">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span></p>    <p style="font-size: 11pt; font-family: calibri; margin: 0in"><span style="font-size: small"><span style="mso-spacerun: yes">&#160;&#160;&#160;&#160; </span>+ TLSCipherSuites: TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA<span style="mso-spacerun: yes">&#160;&#160;&#160;&#160; </span></span></p>    <p style="font-size: 11pt; font-family: calibri; margin: 0in"><span style="font-size: small"><span style="mso-spacerun: yes">&#160;&#160;&#160;&#160; </span>+ TLSCipherSuites: TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA<span style="mso-spacerun: yes">&#160;&#160;&#160; </span></span></p>    <p style="font-size: 11pt; font-family: calibri; margin: 0in"><span style="font-size: small"><span style="mso-spacerun: yes">&#160;&#160;&#160;&#160; </span>+ TLSCipherSuites: TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA<span style="mso-spacerun: yes">&#160;</span></span></p>    <p style="font-size: 11pt; font-family: calibri; margin: 0in"><span style="font-size: small"><span style="mso-spacerun: yes">&#160;&#160;&#160;&#160; </span>+ TLSCipherSuites: TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA</span></p>    <p style="font-size: 11pt; font-family: calibri; margin: 0in"><span style="font-size: small"><span style="mso-spacerun: yes">&#160;&#160;&#160;&#160; </span>+ TLSCipherSuites: TLS_DHE_DSS_WITH_AES_128_CBC_SHA<span style="mso-spacerun: yes">&#160;</span></span></p>    <p style="font-size: 11pt; font-family: calibri; margin: 0in"><span style="font-size: small"><span style="mso-spacerun: yes">&#160;&#160;&#160;&#160; </span>+ TLSCipherSuites: TLS_DHE_DSS_WITH_AES_256_CBC_SHA</span></p>    <p style="font-size: 11pt; font-family: calibri; margin: 0in"><span style="font-size: small"><span style="mso-spacerun: yes">&#160;&#160;&#160;&#160; </span>+ TLSCipherSuites: TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA</span></p> </blockquote>  <p><span style="font-size: small">The working client request contained these ciphers additionally:</span></p>  <blockquote>   <p style="font-size: 11pt; font-family: calibri; margin: 0in"><span style="font-size: small">TLS_RSA_WITH_RC4_128_SHA</span></p>    <p style="font-size: 11pt; font-family: calibri; margin: 0in"><span style="font-size: small">TLS_RSA_WITH_RC4_128_MD5</span></p> </blockquote>  <p><span style="font-size: small">And within the ServerHello, we can see the server has preferred the TLS_RSA_WITH_RC4_128_SHA=</span></p>  <blockquote>   <p style="font-size: 11pt; font-family: calibri; margin: 0in"><span style="font-size: small">- SSLHandshake: SSL HandShake ServerHello(0x02)</span></p>    <p style="font-size: 11pt; font-family: calibri; margin: 0in"><span style="font-size: small"><span style="mso-spacerun: yes">&#160;&#160;&#160;&#160;&#160;&#160; </span>TLSCipherSuite: TLS_RSA_WITH_RC4_128_SHA<span style="mso-spacerun: yes">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span>{ 0x00,0x05 }</span></p> </blockquote>  <p><span style="font-size: small">So what mechanism controls whether the client sends this RC4 cipher? The answer depends on a number of factors. </span></p>  <p><span style="font-weight: bold; font-style: italic"><span style="font-size: small">Microsoft Security Advisory 2868725</span></span></p>  <p style="font-size: 11pt; font-family: calibri; margin: 0in"><span style="font-size: small">Published: November 12, 2013</span></p>  <p style="font-size: 11pt; font-family: calibri; margin: 0in"><a href="https://technet.microsoft.com/library/security/2868725"><span style="font-size: small">https://technet.microsoft.com/library/security/2868725</span></a></p>  <p style="font-size: 11pt; font-family: calibri; margin: 0in"><span style="font-size: small">&#160;</span></p>  <p style="font-size: 11pt; font-family: calibri; margin: 0in"><span style="font-size: small">This update supports the removal of RC4 as an available cipher on affected systems through registry settings. It also allows developers to remove RC4 in individual applications through the use of the SCH_USE_STRONG_CRYPTO flag in the SCHANNEL_CRED structure. <span style="text-decoration: underline; font-weight: bold">These options are not enabled by default.</span> </span></p>  <p style="font-size: 11pt; font-family: calibri; margin: 0in"><span style="font-size: small">&#160;</span></p>  <p style="font-size: 11pt; font-family: calibri; margin: 0in"><span style="font-weight: bold; font-style: italic"><span style="font-size: small">Update for Disabling RC4 in .NET TLS</span></span></p>  <p style="font-size: 11pt; font-family: calibri; margin: 0in"><span style="font-size: small">Published: May 13, 2014 | Updated: July 8, 2014</span></p>  <p style="font-size: 11pt; font-family: calibri; margin: 0in"><a href="https://technet.microsoft.com/library/security/2960358"><span style="font-size: small">https://technet.microsoft.com/library/security/2960358</span></a></p>  <p style="font-size: 11pt; font-family: calibri; margin: 0in"><span style="font-size: small">&#160;</span></p>  <p style="font-size: 11pt; font-family: calibri; margin: 0in"><span style="font-size: small">My customer was at a later version of System.dll and Schannel.dll which contained these security updates and both systems were the same on version. Now, we went to check to see if the ciphers were disabled:</span></p>  <p style="font-size: 11pt; font-family: calibri; margin: 0in"><span style="font-size: small">&#160;</span></p>  <p style="font-size: 11pt; font-family: calibri; margin: 0in"><span style="font-weight: bold; font-style: italic"><span style="font-size: small">How to completely disable RC4</span></span></p>  <p style="font-size: 11pt; font-family: calibri; margin: 0in"><span style="font-size: small">Clients that deploy this setting will be unable to connect to sites that require RC4, and servers that deploy this setting will be unable to service clients that must use RC4. </span></p>  <p style="font-size: 11pt; font-family: calibri; margin: 0in"><span style="font-size: small">&#160;</span></p>  <p style="font-size: 11pt; font-family: calibri; margin: 0in"><span style="font-size: small">[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Ciphers\RC4 128/128]</span></p>  <p style="font-size: 11pt; font-family: calibri; margin: 0in"><span style="font-size: small"><span style="mso-spacerun: yes">&#160;</span>&quot;Enabled&quot;=dword:00000000 </span></p>  <p style="font-size: 11pt; font-family: calibri; margin: 0in"><span style="font-size: small">[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Ciphers\RC4 40/128]</span></p>  <p style="font-size: 11pt; font-family: calibri; margin: 0in"><span style="font-size: small"><span style="mso-spacerun: yes">&#160;</span>&quot;Enabled&quot;=dword:00000000</span></p>  <p style="font-size: 11pt; font-family: calibri; margin: 0in"><span style="font-size: small">[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Ciphers\RC4 56/128]</span></p>  <p style="font-size: 11pt; font-family: calibri; margin: 0in"><span style="font-size: small"><span style="mso-spacerun: yes">&#160;</span>&quot;Enabled&quot;=dword:00000000</span></p>  <p style="font-size: 11pt; font-family: calibri; margin: 0in"><span style="font-size: small">&#160;</span></p>  <p style="font-size: 11pt; font-family: calibri; margin: 0in"><span style="font-size: small">However, my customer did not have these values set on the working or failing system. </span></p>  <p style="font-size: 11pt; font-family: calibri; margin: 0in"><span style="font-size: small">&#160;</span></p>  <p style="font-size: 11pt; font-family: calibri; margin: 0in"><span style="font-size: small">This caused us to look for another explanation altogether which could explain why .NET clients were failing to use the RC4 cipher. We discovered that in our failing environment the following registry key was enabled:</span></p>  <p style="font-size: 11pt; font-family: calibri; margin: 0in"><span style="font-size: small">&#160;</span></p>  <p style="font-size: 11pt; font-family: calibri; margin: 0in"><span style="font-weight: bold; font-style: italic"><span style="font-size: small">SchUseStrongCrypto</span></span></p>  <p style="font-size: 11pt; font-family: calibri; margin: 0in"><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/aa379810(v=vs.85).aspx"><span style="font-size: small">https://msdn.microsoft.com/en-us/library/windows/desktop/aa379810(v=vs.85).aspx</span></a></p>  <p style="font-size: 11pt; font-family: calibri; margin: 0in"><span style="font-size: small">HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v4.0.30319\<span style="font-weight: bold">SchUseStrongCrypto</span></span></p>  <p style="font-size: 11pt; font-family: calibri; margin: 0in"><span style="font-size: small">Instructs Schannel to disable known weak cryptographic algorithms, cipher suites, and SSL/TLS protocol versions that may be otherwise enabled for better interoperability.</span></p>  <p style="font-size: 11pt; font-family: calibri; margin: 0in"><span style="font-size: small">&#160;</span></p>  <p style="font-size: 11pt; font-family: calibri; margin: 0in"><span style="font-size: small">After setting this value to 0 and rebooting the system, the client began to send RC4 ciphers.</span><span style="font-size: 11pt; font-family: calibri"><span style="font-size: small"><em><span style="text-decoration: underline"><strong>This is very important to note:</strong></span></em> that you should not use weak ciphers. A detailed response on the topic from Microsoft may be found here </span><a title="https://blogs.technet.com/b/srd/archive/2013/11/12/security-advisory-2868725-recommendation-to-disable-rc4.aspx" href="https://blogs.technet.com/b/srd/archive/2013/11/12/security-advisory-2868725-recommendation-to-disable-rc4.aspx"><span style="font-size: small">https://blogs.technet.com/b/srd/archive/2013/11/12/security-advisory-2868725-recommendation-to-disable-rc4.aspx</span></a><span style="font-size: small">.</span></span></p>  <p style="font-size: 11pt; font-family: calibri; margin: 0in">&#160;</p>  <p style="font-size: 11pt; font-family: calibri; margin: 0in"><span style="font-size: small"><span style="font-weight: bold; font-style: italic">Summary</span>: (updated 3/4/2015)</span></p>  <p style="font-size: 11pt; font-family: calibri; margin: 0in">&#160;</p>  <ol style="margin-bottom: 0in; font-size: 11pt; font-family: calibri; unicode-bidi: embed; font-weight: normal; direction: ltr; font-style: normal; margin-left: 0.375in; margin-top: 0in" type="1">   <li style="margin-bottom: 0px; vertical-align: middle; margin-top: 0px" value="value"><span style="font-size: 11pt; font-family: calibri; font-weight: normal; font-style: normal">Set your .NET Client to use </span><span style="font-size: 11pt; font-family: calibri">SSL3 <a title="https://msdn.microsoft.com/en-us/library/system.net.servicepointmanager.securityprotocol(v=vs.110).aspx" href="https://msdn.microsoft.com/en-us/library/system.net.servicepointmanager.securityprotocol(v=vs.110).aspx">https://msdn.microsoft.com/en-us/library/system.net.servicepointmanager.securityprotocol(v=vs.110).aspx</a></span></li>    <li style="margin-bottom: 0px; vertical-align: middle; margin-top: 0px">     <p>Set the following registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v4.0.30319\<span style="font-size: 11pt; font-family: calibri; font-weight: bold">SchUseStrongCrypto = 0. This disables the new security update disabling RC4 Ciphers.</span></p>   </li>    <li style="margin-bottom: 0px; vertical-align: middle; margin-top: 0px">If the your application is 32bit running on x64 windows, you’ll need to modify the same key under the HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\v4.0.30319</li> </ol>  <p style="margin-bottom: 0px; vertical-align: middle; margin-top: 0px"><font face="Calibri"></font></p>  <p style="margin-bottom: 0px; vertical-align: middle; margin-top: 0px">&#160;</p>  <p><span style="font-size: small">&#160;</span></p>]]></content:encoded>
    </item>
    <item>
      <title>Simple WSE Routing Sample for Classic SOAP Service</title>
      <link>https://docs.microsoft.com/archive/blogs/tdevere/simple-wse-routing-sample-for-classic-soap-service</link>
      <pubDate>Tue, 28 Oct 2014 16:22:00 GMT</pubDate>
      <dc:creator><![CDATA[Tony DeVere]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/tdevere/2014/10/28/simple-wse-routing-sample-for-classic-soap-service/</guid>
      <description><![CDATA[&nbsp;
&nbsp;
A customer came to me recently asking about options to migrate a set of SOAP...]]></description>
      <content:encoded><![CDATA[<p>&nbsp;</p>
<p>&nbsp;</p>
<h5>A customer came to me recently asking about options to migrate a set of SOAP services hosted on Windows 2003 into two new modern datacenters running Windows 2012. The most critical requirement for the customer was that the client remain unaware of the change and client proxies could not be modified.</h5>
<h5>We decided to insert the WSE Routing layer on the SOAP server layer. WSE routing is implemented through an IHttpHandler. Done this way, the handler can intercept the request for any of the client services and make routing decisions on behalf of the client.</h5>
<h5>So what&rsquo;s the rub then? Don&rsquo;t we have routing samples in the <a href="https://www.bing.com/search?q=wse+3.0+quickstarts" target="_blank">WSE QuickStart</a>? Yes, we do, however, they introduce some complexity which makes the most critical requirement, not modifying the client proxies, nearly impossible. The routing samples assume your clients were built using WSE and introduce a requirement for WS-Address to be present in the client request (which can be modified through a SoapFilter). However, we can rebuild the same project&nbsp;using only classic Web Service SOAP standards which really cleans up the project and demonstrates how simple it is to utilize WSE 3.0 routing for your classic SOAP service needs! Download <a href="https://1drv.ms/1tf2clq" target="_blank">WSE_Soap_Router</a>!</h5>
<h5>Components of the Sample:</h5>
<ul>
<li>
<h5>ClassicSoapClient &ndash; console application which was a web reference to DataCenter.asmx</h5>
</li>
<li>
<h5><strong>WSE_Routing_Sample</strong> &ndash; Classic ASMX web project with two web services:</h5>
</li>
<ul>
<li>
<h5>DataCenter.asmx &ndash; ClassSoapClient was built against this service</h5>
</li>
<li>
<h5>DataCenter1.asmx &ndash;&nbsp; this is where the call will be routed instead</h5>
</li>
</ul>
<li>
<h5>SoapRouter.cs &ndash; this is also contained in the WSE_Routing_Sample web project and contains the logic to process the incoming SOAP message and route where desired</h5>
</li>
</ul>]]></content:encoded>
    </item>
  </channel>
</rss>