Added -private flag for entry points that shouldn't be imported from

other dlls.
Support PRIVATE flag in .def files (based on a patch by Jon
Griffiths).
This commit is contained in:
Alexandre Julliard 2003-07-28 19:19:48 +00:00
parent b96b3d15b5
commit 152b98fa63
5 changed files with 17 additions and 2 deletions

View file

@ -102,6 +102,8 @@ typedef struct
#define FLAG_I386 0x08 /* function is i386 only */
#define FLAG_REGISTER 0x10 /* use register calling convention */
#define FLAG_INTERRUPT 0x20 /* function is an interrupt handler */
#define FLAG_PRIVATE 0x40 /* function is private (cannot be imported) */
#define FLAG_FORWARD 0x100 /* function is a forwarded name */
/* Offset of a structure field relative to the start of the struct */

View file

@ -341,6 +341,11 @@ static int read_import_lib( const char *name, struct import *imp )
/* we don't support importing non-function entry points */
goto next;
}
else if (!strcmp( flags, "PRIVATE" ))
{
/* function must not be imported */
goto next;
}
else
{
error( "Garbage after ordinal declaration\n" );

View file

@ -62,6 +62,7 @@ static const char * const FlagNames[] =
"i386", /* FLAG_I386 */
"register", /* FLAG_REGISTER */
"interrupt", /* FLAG_INTERRUPT */
"private", /* FLAG_PRIVATE */
NULL
};

View file

@ -853,8 +853,11 @@ void BuildDef32File(FILE *outfile)
default:
assert(0);
}
fprintf(outfile, " @%d%s%s\n", odp->ordinal,
odp->name ? "" : " NONAME", is_data ? " DATA" : "" );
fprintf( outfile, " @%d", odp->ordinal );
if (!odp->name) fprintf( outfile, " NONAME" );
if (is_data) fprintf( outfile, " DATA" );
if (odp->flags & FLAG_PRIVATE) fprintf( outfile, " PRIVATE" );
fprintf( outfile, "\n" );
}
}

View file

@ -243,6 +243,10 @@ The function uses CPU register to pass arguments.
.TP
.B -interrupt
The function is an interrupt handler routine.
.TP
.B -private
The function cannot be imported from other dlls, it can only be
accessed through GetProcAddress.
.SS "Function ordinals"
Syntax:
.br