winapi_check and -register functions

Francois Gouget fgouget at free.fr
Thu Oct 21 10:32:33 CDT 2004


winapi_check still has the warning about VxDCall:

dlls/kernel/vxd.c:279: kernel32: void VxDCall(DWORD,CONTEXT86 *): 
calling convention mismatch: cdecl != stdcall

Now this has been discussed allready in 2002:
http://www.winehq.org/hypermail/wine-devel/2002/11/0994.html

And in this discussion Alexandre said:

> It could be argued that no register function should be WINAPI, since
> they don't have to pop the arguments. But it's purely cosmetic either
> way.


So I modified winapi_check to warn about -register functions that are 
implemented by an stdcall function. But it would be easy to do something 
different.

Once the patch is applied winapi_check yields the warnings below and I 
can send a patch to fix these if this one actually gets committed. 
Either way it would be nice for our code to be more consistent on this 
point.


Changelog:

  * tools/winapi_check/winapi_local.pm

    Warn about implementing a -register function as stdcall.


dlls/kernel/heap.c:983: kernel32: void WINAPI AllocMappedBuffer(CONTEXT86 *): -register functions should not be implemented as stdcall
dlls/kernel/heap.c:1016: kernel32: void WINAPI FreeMappedBuffer(CONTEXT86 *): -register functions should not be implemented as stdcall
dlls/kernel/ne_module.c:2271: krnl386.exe & kernel32: void WINAPI MapHInstLS(CONTEXT86 *): -register functions should not be implemented as stdcall
dlls/kernel/ne_module.c:2280: krnl386.exe & kernel32: void WINAPI MapHInstSL(CONTEXT86 *): -register functions should not be implemented as stdcall
dlls/kernel/ne_module.c:2288: kernel32: void WINAPI MapHInstLS_PN(CONTEXT86 *): -register functions should not be implemented as stdcall
dlls/kernel/ne_module.c:2296: kernel32: void WINAPI MapHInstSL_PN(CONTEXT86 *): -register functions should not be implemented as stdcall
dlls/kernel/selector.c:568: kernel32: void WINAPI UnMapSLFixArray(SEGPTR,INT,CONTEXT86 *): -register functions should not be implemented as stdcall
dlls/kernel/selector.c:665: kernel32: void WINAPI SMapLS_IP_EBP_8(CONTEXT86 *): -register functions should not be implemented as stdcall
dlls/kernel/selector.c:670: kernel32: void WINAPI SMapLS_IP_EBP_12(CONTEXT86 *): -register functions should not be implemented as stdcall
dlls/kernel/selector.c:675: kernel32: void WINAPI SMapLS_IP_EBP_16(CONTEXT86 *): -register functions should not be implemented as stdcall
dlls/kernel/selector.c:680: kernel32: void WINAPI SMapLS_IP_EBP_20(CONTEXT86 *): -register functions should not be implemented as stdcall
dlls/kernel/selector.c:685: kernel32: void WINAPI SMapLS_IP_EBP_24(CONTEXT86 *): -register functions should not be implemented as stdcall
dlls/kernel/selector.c:690: kernel32: void WINAPI SMapLS_IP_EBP_28(CONTEXT86 *): -register functions should not be implemented as stdcall
dlls/kernel/selector.c:695: kernel32: void WINAPI SMapLS_IP_EBP_32(CONTEXT86 *): -register functions should not be implemented as stdcall
dlls/kernel/selector.c:700: kernel32: void WINAPI SMapLS_IP_EBP_36(CONTEXT86 *): -register functions should not be implemented as stdcall
dlls/kernel/selector.c:705: kernel32: void WINAPI SMapLS_IP_EBP_40(CONTEXT86 *): -register functions should not be implemented as stdcall
dlls/kernel/selector.c:710: kernel32: void WINAPI SMapLS(CONTEXT86 *): -register functions should not be implemented as stdcall
dlls/kernel/selector.c:725: kernel32: void WINAPI SUnMapLS(CONTEXT86 *): -register functions should not be implemented as stdcall
dlls/kernel/selector.c:743: kernel32: void WINAPI SUnMapLS_IP_EBP_8(CONTEXT86 *): -register functions should not be implemented as stdcall
dlls/kernel/selector.c:748: kernel32: void WINAPI SUnMapLS_IP_EBP_12(CONTEXT86 *): -register functions should not be implemented as stdcall
dlls/kernel/selector.c:753: kernel32: void WINAPI SUnMapLS_IP_EBP_16(CONTEXT86 *): -register functions should not be implemented as stdcall
dlls/kernel/selector.c:758: kernel32: void WINAPI SUnMapLS_IP_EBP_20(CONTEXT86 *): -register functions should not be implemented as stdcall
dlls/kernel/selector.c:763: kernel32: void WINAPI SUnMapLS_IP_EBP_24(CONTEXT86 *): -register functions should not be implemented as stdcall
dlls/kernel/selector.c:768: kernel32: void WINAPI SUnMapLS_IP_EBP_28(CONTEXT86 *): -register functions should not be implemented as stdcall
dlls/kernel/selector.c:773: kernel32: void WINAPI SUnMapLS_IP_EBP_32(CONTEXT86 *): -register functions should not be implemented as stdcall
dlls/kernel/selector.c:778: kernel32: void WINAPI SUnMapLS_IP_EBP_36(CONTEXT86 *): -register functions should not be implemented as stdcall
dlls/kernel/selector.c:783: kernel32: void WINAPI SUnMapLS_IP_EBP_40(CONTEXT86 *): -register functions should not be implemented as stdcall
dlls/kernel/thunk.c:188: kernel32: void WINAPI LogApiThkLSF(LPSTR,CONTEXT86 *): -register functions should not be implemented as stdcall
dlls/kernel/thunk.c:198: kernel32: void WINAPI LogApiThkSL(LPSTR,CONTEXT86 *): -register functions should not be implemented as stdcall
dlls/kernel/thunk.c:208: kernel32: void WINAPI LogCBThkSL(LPSTR,CONTEXT86 *): -register functions should not be implemented as stdcall
dlls/kernel/thunk.c:441: kernel32: void WINAPI QT_Thunk(CONTEXT86 *): -register functions should not be implemented as stdcall
dlls/kernel/thunk.c:525: kernel32: void WINAPI FT_Prolog(CONTEXT86 *): -register functions should not be implemented as stdcall
dlls/kernel/thunk.c:567: kernel32: void WINAPI FT_Thunk(CONTEXT86 *): -register functions should not be implemented as stdcall
dlls/kernel/thunk.c:648: kernel32: void WINAPI FT_Exit0(CONTEXT86 *): -register functions should not be implemented as stdcall
dlls/kernel/thunk.c:653: kernel32: void WINAPI FT_Exit4(CONTEXT86 *): -register functions should not be implemented as stdcall
dlls/kernel/thunk.c:658: kernel32: void WINAPI FT_Exit8(CONTEXT86 *): -register functions should not be implemented as stdcall
dlls/kernel/thunk.c:663: kernel32: void WINAPI FT_Exit12(CONTEXT86 *): -register functions should not be implemented as stdcall
dlls/kernel/thunk.c:668: kernel32: void WINAPI FT_Exit16(CONTEXT86 *): -register functions should not be implemented as stdcall
dlls/kernel/thunk.c:673: kernel32: void WINAPI FT_Exit20(CONTEXT86 *): -register functions should not be implemented as stdcall
dlls/kernel/thunk.c:678: kernel32: void WINAPI FT_Exit24(CONTEXT86 *): -register functions should not be implemented as stdcall
dlls/kernel/thunk.c:683: kernel32: void WINAPI FT_Exit28(CONTEXT86 *): -register functions should not be implemented as stdcall
dlls/kernel/thunk.c:688: kernel32: void WINAPI FT_Exit32(CONTEXT86 *): -register functions should not be implemented as stdcall
dlls/kernel/thunk.c:693: kernel32: void WINAPI FT_Exit36(CONTEXT86 *): -register functions should not be implemented as stdcall
dlls/kernel/thunk.c:698: kernel32: void WINAPI FT_Exit40(CONTEXT86 *): -register functions should not be implemented as stdcall
dlls/kernel/thunk.c:703: kernel32: void WINAPI FT_Exit44(CONTEXT86 *): -register functions should not be implemented as stdcall
dlls/kernel/thunk.c:708: kernel32: void WINAPI FT_Exit48(CONTEXT86 *): -register functions should not be implemented as stdcall
dlls/kernel/thunk.c:713: kernel32: void WINAPI FT_Exit52(CONTEXT86 *): -register functions should not be implemented as stdcall
dlls/kernel/thunk.c:718: kernel32: void WINAPI FT_Exit56(CONTEXT86 *): -register functions should not be implemented as stdcall
dlls/kernel/thunk.c:786: kernel32: void WINAPI Common32ThkLS(CONTEXT86 *): -register functions should not be implemented as stdcall
dlls/kernel/thunk.c:845: kernel32: void WINAPI OT_32ThkLSF(CONTEXT86 *): -register functions should not be implemented as stdcall
dlls/kernel/thunk.c:954: kernel32: void WINAPI FT_PrologPrime(CONTEXT86 *): -register functions should not be implemented as stdcall
dlls/kernel/thunk.c:983: kernel32: void WINAPI QT_ThunkPrime(CONTEXT86 *): -register functions should not be implemented as stdcall
dlls/kernel/thunk.c:1124: kernel32: void WINAPI W32S_BackTo32(CONTEXT86 *): -register functions should not be implemented as stdcall
dlls/kernel/thunk.c:1247: kernel32: void WINAPI K32Thk1632Prolog(CONTEXT86 *): -register functions should not be implemented as stdcall
dlls/kernel/thunk.c:1308: kernel32: void WINAPI K32Thk1632Epilog(CONTEXT86 *): -register functions should not be implemented as stdcall
dlls/kernel/thunk.c:2107: kernel32: void WINAPI CommonUnimpStub(CONTEXT86 *): -register functions should not be implemented as stdcall


