logo logo

 Back to main page

The NWNX Community Forum

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Patch to fix NWNX4 not working on Srv03 x64 + other fixes

 
Post new topic   Reply to topic    nwnx.org Forum Index -> Development
View previous topic :: View next topic  
Author Message
Skywing



Joined: 03 Jan 2008
Posts: 321

PostPosted: Thu Jan 03, 2008 19:14    Post subject: Patch to fix NWNX4 not working on Srv03 x64 + other fixes Reply with quote

Hi,

It seems that madCHook does not work properly as a Wow64 process under Srv03 x64. It does not even attempt to inject the specified hook DLL into the process when CreateProcessEx is called.

I have imported some code I wrote a few years ago that accomplishes the same thing in principle as the madCHook CreateProcessEx routine, with the added bonus that it actually works properly on Windows x64 (for 32-bit processes). Also, source code for that is being made available, so you may be able to cut the dependency on madCHook entirely now.

Additionally, I took the time to move all of the hook dll initialization logic out of DllMain. No more creating windows and other horrible nastiness bits under the loader lock, now, for the injection code now calls an export on the hook dll outside of the loader lock to do it's initialization.

I also added a mechanism by which NWNX4Controller can wait for NWN2Server to get it's message loop pumping. This was necessary because I noticed that sometimes NWNX4Controller would fail to establish the DDE link (as far as I could tell, a race condition where it would give up waiting because NWN2Server was not pumping messages yet). The change I made (create a hidden window that we wait until we get a response to WM_NULL) seems to address this in my tests.

Finally, I also fixed a couple of memory and handle leaks in NWNX4Controller itself.

The changes are available as a diff against the latest SVN revisions + full files as well, at the following url: http://www.nynaeve.net/Skywing/nwnx4_patch.zip
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Development All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group