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
2d3edce0
Commit
2d3edce0
authored
Aug 07, 2015
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Aug 13, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
qedit: COM cleanup for IEnumMediaTypes of SampleGrabber.
parent
793ab7d4
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
44 deletions
+44
-44
samplegrabber.c
dlls/qedit/samplegrabber.c
+44
-44
No files found.
dlls/qedit/samplegrabber.c
View file @
2d3edce0
...
...
@@ -41,7 +41,7 @@ static IEnumMediaTypes *mediaenum_create(const AM_MEDIA_TYPE *mtype);
/* Single media type enumerator */
typedef
struct
_ME_Impl
{
IEnumMediaTypes
m
e
;
IEnumMediaTypes
IEnumMediaTypes_ifac
e
;
LONG
refCount
;
BOOL
past
;
AM_MEDIA_TYPE
mtype
;
...
...
@@ -50,22 +50,42 @@ typedef struct _ME_Impl {
/* IEnumMediaTypes interface implementation */
/* IUnknown */
static
ULONG
WINAPI
Single_IEnumMediaTypes_AddRef
(
IEnumMediaTypes
*
iface
)
static
inline
ME_Impl
*
impl_from_IEnumMediaTypes
(
IEnumMediaTypes
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
ME_Impl
,
IEnumMediaTypes_iface
);
}
static
HRESULT
WINAPI
Single_IEnumMediaTypes_QueryInterface
(
IEnumMediaTypes
*
iface
,
REFIID
riid
,
void
**
ret_iface
)
{
ME_Impl
*
This
=
(
ME_Impl
*
)
iface
;
ME_Impl
*
This
=
impl_from_IEnumMediaTypes
(
iface
);
TRACE
(
"(%p)->(%s %p)
\n
"
,
This
,
debugstr_guid
(
riid
),
ret_iface
);
if
(
IsEqualIID
(
riid
,
&
IID_IUnknown
)
||
IsEqualIID
(
riid
,
&
IID_IEnumMediaTypes
))
{
*
ret_iface
=
iface
;
IEnumMediaTypes_AddRef
(
iface
);
return
S_OK
;
}
*
ret_iface
=
NULL
;
WARN
(
"(%p, %s,%p): not found
\n
"
,
This
,
debugstr_guid
(
riid
),
ret_iface
);
return
E_NOINTERFACE
;
}
static
ULONG
WINAPI
Single_IEnumMediaTypes_AddRef
(
IEnumMediaTypes
*
iface
)
{
ME_Impl
*
This
=
impl_from_IEnumMediaTypes
(
iface
);
ULONG
refCount
=
InterlockedIncrement
(
&
This
->
refCount
);
TRACE
(
"(%p) new ref = %u
\n
"
,
This
,
refCount
);
return
refCount
;
}
/* IUnknown */
static
ULONG
WINAPI
Single_IEnumMediaTypes_Release
(
IEnumMediaTypes
*
iface
)
static
ULONG
WINAPI
Single_IEnumMediaTypes_Release
(
IEnumMediaTypes
*
iface
)
{
ME_Impl
*
This
=
(
ME_Impl
*
)
iface
;
ME_Impl
*
This
=
impl_from_IEnumMediaTypes
(
iface
)
;
ULONG
refCount
=
InterlockedDecrement
(
&
This
->
refCount
);
TRACE
(
"(%p) new ref = %u
\n
"
,
This
,
refCount
);
if
(
refCount
==
0
)
{
...
...
@@ -77,30 +97,13 @@ Single_IEnumMediaTypes_Release(IEnumMediaTypes *iface)
return
refCount
;
}
/* IUnknown */
static
HRESULT
WINAPI
Single_IEnumMediaTypes_QueryInterface
(
IEnumMediaTypes
*
iface
,
REFIID
riid
,
void
**
ppvObject
)
{
ME_Impl
*
This
=
(
ME_Impl
*
)
iface
;
TRACE
(
"(%p)->(%s %p)
\n
"
,
This
,
debugstr_guid
(
riid
),
ppvObject
);
if
(
IsEqualIID
(
riid
,
&
IID_IUnknown
)
||
IsEqualIID
(
riid
,
&
IID_IEnumMediaTypes
))
{
Single_IEnumMediaTypes_AddRef
(
iface
);
*
ppvObject
=
&
(
This
->
me
);
return
S_OK
;
}
*
ppvObject
=
NULL
;
WARN
(
"(%p, %s,%p): not found
\n
"
,
This
,
debugstr_guid
(
riid
),
ppvObject
);
return
E_NOINTERFACE
;
}
/* IEnumMediaTypes */
static
HRESULT
WINAPI
Single_IEnumMediaTypes_Next
(
IEnumMediaTypes
*
iface
,
ULONG
nTypes
,
AM_MEDIA_TYPE
**
types
,
ULONG
*
fetched
)
static
HRESULT
WINAPI
Single_IEnumMediaTypes_Next
(
IEnumMediaTypes
*
iface
,
ULONG
nTypes
,
AM_MEDIA_TYPE
**
types
,
ULONG
*
fetched
)
{
ME_Impl
*
This
=
(
ME_Impl
*
)
iface
;
ME_Impl
*
This
=
impl_from_IEnumMediaTypes
(
iface
)
;
ULONG
count
=
0
;
TRACE
(
"(%p)->(%u, %p, %p)
\n
"
,
This
,
nTypes
,
types
,
fetched
);
if
(
!
nTypes
)
return
E_INVALIDARG
;
...
...
@@ -122,32 +125,29 @@ Single_IEnumMediaTypes_Next(IEnumMediaTypes *iface, ULONG nTypes, AM_MEDIA_TYPE
return
(
count
==
nTypes
)
?
S_OK
:
S_FALSE
;
}
/* IEnumMediaTypes */
static
HRESULT
WINAPI
Single_IEnumMediaTypes_Skip
(
IEnumMediaTypes
*
iface
,
ULONG
nTypes
)
static
HRESULT
WINAPI
Single_IEnumMediaTypes_Skip
(
IEnumMediaTypes
*
iface
,
ULONG
nTypes
)
{
ME_Impl
*
This
=
(
ME_Impl
*
)
iface
;
ME_Impl
*
This
=
impl_from_IEnumMediaTypes
(
iface
);
TRACE
(
"(%p)->(%u)
\n
"
,
This
,
nTypes
);
if
(
nTypes
)
This
->
past
=
TRUE
;
return
This
->
past
?
S_FALSE
:
S_OK
;
}
/* IEnumMediaTypes */
static
HRESULT
WINAPI
Single_IEnumMediaTypes_Reset
(
IEnumMediaTypes
*
iface
)
static
HRESULT
WINAPI
Single_IEnumMediaTypes_Reset
(
IEnumMediaTypes
*
iface
)
{
ME_Impl
*
This
=
(
ME_Impl
*
)
iface
;
ME_Impl
*
This
=
impl_from_IEnumMediaTypes
(
iface
);
TRACE
(
"(%p)->()
\n
"
,
This
);
This
->
past
=
FALSE
;
return
S_OK
;
}
/* IEnumMediaTypes */
static
HRESULT
WINAPI
Single_IEnumMediaTypes_Clone
(
IEnumMediaTypes
*
iface
,
IEnumMediaTypes
**
me
)
static
HRESULT
WINAPI
Single_IEnumMediaTypes_Clone
(
IEnumMediaTypes
*
iface
,
IEnumMediaTypes
**
me
)
{
ME_Impl
*
This
=
(
ME_Impl
*
)
iface
;
ME_Impl
*
This
=
impl_from_IEnumMediaTypes
(
iface
);
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
me
);
if
(
!
me
)
return
E_POINTER
;
...
...
@@ -177,7 +177,7 @@ static IEnumMediaTypes *mediaenum_create(const AM_MEDIA_TYPE *mtype)
ME_Impl
*
obj
=
CoTaskMemAlloc
(
sizeof
(
ME_Impl
));
if
(
obj
)
{
ZeroMemory
(
obj
,
sizeof
(
ME_Impl
));
obj
->
m
e
.
lpVtbl
=
&
IEnumMediaTypes_VTable
;
obj
->
IEnumMediaTypes_ifac
e
.
lpVtbl
=
&
IEnumMediaTypes_VTable
;
obj
->
refCount
=
1
;
obj
->
past
=
FALSE
;
if
(
mtype
)
{
...
...
@@ -193,7 +193,7 @@ static IEnumMediaTypes *mediaenum_create(const AM_MEDIA_TYPE *mtype)
else
obj
->
mtype
.
majortype
=
GUID_NULL
;
}
return
&
obj
->
m
e
;
return
&
obj
->
IEnumMediaTypes_ifac
e
;
}
...
...
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