<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[178530] trunk/Tools</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/178530">178530</a></dd>
<dt>Author</dt> <dd>bfulgham@apple.com</dd>
<dt>Date</dt> <dd>2015-01-15 14:49:26 -0800 (Thu, 15 Jan 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>[Win] Miscellaneous DRT fixes
https://bugs.webkit.org/show_bug.cgi?id=116562

Reviewed by Tim Horton.

While investigating the cause of several Windows crashes, I found:
(1) Messy conversions to and from BSTR types
(2) Weird mixes of wide-string and narrow string conversions
(3) Passing nullptr to some CoreFoundation routines that do not
    permit null arguments.
(4) Commands to link the executable to the VS2005 runtime.

This patch cleans up these issues to improve DRT reliability on
Windows.

* DumpRenderTree/cg/ImageDiffCG.cpp:
(main): Get rid of VS2005 runtime linking.
* DumpRenderTree/win/DumpRenderTree.cpp:
(urlSuitableForTestResult): Protect against being asked
to process an empty URL.
(dumpHistoryItem): Do BSTR string building using _bstr_t, rather
than converting to/from wchar_t buffers.
(runTest): Simplify string and BSTR handling.
(createWebViewAndOffscreenWindow): Ditto.
(main): Get rid of VS2005 runtime linking.
* DumpRenderTree/win/TestRunnerWin.cpp:
(jsStringRefToWString): Simplify code.
(TestRunner::pathToLocalResource):
(TestRunner::setUserStyleSheetLocation):
* TestWebKitAPI/win/main.cpp: Get rid of
VS2005 runtime linking.
* win/DLLLauncher/DLLLauncherMain.cpp:
(wWinMain): Ditto.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsDumpRenderTreecgImageDiffCGcpp">trunk/Tools/DumpRenderTree/cg/ImageDiffCG.cpp</a></li>
<li><a href="#trunkToolsDumpRenderTreewinDumpRenderTreecpp">trunk/Tools/DumpRenderTree/win/DumpRenderTree.cpp</a></li>
<li><a href="#trunkToolsDumpRenderTreewinTestRunnerWincpp">trunk/Tools/DumpRenderTree/win/TestRunnerWin.cpp</a></li>
<li><a href="#trunkToolsTestWebKitAPIwinmaincpp">trunk/Tools/TestWebKitAPI/win/main.cpp</a></li>
<li><a href="#trunkToolswinDLLLauncherDLLLauncherMaincpp">trunk/Tools/win/DLLLauncher/DLLLauncherMain.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (178529 => 178530)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2015-01-15 22:19:40 UTC (rev 178529)
+++ trunk/Tools/ChangeLog        2015-01-15 22:49:26 UTC (rev 178530)
</span><span class="lines">@@ -1,3 +1,39 @@
</span><ins>+2015-01-15  Brent Fulgham  &lt;bfulgham@apple.com&gt;
+
+        [Win] Miscellaneous DRT fixes
+        https://bugs.webkit.org/show_bug.cgi?id=116562
+
+        Reviewed by Tim Horton.
+
+        While investigating the cause of several Windows crashes, I found:
+        (1) Messy conversions to and from BSTR types
+        (2) Weird mixes of wide-string and narrow string conversions
+        (3) Passing nullptr to some CoreFoundation routines that do not
+            permit null arguments.
+        (4) Commands to link the executable to the VS2005 runtime.
+
+        This patch cleans up these issues to improve DRT reliability on
+        Windows.
+
+        * DumpRenderTree/cg/ImageDiffCG.cpp:
+        (main): Get rid of VS2005 runtime linking.
+        * DumpRenderTree/win/DumpRenderTree.cpp:
+        (urlSuitableForTestResult): Protect against being asked
+        to process an empty URL.
+        (dumpHistoryItem): Do BSTR string building using _bstr_t, rather
+        than converting to/from wchar_t buffers.
+        (runTest): Simplify string and BSTR handling.
+        (createWebViewAndOffscreenWindow): Ditto.
+        (main): Get rid of VS2005 runtime linking.
+        * DumpRenderTree/win/TestRunnerWin.cpp:
+        (jsStringRefToWString): Simplify code.
+        (TestRunner::pathToLocalResource):
+        (TestRunner::setUserStyleSheetLocation):
+        * TestWebKitAPI/win/main.cpp: Get rid of
+        VS2005 runtime linking.
+        * win/DLLLauncher/DLLLauncherMain.cpp:
+        (wWinMain): Ditto.
+
</ins><span class="cx"> 2015-01-15  Alexey Proskuryakov  &lt;ap@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Stop hardcoding mac-mountainlion in commit queue
</span></span></pre></div>
<a id="trunkToolsDumpRenderTreecgImageDiffCGcpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/cg/ImageDiffCG.cpp (178529 => 178530)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/cg/ImageDiffCG.cpp        2015-01-15 22:19:40 UTC (rev 178529)
+++ trunk/Tools/DumpRenderTree/cg/ImageDiffCG.cpp        2015-01-15 22:49:26 UTC (rev 178530)
</span><span class="lines">@@ -225,7 +225,7 @@
</span><span class="cx">             } else {
</span><span class="cx">                 if (CGImageGetWidth(actualImage.get()) != CGImageGetWidth(baselineImage.get()) || CGImageGetHeight(actualImage.get()) != CGImageGetHeight(baselineImage.get())) {
</span><span class="cx"> #if OS(WINDOWS)
</span><del>-                    fprintf(stderr, &quot;Error: test and reference images have different sizes. Test image is %zux%zu, reference image is %Iux%Iu\n&quot;,
</del><ins>+                    fprintf(stderr, &quot;Error: test and reference images have different sizes. Test image is %Iux%Iu, reference image is %Iux%Iu\n&quot;,
</ins><span class="cx"> #else
</span><span class="cx">                     fprintf(stderr, &quot;Error: test and reference images have different sizes. Test image is %zux%zu, reference image is %zux%zu\n&quot;,
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkToolsDumpRenderTreewinDumpRenderTreecpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/win/DumpRenderTree.cpp (178529 => 178530)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/win/DumpRenderTree.cpp        2015-01-15 22:19:40 UTC (rev 178529)
+++ trunk/Tools/DumpRenderTree/win/DumpRenderTree.cpp        2015-01-15 22:49:26 UTC (rev 178530)
</span><span class="lines">@@ -43,12 +43,13 @@
</span><span class="cx"> #include &quot;WorkQueue.h&quot;
</span><span class="cx"> 
</span><span class="cx"> #include &lt;comutil.h&gt;
</span><ins>+#include &lt;cstdio&gt;
+#include &lt;cstring&gt;
</ins><span class="cx"> #include &lt;fcntl.h&gt;
</span><ins>+#include &lt;fstream&gt;
</ins><span class="cx"> #include &lt;io.h&gt;
</span><span class="cx"> #include &lt;math.h&gt;
</span><span class="cx"> #include &lt;shlwapi.h&gt;
</span><del>-#include &lt;stdio.h&gt;
-#include &lt;string.h&gt;
</del><span class="cx"> #include &lt;tchar.h&gt;
</span><span class="cx"> #include &lt;wtf/NeverDestroyed.h&gt;
</span><span class="cx"> #include &lt;wtf/RetainPtr.h&gt;
</span><span class="lines">@@ -68,9 +69,9 @@
</span><span class="cx"> using namespace std;
</span><span class="cx"> 
</span><span class="cx"> #ifdef DEBUG_ALL
</span><del>-const LPWSTR TestPluginDir = L&quot;TestNetscapePlugin_Debug&quot;;
</del><ins>+const _bstr_t TestPluginDir = L&quot;TestNetscapePlugin_Debug&quot;;
</ins><span class="cx"> #else
</span><del>-const LPWSTR TestPluginDir = L&quot;TestNetscapePlugin&quot;;
</del><ins>+const _bstr_t TestPluginDir = L&quot;TestNetscapePlugin&quot;;
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> static LPCWSTR fontsEnvironmentVariable = L&quot;WEBKIT_TESTFONTS&quot;;
</span><span class="lines">@@ -143,6 +144,9 @@
</span><span class="cx"> 
</span><span class="cx"> wstring urlSuitableForTestResult(const wstring&amp; urlString)
</span><span class="cx"> {
</span><ins>+    if (urlString.empty())
+        return urlString;
+
</ins><span class="cx">     RetainPtr&lt;CFURLRef&gt; url = adoptCF(CFURLCreateWithBytes(kCFAllocatorDefault, reinterpret_cast&lt;const UInt8*&gt;(urlString.c_str()), urlString.length() * sizeof(wstring::value_type), kCFStringEncodingUTF16, 0));
</span><span class="cx"> 
</span><span class="cx">     RetainPtr&lt;CFStringRef&gt; scheme = adoptCF(CFURLCopyScheme(url.get()));
</span><span class="lines">@@ -515,19 +519,18 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     if (wcsstr(static_cast&lt;wchar_t*&gt;(url), L&quot;file:/&quot;) == static_cast&lt;wchar_t*&gt;(url)) {
</span><del>-        static wchar_t* layoutTestsString = L&quot;/LayoutTests/&quot;;
-        static wchar_t* fileTestString = L&quot;(file test):&quot;;
</del><ins>+        static wchar_t* layoutTestsStringUnixPath = L&quot;/LayoutTests/&quot;;
+        static wchar_t* layoutTestsStringDOSPath = L&quot;\\LayoutTests\\&quot;;
</ins><span class="cx">         
</span><del>-        wchar_t* result = wcsstr(static_cast&lt;wchar_t*&gt;(url), layoutTestsString);
-        if (result == NULL)
</del><ins>+        wchar_t* result = wcsstr(static_cast&lt;wchar_t*&gt;(url), layoutTestsStringUnixPath);
+        if (!result)
+            result = wcsstr(static_cast&lt;wchar_t*&gt;(url), layoutTestsStringDOSPath);
+        if (!result)
</ins><span class="cx">             return;
</span><del>-        wchar_t* start = result + wcslen(layoutTestsString);
</del><span class="cx"> 
</span><del>-        _bstr_t newURL(SysAllocStringLen(0, SysStringLen(url)), false);
-        wcscpy(static_cast&lt;wchar_t*&gt;(newURL), fileTestString);
-        wcscpy(static_cast&lt;wchar_t*&gt;(newURL) + wcslen(fileTestString), start);
</del><ins>+        wchar_t* start = result + wcslen(layoutTestsStringUnixPath);
</ins><span class="cx"> 
</span><del>-        url = newURL;
</del><ins>+        url = _bstr_t(L&quot;(file test):&quot;) + _bstr_t(start);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     printf(&quot;%S&quot;, static_cast&lt;wchar_t*&gt;(url));
</span><span class="lines">@@ -1038,25 +1041,22 @@
</span><span class="cx">     str = CFURLGetString(url);
</span><span class="cx"> 
</span><span class="cx">     CFIndex length = CFStringGetLength(str);
</span><del>-    UniChar* buffer = new UniChar[length + 1];
</del><span class="cx"> 
</span><del>-    CFStringGetCharacters(str, CFRangeMake(0, length), buffer);
-    buffer[length] = 0;
</del><ins>+    Vector&lt;UniChar&gt; buffer(length + 1, 0);
+    CFStringGetCharacters(str, CFRangeMake(0, length), buffer.data());
</ins><span class="cx"> 
</span><del>-    _bstr_t urlBStr((OLECHAR*)buffer);
</del><ins>+    _bstr_t urlBStr(reinterpret_cast&lt;wchar_t*&gt;(buffer.data()));
</ins><span class="cx">     ASSERT(urlBStr.length() == length);
</span><del>-    delete[] buffer;
</del><span class="cx"> 
</span><span class="cx">     CFIndex maximumURLLengthAsUTF8 = CFStringGetMaximumSizeForEncoding(length, kCFStringEncodingUTF8) + 1;
</span><del>-    char* testURL = new char[maximumURLLengthAsUTF8];
-    CFStringGetCString(str, testURL, maximumURLLengthAsUTF8, kCFStringEncodingUTF8);
</del><ins>+    Vector&lt;char&gt; testURL(maximumURLLengthAsUTF8 + 1, 0);
+    CFStringGetCString(str, testURL.data(), maximumURLLengthAsUTF8, kCFStringEncodingUTF8);
</ins><span class="cx"> 
</span><span class="cx">     CFRelease(url);
</span><span class="cx"> 
</span><span class="cx">     resetWebViewToConsistentStateBeforeTesting();
</span><span class="cx"> 
</span><del>-    ::gTestRunner = TestRunner::create(testURL, command.expectedPixelHash);
-    delete[] testURL;
</del><ins>+    ::gTestRunner = TestRunner::create(testURL.data(), command.expectedPixelHash);
</ins><span class="cx">     ::gTestRunner-&gt;setCustomTimeout(command.timeout);
</span><span class="cx">     topLoadingFrame = nullptr;
</span><span class="cx">     done = false;
</span><span class="lines">@@ -1220,10 +1220,8 @@
</span><span class="cx">     viewPrivate-&gt;setShouldApplyMacFontAscentHack(TRUE);
</span><span class="cx">     viewPrivate-&gt;setAlwaysUsesComplexTextCodePath(forceComplexText);
</span><span class="cx"> 
</span><del>-    _bstr_t pluginPath(SysAllocStringLen(0, exePath().length() + _tcslen(TestPluginDir)), false);
-    _tcscpy(static_cast&lt;TCHAR*&gt;(pluginPath), exePath().c_str());
-    _tcscat(static_cast&lt;TCHAR*&gt;(pluginPath), TestPluginDir);
-    if (FAILED(viewPrivate-&gt;addAdditionalPluginDirectory(pluginPath)))
</del><ins>+    _bstr_t pluginPath = _bstr_t(exePath().data()) + TestPluginDir;
+    if (FAILED(viewPrivate-&gt;addAdditionalPluginDirectory(pluginPath.GetBSTR())))
</ins><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><span class="cx">     HWND viewWindow;
</span><span class="lines">@@ -1384,11 +1382,6 @@
</span><span class="cx"> 
</span><span class="cx"> int main(int argc, const char* argv[])
</span><span class="cx"> {
</span><del>-#ifdef _CRTDBG_MAP_ALLOC
-    _CrtSetReportFile(_CRT_WARN, _CRTDBG_FILE_STDERR);
-    _CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE);
-#endif
-
</del><span class="cx">     // Cygwin calls ::SetErrorMode(SEM_FAILCRITICALERRORS), which we will inherit. This is bad for
</span><span class="cx">     // testing/debugging, as it causes the post-mortem debugger not to be invoked. We reset the
</span><span class="cx">     // error mode here to work around Cygwin's behavior. See &lt;http://webkit.org/b/55222&gt;.
</span></span></pre></div>
<a id="trunkToolsDumpRenderTreewinTestRunnerWincpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/win/TestRunnerWin.cpp (178529 => 178530)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/win/TestRunnerWin.cpp        2015-01-15 22:19:40 UTC (rev 178529)
+++ trunk/Tools/DumpRenderTree/win/TestRunnerWin.cpp        2015-01-15 22:49:26 UTC (rev 178530)
</span><span class="lines">@@ -273,9 +273,9 @@
</span><span class="cx"> static wstring jsStringRefToWString(JSStringRef jsStr)
</span><span class="cx"> {
</span><span class="cx">     size_t length = JSStringGetLength(jsStr);
</span><del>-    Vector&lt;WCHAR&gt; buffer(length + 1);
</del><ins>+    Vector&lt;WCHAR&gt; buffer(length + 1, 0);
</ins><span class="cx">     memcpy(buffer.data(), JSStringGetCharactersPtr(jsStr), length * sizeof(WCHAR));
</span><del>-    buffer[length] = '\0';
</del><ins>+    buffer[length] = 0;
</ins><span class="cx"> 
</span><span class="cx">     return buffer.data();
</span><span class="cx"> }
</span><span class="lines">@@ -287,7 +287,7 @@
</span><span class="cx">     wstring localPath;
</span><span class="cx">     if (!resolveCygwinPath(input, localPath)) {
</span><span class="cx">         printf(&quot;ERROR: Failed to resolve Cygwin path %S\n&quot;, input.c_str());
</span><del>-        return 0;
</del><ins>+        return nullptr;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     return JSStringCreateWithCharacters(localPath.c_str(), localPath.length());
</span><span class="lines">@@ -766,9 +766,9 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     // The path has been resolved, now convert it back to a CFURL.
</span><del>-    int result = WideCharToMultiByte(CP_UTF8, 0, resultPath.c_str(), resultPath.size() + 1, 0, 0, 0, 0);
</del><ins>+    int result = ::WideCharToMultiByte(CP_UTF8, 0, resultPath.c_str(), resultPath.size() + 1, nullptr, 0, nullptr, nullptr);
</ins><span class="cx">     Vector&lt;char&gt; utf8Vector(result);
</span><del>-    result = WideCharToMultiByte(CP_UTF8, 0, resultPath.c_str(), resultPath.size() + 1, utf8Vector.data(), result, 0, 0);
</del><ins>+    result = ::WideCharToMultiByte(CP_UTF8, 0, resultPath.c_str(), resultPath.size() + 1, utf8Vector.data(), result, nullptr, nullptr);
</ins><span class="cx">     if (!result)
</span><span class="cx">         return;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPIwinmaincpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/win/main.cpp (178529 => 178530)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/win/main.cpp        2015-01-15 22:19:40 UTC (rev 178529)
+++ trunk/Tools/TestWebKitAPI/win/main.cpp        2015-01-15 22:49:26 UTC (rev 178530)
</span><span class="lines">@@ -38,9 +38,6 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #pragma comment(linker, &quot;/manifestdependency:\&quot;type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='&quot; PROCESSORARCHITECTURE &quot;' publicKeyToken='6595b64144ccf1df' language='*'\&quot;&quot;)
</span><del>-#if defined(_MSC_VER) &amp;&amp; (_MSC_VER &gt;= 1600)
-#pragma comment(linker, &quot;/manifestdependency:\&quot;type='win32' name='Microsoft.VC80.CRT' version='8.0.50727.6195' processorArchitecture='&quot; PROCESSORARCHITECTURE &quot;' publicKeyToken='1fc8b3b9a1e18e3b' language='*'\&quot;&quot;)
-#endif
</del><span class="cx"> 
</span><span class="cx"> int main(int argc, char** argv)
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkToolswinDLLLauncherDLLLauncherMaincpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/win/DLLLauncher/DLLLauncherMain.cpp (178529 => 178530)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/win/DLLLauncher/DLLLauncherMain.cpp        2015-01-15 22:19:40 UTC (rev 178529)
+++ trunk/Tools/win/DLLLauncher/DLLLauncherMain.cpp        2015-01-15 22:49:26 UTC (rev 178530)
</span><span class="lines">@@ -48,9 +48,6 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #pragma comment(linker, &quot;/manifestdependency:\&quot;type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='&quot; PROCESSORARCHITECTURE &quot;' publicKeyToken='6595b64144ccf1df' language='*'\&quot;&quot;)
</span><del>-#if defined(_MSC_VER) &amp;&amp; (_MSC_VER &gt;= 1600) &amp;&amp; !defined(WIN_CAIRO)
-#pragma comment(linker, &quot;/manifestdependency:\&quot;type='win32' name='Microsoft.VC80.CRT' version='8.0.50727.6195' processorArchitecture='&quot; PROCESSORARCHITECTURE &quot;' publicKeyToken='1fc8b3b9a1e18e3b' language='*'\&quot;&quot;)
-#endif
</del><span class="cx"> 
</span><span class="cx"> static void enableTerminationOnHeapCorruption()
</span><span class="cx"> {
</span><span class="lines">@@ -187,8 +184,13 @@
</span><span class="cx"> int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpstrCmdLine, int nCmdShow)
</span><span class="cx"> #endif
</span><span class="cx"> {
</span><del>-    _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF | _CRTDBG_CHECK_ALWAYS_DF);
</del><ins>+#ifdef _CRTDBG_MAP_ALLOC
+    _CrtSetReportFile(_CRT_WARN, _CRTDBG_FILE_STDERR);
+    _CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE);
+#endif
</ins><span class="cx"> 
</span><ins>+    _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_DELAY_FREE_MEM_DF | _CRTDBG_CHECK_ALWAYS_DF);
+
</ins><span class="cx">     enableTerminationOnHeapCorruption();
</span><span class="cx"> 
</span><span class="cx">     // Get the path of our executable.
</span></span></pre>
</div>
</div>

</body>
</html>