Skip to main content
gamedev.net
🔒 Locked

LoadLibrary problem 998

Started by Leadorn Mar 29, 2006 at 2:03 AM 0 replies 2.5k views
Original Post
Leadorn
Leadorn
Hi I'm trying to hook IDirectPlay3 interface for combat flight simulator 1. At the moment I have a test project using direct play to debug and test my hookdll. I’ve created my own dplayx.dll file and I want to forward calls to the original dplayx.dll file. From the dllmain in fake dplayx dll I try to load the dplayx_.dll which is the original dll file I get GetLastError() 998 (ERROR_NOACCESS 998 Invalid access to memory location). Loading the dll from the parent process (testproject main) c:\\windows\\system32\dplayx.dll there is no problem. I read something about trusted and untrusted dlls/processes http://support.microsoft.com/kb/q196069/ My first attempt was to inject a dll with CreateRemoteThread and hook the function CoCreateInstance (ole2.dll) or DirectPlayCreate but combat flight simulator doesn’t use dplayx.dll or dplay.dll or dpnet.dll. Using dumpbin /dependents I can’t find any dependencies to and direct play dll very strange. Yet it uses directplay. Combat flight simulator 3 uses DllGetClassObject comobject interface to get comobjects. Either way I need to load that dll. I've successfully done this with combat flight simulator 3. calls game-> dplayx.dll -> dplayx_.dll Any ideas to what can be wrong?
Leadorn
Leadorn
Solved it. But maybe you guys can explain it cuz I can’t.

I removed the dplayx.lib from the test project and after that it works. This might not be as far fetched as I first thought. The dplayx.lib and dplayx.dll are compiled together and have references between each other. But those references are not valid in my dplayx.dll so that must somehow be the problem.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.