From d18837b7aa9644c1f0e255729719c700f090fb37 Mon Sep 17 00:00:00 2001 From: Patrik Stridvall Date: Wed, 7 Jun 2000 02:11:42 +0000 Subject: [PATCH] - Minor API files update. - Turned on calling convention checking for Win32 functions by default. --- tools/winapi_check/modules.dat | 114 +++++++++++++++++----------------- tools/winapi_check/win32/comdlg32.api | 2 + tools/winapi_check/win32/odbc32.api | 5 +- tools/winapi_check/winapi_check | 4 +- tools/winapi_check/winapi_local.pm | 9 ++- tools/winapi_check/winapi_options.pm | 4 +- 6 files changed, 72 insertions(+), 66 deletions(-) diff --git a/tools/winapi_check/modules.dat b/tools/winapi_check/modules.dat index 649d18c9c55..25821f1c4c5 100644 --- a/tools/winapi_check/modules.dat +++ b/tools/winapi_check/modules.dat @@ -41,11 +41,6 @@ dlls/ddraw/dclipper dlls/dinput -% dlls/display/display.spec - -dlls/display -objects - % dlls/dplayx/dplay.spec dlls/dplayx @@ -93,6 +88,58 @@ dlls/imagehlp dlls/imm32 +% dlls/kernel/comm.spec + +% dlls/kernel/kernel.spec + +files +if1632 +loader/ne +loader +memory +misc +msdos +relay32 +scheduler +win32 + +% dlls/kernel/kernel32.spec + +files +loader/ne +loader +memory +misc +objects +ole +relay32 +scheduler +win32 + +% dlls/kernel/system.spec + +misc + +% dlls/kernel/toolhelp.spec + +loader/ne +loader +memory +misc +windows + +% dlls/kernel/wow32.spec + +relay32 + +% dlls/kernel/wprocs.spec + +if1632 +loader/ne +msdos +relay32 +windows + % dlls/lzexpand/lz32.spec dlls/lzexpand @@ -274,6 +321,11 @@ windows dlls/user misc +% dlls/user/display.spec + +dlls/user +objects + % dlls/user/user.spec controls @@ -414,55 +466,3 @@ win32 % dlls/x11drv/x11drv.spec dlls/x11drv - -% if1632/comm.spec - -% if1632/kernel.spec - -files -if1632 -loader/ne -loader -memory -misc -msdos -relay32 -scheduler -win32 - -% if1632/system.spec - -misc - -% if1632/toolhelp.spec - -loader/ne -loader -memory -misc -windows - -% if1632/wprocs.spec - -if1632 -loader/ne -msdos -relay32 -windows - -% relay32/kernel32.spec - -files -loader/ne -loader -memory -misc -objects -ole -relay32 -scheduler -win32 - -% relay32/wow32.spec - -relay32 \ No newline at end of file diff --git a/tools/winapi_check/win32/comdlg32.api b/tools/winapi_check/win32/comdlg32.api index 77b9d783ed6..981b3a75755 100644 --- a/tools/winapi_check/win32/comdlg32.api +++ b/tools/winapi_check/win32/comdlg32.api @@ -2,6 +2,7 @@ BOOL DWORD +HRESULT HWND UINT @@ -23,6 +24,7 @@ LPPAGESETUPDLGA LPPAGESETUPDLGW LPPRINTDLGA LPPRINTDLGW +LPVOID %str diff --git a/tools/winapi_check/win32/odbc32.api b/tools/winapi_check/win32/odbc32.api index 4106e6bbd89..a532242d40a 100644 --- a/tools/winapi_check/win32/odbc32.api +++ b/tools/winapi_check/win32/odbc32.api @@ -7,14 +7,11 @@ SQLHENV SQLHSTMT SQLHWND SQLINTEGER +SQLRETURN SQLSMALLINT SQLUINTEGER SQLUSMALLINT -%long --extension - -SQLRETURNTYPE - %ptr SQLCHAR * diff --git a/tools/winapi_check/winapi_check b/tools/winapi_check/winapi_check index f517dfa0e2e..1f518579c65 100755 --- a/tools/winapi_check/winapi_check +++ b/tools/winapi_check/winapi_check @@ -387,11 +387,11 @@ foreach my $file ($options->c_files) { if($options->local && $options->argument) { if($options->win16 && $options->report_module($module16)) { winapi_local::check_function $options, $output16, - $return_type, $calling_convention, $external_name16, $internal_name, [@argument_types], $win16api; + $return_type, $calling_convention, $external_name16, $internal_name, [@argument_types], $nativeapi, $win16api; } if($options->win32 && $options->report_module($module32)) { winapi_local::check_function $options, $output32, - $return_type, $calling_convention, $external_name32, $internal_name, [@argument_types], $win32api; + $return_type, $calling_convention, $external_name32, $internal_name, [@argument_types], $nativeapi, $win32api; } } diff --git a/tools/winapi_check/winapi_local.pm b/tools/winapi_check/winapi_local.pm index 5dd90a4530f..73248c23816 100644 --- a/tools/winapi_check/winapi_local.pm +++ b/tools/winapi_check/winapi_local.pm @@ -11,6 +11,7 @@ sub check_function { my $internal_name = shift; my $refargument_types = shift; my @argument_types = @$refargument_types; + my $nativeapi = shift; my $winapi = shift; my $module = $winapi->function_module($internal_name); @@ -76,7 +77,7 @@ sub check_function { } elsif($calling_convention =~ /^__stdcall|VFWAPI|WINAPI|CALLBACK$/) { $implemented_calling_convention = "stdcall"; } else { - $implemented_calling_convention = ""; + $implemented_calling_convention = "cdecl"; } } @@ -96,7 +97,11 @@ sub check_function { !($declared_calling_convention =~ /^pascal/ && $forbidden_return_type) && !($implemented_calling_convention =~ /^cdecl|varargs$/ && $declared_calling_convention =~ /^cdecl|varargs$/)) { - if($options->calling_convention) { + if($options->calling_convention && ( + ($options->calling_convention_win16 && $winapi->name eq "win16") || + ($options->calling_convention_win32 && $winapi->name eq "win32")) && + !$nativeapi->is_function($internal_name)) + { &$output("calling convention mismatch: $implemented_calling_convention != $declared_calling_convention"); } } diff --git a/tools/winapi_check/winapi_options.pm b/tools/winapi_check/winapi_options.pm index 5c90f9167a0..1f15aebd756 100644 --- a/tools/winapi_check/winapi_options.pm +++ b/tools/winapi_check/winapi_options.pm @@ -58,7 +58,9 @@ my %options = ( parser => \&parser_comma_list, description => "argument kind checking" }, - "calling-convention" => { default => 0, parent => "local", description => "calling convention checking" }, + "calling-convention" => { default => 1, parent => "local", description => "calling convention checking" }, + "calling-convention-win16" => { default => 0, parent => "calling-convention", description => "calling convention checking (Win16)" }, + "calling-convention-win32" => { default => 1, parent => "calling-convention", description => "calling convention checking (Win32)" }, "misplaced" => { default => 1, parent => "local", description => "check for misplaced functions" }, "statements" => { default => 0, parent => "local", description => "check for statements inconsistances" }, "cross-call" => { default => 0, parent => "statements", description => "check for cross calling functions" }, -- 2.11.4.GIT