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
6bdb2210
Commit
6bdb2210
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: Implement IMoniker::BindToObject() for DMO devices.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
7133ed25
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
78 additions
and
28 deletions
+78
-28
Makefile.in
dlls/devenum/Makefile.in
+1
-1
devenum_private.h
dlls/devenum/devenum_private.h
+3
-14
mediacatenum.c
dlls/devenum/mediacatenum.c
+17
-4
devenum.c
dlls/devenum/tests/devenum.c
+57
-9
No files found.
dlls/devenum/Makefile.in
View file @
6bdb2210
MODULE
=
devenum.dll
IMPORTS
=
strmiids uuid ole32 oleaut32 avicap32 winmm user32 advapi32 dsound msdmo
IMPORTS
=
dmoguids
strmiids uuid ole32 oleaut32 avicap32 winmm user32 advapi32 dsound msdmo
DELAYIMPORTS
=
msvfw32
EXTRADLLFLAGS
=
-mno-cygwin
...
...
dlls/devenum/devenum_private.h
View file @
6bdb2210
...
...
@@ -22,21 +22,10 @@
* - Private file where devenum globals are declared
*/
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "winreg.h"
#include "winerror.h"
#define COBJMACROS
#include "ole2.h"
#include "strmif.h"
#include "olectl.h"
#include "uuids.h"
#include "dshow.h"
#include "dmo.h"
#include "dmodshow.h"
/**********************************************************************
* Dll lifetime tracking declaration for devenum.dll
...
...
dlls/devenum/mediacatenum.c
View file @
6bdb2210
...
...
@@ -23,9 +23,6 @@
*/
#include "devenum_private.h"
#include "oleauto.h"
#include "ocidl.h"
#include "dmoreg.h"
#include "wine/debug.h"
...
...
@@ -393,9 +390,25 @@ static HRESULT WINAPI moniker_BindToObject(IMoniker *iface, IBindCtx *bind_ctx,
if
(
!
out
)
return
E_POINTER
;
VariantInit
(
&
var
);
*
out
=
NULL
;
if
(
moniker
->
type
==
DEVICE_DMO
)
{
IDMOWrapperFilter
*
wrapper
;
if
(
FAILED
(
hr
=
CoCreateInstance
(
&
CLSID_DMOWrapperFilter
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IDMOWrapperFilter
,
(
void
**
)
&
wrapper
)))
return
hr
;
if
(
SUCCEEDED
(
hr
=
IDMOWrapperFilter_Init
(
wrapper
,
&
moniker
->
clsid
,
&
moniker
->
class
)))
{
hr
=
IDMOWrapperFilter_QueryInterface
(
wrapper
,
iid
,
out
);
}
IDMOWrapperFilter_Release
(
wrapper
);
return
hr
;
}
VariantInit
(
&
var
);
V_VT
(
&
var
)
=
VT_BSTR
;
if
(
FAILED
(
hr
=
IPropertyBag_Read
(
&
moniker
->
IPropertyBag_iface
,
L"CLSID"
,
&
var
,
NULL
)))
return
hr
;
...
...
dlls/devenum/tests/devenum.c
View file @
6bdb2210
...
...
@@ -20,20 +20,15 @@
#define COBJMACROS
#include <stdio.h>
#include "wine/test.h"
#include "initguid.h"
#include "ole2.h"
#include "strmif.h"
#include "uuids.h"
#include "vfwmsgs.h"
#include "mmsystem.h"
#include "dshow.h"
#include "dmo.h"
#include "dmodshow.h"
#include "dsound.h"
#include "mmddk.h"
#include "vfw.h"
#include "dmoreg.h"
#include "setupapi.h"
#include "wine/test.h"
DEFINE_GUID
(
GUID_NULL
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
);
...
...
@@ -603,10 +598,15 @@ static void test_dmo(void)
{
IParseDisplayName
*
parser
;
IPropertyBag
*
prop_bag
;
IBaseFilter
*
filter
;
IMediaObject
*
dmo
;
IEnumDMO
*
enumdmo
;
WCHAR
buffer
[
200
];
IMoniker
*
mon
;
VARIANT
var
;
WCHAR
*
name
;
HRESULT
hr
;
GUID
clsid
;
hr
=
CoCreateInstance
(
&
CLSID_CDeviceMoniker
,
NULL
,
CLSCTX_INPROC
,
&
IID_IParseDisplayName
,
(
void
**
)
&
parser
);
ok
(
hr
==
S_OK
,
"Failed to create ParseDisplayName: %#x
\n
"
,
hr
);
...
...
@@ -657,6 +657,54 @@ static void test_dmo(void)
}
IPropertyBag_Release
(
prop_bag
);
IMoniker_Release
(
mon
);
hr
=
DMOEnum
(
&
DMOCATEGORY_AUDIO_DECODER
,
0
,
0
,
NULL
,
0
,
NULL
,
&
enumdmo
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
while
(
IEnumDMO_Next
(
enumdmo
,
1
,
&
clsid
,
&
name
,
NULL
)
==
S_OK
)
{
wcscpy
(
buffer
,
L"@device:dmo:"
);
StringFromGUID2
(
&
clsid
,
buffer
+
wcslen
(
buffer
),
CHARS_IN_GUID
);
StringFromGUID2
(
&
DMOCATEGORY_AUDIO_DECODER
,
buffer
+
wcslen
(
buffer
),
CHARS_IN_GUID
);
mon
=
check_display_name
(
parser
,
buffer
);
ok
(
find_moniker
(
&
DMOCATEGORY_AUDIO_DECODER
,
mon
),
"DMO was not found.
\n
"
);
hr
=
IMoniker_BindToStorage
(
mon
,
NULL
,
NULL
,
&
IID_IPropertyBag
,
(
void
**
)
&
prop_bag
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
VariantClear
(
&
var
);
hr
=
IPropertyBag_Read
(
prop_bag
,
L"FriendlyName"
,
&
var
,
NULL
);
ok
(
hr
==
S_OK
,
"got %#x
\n
"
,
hr
);
ok
(
!
wcscmp
(
V_BSTR
(
&
var
),
name
),
"got %s
\n
"
,
wine_dbgstr_w
(
V_BSTR
(
&
var
)));
VariantClear
(
&
var
);
V_VT
(
&
var
)
=
VT_BSTR
;
V_BSTR
(
&
var
)
=
SysAllocString
(
L"devenum test"
);
hr
=
IPropertyBag_Write
(
prop_bag
,
L"FriendlyName"
,
&
var
);
ok
(
hr
==
E_ACCESSDENIED
,
"Write failed: %#x
\n
"
,
hr
);
VariantClear
(
&
var
);
hr
=
IPropertyBag_Read
(
prop_bag
,
L"CLSID"
,
&
var
,
NULL
);
ok
(
hr
==
HRESULT_FROM_WIN32
(
ERROR_NOT_FOUND
),
"got %#x
\n
"
,
hr
);
IPropertyBag_Release
(
prop_bag
);
CoTaskMemFree
(
name
);
hr
=
IMoniker_BindToObject
(
mon
,
NULL
,
NULL
,
&
IID_IBaseFilter
,
(
void
**
)
&
filter
);
ok
(
hr
==
S_OK
,
"got %#x
\n
"
,
hr
);
hr
=
IBaseFilter_GetClassID
(
filter
,
&
clsid
);
ok
(
hr
==
S_OK
,
"got %#x
\n
"
,
hr
);
ok
(
IsEqualGUID
(
&
clsid
,
&
CLSID_DMOWrapperFilter
),
"Got CLSID %s.
\n
"
,
debugstr_guid
(
&
clsid
));
hr
=
IBaseFilter_QueryInterface
(
filter
,
&
IID_IMediaObject
,
(
void
**
)
&
dmo
);
ok
(
hr
==
S_OK
,
"got %#x
\n
"
,
hr
);
IMediaObject_Release
(
dmo
);
IBaseFilter_Release
(
filter
);
}
IEnumDMO_Release
(
enumdmo
);
IParseDisplayName_Release
(
parser
);
}
...
...
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