sleeper
2006-08-29 07:14:58 UTC
Hello
I am trying to use GetModuleHandle and in the documentation it says:
"Retrieves a module handle for the specified module. The module must
have been loaded by the calling process."
So I am having a problem because in my Executable, it loads
user32.dll which loads advapi32.dll which loads secur32.dll which loads
ntdsapi.dll which loads ws2_32.dll. I got this information from
Dependecy Walker. So in other words, the chain looks something like
this:
user32.dll -> advapi32.dll -> secur32.dll -> ntdsapi.dll -> ws2_32.dll
I try to call GetModuleHandle("ws2_32.dll") but it returns NULL,
meaning that it can't get the module handle. I think the problem is
because my executable doesn't load it directly. Instead it loads a DLL
that loads another DLL that eventually loads my DLL.
I hope that makes sense. So like i said, in the msdn documentation it
says that the "module must have been loaded by the calling process" in
which in this case, it doesn't.
How would I go about getting the module handle of ws2_32.dll from my
process?
thanks
I am trying to use GetModuleHandle and in the documentation it says:
"Retrieves a module handle for the specified module. The module must
have been loaded by the calling process."
So I am having a problem because in my Executable, it loads
user32.dll which loads advapi32.dll which loads secur32.dll which loads
ntdsapi.dll which loads ws2_32.dll. I got this information from
Dependecy Walker. So in other words, the chain looks something like
this:
user32.dll -> advapi32.dll -> secur32.dll -> ntdsapi.dll -> ws2_32.dll
I try to call GetModuleHandle("ws2_32.dll") but it returns NULL,
meaning that it can't get the module handle. I think the problem is
because my executable doesn't load it directly. Instead it loads a DLL
that loads another DLL that eventually loads my DLL.
I hope that makes sense. So like i said, in the msdn documentation it
says that the "module must have been loaded by the calling process" in
which in this case, it doesn't.
How would I go about getting the module handle of ws2_32.dll from my
process?
thanks