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
6f8749b7
Commit
6f8749b7
authored
Jul 07, 2008
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rpcrt4: Use interlocked functions to increment/decrement ref counts.
parent
b75828fc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
8 deletions
+9
-8
cpsf.c
dlls/rpcrt4/cpsf.c
+3
-3
ndr_ole.c
dlls/rpcrt4/ndr_ole.c
+6
-5
No files found.
dlls/rpcrt4/cpsf.c
View file @
6f8749b7
...
...
@@ -65,7 +65,7 @@ static HRESULT WINAPI CStdPSFactory_QueryInterface(LPPSFACTORYBUFFER iface,
if
(
IsEqualGUID
(
&
IID_IUnknown
,
riid
)
||
IsEqualGUID
(
&
IID_IPSFactoryBuffer
,
riid
))
{
*
obj
=
This
;
This
->
RefCount
++
;
InterlockedIncrement
(
&
This
->
RefCount
)
;
return
S_OK
;
}
return
E_NOINTERFACE
;
...
...
@@ -75,14 +75,14 @@ static ULONG WINAPI CStdPSFactory_AddRef(LPPSFACTORYBUFFER iface)
{
CStdPSFactoryBuffer
*
This
=
(
CStdPSFactoryBuffer
*
)
iface
;
TRACE
(
"(%p)->AddRef()
\n
"
,
iface
);
return
++
(
This
->
RefCount
);
return
InterlockedIncrement
(
&
This
->
RefCount
);
}
static
ULONG
WINAPI
CStdPSFactory_Release
(
LPPSFACTORYBUFFER
iface
)
{
CStdPSFactoryBuffer
*
This
=
(
CStdPSFactoryBuffer
*
)
iface
;
TRACE
(
"(%p)->Release()
\n
"
,
iface
);
return
--
(
This
->
RefCount
);
return
InterlockedDecrement
(
&
This
->
RefCount
);
}
static
HRESULT
WINAPI
CStdPSFactory_CreateProxy
(
LPPSFACTORYBUFFER
iface
,
...
...
dlls/rpcrt4/ndr_ole.c
View file @
6f8749b7
...
...
@@ -79,7 +79,7 @@ static HMODULE LoadCOM(void)
typedef
struct
RpcStreamImpl
{
const
IStreamVtbl
*
lpVtbl
;
DWORD
RefCount
;
LONG
RefCount
;
PMIDL_STUB_MESSAGE
pMsg
;
LPDWORD
size
;
unsigned
char
*
data
;
...
...
@@ -95,7 +95,7 @@ static HRESULT WINAPI RpcStream_QueryInterface(LPSTREAM iface,
IsEqualGUID
(
&
IID_ISequentialStream
,
riid
)
||
IsEqualGUID
(
&
IID_IStream
,
riid
))
{
*
obj
=
This
;
This
->
RefCount
++
;
InterlockedIncrement
(
&
This
->
RefCount
)
;
return
S_OK
;
}
return
E_NOINTERFACE
;
...
...
@@ -104,19 +104,20 @@ static HRESULT WINAPI RpcStream_QueryInterface(LPSTREAM iface,
static
ULONG
WINAPI
RpcStream_AddRef
(
LPSTREAM
iface
)
{
RpcStreamImpl
*
This
=
(
RpcStreamImpl
*
)
iface
;
return
++
(
This
->
RefCount
);
return
InterlockedIncrement
(
&
This
->
RefCount
);
}
static
ULONG
WINAPI
RpcStream_Release
(
LPSTREAM
iface
)
{
RpcStreamImpl
*
This
=
(
RpcStreamImpl
*
)
iface
;
if
(
!--
(
This
->
RefCount
))
{
ULONG
ref
=
InterlockedDecrement
(
&
This
->
RefCount
);
if
(
!
ref
)
{
TRACE
(
"size=%d
\n
"
,
*
This
->
size
);
This
->
pMsg
->
Buffer
=
This
->
data
+
*
This
->
size
;
HeapFree
(
GetProcessHeap
(),
0
,
This
);
return
0
;
}
return
This
->
RefCount
;
return
ref
;
}
static
HRESULT
WINAPI
RpcStream_Read
(
LPSTREAM
iface
,
...
...
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