Alexandre Julliard : ntdll: Use the manifest with the highest matching version number.
Alexandre Julliard
julliard at winehq.org
Mon Aug 29 11:28:31 CDT 2011
Module: wine
Branch: master
Commit: f8397ef229a7351226922f9ccf98ba7ff8adc061
URL: http://source.winehq.org/git/wine.git/?a=commit;h=f8397ef229a7351226922f9ccf98ba7ff8adc061
Author: Alexandre Julliard <julliard at winehq.org>
Date: Sat Aug 27 13:55:51 2011 +0200
ntdll: Use the manifest with the highest matching version number.
---
dlls/ntdll/actctx.c | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/dlls/ntdll/actctx.c b/dlls/ntdll/actctx.c
index cba0988..a539e54 100644
--- a/dlls/ntdll/actctx.c
+++ b/dlls/ntdll/actctx.c
@@ -1824,6 +1824,7 @@ static WCHAR *lookup_manifest_file( HANDLE dir, struct assembly_identity *ai )
FileBothDirectoryInformation, FALSE, &lookup_us, TRUE );
if (io.u.Status == STATUS_SUCCESS)
{
+ ULONG min_build = ai->version.build, min_revision = ai->version.revision;
FILE_BOTH_DIR_INFORMATION *dir_info;
WCHAR *tmp;
ULONG build, revision;
@@ -1847,19 +1848,18 @@ static WCHAR *lookup_manifest_file( HANDLE dir, struct assembly_identity *ai )
tmp = (WCHAR *)dir_info->FileName + (strchrW(lookup, '*') - lookup);
build = atoiW(tmp);
- if (build < ai->version.build) continue;
+ if (build < min_build) continue;
tmp = strchrW(tmp, '.') + 1;
revision = atoiW(tmp);
- if (build == ai->version.build && revision < ai->version.revision)
- continue;
- ai->version.build = build;
- ai->version.revision = revision;
+ if (build == min_build && revision < min_revision) continue;
+ ai->version.build = min_build = build;
+ ai->version.revision = min_revision = revision;
+ RtlFreeHeap( GetProcessHeap(), 0, ret );
if ((ret = RtlAllocateHeap( GetProcessHeap(), 0, dir_info->FileNameLength + sizeof(WCHAR) )))
{
memcpy( ret, dir_info->FileName, dir_info->FileNameLength );
ret[dir_info->FileNameLength/sizeof(WCHAR)] = 0;
}
- break;
}
}
else WARN("no matching file for %s\n", debugstr_w(lookup));
More information about the wine-cvs
mailing list