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
6cfd0924
Commit
6cfd0924
authored
Apr 16, 2020
by
Zebediah Figura
Committed by
Alexandre Julliard
Apr 17, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
devenum: Ignore the "left" parameter to IMoniker::BindToObject().
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
561a84ec
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
56 additions
and
50 deletions
+56
-50
mediacatenum.c
dlls/devenum/mediacatenum.c
+39
-49
devenum.c
dlls/devenum/tests/devenum.c
+17
-1
No files found.
dlls/devenum/mediacatenum.c
View file @
6cfd0924
...
...
@@ -377,73 +377,63 @@ static HRESULT WINAPI moniker_GetSizeMax(IMoniker *iface, ULARGE_INTEGER *pcbSiz
return
S_OK
;
}
static
HRESULT
WINAPI
moniker_BindToObject
(
IMoniker
*
iface
,
IBindCtx
*
pbc
,
IMoniker
*
pmkToLeft
,
REFIID
riidResult
,
void
**
ppvResul
t
)
static
HRESULT
WINAPI
moniker_BindToObject
(
IMoniker
*
iface
,
IBindCtx
*
bind_ctx
,
IMoniker
*
left
,
REFIID
iid
,
void
**
ou
t
)
{
struct
moniker
*
This
=
impl_from_IMoniker
(
iface
);
IUnknown
*
pObj
=
NULL
;
IPropertyBag
*
pProp
=
NULL
;
CLSID
clsID
;
struct
moniker
*
moniker
=
impl_from_IMoniker
(
iface
);
IPersistPropertyBag
*
persist_bag
;
IPropertyBag
*
prop_bag
;
IUnknown
*
unk
;
CLSID
clsid
;
VARIANT
var
;
HRESULT
res
=
E_FAIL
;
HRESULT
hr
;
TRACE
(
"(%p)->(%p, %p, %s, %p)
\n
"
,
This
,
pbc
,
pmkToLeft
,
debugstr_guid
(
riidResult
),
ppvResult
);
TRACE
(
"moniker %p, bind_ctx %p, left %p, iid %s, out %p.
\n
"
,
moniker
,
bind_ctx
,
left
,
debugstr_guid
(
iid
),
out
);
if
(
!
ppvResul
t
)
if
(
!
ou
t
)
return
E_POINTER
;
VariantInit
(
&
var
);
*
ppvResul
t
=
NULL
;
*
ou
t
=
NULL
;
if
(
pmkToLeft
==
NULL
)
if
(
FAILED
(
hr
=
IMoniker_BindToStorage
(
iface
,
NULL
,
NULL
,
&
IID_IPropertyBag
,
(
void
**
)
&
prop_bag
)))
return
hr
;
V_VT
(
&
var
)
=
VT_BSTR
;
if
(
FAILED
(
hr
=
IPropertyBag_Read
(
prop_bag
,
L"CLSID"
,
&
var
,
NULL
)))
{
/* first activation of this class */
LPVOID
pvptr
;
res
=
IMoniker_BindToStorage
(
iface
,
NULL
,
NULL
,
&
IID_IPropertyBag
,
&
pvptr
);
pProp
=
pvptr
;
if
(
SUCCEEDED
(
res
))
{
V_VT
(
&
var
)
=
VT_BSTR
;
res
=
IPropertyBag_Read
(
pProp
,
clsidW
,
&
var
,
NULL
);
}
if
(
SUCCEEDED
(
res
))
{
res
=
CLSIDFromString
(
V_BSTR
(
&
var
),
&
clsID
);
VariantClear
(
&
var
);
}
if
(
SUCCEEDED
(
res
))
{
res
=
CoCreateInstance
(
&
clsID
,
NULL
,
CLSCTX_ALL
,
&
IID_IUnknown
,
&
pvptr
);
pObj
=
pvptr
;
}
IPropertyBag_Release
(
prop_bag
);
return
hr
;
}
if
(
pObj
!=
NULL
)
hr
=
CLSIDFromString
(
V_BSTR
(
&
var
),
&
clsid
);
VariantClear
(
&
var
);
if
(
FAILED
(
hr
))
{
/* get the requested interface from the loaded class */
res
=
S_OK
;
if
(
pProp
)
{
HRESULT
res2
;
LPVOID
ppv
=
NULL
;
res2
=
IUnknown_QueryInterface
(
pObj
,
&
IID_IPersistPropertyBag
,
&
ppv
);
if
(
SUCCEEDED
(
res2
))
{
res
=
IPersistPropertyBag_Load
((
IPersistPropertyBag
*
)
ppv
,
pProp
,
NULL
);
IPersistPropertyBag_Release
((
IPersistPropertyBag
*
)
ppv
);
}
}
if
(
SUCCEEDED
(
res
))
res
=
IUnknown_QueryInterface
(
pObj
,
riidResult
,
ppvResult
);
IUnknown_Release
(
pObj
);
IPropertyBag_Release
(
prop_bag
);
return
hr
;
}
if
(
pProp
)
if
(
FAILED
(
hr
=
CoCreateInstance
(
&
clsid
,
NULL
,
CLSCTX_ALL
,
&
IID_IUnknown
,
(
void
**
)
&
unk
))
)
{
IPropertyBag_Release
(
pProp
);
IPropertyBag_Release
(
prop_bag
);
return
hr
;
}
if
(
SUCCEEDED
(
IUnknown_QueryInterface
(
unk
,
&
IID_IPersistPropertyBag
,
(
void
**
)
&
persist_bag
)))
{
hr
=
IPersistPropertyBag_Load
(
persist_bag
,
prop_bag
,
NULL
);
IPersistPropertyBag_Release
(
persist_bag
);
}
TRACE
(
"<- 0x%x
\n
"
,
res
);
if
(
SUCCEEDED
(
hr
))
hr
=
IUnknown_QueryInterface
(
unk
,
iid
,
out
);
return
res
;
IUnknown_Release
(
unk
);
IPropertyBag_Release
(
prop_bag
);
return
hr
;
}
static
HRESULT
WINAPI
moniker_BindToStorage
(
IMoniker
*
iface
,
IBindCtx
*
pbc
,
...
...
dlls/devenum/tests/devenum.c
View file @
6cfd0924
...
...
@@ -46,8 +46,9 @@ static void test_devenum(void)
GUID
cat_guid
,
clsid
;
WCHAR
*
displayname
;
IBindCtx
*
bindctx
;
HRESULT
hr
,
hr2
;
IUnknown
*
unk
;
VARIANT
var
;
HRESULT
hr
;
int
count
;
hr
=
CoCreateInstance
(
&
CLSID_SystemDeviceEnum
,
NULL
,
CLSCTX_INPROC
,
...
...
@@ -114,6 +115,21 @@ static void test_devenum(void)
hr
=
IMoniker_BindToObject
(
moniker
,
NULL
,
NULL
,
&
IID_IUnknown
,
NULL
);
ok
(
hr
==
E_POINTER
,
"got %#x
\n
"
,
hr
);
VariantClear
(
&
var
);
hr
=
IPropertyBag_Read
(
prop_bag
,
L"CLSID"
,
&
var
,
NULL
);
/* Instantiating the WMT Screen Capture Filter crashes on Windows XP. */
if
(
hr
!=
S_OK
||
wcscmp
(
V_BSTR
(
&
var
),
L"{31087270-D348-432C-899E-2D2F38FF29A0}"
))
{
hr
=
IMoniker_BindToObject
(
moniker
,
NULL
,
NULL
,
&
IID_IUnknown
,
(
void
**
)
&
unk
);
if
(
hr
==
S_OK
)
IUnknown_Release
(
unk
);
hr2
=
IMoniker_BindToObject
(
moniker
,
NULL
,
(
IMoniker
*
)
0xdeadbeef
,
&
IID_IUnknown
,
(
void
**
)
&
unk
);
if
(
hr2
==
S_OK
)
IUnknown_Release
(
unk
);
ok
(
hr2
==
hr
,
"Expected hr %#x, got %#x.
\n
"
,
hr
,
hr2
);
}
hr
=
CreateBindCtx
(
0
,
&
bindctx
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IMoniker_BindToStorage
(
moniker
,
bindctx
,
NULL
,
&
IID_IPropertyBag
,
(
LPVOID
*
)
&
prop_bag
);
...
...
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