-- 
Francois Gouget         fgouget at free.fr        http://fgouget.free.fr/
   Good judgment comes from experience, and experience comes from bad judgment
                                -- Barry LePatner
-------------- next part --------------
Index: tools/winapi_check/winapi_local.pm
===================================================================
RCS file: /var/cvs/wine/tools/winapi_check/winapi_local.pm,v
retrieving revision 1.39
diff -u -r1.39 winapi_local.pm
--- tools/winapi_check/winapi_local.pm	7 Oct 2004 18:53:56 -0000	1.39
+++ tools/winapi_check/winapi_local.pm	21 Oct 2004 14:53:43 -0000
@@ -156,7 +156,14 @@
 	$declared_calling_convention = $1;
     }
 
-    if($implemented_calling_convention ne $declared_calling_convention &&
+    if ($declared_register)
+    {
+        if ($implemented_calling_convention eq "stdcall")
+        {
+	    $output->write("-register functions should not be implemented as stdcall\n");
+        }
+    }
+    elsif($implemented_calling_convention ne $declared_calling_convention &&
        $implemented_calling_convention ne "asm" &&
        !($declared_calling_convention =~ /^pascal/ && $forbidden_return_type) &&
        !($implemented_calling_convention =~ /^cdecl|varargs$/ && $declared_calling_convention =~ /^cdecl|varargs$/))


More information about the wine-patches mailing list