<p>This is essentially sanitizing and cleanups of existing win32 platform code.<br>
There's no new feature or behavior change except this one: path passed to security plugin will be interpreted as UTF-8 encoded on windows VM.<br>
These changes are required before cleaning the contract between image and VM, especially about encoding of various strings passed: they should be encoded in UTF8 which seems best for platform interoperability.<br>
It's a step forward for enabling the -DUNICODE as attempted by Tobias about 2 years ago.</p>
<p>It is also very important to reduce the number of compiler warnings. 9 times out of 10, these warnings are false positive, but the tenth is indicating a true problem that we'd better not ignore. If we let the benign warnings overflow us, then we are depriving ourself of a useful tool.</p>

<hr>

<h4>You can view, comment on, or merge this pull request online at:</h4>
<p>  <a href='https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/329'>https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/329</a></p>

<h4>Commit Summary</h4>
<ul>
  <li>Protect buffer underflow</li>
  <li>Make icon setting 64bits compatible</li>
  <li>remove a warning about a control path not returning a value</li>
  <li>Use TEXT macro for generic (ASCII or WIDE) string method</li>
  <li>Provides a high resolution clock for MSVC</li>
  <li>Define some UNIX constants in sqWin32Directory.c, MSVC oblige</li>
  <li>Remove a few printf warnings</li>
  <li>Prefer DirectX8 in MSVC</li>
  <li>Workaround S_ISFIFO to let MSVC compile FilePlugin</li>
  <li>Backport Unicode compatibility patches from minheadless variant</li>
  <li>Yet another printLastError Unicode compatibility fix in SoundPlugin</li>
  <li>Fix another bunch of usage of printLastError uncompatible with Unicode</li>
  <li>Fix sqWin32Security.c UNICODE problems</li>
  <li>Fix TEXT(VMOPTION('foo"))</li>
  <li>Concatenate TEXT constants rather than TEXT concatenated constants</li>
  <li>printLastError & warnPrintf take a TCHAR *, not a char *</li>
  <li>DPRINTF takes a TCHAR * when it is a warnPrintf in disguise</li>
  <li>Splash file and title may use Unicode variant</li>
  <li>windowTitle is not a TCHAR *, it is a UTF8 encoded char *</li>
  <li>make win23OpenGL UNICODE friendly</li>
  <li>Invoke LoadLibraryA when there's no point to internationalize library name</li>
  <li>GetProcAddress takes simple byte string procedure name</li>
  <li>Use GetLocaleInfoA rather than generic version</li>
  <li>remove unused LongFileNameFromPossiblyShortName</li>
  <li>the DPRINTF used in sqWin32PluginSupport.c takes a TCHAR *, not a char *</li>
</ul>

<h4>File Changes</h4>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/329/files#diff-0">platforms/Cross/plugins/B3DAcceleratorPlugin/sqOpenGLRenderer.c</a>
    (1)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/329/files#diff-1">platforms/Cross/plugins/FilePlugin/sqFilePluginBasicPrims.c</a>
    (6)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/329/files#diff-2">platforms/win32/plugins/B3DAcceleratorPlugin/sqWin32OpenGL.c</a>
    (4)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/329/files#diff-3">platforms/win32/plugins/CroquetPlugin/sqWin32CroquetPlugin.c</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/329/files#diff-4">platforms/win32/plugins/HostWindowPlugin/sqWin32HostWindowPlugin.c</a>
    (4)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/329/files#diff-5">platforms/win32/plugins/LocalePlugin/sqWin32Locale.c</a>
    (28)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/329/files#diff-6">platforms/win32/plugins/SecurityPlugin/sqWin32Security.c</a>
    (25)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/329/files#diff-7">platforms/win32/plugins/SoundPlugin/sqWin32Sound.c</a>
    (72)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/329/files#diff-8">platforms/win32/plugins/SqueakSSL/sqWin32SSL.c</a>
    (16)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/329/files#diff-9">platforms/win32/vm/sqWin32.h</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/329/files#diff-10">platforms/win32/vm/sqWin32Alloc.c</a>
    (14)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/329/files#diff-11">platforms/win32/vm/sqWin32Backtrace.c</a>
    (24)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/329/files#diff-12">platforms/win32/vm/sqWin32DirectInput.c</a>
    (6)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/329/files#diff-13">platforms/win32/vm/sqWin32Directory.c</a>
    (13)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/329/files#diff-14">platforms/win32/vm/sqWin32ExternalPrims.c</a>
    (12)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/329/files#diff-15">platforms/win32/vm/sqWin32Heartbeat.c</a>
    (5)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/329/files#diff-16">platforms/win32/vm/sqWin32Main.c</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/329/files#diff-17">platforms/win32/vm/sqWin32PluginSupport.c</a>
    (48)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/329/files#diff-18">platforms/win32/vm/sqWin32Prefs.c</a>
    (9)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/329/files#diff-19">platforms/win32/vm/sqWin32Threads.c</a>
    (4)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/329/files#diff-20">platforms/win32/vm/sqWin32Window.c</a>
    (120)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/329.patch'>https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/329.patch</a></li>
  <li><a href='https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/329.diff'>https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/329.diff</a></li>
</ul>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/329">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AhLyW_zG5dcJbSPPLxMyo7UcG5KC9rSPks5u9kxxgaJpZM4ZkCQ-">mute the thread</a>.<img src="https://github.com/notifications/beacon/AhLyW5W6WDXZ1kw0SDYFDDr8e4arl2fEks5u9kxxgaJpZM4ZkCQ-.gif" height="1" width="1" alt="" /></p>
<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/OpenSmalltalk/opensmalltalk-vm","title":"OpenSmalltalk/opensmalltalk-vm","subtitle":"GitHub repository","main_image_url":"https://github.githubassets.com/images/email/message_cards/header.png","avatar_image_url":"https://github.githubassets.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/OpenSmalltalk/opensmalltalk-vm"}},"updates":{"snippets":[{"icon":"DESCRIPTION","message":"Win64 cleanups (#329)"}],"action":{"name":"View Pull Request","url":"https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/329"}}}</script>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/329",
"url": "https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/329",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>