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
a1e304a2
Commit
a1e304a2
authored
Jan 12, 2005
by
James Hawkins
Committed by
Alexandre Julliard
Jan 12, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- use only stored result of Interlocked* in AddRef/Release
- expand TRACEs to display the ref count
parent
fea45b14
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
20 deletions
+28
-20
assoc.c
dlls/shlwapi/assoc.c
+9
-7
istream.c
dlls/shlwapi/istream.c
+10
-7
regstream.c
dlls/shlwapi/regstream.c
+9
-6
No files found.
dlls/shlwapi/assoc.c
View file @
a1e304a2
...
...
@@ -467,10 +467,11 @@ static HRESULT WINAPI IQueryAssociations_fnQueryInterface(
static
ULONG
WINAPI
IQueryAssociations_fnAddRef
(
IQueryAssociations
*
iface
)
{
IQueryAssociationsImpl
*
This
=
(
IQueryAssociationsImpl
*
)
iface
;
ULONG
refCount
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"(%p)->(ref before=%lu)
\n
"
,
This
,
refCount
-
1
);
TRACE
(
"(%p)->(ref before=%lu)
\n
"
,
This
,
This
->
ref
);
return
InterlockedIncrement
(
&
This
->
ref
);
return
refCount
;
}
/**************************************************************************
...
...
@@ -481,16 +482,17 @@ static ULONG WINAPI IQueryAssociations_fnAddRef(IQueryAssociations *iface)
static
ULONG
WINAPI
IQueryAssociations_fnRelease
(
IQueryAssociations
*
iface
)
{
IQueryAssociationsImpl
*
This
=
(
IQueryAssociationsImpl
*
)
iface
;
ULONG
ulRet
;
ULONG
refCount
=
InterlockedDecrement
(
&
This
->
ref
)
;
TRACE
(
"(%p)->(ref before=%lu)
\n
"
,
This
,
This
->
ref
);
TRACE
(
"(%p)->(ref before=%lu)
\n
"
,
This
,
refCount
+
1
);
if
(
!
(
ulRet
=
InterlockedDecrement
(
&
This
->
ref
))
)
if
(
!
refCount
)
{
TRACE
(
"Destroying IQueryAssociations (%p)
\n
"
,
This
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
return
ulRet
;
return
refCount
;
}
/**************************************************************************
...
...
dlls/shlwapi/istream.c
View file @
a1e304a2
...
...
@@ -78,9 +78,11 @@ static HRESULT WINAPI IStream_fnQueryInterface(IStream *iface, REFIID riid, LPVO
static
ULONG
WINAPI
IStream_fnAddRef
(
IStream
*
iface
)
{
ISHFileStream
*
This
=
(
ISHFileStream
*
)
iface
;
ULONG
refCount
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"(%p)->(ref before=%lu)
\n
"
,
This
,
refCount
-
1
);
TRACE
(
"(%p)
\n
"
,
This
);
return
InterlockedIncrement
(
&
This
->
ref
);
return
refCount
;
}
/**************************************************************************
...
...
@@ -89,18 +91,19 @@ static ULONG WINAPI IStream_fnAddRef(IStream *iface)
static
ULONG
WINAPI
IStream_fnRelease
(
IStream
*
iface
)
{
ISHFileStream
*
This
=
(
ISHFileStream
*
)
iface
;
ULONG
ulRet
;
TRACE
(
"(%p)
\n
"
,
This
);
ULONG
refCount
=
InterlockedDecrement
(
&
This
->
ref
);
if
(
!
(
ulRet
=
InterlockedDecrement
(
&
This
->
ref
)))
TRACE
(
"(%p)->(ref before=%lu)
\n
"
,
This
,
refCount
+
1
);
if
(
!
refCount
)
{
IStream_fnCommit
(
iface
,
0
);
/* If ever buffered, this will be needed */
LocalFree
((
HLOCAL
)
This
->
lpszPath
);
CloseHandle
(
This
->
hFile
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
return
ulRet
;
return
refCount
;
}
/**************************************************************************
...
...
dlls/shlwapi/regstream.c
View file @
a1e304a2
...
...
@@ -75,10 +75,11 @@ static HRESULT WINAPI IStream_fnQueryInterface(IStream *iface, REFIID riid, LPVO
static
ULONG
WINAPI
IStream_fnAddRef
(
IStream
*
iface
)
{
ISHRegStream
*
This
=
(
ISHRegStream
*
)
iface
;
ULONG
refCount
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"(%p)->(ref before=%lu)
\n
"
,
This
,
refCount
-
1
);
TRACE
(
"(%p)->(count=%lu)
\n
"
,
This
,
This
->
ref
);
return
InterlockedIncrement
(
&
This
->
ref
);
return
refCount
;
}
/**************************************************************************
...
...
@@ -87,10 +88,11 @@ static ULONG WINAPI IStream_fnAddRef(IStream *iface)
static
ULONG
WINAPI
IStream_fnRelease
(
IStream
*
iface
)
{
ISHRegStream
*
This
=
(
ISHRegStream
*
)
iface
;
ULONG
refCount
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p)->(
)
\n
"
,
This
);
TRACE
(
"(%p)->(
ref before=%lu)
\n
"
,
This
,
refCount
+
1
);
if
(
!
InterlockedDecrement
(
&
This
->
ref
)
)
if
(
!
refCount
)
{
TRACE
(
" destroying SHReg IStream (%p)
\n
"
,
This
);
...
...
@@ -102,7 +104,8 @@ static ULONG WINAPI IStream_fnRelease(IStream *iface)
HeapFree
(
GetProcessHeap
(),
0
,
This
);
return
0
;
}
return
This
->
ref
;
return
refCount
;
}
/**************************************************************************
...
...
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