http://bugs.winehq.org/show_bug.cgi?id=7116
--- Comment #19 from Dmitry Timoshkov dmitry@codeweavers.com 2008-01-29 23:42:08 --- The problem seems to be related to the fact that GetFileVersionInfoXXXX APIs may trash the refcount of loaded DLLs. That happens because GetModuleHandleExW increments the refcount *only* for the library handle passed to it, but FreeLibrary which gets called later decrements refcounts for each linked in library. This may imply a bug in GetModuleHandleExW.
However. The testing with native version.dll shows that it doesn't care about already loaded modules and always loads the library as a data file, i.e calls LoadLibraryExW(filename, 0, LOAD_LIBRARY_AS_DATAFILE);