From 152b98fa633a77e50c0a4b8fbb258b97981bff02 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Mon, 28 Jul 2003 19:19:48 +0000 Subject: [PATCH] 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). --- tools/winebuild/build.h | 2 ++ tools/winebuild/import.c | 5 +++++ tools/winebuild/parser.c | 1 + tools/winebuild/spec32.c | 7 +++++-- tools/winebuild/winebuild.man.in | 4 ++++ 5 files changed, 17 insertions(+), 2 deletions(-) diff --git a/tools/winebuild/build.h b/tools/winebuild/build.h index 475da5aa5b2..0f5092ef9bb 100644 --- a/tools/winebuild/build.h +++ b/tools/winebuild/build.h @@ -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 */ diff --git a/tools/winebuild/import.c b/tools/winebuild/import.c index 6e22f6b4924..24f5a601e5f 100644 --- a/tools/winebuild/import.c +++ b/tools/winebuild/import.c @@ -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" ); diff --git a/tools/winebuild/parser.c b/tools/winebuild/parser.c index 0b6118b4668..8cca02ede0e 100644 --- a/tools/winebuild/parser.c +++ b/tools/winebuild/parser.c @@ -62,6 +62,7 @@ static const char * const FlagNames[] = "i386", /* FLAG_I386 */ "register", /* FLAG_REGISTER */ "interrupt", /* FLAG_INTERRUPT */ + "private", /* FLAG_PRIVATE */ NULL }; diff --git a/tools/winebuild/spec32.c b/tools/winebuild/spec32.c index a5e9462b985..11de51fda35 100644 --- a/tools/winebuild/spec32.c +++ b/tools/winebuild/spec32.c @@ -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" ); } } diff --git a/tools/winebuild/winebuild.man.in b/tools/winebuild/winebuild.man.in index 50fd9ffbd75..d5672bf1972 100644 --- a/tools/winebuild/winebuild.man.in +++ b/tools/winebuild/winebuild.man.in @@ -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