Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
5b416208
Commit
5b416208
authored
Feb 19, 2009
by
Hans Leidekker
Committed by
Alexandre Julliard
Feb 19, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fusion: Sort the list of assemblies built during enumeration.
parent
18cd216e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
61 additions
and
1 deletion
+61
-1
asmenum.c
dlls/fusion/asmenum.c
+61
-1
No files found.
dlls/fusion/asmenum.c
View file @
5b416208
...
...
@@ -221,6 +221,66 @@ static void parse_name(IAssemblyName *name, int depth, LPWSTR path, LPWSTR buf)
}
}
static
int
compare_assembly_names
(
ASMNAME
*
asmname1
,
ASMNAME
*
asmname2
)
{
int
ret
;
WORD
version1
,
version2
;
WCHAR
name1
[
MAX_PATH
],
name2
[
MAX_PATH
];
WCHAR
token_str1
[
TOKEN_LENGTH
+
1
],
token_str2
[
TOKEN_LENGTH
+
1
];
BYTE
token1
[
BYTES_PER_TOKEN
],
token2
[
BYTES_PER_TOKEN
];
DWORD
size
,
i
;
size
=
sizeof
(
name1
);
IAssemblyName_GetProperty
(
asmname1
->
name
,
ASM_NAME_NAME
,
&
name1
,
&
size
);
size
=
sizeof
(
name2
);
IAssemblyName_GetProperty
(
asmname2
->
name
,
ASM_NAME_NAME
,
&
name2
,
&
size
);
if
((
ret
=
strcmpiW
(
name1
,
name2
)))
return
ret
;
for
(
i
=
ASM_NAME_MAJOR_VERSION
;
i
<
ASM_NAME_CULTURE
;
i
++
)
{
size
=
sizeof
(
version1
);
IAssemblyName_GetProperty
(
asmname1
->
name
,
i
,
&
version1
,
&
size
);
size
=
sizeof
(
version2
);
IAssemblyName_GetProperty
(
asmname2
->
name
,
i
,
&
version2
,
&
size
);
if
(
version1
<
version2
)
return
-
1
;
if
(
version1
>
version2
)
return
1
;
}
/* FIXME: compare cultures */
size
=
sizeof
(
token1
);
IAssemblyName_GetProperty
(
asmname1
->
name
,
ASM_NAME_PUBLIC_KEY_TOKEN
,
token1
,
&
size
);
size
=
sizeof
(
token2
);
IAssemblyName_GetProperty
(
asmname2
->
name
,
ASM_NAME_PUBLIC_KEY_TOKEN
,
token2
,
&
size
);
token_to_str
(
token1
,
token_str1
);
token_to_str
(
token2
,
token_str2
);
if
((
ret
=
strcmpiW
(
token_str1
,
token_str2
)))
return
ret
;
return
0
;
}
/* insert assembly in list preserving sort order */
static
void
insert_assembly
(
struct
list
*
assemblies
,
ASMNAME
*
to_insert
)
{
struct
list
*
item
;
LIST_FOR_EACH
(
item
,
assemblies
)
{
ASMNAME
*
name
=
LIST_ENTRY
(
item
,
ASMNAME
,
entry
);
if
(
compare_assembly_names
(
name
,
to_insert
)
>
0
)
{
list_add_before
(
&
name
->
entry
,
&
to_insert
->
entry
);
return
;
}
}
list_add_tail
(
assemblies
,
&
to_insert
->
entry
);
}
static
HRESULT
enum_gac_assemblies
(
struct
list
*
assemblies
,
IAssemblyName
*
name
,
int
depth
,
LPWSTR
path
)
{
...
...
@@ -292,7 +352,7 @@ static HRESULT enum_gac_assemblies(struct list *assemblies, IAssemblyName *name,
break
;
}
list_add_tail
(
assemblies
,
&
asmname
->
entry
);
insert_assembly
(
assemblies
,
asmname
);
continue
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment