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
828a0ae6
Commit
828a0ae6
authored
Sep 20, 2021
by
Nikolay Sivov
Committed by
Alexandre Julliard
Sep 20, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32: Remove explicit type check in CommonPrefixWith() for item moniker.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
1a6659e8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
21 deletions
+37
-21
itemmoniker.c
dlls/ole32/itemmoniker.c
+8
-20
moniker.c
dlls/ole32/tests/moniker.c
+29
-1
No files found.
dlls/ole32/itemmoniker.c
View file @
828a0ae6
...
...
@@ -753,31 +753,19 @@ static HRESULT WINAPI ItemMonikerImpl_Inverse(IMoniker* iface,IMoniker** ppmk)
return
CreateAntiMoniker
(
ppmk
);
}
/******************************************************************************
* ItemMoniker_CommonPrefixWith
******************************************************************************/
static
HRESULT
WINAPI
ItemMonikerImpl_CommonPrefixWith
(
IMoniker
*
iface
,
IMoniker
*
pmkOther
,
IMoniker
**
ppmkPrefix
)
static
HRESULT
WINAPI
ItemMonikerImpl_CommonPrefixWith
(
IMoniker
*
iface
,
IMoniker
*
other
,
IMoniker
**
prefix
)
{
DWORD
mkSys
;
TRACE
(
"(%p,%p)
\n
"
,
pmkOther
,
ppmkPrefix
);
IMoniker_IsSystemMoniker
(
pmkOther
,
&
mkSys
);
/* If the other moniker is an item moniker that is equal to this moniker, this method sets *ppmkPrefix */
/* to this moniker and returns MK_S_US */
if
((
mkSys
==
MKSYS_ITEMMONIKER
)
&&
(
IMoniker_IsEqual
(
iface
,
pmkOther
)
==
S_OK
)
){
*
ppmkPrefix
=
iface
;
TRACE
(
"%p, %p, %p
\n
"
,
iface
,
other
,
prefix
);
if
(
IMoniker_IsEqual
(
iface
,
other
)
==
S_OK
)
{
*
prefix
=
iface
;
IMoniker_AddRef
(
iface
);
return
MK_S_US
;
}
else
/* otherwise, the method calls the MonikerCommonPrefixWith function. This function correctly handles */
/* the case where the other moniker is a generic composite. */
return
MonikerCommonPrefixWith
(
iface
,
pmkOther
,
ppmkPrefix
);
return
MonikerCommonPrefixWith
(
iface
,
other
,
prefix
);
}
/******************************************************************************
...
...
dlls/ole32/tests/moniker.c
View file @
828a0ae6
...
...
@@ -2276,7 +2276,7 @@ static void test_item_moniker(void)
"Moniker_IsRunning"
,
NULL
};
IMoniker
*
moniker
,
*
moniker2
,
*
reduced
,
*
anti
,
*
inverse
;
IMoniker
*
moniker
,
*
moniker2
,
*
moniker3
,
*
reduced
,
*
anti
,
*
inverse
;
DWORD
i
,
hash
,
eaten
,
cookie
;
HRESULT
hr
;
IBindCtx
*
bindctx
;
...
...
@@ -2611,6 +2611,34 @@ todo_wine
IMoniker_Release
(
anti
);
IMoniker_Release
(
moniker
);
/* CommonPrefixWith */
hr
=
CreateItemMoniker
(
L"!"
,
L"Item"
,
&
moniker
);
ok
(
hr
==
S_OK
,
"Failed to create a moniker, hr %#x.
\n
"
,
hr
);
hr
=
CreateItemMoniker
(
L"#"
,
L"Item"
,
&
moniker2
);
ok
(
hr
==
S_OK
,
"Failed to create a moniker, hr %#x.
\n
"
,
hr
);
hr
=
IMoniker_CommonPrefixWith
(
moniker
,
moniker2
,
&
moniker3
);
ok
(
hr
==
MK_S_US
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
moniker3
==
moniker
,
"Unexpected object.
\n
"
);
IMoniker_Release
(
moniker3
);
IMoniker_Release
(
moniker2
);
hr
=
CreateItemMoniker
(
L"!"
,
L"Item2"
,
&
moniker2
);
ok
(
hr
==
S_OK
,
"Failed to create a moniker, hr %#x.
\n
"
,
hr
);
moniker3
=
(
void
*
)
0xdeadbeef
;
hr
=
IMoniker_CommonPrefixWith
(
moniker
,
moniker2
,
&
moniker3
);
todo_wine
{
ok
(
hr
==
MK_E_NOPREFIX
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
!
moniker3
,
"Unexpected object.
\n
"
);
}
IMoniker_Release
(
moniker2
);
IMoniker_Release
(
moniker
);
}
static
void
stream_write_dword
(
IStream
*
stream
,
DWORD
value
)
...
...
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