Re: System-wide hooking, VB+ASM
- From: erewhon@xxxxxxxxxx (J French)
- Date: Wed, 8 Jun 2005 07:03:57 +0000 (UTC)
On Tue, 7 Jun 2005 11:54:52 -0700, "Sam Hobbs"
<samuel@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
<snip>
>Note that a VB exe file has a dependency on MSVBVM60.DLL, which is the
>run-time DLL. Look at "Compiling Your Project to Native Code" for a little
>bit about that. Since VB is not designed to create DLLs that are not used
>for ActiveX/COM, it is likely that when a function in a VB-generated DLL is
>called directly that the run-time services in MSVBVM60.DLL have not had the
>opportunity to initialize the VB run-time for processes that have not yet
>used VB.
>If a VB program calls a function in a DLL generated by VB to set a hook, the
>VB program does have the opportunity to initialize the VB run-time for the
>process . I don't know what happens, but my guess is that when a function in
>a VB-generated DLL is called directly by a VB program, that the run-time
>services in MSVBVM60.DLL do not need to be initialized for the DLL function
>since the run-time would have already been initialized for the process.
>However for system-wide hooks, the hook function in a DLL can be called
>without any other VB code being called for the process.
As it happens I know for a fact that DllMain is invoked when a Delphi
DLL is instantiated for a system wide hook.
I do not agree that DLLs are just 'plain code', there is a fairly
complex mechanism for initializing them (LoadLibrary springs to mind)
also being 'under the hood' EXEs they need 'fixing up' - internally
their addresses are relative
- the system performs a little dance down the EXE turning relative
addresses into absolute addresses.
The RTL is (almost certainly) required for calls out of VB, as it has
to perform its rather perverse type conversions.
Interestingly, I've found that calls /into/ VB are pretty bland.
.
- Follow-Ups:
- Re: System-wide hooking, VB+ASM
- From: Sam Hobbs
- Re: System-wide hooking, VB+ASM
- References:
- Re: System-wide hooking, VB+ASM
- From: TC
- Re: System-wide hooking, VB+ASM
- From: Simon Woods
- Re: System-wide hooking, VB+ASM
- From: Sam Hobbs
- Re: System-wide hooking, VB+ASM
- From: Simon Woods
- Re: System-wide hooking, VB+ASM
- From: Sam Hobbs
- Re: System-wide hooking, VB+ASM
- From: Simon Woods
- Re: System-wide hooking, VB+ASM
- Prev by Date: Re: Extension API
- Next by Date: Re: how to find app termination event?
- Previous by thread: Re: System-wide hooking, VB+ASM
- Next by thread: Re: System-wide hooking, VB+ASM
- Index(es):
Relevant Pages
|