- Added new option --documentation-arguments
- Minor API files update

diff --git a/tools/winapi_check/modules.dat b/tools/winapi_check/modules.dat
index bc2033d..aae92d3 100644
--- a/tools/winapi_check/modules.dat
+++ b/tools/winapi_check/modules.dat
@@ -354,7 +354,6 @@
 % dlls/win32s/w32skrnl.spec
 
 dlls/win32s
-loader
 
 % dlls/win32s/w32sys.spec
 
@@ -450,7 +449,6 @@
 % dlls/winspool/winspool.drv.spec
 
 dlls/winspool
-win32
 
 % dlls/wow32/wow32.spec
 
diff --git a/tools/winapi_check/nativeapi.dat b/tools/winapi_check/nativeapi.dat
index 321286a..07a840e 100644
--- a/tools/winapi_check/nativeapi.dat
+++ b/tools/winapi_check/nativeapi.dat
@@ -45,7 +45,7 @@
 div
 dup
 dup2
-environ
+ecvt
 errno
 execlp
 execvp
@@ -54,6 +54,7 @@
 fabs
 fclose
 fcntl
+fcvt
 fdopen
 feof
 fflush
@@ -79,6 +80,7 @@
 ftell
 ftruncate
 fwrite
+gcvt
 getc
 getcwd
 getenv
diff --git a/tools/winapi_check/win16/toolhelp.api b/tools/winapi_check/win16/toolhelp.api
index 8100ff2..b2d5cbf 100644
--- a/tools/winapi_check/win16/toolhelp.api
+++ b/tools/winapi_check/win16/toolhelp.api
@@ -31,6 +31,10 @@
 
 LPCSTR
 
+%void
+
+void
+
 %word
 
 BOOL16
diff --git a/tools/winapi_check/win32/crtdll.api b/tools/winapi_check/win32/crtdll.api
index 0e30121..8a87159 100644
--- a/tools/winapi_check/win32/crtdll.api
+++ b/tools/winapi_check/win32/crtdll.api
@@ -27,7 +27,6 @@
 %longlong
  
 LONGLONG
-ULONGLONG
 
 %ptr
 
diff --git a/tools/winapi_check/winapi.pm b/tools/winapi_check/winapi.pm
index 32df607..eadca22 100644
--- a/tools/winapi_check/winapi.pm
+++ b/tools/winapi_check/winapi.pm
@@ -268,7 +268,10 @@
 	} 
 
 	my $ordinal;
-	if(/^(\d+|@)\s+(pascal|pascal16|stdcall|stdcall64|cdecl|register|interrupt|varargs)\s+(\S+)\s*\(\s*(.*?)\s*\)\s*(\S+)$/) {
+	if(/^(\d+|@)\s+
+	   (pascal|pascal16|stdcall|cdecl|register|interrupt|varargs)
+	   (?:\s+(?:-noimport|-norelay|-i386|-ret64))*\s+(\S+)\s*\(\s*(.*?)\s*\)\s*(\S+)$/x)
+	{
 	    my $calling_convention = $2;
 	    my $external_name = $3;
 	    my $arguments = $4;
@@ -350,7 +353,7 @@
 	    my $forward_name = $4;
 
 	    $$function_forward{$external_name} = "$module:$forward_module.$forward_name";
-	} elsif(/^(\d+|@)\s+(equate|long|word|extern|forward)/) {
+	} elsif(/^(\d+|@)\s+(equate|extern|variable)/) {
 	    # ignore
 	} else {
 	    my $next_line = <IN>;
diff --git a/tools/winapi_check/winapi_check b/tools/winapi_check/winapi_check
index 5e6c2fe..bd6f9e5 100755
--- a/tools/winapi_check/winapi_check
+++ b/tools/winapi_check/winapi_check
@@ -192,6 +192,8 @@
 	    my @argument_types = @$refargument_types;
 	    my $refargument_names = shift;
 	    my @argument_names = @$refargument_names;
+	    my $refargument_documentations = shift;
+	    my @argument_documentations = @$refargument_documentations;
 	    my $statements = shift;
 
 	    foreach my $winapi (@winapis) {
@@ -273,6 +275,8 @@
 	my @argument_types = @$refargument_types;
 	my $refargument_names = shift;
 	my @argument_names = @$refargument_names;
+	my $refargument_documentations = shift;
+	my @argument_documentations = @$refargument_documentations;
 	my $statements = shift;
 
 	my $external_name16 = $win16api->function_external_name($internal_name);
@@ -480,7 +484,7 @@
 		}
 
 		if($documentation !~ /\b($internal_name|$name1|$name2)\b/) {
-		    $output->write("\\\n$documentation\n");
+		    $output->write("documentation: \\\n$documentation\n");
 		}
 
 		if($options->documentation_width) {		
@@ -493,6 +497,18 @@
 			}
 		    }
 		}
+		
+		if($options->documentation_arguments) {
+		    my $n = 0;
+		    for my $argument_documentation (@argument_documentations) {
+			$n++;
+			if($argument_documentation ne "") {
+			    if($argument_documentation !~ /^\/\*\s+\[(?:in|out|in\/out)\].*?\*\/$/) {
+				$output->write("argument $n documentation: \\\n$argument_documentation\n");
+			    }
+			}
+		    }
+		}
 	    }
 	    $output->prefix("");
 	}
