DLL wedge

Windows 98, C++

I'm trying to wedge into a DLL to log all calls. It's a quick-and-dirty thing (and I'm not really proficient in either of the above) but the idea is as follows:

TestProgram -> TestFolder/MyDLL -> ../System/RealDLL

MyDLL just logs the call and passes it on to RealDLL as is.

For clarity:

Windows/System/RealDLL: actual DLL
TestFolder/MyDLL: DLL wedge I have written
TestFolder/TestProgram: do-nothing program which calls MyDLL

In my test environment described above the code I've written so far works just fine, but when I try to wedge in MyDLL for real, things break down. Specifically there are two problems related to renaming:

1. When I rename the original DLL (and adjust references in MyDLL accordingly) all of a sudden the calls return an unknown error code. Specifically, given the above context, if I:

Rename ../System/RealDLL to, for example, "OriginalDLL".
Change code in MyDLL to call OriginalDLL (instead of RealDLL).

So I end up with:

TestProgram -> TestFolder/MyDLL -> ../System/OriginalDLL

This results in a bad (unknown) error/status code from the call which is strange because nothing has changed internally.

2. The second problem is when I rename my wedge DLL to real name of the DLL I'm trying to wedge into. Again, given the above context:

Rename TestFolder/MyDLL to TestFolder/RealDLL
Change code in TestProgram to call this DLL instead of MyDLL resulting in:

TestProgram -> TestFolder/RealDLL -> ../System/RealDLL

This blows up with:

"Can't find DLL entry point in 'TestFolder/RealDLL'"

This is very odd because nothing has changed except the name of the DLL (which I refer to accordingly).

Any insight into all this is welcome. Thanks!

Dan
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories