2 # Copyright 1999, 2000, 2001 Patrik Stridvall
4 # This library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2.1 of the License, or (at your option) any later version.
9 # This library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # Lesser General Public License for more details.
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with this library; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 use vars qw($VERSION @ISA @EXPORT @EXPORT_OK);
28 @EXPORT_OK = qw($win16api $win32api @winapis);
30 use vars qw($win16api $win32api @winapis);
32 use config qw($current_dir $wine_dir $winapi_dir);
33 use modules qw($modules);
34 use options qw($options);
35 use output qw($output);
37 my @spec_files16 = $modules->allowed_spec_files16;
38 $win16api = 'winapi'->new("win16", \@spec_files16);
40 my @spec_files32 = $modules->allowed_spec_files32;
41 $win32api = 'winapi'->new("win32", \@spec_files32);
43 @winapis = ($win16api, $win32api);
45 for my $internal_name ($win32api->all_internal_functions) {
46 my $module16 = $win16api->function_internal_module($internal_name);
47 my $module32 = $win16api->function_internal_module($internal_name);
48 if(defined($module16) &&
49 !$win16api->is_function_stub_in_module($module16, $internal_name) &&
50 !$win32api->is_function_stub_in_module($module32, $internal_name))
52 $win16api->found_shared_internal_function($internal_name);
53 $win32api->found_shared_internal_function($internal_name);
59 my $class = ref($proto) || $proto;
61 bless ($self, $class);
63 my $name = \${$self->{NAME}};
64 my $function_forward = \%{$self->{FUNCTION_FORWARD}};
65 my $function_internal_name = \%{$self->{FUNCTION_INTERNAL_NAME}};
66 my $function_module = \%{$self->{FUNCTION_MODULE}};
69 my $refspec_files = shift;
71 foreach my $file (@$refspec_files) {
72 $self->parse_spec_file("$wine_dir/$file");
75 $self->parse_api_file("$$name.api");
77 foreach my $module (sort(keys(%$function_forward))) {
78 foreach my $external_name (sort(keys(%{$$function_forward{$module}}))) {
79 (my $forward_module, my $forward_external_name) = @{$$function_forward{$module}{$external_name}};
80 my $forward_internal_name = $$function_internal_name{$forward_external_name};
81 if(defined($forward_internal_name)) {
82 $$function_module{$forward_internal_name} .= " & $module";
101 my $allowed_kind = \%{$self->{ALLOWED_KIND}};
102 my $allowed_modules = \%{$self->{ALLOWED_MODULES}};
103 my $allowed_modules_limited = \%{$self->{ALLOWED_MODULES_LIMITED}};
104 my $allowed_modules_unlimited = \%{$self->{ALLOWED_MODULES_UNLIMITED}};
105 my $translate_argument = \%{$self->{TRANSLATE_ARGUMENT}};
106 my $type_format = \%{$self->{TYPE_FORMAT}};
116 $output->lazy_progress("$file");
118 open(IN, "< $winapi_dir/$file") || die "$winapi_dir/$file: $!\n";
121 s/^\s*?(.*?)\s*$/$1/; # remove whitespace at begin and end of line
122 s/^(.*?)\s*#.*$/$1/; # remove comments
123 /^$/ && next; # skip empty lines
127 $module =~ s/\.dll$//; # FIXME: Kludge
128 } elsif(!$modules->is_allowed_module($module)) {
130 } elsif(s/^%(\S+)\s*//) {
136 $$allowed_kind{$kind} = 1;
139 } elsif(/^--extension/) {
141 } elsif(/^--format=(\".*?\"|\S*)/) {
143 $format =~ s/^\"(.*?)\"$/$1/;
146 if(!defined($format)) {
147 if($kind eq "long") {
148 $format = "%d|%u|%x|%X|";
149 $format .= "%hd|%hu|%hx|%hX|";
150 $format .= "%ld|%lu|%lx|%lX|";
151 $format .= "%04x|%04X|0x%04x|0x%04X|";
152 $format .= "%08x|%08X|0x%08x|0x%08X|";
153 $format .= "%08lx|%08lX|0x%08lx|0x%08lX";
154 } elsif($kind eq "longlong") {
156 } elsif($kind eq "ptr") {
158 } elsif($kind eq "segptr") {
160 } elsif($kind eq "str") {
162 } elsif($kind eq "wstr") {
164 } elsif($kind eq "word") {
165 $format = "%d|%u|%x|%X|";
166 $format .= "%hd|%hu|%hx|%hX|";
167 $format .= "%04x|%04X|0x%04x|0x%04X";
169 $format = "<unknown>";
172 } elsif(defined($kind)) {
175 if(defined($module)) {
176 if($$allowed_modules_unlimited{$type}) {
177 $output->write("$file: type ($type) already specificed as an unlimited type\n");
178 } elsif(!$$allowed_modules{$type}{$module}) {
179 $$allowed_modules{$type}{$module} = 1;
180 $$allowed_modules_limited{$type} = 1;
182 $output->write("$file: type ($type) already specificed\n");
185 $$allowed_modules_unlimited{$type} = 1;
188 $$allowed_modules_limited{$type} = 1;
190 if(defined($$translate_argument{$type}) && $$translate_argument{$type} ne $kind) {
191 $output->write("$file: type ($type) respecified as different kind ($kind != $$translate_argument{$type})\n");
193 $$translate_argument{$type} = $kind;
196 $$type_format{$module}{$type} = $format;
198 $output->write("$file: file must begin with %<type> statement\n");
205 sub parse_spec_file {
208 my $function_internal_arguments = \%{$self->{FUNCTION_INTERNAL_ARGUMENTS}};
209 my $function_external_arguments = \%{$self->{FUNCTION_EXTERNAL_ARGUMENTS}};
210 my $function_internal_ordinal = \%{$self->{FUNCTION_INTERNAL_ORDINAL}};
211 my $function_external_ordinal = \%{$self->{FUNCTION_EXTERNAL_ORDINAL}};
212 my $function_internal_calling_convention = \%{$self->{FUNCTION_INTERNAL_CALLING_CONVENTION}};
213 my $function_external_calling_convention = \%{$self->{FUNCTION_EXTERNAL_CALLING_CONVENTION}};
214 my $function_internal_name = \%{$self->{FUNCTION_INTERNAL_NAME}};
215 my $function_external_name = \%{$self->{FUNCTION_EXTERNAL_NAME}};
216 my $function_forward = \%{$self->{FUNCTION_FORWARD}};
217 my $function_internal_module = \%{$self->{FUNCTION_INTERNAL_MODULE}};
218 my $function_external_module = \%{$self->{FUNCTION_EXTERNAL_MODULE}};
219 my $modules = \%{$self->{MODULES}};
220 my $module_files = \%{$self->{MODULE_FILES}};
221 my $module_external_calling_convention = \%{$self->{MODULE_EXTERNAL_CALLING_CONVENTION}};
229 $output->lazy_progress("$file");
232 $module =~ s/^.*?([^\/]*)\.spec$/$1/;
235 open(IN, "< $file") || die "$file: $!\n";
239 while($lookahead || defined($_ = <IN>)) {
246 if(/^\d+|@/) { $header = 0; $lookahead = 1; }
252 (pascal|pascal16|stdcall|cdecl|varargs)\s+
253 ((?:(?:-noimport|-noname|-norelay|-i386|-ret64|-register|-interrupt)\s+)*)(\S+)\s*\(\s*(.*?)\s*\)\s*(\S+)$/x)
255 my $calling_convention = $2;
257 my $external_name = $4;
259 my $internal_name = $6;
265 if($flags =~ /-noname/) {
266 # $external_name = "@";
269 if($flags =~ /(?:-register|-interrupt)/) {
270 if($arguments) { $arguments .= " "; }
274 if($external_name ne "@") {
275 $$module_external_calling_convention{$module}{$external_name} = $calling_convention;
277 $$module_external_calling_convention{$module}{"\@$ordinal"} = $calling_convention;
279 if(!$$function_internal_name{$external_name}) {
280 $$function_internal_name{$external_name} = $internal_name;
282 $$function_internal_name{$external_name} .= " & $internal_name";
284 if(!$$function_external_name{$internal_name}) {
285 $$function_external_name{$internal_name} = $external_name;
287 $$function_external_name{$internal_name} .= " & $external_name";
289 $$function_internal_arguments{$internal_name} = $arguments;
290 $$function_external_arguments{$external_name} = $arguments;
291 if(!$$function_internal_ordinal{$internal_name}) {
292 $$function_internal_ordinal{$internal_name} = $ordinal;
294 $$function_internal_ordinal{$internal_name} .= " & $ordinal";
296 if(!$$function_external_ordinal{$external_name}) {
297 $$function_external_ordinal{$external_name} = $ordinal;
299 $$function_external_ordinal{$external_name} .= " & $ordinal";
301 $$function_internal_calling_convention{$internal_name} = $calling_convention;
302 $$function_external_calling_convention{$external_name} = $calling_convention;
303 if(!$$function_internal_module{$internal_name}) {
304 $$function_internal_module{$internal_name} = "$module";
306 $$function_internal_module{$internal_name} .= " & $module";
308 if(!$$function_external_module{$external_name}) {
309 $$function_external_module{$external_name} = "$module";
311 $$function_external_module{$external_name} .= " & $module";
314 if(0 && $options->spec_mismatch) {
315 if($external_name eq "@") {
316 if($internal_name !~ /^\U$module\E_$ordinal$/) {
317 $output->write("$file: $external_name: the internal name ($internal_name) mismatch\n");
320 my $name = $external_name;
326 $name2 =~ s/^(?:_|Rtl|k32|K32)//;
329 $name3 =~ s/^INT_Int[0-9a-f]{2}Handler$/BUILTIN_DefaultIntHandler/;
332 $name4 =~ s/^(VxDCall)\d$/$1/;
334 # FIXME: This special case is becuase of a very ugly kludge that should be fixed IMHO
336 $name5 =~ s/^(.*?16)_(.*?)$/$1_fn$2/;
338 if(uc($internal_name) ne uc($external_name) &&
339 $internal_name !~ /(\Q$name\E|\Q$name1\E|\Q$name2\E|\Q$name3\E|\Q$name4\E|\Q$name5\E)/)
341 $output->write("$file: $external_name: internal name ($internal_name) mismatch\n");
345 } elsif(/^(\d+|@)\s+stub(?:\s+(-noimport|-noname|-norelay|-i386|-ret64))?\s+(\S+)$/) {
349 my $external_name = $3;
351 $flags = "" if !defined($flags);
353 if($flags =~ /-noname/) {
354 # $external_name = "@";
357 my $internal_name = $external_name;
359 if ($external_name ne "@") {
360 $$module_external_calling_convention{$module}{$external_name} = "stub";
362 $$module_external_calling_convention{$module}{"\@$ordinal"} = "stub";
364 if(!$$function_internal_name{$external_name}) {
365 $$function_internal_name{$external_name} = $internal_name;
367 $$function_internal_name{$external_name} .= " & $internal_name";
369 if(!$$function_external_name{$internal_name}) {
370 $$function_external_name{$internal_name} = $external_name;
372 $$function_external_name{$internal_name} .= " & $external_name";
374 if(!$$function_internal_ordinal{$internal_name}) {
375 $$function_internal_ordinal{$internal_name} = $ordinal;
377 $$function_internal_ordinal{$internal_name} .= " & $ordinal";
379 if(!$$function_external_ordinal{$external_name}) {
380 $$function_external_ordinal{$external_name} = $ordinal;
382 $$function_external_ordinal{$external_name} .= " & $ordinal";
384 if(!$$function_internal_module{$internal_name}) {
385 $$function_internal_module{$internal_name} = "$module";
386 } else { # if($$function_internal_module{$internal_name} !~ /$module/) {
387 $$function_internal_module{$internal_name} .= " & $module";
389 if(!$$function_external_module{$external_name}) {
390 $$function_external_module{$external_name} = "$module";
391 } else { # if($$function_external_module{$external_name} !~ /$module/) {
392 $$function_external_module{$external_name} .= " & $module";
394 } elsif(/^(\d+|@)\s+forward(?:\s+(?:-noimport|-norelay|-i386|-ret64))?\s+(\S+)\s+(\S+)\.(\S+)$/) {
397 my $external_name = $2;
398 my $forward_module = lc($3);
399 my $forward_name = $4;
401 if ($external_name ne "@") {
402 $$module_external_calling_convention{$module}{$external_name} = "forward";
404 $$module_external_calling_convention{$module}{"\@$ordinal"} = "forward";
406 $$function_forward{$module}{$external_name} = [$forward_module, $forward_name];
407 } elsif(/^(\d+|@)\s+extern\s+(\S+)\s+(\S+)$/) {
410 my $external_name = $2;
411 my $internal_name = $3;
413 if ($external_name ne "@") {
414 $$module_external_calling_convention{$module}{$external_name} = "extern";
416 $$module_external_calling_convention{$module}{"\@$ordinal"} = "extern";
418 } elsif(/^(\d+|@)\s+(equate|variable)/) {
421 my $next_line = <IN>;
422 if(!defined($next_line) || $next_line =~ /^\s*\d|@/) {
423 die "$file: $.: syntax error: '$_'\n";
430 if(defined($ordinal)) {
431 if($ordinal ne "@" && $ordinals{$ordinal}) {
432 $output->write("$file: ordinal redefined: $_\n");
434 $ordinals{$ordinal}++;
439 $$modules{$module}++;
441 $$module_files{$module} = $file;
446 my $name = \${$self->{NAME}};
451 sub is_allowed_kind {
453 my $allowed_kind = \%{$self->{ALLOWED_KIND}};
457 return $$allowed_kind{$kind};
466 my $allowed_kind = \%{$self->{ALLOWED_KIND}};
470 $$allowed_kind{$kind}++;
473 sub is_limited_type {
475 my $allowed_modules_limited = \%{$self->{ALLOWED_MODULES_LIMITED}};
479 return $$allowed_modules_limited{$type};
482 sub is_allowed_type_in_module {
484 my $allowed_modules = \%{$self->{ALLOWED_MODULES}};
485 my $allowed_modules_limited = \%{$self->{ALLOWED_MODULES_LIMITED}};
488 my @modules = split(/ \& /, shift);
490 if(!$$allowed_modules_limited{$type}) { return 1; }
492 foreach my $module (@modules) {
493 if($$allowed_modules{$type}{$module}) { return 1; }
499 sub allow_type_in_module {
501 my $allowed_modules = \%{$self->{ALLOWED_MODULES}};
504 my @modules = split(/ \& /, shift);
506 foreach my $module (@modules) {
507 $$allowed_modules{$type}{$module}++;
511 sub type_used_in_module {
513 my $used_modules = \%{$self->{USED_MODULES}};
516 my @modules = split(/ \& /, shift);
518 foreach my $module (@modules) {
519 $$used_modules{$type}{$module} = 1;
527 my $used_modules = \%{$self->{USED_MODULES}};
528 my $allowed_modules = \%{$self->{ALLOWED_MODULES}};
531 foreach my $type (sort(keys(%$allowed_modules))) {
532 foreach my $module (sort(keys(%{$$allowed_modules{$type}}))) {
533 if(!$$used_modules{$type}{$module}) {
534 $$not_used{$module}{$type} = 1;
541 sub types_unlimited_used_in_modules {
544 my $used_modules = \%{$self->{USED_MODULES}};
545 my $allowed_modules = \%{$self->{ALLOWED_MODULES}};
546 my $allowed_modules_unlimited = \%{$self->{ALLOWED_MODULES_UNLIMITED}};
549 foreach my $type (sort(keys(%$allowed_modules_unlimited))) {
552 foreach my $module (sort(keys(%{$$used_modules{$type}}))) {
554 push @modules, $module;
557 foreach my $module (@modules) {
558 $$used_types{$type}{$module} = 1;
565 sub translate_argument {
567 my $translate_argument = \%{$self->{TRANSLATE_ARGUMENT}};
571 return $$translate_argument{$type};
574 sub declare_argument {
576 my $translate_argument = \%{$self->{TRANSLATE_ARGUMENT}};
581 $$translate_argument{$type} = $kind;
584 sub all_declared_types {
586 my $translate_argument = \%{$self->{TRANSLATE_ARGUMENT}};
588 return sort(keys(%$translate_argument));
591 sub is_allowed_type_format {
593 my $type_format = \%{$self->{TYPE_FORMAT}};
601 if(defined($module) && defined($type)) {
603 foreach (split(/ & /, $module)) {
604 if(defined($formats)) {
609 if(defined($$type_format{$_}{$type})) {
610 $formats .= $$type_format{$_}{$type};
615 if(defined($formats)) {
617 foreach (split(/\|/, $formats)) {
629 my $modules = \%{$self->{MODULES}};
631 return sort(keys(%$modules));
636 my $modules = \%{$self->{MODULES}};
640 return $$modules{$name};
648 my $module_files = \%{$self->{MODULE_FILES}};
650 return $$module_files{$module};
653 sub all_internal_functions {
655 my $function_internal_calling_convention = \%{$self->{FUNCTION_INTERNAL_CALLING_CONVENTION}};
657 return sort(keys(%$function_internal_calling_convention));
660 sub all_internal_functions_in_module {
662 my $function_internal_calling_convention = \%{$self->{FUNCTION_INTERNAL_CALLING_CONVENTION}};
663 my $function_internal_module = \%{$self->{FUNCTION_INTERNAL_MODULE}};
668 foreach my $name (keys(%$function_internal_calling_convention)) {
669 if($$function_internal_module{$name} eq $module) {
677 sub all_external_functions {
679 my $function_external_name = \%{$self->{FUNCTION_EXTERNAL_NAME}};
681 return sort(keys(%$function_external_name));
684 sub all_external_functions_in_module {
686 my $function_external_name = \%{$self->{FUNCTION_EXTERNAL_NAME}};
687 my $function_external_module = \%{$self->{FUNCTION_EXTERNAL_MODULE}};
692 foreach my $name (keys(%$function_external_name)) {
693 if($$function_external_module{$name} eq $module) {
701 sub all_functions_in_module {
703 my $module_external_calling_convention = \%{$self->{MODULE_EXTERNAL_CALLING_CONVENTION}};
707 return sort(keys(%{$$module_external_calling_convention{$module}}));
710 sub all_broken_forwards {
712 my $function_forward = \%{$self->{FUNCTION_FORWARD}};
714 my @broken_forwards = ();
715 foreach my $module (sort(keys(%$function_forward))) {
716 foreach my $external_name (sort(keys(%{$$function_forward{$module}}))) {
717 (my $forward_module, my $forward_external_name) = @{$$function_forward{$module}{$external_name}};
719 my $forward_external_calling_convention =
720 $self->function_external_calling_convention_in_module($forward_module, $forward_external_name);
722 if(!defined($forward_external_calling_convention)) {
723 push @broken_forwards, [$module, $external_name, $forward_module, $forward_external_name];
727 return @broken_forwards;
731 sub function_internal_ordinal {
733 my $function_internal_ordinal = \%{$self->{FUNCTION_INTERNAL_ORDINAL}};
737 return $$function_internal_ordinal{$name};
740 sub function_external_ordinal {
742 my $function_external_ordinal = \%{$self->{FUNCTION_EXTERNAL_ORDINAL}};
746 return $$function_external_ordinal{$name};
749 sub function_internal_calling_convention {
751 my $function_internal_calling_convention = \%{$self->{FUNCTION_INTERNAL_CALLING_CONVENTION}};
755 return $$function_internal_calling_convention{$name};
758 sub function_external_calling_convention {
760 my $function_external_calling_convention = \%{$self->{FUNCTION_EXTERNAL_CALLING_CONVENTION}};
764 return $$function_external_calling_convention{$name};
767 sub function_external_calling_convention_in_module {
769 my $module_external_calling_convention = \%{$self->{MODULE_EXTERNAL_CALLING_CONVENTION}};
774 return $$module_external_calling_convention{$module}{$name};
777 sub function_internal_name {
779 my $function_internal_name = \%{$self->{FUNCTION_INTERNAL_NAME}};
783 return $$function_internal_name{$name};
786 sub function_external_name {
788 my $function_external_name = \%{$self->{FUNCTION_EXTERNAL_NAME}};
792 return $$function_external_name{$name};
795 sub function_forward_final_destination {
798 my $function_forward = \%{$self->{FUNCTION_FORWARD}};
803 my $forward_module = $module;
804 my $forward_name = $name;
805 while(defined(my $forward = $$function_forward{$forward_module}{$forward_name})) {
806 ($forward_module, $forward_name) = @$forward;
809 return ($forward_module, $forward_name);
814 my $function_internal_calling_convention = \%{$self->{FUNCTION_INTERNAL_CALLING_CONVENTION}};
818 return $$function_internal_calling_convention{$name};
821 sub all_shared_internal_functions {
823 my $function_shared = \%{$self->{FUNCTION_SHARED}};
825 return sort(keys(%$function_shared));
828 sub is_shared_internal_function {
830 my $function_shared = \%{$self->{FUNCTION_SHARED}};
834 return $$function_shared{$name};
837 sub found_shared_internal_function {
839 my $function_shared = \%{$self->{FUNCTION_SHARED}};
843 $$function_shared{$name} = 1;
846 sub function_internal_arguments {
848 my $function_internal_arguments = \%{$self->{FUNCTION_INTERNAL_ARGUMENTS}};
852 return $$function_internal_arguments{$name};
855 sub function_external_arguments {
857 my $function_external_arguments = \%{$self->{FUNCTION_EXTERNAL_ARGUMENTS}};
861 return $$function_external_arguments{$name};
864 sub function_internal_module {
866 my $function_internal_module = \%{$self->{FUNCTION_INTERNAL_MODULE}};
870 return $$function_internal_module{$name};
873 sub function_external_module {
875 my $function_external_module = \%{$self->{FUNCTION_EXTERNAL_MODULE}};
879 return $$function_external_module{$name};
882 sub is_function_stub {
884 my $module_external_calling_convention = \%{$self->{MODULE_EXTERNAL_CALLING_CONVENTION}};
885 my $modules = \%{$self->{MODULES}};
890 foreach my $module (keys(%$modules)) {
891 if($$module_external_calling_convention{$module}{$name} eq "stub") {
899 sub is_function_stub_in_module {
901 my $module_external_calling_convention = \%{$self->{MODULE_EXTERNAL_CALLING_CONVENTION}};
906 if(!defined($$module_external_calling_convention{$module}{$name})) {
909 return $$module_external_calling_convention{$module}{$name} eq "stub";
912 ########################################################################
916 sub _get_all_module_internal_ordinal {
918 my $internal_name = shift;
923 my $name = $winapi->function_external_name($internal_name);
925 @name = split(/ & /, $name);
930 my $module = $winapi->function_internal_module($internal_name);
931 if(defined($module)) {
932 @module = split(/ & /, $module);
937 my $ordinal = $winapi->function_internal_ordinal($internal_name);
938 if(defined($ordinal)) {
939 @ordinal = split(/ & /, $ordinal);
946 while(defined($name = shift @name) &&
947 defined($module = shift @module) &&
948 defined($ordinal = shift @ordinal))
950 push @entries, [$name, $module, $ordinal];
956 sub get_all_module_internal_ordinal16 {
957 return _get_all_module_internal_ordinal($win16api, @_);
960 sub get_all_module_internal_ordinal32 {
961 return _get_all_module_internal_ordinal($win32api, @_);
964 sub get_all_module_internal_ordinal {
966 foreach my $winapi (@winapis) {
967 push @entries, _get_all_module_internal_ordinal($winapi, @_);
973 sub _get_all_module_external_ordinal {
975 my $external_name = shift;
980 my $name = $winapi->function_internal_name($external_name);
982 @name = split(/ & /, $name);
987 my $module = $winapi->function_external_module($external_name);
988 if(defined($module)) {
989 @module = split(/ & /, $module);
994 my $ordinal = $winapi->function_external_ordinal($external_name);
995 if(defined($ordinal)) {
996 @ordinal = split(/ & /, $ordinal);
1003 while(defined($name = shift @name) &&
1004 defined($module = shift @module) &&
1005 defined($ordinal = shift @ordinal))
1007 push @entries, [$name, $module, $ordinal];
1013 sub get_all_module_external_ordinal16 {
1014 return _get_all_module_external_ordinal($win16api, @_);
1017 sub get_all_module_external_ordinal32 {
1018 return _get_all_module_external_ordinal($win32api, @_);
1021 sub get_all_module_external_ordinal {
1023 foreach my $winapi (@winapis) {
1024 push @entries, _get_all_module_external_ordinal($winapi, @_);