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
76238898
Commit
76238898
authored
Jan 27, 2020
by
Zebediah Figura
Committed by
Alexandre Julliard
Jan 28, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rpcrt4: Use a critical section for the context handle lock.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
1d0cca46
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
+8
-7
rpc_assoc.c
dlls/rpcrt4/rpc_assoc.c
+8
-7
No files found.
dlls/rpcrt4/rpc_assoc.c
View file @
76238898
...
...
@@ -24,7 +24,6 @@
#include "rpc.h"
#include "rpcndr.h"
#include "winternl.h"
#include "wine/debug.h"
...
...
@@ -55,7 +54,7 @@ typedef struct _RpcContextHandle
NDR_RUNDOWN
rundown_routine
;
void
*
ctx_guard
;
UUID
uuid
;
RTL_RWLOCK
rw_
lock
;
CRITICAL_SECTION
lock
;
unsigned
int
refs
;
}
RpcContextHandle
;
...
...
@@ -463,12 +462,13 @@ RPC_STATUS RpcServerAssoc_AllocateContextHandle(RpcAssoc *assoc, void *CtxGuard,
return
RPC_S_OUT_OF_MEMORY
;
context_handle
->
ctx_guard
=
CtxGuard
;
RtlInitializeResource
(
&
context_handle
->
rw_lock
);
InitializeCriticalSection
(
&
context_handle
->
lock
);
context_handle
->
lock
.
DebugInfo
->
Spare
[
0
]
=
(
DWORD_PTR
)(
__FILE__
": RpcContextHandle.lock"
);
context_handle
->
refs
=
1
;
/* lock here to mirror unmarshall, so we don't need to special-case the
* freeing of a non-marshalled context handle */
RtlAcquireResourceExclusive
(
&
context_handle
->
rw_lock
,
TRUE
);
EnterCriticalSection
(
&
context_handle
->
lock
);
EnterCriticalSection
(
&
assoc
->
cs
);
list_add_tail
(
&
assoc
->
context_handle_list
,
&
context_handle
->
entry
);
...
...
@@ -500,7 +500,7 @@ RPC_STATUS RpcServerAssoc_FindContextHandle(RpcAssoc *assoc, const UUID *uuid,
{
LeaveCriticalSection
(
&
assoc
->
cs
);
TRACE
(
"found %p
\n
"
,
context_handle
);
RtlAcquireResourceExclusive
(
&
context_handle
->
rw_lock
,
TRUE
);
EnterCriticalSection
(
&
context_handle
->
lock
);
return
RPC_S_OK
;
}
}
...
...
@@ -555,7 +555,8 @@ static void RpcContextHandle_Destroy(RpcContextHandle *context_handle)
context_handle
->
rundown_routine
(
context_handle
->
user_context
);
}
RtlDeleteResource
(
&
context_handle
->
rw_lock
);
context_handle
->
lock
.
DebugInfo
->
Spare
[
0
]
=
0
;
DeleteCriticalSection
(
&
context_handle
->
lock
);
HeapFree
(
GetProcessHeap
(),
0
,
context_handle
);
}
...
...
@@ -566,7 +567,7 @@ unsigned int RpcServerAssoc_ReleaseContextHandle(RpcAssoc *assoc, NDR_SCONTEXT S
unsigned
int
refs
;
if
(
release_lock
)
RtlReleaseResource
(
&
context_handle
->
rw_
lock
);
LeaveCriticalSection
(
&
context_handle
->
lock
);
EnterCriticalSection
(
&
assoc
->
cs
);
refs
=
--
context_handle
->
refs
;
...
...
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