Today, c2man assumes that there is no file extension in the DLL name part of a forward specification. This causes forwarded exports to krnl386.exe16 from kernel32 to be recognized incorrectly. For example, the spec index file for kernel32 contains the following incorrect entry:
VxDCall0() (forwarded to exe16.VxDCall0() in krnl386())
Fix this by correctly handling DLL names with file extensions in forward specifications. We omit the extension in the link destination, but not the link text itself. The line above is now changed into:
VxDCall0() (forwarded to VxDCall0() in {{krnl386.exe16}}{{krnl386}})
We switch to the double-brace syntax for the DLL hyperlink, since the "<id>()" syntax cannot accept strings with dots in them.
Signed-off-by: Jinoh Kang jinoh.kang.kr@gmail.com --- c2man.pl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/c2man.pl b/c2man.pl index 0fe9e78..883a888 100755 --- a/c2man.pl +++ b/c2man.pl @@ -1229,9 +1229,9 @@ sub output_spec($) # @$_ => ordinal, call convention, exported name, implementation name, flags; if (@$_[$EXPORT_CALL] eq "forward") { - my $forward_dll = @$_[$EXPORT_IMPNAME]; - $forward_dll =~ s/.(.*)//; - $line = @$_[$EXPORT_EXPNAME]." (forward to ".$1."() in ".$forward_dll."())"; + if (@$_[$EXPORT_IMPNAME] =~ /^(?:([^.]*)((?:..*)?).)?([^.]*)$/) { + $line = @$_[$EXPORT_EXPNAME]." (forward to ".$3."() in {{".$1.$2."}}{{".$1."}})"; + } } elsif (@$_[$EXPORT_CALL] eq "extern") {
Some forward specifications specify the module name in uppercase (e.g. NTDLL), whereas Wine DLL names are always in lowercase (e.g. ntdll).
Signed-off-by: Jinoh Kang jinoh.kang.kr@gmail.com --- c2man.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/c2man.pl b/c2man.pl index 883a888..b4226a0 100755 --- a/c2man.pl +++ b/c2man.pl @@ -1230,7 +1230,7 @@ sub output_spec($) if (@$_[$EXPORT_CALL] eq "forward") { if (@$_[$EXPORT_IMPNAME] =~ /^(?:([^.]*)((?:..*)?).)?([^.]*)$/) { - $line = @$_[$EXPORT_EXPNAME]." (forward to ".$3."() in {{".$1.$2."}}{{".$1."}})"; + $line = @$_[$EXPORT_EXPNAME]." (forward to ".$3."() in {{".$1.$2."}}{{".lc($1)."}})"; } } elsif (@$_[$EXPORT_CALL] eq "extern")