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
aa4df8f6
Commit
aa4df8f6
authored
May 06, 2005
by
Maarten Lankhorst
Committed by
Alexandre Julliard
May 06, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed {Copy/Delete/Free}MediaType functions to show proper behaviour.
Fixed EnumMediaTypes to copy pbFormat too. Added FreeMediaType.
parent
a96f8ac2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
6 deletions
+27
-6
enummedia.c
dlls/quartz/enummedia.c
+26
-6
quartz_private.h
dlls/quartz/quartz_private.h
+1
-0
No files found.
dlls/quartz/enummedia.c
View file @
aa4df8f6
...
...
@@ -27,13 +27,14 @@ WINE_DEFAULT_DEBUG_CHANNEL(quartz);
HRESULT
CopyMediaType
(
AM_MEDIA_TYPE
*
pDest
,
const
AM_MEDIA_TYPE
*
pSrc
)
{
memcpy
(
pDest
,
pSrc
,
sizeof
(
AM_MEDIA_TYPE
));
if
(
!
pSrc
->
pbFormat
)
return
S_OK
;
if
(
!
(
pDest
->
pbFormat
=
CoTaskMemAlloc
(
pSrc
->
cbFormat
)))
return
E_OUTOFMEMORY
;
memcpy
(
pDest
->
pbFormat
,
pSrc
->
pbFormat
,
pSrc
->
cbFormat
);
return
S_OK
;
}
void
Delet
eMediaType
(
AM_MEDIA_TYPE
*
pMediaType
)
void
Fre
eMediaType
(
AM_MEDIA_TYPE
*
pMediaType
)
{
if
(
pMediaType
->
pbFormat
)
{
...
...
@@ -47,6 +48,13 @@ void DeleteMediaType(AM_MEDIA_TYPE * pMediaType)
}
}
void
DeleteMediaType
(
AM_MEDIA_TYPE
*
pMediaType
)
{
FreeMediaType
(
pMediaType
);
CoTaskMemFree
(
pMediaType
);
}
BOOL
CompareMediaTypes
(
const
AM_MEDIA_TYPE
*
pmt1
,
const
AM_MEDIA_TYPE
*
pmt2
,
BOOL
bWildcards
)
{
TRACE
(
"pmt1: "
);
...
...
@@ -90,7 +98,11 @@ HRESULT IEnumMediaTypesImpl_Construct(const ENUMMEDIADETAILS * pDetails, IEnumMe
pEnumMediaTypes
->
enumMediaDetails
.
cMediaTypes
=
pDetails
->
cMediaTypes
;
pEnumMediaTypes
->
enumMediaDetails
.
pMediaTypes
=
CoTaskMemAlloc
(
sizeof
(
AM_MEDIA_TYPE
)
*
pDetails
->
cMediaTypes
);
for
(
i
=
0
;
i
<
pDetails
->
cMediaTypes
;
i
++
)
pEnumMediaTypes
->
enumMediaDetails
.
pMediaTypes
[
i
]
=
pDetails
->
pMediaTypes
[
i
];
if
(
FAILED
(
CopyMediaType
(
&
pEnumMediaTypes
->
enumMediaDetails
.
pMediaTypes
[
i
],
&
pDetails
->
pMediaTypes
[
i
])))
{
while
(
--
i
>
0
)
CoTaskMemFree
(
pEnumMediaTypes
->
enumMediaDetails
.
pMediaTypes
[
i
].
pbFormat
);
CoTaskMemFree
(
pEnumMediaTypes
->
enumMediaDetails
.
pMediaTypes
);
return
E_OUTOFMEMORY
;
}
*
ppEnum
=
(
IEnumMediaTypes
*
)(
&
pEnumMediaTypes
->
lpVtbl
);
return
S_OK
;
}
...
...
@@ -136,12 +148,14 @@ static ULONG WINAPI IEnumMediaTypesImpl_Release(IEnumMediaTypes * iface)
if
(
!
refCount
)
{
int
i
;
for
(
i
=
0
;
i
<
This
->
enumMediaDetails
.
cMediaTypes
;
i
++
)
if
(
This
->
enumMediaDetails
.
pMediaTypes
[
i
].
pbFormat
)
CoTaskMemFree
(
This
->
enumMediaDetails
.
pMediaTypes
[
i
].
pbFormat
);
CoTaskMemFree
(
This
->
enumMediaDetails
.
pMediaTypes
);
CoTaskMemFree
(
This
);
return
0
;
}
else
return
refCount
;
return
refCount
;
}
static
HRESULT
WINAPI
IEnumMediaTypesImpl_Next
(
IEnumMediaTypes
*
iface
,
ULONG
cMediaTypes
,
AM_MEDIA_TYPE
**
ppMediaTypes
,
ULONG
*
pcFetched
)
...
...
@@ -159,7 +173,13 @@ static HRESULT WINAPI IEnumMediaTypesImpl_Next(IEnumMediaTypes * iface, ULONG cM
ULONG
i
;
*
ppMediaTypes
=
CoTaskMemAlloc
(
sizeof
(
AM_MEDIA_TYPE
)
*
cFetched
);
for
(
i
=
0
;
i
<
cFetched
;
i
++
)
(
*
ppMediaTypes
)[
i
]
=
This
->
enumMediaDetails
.
pMediaTypes
[
This
->
uIndex
+
i
];
if
(
FAILED
(
CopyMediaType
(
&
(
*
ppMediaTypes
)[
i
],
&
This
->
enumMediaDetails
.
pMediaTypes
[
This
->
uIndex
+
i
])))
{
while
(
--
i
)
CoTaskMemFree
((
*
ppMediaTypes
)[
i
].
pbFormat
);
CoTaskMemFree
(
*
ppMediaTypes
);
*
ppMediaTypes
=
NULL
;
return
E_OUTOFMEMORY
;
}
}
if
((
cMediaTypes
!=
1
)
||
pcFetched
)
...
...
dlls/quartz/quartz_private.h
View file @
aa4df8f6
...
...
@@ -77,6 +77,7 @@ extern const char * qzdebugstr_guid(const GUID * id);
extern
const
char
*
qzdebugstr_State
(
FILTER_STATE
state
);
HRESULT
CopyMediaType
(
AM_MEDIA_TYPE
*
pDest
,
const
AM_MEDIA_TYPE
*
pSrc
);
void
FreeMediaType
(
AM_MEDIA_TYPE
*
pmt
);
void
DeleteMediaType
(
AM_MEDIA_TYPE
*
pmt
);
BOOL
CompareMediaTypes
(
const
AM_MEDIA_TYPE
*
pmt1
,
const
AM_MEDIA_TYPE
*
pmt2
,
BOOL
bWildcards
);
void
dump_AM_MEDIA_TYPE
(
const
AM_MEDIA_TYPE
*
pmt
);
...
...
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