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
70f35c65
Commit
70f35c65
authored
Jan 28, 2020
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jan 28, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32: Fix equality check in CommonPrefixWith() for pointer moniker.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
5a93d972
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
66 additions
and
24 deletions
+66
-24
pointermoniker.c
dlls/ole32/pointermoniker.c
+26
-23
moniker.c
dlls/ole32/tests/moniker.c
+40
-1
No files found.
dlls/ole32/pointermoniker.c
View file @
70f35c65
...
...
@@ -48,9 +48,10 @@ typedef struct PointerMonikerImpl{
static
inline
PointerMonikerImpl
*
impl_from_IMoniker
(
IMoniker
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
PointerMonikerImpl
,
IMoniker_iface
);
return
CONTAINING_RECORD
(
iface
,
PointerMonikerImpl
,
IMoniker_iface
);
}
static
PointerMonikerImpl
*
unsafe_impl_from_IMoniker
(
IMoniker
*
iface
);
static
HRESULT
WINAPI
PointerMonikerImpl_QueryInterface
(
IMoniker
*
iface
,
REFIID
riid
,
void
**
ppvObject
)
{
...
...
@@ -58,7 +59,6 @@ PointerMonikerImpl_QueryInterface(IMoniker* iface,REFIID riid,void** ppvObject)
TRACE
(
"(%p,%s,%p)
\n
"
,
This
,
debugstr_guid
(
riid
),
ppvObject
);
/* Perform a sanity check on the parameters.*/
if
(
(
This
==
0
)
||
(
ppvObject
==
0
)
)
return
E_INVALIDARG
;
...
...
@@ -337,26 +337,20 @@ PointerMonikerImpl_Enum(IMoniker* iface,BOOL fForward, IEnumMoniker** ppenumMoni
/******************************************************************************
* PointerMoniker_IsEqual
******************************************************************************/
static
HRESULT
WINAPI
PointerMonikerImpl_IsEqual
(
IMoniker
*
iface
,
IMoniker
*
pmkOtherMoniker
)
static
HRESULT
WINAPI
PointerMonikerImpl_IsEqual
(
IMoniker
*
iface
,
IMoniker
*
other
)
{
PointerMonikerImpl
*
This
=
impl_from_IMoniker
(
iface
);
DWORD
mkSys
;
PointerMonikerImpl
*
moniker
=
impl_from_IMoniker
(
iface
),
*
other_moniker
;
TRACE
(
"(%p,%p)
\n
"
,
iface
,
pmkOtherMoniker
);
if
(
pmkOtherMoniker
==
NULL
)
return
S_FALSE
;
TRACE
(
"%p, %p.
\n
"
,
iface
,
other
);
IMoniker_IsSystemMoniker
(
pmkOtherMoniker
,
&
mkSys
);
if
(
!
other
)
return
E_INVALIDARG
;
if
(
mkSys
==
MKSYS_POINTERMONIKER
)
{
PointerMonikerImpl
*
pOtherMoniker
=
impl_from_IMoniker
(
pmkOtherMoniker
);
return
This
->
pObject
==
pOtherMoniker
->
pObject
?
S_OK
:
S_FALSE
;
}
else
other_moniker
=
unsafe_impl_from_IMoniker
(
other
);
if
(
!
other_moniker
)
return
S_FALSE
;
return
moniker
->
pObject
==
other_moniker
->
pObject
?
S_OK
:
S_FALSE
;
}
/******************************************************************************
...
...
@@ -412,18 +406,20 @@ PointerMonikerImpl_Inverse(IMoniker* iface,IMoniker** ppmk)
/******************************************************************************
* PointerMoniker_CommonPrefixWith
******************************************************************************/
static
HRESULT
WINAPI
PointerMonikerImpl_CommonPrefixWith
(
IMoniker
*
iface
,
IMoniker
*
pmkOther
,
IMoniker
**
ppmkPrefix
)
static
HRESULT
WINAPI
PointerMonikerImpl_CommonPrefixWith
(
IMoniker
*
iface
,
IMoniker
*
other
,
IMoniker
**
prefix
)
{
TRACE
(
"(%p, %p)
\n
"
,
pmkOther
,
ppmkPrefix
);
TRACE
(
"%p, %p, %p.
\n
"
,
iface
,
other
,
prefix
);
if
(
!
prefix
||
!
other
)
return
E_INVALIDARG
;
*
p
pmkP
refix
=
NULL
;
*
prefix
=
NULL
;
if
(
PointerMonikerImpl_IsEqual
(
iface
,
pmkOther
)
)
if
(
PointerMonikerImpl_IsEqual
(
iface
,
other
)
==
S_OK
)
{
IMoniker_AddRef
(
iface
);
*
p
pmkPrefix
=
iface
;
*
p
refix
=
iface
;
return
MK_S_US
;
}
...
...
@@ -539,6 +535,13 @@ static const IMonikerVtbl VT_PointerMonikerImpl =
PointerMonikerImpl_IsSystemMoniker
};
static
PointerMonikerImpl
*
unsafe_impl_from_IMoniker
(
IMoniker
*
iface
)
{
if
(
iface
->
lpVtbl
!=
&
VT_PointerMonikerImpl
)
return
NULL
;
return
CONTAINING_RECORD
(
iface
,
PointerMonikerImpl
,
IMoniker_iface
);
}
/******************************************************************************
* PointerMoniker_Construct (local function)
*******************************************************************************/
...
...
dlls/ole32/tests/moniker.c
View file @
70f35c65
...
...
@@ -2625,7 +2625,7 @@ todo_wine
static
void
test_pointer_moniker
(
void
)
{
IMoniker
*
moniker
,
*
inverse
;
IMoniker
*
moniker
,
*
moniker2
,
*
prefix
,
*
inverse
;
IEnumMoniker
*
enummoniker
;
HRESULT
hr
;
DWORD
moniker_type
;
...
...
@@ -2748,6 +2748,45 @@ todo_wine
ok
(
hr
==
E_NOTIMPL
,
"Unexpected hr %#x.
\n
"
,
hr
);
IMoniker_Release
(
moniker
);
/* CommonPrefixWith() */
hr
=
CreatePointerMoniker
((
IUnknown
*
)
&
Test_ClassFactory
,
&
moniker
);
ok
(
hr
==
S_OK
,
"Failed to create moniker, hr %#x.
\n
"
,
hr
);
hr
=
CreatePointerMoniker
((
IUnknown
*
)
&
Test_ClassFactory
,
&
moniker2
);
ok
(
hr
==
S_OK
,
"Failed to create moniker, hr %#x.
\n
"
,
hr
);
hr
=
IMoniker_IsEqual
(
moniker
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMoniker_IsEqual
(
moniker
,
moniker2
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMoniker_CommonPrefixWith
(
moniker
,
moniker2
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMoniker_CommonPrefixWith
(
moniker
,
NULL
,
&
prefix
);
ok
(
hr
==
E_INVALIDARG
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMoniker_CommonPrefixWith
(
moniker
,
moniker2
,
&
prefix
);
ok
(
hr
==
MK_S_US
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
prefix
==
moniker
,
"Unexpected pointer.
\n
"
);
IMoniker_Release
(
prefix
);
IMoniker_Release
(
moniker2
);
hr
=
CreatePointerMoniker
((
IUnknown
*
)
moniker
,
&
moniker2
);
ok
(
hr
==
S_OK
,
"Failed to create moniker, hr %#x.
\n
"
,
hr
);
hr
=
IMoniker_IsEqual
(
moniker
,
moniker2
);
ok
(
hr
==
S_FALSE
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMoniker_CommonPrefixWith
(
moniker
,
moniker2
,
&
prefix
);
ok
(
hr
==
MK_E_NOPREFIX
,
"Unexpected hr %#x.
\n
"
,
hr
);
IMoniker_Release
(
moniker2
);
IMoniker_Release
(
moniker
);
}
static
void
test_bind_context
(
void
)
...
...
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