<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="https://syndication.webwiz.net/rss_namespace/">
 <channel>
  <title>Codejock Developer Community : Bug in OnHookLoadLibrary()</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Skin Framework : Bug in OnHookLoadLibrary()]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Sun, 05 Apr 2026 16:44:49 +0000</pubDate>
  <lastBuildDate>Tue, 21 Aug 2012 12:09:59 +0000</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 12.04</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>forum.codejock.com/RSS_post_feed.asp?TID=20071</WebWizForums:feedURL>
  <image>
   <title><![CDATA[Codejock Developer Community]]></title>
   <url>http://forum.codejock.com/forum_images/codejock-logo.gif</url>
   <link>http://forum.codejock.com/</link>
  </image>
  <item>
   <title><![CDATA[Bug in OnHookLoadLibrary() :    akur wrote:Can you please...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=20071&amp;PID=68807&amp;title=bug-in-onhookloadlibrary#68807</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=1755">ABuenger</a><br /><strong>Subject:</strong> 20071<br /><strong>Posted:</strong> 21 August 2012 at 12:09pm<br /><br /><table width="99%"><tr><td class="BBquote"><img src="forum_images/quote_box.png" title="Originally posted by akur" alt="Originally posted by akur" style="vertical-align: text-bottom;" /> <strong>akur wrote:</strong><br /><br /><div>Can you please add this fix to your future releases, on all code places where relevant? Thank you.</div><div><br></div><div>It's the same case at least with the following functions:</div><div><font face="Courier New, Courier, mono">CXTPSkinManagerApiHook::OnHookLoadLibraryA()</font></div><div><font face="Courier New, Courier, mono">CXTPSkinManagerApiHook::OnHookLoadLibraryW()</font></div><div><font face="Courier New, Courier, mono">CXTPSkinManagerApiHook::OnHookLoadLibraryExA()</font></div><div><font face="Courier New, Courier, mono">CXTPSkinManagerApiHook::OnHookLoadLibraryExW()</font></div><div><font face="Courier New, Courier, mono">CXTPSkinManagerApiHook::OnHookLoadLibraryEx2W()</font></div></td></tr></table><br><br>Hi,<br><br>check added for next release.<br><br>Andre<br><br>]]>
   </description>
   <pubDate>Tue, 21 Aug 2012 12:09:59 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=20071&amp;PID=68807&amp;title=bug-in-onhookloadlibrary#68807</guid>
  </item> 
  <item>
   <title><![CDATA[Bug in OnHookLoadLibrary() : We just found out thatCXTPSkinManagerApiHook&amp;#039;s...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=20071&amp;PID=68797&amp;title=bug-in-onhookloadlibrary#68797</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2014">akur</a><br /><strong>Subject:</strong> 20071<br /><strong>Posted:</strong> 21 August 2012 at 1:52am<br /><br /><div>We just found out that&nbsp;CXTPSkinManagerApiHook's methods for hooking LoadLibrary() can accidentally change the <b><font color="#0000ff">GetLastError()</font></b> value returned by system. To overcome some problems this caused to our application, we <b><font color="#0000ff">needed to fix XTP code</font></b> like this:</div><div><br></div><div><div><font face="Courier New, Courier, mono">HMODULE WINAPI CXTPSkinManagerApiHook::OnHookLoadLibraryW(PCWSTR pszModuleName)</font></div><div><font face="Courier New, Courier, mono">{</font></div><div><font face="Courier New, Courier, mono">&nbsp; &nbsp; typedef HMODULE (WINAPI* LPFNLOADLIBRARYW)(PCWSTR pszModuleName);</font></div><div><font face="Courier New, Courier, mono"><br></font></div><div><font face="Courier New, Courier, mono">&nbsp; &nbsp; PROC pfnOrig = GetOriginalProc(xtpSkinApiLoadLibraryW);</font></div><div><font face="Courier New, Courier, mono">&nbsp; &nbsp; if (!pfnOrig)</font></div><div><span style="font-family: 'Courier New', Courier, mono; ">&nbsp; &nbsp;</span><span style="font-family: 'Courier New', Courier, mono; ">&nbsp;</span><span style="font-family: 'Courier New', Courier, mono; ">&nbsp; &nbsp;</span><span style="font-family: 'Courier New', Courier, mono; ">&nbsp;</span><span style="font-family: 'Courier New', Courier, mono; ">return ::LoadLibraryW(pszModuleName);</span></div><div><font face="Courier New, Courier, mono"><br></font></div><div><span style="font-family: 'Courier New', Courier, mono; ">&nbsp; &nbsp;</span><span style="font-family: 'Courier New', Courier, mono; ">&nbsp;</span><font face="Courier New, Courier, mono">HMODULE hmod = ((LPFNLOADLIBRARYW)pfnOrig)(pszModuleName);</font></div><div><font face="Courier New, Courier, mono"><br></font></div><div><span style="font-family: 'Courier New', Courier, mono; ">&nbsp; &nbsp;</span><span style="font-family: 'Courier New', Courier, mono; ">&nbsp;</span><font face="Courier New, Courier, mono" color="#339900">//&nbsp;Added test for hmod: the fn. HackModuleOnLoad() can be called only when</font></div><div><span style="font-family: 'Courier New', Courier, mono; ">&nbsp; &nbsp;</span><span style="font-family: 'Courier New', Courier, mono; ">&nbsp;</span><font color="#339900"><font face="Courier New, Courier, mono">//&nbsp;hmod is not-NULL, it means the&nbsp;</font><span style="font-family: 'Courier New', Courier, mono; ">module (some dll) was successfully loaded.</span></font></div><div><span style="font-family: 'Courier New', Courier, mono; ">&nbsp; &nbsp;</span><span style="font-family: 'Courier New', Courier, mono; ">&nbsp;</span><span style="font-family: 'Courier New', Courier, mono; "><font color="#339900">//&nbsp;Otherwise the global 'last error value' could be changed.</font></span></div><div><span style="font-family: 'Courier New', Courier, mono; ">&nbsp; &nbsp;</span><span style="font-family: 'Courier New', Courier, mono; ">&nbsp;</span><font face="Courier New, Courier, mono"><b><font color="#0000ff">if (hmod)</font></b></font></div><div><span style="font-family: 'Courier New', Courier, mono; ">&nbsp; &nbsp;</span><span style="font-family: 'Courier New', Courier, mono; ">&nbsp;</span><span style="font-family: 'Courier New', Courier, mono; ">&nbsp; &nbsp;</span><span style="font-family: 'Courier New', Courier, mono; ">&nbsp;</span><span style="font-family: 'Courier New', Courier, mono; ">GetInstance()-&gt;HackModuleOnLoad(hmod, 0);</span></div><div><font face="Courier New, Courier, mono"><br></font></div><div><span style="font-family: 'Courier New', Courier, mono; ">&nbsp; &nbsp;</span><span style="font-family: 'Courier New', Courier, mono; ">&nbsp;</span><font face="Courier New, Courier, mono">return hmod;</font></div><div><font face="Courier New, Courier, mono">}</font></div></div><div><br></div><div>Can you please add this fix to your future releases, on all code places where relevant? Thank you.</div><div><br></div><div>It's the same case at least with the following functions:</div><div><font face="Courier New, Courier, mono">CXTPSkinManagerApiHook::OnHookLoadLibraryA()</font></div><div><font face="Courier New, Courier, mono">CXTPSkinManagerApiHook::OnHookLoadLibraryW()</font></div><div><font face="Courier New, Courier, mono">CXTPSkinManagerApiHook::OnHookLoadLibraryExA()</font></div><div><font face="Courier New, Courier, mono">CXTPSkinManagerApiHook::OnHookLoadLibraryExW()</font></div><div><font face="Courier New, Courier, mono">CXTPSkinManagerApiHook::OnHookLoadLibraryEx2W()</font></div><div><br></div>]]>
   </description>
   <pubDate>Tue, 21 Aug 2012 01:52:49 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=20071&amp;PID=68797&amp;title=bug-in-onhookloadlibrary#68797</guid>
  </item> 
 </channel>
</rss>