Re: How to get imagebase after a DLL gets loaded



It provides a way of retrieving the instance handle / base address if he
doesn't have one.

Well, I thought the OP made it clear that DLL is not yet loaded at the
time when he wants
to do things. Therefore, in our situation the step that you have
mentioned is absolutely unnecessary - by the time the OP is able to
take it, he will already have a module handle
(or pointer to the mapped section, if he chooses MapViewOfFile()), so
that the whole thing will be already sorted out.

In fact, the step you have mentioned is appropriate only if you don't
know the names of the modules that are loaded into your address space


Anton Bassov


William DePalo [MVP VC++] wrote:
"anton bassov" <soviet_bloke@xxxxxxxxxxx> wrote in message
news:1164985935.593047.310150@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
This is absolutely unnecessary step, which involves a system call. What
is the point of making function calls, especially the ones that involve
user-to-kernel mode transition, at the time when you already have DLL's
base address???? Just for the fun of doing it?????

It provides a way of retrieving the instance handle / base address if he
doesn't have one.

Regards,
Will

.



Relevant Pages

  • Re: Importing a Class define in a Dll
    ... pointer as an extra parameter passed to each non-static ... It is specially useful for the ARM platform as the ... MyClass() {... ... Build the DLL containing your class in the same ...
    (microsoft.public.windowsce.embedded.vc)
  • Re: Exception handling for loading of dependency library?
    ... typedef int (const CString & s, ... A common technique for doing this is to declare it as a global variable, ... the handle for a given dll all in one place. ... pointless because ANSI C does not require dereferencing function pointer variables. ...
    (microsoft.public.vc.mfc)
  • Re: How to program plugin DLLs
    ... build the descriptor you mentioned. ... That class is the "only" element to be exported from the DLL. ... pointer to that class and then call something like this: ... > What I might consider here is a method which fills in a popup menu. ...
    (microsoft.public.vc.mfc)
  • Re: Pointers and DLLs/shared libraries
    ... These pointer variables will point to data in the main program. ... subroutine set_pointer ... (DLLs and shared libraries do not always behave like ordinary ... ....the DLL effectively becomes a part of all of the client programs that use it. ...
    (comp.lang.fortran)
  • Re: dll load address
    ... Marco Ventanas ... >> I'm trying to read the dll import table using a pointer initialized to ... >> but as I read the first byte pointed by this pointer, ... but the displayed Base Addr is the same for all ...
    (microsoft.public.windowsce.platbuilder)