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).
diff --git a/tools/winebuild/build.h b/tools/winebuild/build.h
index 475da5a..0f5092e 100644
--- a/tools/winebuild/build.h
+++ b/tools/winebuild/build.h
@@ -102,6 +102,8 @@
#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 6e22f6b..24f5a60 100644
--- a/tools/winebuild/import.c
+++ b/tools/winebuild/import.c
@@ -341,6 +341,11 @@
/* 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 0b6118b..8cca02e 100644
--- a/tools/winebuild/parser.c
+++ b/tools/winebuild/parser.c
@@ -62,6 +62,7 @@
"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 a5e9462..11de51f 100644
--- a/tools/winebuild/spec32.c
+++ b/tools/winebuild/spec32.c
@@ -853,8 +853,11 @@
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 50fd9ff..d5672bf 100644
--- a/tools/winebuild/winebuild.man.in
+++ b/tools/winebuild/winebuild.man.in
@@ -243,6 +243,10 @@
.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