This is the mail archive of the cygwin@sources.redhat.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: DLL naming conventions


> -----Original Message-----
> From: Egor Duda [mailto:deo@logos-m.ru]
> Sent: Thursday, August 31, 2000 6:44 PM
> To: Chris Faylor
> Cc: Charles S. Wilson
> Subject: Re: DLL naming conventions
> 
> 
> Hi!
> 
> Thursday, 31 August, 2000 Chris Faylor cgf@cygnus.com wrote:
> 
> >>(This  argument is based on the supposition that dll's with the same
> >>name  will  always  conflict.  If  I'm wrong about that supposition,
> >>please correct me...as I stated above, I'm a bit confused as to when
> >>dll's will conflict and when they will not)
> 
> CF> Can someone write a simple test to verify Windows 
> behavior?  It's pointless
> CF> to argue about what Windows does with DLLs if we don't 
> know for sure.
> 
> with ease. all you need is two different builds of cygwin1.dll, sh.exe
> and  strace.exe  i've  used  my  yesterday's build and current one.
> 1. create 2 directories -- say c:\test\1 and c:\test\2
> 2. copy first cygwin1.dll to c:\test\1 and other build to c:\test\2
> 3. copy sh.exe and strace.exe into both c:\test\1 and c:\test\2
> 4. start cmd.exe, cd c:\test\1, strace -o sh.log sh
> 5. start cmd.exe, cd c:\test\2, strace -o sh.log sh
> 6.  look  at the string containing "DLL build" in c:\test\1\sh.log and
> c:\test\2\sh.log
> 
> voila
> 

Note that there *is* a solution on Windows98 and Windows2000 (at least
reading Microsoft prose in MSDN Library) named "side-by-side DLLs"; however
this does *not* work on NT nor on 95 :-(

The idea is either by special arrangment when building the application (not
very practlical when porting) or by creating a file named "myapp.exe.local"
in the same directory than "myapp.exe", Windows will link the DLLs it found
in the same directory as "myapp.exe" BEFORE looking elsewhere, and even
before looking if it already has a copy of this DLL in memory.

This helps solve what Microsoft calls "DLL Hell", but is a typically kludgy
MS solution (especially the ".local" stuff). Some DLLs cannot run
side-by-side; their list is in
"HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\KnownDLLs"; it's not
clear however if one can add it's own DLLs to this list, for example
cygwin1.dll that cannot be run side-by-side as it shares data cross-process.

HTH

	Bernard

PS: IOW the behaviour we were talking about was documented and Microsoft
itself discover that, although it allow for better performances, it may be
problematic :-)

--------------------------------------------
Bernard Dautrevaux
Microprocess Ingéniérie
97 bis, rue de Colombes
92400 COURBEVOIE
FRANCE
Tel:	+33 (0) 1 47 68 80 80
Fax:	+33 (0) 1 47 88 97 85
e-mail:	dautrevaux@microprocess.com
		b.dautrevaux@usa.net
-------------------------------------------- 

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]