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
0806f953
Commit
0806f953
authored
Sep 29, 2021
by
Nikolay Sivov
Committed by
Alexandre Julliard
Sep 29, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32/composite: Cleanup IsRunning() implementation.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
b8ba0e6f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
63 deletions
+39
-63
compositemoniker.c
dlls/ole32/compositemoniker.c
+30
-63
moniker.c
dlls/ole32/tests/moniker.c
+9
-0
No files found.
dlls/ole32/compositemoniker.c
View file @
0806f953
...
...
@@ -612,82 +612,49 @@ static HRESULT WINAPI CompositeMonikerImpl_Hash(IMoniker *iface, DWORD *hash)
return
hr
;
}
/******************************************************************************
* CompositeMoniker_IsRunning
******************************************************************************/
static
HRESULT
WINAPI
CompositeMonikerImpl_IsRunning
(
IMoniker
*
iface
,
IBindCtx
*
pbc
,
IMoniker
*
pmkToLeft
,
IMoniker
*
pmkNewlyRunning
)
static
HRESULT
WINAPI
CompositeMonikerImpl_IsRunning
(
IMoniker
*
iface
,
IBindCtx
*
pbc
,
IMoniker
*
toleft
,
IMoniker
*
newly_running
)
{
IRunningObjectTable
*
rot
;
HRESULT
res
;
IMoniker
*
tempMk
,
*
antiMk
,
*
rightMostMk
;
IEnumMoniker
*
enumMoniker
;
TRACE
(
"(%p,%p,%p,%p)
\n
"
,
iface
,
pbc
,
pmkToLeft
,
pmkNewlyRunning
);
/* If pmkToLeft is non-NULL, this method composes pmkToLeft with this moniker and calls IsRunning on the result.*/
if
(
pmkToLeft
!=
NULL
){
CompositeMonikerImpl
*
moniker
=
impl_from_IMoniker
(
iface
);
IMoniker
*
c
,
*
left
,
*
rightmost
;
IRunningObjectTable
*
rot
;
HRESULT
hr
;
CreateGenericComposite
(
pmkToLeft
,
iface
,
&
tempMk
);
TRACE
(
"%p, %p, %p, %p.
\n
"
,
iface
,
pbc
,
toleft
,
newly_running
);
res
=
IMoniker_IsRunning
(
tempMk
,
pbc
,
NULL
,
pmkNewlyRunning
);
if
(
!
pbc
)
return
E_INVALIDARG
;
IMoniker_Release
(
tempMk
);
if
(
toleft
)
{
if
(
SUCCEEDED
(
hr
=
CreateGenericComposite
(
toleft
,
iface
,
&
c
)))
{
hr
=
IMoniker_IsRunning
(
c
,
pbc
,
NULL
,
newly_running
);
IMoniker_Release
(
c
);
}
return
res
;
return
hr
;
}
else
/* If pmkToLeft is NULL, this method returns S_OK if pmkNewlyRunning is non-NULL and is equal */
/* to this moniker */
if
(
pmkNewlyRunning
!=
NULL
)
if
(
newly_running
)
return
IMoniker_IsEqual
(
iface
,
newly_running
);
if
(
IMoniker_IsEqual
(
iface
,
pmkNewlyRunning
)
==
S_OK
)
return
S_OK
;
else
return
S_FALSE
;
else
{
if
(
pbc
==
NULL
)
return
E_INVALIDARG
;
/* If pmkToLeft and pmkNewlyRunning are both NULL, this method checks the ROT to see whether */
/* the moniker is running. If so, the method returns S_OK; otherwise, it recursively calls */
/* IMoniker::IsRunning on the rightmost component of the composite, passing the remainder of */
/* the composite as the pmkToLeft parameter for that call. */
res
=
IBindCtx_GetRunningObjectTable
(
pbc
,
&
rot
);
if
(
FAILED
(
res
))
return
res
;
res
=
IRunningObjectTable_IsRunning
(
rot
,
iface
);
IRunningObjectTable_Release
(
rot
);
if
(
res
==
S_OK
)
return
S_OK
;
else
{
if
(
FAILED
(
hr
=
IBindCtx_GetRunningObjectTable
(
pbc
,
&
rot
)))
return
hr
;
IMoniker_Enum
(
iface
,
FALSE
,
&
enumMoniker
);
IEnumMoniker_Next
(
enumMoniker
,
1
,
&
rightMostMk
,
NULL
);
IEnumMoniker_Release
(
enumMoniker
)
;
hr
=
IRunningObjectTable_IsRunning
(
rot
,
iface
);
IRunningObjectTable_Release
(
rot
);
if
(
hr
==
S_OK
)
return
S_OK
;
res
=
CreateAntiMoniker
(
&
antiMk
);
res
=
IMoniker_ComposeWith
(
iface
,
antiMk
,
0
,
&
tempMk
);
IMoniker_Release
(
antiMk
);
if
(
FAILED
(
hr
=
composite_get_rightmost
(
moniker
,
&
left
,
&
rightmost
)))
return
hr
;
res
=
IMoniker_IsRunning
(
rightMostMk
,
pbc
,
tempMk
,
pmkNewlyRunning
);
hr
=
IMoniker_IsRunning
(
rightmost
,
pbc
,
left
,
NULL
);
IMoniker_Release
(
tempMk
);
IMoniker_Release
(
rightMostMk
);
IMoniker_Release
(
left
);
IMoniker_Release
(
rightmost
);
return
res
;
}
}
return
hr
;
}
static
HRESULT
WINAPI
CompositeMonikerImpl_GetTimeOfLastChange
(
IMoniker
*
iface
,
IBindCtx
*
pbc
,
...
...
dlls/ole32/tests/moniker.c
View file @
0806f953
...
...
@@ -3273,6 +3273,15 @@ todo_wine
hr
=
IMoniker_IsRunning
(
moniker
,
bindctx
,
NULL
,
NULL
);
ok
(
hr
==
S_FALSE
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMoniker_IsRunning
(
moniker
,
bindctx
,
NULL
,
moniker
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMoniker_IsRunning
(
moniker
,
bindctx
,
moniker1
,
moniker
);
ok
(
hr
==
S_FALSE
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMoniker_IsRunning
(
moniker
,
NULL
,
moniker1
,
moniker
);
ok
(
hr
==
E_INVALIDARG
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMoniker_GetTimeOfLastChange
(
moniker
,
bindctx
,
NULL
,
&
filetime
);
ok
(
hr
==
MK_E_NOTBINDABLE
,
"IMoniker_GetTimeOfLastChange should return MK_E_NOTBINDABLE, not 0x%08x
\n
"
,
hr
);
...
...
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