Andreas Mohr writes:
 > That's why IMHO we should just LoadLibrary() (i.e. obey the loadorder)
 > *any* file name given for GetFileVersionInfo*() and read out the
 > VERSION_INFO_xxx by using the Windows resource handling functions
 > and throw the whole code for directly reading out the VERSION_INFO
 > from a file away.
 > Or does GetFileVersionInfo*() get used for non-libraries sometimes, too ?
 > (I'm afraid it does)
 > In this case we can't throw away the old code that directly reads the content
 > from the file, as we need to use it in case LoadLibrary() of the file fails.

You could use LOAD_LIBRARY_AS_DATAFILE, this would speed up the
process, as references are not resolved and it would make it possible
to load executables to obtain the version info, too. 

 > And a GetFileVersionInfo*() normally happens directly before a LoadLibrary()
 > anyway.
 > Hmm, a question about that:
 > If we do the LoadLibrary() in GetFileVersionInfo*() and do a FreeLibrary()
 > at the end (usage count down to 0 again ! -> removal),
 > then the LoadLibrary() of the same file probably done by the Windows
 > program some lines later will need to load the whole library again, no ?
 > Maybe we should use a service timer callback for doing the FreeLibrary()
 > 2 minutes later in order to keep the usage count from going to 0 before
 > the program has loaded the library ?

This might lead to other problems. Under Windows you can't remove or
overwrite a library or executable as long as it is loaded. While this
is possible with wine now, I think we want to change wine here to
behave more like Windows. I will send a patch soon, which lets
DeleteFile() and MoveFileEx() go through the server. This will make it
impossible to delete a loaded PE-library from within wine. The plan
behind this is to use the filename of a loaded library as unique
identifier, which seems to be needed for the implementation of shared
PE sections. 

Now imagine some installation programm, which calls
GetFileVersionInfo() on some library, detects, that it has to replace
the library and can't do this, because it is still loaded. 

Greetings, 

Peter

-- 
Peter Ganten
[EMAIL PROTECTED]

Reply via email to