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
1fad8729
Commit
1fad8729
authored
Apr 28, 2008
by
Maarten Lankhorst
Committed by
Alexandre Julliard
Apr 29, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
quartz: Fix bug in memallocator with test.
parent
928914c8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
10 deletions
+30
-10
memallocator.c
dlls/quartz/memallocator.c
+3
-3
memallocator.c
dlls/quartz/tests/memallocator.c
+27
-7
No files found.
dlls/quartz/memallocator.c
View file @
1fad8729
...
...
@@ -237,13 +237,13 @@ static HRESULT WINAPI BaseMemAllocator_Commit(IMemAllocator * iface)
{
if
(
!
This
->
pProps
)
hr
=
VFW_E_SIZENOTSET
;
else
if
(
This
->
bCommitted
)
hr
=
S_OK
;
else
if
(
This
->
bDecommitQueued
)
else
if
(
This
->
bDecommitQueued
&&
This
->
bCommitted
)
{
This
->
bDecommitQueued
=
FALSE
;
hr
=
S_OK
;
}
else
if
(
This
->
bCommitted
)
hr
=
S_OK
;
else
{
if
(
!
(
This
->
hSemWaiting
=
CreateSemaphoreW
(
NULL
,
This
->
pProps
->
cBuffers
,
This
->
pProps
->
cBuffers
,
NULL
)))
...
...
dlls/quartz/tests/memallocator.c
View file @
1fad8729
...
...
@@ -37,13 +37,15 @@ static void CommitDecommitTest(void)
if
(
hr
==
S_OK
)
{
ALLOCATOR_PROPERTIES
RequestedProps
;
ALLOCATOR_PROPERTIES
ActualProps
;
ALLOCATOR_PROPERTIES
RequestedProps
;
ALLOCATOR_PROPERTIES
ActualProps
;
RequestedProps
.
cBuffers
=
1
;
RequestedProps
.
cbBuffer
=
65536
;
RequestedProps
.
cbAlign
=
1
;
RequestedProps
.
cbPrefix
=
0
;
IMediaSample
*
sample
=
NULL
,
*
sample2
=
NULL
;
RequestedProps
.
cBuffers
=
2
;
RequestedProps
.
cbBuffer
=
65536
;
RequestedProps
.
cbAlign
=
1
;
RequestedProps
.
cbPrefix
=
0
;
hr
=
IMemAllocator_SetProperties
(
pMemAllocator
,
&
RequestedProps
,
&
ActualProps
);
ok
(
hr
==
S_OK
,
"SetProperties returned: %x
\n
"
,
hr
);
...
...
@@ -53,12 +55,30 @@ static void CommitDecommitTest(void)
hr
=
IMemAllocator_Commit
(
pMemAllocator
);
ok
(
hr
==
S_OK
,
"Commit returned: %x
\n
"
,
hr
);
hr
=
IMemAllocator_GetBuffer
(
pMemAllocator
,
&
sample
,
NULL
,
NULL
,
0
);
ok
(
hr
==
S_OK
,
"Could not get a buffer: %x
\n
"
,
hr
);
hr
=
IMemAllocator_Decommit
(
pMemAllocator
);
ok
(
hr
==
S_OK
,
"Decommit returned: %x
\n
"
,
hr
);
hr
=
IMemAllocator_Decommit
(
pMemAllocator
);
ok
(
hr
==
S_OK
,
"Cecommit returned: %x
\n
"
,
hr
);
IMemAllocator_Release
(
pMemAllocator
);
/* Decommit and recommit while holding a sample */
if
(
sample
)
{
hr
=
IMemAllocator_Commit
(
pMemAllocator
);
ok
(
hr
==
S_OK
,
"Commit returned: %x
\n
"
,
hr
);
hr
=
IMemAllocator_GetBuffer
(
pMemAllocator
,
&
sample2
,
NULL
,
NULL
,
0
);
ok
(
hr
==
S_OK
,
"Could not get a buffer: %x
\n
"
,
hr
);
IUnknown_Release
(
sample
);
if
(
sample2
)
IUnknown_Release
(
sample2
);
hr
=
IMemAllocator_Decommit
(
pMemAllocator
);
ok
(
hr
==
S_OK
,
"Cecommit returned: %x
\n
"
,
hr
);
}
IMemAllocator_Release
(
pMemAllocator
);
}
}
...
...
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