diff --git a/tools/winapi_check/winapi_local.pm b/tools/winapi_check/winapi_local.pm
index 678aac4..315ce41 100644
--- a/tools/winapi_check/winapi_local.pm
+++ b/tools/winapi_check/winapi_local.pm
@@ -76,7 +76,7 @@
 	    $implemented_calling_convention = "varargs";
 	} elsif($calling_convention =~ /^__stdcall|VFWAPI|WINAPI|CALLBACK$/) {
 	    if($implemented_return_kind =~ /^longlong$/) {
-		$implemented_calling_convention = "stdcall64";
+		$implemented_calling_convention = "stdcall"; # FIXME: Check entry flags
 	    } else {
 		$implemented_calling_convention = "stdcall";
 	    }
diff --git a/tools/winapi_check/winapi_options.pm b/tools/winapi_check/winapi_options.pm
index 2c374b5..0536dcd 100644
--- a/tools/winapi_check/winapi_options.pm
+++ b/tools/winapi_check/winapi_options.pm
@@ -73,6 +73,7 @@
     "debug-messages" => { default => 0, parent => "statements", description => "check for debug messages inconsistances" },
     "documentation" => { default => 1, parent => "local", description => "check for documentation inconsistances\n" },
     "documentation-width" => { default => 0, parent => "documentation", description => "check for documentation width inconsistances\n" },
+    "documentation-arguments" => { default => 0, parent => "documentation", description => "check for arguments documentation inconsistances\n" },
     "prototype" => { default => 0, parent => ["local", "headers"], description => "prototype checking" },
 
     "global" => { default => 1, description => "global checking" },
diff --git a/tools/winapi_check/winapi_parser.pm b/tools/winapi_check/winapi_parser.pm
index 630ec8f..18c8f71 100644
--- a/tools/winapi_check/winapi_parser.pm
+++ b/tools/winapi_check/winapi_parser.pm
@@ -16,6 +16,7 @@
     my $function = "";
     my $argument_types;
     my $argument_names;
+    my $argument_documentations;
     my $statements;
 
     my $function_begin = sub {
@@ -26,18 +27,26 @@
 	$function = shift;
 	$argument_types = shift;
 	$argument_names = shift;
-	
+	$argument_documentations = shift;
+
 	if($#$argument_names == -1) {
 	    foreach my $n (0..$#$argument_types) {
 		push @$argument_names, "";
 	    }
 	}
 
+	if($#$argument_documentations == -1) {
+	    foreach my $n (0..$#$argument_documentations) {
+		push @$argument_documentations, "";
+	    }
+	}
+
 	$statements = "";
     };
     my $function_end = sub {
-	&$function_found_callback($documentation,$linkage,$return_type,$calling_convention,
-				  $function,$argument_types,$argument_names,$statements);
+	&$function_found_callback($documentation,$linkage,$return_type,
+				  $calling_convention,$function,$argument_types,
+				  $argument_names,$argument_documentations,$statements);
 	$function = "";
     };
 
@@ -113,12 +122,21 @@
 	    next; 
 	}
 
-	my $documentation; 
+	my $documentation;
+	my @argument_documentations;
 	{
 	    my $n = $#comments;
-	    while($n >= 0 && ($comments[$n] !~ /^\/\*\*/ || $comments[$n] =~ /^\/\*\*+\//)) { $n-- }
+	    while($n >= 0 && ($comments[$n] !~ /^\/\*\*/ ||
+			      $comments[$n] =~ /^\/\*\*+\//)) 
+	    {
+		$n--;
+	    }
+
 	    if(defined($comments[$n]) && $n >= 0) {
 		$documentation = $comments[$n];
+		for(my $m=$n+1; $m <= $#comments; $m++) {
+		    push @argument_documentations, $comments[$m];
+		}
 	    } else {
 		$documentation = "";
 	    }
@@ -228,7 +246,7 @@
 	    $arguments =~ y/\t\n/  /;
 	    $arguments =~ s/^\s*(.*?)\s*$/$1/;
 	    if($arguments eq "") { $arguments = "void" }
-	    
+
 	    my @argument_types;
 	    my @argument_names;
 	    my @arguments = split(/,/, $arguments);
@@ -243,7 +261,12 @@
 		if($argument =~ /^\.\.\.$/) {
 		    $argument_type = "...";
 		    $argument_name = "...";
-		} elsif($argument =~ /^((?:struct\s+|union\s+|enum\s+|(?:signed\s+|unsigned\s+)(?:short\s+(?=int)|long\s+(?=int))?)?\w+)\s*((?:const)?\s*(?:\*\s*?)*)\s*(?:WINE_UNUSED\s+)?(\w*)\s*(?:\[\]|\s+OPTIONAL)?/) {
+		} elsif($argument =~ /^
+			((?:struct\s+|union\s+|enum\s+|(?:signed\s+|unsigned\s+)
+			  (?:short\s+(?=int)|long\s+(?=int))?)?\w+)\s*
+			((?:const)?\s*(?:\*\s*?)*)\s*
+			(?:WINE_UNUSED\s+)?(\w*)\s*(?:\[\]|\s+OPTIONAL)?/x)
+		{
 		    $argument_type = "$1";
 		    if($2 ne "") {
 			$argument_type .= " $2";
@@ -269,8 +292,8 @@
 	    if($options->debug) {
 		print "$file: $return_type $calling_convention $name(" . join(",", @arguments) . ")\n";
 	    }
-
-	    &$function_begin($documentation,$linkage,$return_type,$calling_convention,$name,\@argument_types,\@argument_names);
+	    
+	    &$function_begin($documentation,$linkage,$return_type,$calling_convention,$name,\@argument_types,\@argument_names,\@argument_documentations);
 	    if($level == 0) {
 		&$function_end;
 	    }