Boost C++ Libraries: Ticket #5830: mutex.inl: extraneous use of GetVersionEx https://svn.boost.org/trac10/ticket/5830 <p> Index: mutex.inl =================================================================== RCS file: /cvsroot/boost/boost/libs/thread/src/mutex.inl,v retrieving revision 1.9 diff -<a class="changeset" href="https://svn.boost.org/trac10/changeset/1" title="Import core sources for SVNmanger 0.38 ">r1</a>.9 mutex.inl 21,28c21,34 &lt; OSVERSIONINFO version_info = {sizeof(OSVERSIONINFO)}; &lt; ::<a class="missing wiki">GetVersionEx</a>(&amp;version_info); &lt; if (version_info.dwPlatformId == VER_PLATFORM_WIN32_NT &amp;&amp; &lt; version_info.dwMajorVersion &gt;= 4) &lt; { &lt; if (HMODULE kernel_module = <a class="missing wiki">GetModuleHandle</a>(TEXT("KERNEL32.DLL"))) &lt; g_TryEnterCriticalSection = reinterpret_cast&lt;TryEnterCriticalSection_type&gt;(<a class="missing wiki">GetProcAddress</a>(kernel_module, TEXT("<a class="missing wiki">TryEnterCriticalSection</a>"))); &lt; } --- </p> <blockquote class="citation"> <blockquote> <p> <em> No need for this test since Boost is using <a class="missing wiki">GetModuleHandle/GetProcAddress</a>. </em></p> <blockquote> <p> <em>OSVERSIONINFO version_info = {sizeof(OSVERSIONINFO)}; </em>::<a class="missing wiki">GetVersionEx</a>(&amp;version_info); <em>if (version_info.dwPlatformId == VER_PLATFORM_WIN32_NT &amp;&amp; </em> version_info.dwMajorVersion &gt;= 4) <em>{ </em> if (HMODULE kernel_module = <a class="missing wiki">GetModuleHandle</a>(TEXT("KERNEL32.DLL"))) <em> g_TryEnterCriticalSection = reinterpret_cast&lt;TryEnterCriticalSection_type&gt;(<a class="missing wiki">GetProcAddress</a>(kernel_module, TEXT("<a class="missing wiki">TryEnterCriticalSection</a>"))); </em>} </p> </blockquote> </blockquote> <p> </p> <blockquote> <p> <em> The <a class="missing wiki">GetModuleHandle</a> function returns a handle to KERNEL32.DLL without incrementing its reference count </em></p> <blockquote> <p> if (HMODULE kernel_module = <a class="missing wiki">GetModuleHandle</a>(TEXT("KERNEL32.DLL"))) { </p> <blockquote> <p> g_TryEnterCriticalSection = reinterpret_cast&lt;TryEnterCriticalSection_type&gt;(<a class="missing wiki">GetProcAddress</a>(kernel_module, TEXT("<a class="missing wiki">TryEnterCriticalSection</a>"))); </p> </blockquote> </blockquote> <p> } </p> </blockquote> </blockquote> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/5830 Trac 1.4.3 noloader@… Tue, 30 Aug 2011 03:37:42 GMT <link>https://svn.boost.org/trac10/ticket/5830#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5830#comment:1</guid> <description> <p> Sorry about the poor formatting. It looks like the web submission system is cooking the copy/paste from the diff command. </p> </description> <category>Ticket</category> </item> <item> <author>Jeffrey Walton <noloader@…></author> <pubDate>Wed, 31 Aug 2011 00:38:50 GMT</pubDate> <title>component changed; cc, owner set https://svn.boost.org/trac10/ticket/5830#comment:2 https://svn.boost.org/trac10/ticket/5830#comment:2 <ul> <li><strong>cc</strong> <span class="trac-author">noloader@…</span> added </li> <li><strong>owner</strong> set to <span class="trac-author">Anthony Williams</span> </li> <li><strong>component</strong> <span class="trac-field-old">None</span> → <span class="trac-field-new">thread</span> </li> </ul> Ticket viboes Fri, 02 Dec 2011 23:58:36 GMT <link>https://svn.boost.org/trac10/ticket/5830#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5830#comment:3</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/5830#comment:1" title="Comment 1">noloader@…</a>: </p> <blockquote class="citation"> <p> Sorry about the poor formatting. It looks like the web submission system is cooking the copy/paste from the diff command. </p> </blockquote> <p> Please use the code block. 5th widget from the left. E.g. </p> <pre class="wiki">{ code block } </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Wed, 07 Dec 2011 00:43:54 GMT</pubDate> <title>type changed https://svn.boost.org/trac10/ticket/5830#comment:4 https://svn.boost.org/trac10/ticket/5830#comment:4 <ul> <li><strong>type</strong> <span class="trac-field-old">Bugs</span> → <span class="trac-field-new">Support Requests</span> </li> </ul> <p> Moved to support request until the format is clear. </p> Ticket viboes Wed, 14 Dec 2011 21:43:22 GMT <link>https://svn.boost.org/trac10/ticket/5830#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5830#comment:5</guid> <description> <p> Sorry, I don't see any file libs/thread/src/mutex.inl. Moved to support request until concerned file clarified. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Thu, 29 Dec 2011 10:34:29 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/5830#comment:6 https://svn.boost.org/trac10/ticket/5830#comment:6 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">invalid</span> </li> </ul> <p> Closed as it seems these doesn't corresponds to the current Boost.Thread implementation. </p> Ticket