Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
39070fd4
Commit
39070fd4
authored
Sep 14, 2021
by
Nikolay Sivov
Committed by
Alexandre Julliard
Sep 14, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32: Simplify IsEqual() for class moniker.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
c79678ed
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
29 deletions
+18
-29
classmoniker.c
dlls/ole32/classmoniker.c
+18
-29
No files found.
dlls/ole32/classmoniker.c
View file @
39070fd4
...
...
@@ -57,6 +57,15 @@ static inline ClassMoniker *impl_from_IROTData(IROTData *iface)
return
CONTAINING_RECORD
(
iface
,
ClassMoniker
,
IROTData_iface
);
}
static
const
IMonikerVtbl
ClassMonikerVtbl
;
static
ClassMoniker
*
unsafe_impl_from_IMoniker
(
IMoniker
*
iface
)
{
if
(
iface
->
lpVtbl
!=
&
ClassMonikerVtbl
)
return
NULL
;
return
CONTAINING_RECORD
(
iface
,
ClassMoniker
,
IMoniker_iface
);
}
/*******************************************************************************
* ClassMoniker_QueryInterface
*******************************************************************************/
...
...
@@ -373,37 +382,20 @@ static HRESULT WINAPI ClassMoniker_Enum(IMoniker* iface,BOOL fForward, IEnumMoni
return
S_OK
;
}
/******************************************************************************
* ClassMoniker_IsEqual
******************************************************************************/
static
HRESULT
WINAPI
ClassMoniker_IsEqual
(
IMoniker
*
iface
,
IMoniker
*
pmkOtherMoniker
)
static
HRESULT
WINAPI
ClassMoniker_IsEqual
(
IMoniker
*
iface
,
IMoniker
*
other
)
{
ClassMoniker
*
moniker
=
impl_from_IMoniker
(
iface
),
*
other_moniker
;
CLSID
clsid
;
LPOLESTR
dispName1
,
dispName2
;
IBindCtx
*
bind
;
HRESULT
res
=
S_FALSE
;
TRACE
(
"(%p,%p)
\n
"
,
iface
,
pmkOtherMoniker
);
if
(
!
pmkOtherMoniker
)
return
S_FALSE
;
TRACE
(
"%p, %p.
\n
"
,
iface
,
other
);
if
(
!
other
)
return
E_INVALIDARG
;
/* check if both are ClassMoniker */
if
(
FAILED
(
IMoniker_GetClassID
(
pmkOtherMoniker
,
&
clsid
)))
return
S_FALSE
;
if
(
!
IsEqualCLSID
(
&
clsid
,
&
CLSID_ClassMoniker
))
return
S_FALSE
;
other_moniker
=
unsafe_impl_from_IMoniker
(
other
);
if
(
!
other_moniker
)
return
S_FALSE
;
/* check if both displaynames are the same */
if
(
SUCCEEDED
((
res
=
CreateBindCtx
(
0
,
&
bind
))))
{
if
(
SUCCEEDED
(
IMoniker_GetDisplayName
(
iface
,
bind
,
NULL
,
&
dispName1
)))
{
if
(
SUCCEEDED
(
IMoniker_GetDisplayName
(
pmkOtherMoniker
,
bind
,
NULL
,
&
dispName2
)))
{
if
(
wcscmp
(
dispName1
,
dispName2
)
==
0
)
res
=
S_OK
;
CoTaskMemFree
(
dispName2
);
}
CoTaskMemFree
(
dispName1
);
}
}
return
res
;
return
IsEqualGUID
(
&
moniker
->
clsid
,
&
other_moniker
->
clsid
)
?
S_OK
:
S_FALSE
;
}
/******************************************************************************
...
...
@@ -627,9 +619,6 @@ static HRESULT WINAPI ClassMonikerROTData_GetComparisonData(IROTData* iface,
return
S_OK
;
}
/********************************************************************************/
/* Virtual function table for the ClassMoniker class which include IPersist,*/
/* IPersistStream and IMoniker functions. */
static
const
IMonikerVtbl
ClassMonikerVtbl
=
{
ClassMoniker_QueryInterface
,
...
...
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