Commit f2c2eafa authored by Patrik Stridvall's avatar Patrik Stridvall Committed by Alexandre Julliard

- API files update.

- Minor improvement and bug fixes.
parent 21c3dfaa
...@@ -296,7 +296,7 @@ sub options_set { ...@@ -296,7 +296,7 @@ sub options_set {
if(/^default$/) { if(/^default$/) {
$$refvalue = $$option{default}; $$refvalue = $$option{default};
} elsif(/^all$/) { } elsif(/^all$/) {
if($name !~ /^help|debug|verbose|module$/) { if($name !~ /^(?:help|debug|verbose|module)$/) {
if(ref($$refvalue) ne "HASH") { if(ref($$refvalue) ne "HASH") {
$$refvalue = 1; $$refvalue = 1;
} else { } else {
...@@ -304,7 +304,7 @@ sub options_set { ...@@ -304,7 +304,7 @@ sub options_set {
} }
} }
} elsif(/^none$/) { } elsif(/^none$/) {
if($name !~ /^help|debug|verbose|module$/) { if($name !~ /^(?:help|debug|verbose|module)$/) {
if(ref($$refvalue) ne "HASH") { if(ref($$refvalue) ne "HASH") {
$$refvalue = 0; $$refvalue = 0;
} else { } else {
...@@ -367,8 +367,6 @@ sub show_help { ...@@ -367,8 +367,6 @@ sub show_help {
} }
} }
if($default == $current) { if($default == $current) {
$output->write("$description (default)\n");
} else {
$output->write("$description\n"); $output->write("$description\n");
} }
} }
......
...@@ -159,6 +159,48 @@ void ...@@ -159,6 +159,48 @@ void
LPCWSTR LPCWSTR
LPWSTR LPWSTR
%%cabinet.dll
%long
BOOL
HFCI
HFDI
INT_PTR
TCOMP
USHORT
int
%ptr
PCCAB
PERF
PFDICABINETINFO
PFNALLOC
PFNCLOSE
PFNFCIALLOC
PFNFCICLOSE
PFNFCIDELETE
PFNFCIFILEPLACED
PFNFCIFREE
PFNFCIGETNEXTCABINET
PFNFCIGETOPENINFO
PFNFCIGETTEMPFILE
PFNFCIOPEN
PFNFCIREAD
PFNFCISEEK
PFNFCISTATUS
PFNFCIWRITE
PFNFDIDECRYPT
PFNFDINOTIFY
PFNFREE
PFNOPEN
PFNREAD
PFNSEEK
PFNWRITE
char *
void *
%%comcat.dll %%comcat.dll
%long %long
...@@ -881,6 +923,7 @@ LPVOID ...@@ -881,6 +923,7 @@ LPVOID
LPVOID * LPVOID *
LPWORD LPWORD
LPWSTR * LPWSTR *
MEMMANINFO *
NUMBERFMTA * NUMBERFMTA *
NUMBERFMTW * NUMBERFMTW *
OFSTRUCT * OFSTRUCT *
...@@ -1270,6 +1313,7 @@ __non_rtti_object * ...@@ -1270,6 +1313,7 @@ __non_rtti_object *
_onexit_t _onexit_t
_onexit_t ** _onexit_t **
_se_translator_function _se_translator_function
_stati64 *
bad_cast * bad_cast *
bad_typeid * bad_typeid *
char * char *
...@@ -1459,6 +1503,7 @@ LPCVOID * ...@@ -1459,6 +1503,7 @@ LPCVOID *
LPDWORD LPDWORD
LPDWORD * LPDWORD *
LPRTL_RWLOCK LPRTL_RWLOCK
LPTIME_ZONE_INFORMATION
LPVOID LPVOID
LPVOID * LPVOID *
LPWSTR * LPWSTR *
...@@ -1504,6 +1549,7 @@ PVOID ...@@ -1504,6 +1549,7 @@ PVOID
PVOID * PVOID *
RTL_CRITICAL_SECTION * RTL_CRITICAL_SECTION *
STRING * STRING *
TIME_ZONE_INFORMATION *
UINT * UINT *
ULONG * ULONG *
ULONGLONG * ULONGLONG *
...@@ -2984,6 +3030,7 @@ INTERNET_STATUS_CALLBACK ...@@ -2984,6 +3030,7 @@ INTERNET_STATUS_CALLBACK
LPBYTE LPBYTE
LPCSTR * LPCSTR *
LPCVOID LPCVOID
LPCWSTR *
LPDWORD LPDWORD
LPINTERNET_BUFFERSA LPINTERNET_BUFFERSA
LPINTERNET_BUFFERSW LPINTERNET_BUFFERSW
...@@ -3194,6 +3241,8 @@ LPWSAOVERLAPPED ...@@ -3194,6 +3241,8 @@ LPWSAOVERLAPPED
LPWSAOVERLAPPED_COMPLETION_ROUTINE LPWSAOVERLAPPED_COMPLETION_ROUTINE
LPWSAPROTOCOL_INFOA LPWSAPROTOCOL_INFOA
LPWSAPROTOCOL_INFOW LPWSAPROTOCOL_INFOW
LPWSASERVICECLASSINFOA
LPWSASERVICECLASSINFOW
WS_fd_set * WS_fd_set *
char * char *
int * int *
......
...@@ -40,6 +40,10 @@ sub import { ...@@ -40,6 +40,10 @@ sub import {
&Exporter::import(@_); &Exporter::import(@_);
$Exporter::ExportLevel--; $Exporter::ExportLevel--;
if (defined($modules) && defined($win16api) && defined($win32api)) {
return;
}
require modules; require modules;
import modules qw($modules); import modules qw($modules);
...@@ -286,6 +290,7 @@ sub parse_spec_file { ...@@ -286,6 +290,7 @@ sub parse_spec_file {
if($flags =~ /(?:-register|-interrupt)/) { if($flags =~ /(?:-register|-interrupt)/) {
if($arguments) { $arguments .= " "; } if($arguments) { $arguments .= " "; }
$arguments .= "ptr"; $arguments .= "ptr";
$calling_convention .= " -register";
} }
if($external_name ne "@") { if($external_name ne "@") {
......
...@@ -76,7 +76,7 @@ my %options_long = ( ...@@ -76,7 +76,7 @@ my %options_long = (
"calling-convention-win32" => { default => 1, parent => "calling-convention", description => "calling convention checking (Win32)" }, "calling-convention-win32" => { default => 1, parent => "calling-convention", description => "calling convention checking (Win32)" },
"misplaced" => { default => 1, parent => "local", description => "check for misplaced functions" }, "misplaced" => { default => 1, parent => "local", description => "check for misplaced functions" },
"statements" => { default => 0, parent => "local", description => "check for statements inconsistances" }, "statements" => { default => 0, parent => "local", description => "check for statements inconsistances" },
"cross-call" => { default => 0, parent => "statements", description => "check for cross calling functions" }, "cross-call" => { default => 0, parent => ["statements", "win16", "win32"], description => "check for cross calling functions" },
"cross-call-win32-win16" => { "cross-call-win32-win16" => {
default => 0, parent => "cross-call", description => "check for cross calls between win32 and win16" default => 0, parent => "cross-call", description => "check for cross calls between win32 and win16"
}, },
......
...@@ -16,6 +16,10 @@ dlls/avifil32 ...@@ -16,6 +16,10 @@ dlls/avifil32
dlls/avifil32 dlls/avifil32
% dlls/cabinet/cabinet.spec
dlls/cabinet
% dlls/comcat/comcat.spec % dlls/comcat/comcat.spec
dlls/comcat dlls/comcat
......
...@@ -44,6 +44,10 @@ sub import { ...@@ -44,6 +44,10 @@ sub import {
&Exporter::import(@_); &Exporter::import(@_);
$Exporter::ExportLevel--; $Exporter::ExportLevel--;
if (defined($modules)) {
return;
}
$modules = 'modules'->new; $modules = 'modules'->new;
} }
......
...@@ -61,10 +61,9 @@ use winapi_local; ...@@ -61,10 +61,9 @@ use winapi_local;
use winapi_global; use winapi_global;
use winapi_parser; use winapi_parser;
my %declared_functions;
my %include2info; my %include2info;
{
if ($options->global) {
my @files = get_h_files("winelib"); my @files = get_h_files("winelib");
my $progress_current = 0; my $progress_current = 0;
...@@ -152,6 +151,8 @@ if(1) { ...@@ -152,6 +151,8 @@ if(1) {
my $progress_current = 0; my $progress_current = 0;
my $progress_max = scalar(@c_files); my $progress_max = scalar(@c_files);
my %declared_functions;
if($options->headers) { if($options->headers) {
$progress_max += scalar(@h_files); $progress_max += scalar(@h_files);
...@@ -340,14 +341,9 @@ foreach my $file (@c_files) { ...@@ -340,14 +341,9 @@ foreach my $file (@c_files) {
} }
} }
foreach my $module ($function->modules) { if ($options->global) {
$module2functions{$module}{$internal_name} = $function; foreach my $module ($function->modules) {
$module2functions{$module}{$internal_name} = $function;
my @types = ($return_type);
my $refargument_types = $function->argument_types;
if(defined($refargument_types)) {
push @types, @$refargument_types;
} }
} }
......
...@@ -150,6 +150,12 @@ sub _check_function { ...@@ -150,6 +150,12 @@ sub _check_function {
my $declared_calling_convention = $winapi->function_internal_calling_convention($internal_name); my $declared_calling_convention = $winapi->function_internal_calling_convention($internal_name);
my @declared_argument_kinds = split(/\s+/, $winapi->function_internal_arguments($internal_name)); my @declared_argument_kinds = split(/\s+/, $winapi->function_internal_arguments($internal_name));
my $declared_register = 0;
if ($declared_calling_convention =~ /^(\w+) -register$/) {
$declared_register = 1;
$declared_calling_convention = $1;
}
if($implemented_calling_convention ne $declared_calling_convention && if($implemented_calling_convention ne $declared_calling_convention &&
$implemented_calling_convention ne "asm" && $implemented_calling_convention ne "asm" &&
!($declared_calling_convention =~ /^pascal/ && $forbidden_return_type) && !($declared_calling_convention =~ /^pascal/ && $forbidden_return_type) &&
...@@ -179,7 +185,7 @@ sub _check_function { ...@@ -179,7 +185,7 @@ sub _check_function {
} }
if($#argument_types != -1 && $argument_types[$#argument_types] eq "CONTEXT *" && if($#argument_types != -1 && $argument_types[$#argument_types] eq "CONTEXT *" &&
$internal_name !~ /^(Get|Set)ThreadContext$/) # FIXME: Kludge $internal_name =~ /^(?:RtlRaiseException|RtlUnwind|NtRaiseException)$/) # FIXME: Kludge
{ {
$#argument_types--; $#argument_types--;
} }
...@@ -220,6 +226,10 @@ sub _check_function { ...@@ -220,6 +226,10 @@ sub _check_function {
} }
} @argument_types; } @argument_types;
if ($declared_register && $argument_kinds[$#argument_kinds] ne "context86") {
$output->write("function declared as register, but CONTEXT86 * is not last argument\n");
}
for my $n (0..$#argument_kinds) { for my $n (0..$#argument_kinds) {
if(!defined($argument_kinds[$n]) || !defined($declared_argument_kinds[$n])) { next; } if(!defined($argument_kinds[$n]) || !defined($declared_argument_kinds[$n])) { next; }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment