4 * Copyright 1993 Robert J. Amstadt
5 * Copyright 1995 Martin von Loewis
6 * Copyright 1995, 1996, 1997 Alexandre Julliard
7 * Copyright 1997 Eric Youngdale
8 * Copyright 1999 Ulrich Weigand
10 * This library is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU Lesser General Public
12 * License as published by the Free Software Foundation; either
13 * version 2.1 of the License, or (at your option) any later version.
15 * This library is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * Lesser General Public License for more details.
20 * You should have received a copy of the GNU Lesser General Public
21 * License along with this library; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
26 #include "wine/port.h"
34 //#include "wine/exception.h"
38 /* check if entry point needs a relay thunk */
39 static inline int needs_relay( const ORDDEF
*odp
)
41 /* skip nonexistent entry points */
43 /* skip non-functions */
44 if ((odp
->type
!= TYPE_STDCALL
) && (odp
->type
!= TYPE_CDECL
)) return 0;
45 /* skip norelay and forward entry points */
46 if (odp
->flags
& (FLAG_NORELAY
|FLAG_FORWARD
)) return 0;
50 /* check if dll will output relay thunks */
51 int has_relays( DLLSPEC
*spec
)
55 if (target_cpu
!= CPU_x86
) return 0;
57 for (i
= spec
->base
; i
<= spec
->limit
; i
++)
59 ORDDEF
*odp
= spec
->ordinals
[i
];
60 if (needs_relay( odp
)) return 1;
65 /*******************************************************************
68 * Generate an internal name for an entry point. Used for stubs etc.
70 static const char *make_internal_name( const ORDDEF
*odp
, DLLSPEC
*spec
, const char *prefix
)
72 static char buffer
[256];
73 if (odp
->name
|| odp
->export_name
)
76 sprintf( buffer
, "__wine_%s_%s_%s", prefix
, spec
->file_name
,
77 odp
->name
? odp
->name
: odp
->export_name
);
78 /* make sure name is a legal C identifier */
79 for (p
= buffer
; *p
; p
++) if (!isalnum(*p
) && *p
!= '_') break;
80 if (!*p
) return buffer
;
82 sprintf( buffer
, "__wine_%s_%s_%d", prefix
, make_c_identifier(spec
->file_name
), odp
->ordinal
);
87 /*******************************************************************
90 * Output entry points for relay debugging
92 static void output_relay_debug( DLLSPEC
*spec
)
95 unsigned int j
, args
, flags
;
97 /* first the table of entry point offsets */
99 output( "\t%s\n", get_asm_rodata_section() );
100 output( "\t.align %d\n", get_alignment(4) );
101 output( ".L__wine_spec_relay_entry_point_offsets:\n" );
103 for (i
= spec
->base
; i
<= spec
->limit
; i
++)
105 ORDDEF
*odp
= spec
->ordinals
[i
];
107 if (needs_relay( odp
))
108 output( "\t.long .L__wine_spec_relay_entry_point_%d-__wine_spec_relay_entry_points\n", i
);
110 output( "\t.long 0\n" );
113 /* then the table of argument types */
115 output( "\t.align %d\n", get_alignment(4) );
116 output( ".L__wine_spec_relay_arg_types:\n" );
118 for (i
= spec
->base
; i
<= spec
->limit
; i
++)
120 ORDDEF
*odp
= spec
->ordinals
[i
];
121 unsigned int mask
= 0;
123 if (needs_relay( odp
))
125 for (j
= 0; j
< 16 && odp
->u
.func
.arg_types
[j
]; j
++)
127 if (odp
->u
.func
.arg_types
[j
] == 't') mask
|= 1<< (j
*2);
128 if (odp
->u
.func
.arg_types
[j
] == 'W') mask
|= 2<< (j
*2);
131 output( "\t.long 0x%08x\n", mask
);
134 /* then the relay thunks */
136 output( "\t.text\n" );
137 output( "__wine_spec_relay_entry_points:\n" );
138 output( "\tnop\n" ); /* to avoid 0 offset */
140 for (i
= spec
->base
; i
<= spec
->limit
; i
++)
142 ORDDEF
*odp
= spec
->ordinals
[i
];
144 if (!needs_relay( odp
)) continue;
146 output( "\t.align %d\n", get_alignment(4) );
147 output( ".L__wine_spec_relay_entry_point_%d:\n", i
);
149 if (odp
->flags
& FLAG_REGISTER
)
150 output( "\tpushl %%eax\n" );
152 output( "\tpushl %%esp\n" );
154 args
= strlen(odp
->u
.func
.arg_types
);
156 if (odp
->flags
& FLAG_RET64
) flags
|= 1;
157 if (odp
->type
== TYPE_STDCALL
) flags
|= 2;
158 output( "\tpushl $%u\n", (flags
<< 24) | (args
<< 16) | (i
- spec
->base
) );
162 output( "\tcall %s\n", asm_name("__wine_spec_get_pc_thunk_eax") );
163 output( "1:\tleal .L__wine_spec_relay_descr-1b(%%eax),%%eax\n" );
165 else output( "\tmovl $.L__wine_spec_relay_descr,%%eax\n" );
166 output( "\tpushl %%eax\n" );
168 if (odp
->flags
& FLAG_REGISTER
)
170 output( "\tcall *8(%%eax)\n" );
174 output( "\tcall *4(%%eax)\n" );
175 if (odp
->type
== TYPE_STDCALL
)
176 output( "\tret $%u\n", args
* get_ptr_size() );
183 /*******************************************************************
186 * Output the export table for a Win32 module.
188 static void output_exports( DLLSPEC
*spec
)
191 int nr_exports
= spec
->base
<= spec
->limit
? spec
->limit
- spec
->base
+ 1 : 0;
193 if (!nr_exports
) return;
195 output( "\n/* export table */\n\n" );
196 output( "\t.data\n" );
197 output( "\t.align %d\n", get_alignment(4) );
198 output( ".L__wine_spec_exports:\n" );
200 /* export directory header */
202 output( "\t.long 0\n" ); /* Characteristics */
203 output( "\t.long 0\n" ); /* TimeDateStamp */
204 output( "\t.long 0\n" ); /* MajorVersion/MinorVersion */
205 output( "\t.long .L__wine_spec_exp_names-.L__wine_spec_rva_base\n" ); /* Name */
206 output( "\t.long %u\n", spec
->base
); /* Base */
207 output( "\t.long %u\n", nr_exports
); /* NumberOfFunctions */
208 output( "\t.long %u\n", spec
->nb_names
); /* NumberOfNames */
209 output( "\t.long .L__wine_spec_exports_funcs-.L__wine_spec_rva_base\n" ); /* AddressOfFunctions */
212 output( "\t.long .L__wine_spec_exp_name_ptrs-.L__wine_spec_rva_base\n" ); /* AddressOfNames */
213 output( "\t.long .L__wine_spec_exp_ordinals-.L__wine_spec_rva_base\n" ); /* AddressOfNameOrdinals */
217 output( "\t.long 0\n" ); /* AddressOfNames */
218 output( "\t.long 0\n" ); /* AddressOfNameOrdinals */
221 /* output the function pointers */
223 output( "\n.L__wine_spec_exports_funcs:\n" );
224 for (i
= spec
->base
; i
<= spec
->limit
; i
++)
226 ORDDEF
*odp
= spec
->ordinals
[i
];
227 if (!odp
) output( "\t%s 0\n", get_asm_ptr_keyword() );
228 else switch(odp
->type
)
234 if (odp
->flags
& FLAG_FORWARD
)
236 output( "\t%s .L__wine_spec_forwards+%u\n", get_asm_ptr_keyword(), fwd_size
);
237 fwd_size
+= strlen(odp
->link_name
) + 1;
239 else if (odp
->flags
& FLAG_EXT_LINK
)
241 output( "\t%s %s_%s\n",
242 get_asm_ptr_keyword(), asm_name("__wine_spec_ext_link"), odp
->link_name
);
246 output( "\t%s %s\n", get_asm_ptr_keyword(), asm_name(odp
->link_name
) );
250 output( "\t%s %s\n", get_asm_ptr_keyword(),
251 asm_name( get_stub_name( odp
, spec
)) );
260 /* output the function name pointers */
262 int namepos
= strlen(spec
->file_name
) + 1;
264 output( "\n.L__wine_spec_exp_name_ptrs:\n" );
265 for (i
= 0; i
< spec
->nb_names
; i
++)
267 output( "\t.long .L__wine_spec_exp_names+%u-.L__wine_spec_rva_base\n", namepos
);
268 namepos
+= strlen(spec
->names
[i
]->name
) + 1;
271 /* output the function ordinals */
273 output( "\n.L__wine_spec_exp_ordinals:\n" );
274 for (i
= 0; i
< spec
->nb_names
; i
++)
277 get_asm_short_keyword(), spec
->names
[i
]->ordinal
- spec
->base
);
279 if (spec
->nb_names
% 2)
281 output( "\t%s 0\n", get_asm_short_keyword() );
285 /* output the export name strings */
287 output( "\n.L__wine_spec_exp_names:\n" );
288 output( "\t%s \"%s\"\n", get_asm_string_keyword(), spec
->file_name
);
289 for (i
= 0; i
< spec
->nb_names
; i
++)
290 output( "\t%s \"%s\"\n",
291 get_asm_string_keyword(), spec
->names
[i
]->name
);
293 /* output forward strings */
297 output( "\n.L__wine_spec_forwards:\n" );
298 for (i
= spec
->base
; i
<= spec
->limit
; i
++)
300 ORDDEF
*odp
= spec
->ordinals
[i
];
301 if (odp
&& (odp
->flags
& FLAG_FORWARD
))
302 output( "\t%s \"%s\"\n", get_asm_string_keyword(), odp
->link_name
);
305 output( "\t.align %d\n", get_alignment(get_ptr_size()) );
306 output( ".L__wine_spec_exports_end:\n" );
310 /* we only support relay debugging on i386 */
311 if (target_cpu
!= CPU_x86
)
313 output( "\t%s 0\n", get_asm_ptr_keyword() );
317 output( ".L__wine_spec_relay_descr:\n" );
318 output( "\t%s 0xdeb90001\n", get_asm_ptr_keyword() ); /* magic */
319 output( "\t%s 0,0\n", get_asm_ptr_keyword() ); /* relay funcs */
320 output( "\t%s 0\n", get_asm_ptr_keyword() ); /* private data */
321 output( "\t%s __wine_spec_relay_entry_points\n", get_asm_ptr_keyword() );
322 output( "\t%s .L__wine_spec_relay_entry_point_offsets\n", get_asm_ptr_keyword() );
323 output( "\t%s .L__wine_spec_relay_arg_types\n", get_asm_ptr_keyword() );
325 output_relay_debug( spec
);
329 /*******************************************************************
332 * Output the functions for stub entry points
334 static void output_stub_funcs( DLLSPEC
*spec
)
339 for (i
= 0; i
< spec
->nb_entry_points
; i
++)
341 ORDDEF
*odp
= &spec
->entry_points
[i
];
342 if (odp
->type
!= TYPE_STUB
) continue;
343 fprintf( outfile
, "#ifdef __GNUC__\n" );
344 fprintf( outfile
, "extern void __wine_spec_unimplemented_stub( const char *module, const char *func ) __attribute__((noreturn));\n" );
345 fprintf( outfile
, "#else\n" );
346 fprintf( outfile
, "extern void __wine_spec_unimplemented_stub( const char *module, const char *func );\n" );
347 fprintf( outfile
, "#endif\n\n" );
352 for (i
= 0; i
< spec
->nb_entry_points
; i
++)
354 const ORDDEF
*odp
= &spec
->entry_points
[i
];
355 if (odp
->type
!= TYPE_STUB
) continue;
356 output( "void %s(void) ", make_internal_name( odp
, spec
, "stub" ) );
358 output( "{ __wine_spec_unimplemented_stub(__wine_spec_file_name, \"%s\"); }\n", odp
->name
);
359 else if (odp
->export_name
)
360 output( "{ __wine_spec_unimplemented_stub(__wine_spec_file_name, \"%s\"); }\n", odp
->export_name
);
362 output( "{ __wine_spec_unimplemented_stub(__wine_spec_file_name, \"%d\"); }\n", odp
->ordinal
);
367 /*******************************************************************
368 * output_asm_constructor
370 * Output code for calling a dll constructor.
372 static void output_asm_constructor( const char *constructor
)
374 if (target_platform
== PLATFORM_APPLE
)
376 /* Mach-O doesn't have an init section */
377 output( "\n\t.mod_init_func\n" );
378 output( "\t.align %d\n", get_alignment(4) );
379 output( "\t.long %s\n", asm_name(constructor
) );
383 output( "\n\t.section \".init\",\"ax\"\n" );
388 output( "\tcall %s\n", asm_name(constructor
) );
391 output( "\tcall %s\n", asm_name(constructor
) );
395 output( "\tjsr $26,%s\n", asm_name(constructor
) );
398 output( "\tbl %s\n", asm_name(constructor
) );
405 /*******************************************************************
408 * Build a Win32 C file from a spec file.
410 void BuildSpec32File( DLLSPEC
*spec
)
413 unsigned int page_size
= get_page_size();
415 resolve_imports( spec
);
416 output_standard_file_header();
418 /* Reserve some space for the PE header */
420 output( "\t.text\n" );
421 output( "\t.align %d\n", get_alignment(page_size
) );
422 output( "__wine_spec_pe_header:\n" );
423 if (target_platform
== PLATFORM_APPLE
)
424 output( "\t.space 65536\n" );
426 output( "\t.skip 65536\n" );
428 /* Output the NT header */
430 output( "\n\t.data\n" );
431 output( "\t.align %d\n", get_alignment(get_ptr_size()) );
432 output( "%s\n", asm_globl("__wine_spec_nt_header") );
433 output( ".L__wine_spec_rva_base:\n" );
435 output( "\t.long 0x%04x\n", IMAGE_NT_SIGNATURE
); /* Signature */
438 case CPU_x86
: machine
= IMAGE_FILE_MACHINE_I386
; break;
439 case CPU_x86_64
: machine
= IMAGE_FILE_MACHINE_AMD64
; break;
440 case CPU_POWERPC
: machine
= IMAGE_FILE_MACHINE_POWERPC
; break;
441 case CPU_ALPHA
: machine
= IMAGE_FILE_MACHINE_ALPHA
; break;
442 case CPU_SPARC
: machine
= IMAGE_FILE_MACHINE_UNKNOWN
; break;
444 output( "\t%s 0x%04x\n", /* Machine */
445 get_asm_short_keyword(), machine
);
446 output( "\t%s 0\n", /* NumberOfSections */
447 get_asm_short_keyword() );
448 output( "\t.long 0\n" ); /* TimeDateStamp */
449 output( "\t.long 0\n" ); /* PointerToSymbolTable */
450 output( "\t.long 0\n" ); /* NumberOfSymbols */
451 output( "\t%s %d\n", /* SizeOfOptionalHeader */
452 get_asm_short_keyword(),
453 get_ptr_size() == 8 ? IMAGE_SIZEOF_NT_OPTIONAL64_HEADER
: IMAGE_SIZEOF_NT_OPTIONAL32_HEADER
);
454 output( "\t%s 0x%04x\n", /* Characteristics */
455 get_asm_short_keyword(), spec
->characteristics
);
456 output( "\t%s 0x%04x\n", /* Magic */
457 get_asm_short_keyword(),
458 get_ptr_size() == 8 ? IMAGE_NT_OPTIONAL_HDR64_MAGIC
: IMAGE_NT_OPTIONAL_HDR32_MAGIC
);
459 output( "\t.byte 0\n" ); /* MajorLinkerVersion */
460 output( "\t.byte 0\n" ); /* MinorLinkerVersion */
461 output( "\t.long 0\n" ); /* SizeOfCode */
462 output( "\t.long 0\n" ); /* SizeOfInitializedData */
463 output( "\t.long 0\n" ); /* SizeOfUninitializedData */
464 /* note: we expand the AddressOfEntryPoint field on 64-bit by overwriting the BaseOfCode field */
465 output( "\t%s %s\n", /* AddressOfEntryPoint */
466 get_asm_ptr_keyword(), asm_name(spec
->init_func
) );
467 if (get_ptr_size() == 4)
469 output( "\t.long 0\n" ); /* BaseOfCode */
470 output( "\t.long 0\n" ); /* BaseOfData */
472 output( "\t%s __wine_spec_pe_header\n", /* ImageBase */
473 get_asm_ptr_keyword() );
474 output( "\t.long %u\n", page_size
); /* SectionAlignment */
475 output( "\t.long %u\n", page_size
); /* FileAlignment */
476 output( "\t%s 1,0\n", /* Major/MinorOperatingSystemVersion */
477 get_asm_short_keyword() );
478 output( "\t%s 0,0\n", /* Major/MinorImageVersion */
479 get_asm_short_keyword() );
480 output( "\t%s %u,%u\n", /* Major/MinorSubsystemVersion */
481 get_asm_short_keyword(), spec
->subsystem_major
, spec
->subsystem_minor
);
482 output( "\t.long 0\n" ); /* Win32VersionValue */
483 output( "\t.long %s-.L__wine_spec_rva_base\n", /* SizeOfImage */
485 output( "\t.long %u\n", page_size
); /* SizeOfHeaders */
486 output( "\t.long 0\n" ); /* CheckSum */
487 output( "\t%s 0x%04x\n", /* Subsystem */
488 get_asm_short_keyword(), spec
->subsystem
);
489 output( "\t%s 0x%04x\n", /* DllCharacteristics */
490 get_asm_short_keyword(), spec
->dll_characteristics
);
491 output( "\t%s %u,%u\n", /* SizeOfStackReserve/Commit */
492 get_asm_ptr_keyword(), (spec
->stack_size
? spec
->stack_size
: 1024) * 1024, page_size
);
493 output( "\t%s %u,%u\n", /* SizeOfHeapReserve/Commit */
494 get_asm_ptr_keyword(), (spec
->heap_size
? spec
->heap_size
: 1024) * 1024, page_size
);
495 output( "\t.long 0\n" ); /* LoaderFlags */
496 output( "\t.long 16\n" ); /* NumberOfRvaAndSizes */
498 if (spec
->base
<= spec
->limit
) /* DataDirectory[IMAGE_DIRECTORY_ENTRY_EXPORT] */
499 output( "\t.long .L__wine_spec_exports-.L__wine_spec_rva_base,"
500 ".L__wine_spec_exports_end-.L__wine_spec_exports\n" );
502 output( "\t.long 0,0\n" );
504 if (has_imports()) /* DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT] */
505 output( "\t.long .L__wine_spec_imports-.L__wine_spec_rva_base,"
506 ".L__wine_spec_imports_end-.L__wine_spec_imports\n" );
508 output( "\t.long 0,0\n" );
510 if (spec
->nb_resources
) /* DataDirectory[IMAGE_DIRECTORY_ENTRY_RESOURCE] */
511 output( "\t.long .L__wine_spec_resources-.L__wine_spec_rva_base,"
512 ".L__wine_spec_resources_end-.L__wine_spec_resources\n" );
514 output( "\t.long 0,0\n" );
516 output( "\t.long 0,0\n" ); /* DataDirectory[3] */
517 output( "\t.long 0,0\n" ); /* DataDirectory[4] */
518 output( "\t.long 0,0\n" ); /* DataDirectory[5] */
519 output( "\t.long 0,0\n" ); /* DataDirectory[6] */
520 output( "\t.long 0,0\n" ); /* DataDirectory[7] */
521 output( "\t.long 0,0\n" ); /* DataDirectory[8] */
522 output( "\t.long 0,0\n" ); /* DataDirectory[9] */
523 output( "\t.long 0,0\n" ); /* DataDirectory[10] */
524 output( "\t.long 0,0\n" ); /* DataDirectory[11] */
525 output( "\t.long 0,0\n" ); /* DataDirectory[12] */
526 output( "\t.long 0,0\n" ); /* DataDirectory[13] */
527 output( "\t.long 0,0\n" ); /* DataDirectory[14] */
528 output( "\t.long 0,0\n" ); /* DataDirectory[15] */
530 output( "\n\t%s\n", get_asm_string_section() );
531 output( "%s\n", asm_globl("__wine_spec_file_name") );
532 output( ".L__wine_spec_file_name:\n" );
533 output( "\t%s \"%s\"\n", get_asm_string_keyword(), spec
->file_name
);
534 if (target_platform
== PLATFORM_APPLE
)
535 output( "\t.lcomm %s,4\n", asm_name("_end") );
537 output_stubs( spec
);
538 output_exports( spec
);
539 output_imports( spec
);
540 output_resources( spec
);
541 output_asm_constructor( "__wine_spec_init_ctor" );
542 output_gnu_stack_note();
546 /*******************************************************************
549 * Build a Win32 def file from a spec file.
551 void BuildDef32File( DLLSPEC
*spec
)
557 output( "; File generated automatically from %s; do not edit!\n\n",
560 output( "; File generated automatically; do not edit!\n\n" );
562 output( "LIBRARY %s\n\n", spec
->file_name
);
563 output( "EXPORTS\n");
565 /* Output the exports and relay entry points */
567 for (i
= total
= 0; i
< spec
->nb_entry_points
; i
++)
569 const ORDDEF
*odp
= &spec
->entry_points
[i
];
574 if (odp
->name
) name
= odp
->name
;
575 else if (odp
->export_name
) name
= odp
->export_name
;
578 if (!(odp
->flags
& FLAG_PRIVATE
)) total
++;
583 output( " %s", name
);
585 if(strcmp(name
, odp
->link_name
) || (odp
->flags
& FLAG_FORWARD
))
586 output( "=%s", odp
->link_name
);
590 /* try to reduce output */
591 output( " %s", name
);
592 if(strcmp(name
, odp
->link_name
) || (odp
->flags
& FLAG_FORWARD
))
593 output( "=%s", odp
->link_name
);
597 int at_param
= strlen(odp
->u
.func
.arg_types
) * get_ptr_size();
598 output( " %s", name
);
599 if (!kill_at
) output( "@%d", at_param
);
600 if (odp
->flags
& FLAG_FORWARD
)
602 output( "=%s", odp
->link_name
);
604 else if (strcmp(name
, odp
->link_name
)) /* try to reduce output */
606 output( "=%s", odp
->link_name
);
607 if (!kill_at
) output( "@%d", at_param
);
613 int at_param
= strlen(odp
->u
.func
.arg_types
) * get_ptr_size();
615 if (!kill_at
) output( "@" );
616 output( "%s", name
);
617 if (!kill_at
) output( "@%d", at_param
);
618 if (odp
->flags
& FLAG_FORWARD
)
621 if (!kill_at
) output( "@" );
622 output( "%s", odp
->link_name
);
624 else if (strcmp(name
, odp
->link_name
)) /* try to reduce output */
627 if (!kill_at
) output( "@" );
628 output( "%s", odp
->link_name
);
629 if (!kill_at
) output( "@%d", at_param
);
635 output( " %s", name
);
638 const char *check
= name
+ strlen(name
);
639 while (name
!= check
&&
640 '0' <= check
[-1] && check
[-1] <= '9')
644 if (name
!= check
&& check
!= name
+ strlen(name
) &&
647 output("%s", check
- 1);
650 if (odp
->name
|| odp
->export_name
)
652 output("=%s", make_internal_name( odp
, spec
, "stub" ));
659 output( " @%d", odp
->ordinal
);
660 if (!odp
->name
|| (odp
->flags
& FLAG_ORDINAL
)) output( " NONAME" );
661 if (is_data
) output( " DATA" );
662 if (odp
->flags
& FLAG_PRIVATE
) output( " PRIVATE" );
665 if (!total
) warning( "%s: Import library doesn't export anything\n", spec
->file_name
);
669 /*******************************************************************
672 * Build a PE DLL C file from a spec file.
674 void BuildPedllFile( DLLSPEC
*spec
)
676 int i
, has_stubs
= 0;
678 output_standard_file_header();
680 for (i
= 0; i
< spec
->nb_entry_points
; i
++)
682 const ORDDEF
*odp
= &spec
->entry_points
[i
];
683 if (odp
->type
== TYPE_STUB
)
692 output( "/* This file is intentionally left blank */\n");
696 output( "#include <stdarg.h>\n");
697 output( "#include \"windef.h\"\n");
698 output( "#include \"winbase.h\"\n");
699 output( "#include \"wine/config.h\"\n");
700 output( "#include \"wine/exception.h\"\n\n");
702 output( "void __wine_spec_unimplemented_stub( const char *module, const char *function )\n");
704 output( " ULONG_PTR args[2];\n");
706 output( " args[0] = (ULONG_PTR)module;\n");
707 output( " args[1] = (ULONG_PTR)function;\n");
708 output( " RaiseException( EXCEPTION_WINE_STUB, EH_NONCONTINUABLE, 2, args );\n");
711 output( "static const char __wine_spec_file_name[] = \"%s\";\n\n", spec
->file_name
);
713 /* Output the stub functions */
714 output_stub_funcs( spec
);