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
c905d691
Commit
c905d691
authored
Jan 14, 2005
by
Paul Vriens
Committed by
Alexandre Julliard
Jan 14, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- use Interlocked* functions in AddRef and Release.
- store the result of the Interlocked functions and use only this.
parent
a010e3b3
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
46 additions
and
33 deletions
+46
-33
acmstream.c
dlls/avifil32/acmstream.c
+3
-2
avifile.c
dlls/avifil32/avifile.c
+14
-12
editstream.c
dlls/avifil32/editstream.c
+9
-6
getframe.c
dlls/avifil32/getframe.c
+5
-3
icmstream.c
dlls/avifil32/icmstream.c
+3
-2
tmpfile.c
dlls/avifil32/tmpfile.c
+8
-5
wavfile.c
dlls/avifil32/wavfile.c
+4
-3
No files found.
dlls/avifil32/acmstream.c
View file @
c905d691
...
...
@@ -147,14 +147,15 @@ static HRESULT WINAPI ACMStream_fnQueryInterface(IAVIStream *iface,
static
ULONG
WINAPI
ACMStream_fnAddRef
(
IAVIStream
*
iface
)
{
IAVIStreamImpl
*
This
=
(
IAVIStreamImpl
*
)
iface
;
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"(%p) -> %ld
\n
"
,
iface
,
This
->
ref
+
1
);
TRACE
(
"(%p) -> %ld
\n
"
,
iface
,
ref
);
/* also add reference to the nested stream */
if
(
This
->
pStream
!=
NULL
)
IAVIStream_AddRef
(
This
->
pStream
);
return
++
(
This
->
ref
)
;
return
ref
;
}
static
ULONG
WINAPI
ACMStream_fnRelease
(
IAVIStream
*
iface
)
...
...
dlls/avifil32/avifile.c
View file @
c905d691
...
...
@@ -282,21 +282,22 @@ static HRESULT WINAPI IAVIFile_fnQueryInterface(IAVIFile *iface, REFIID refiid,
static
ULONG
WINAPI
IAVIFile_fnAddRef
(
IAVIFile
*
iface
)
{
IAVIFileImpl
*
This
=
(
IAVIFileImpl
*
)
iface
;
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"(%p) -> %ld
\n
"
,
iface
,
This
->
ref
+
1
);
return
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"(%p) -> %ld
\n
"
,
iface
,
ref
);
return
ref
;
}
static
ULONG
WINAPI
IAVIFile_fnRelease
(
IAVIFile
*
iface
)
{
IAVIFileImpl
*
This
=
(
IAVIFileImpl
*
)
iface
;
UINT
i
;
ULONG
re
t
;
ULONG
re
f
=
InterlockedDecrement
(
&
This
->
ref
)
;
TRACE
(
"(%p) -> %ld
\n
"
,
iface
,
This
->
ref
-
1
);
TRACE
(
"(%p) -> %ld
\n
"
,
iface
,
ref
);
ret
=
InterlockedDecrement
(
&
This
->
ref
);
if
(
!
ret
)
{
if
(
!
ref
)
{
if
(
This
->
fDirty
)
{
/* need to write headers to file */
AVIFILE_SaveFile
(
This
);
...
...
@@ -337,7 +338,7 @@ static ULONG WINAPI IAVIFile_fnRelease(IAVIFile *iface)
LocalFree
((
HLOCAL
)
This
);
}
return
re
t
;
return
re
f
;
}
static
HRESULT
WINAPI
IAVIFile_fnInfo
(
IAVIFile
*
iface
,
LPAVIFILEINFOW
afi
,
...
...
@@ -737,27 +738,28 @@ static HRESULT WINAPI IAVIStream_fnQueryInterface(IAVIStream *iface,
static
ULONG
WINAPI
IAVIStream_fnAddRef
(
IAVIStream
*
iface
)
{
IAVIStreamImpl
*
This
=
(
IAVIStreamImpl
*
)
iface
;
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"(%p) -> %ld
\n
"
,
iface
,
This
->
ref
+
1
);
TRACE
(
"(%p) -> %ld
\n
"
,
iface
,
ref
);
/* also add ref to parent, so that it doesn't kill us */
if
(
This
->
paf
!=
NULL
)
IAVIFile_AddRef
((
PAVIFILE
)
This
->
paf
);
return
InterlockedIncrement
(
&
This
->
ref
)
;
return
ref
;
}
static
ULONG
WINAPI
IAVIStream_fnRelease
(
IAVIStream
*
iface
)
{
IAVIStreamImpl
*
This
=
(
IAVIStreamImpl
*
)
iface
;
ULONG
re
t
=
InterlockedDecrement
(
&
This
->
ref
);
ULONG
re
f
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p) -> %ld
\n
"
,
iface
,
re
t
);
TRACE
(
"(%p) -> %ld
\n
"
,
iface
,
re
f
);
if
(
This
->
paf
!=
NULL
)
IAVIFile_Release
((
PAVIFILE
)
This
->
paf
);
return
re
t
;
return
re
f
;
}
static
HRESULT
WINAPI
IAVIStream_fnCreate
(
IAVIStream
*
iface
,
LPARAM
lParam1
,
...
...
dlls/avifil32/editstream.c
View file @
c905d691
...
...
@@ -381,20 +381,23 @@ static HRESULT WINAPI IAVIEditStream_fnQueryInterface(IAVIEditStream*iface,REFII
static
ULONG
WINAPI
IAVIEditStream_fnAddRef
(
IAVIEditStream
*
iface
)
{
IAVIEditStreamImpl
*
This
=
(
IAVIEditStreamImpl
*
)
iface
;
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"(%p) -> %ld
\n
"
,
iface
,
This
->
ref
+
1
);
return
++
(
This
->
ref
);
TRACE
(
"(%p) -> %ld
\n
"
,
iface
,
ref
);
return
ref
;
}
static
ULONG
WINAPI
IAVIEditStream_fnRelease
(
IAVIEditStream
*
iface
)
{
IAVIEditStreamImpl
*
This
=
(
IAVIEditStreamImpl
*
)
iface
;
DWORD
i
;
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p) -> %ld
\n
"
,
iface
,
This
->
ref
-
1
);
TRACE
(
"(%p) -> %ld
\n
"
,
iface
,
ref
);
if
(
!
--
(
This
->
ref
)
)
{
/* relea
a
se memory */
if
(
!
ref
)
{
/* release memory */
if
(
This
->
pg
!=
NULL
)
AVIStreamGetFrameClose
(
This
->
pg
);
if
(
This
->
pStreams
!=
NULL
)
{
...
...
@@ -408,7 +411,7 @@ static ULONG WINAPI IAVIEditStream_fnRelease(IAVIEditStream*iface)
LocalFree
((
HLOCAL
)
This
);
return
0
;
}
return
This
->
ref
;
return
ref
;
}
static
HRESULT
WINAPI
IAVIEditStream_fnCut
(
IAVIEditStream
*
iface
,
LONG
*
plStart
,
...
...
dlls/avifil32/getframe.c
View file @
c905d691
...
...
@@ -155,19 +155,21 @@ static HRESULT WINAPI IGetFrame_fnQueryInterface(IGetFrame *iface,
static
ULONG
WINAPI
IGetFrame_fnAddRef
(
IGetFrame
*
iface
)
{
IGetFrameImpl
*
This
=
(
IGetFrameImpl
*
)
iface
;
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"(%p)
\n
"
,
iface
);
return
++
(
This
->
ref
)
;
return
ref
;
}
static
ULONG
WINAPI
IGetFrame_fnRelease
(
IGetFrame
*
iface
)
{
IGetFrameImpl
*
This
=
(
IGetFrameImpl
*
)
iface
;
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p)
\n
"
,
iface
);
if
(
!
--
(
This
->
ref
)
)
{
if
(
!
ref
)
{
AVIFILE_CloseCompressor
(
This
);
if
(
This
->
pStream
!=
NULL
)
{
IAVIStream_Release
(
This
->
pStream
);
...
...
@@ -178,7 +180,7 @@ static ULONG WINAPI IGetFrame_fnRelease(IGetFrame *iface)
return
0
;
}
return
This
->
ref
;
return
ref
;
}
static
LPVOID
WINAPI
IGetFrame_fnGetFrame
(
IGetFrame
*
iface
,
LONG
lPos
)
...
...
dlls/avifil32/icmstream.c
View file @
c905d691
...
...
@@ -163,14 +163,15 @@ static HRESULT WINAPI ICMStream_fnQueryInterface(IAVIStream *iface,
static
ULONG
WINAPI
ICMStream_fnAddRef
(
IAVIStream
*
iface
)
{
IAVIStreamImpl
*
This
=
(
IAVIStreamImpl
*
)
iface
;
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"(%p) -> %ld
\n
"
,
iface
,
This
->
ref
+
1
);
TRACE
(
"(%p) -> %ld
\n
"
,
iface
,
ref
);
/* also add reference to the nested stream */
if
(
This
->
pStream
!=
NULL
)
IAVIStream_AddRef
(
This
->
pStream
);
return
++
(
This
->
ref
)
;
return
ref
;
}
static
ULONG
WINAPI
ICMStream_fnRelease
(
IAVIStream
*
iface
)
...
...
dlls/avifil32/tmpfile.c
View file @
c905d691
...
...
@@ -152,18 +152,21 @@ static HRESULT WINAPI ITmpFile_fnQueryInterface(IAVIFile *iface, REFIID refiid,
static
ULONG
WINAPI
ITmpFile_fnAddRef
(
IAVIFile
*
iface
)
{
ITmpFileImpl
*
This
=
(
ITmpFileImpl
*
)
iface
;
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"(%p) -> %ld
\n
"
,
iface
,
This
->
ref
+
1
);
return
++
(
This
->
ref
);
TRACE
(
"(%p) -> %ld
\n
"
,
iface
,
ref
);
return
ref
;
}
static
ULONG
WINAPI
ITmpFile_fnRelease
(
IAVIFile
*
iface
)
{
ITmpFileImpl
*
This
=
(
ITmpFileImpl
*
)
iface
;
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p) -> %ld
\n
"
,
iface
,
This
->
ref
-
1
);
TRACE
(
"(%p) -> %ld
\n
"
,
iface
,
ref
);
if
(
!
--
(
This
->
ref
)
)
{
if
(
!
ref
)
{
unsigned
int
i
;
for
(
i
=
0
;
i
<
This
->
fInfo
.
dwStreams
;
i
++
)
{
...
...
@@ -178,7 +181,7 @@ static ULONG WINAPI ITmpFile_fnRelease(IAVIFile *iface)
return
0
;
}
return
This
->
ref
;
return
ref
;
}
static
HRESULT
WINAPI
ITmpFile_fnInfo
(
IAVIFile
*
iface
,
...
...
dlls/avifil32/wavfile.c
View file @
c905d691
...
...
@@ -272,16 +272,17 @@ static ULONG WINAPI IAVIFile_fnAddRef(IAVIFile *iface)
TRACE
(
"(%p)
\n
"
,
iface
);
return
++
(
This
->
ref
);
return
InterlockedIncrement
(
&
This
->
ref
);
}
static
ULONG
WINAPI
IAVIFile_fnRelease
(
IAVIFile
*
iface
)
{
IAVIFileImpl
*
This
=
(
IAVIFileImpl
*
)
iface
;
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p)
\n
"
,
iface
);
if
(
!
--
(
This
->
ref
)
)
{
if
(
!
ref
)
{
if
(
This
->
fDirty
)
{
/* need to write headers to file */
AVIFILE_SaveFile
(
This
);
...
...
@@ -309,7 +310,7 @@ static ULONG WINAPI IAVIFile_fnRelease(IAVIFile *iface)
LocalFree
((
HLOCAL
)
This
);
return
0
;
}
return
This
->
ref
;
return
ref
;
}
static
HRESULT
WINAPI
IAVIFile_fnInfo
(
IAVIFile
*
iface
,
LPAVIFILEINFOW
afi
,
...
...
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