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
50996679
Commit
50996679
authored
May 16, 2012
by
Hans Leidekker
Committed by
Alexandre Julliard
May 16, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fusion: Implement IAssemblyName::IsEqual.
parent
97d86f77
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
106 additions
and
3 deletions
+106
-3
asmname.c
dlls/fusion/asmname.c
+30
-3
asmname.c
dlls/fusion/tests/asmname.c
+76
-0
No files found.
dlls/fusion/asmname.c
View file @
50996679
...
@@ -407,10 +407,37 @@ static HRESULT WINAPI IAssemblyNameImpl_GetVersion(IAssemblyName *iface,
...
@@ -407,10 +407,37 @@ static HRESULT WINAPI IAssemblyNameImpl_GetVersion(IAssemblyName *iface,
static
HRESULT
WINAPI
IAssemblyNameImpl_IsEqual
(
IAssemblyName
*
iface
,
static
HRESULT
WINAPI
IAssemblyNameImpl_IsEqual
(
IAssemblyName
*
iface
,
IAssemblyName
*
pName
,
IAssemblyName
*
pName
,
DWORD
dwCmpF
lags
)
DWORD
f
lags
)
{
{
FIXME
(
"(%p, %p, %d) stub!
\n
"
,
iface
,
pName
,
dwCmpFlags
);
IAssemblyNameImpl
*
name1
=
impl_from_IAssemblyName
(
iface
);
return
E_NOTIMPL
;
IAssemblyNameImpl
*
name2
=
impl_from_IAssemblyName
(
pName
);
TRACE
(
"(%p, %p, 0x%08x)
\n
"
,
iface
,
pName
,
flags
);
if
(
!
pName
)
return
S_FALSE
;
if
(
flags
&
~
ASM_CMPF_IL_ALL
)
FIXME
(
"unsupported flags
\n
"
);
if
((
flags
&
ASM_CMPF_NAME
)
&&
strcmpW
(
name1
->
name
,
name2
->
name
))
return
S_FALSE
;
if
(
name1
->
versize
&&
name2
->
versize
)
{
if
((
flags
&
ASM_CMPF_MAJOR_VERSION
)
&&
name1
->
version
[
0
]
!=
name2
->
version
[
0
])
return
S_FALSE
;
if
((
flags
&
ASM_CMPF_MINOR_VERSION
)
&&
name1
->
version
[
1
]
!=
name2
->
version
[
1
])
return
S_FALSE
;
if
((
flags
&
ASM_CMPF_BUILD_NUMBER
)
&&
name1
->
version
[
2
]
!=
name2
->
version
[
2
])
return
S_FALSE
;
if
((
flags
&
ASM_CMPF_REVISION_NUMBER
)
&&
name1
->
version
[
3
]
!=
name2
->
version
[
3
])
return
S_FALSE
;
}
if
((
flags
&
ASM_CMPF_PUBLIC_KEY_TOKEN
)
&&
name1
->
haspubkey
&&
name2
->
haspubkey
&&
memcmp
(
name1
->
pubkey
,
name2
->
pubkey
,
sizeof
(
name1
->
pubkey
)))
return
S_FALSE
;
if
((
flags
&
ASM_CMPF_CULTURE
)
&&
name1
->
culture
&&
name2
->
culture
&&
strcmpW
(
name1
->
culture
,
name2
->
culture
))
return
S_FALSE
;
return
S_OK
;
}
}
static
HRESULT
WINAPI
IAssemblyNameImpl_Clone
(
IAssemblyName
*
iface
,
static
HRESULT
WINAPI
IAssemblyNameImpl_Clone
(
IAssemblyName
*
iface
,
...
...
dlls/fusion/tests/asmname.c
View file @
50996679
...
@@ -893,6 +893,81 @@ static void test_CreateAssemblyNameObject(void)
...
@@ -893,6 +893,81 @@ static void test_CreateAssemblyNameObject(void)
ok
(
name
==
(
IAssemblyName
*
)
0xdeadbeef
,
"Expected 0xdeadbeef, got %p
\n
"
,
name
);
ok
(
name
==
(
IAssemblyName
*
)
0xdeadbeef
,
"Expected 0xdeadbeef, got %p
\n
"
,
name
);
}
}
static
void
test_IAssemblyName_IsEqual
(
void
)
{
static
const
WCHAR
wine1
[]
=
{
'w'
,
'i'
,
'n'
,
'e'
,
0
};
static
const
WCHAR
wine2
[]
=
{
'w'
,
'i'
,
'n'
,
'e'
,
','
,
'v'
,
'e'
,
'r'
,
's'
,
'i'
,
'o'
,
'n'
,
'='
,
'1'
,
'.'
,
'0'
,
'.'
,
'0'
,
'.'
,
'0'
,
0
};
static
const
WCHAR
wine3
[]
=
{
'w'
,
'i'
,
'n'
,
'e'
,
','
,
'v'
,
'e'
,
'r'
,
's'
,
'i'
,
'o'
,
'n'
,
'='
,
'1'
,
'.'
,
'0'
,
'.'
,
'0'
,
'.'
,
'0'
,
','
,
'c'
,
'u'
,
'l'
,
't'
,
'u'
,
'r'
,
'e'
,
'='
,
'n'
,
'e'
,
'u'
,
't'
,
'r'
,
'a'
,
'l'
,
0
};
static
const
WCHAR
wine4
[]
=
{
'w'
,
'i'
,
'n'
,
'e'
,
','
,
'v'
,
'e'
,
'r'
,
's'
,
'i'
,
'o'
,
'n'
,
'='
,
'1'
,
'.'
,
'0'
,
'.'
,
'0'
,
'.'
,
'0'
,
','
,
'c'
,
'u'
,
'l'
,
't'
,
'u'
,
'r'
,
'e'
,
'='
,
'e'
,
'n'
,
0
};
static
const
WCHAR
wine5
[]
=
{
'w'
,
'i'
,
'n'
,
'e'
,
','
,
'v'
,
'e'
,
'r'
,
's'
,
'i'
,
'o'
,
'n'
,
'='
,
'1'
,
'.'
,
'0'
,
'.'
,
'0'
,
'.'
,
'0'
,
','
,
'p'
,
'u'
,
'b'
,
'l'
,
'i'
,
'c'
,
'K'
,
'e'
,
'y'
,
'T'
,
'o'
,
'k'
,
'e'
,
'n'
,
'='
,
'1'
,
'2'
,
'3'
,
'4'
,
'5'
,
'6'
,
'7'
,
'8'
,
'9'
,
'0'
,
'a'
,
'b'
,
'c'
,
'd'
,
'e'
,
'f'
,
0
};
HRESULT
hr
;
IAssemblyName
*
name1
,
*
name2
;
hr
=
pCreateAssemblyNameObject
(
&
name1
,
wine1
,
CANOF_PARSE_DISPLAY_NAME
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
pCreateAssemblyNameObject
(
&
name2
,
wine1
,
CANOF_PARSE_DISPLAY_NAME
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
if
(
0
)
{
/* crashes on some old version */
hr
=
IAssemblyName_IsEqual
(
name1
,
NULL
,
0
);
ok
(
hr
==
S_FALSE
,
"got %08x
\n
"
,
hr
);
hr
=
IAssemblyName_IsEqual
(
name1
,
NULL
,
ASM_CMPF_IL_ALL
);
ok
(
hr
==
S_FALSE
,
"got %08x
\n
"
,
hr
);
}
hr
=
IAssemblyName_IsEqual
(
name1
,
name1
,
ASM_CMPF_IL_ALL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
IAssemblyName_IsEqual
(
name1
,
name2
,
ASM_CMPF_IL_ALL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
IAssemblyName_Release
(
name2
);
hr
=
pCreateAssemblyNameObject
(
&
name2
,
wine2
,
CANOF_PARSE_DISPLAY_NAME
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
IAssemblyName_IsEqual
(
name1
,
name2
,
ASM_CMPF_IL_ALL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
IAssemblyName_Release
(
name2
);
hr
=
pCreateAssemblyNameObject
(
&
name2
,
wine3
,
CANOF_PARSE_DISPLAY_NAME
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
IAssemblyName_IsEqual
(
name1
,
name2
,
ASM_CMPF_IL_ALL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
IAssemblyName_Release
(
name1
);
hr
=
pCreateAssemblyNameObject
(
&
name1
,
wine4
,
CANOF_PARSE_DISPLAY_NAME
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
IAssemblyName_IsEqual
(
name1
,
name2
,
ASM_CMPF_IL_ALL
);
todo_wine
ok
(
hr
==
S_FALSE
,
"got %08x
\n
"
,
hr
);
IAssemblyName_Release
(
name1
);
hr
=
pCreateAssemblyNameObject
(
&
name1
,
wine1
,
CANOF_PARSE_DISPLAY_NAME
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
IAssemblyName_Release
(
name2
);
hr
=
pCreateAssemblyNameObject
(
&
name2
,
wine5
,
CANOF_PARSE_DISPLAY_NAME
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
IAssemblyName_IsEqual
(
name1
,
name2
,
ASM_CMPF_IL_ALL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
IAssemblyName_Release
(
name1
);
IAssemblyName_Release
(
name2
);
}
START_TEST
(
asmname
)
START_TEST
(
asmname
)
{
{
if
(
!
init_functionpointers
())
if
(
!
init_functionpointers
())
...
@@ -902,4 +977,5 @@ START_TEST(asmname)
...
@@ -902,4 +977,5 @@ START_TEST(asmname)
}
}
test_CreateAssemblyNameObject
();
test_CreateAssemblyNameObject
();
test_IAssemblyName_IsEqual
();
}
}
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