diff --git a/tools/winapi/winapi_extract b/tools/winapi/winapi_extract index 3680bdb90ea..de72ae0dff0 100755 --- a/tools/winapi/winapi_extract +++ b/tools/winapi/winapi_extract @@ -10,7 +10,7 @@ BEGIN { } use config qw( - &file_type &file_skip &files_skip &get_spec_files + &file_type &files_skip &files_filter &get_spec_files $current_dir $wine_dir $winapi_dir $winapi_check_dir ); use modules; diff --git a/tools/winapi_check/win32/shell32.api b/tools/winapi_check/win32/shell32.api index 6f23acabec8..d4afdf25b2a 100644 --- a/tools/winapi_check/win32/shell32.api +++ b/tools/winapi_check/win32/shell32.api @@ -38,7 +38,6 @@ HWND * IShellFolder ** IStream * ITEMIDLIST * -IUnknown * LPBROWSEINFOA LPBYTE LPCITEMIDLIST @@ -79,7 +78,6 @@ LPVOID * LPWORD LPWSTR * PAPPBARDATA -PLONG PNOTIFYICONDATAA PNOTIFYICONDATAW POINT * diff --git a/tools/winapi_check/win32/user32.api b/tools/winapi_check/win32/user32.api index 56fe1789a5d..54d57b97043 100644 --- a/tools/winapi_check/win32/user32.api +++ b/tools/winapi_check/win32/user32.api @@ -38,6 +38,7 @@ LPARAM LRESULT SHORT UINT +ULONG_PTR WCHAR WORD WPARAM @@ -70,7 +71,6 @@ COLORREF * DWORD * DLGPROC DRAWSTATEPROC -FARPROC GRAYSTRINGPROC HANDLE * HICON * @@ -127,6 +127,7 @@ PVOID RECT * SCROLLINFO * SECURITY_QUALITY_OF_SERVICE * +SENDASYNCPROC TIMERPROC UINT * WINDOWPLACEMENT * diff --git a/tools/winapi_check/winapi_check b/tools/winapi_check/winapi_check index 22d2ee941b3..d79be72dcba 100755 --- a/tools/winapi_check/winapi_check +++ b/tools/winapi_check/winapi_check @@ -180,8 +180,7 @@ my %type_found = (); foreach my $file (@c_files) { my %functions = (); - my @includes = (); - my %needed_includes = (); + my %includes = (); my $file_module16 = $modules->allowed_modules_in_file("$current_dir/$file"); my $file_module32 = $modules->allowed_modules_in_file("$current_dir/$file"); @@ -241,8 +240,14 @@ foreach my $file (@c_files) { } } - if(defined($declared_function)) { - $needed_includes{$declared_function->file}++; + if($options->headers_needed && defined($declared_function)) { + my $needed_include = $declared_function->file; + + if(!defined($includes{$needed_include})) { + my $header = $needed_include; + $header =~ s%^(include|$file_dir)/%%; + $output->write("prototype not included: #include \"$header\" is needed\n"); + } } if(1) { @@ -399,21 +404,29 @@ foreach my $file (@c_files) { } if(defined($header)) { + my $include; if(-e "$wine_dir/include/$header") { - push @includes, "include/$header"; + $include = "include/$header"; } elsif(-e "$file_dir/$header") { - push @includes, "$file_dir/$header"; + $include = "$file_dir/$header"; } elsif(-e "$file_dir/../$header") { if($file_dir =~ m%^(.*?)/[^/]+$%) { - push @includes, "$1/$header"; + $include = "$1/$header"; } else { - push @includes, "$header"; + $include = "$header"; } } elsif($header eq "controls.h") { # FIXME: Kludge - push @includes, "dlls/user/controls.h"; + $include = "dlls/user/controls.h"; } elsif($check_local) { $output->write("$file: #include \"$header\": file not found\n"); } + + if(defined($include)) { + $includes{$include}++; + foreach my $include (keys(%{$include2info{$include}{includes}})) { + $includes{$include}++; + } + } } if($check_protection && $header) { @@ -495,28 +508,6 @@ foreach my $file (@c_files) { } } - if($options->headers_needed) { - my %includes2; - foreach my $include (@includes) { - $includes2{$include}++; - foreach my $include (keys(%{$include2info{$include}{includes}})) { - $includes2{$include}++; - } - } - foreach my $needed_include (sort(keys(%needed_includes))) { - my $found = 0; - foreach my $include (sort(keys(%includes2))) { - if($needed_include eq $include) { - $found = 1; - } - } - if(!$found) { - $output->write("$file: file '$needed_include' needed but not included\n"); - } - } - } - - winapi_local::check_file $options, $output, $file, \%functions; }