Hi,
As a result of the "Wine FIXME Report 2009 Aug - Dec" thread, I created the following to hunt for DllCanUnloadNow calls that were marked as being FIXME stubs:
cat > DllCanUnloadNow.pl < EOF #!/usr/local/bin/perl # Based on http://www.unix.com/unix-dummies-questions-answers/56703-multiline-grep.html
use strict;
my $filename = shift;
open (FILE, "<", $filename) or die "Failed to read file $filename : $! \n"; my $whole_file; { local $/; $whole_file = <FILE>; } close(FILE);
if ($whole_file =~ m#HRESULT WINAPI DllCanUnloadNow ?( ?(void|VOID) ?)[\n ]{\n\s+FIXME#sg) { print $filename . "\n"; } EOF
and used it with the following:
$ grep -F DllCanUnloadNow -r dlls | grep -F HRESULT | sed -e 's/:.*//' | while read line ; do perl DllCanUnloadNow.pl $line ; done | sort | tee results.log
This gives the following results: ----- 8< ----- dlls/ddrawex/main.c dlls/dinput/dinput_main.c dlls/dpnhpast/main.c dlls/dsound/dsound_main.c dlls/hlink/hlink_main.c dlls/hnetcfg/hnetcfg.c dlls/inetcomm/inetcomm_main.c dlls/infosoft/infosoft_main.c dlls/inseng/inseng_main.c dlls/itircl/itircl_main.c dlls/mmdevapi/main.c dlls/mpr/mpr_main.c dlls/mscoree/mscoree_main.c dlls/msimtf/main.c dlls/msxml3/main.c dlls/oledb32/main.c dlls/olepro32/olepro32stubs.c dlls/pstorec/pstorec.c dlls/query/query_main.c dlls/shell32/shell32_main.c dlls/sti/sti_main.c dlls/wbemprox/main.c dlls/winhttp/main.c dlls/wmiutils/main.c dlls/wuapi/main.c ----- >8 -----
I am currently going through the results and removing the FIXME stubs for the DllCanUnloadNow calls, as returning S_FALSE is a perfectly valid implementation (see the "Wine FIXME Report 2009 Aug - Dec" discussion).
While doing this, I noticed that some implementations of DllGetClassObject, DllRegisterServer and DllUnregisterServer also have FIXMEs. This is because the DLLs implement COM objects, but the wine versions are incomplete.
For the DllRegister/UnregisterServer calls, the FIXMEs should be removed -- the FIXMEs do not add any value, and are only likely to appear during install or when calling regsvr32.
For DllGetClassObject, the FIXME should output the GUID of the object that is trying to be created.
NOTE: I have also seen some implementations of DllCanUnloadNow that always return S_OK (e.g. dlls/hlink/hlink_main.c, even though it is implementing COM objects). I will keep a note of these and look to see whether they implement COM objects or not. I will sent a separate patch to address this issue.
- Reece