> I wrote a pre-version of what could allow to delay loading of 
> imported DLLs
> for example, if DLL A imports functions from DLL B, current 
> import mechanism
> implies that B will be loaded with A
> in some cases, this is not wanted.
> this patch allows to delay actual loading of B until the 
> first function of
> B is called from A
> replacing the import B.dll line in the .spec file with 
> delay_import B.dll
> shall do the trick

Cool.

> two examples of applicable areas :
> - user32 rely on shell32 for displaying the about dialog box 
> (furthermore, 
> its an ugly hack)
> - comctl32 (in the animate control) uses video and multimedia 
> functions
> - and I don't doubt there more spread out (didn't check)
> 
> this patch is provided for comments

There are some functions forwarding to user32 in kernel32
that are needed for compabillity with native dlls.

If I try to run with native advapi32 (Win98 SE) I get:
err:win32:PE_FindExportedFunction module not found for forward
'user32.CharToOemBuffA' used by 'kernel32.dll'
err:win32:fixup_imports No implementation for KERNEL32.dll.11, setting to
0xdeadbeef

One intresting thing to note is that kernel32 doesn't import user32.
Initially I thought that was the problem, however adding import user32
doesn't help.

I should guess this is because it would create a mutual dependency between
kernel32 and user32, which the DLL loader doesn't seem to be able to handle.

While this is not the case on Windows (neither Win98SE nor WinNT40 at
least),
mutual depedencies do exit on WinNT40 between advapi32 and user32 so the
DLL really should be able to handle this.

In any case perhaps just having delayed load will help to solve this
and similar issues without having a loader that is able to handle
mutual dependencies.

Any ideas?


Reply via email to