<?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>Software Sleuthing</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/joshpoley/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/joshpoley/feed.xml</link>
    <description>Software Testing, Development, and Related</description>
    <lastBuildDate>Wed, 17 Apr 2019 03:23:30 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Blog Migration</title>
      <link>https://docs.microsoft.com/archive/blogs/joshpoley/blog-migration</link>
      <pubDate>Sat, 22 Oct 2011 08:04:41 GMT</pubDate>
      <dc:creator><![CDATA[Josh Poley]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/joshpoley/2011/10/22/blog-migration/</guid>
      <description><![CDATA[For more flexibility in my posting options, I'm moving off of blogs.msdn.com. New posts can be found...]]></description>
      <content:encoded><![CDATA[<p>For more flexibility in my posting options, I'm moving off of blogs.msdn.com. New posts can be found <a href="https://joshpoley.blogspot.com/">here</a>.</p>]]></content:encoded>
    </item>
    <item>
      <title>Your Password is Too Secure</title>
      <link>https://docs.microsoft.com/archive/blogs/joshpoley/your-password-is-too-secure</link>
      <pubDate>Tue, 13 Sep 2011 08:27:00 GMT</pubDate>
      <dc:creator><![CDATA[Josh Poley]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/joshpoley/2011/09/13/your-password-is-too-secure/</guid>
      <description><![CDATA[For obvious reasons, Microsoft employees are asked to refrain from bashing other teams or products...]]></description>
      <content:encoded><![CDATA[<p>For obvious reasons, Microsoft employees are asked to refrain from bashing other teams or products in their blog posts. But with the dismantling of the Money product line a couple years ago, I feel the statute of limitations has expired and I can share a useful lesson.</p>
<p>At one point, I changed the password for my bank, and then went in to update the corresponding password in Microsoft Money so I could continue to download statements. Unfortunately, upon entering the password, I was met with this error box.</p>
<p style="text-align: center;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/94/85/0458.badUI%20-%20password.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-94-85/0458.badUI-_2D00_-password.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/94/85/0458.badUI%20-%20password.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/314x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-94-85/0458.badUI-_2D00_-password.png" border="0" alt="" /></a></p>
<p></p>
<p>Here is a product, which is charged with protecting my most important data, and it is telling me that it can't accept a password which any typical computer-savvy user would consider a normal "<a href="https://en.wikipedia.org/wiki/Password_strength">strong</a>" password. After seeing this message, <i>my brain stopped working</i>. If anything, a product which deals with access to someone's money should favor the uber-paranoid side of the security fence. But here was a product that actually limits a password's complexity and forced users to a weak one.</p>
<p>I can understand <i>reasonable</i> limits on length as there may be storage or processing concerns (I've run into web sites where an eight-character password was too long, and no, that is not a reasonable limit). But if you are working on the password-processing feature of your software, gimping a password's strength is something that should be avoided at all costs.</p>
<p>As an aside, you can use <a href="https://www.microsoft.com/security/pc-security/password-checker.aspx">this utility</a> to help gauge whether or not <i>your</i> password is strong.</p>]]></content:encoded>
    </item>
    <item>
      <title>WinDbg / i386kd Primer</title>
      <link>https://docs.microsoft.com/archive/blogs/joshpoley/windbg-i386kd-primer</link>
      <pubDate>Mon, 29 Aug 2011 11:59:29 GMT</pubDate>
      <dc:creator><![CDATA[Josh Poley]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/joshpoley/2011/08/29/windbg-i386kd-primer/</guid>
      <description><![CDATA[A handful of people on my team are working with the Windows code base to ensure we don't break them...]]></description>
      <content:encoded><![CDATA[<p>A handful of people on my team are working with the Windows code base to ensure we don't break them with compiler changes, and since some of them were new to kernel debugging, I put together a rather quick introduction to <a href="https://www.microsoft.com/whdc/devtools/debugging/default.mspx">windbg/i386kd</a>. The slide deck can be found <a href="https://docs.google.com/present/view?id=0AZOAQ1DIXFd4ZGdqZ2R4OWhfMTFmZDhoY2JnZg&amp;hl=en">here</a>.</p>]]></content:encoded>
    </item>
    <item>
      <title>Console output with a transparent background color</title>
      <link>https://docs.microsoft.com/archive/blogs/joshpoley/console-output-with-a-transparent-background-color</link>
      <pubDate>Tue, 26 Jul 2011 08:02:44 GMT</pubDate>
      <dc:creator><![CDATA[Josh Poley]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/joshpoley/2011/07/26/console-output-with-a-transparent-background-color/</guid>
      <description><![CDATA[In Windows land, if you want to print out colored text to a console, you will probably end up...]]></description>
      <content:encoded><![CDATA[<p>In Windows land, if you want to print out colored text to a console, you will probably end up calling <a href="https://msdn.microsoft.com/en-us/library/ms686047.aspx">SetConsoleTextAttribute</a> to set the desired color, then calling it again to restore the original settings. Unfortunately the documentation doesn't make it very clear how to change <i>just</i> the foreground color; which, in my experience, is a fairly common scenario. (You will still need to worry about clashing or unreadable text, but that is outside of the scope of this post.)</p>
<p></p>
<div style="color: black; margin: 0 0 10 0; padding: 10 10 10 10; border: solid 1px black; background-color: #fffecb; font: normal 9pt Courier New;">HANDLE consoleOut = GetStdHandle(STD_OUTPUT_HANDLE);<br /> <br /> CONSOLE_SCREEN_BUFFER_INFO csbiInfo = {0};<br /> GetConsoleScreenBufferInfo(consoleOut, &amp;csbiInfo);<br /> <br /> SetConsoleTextAttribute(consoleOut, FOREGROUND_INTENSITY | FOREGROUND_RED | <br /> &nbsp;&nbsp;&nbsp;&nbsp;(csbiInfo.wAttributes &amp; (0x00F0)));<br /> <br /> printf(<span style="color: maroon;">"Foreground red, background unchanged\n"</span>);<br /> <br /> <span style="color: green;">// restore the original colors<br /> </span>SetConsoleTextAttribute(consoleOut, csbiInfo.wAttributes);</div>
<p></p>
<p>The magic part is where we OR in the original attributes with a bit mask of 0x00F0 which just keeps the BACKGROUND_* values intact. The un-obvious (and extremely useful) thing to note, is that the original background will be kept intact even if it can't be expressed in the provided 4 bits of information (i.e. the user has defined a custom color using a 24-bit RGB value).</p>]]></content:encoded>
    </item>
    <item>
      <title>How Testers Test versus How Users Use</title>
      <link>https://docs.microsoft.com/archive/blogs/joshpoley/how-testers-test-versus-how-users-use</link>
      <pubDate>Mon, 11 Jul 2011 09:05:00 GMT</pubDate>
      <dc:creator><![CDATA[Josh Poley]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/joshpoley/2011/07/11/how-testers-test-versus-how-users-use/</guid>
      <description><![CDATA[With the emphasis on SDETs and generic Engineering teams, I've seen a growing disparity in how...]]></description>
      <content:encoded><![CDATA[<p>With the emphasis on SDETs and generic Engineering teams, I've seen a growing disparity in how products are being tested versus how users actually use a product. Because it is often very easy to crank out more test cases (especially ones which just iterate on existing tests), testers often lose focus of what is actually important to a customer.</p>
<p></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/94/85/6825.Test%20vs%20User%20Venn.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-94-85/6825.Test-vs-User-Venn.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/94/85/6825.Test%20vs%20User%20Venn.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x363/__key/communityserver-blogs-components-weblogfiles/00-00-00-94-85/6825.Test-vs-User-Venn.png" border="0" alt="" style="display: block; margin-left: auto; margin-right: auto;" /></a></p>
<p></p>
<p>When looking at your automation ask yourself these questions:</p>
<ul>
<li>Are my tests focused on the functionality which users care the most about? Figure out what matters the most to users. If users spend 80% of their time in one area of your product, that is where 80% of your testing should be as well.</li>
<li>How much time (both development-time and execution-time) is invested in edge/corner cases versus actual user scenarios? A finely-tuned unit-test suite is a great thing to have, but is not a substitute for actually testing the software. It is just too easy to spend more time adding variations and more test cases that don't offer any additional benefit.</li>
<li>Does the automation correctly hit all the same code paths under the same environmental situations? If your automation is relying too heavily on internal hooks at lower levels, it might not be exercising the software the way a user will be. Any deviation will reduce the effectiveness of the tests.</li>
<li>Are test cases executing in a "pristine" state? Often tests are run on a clean system, after a fresh install, utilizing perfectly scripted steps over clean data. Users don't work like that. Run tests under a heavily loaded system. Intermix test scenarios to mimic the user moving chaotically through the software. Use real-world data sets. Then on top of all that, throw in some task-switches, network fluctuations, etc.</li>
</ul>
<p>To make customers happy, you need a way to quantify how Customerized your tests are. If the "how testers test the product" circle fully overlaps the "how a customer uses the product" circle, then your tests are highly Customerized, and you will have a better chance at satisfying your customers.</p>]]></content:encoded>
    </item>
    <item>
      <title>Hex Conversion via a Batch File</title>
      <link>https://docs.microsoft.com/archive/blogs/joshpoley/hex-conversion-via-a-batch-file</link>
      <pubDate>Wed, 29 Jun 2011 08:27:00 GMT</pubDate>
      <dc:creator><![CDATA[Josh Poley]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/joshpoley/2011/06/29/hex-conversion-via-a-batch-file/</guid>
      <description><![CDATA[Occasionally, when something bad happens, an application will return an exception code (which is...]]></description>
      <content:encoded><![CDATA[<p>Occasionally, when something bad happens, an application will return an <a href="https://blogs.msdn.com/b/joshpoley/archive/2011/06/13/common-process-termination-values.aspx">exception code</a> (which is occasionally an <a href="https://msdn.microsoft.com/en-us/library/cc704588.aspx">NTSTATUS</a> value). Unfortunately dumping out %ERRORLEVEL% can give you a negative value which makes looking up the error a little harder. Since I was in batch-land, I had the desire to take the value and print it out in a hex format, which drastically simplified my diagnosis efforts.</p>
<p>Below is some batch code which will take a two's-compliment value, and print it out as an unsigned hexadecimal value. The basic algorithm is not very difficult (see 'hexloop' below): take the "ones place" digit off (by mod 16) and stick it in the result, then divide the input down by 16 and repeat. The tricky part comes when we have a negative value and thus need to deal with unsigned values that go beyond the range of a positively signed 32-bit value.</p>
<p>To deal with this we first figure out how far past the MAX_INT value we are (stored in _offset). We then break the number into two parts so that we can operate on them in the positive side of a signed variable. Into each part, we then need to add in the equivalent (also broken apart) MAX_INT pieces. The first part (the first digit) is handled immediately; for the remaining digits, we just fall down into the normal processing loop. Note that we are using <a href="https://blogs.msdn.com/b/joshpoley/archive/2011/06/03/batch-file-string-substitution-with-nested-environment-variables.aspx">the ! syntax</a> for variables inside the 'if' statement as that helps keep the processor from getting confused.</p>
<div style="margin-top: 0px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; background-color: #fffecb; font: normal normal normal 9pt/normal 'Courier New'; border-width: 1px; border-color: black; border-style: solid; padding: 10px;"><span style="color: blue;">@echo</span> off<br /> <span style="color: blue;">setlocal</span><br /><span style="color: blue;">setlocal</span>&nbsp;ENABLEDELAYEDEXPANSION<br /><br /><span color="#0000ff" style="color: #0000ff;"></span> <span style="color: blue;">call</span> :tohex %1<br /> <span style="color: blue;">echo</span> %_DECVAL% == 0x%_HEXVAL%<br /> <br /> <span style="color: blue;">goto</span> :eof<br /> <br /> <strong style="color: black;">:tohex</strong><br /> &nbsp;&nbsp;&nbsp;&nbsp;set _DECVAL=%1<br /> &nbsp;&nbsp;&nbsp;&nbsp;set _HEXVAL=<br /> &nbsp;&nbsp;&nbsp;&nbsp;set _VAL=%1<br /> &nbsp;&nbsp;&nbsp;&nbsp;if %1 LSS 0 (<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;REM <span style="color: blue;">break</span> the number into two parts so that we can output the<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;REM full value within the bounds of a 32 bit signed value<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;set /A _offset=<span style="color: maroon;">"-(-2147483647 - !_VAL!) + 2"</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;set /A _VAL=<span style="color: maroon;">"!_offset! / 16 + 0x7FFFFFF"</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;set /A _P=<span style="color: maroon;">"!_offset! %% 16 + 0xF"</span><br /> <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if !_P! GEQ 16 (<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;set /A _VAL=<span style="color: maroon;">"!_VAL! + 1"</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;set /A _P=<span style="color: maroon;">"!_P! %% 16"</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;)<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if !_P! LEQ 9 <span style="color: blue;">set</span> _HEXVAL=!_P!!_HEXVAL!<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if <span style="color: maroon;">"!_P!"</span> == <span style="color: maroon;">"10"</span> <span style="color: blue;">set</span> _HEXVAL=A!_HEXVAL!<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if <span style="color: maroon;">"!_P!"</span> == <span style="color: maroon;">"11"</span> <span style="color: blue;">set</span> _HEXVAL=B!_HEXVAL!<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if <span style="color: maroon;">"!_P!"</span> == <span style="color: maroon;">"12"</span> <span style="color: blue;">set</span> _HEXVAL=C!_HEXVAL!<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if <span style="color: maroon;">"!_P!"</span> == <span style="color: maroon;">"13"</span> <span style="color: blue;">set</span> _HEXVAL=D!_HEXVAL!<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if <span style="color: maroon;">"!_P!"</span> == <span style="color: maroon;">"14"</span> <span style="color: blue;">set</span> _HEXVAL=E!_HEXVAL!<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if <span style="color: maroon;">"!_P!"</span> == <span style="color: maroon;">"15"</span> <span style="color: blue;">set</span> _HEXVAL=F!_HEXVAL!<br /> &nbsp;&nbsp;&nbsp;&nbsp;)<br /> <br /> &nbsp;&nbsp;&nbsp;&nbsp;<strong style="color: black;">:hexloop</strong><br /> &nbsp;&nbsp;&nbsp;&nbsp;set /A _P=<span style="color: maroon;">"%_VAL% %% 16"</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;if %_P% LEQ 9 <span style="color: blue;">set</span> _HEXVAL=%_P%%_HEXVAL%<br /> &nbsp;&nbsp;&nbsp;&nbsp;if <span style="color: maroon;">"%_P%"</span> == <span style="color: maroon;">"10"</span> <span style="color: blue;">set</span> _HEXVAL=A%_HEXVAL%<br /> &nbsp;&nbsp;&nbsp;&nbsp;if <span style="color: maroon;">"%_P%"</span> == <span style="color: maroon;">"11"</span> <span style="color: blue;">set</span> _HEXVAL=B%_HEXVAL%<br /> &nbsp;&nbsp;&nbsp;&nbsp;if <span style="color: maroon;">"%_P%"</span> == <span style="color: maroon;">"12"</span> <span style="color: blue;">set</span> _HEXVAL=C%_HEXVAL%<br /> &nbsp;&nbsp;&nbsp;&nbsp;if <span style="color: maroon;">"%_P%"</span> == <span style="color: maroon;">"13"</span> <span style="color: blue;">set</span> _HEXVAL=D%_HEXVAL%<br /> &nbsp;&nbsp;&nbsp;&nbsp;if <span style="color: maroon;">"%_P%"</span> == <span style="color: maroon;">"14"</span> <span style="color: blue;">set</span> _HEXVAL=E%_HEXVAL%<br /> &nbsp;&nbsp;&nbsp;&nbsp;if <span style="color: maroon;">"%_P%"</span> == <span style="color: maroon;">"15"</span> <span style="color: blue;">set</span> _HEXVAL=F%_HEXVAL%<br /> &nbsp;&nbsp;&nbsp;&nbsp;set /A _VAL=<span style="color: maroon;">"%_VAL% / 16"</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;if <span style="color: maroon;">"%_VAL%"</span> == <span style="color: maroon;">"0"</span> <span style="color: blue;">goto</span> :endloop<br /> &nbsp;&nbsp;&nbsp;&nbsp;goto :hexloop<br /> &nbsp;&nbsp;&nbsp;&nbsp;<strong style="color: black;">:endloop</strong><br /> <br /> &nbsp;&nbsp;&nbsp;&nbsp;set _offset=<br /> &nbsp;&nbsp;&nbsp;&nbsp;set _P=<br /> &nbsp;&nbsp;&nbsp;&nbsp;set _VAL=<br /> &nbsp;&nbsp;&nbsp;&nbsp;goto :eof</div>]]></content:encoded>
    </item>
    <item>
      <title>Common Process Termination Values</title>
      <link>https://docs.microsoft.com/archive/blogs/joshpoley/common-process-termination-values</link>
      <pubDate>Mon, 13 Jun 2011 08:36:08 GMT</pubDate>
      <dc:creator><![CDATA[Josh Poley]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/joshpoley/2011/06/13/common-process-termination-values/</guid>
      <description><![CDATA[When your application does something the OS (or the application itself) doesn't like, often the...]]></description>
      <content:encoded><![CDATA[<p><span style="font-size: small;">When your application does something the OS (or the application itself) doesn't like, often the floor gets yanked out and the process is terminated in an abrupt manner. If you don't happen to be running with a debugger, often the easiest way to get an idea of what went wrong is to look at the process exit code. Here we have an assortment of some of the more frequently encountered exit codes you are likely to witness:</span></p>
<table cellpadding="0" cellspacing="0" border="0">
<tbody>
<tr>
<td width="120" valign="top">
<p><span style="font-size: small;">0x00000003</span></p>
</td>
<td width="474" valign="top">
<p><span style="font-size: small;">CRT's abort() or assert() was called.</span></p>
</td>
</tr>
<tr>
<td width="120" valign="top">
<p><span style="font-size: small;">0x80000003</span></p>
</td>
<td width="474" valign="top">
<p><span style="font-size: small;">An unhandled breakpoint (such as __debugbreak()), may also be caused by <a href="https://msdn.microsoft.com/en-us/library/8wtf2dfz.aspx"><span style="color: #0000ff;">/RTC</span></a> run-time checks.</span></p>
</td>
</tr>
<tr>
<td width="120" valign="top">
<p><span style="font-size: small;">0xC0000005</span></p>
</td>
<td width="474" valign="top">
<p><span style="font-size: small;">Access violation.</span></p>
</td>
</tr>
<tr>
<td width="120" valign="top">
<p><span style="font-size: small;">0xC00000FD</span></p>
</td>
<td width="474" valign="top">
<p><span style="font-size: small;">Stack overflow. Avoid recursion, move large stack buffers onto the heap, or increase the stack size via the <a href="https://msdn.microsoft.com/en-us/library/8cxs58a6.aspx"><span style="color: #0000ff;">/STACK</span></a> linker option.</span></p>
</td>
</tr>
<tr>
<td width="120" valign="top">
<p><span style="font-size: small;">0xC0000135</span></p>
</td>
<td width="474" valign="top">
<p><span style="font-size: small;">A required DLL was not found. Make sure you deploy all necessary components.</span></p>
</td>
</tr>
<tr>
<td width="120" valign="top">
<p><span style="font-size: small;">0xC0000138</span></p>
</td>
<td width="474" valign="top">
<p><span style="font-size: small;">An API is missing from the loaded DLL (searched by ordinal). This, and the one below, is typically due to running on an older version of Windows. You can change your _WIN32_WINNT, _WIN32_IE, etc. defines to target a previous version, or use LoadLibrary/GetProcAddress on the specific new API.</span></p>
</td>
</tr>
<tr>
<td width="120" valign="top">
<p><span style="font-size: small;">0xC0000139</span></p>
</td>
<td width="474" valign="top">
<p><span style="font-size: small;">An API is missing from the loaded DLL (searched by name).</span></p>
</td>
</tr>
<tr>
<td width="120" valign="top">
<p><span style="font-size: small;">0xC0000142</span></p>
</td>
<td width="474" valign="top">
<p><span style="font-size: small;">DllMain (from a required library) returned FALSE.</span></p>
</td>
</tr>
<tr>
<td width="120" valign="top">
<p><span style="font-size: small;">0xC0000374</span></p>
</td>
<td width="474" valign="top">
<p><span style="font-size: small;">Heap corruption detected (via <a href="https://msdn.microsoft.com/en-us/library/aa366705.aspx"><span style="color: #0000ff;">HeapSetInformation</span></a>'s HeapEnableTerminationOnCorruption option).</span></p>
</td>
</tr>
<tr>
<td width="120" valign="top">
<p><span style="font-size: small;">0xC0000409</span></p>
</td>
<td width="474" valign="top">
<p><span style="font-size: small;">Stack corruption detected (typically a result of <a href="https://msdn.microsoft.com/en-us/library/8dbf701c.aspx"><span style="color: #0000ff;">/GS</span></a> stack checks).</span></p>
</td>
</tr>
<tr>
<td width="120" valign="top">
<p><span style="font-size: small;">0xC0000417</span></p>
</td>
<td width="474" valign="top">
<p><span style="font-size: small;">Invalid CRT parameter (typically a result of the safe CRT functions failing a check).</span></p>
</td>
</tr>
</tbody>
</table>
<p><span style="font-size: small;">The 0xC&hellip; values are NTSTATUS codes, so if you happen to see other values in that range you know where to <a href="https://msdn.microsoft.com/en-us/library/cc704588.aspx"><span style="color: #0000ff;">look them up</span></a>.</span></p>
<p><span style="font-size: small;">&nbsp;</span></p>]]></content:encoded>
    </item>
    <item>
      <title>Batch File String Substitution with Nested Environment Variables</title>
      <link>https://docs.microsoft.com/archive/blogs/joshpoley/batch-file-string-substitution-with-nested-environment-variables</link>
      <pubDate>Fri, 03 Jun 2011 08:10:31 GMT</pubDate>
      <dc:creator><![CDATA[Josh Poley]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/joshpoley/2011/06/03/batch-file-string-substitution-with-nested-environment-variables/</guid>
      <description><![CDATA[The SET command has some nice extensions that let you do various manipulation operations on...]]></description>
      <content:encoded><![CDATA[<p>The SET command has some nice extensions that let you do various manipulation operations on environment variables. One said operation is the string substitution feature, which is often used to perform basic pattern replacements such as stripping out quotes around filenames:&nbsp;</p>
<div style="background-color: #cccccc;">
<p class="Code"><span><span style="font-family: Courier New;"><span style="color: #0000ff;">set </span><span style="color: #050505;">ABC="c:\foo.txt"</span></span></span><span><span style="font-family: Courier New;"><span style="color: #0000ff;"><br />set</span><span style="color: #050505;"> ABC=%ABC:"=%</span></span></span><span><span style="font-family: Courier New;"><span style="color: #0000ff;"><br />echo</span><span style="color: #050505;"> %ABC%</span></span></span></p>
</div>
<p>In the above sample, the quotes around the filename are removed (the search pattern is located between the colon and the equal sign, and the replacement pattern is located after the equal and before the ending percent sign &ndash; which is empty in this case).</p>
<p>I recently had a need to replace the beginning portion of a path name, with a different directory. But, unfortunately, I wasn't able to use hard-coded pattern strings as the both the initial directory and the replacement were unknown beforehand. This meant that I was left with the unfortunate task of trying to use an environment variable <i>inside</i> of the replacement syntax. Needless to say, nesting % signs didn't go very well for me.</p>
<p>&nbsp;</p>
<p>Luckily, there is a mode of cmd.exe which support delayed environment evaluation, and offers a new syntax for evaluating the environment variable.</p>
<p>&nbsp;</p>
<div style="background-color: #cccccc;">
<p class="Code"><span style="color: #050505;"><span><span style="font-family: Courier New;">cmd.exe /v</span></span></span></p>
</div>
<p><span style="font-size: x-small;">&nbsp;</span></p>
<p>When /v is passed into cmd.exe, it allows you to expand environment variables using ! instead of %:</p>
<p><span style="font-size: x-small;">&nbsp;</span></p>
<div style="background-color: #cccccc;">
<p class="Code"><span><span style="font-family: Courier New;"><span style="color: #0000ff;">echo</span><span style="color: #050505;"> !ABC!</span></span></span></p>
</div>
<p><span style="font-size: x-small;">&nbsp;</span></p>
<p>Using both forms of expansion, I can nest one inside of the other, allowing me to use a variable for both the search string as well as the replacement:</p>
<p><span style="font-size: x-small;">&nbsp;</span></p>
<div style="background-color: #cccccc;">
<p class="Code"><span><span style="font-family: Courier New;"><span style="color: #0000ff;">set</span><span style="color: #050505;"> TARGETPATH=!TARGETPATH:%ROOT%=%NEWROOT%!</span></span></span></p>
</div>
<p>As an aside, here is a little test which will let you determine if /v is enabled or not:</p>
<div style="background-color: #cccccc;">
<p><span><span style="font-family: Courier New;"><span style="color: #0000ff;">set </span><span style="color: #050505;">_EXP=expanded<br /></span></span></span><span><span style="font-family: Courier New;"><span><span><span><span><span><span><span><span style="color: #0000ff;">if</span> "!_EXP!"</span><span style="color: #050505;"> NEQ </span></span>"expanded" <span style="color: #0000ff;">echo </span></span><span style="color: #000000;">ERROR: You must </span></span><span style="color: #000000;">start </span></span><span style="color: #050505;">cmd.exe with /v &amp; </span></span>goto </span><span style="color: #050505;">:eof<br /></span></span></span><span><span style="font-family: Courier New;"><span style="color: #0000ff;">set </span><span style="color: #050505;">_EXP=</span></span></span></p>
</div>
<p><span style="font-size: x-small;">&nbsp;</span></p>
<p><span style="font-size: x-small;">&nbsp;</span></p>]]></content:encoded>
    </item>
    <item>
      <title>Limits of OLEDB and Access Passwords</title>
      <link>https://docs.microsoft.com/archive/blogs/joshpoley/limits-of-oledb-and-access-passwords</link>
      <pubDate>Wed, 25 May 2011 08:49:00 GMT</pubDate>
      <dc:creator><![CDATA[Josh Poley]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/joshpoley/2011/05/25/limits-of-oledb-and-access-passwords/</guid>
      <description><![CDATA[People that know me know I hate useless error codes. During code reviews if I see someone attempting...]]></description>
      <content:encoded><![CDATA[<p>People that know me know I hate useless error codes. During code reviews if I see someone attempting to return E_FAIL I will often launch into a blistering remark about how they are being lazy and making other developer's lifes harder all at the same time.&nbsp; The problem with E_FAIL is that it is completely unactionable; it gives the caller (or the end user) zero details about what failed or how to fix it.</p>
<p>Given this, you can imagine the distaste in my mouth when I encountered a DB_E_ERRORSOCCURRED (0x80040E21) error while just trying to open an Access database using OLE (via <a href="https://msdn.microsoft.com/en-us/library/z3dbz7ce.aspx">CDataSource</a>/<a href="https://msdn.microsoft.com/en-us/library/bez779k2.aspx">CSession</a>). I get this error back with no fanfare about what the actual problem is. The connection string used looked something like this:</p>
<div style="background-color: #cccccc;"><span style="color: #3366ff;">PROVIDER</span>=Microsoft.ACE.OLEDB.12.0;<span style="color: #3366ff;">DATA SOURCE</span>=database.accdb;<span style="color: #3366ff;">Jet OLEDB:Database Password</span>=' O1i6PidNWwKFHhl6DWJa7UZjD8RiPZ'</div>
<p>&nbsp;</p>
<p>After blindly fishing around, I narrowed it down to the actual password that was the issue. If I disable the password protection on the database, I could connect just fine.</p>
<p>After hacking around some more I discovered that it is the <i>length</i> of the password (and not the any specific characters) which cause the open operation to fail. My life could have been so much happier if I had received a specific error message, or even an overloaded one which would help point to the length of the password as an issue. Looking through the standard windows headers, there are a handful of existing errors that would have been much nicer to see than an "errors occurred" message.</p>
<p>So, if you happen to run into this error code yourself, you may need to shorten the password to fewer than <strong>20</strong> characters.</p>]]></content:encoded>
    </item>
    <item>
      <title>The Many Faces of Visual C++</title>
      <link>https://docs.microsoft.com/archive/blogs/joshpoley/the-many-faces-of-visual-c</link>
      <pubDate>Tue, 15 Dec 2009 09:21:00 GMT</pubDate>
      <dc:creator><![CDATA[Josh Poley]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/joshpoley/2009/12/15/the-many-faces-of-visual-c/</guid>
      <description><![CDATA[Microsoft has an uncanny ability to confuse and befuddle users with the ever changing names of...]]></description>
      <content:encoded><![CDATA[<p class="MsoNormal">Microsoft has an uncanny ability to confuse and befuddle users with the ever changing names of products across versions. Visual C++ is no stranger to this concept and I'm often left with trying to interpret some innocuous sounding statement into something meaningful to my simple mind. </p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal"><i style="mso-bidi-font-style: normal;">You need to link with the VC8's libs.<o:p></o:p></i></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">Ok, great, now what does that mean? Is that version 8.0 (as reported by the binary)? Is it "Visual C++ 2008"? One could go <i style="mso-bidi-font-style: normal;">mad</i> trying to understand that each version has <i style="mso-bidi-font-style: normal;">three</i> different ways to identify and name it. To simplify my own life, I've created a chart with the last handful of versions and their equivalent names, hopefully this will be useful to others as well.</p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<table cellpadding="0" cellspacing="0" border="1" class="MsoTableGrid" style="border-collapse: collapse; mso-border-alt: solid windowtext .5pt; mso-yfti-tbllook: 1184; mso-padding-alt: 0in 5.4pt 0in 5.4pt;">
<tbody>
<tr style="mso-yfti-irow: 0; mso-yfti-firstrow: yes;">
<td width="245" valign="top" style="padding-bottom: 0in; background-color: transparent; padding-left: 5.4pt; width: 2.55in; padding-right: 5.4pt; padding-top: 0in; mso-border-alt: solid windowtext .5pt; border: windowtext 1pt solid;">
<p class="MsoNormal"><strong>Product Name</strong></p>
</td>
<td width="245" valign="top" style="border-bottom: windowtext 1pt solid; border-left: #c0c0c0; padding-bottom: 0in; background-color: transparent; padding-left: 5.4pt; width: 2.55in; padding-right: 5.4pt; border-top: windowtext 1pt solid; border-right: windowtext 1pt solid; padding-top: 0in; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt;">
<p class="MsoNormal"><strong>Product Version</strong></p>
</td>
<td width="245" valign="top" style="border-bottom: windowtext 1pt solid; border-left: #c0c0c0; padding-bottom: 0in; background-color: transparent; padding-left: 5.4pt; width: 2.55in; padding-right: 5.4pt; border-top: windowtext 1pt solid; border-right: windowtext 1pt solid; padding-top: 0in; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt;">
<p class="MsoNormal"><strong>Compiler File Version</strong></p>
</td>
</tr>
<tr style="mso-yfti-irow: 0; mso-yfti-firstrow: yes;">
<td width="245" valign="top" style="padding-bottom: 0in; background-color: transparent; padding-left: 5.4pt; width: 2.55in; padding-right: 5.4pt; padding-top: 0in; mso-border-alt: solid windowtext .5pt; border: windowtext 1pt solid;">
<p class="MsoNormal">Visual C++ 2010</p>
</td>
<td width="245" valign="top" style="border-bottom: windowtext 1pt solid; border-left: #c0c0c0; padding-bottom: 0in; background-color: transparent; padding-left: 5.4pt; width: 2.55in; padding-right: 5.4pt; border-top: windowtext 1pt solid; border-right: windowtext 1pt solid; padding-top: 0in; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt;">
<p class="MsoNormal">VC10</p>
</td>
<td width="245" valign="top" style="border-bottom: windowtext 1pt solid; border-left: #c0c0c0; padding-bottom: 0in; background-color: transparent; padding-left: 5.4pt; width: 2.55in; padding-right: 5.4pt; border-top: windowtext 1pt solid; border-right: windowtext 1pt solid; padding-top: 0in; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt;">
<p class="MsoNormal">16.xx</p>
</td>
</tr>
<tr style="mso-yfti-irow: 1;">
<td width="245" valign="top" style="border-bottom: windowtext 1pt solid; border-left: windowtext 1pt solid; padding-bottom: 0in; background-color: transparent; padding-left: 5.4pt; width: 2.55in; padding-right: 5.4pt; border-top: #c0c0c0; border-right: windowtext 1pt solid; padding-top: 0in; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt;">
<p class="MsoNormal">Visual C++ 2008</p>
</td>
<td width="245" valign="top" style="border-bottom: windowtext 1pt solid; border-left: #c0c0c0; padding-bottom: 0in; background-color: transparent; padding-left: 5.4pt; width: 2.55in; padding-right: 5.4pt; border-top: #c0c0c0; border-right: windowtext 1pt solid; padding-top: 0in; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt;">
<p class="MsoNormal">VC9</p>
</td>
<td width="245" valign="top" style="border-bottom: windowtext 1pt solid; border-left: #c0c0c0; padding-bottom: 0in; background-color: transparent; padding-left: 5.4pt; width: 2.55in; padding-right: 5.4pt; border-top: #c0c0c0; border-right: windowtext 1pt solid; padding-top: 0in; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt;">
<p class="MsoNormal">15.xx</p>
</td>
</tr>
<tr style="mso-yfti-irow: 2;">
<td width="245" valign="top" style="border-bottom: windowtext 1pt solid; border-left: windowtext 1pt solid; padding-bottom: 0in; background-color: transparent; padding-left: 5.4pt; width: 2.55in; padding-right: 5.4pt; border-top: #c0c0c0; border-right: windowtext 1pt solid; padding-top: 0in; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt;">
<p class="MsoNormal">Visual C++ 2005</p>
</td>
<td width="245" valign="top" style="border-bottom: windowtext 1pt solid; border-left: #c0c0c0; padding-bottom: 0in; background-color: transparent; padding-left: 5.4pt; width: 2.55in; padding-right: 5.4pt; border-top: #c0c0c0; border-right: windowtext 1pt solid; padding-top: 0in; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt;">
<p class="MsoNormal">VC8</p>
</td>
<td width="245" valign="top" style="border-bottom: windowtext 1pt solid; border-left: #c0c0c0; padding-bottom: 0in; background-color: transparent; padding-left: 5.4pt; width: 2.55in; padding-right: 5.4pt; border-top: #c0c0c0; border-right: windowtext 1pt solid; padding-top: 0in; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt;">
<p class="MsoNormal">14.xx</p>
</td>
</tr>
<tr style="mso-yfti-irow: 3;">
<td width="245" valign="top" style="border-bottom: windowtext 1pt solid; border-left: windowtext 1pt solid; padding-bottom: 0in; background-color: transparent; padding-left: 5.4pt; width: 2.55in; padding-right: 5.4pt; border-top: #c0c0c0; border-right: windowtext 1pt solid; padding-top: 0in; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt;">
<p class="MsoNormal">Visual C++ .NET 2003</p>
</td>
<td width="245" valign="top" style="border-bottom: windowtext 1pt solid; border-left: #c0c0c0; padding-bottom: 0in; background-color: transparent; padding-left: 5.4pt; width: 2.55in; padding-right: 5.4pt; border-top: #c0c0c0; border-right: windowtext 1pt solid; padding-top: 0in; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt;">
<p class="MsoNormal">VC7.1</p>
</td>
<td width="245" valign="top" style="border-bottom: windowtext 1pt solid; border-left: #c0c0c0; padding-bottom: 0in; background-color: transparent; padding-left: 5.4pt; width: 2.55in; padding-right: 5.4pt; border-top: #c0c0c0; border-right: windowtext 1pt solid; padding-top: 0in; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt;">
<p class="MsoNormal">13.10</p>
</td>
</tr>
<tr style="mso-yfti-irow: 4;">
<td width="245" valign="top" style="border-bottom: windowtext 1pt solid; border-left: windowtext 1pt solid; padding-bottom: 0in; background-color: transparent; padding-left: 5.4pt; width: 2.55in; padding-right: 5.4pt; border-top: #c0c0c0; border-right: windowtext 1pt solid; padding-top: 0in; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt;">
<p class="MsoNormal">Visual C++ .NET 2002</p>
</td>
<td width="245" valign="top" style="border-bottom: windowtext 1pt solid; border-left: #c0c0c0; padding-bottom: 0in; background-color: transparent; padding-left: 5.4pt; width: 2.55in; padding-right: 5.4pt; border-top: #c0c0c0; border-right: windowtext 1pt solid; padding-top: 0in; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt;">
<p class="MsoNormal">VC7.0</p>
</td>
<td width="245" valign="top" style="border-bottom: windowtext 1pt solid; border-left: #c0c0c0; padding-bottom: 0in; background-color: transparent; padding-left: 5.4pt; width: 2.55in; padding-right: 5.4pt; border-top: #c0c0c0; border-right: windowtext 1pt solid; padding-top: 0in; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt;">
<p class="MsoNormal">13.00</p>
</td>
</tr>
<tr style="mso-yfti-irow: 5; mso-yfti-lastrow: yes;">
<td width="245" valign="top" style="border-bottom: windowtext 1pt solid; border-left: windowtext 1pt solid; padding-bottom: 0in; background-color: transparent; padding-left: 5.4pt; width: 2.55in; padding-right: 5.4pt; border-top: #c0c0c0; border-right: windowtext 1pt solid; padding-top: 0in; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt;">
<p class="MsoNormal">Visual C++ 6.0</p>
</td>
<td width="245" valign="top" style="border-bottom: windowtext 1pt solid; border-left: #c0c0c0; padding-bottom: 0in; background-color: transparent; padding-left: 5.4pt; width: 2.55in; padding-right: 5.4pt; border-top: #c0c0c0; border-right: windowtext 1pt solid; padding-top: 0in; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt;">
<p class="MsoNormal">VC6</p>
</td>
<td width="245" valign="top" style="border-bottom: windowtext 1pt solid; border-left: #c0c0c0; padding-bottom: 0in; background-color: transparent; padding-left: 5.4pt; width: 2.55in; padding-right: 5.4pt; border-top: #c0c0c0; border-right: windowtext 1pt solid; padding-top: 0in; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt;">
<p class="MsoNormal">12.xx</p>
</td>
</tr>
</tbody>
</table>
<p mce_keep="true">&nbsp;</p>]]></content:encoded>
    </item>
  </channel>
</rss>