Module: wine
Branch: master
Commit: 324331121435cfbc43d36cfe8616ef9d098810ba
URL: http://source.winehq.org/git/wine.git/?a=commit;h=324331121435cfbc43d36cfe8…
Author: Alexandre Julliard <julliard(a)winehq.org>
Date: Fri Oct 26 12:47:40 2007 +0200
winebuild: Add a -ordinal flag for entry points that must be imported by ordinal but exported by name.
---
tools/winebuild/build.h | 7 ++++---
tools/winebuild/parser.c | 21 ++++++++++++++++-----
tools/winebuild/spec32.c | 2 +-
tools/winebuild/winebuild.man.in | 7 ++++++-
4 files changed, 27 insertions(+), 10 deletions(-)
diff --git a/tools/winebuild/build.h b/tools/winebuild/build.h
index 5668271..85309ad 100644
--- a/tools/winebuild/build.h
+++ b/tools/winebuild/build.h
@@ -124,15 +124,16 @@ extern enum target_platform target_platform;
/* entry point flags */
#define FLAG_NORELAY 0x01 /* don't use relay debugging for this function */
-#define FLAG_NONAME 0x02 /* don't import function by name */
+#define FLAG_NONAME 0x02 /* don't export function by name */
#define FLAG_RET16 0x04 /* function returns a 16-bit value */
#define FLAG_RET64 0x08 /* function returns a 64-bit value */
#define FLAG_I386 0x10 /* function is i386 only */
#define FLAG_REGISTER 0x20 /* use register calling convention */
#define FLAG_PRIVATE 0x40 /* function is private (cannot be imported) */
+#define FLAG_ORDINAL 0x80 /* function should be imported by ordinal */
-#define FLAG_FORWARD 0x80 /* function is a forwarded name */
-#define FLAG_EXT_LINK 0x100 /* function links to an external symbol */
+#define FLAG_FORWARD 0x100 /* function is a forwarded name */
+#define FLAG_EXT_LINK 0x200 /* function links to an external symbol */
#define MAX_ORDINALS 65535
diff --git a/tools/winebuild/parser.c b/tools/winebuild/parser.c
index 9246fd2..bcbf951 100644
--- a/tools/winebuild/parser.c
+++ b/tools/winebuild/parser.c
@@ -70,6 +70,7 @@ static const char * const FlagNames[] =
"i386", /* FLAG_I386 */
"register", /* FLAG_REGISTER */
"private", /* FLAG_PRIVATE */
+ "ordinal", /* FLAG_ORDINAL */
NULL
};
@@ -545,11 +546,14 @@ static int parse_spec_ordinal( int ordinal, DLLSPEC *spec )
}
}
- if (!strcmp( odp->name, "@" ) || odp->flags & FLAG_NONAME)
+ if (!strcmp( odp->name, "@" ) || odp->flags & (FLAG_NONAME | FLAG_ORDINAL))
{
if (ordinal == -1)
{
- error( "Nameless function needs an explicit ordinal number\n" );
+ if (!strcmp( odp->name, "@" ))
+ error( "Nameless function needs an explicit ordinal number\n" );
+ else
+ error( "Function imported by ordinal needs an explicit ordinal number\n" );
goto error;
}
if (spec->type != SPEC_WIN32)
@@ -557,9 +561,16 @@ static int parse_spec_ordinal( int ordinal, DLLSPEC *spec )
error( "Nameless functions not supported for Win16\n" );
goto error;
}
- if (!strcmp( odp->name, "@" )) free( odp->name );
- else odp->export_name = odp->name;
- odp->name = NULL;
+ if (!strcmp( odp->name, "@" ))
+ {
+ free( odp->name );
+ odp->name = NULL;
+ }
+ else if (!(odp->flags & FLAG_ORDINAL)) /* -ordinal only affects the import library */
+ {
+ odp->export_name = odp->name;
+ odp->name = NULL;
+ }
}
return 1;
diff --git a/tools/winebuild/spec32.c b/tools/winebuild/spec32.c
index 26e66b8..8df5b85 100644
--- a/tools/winebuild/spec32.c
+++ b/tools/winebuild/spec32.c
@@ -552,7 +552,7 @@ void BuildDef32File( DLLSPEC *spec )
assert(0);
}
output( " @%d", odp->ordinal );
- if (!odp->name) output( " NONAME" );
+ if (!odp->name || (odp->flags & FLAG_ORDINAL)) output( " NONAME" );
if (is_data) output( " DATA" );
if (odp->flags & FLAG_PRIVATE) output( " PRIVATE" );
output( "\n" );
diff --git a/tools/winebuild/winebuild.man.in b/tools/winebuild/winebuild.man.in
index 87f47f8..d135968 100644
--- a/tools/winebuild/winebuild.man.in
+++ b/tools/winebuild/winebuild.man.in
@@ -260,7 +260,8 @@ The entry point is not displayed in relay debugging traces (Win32
only).
.TP
.B -noname
-The entry point will be imported by ordinal instead of by name.
+The entry point will be exported by ordinal instead of by name. The
+name is still available for importing.
.TP
.B -ret16
The function returns a 16-bit value (Win16 only).
@@ -277,6 +278,10 @@ The function uses CPU register to pass arguments.
.B -private
The function cannot be imported from other dlls, it can only be
accessed through GetProcAddress.
+.TP
+.B -ordinal
+The entry point will be imported by ordinal instead of by name. The
+name is still exported.
.SS "Function ordinals"
Syntax:
.br
Module: wine
Branch: master
Commit: 8240395073cc44c4d698e4037ebb14731a0450b4
URL: http://source.winehq.org/git/wine.git/?a=commit;h=8240395073cc44c4d698e4037…
Author: Juan Lang <juan.lang(a)gmail.com>
Date: Thu Oct 25 09:05:38 2007 -0700
crypt32: Remove a test because of a Windows 2003 SP1 bug.
---
dlls/crypt32/tests/cert.c | 14 ++++----------
1 files changed, 4 insertions(+), 10 deletions(-)
diff --git a/dlls/crypt32/tests/cert.c b/dlls/crypt32/tests/cert.c
index 3c6aaa4..14549eb 100644
--- a/dlls/crypt32/tests/cert.c
+++ b/dlls/crypt32/tests/cert.c
@@ -1374,17 +1374,11 @@ static void testGetIssuerCert(void)
flags);
if (parent)
CertFreeCertificateContext(parent);
- /* Now check just the time */
- flags = CERT_STORE_TIME_VALIDITY_FLAG;
- parent = CertGetIssuerCertificateFromStore(store, child, NULL, &flags);
- ok(parent != NULL, "CertGetIssuerCertificateFromStore failed: %08x\n",
- GetLastError());
- /* Oops: the child is not expired, so the time validity check actually
- * succeeds, even though the signing cert is expired.
+ /* Checking time validity is not productive, because while most Windows
+ * versions return 0 (time valid) because the child is not expired,
+ * Windows 2003 SP1 returns that it is expired. Thus the range of
+ * possibilities is covered, and a test verifies nothing.
*/
- ok(!flags, "Expected check to succeed, got %08x\n", flags);
- if (parent)
- CertFreeCertificateContext(parent);
CertFreeCertificateContext(child);
CertCloseStore(store, 0);