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
8cabd478
Commit
8cabd478
authored
Apr 11, 2020
by
Zebediah Figura
Committed by
Alexandre Julliard
Apr 13, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
devenum: Pass moniker fields to moniker_create().
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
4994ba21
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
73 additions
and
61 deletions
+73
-61
devenum_private.h
dlls/devenum/devenum_private.h
+3
-1
mediacatenum.c
dlls/devenum/mediacatenum.c
+52
-37
parsedisplayname.c
dlls/devenum/parsedisplayname.c
+18
-23
No files found.
dlls/devenum/devenum_private.h
View file @
8cabd478
...
...
@@ -68,7 +68,9 @@ struct moniker
};
};
struct
moniker
*
moniker_create
(
void
)
DECLSPEC_HIDDEN
;
struct
moniker
*
dmo_moniker_create
(
const
GUID
class
,
const
GUID
clsid
)
DECLSPEC_HIDDEN
;
struct
moniker
*
codec_moniker_create
(
const
GUID
*
class
,
const
WCHAR
*
name
)
DECLSPEC_HIDDEN
;
struct
moniker
*
filter_moniker_create
(
const
GUID
*
class
,
const
WCHAR
*
name
)
DECLSPEC_HIDDEN
;
HRESULT
enum_moniker_create
(
REFCLSID
class
,
IEnumMoniker
**
enum_mon
)
DECLSPEC_HIDDEN
;
extern
ICreateDevEnum
devenum_factory
DECLSPEC_HIDDEN
;
...
...
dlls/devenum/mediacatenum.c
View file @
8cabd478
...
...
@@ -768,7 +768,7 @@ static const IMonikerVtbl IMoniker_Vtbl =
moniker_IsSystemMoniker
,
};
struct
moniker
*
moniker_create
(
void
)
struct
moniker
*
filter_moniker_create
(
const
GUID
*
class
,
const
WCHAR
*
name
)
{
struct
moniker
*
object
;
...
...
@@ -777,6 +777,49 @@ struct moniker *moniker_create(void)
object
->
IMoniker_iface
.
lpVtbl
=
&
IMoniker_Vtbl
;
object
->
ref
=
1
;
object
->
type
=
DEVICE_FILTER
;
if
(
class
)
object
->
class
=
*
class
;
object
->
has_class
=
!!
class
;
object
->
name
=
wcsdup
(
name
);
DEVENUM_LockModule
();
return
object
;
}
struct
moniker
*
codec_moniker_create
(
const
GUID
*
class
,
const
WCHAR
*
name
)
{
struct
moniker
*
object
;
if
(
!
(
object
=
calloc
(
1
,
sizeof
(
*
object
))))
return
NULL
;
object
->
IMoniker_iface
.
lpVtbl
=
&
IMoniker_Vtbl
;
object
->
ref
=
1
;
object
->
type
=
DEVICE_CODEC
;
if
(
class
)
object
->
class
=
*
class
;
object
->
has_class
=
!!
class
;
object
->
name
=
wcsdup
(
name
);
DEVENUM_LockModule
();
return
object
;
}
struct
moniker
*
dmo_moniker_create
(
const
GUID
class
,
const
GUID
clsid
)
{
struct
moniker
*
object
;
if
(
!
(
object
=
calloc
(
1
,
sizeof
(
*
object
))))
return
NULL
;
object
->
IMoniker_iface
.
lpVtbl
=
&
IMoniker_Vtbl
;
object
->
ref
=
1
;
object
->
type
=
DEVICE_DMO
;
object
->
class
=
class
;
object
->
clsid
=
clsid
;
DEVENUM_LockModule
();
...
...
@@ -842,11 +885,11 @@ static HRESULT WINAPI enum_moniker_Next(IEnumMoniker *iface, ULONG celt, IMonike
{
EnumMonikerImpl
*
This
=
impl_from_IEnumMoniker
(
iface
);
WCHAR
buffer
[
MAX_PATH
+
1
];
struct
moniker
*
pM
oniker
;
struct
moniker
*
m
oniker
;
LONG
res
;
ULONG
fetched
=
0
;
CLSID
clsid
;
HRESULT
hr
;
GUID
clsid
;
HKEY
hkey
;
TRACE
(
"(%p)->(%d, %p, %p)
\n
"
,
iface
,
celt
,
rgelt
,
pceltFetched
);
...
...
@@ -858,14 +901,7 @@ static HRESULT WINAPI enum_moniker_Next(IEnumMoniker *iface, ULONG celt, IMonike
/* try DMOs */
if
((
hr
=
IEnumDMO_Next
(
This
->
dmo_enum
,
1
,
&
clsid
,
NULL
,
NULL
))
==
S_OK
)
{
if
(
!
(
pMoniker
=
moniker_create
()))
return
E_OUTOFMEMORY
;
pMoniker
->
type
=
DEVICE_DMO
;
pMoniker
->
clsid
=
clsid
;
StringFromGUID2
(
&
clsid
,
buffer
,
CHARS_IN_GUID
);
StringFromGUID2
(
&
This
->
class
,
buffer
+
CHARS_IN_GUID
-
1
,
CHARS_IN_GUID
);
moniker
=
dmo_moniker_create
(
This
->
class
,
clsid
);
}
/* try DirectShow filters */
else
if
(
!
(
res
=
RegEnumKeyW
(
This
->
sw_key
,
This
->
sw_index
,
buffer
,
ARRAY_SIZE
(
buffer
))))
...
...
@@ -874,17 +910,7 @@ static HRESULT WINAPI enum_moniker_Next(IEnumMoniker *iface, ULONG celt, IMonike
if
((
res
=
RegOpenKeyExW
(
This
->
sw_key
,
buffer
,
0
,
KEY_QUERY_VALUE
,
&
hkey
)))
break
;
if
(
!
(
pMoniker
=
moniker_create
()))
return
E_OUTOFMEMORY
;
pMoniker
->
type
=
DEVICE_FILTER
;
if
(
!
(
pMoniker
->
name
=
CoTaskMemAlloc
((
lstrlenW
(
buffer
)
+
1
)
*
sizeof
(
WCHAR
))))
{
IMoniker_Release
(
&
pMoniker
->
IMoniker_iface
);
return
E_OUTOFMEMORY
;
}
lstrcpyW
(
pMoniker
->
name
,
buffer
);
moniker
=
filter_moniker_create
(
&
This
->
class
,
buffer
);
}
/* then try codecs */
else
if
(
!
(
res
=
RegEnumKeyW
(
This
->
cm_key
,
This
->
cm_index
,
buffer
,
ARRAY_SIZE
(
buffer
))))
...
...
@@ -894,26 +920,15 @@ static HRESULT WINAPI enum_moniker_Next(IEnumMoniker *iface, ULONG celt, IMonike
if
((
res
=
RegOpenKeyExW
(
This
->
cm_key
,
buffer
,
0
,
KEY_QUERY_VALUE
,
&
hkey
)))
break
;
if
(
!
(
pMoniker
=
moniker_create
()))
return
E_OUTOFMEMORY
;
pMoniker
->
type
=
DEVICE_CODEC
;
if
(
!
(
pMoniker
->
name
=
CoTaskMemAlloc
((
lstrlenW
(
buffer
)
+
1
)
*
sizeof
(
WCHAR
))))
{
IMoniker_Release
(
&
pMoniker
->
IMoniker_iface
);
return
E_OUTOFMEMORY
;
}
lstrcpyW
(
pMoniker
->
name
,
buffer
);
moniker
=
codec_moniker_create
(
&
This
->
class
,
buffer
);
}
else
break
;
pMoniker
->
has_class
=
TRUE
;
pMoniker
->
class
=
This
->
class
;
if
(
!
moniker
)
return
E_OUTOFMEMORY
;
rgelt
[
fetched
]
=
&
pMoniker
->
IMoniker_iface
;
fetched
++
;
rgelt
[
fetched
++
]
=
&
moniker
->
IMoniker_iface
;
}
TRACE
(
"-- fetched %d
\n
"
,
fetched
);
...
...
dlls/devenum/parsedisplayname.c
View file @
8cabd478
...
...
@@ -68,10 +68,10 @@ static ULONG WINAPI devenum_parser_Release(IParseDisplayName *iface)
static
HRESULT
WINAPI
devenum_parser_ParseDisplayName
(
IParseDisplayName
*
iface
,
IBindCtx
*
pbc
,
LPOLESTR
name
,
ULONG
*
eaten
,
IMoniker
**
ret
)
{
struct
moniker
*
moniker
;
WCHAR
buffer
[
MAX_PATH
];
enum
device_type
type
;
struct
moniker
*
mon
;
CLSID
class
;
GUID
class
,
clsid
;
TRACE
(
"(%p, %s, %p, %p)
\n
"
,
pbc
,
debugstr_w
(
name
),
eaten
,
ret
);
...
...
@@ -102,47 +102,42 @@ static HRESULT WINAPI devenum_parser_ParseDisplayName(IParseDisplayName *iface,
return
MK_E_SYNTAX
;
}
if
(
!
(
mon
=
moniker_create
()))
return
E_OUTOFMEMORY
;
if
(
type
==
DEVICE_DMO
)
{
lstrcpynW
(
buffer
,
name
,
CHARS_IN_GUID
);
if
(
FAILED
(
CLSIDFromString
(
buffer
,
&
mon
->
clsid
)))
{
IMoniker_Release
(
&
mon
->
IMoniker_iface
);
if
(
FAILED
(
CLSIDFromString
(
buffer
,
&
clsid
)))
return
MK_E_SYNTAX
;
}
lstrcpynW
(
buffer
,
name
+
CHARS_IN_GUID
-
1
,
CHARS_IN_GUID
);
if
(
FAILED
(
CLSIDFromString
(
buffer
,
&
mon
->
class
)))
{
IMoniker_Release
(
&
mon
->
IMoniker_iface
);
if
(
FAILED
(
CLSIDFromString
(
buffer
,
&
class
)))
return
MK_E_SYNTAX
;
}
moniker
=
dmo_moniker_create
(
class
,
clsid
);
}
else
{
lstrcpynW
(
buffer
,
name
,
CHARS_IN_GUID
);
if
(
CLSIDFromString
(
buffer
,
&
class
)
==
S_OK
)
{
mon
->
has_class
=
TRUE
;
mon
->
class
=
class
;
name
+=
CHARS_IN_GUID
;
if
(
type
==
DEVICE_FILTER
)
moniker
=
filter_moniker_create
(
&
class
,
name
);
else
moniker
=
codec_moniker_create
(
&
class
,
name
);
}
if
(
!
(
mon
->
name
=
CoTaskMemAlloc
((
lstrlenW
(
name
)
+
1
)
*
sizeof
(
WCHAR
))))
else
{
IMoniker_Release
(
&
mon
->
IMoniker_iface
);
return
E_OUTOFMEMORY
;
if
(
type
==
DEVICE_FILTER
)
moniker
=
filter_moniker_create
(
NULL
,
name
);
else
moniker
=
codec_moniker_create
(
NULL
,
name
);
}
lstrcpyW
(
mon
->
name
,
name
);
}
mon
->
type
=
type
;
*
ret
=
&
mon
->
IMoniker_iface
;
if
(
!
moniker
)
return
E_OUTOFMEMORY
;
*
ret
=
&
moniker
->
IMoniker_iface
;
return
S_OK
;
}
...
...
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