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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 #include "wine/port.h"
31 #include "wine/exception.h"
32 #include "wine/winbase16.h"
38 /*******************************************************************
42 static inline unsigned short get_cs(void)
46 __asm__("movw %%cs,%w0" : "=r"(res));
47 #elif defined(_MSC_VER)
57 /*******************************************************************
60 * Output a file header with the common declarations we need.
62 static void output_file_header( FILE *outfile )
64 output_standard_file_header( outfile );
65 fprintf( outfile, "extern struct\n{\n" );
66 fprintf( outfile, " void *base[8192];\n" );
67 fprintf( outfile, " unsigned long limit[8192];\n" );
68 fprintf( outfile, " unsigned char flags[8192];\n" );
69 fprintf( outfile, "} wine_ldt_copy;\n\n" );
71 fprintf( outfile, "#define __stdcall __attribute__((__stdcall__))\n\n" );
73 fprintf( outfile, "#define __stdcall\n\n" );
78 /*******************************************************************
81 * Store a list of ints into a byte array.
83 static int StoreVariableCode( unsigned char *buffer, int size, ORDDEF *odp )
90 for (i = 0; i < odp->u.var.n_values; i++)
91 buffer[i] = odp->u.var.values[i];
94 for (i = 0; i < odp->u.var.n_values; i++)
95 ((unsigned short *)buffer)[i] = odp->u.var.values[i];
98 for (i = 0; i < odp->u.var.n_values; i++)
99 ((unsigned int *)buffer)[i] = odp->u.var.values[i];
102 return odp->u.var.n_values * size;
106 /*******************************************************************
109 * Build the in-memory representation of a 16-bit NE module, and dump it
110 * as a byte stream into the assembly code.
112 static int BuildModule16( FILE *outfile, int max_code_offset,
113 int max_data_offset, DLLSPEC *spec )
117 IMAGE_OS2_HEADER *pModule;
118 SEGTABLEENTRY *pSegment;
120 ET_BUNDLE *bundle = 0;
124 * IMAGE_OS2_HEADER Module
125 * OFSTRUCT File information
126 * SEGTABLEENTRY Segment 1 (code)
127 * SEGTABLEENTRY Segment 2 (data)
128 * WORD[2] Resource table (empty)
129 * BYTE[2] Imported names (empty)
130 * BYTE[n] Resident names table
131 * BYTE[n] Entry table
134 buffer = xmalloc( 0x10000 );
135 memset( buffer, 0, 0x10000 );
137 pModule = (IMAGE_OS2_HEADER *)buffer;
138 pModule->ne_magic = IMAGE_OS2_SIGNATURE;
139 pModule->ne_flags = NE_FFLAGS_SINGLEDATA | NE_FFLAGS_BUILTIN | NE_FFLAGS_LIBMODULE;
140 pModule->ne_autodata = 2;
141 pModule->ne_heap = spec->heap_size;
142 pModule->ne_cseg = 2;
143 pModule->ne_exetyp = NE_OSFLAGS_WINDOWS;
145 /* File information */
147 pFileInfo = (OFSTRUCT *)(pModule + 1);
148 pFileInfo->cBytes = sizeof(*pFileInfo) - sizeof(pFileInfo->szPathName)
149 + strlen(spec->file_name);
150 strcpy( pFileInfo->szPathName, spec->file_name );
151 /* note: we allocate the whole OFSTRUCT so that the loader has some extra space to play with */
155 pSegment = (SEGTABLEENTRY *)(pFileInfo + 1);
156 pModule->ne_segtab = (char *)pSegment - buffer;
157 pSegment->filepos = 0;
158 pSegment->size = max_code_offset;
160 pSegment->minsize = max_code_offset;
164 pSegment->filepos = 0;
165 pSegment->size = max_data_offset;
166 pSegment->flags = NE_SEGFLAGS_DATA;
167 pSegment->minsize = max_data_offset;
173 pstr = (char *)pSegment;
174 pstr = (char *)(((long)pstr + 3) & ~3);
175 pModule->ne_rsrctab = pstr - buffer;
176 pstr += output_res16_directory( pstr, spec );
178 /* Imported names table */
180 pstr = (char *)(((long)pstr + 3) & ~3);
181 pModule->ne_imptab = pstr - buffer;
185 /* Resident names table */
187 pstr = (char *)(((long)pstr + 3) & ~3);
188 pModule->ne_restab = pstr - buffer;
189 /* First entry is module name */
190 *pstr = strlen( spec->dll_name );
191 strcpy( pstr + 1, spec->dll_name );
192 strupper( pstr + 1 );
196 /* Store all ordinals */
197 for (i = 1; i <= spec->limit; i++)
199 ORDDEF *odp = spec->ordinals[i];
201 if (!odp || !odp->name[0]) continue;
202 *pstr = strlen( odp->name );
203 strcpy( pstr + 1, odp->name );
204 strupper( pstr + 1 );
206 memcpy( pstr, &ord, sizeof(WORD) );
207 pstr += sizeof(WORD);
213 pstr = (char *)(((long)pstr + 3) & ~3);
214 pModule->ne_enttab = pstr - buffer;
215 for (i = 1; i <= spec->limit; i++)
218 ORDDEF *odp = spec->ordinals[i];
227 selector = 1; /* Code selector */
231 selector = 2; /* Data selector */
235 selector = 0xfe; /* Constant selector */
239 selector = 0; /* Invalid selector */
246 if ( bundle && bundle->last+1 == i )
250 pstr = (char *)(((long)pstr + 1) & ~1);
252 bundle->next = pstr - buffer;
254 bundle = (ET_BUNDLE *)pstr;
258 pstr += sizeof(ET_BUNDLE);
261 /* FIXME: is this really correct ?? */
262 entry.type = 0xff; /* movable */
263 entry.flags = 3; /* exported & public data */
264 entry.segnum = selector;
265 entry.offs = odp->offset;
266 memcpy( pstr, &entry, sizeof(ET_ENTRY) );
267 pstr += sizeof(ET_ENTRY);
271 /* Dump the module content */
273 pstr = (char *)(((long)pstr + 3) & ~3);
274 dump_bytes( outfile, buffer, pstr - buffer, "Module", 0 );
276 return pstr - buffer;
281 /*******************************************************************
282 * BuildCallFrom16Func
284 * Build a 16-bit-to-Wine callback glue function.
286 * The generated routines are intended to be used as argument conversion
287 * routines to be called by the CallFrom16... core. Thus, the prototypes of
288 * the generated routines are (see also CallFrom16):
290 * extern WORD WINAPI PREFIX_CallFrom16_C_word_xxx( FARPROC func, LPBYTE args );
291 * extern LONG WINAPI PREFIX_CallFrom16_C_long_xxx( FARPROC func, LPBYTE args );
292 * extern void WINAPI PREFIX_CallFrom16_C_regs_xxx( FARPROC func, LPBYTE args,
293 * CONTEXT86 *context );
295 * where 'C' is the calling convention ('p' for pascal or 'c' for cdecl),
296 * and each 'x' is an argument ('w'=word, 's'=signed word, 'l'=long,
297 * 'p'=linear pointer, 't'=linear pointer to null-terminated string,
298 * 'T'=segmented pointer to null-terminated string).
300 * The generated routines fetch the arguments from the 16-bit stack (pointed
301 * to by 'args'); the offsets of the single argument values are computed
302 * according to the calling convention and the argument types. Then, the
303 * 32-bit entry point is called with these arguments.
305 * For register functions, the arguments (if present) are converted just
306 * the same as for normal functions, but in addition the CONTEXT86 pointer
307 * filled with the current register values is passed to the 32-bit routine.
309 static void BuildCallFrom16Func( FILE *outfile, const char *profile, const char *prefix )
311 int i, pos, argsize = 0;
316 const char *args = profile + 7;
317 const char *ret_type;
319 /* Parse function type */
321 if (!strncmp( "c_", profile, 2 )) usecdecl = 1;
322 else if (!strncmp( "v_", profile, 2 )) varargs = usecdecl = 1;
323 else if (strncmp( "p_", profile, 2 ))
325 fprintf( stderr, "Invalid function name '%s', ignored\n", profile );
329 if (!strncmp( "word_", profile + 2, 5 )) short_ret = 1;
330 else if (!strncmp( "regs_", profile + 2, 5 )) reg_func = 1;
331 else if (strncmp( "long_", profile + 2, 5 ))
333 fprintf( stderr, "Invalid function name '%s', ignored\n", profile );
337 for ( i = 0; args[i]; i++ )
341 case 's': /* s_word */
344 case 'l': /* long or segmented pointer */
345 case 'T': /* segmented pointer to null-terminated string */
346 case 'p': /* linear pointer */
347 case 't': /* linear pointer to null-terminated string */
352 ret_type = reg_func? "void" : short_ret ? "unsigned short" : "unsigned int";
354 fprintf( outfile, "typedef %s (%s*proc_%s_t)( ",
355 ret_type, usecdecl ? "" : "__stdcall ", profile );
357 for ( i = 0; args[i]; i++ )
359 if ( i ) fprintf( outfile, ", " );
362 case 'w': fprintf( outfile, "unsigned short" ); break;
363 case 's': fprintf( outfile, "short" ); break;
364 case 'l': case 'T': fprintf( outfile, "unsigned int" ); break;
365 case 'p': case 't': fprintf( outfile, "void *" ); break;
368 if (reg_func || varargs)
369 fprintf( outfile, "%svoid *", i? ", " : "" );
371 fprintf( outfile, "void" );
372 fprintf( outfile, " );\n" );
374 fprintf( outfile, "static %s __stdcall __wine_%s_CallFrom16_%s( proc_%s_t proc, unsigned char *args%s )\n",
375 ret_type, make_c_identifier(prefix), profile, profile,
376 reg_func? ", void *context" : "" );
378 fprintf( outfile, "{\n %sproc(\n", reg_func ? "" : "return " );
380 pos = !usecdecl? argsize : 0;
381 for ( i = 0; args[i]; i++ )
383 if ( i ) fprintf( outfile, ",\n" );
384 fprintf( outfile, " " );
388 if ( !usecdecl ) pos -= 2;
389 fprintf( outfile, "*(unsigned short *)(args+%d)", pos );
390 if ( usecdecl ) pos += 2;
393 case 's': /* s_word */
394 if ( !usecdecl ) pos -= 2;
395 fprintf( outfile, "*(short *)(args+%d)", pos );
396 if ( usecdecl ) pos += 2;
399 case 'l': /* long or segmented pointer */
400 case 'T': /* segmented pointer to null-terminated string */
401 if ( !usecdecl ) pos -= 4;
402 fprintf( outfile, "*(unsigned int *)(args+%d)", pos );
403 if ( usecdecl ) pos += 4;
406 case 'p': /* linear pointer */
407 case 't': /* linear pointer to null-terminated string */
408 if ( !usecdecl ) pos -= 4;
409 fprintf( outfile, "((char*)wine_ldt_copy.base[*(unsigned short*)(args+%d) >> 3] + *(unsigned short*)(args+%d))",
411 if ( usecdecl ) pos += 4;
415 fprintf( stderr, "Unknown arg type '%c'\n", args[i] );
419 fprintf( outfile, "%s context", i? ",\n" : "" );
421 fprintf( outfile, "%s args + %d", i? ",\n" : "", argsize );
422 fprintf( outfile, " );\n}\n\n" );
427 /*******************************************************************
430 static const char *get_function_name( const ORDDEF *odp )
432 static char buffer[80];
434 sprintf( buffer, "%s_%s_%s",
435 (odp->type == TYPE_PASCAL) ? "p" :
436 (odp->type == TYPE_VARARGS) ? "v" : "c",
437 (odp->flags & FLAG_REGISTER) ? "regs" :
438 (odp->flags & FLAG_RET16) ? "word" : "long",
439 odp->u.func.arg_types );
444 /*******************************************************************
447 static int Spec16TypeCompare( const void *e1, const void *e2 )
449 const ORDDEF *odp1 = *(const ORDDEF * const *)e1;
450 const ORDDEF *odp2 = *(const ORDDEF * const *)e2;
452 int type1 = odp1->type;
453 int type2 = odp2->type;
455 if (type1 == TYPE_STUB) type1 = TYPE_CDECL;
456 if (type2 == TYPE_STUB) type2 = TYPE_CDECL;
458 if ((retval = type1 - type2) != 0) return retval;
460 type1 = odp1->flags & (FLAG_RET16|FLAG_REGISTER);
461 type2 = odp2->flags & (FLAG_RET16|FLAG_REGISTER);
463 if ((retval = type1 - type2) != 0) return retval;
465 return strcmp( odp1->u.func.arg_types, odp2->u.func.arg_types );
469 /*******************************************************************
472 * Output the functions for stub entry points
474 static void output_stub_funcs( FILE *outfile, const DLLSPEC *spec )
479 for (i = 0; i <= spec->limit; i++)
481 ORDDEF *odp = spec->ordinals[i];
482 if (!odp || odp->type != TYPE_STUB) continue;
483 fprintf( outfile, "#ifdef __GNUC__\n" );
484 fprintf( outfile, "static void __wine_unimplemented( const char *func ) __attribute__((noreturn));\n" );
485 fprintf( outfile, "#endif\n" );
486 fprintf( outfile, "static void __wine_unimplemented( const char *func )\n{\n" );
487 fprintf( outfile, " struct exc_record {\n" );
488 fprintf( outfile, " unsigned int code, flags;\n" );
489 fprintf( outfile, " void *rec, *addr;\n" );
490 fprintf( outfile, " unsigned int params;\n" );
491 fprintf( outfile, " const void *info[15];\n" );
492 fprintf( outfile, " } rec;\n\n" );
493 fprintf( outfile, " extern void __stdcall RtlRaiseException( struct exc_record * );\n\n" );
494 fprintf( outfile, " rec.code = 0x%08x;\n", EXCEPTION_WINE_STUB );
495 fprintf( outfile, " rec.flags = %d;\n", EH_NONCONTINUABLE );
496 fprintf( outfile, " rec.rec = 0;\n" );
497 fprintf( outfile, " rec.params = 2;\n" );
498 fprintf( outfile, " rec.info[0] = \"%s\";\n", spec->file_name );
499 fprintf( outfile, " rec.info[1] = func;\n" );
500 fprintf( outfile, "#ifdef __GNUC__\n" );
501 fprintf( outfile, " rec.addr = __builtin_return_address(1);\n" );
502 fprintf( outfile, "#else\n" );
503 fprintf( outfile, " rec.addr = 0;\n" );
504 fprintf( outfile, "#endif\n" );
505 fprintf( outfile, " for (;;) RtlRaiseException( &rec );\n}\n\n" );
508 for (i = 0; i <= spec->limit; i++)
510 ORDDEF *odp = spec->ordinals[i];
511 if (!odp || odp->type != TYPE_STUB) continue;
512 odp->link_name = xrealloc( odp->link_name, strlen(odp->name) + 13 );
513 strcpy( odp->link_name, "__wine_stub_" );
514 strcat( odp->link_name, odp->name );
515 for (p = odp->link_name; *p; p++) if (!isalnum(*p)) *p = '_';
516 fprintf( outfile, "static void %s(void) { __wine_unimplemented(\"%s\"); }\n",
517 odp->link_name, odp->name );
522 /*******************************************************************
525 * Build a Win16 assembly file from a spec file.
527 void BuildSpec16File( FILE *outfile, DLLSPEC *spec )
529 ORDDEF **type, **typelist;
530 int i, nFuncs, nTypes;
531 int code_offset, data_offset, module_size, res_size;
533 char constructor[100], destructor[100];
535 unsigned short code_selector = get_cs();
540 output_file_header( outfile );
541 fprintf( outfile, "extern unsigned short __wine_call_from_16_word();\n" );
542 fprintf( outfile, "extern unsigned int __wine_call_from_16_long();\n" );
543 fprintf( outfile, "extern void __wine_call_from_16_regs();\n" );
544 fprintf( outfile, "extern void __wine_call_from_16_thunk();\n" );
546 data = (unsigned char *)xmalloc( 0x10000 );
547 memset( data, 0, 16 );
550 if (!spec->dll_name) /* set default name from file name */
553 spec->dll_name = xstrdup( spec->file_name );
554 if ((p = strrchr( spec->dll_name, '.' ))) *p = 0;
557 output_stub_funcs( outfile, spec );
559 /* Build sorted list of all argument types, without duplicates */
561 typelist = (ORDDEF **)calloc( spec->limit+1, sizeof(ORDDEF *) );
563 for (i = nFuncs = 0; i <= spec->limit; i++)
565 ORDDEF *odp = spec->ordinals[i];
573 typelist[nFuncs++] = odp;
580 qsort( typelist, nFuncs, sizeof(ORDDEF *), Spec16TypeCompare );
585 typelist[nTypes++] = typelist[i++];
586 while ( i < nFuncs && Spec16TypeCompare( typelist + i, typelist + nTypes-1 ) == 0 )
590 /* Output CallFrom16 routines needed by this .spec file */
592 for ( i = 0; i < nTypes; i++ )
596 strcpy( profile, get_function_name( typelist[i] ));
597 BuildCallFrom16Func( outfile, profile, spec->file_name );
601 /* Output the DLL functions prototypes */
603 for (i = 0; i <= spec->limit; i++)
605 ORDDEF *odp = spec->ordinals[i];
612 fprintf( outfile, "extern void %s();\n", odp->link_name );
619 /* Output code segment */
621 fprintf( outfile, "\n#include \"pshpack1.h\"\n" );
622 fprintf( outfile, "\nstatic struct code_segment\n{\n" );
623 fprintf( outfile, " struct {\n" );
625 fprintf( outfile, " unsigned char pushl;\n" ); /* pushl $relay */
626 fprintf( outfile, " void *relay;\n" );
627 fprintf( outfile, " unsigned char lcall;\n" ); /* lcall __FLATCS__:glue */
628 fprintf( outfile, " void *glue;\n" );
629 fprintf( outfile, " unsigned short flatcs;\n" );
631 fprintf( outfile, " unsigned short lret;\n" ); /* lret $args */
632 fprintf( outfile, " unsigned short args;\n" );
633 fprintf( outfile, " unsigned int arg_types[2];\n" );
634 fprintf( outfile, " } call[%d];\n", nTypes );
635 fprintf( outfile, " struct {\n" );
637 fprintf( outfile, " unsigned short pushw_bp;\n" ); /* pushw %bp */
638 fprintf( outfile, " unsigned char pushl;\n" ); /* pushl $target */
640 fprintf( outfile, " void (*target)();\n" );
641 fprintf( outfile, " unsigned short call;\n" ); /* call CALLFROM16 */
642 fprintf( outfile, " short callfrom16;\n" );
643 fprintf( outfile, " } entry[%d];\n", nFuncs );
644 fprintf( outfile, "} code_segment =\n{\n {\n" );
648 for ( i = 0; i < nTypes; i++ )
650 char profile[101], *arg;
651 unsigned int arg_types[2];
654 strcpy( profile, get_function_name( typelist[i] ));
655 if ( typelist[i]->type == TYPE_PASCAL )
656 for ( arg = typelist[i]->u.func.arg_types; *arg; arg++ )
660 case 's': /* s_word */
663 case 'l': /* long or segmented pointer */
664 case 'T': /* segmented pointer to null-terminated string */
665 case 'p': /* linear pointer */
666 case 't': /* linear pointer to null-terminated string */
671 /* build the arg types bit fields */
672 arg_types[0] = arg_types[1] = 0;
673 for (j = 0; typelist[i]->u.func.arg_types[j]; j++)
676 switch(typelist[i]->u.func.arg_types[j])
678 case 'w': type = ARG_WORD; break;
679 case 's': type = ARG_SWORD; break;
680 case 'l': type = ARG_LONG; break;
681 case 'p': type = ARG_PTR; break;
682 case 't': type = ARG_STR; break;
683 case 'T': type = ARG_SEGSTR; break;
685 arg_types[j / 10] |= type << (3 * (j % 10));
687 if (typelist[i]->flags & FLAG_REGISTER) arg_types[0] |= ARG_REGISTER;
688 if (typelist[i]->flags & FLAG_RET16) arg_types[0] |= ARG_RET16;
691 fprintf( outfile, " { 0x68, __wine_%s_CallFrom16_%s, 0x9a, __wine_call_from_16_%s,\n",
692 make_c_identifier(spec->file_name), profile,
693 (typelist[i]->flags & FLAG_REGISTER) ? "regs":
694 (typelist[i]->flags & FLAG_RET16) ? "word" : "long" );
696 fprintf( outfile, " 0x%04x, 0xca66, %d, { 0x%08x, 0x%08x } },\n",
697 code_selector, argsize, arg_types[0], arg_types[1] );
699 fprintf( outfile, " 0x%04x, 0xcb66, 0x9090, { 0x%08x, 0x%08x } },\n",
700 code_selector, arg_types[0], arg_types[1] );
703 fprintf( outfile, " { 0xca66, %d, { 0x%08x, 0x%08x } },\n",
704 argsize, arg_types[0], arg_types[1] );
706 fprintf( outfile, " { 0xcb66, 0x9090, { 0x%08x, 0x%08x } },\n",
707 arg_types[0], arg_types[1] );
709 code_offset += sizeof(CALLFROM16);
711 fprintf( outfile, " },\n {\n" );
713 for (i = 0; i <= spec->limit; i++)
715 ORDDEF *odp = spec->ordinals[i];
720 odp->offset = LOWORD(odp->u.abs.value);
724 odp->offset = data_offset;
725 data_offset += StoreVariableCode( data + data_offset, 4, odp);
732 type = bsearch( &odp, typelist, nTypes, sizeof(ORDDEF *), Spec16TypeCompare );
735 fprintf( outfile, " /* %s.%d */ ", spec->dll_name, i );
737 fprintf( outfile, "{ 0x5566, 0x68, %s, 0xe866, %d /* %s */ },\n",
739 fprintf( outfile, "{ %s, 0xe866, %d, /* %s */ },\n",
742 (type-typelist)*sizeof(CALLFROM16) -
743 (code_offset + sizeof(ENTRYPOINT16)),
744 get_function_name( odp ) );
746 odp->offset = code_offset;
747 code_offset += sizeof(ENTRYPOINT16);
751 fprintf(stderr,"build: function type %d not available for Win16\n",
757 fprintf( outfile, " }\n};\n" );
759 /* Output data segment */
761 dump_bytes( outfile, data, data_offset, "Data_Segment", 0 );
763 /* Build the module */
765 module_size = BuildModule16( outfile, code_offset, data_offset, spec );
766 res_size = output_res16_data( outfile, spec );
768 /* Output the DLL descriptor */
770 fprintf( outfile, "#include \"poppack.h\"\n\n" );
772 fprintf( outfile, "static const struct dll_descriptor\n{\n" );
773 fprintf( outfile, " unsigned char *module_start;\n" );
774 fprintf( outfile, " int module_size;\n" );
775 fprintf( outfile, " struct code_segment *code_start;\n" );
776 fprintf( outfile, " unsigned char *data_start;\n" );
777 fprintf( outfile, " const char *owner;\n" );
778 fprintf( outfile, " const unsigned char *rsrc;\n" );
779 fprintf( outfile, "} descriptor =\n{\n" );
780 fprintf( outfile, " Module,\n" );
781 fprintf( outfile, " sizeof(Module),\n" );
782 fprintf( outfile, " &code_segment,\n" );
783 fprintf( outfile, " Data_Segment,\n" );
784 fprintf( outfile, " \"%s\",\n", spec->owner_name );
785 fprintf( outfile, " %s\n", res_size ? "resource_data" : "0" );
786 fprintf( outfile, "};\n" );
788 /* Output the DLL constructor */
790 sprintf( constructor, "__wine_spec_%s_init", make_c_identifier(spec->file_name) );
791 sprintf( destructor, "__wine_spec_%s_fini", make_c_identifier(spec->file_name) );
792 output_dll_init( outfile, constructor, destructor );
797 " extern void __wine_register_dll_16( const struct dll_descriptor *descr );\n"
798 " __wine_register_dll_16( &descriptor );\n"
799 "}\n", constructor );
803 " extern void __wine_unregister_dll_16( const struct dll_descriptor *descr );\n"
804 " __wine_unregister_dll_16( &descriptor );\n"