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
eb0e82a7
Commit
eb0e82a7
authored
Oct 08, 2010
by
Krzysztof Nowicki
Committed by
Alexandre Julliard
Oct 12, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Fix possible deadlock in vectored exception handling.
parent
12c964be
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
13 deletions
+18
-13
exception.c
dlls/ntdll/exception.c
+16
-13
ntdll_misc.h
dlls/ntdll/ntdll_misc.h
+1
-0
thread.c
dlls/ntdll/thread.c
+1
-0
No files found.
dlls/ntdll/exception.c
View file @
eb0e82a7
...
...
@@ -48,14 +48,17 @@ typedef struct
static
struct
list
vectored_handlers
=
LIST_INIT
(
vectored_handlers
);
static
RTL_CRITICAL_SECTION
vectored_handlers_section
;
static
RTL_CRITICAL_SECTION_DEBUG
critsect_debug
=
static
RTL_RWLOCK
vectored_handlers_lock
;
/**********************************************************************
* exceptions_init
*
* Initialize read/write lock used by the vectored exception handling.
*/
void
exceptions_init
(
void
)
{
0
,
0
,
&
vectored_handlers_section
,
{
&
critsect_debug
.
ProcessLocksList
,
&
critsect_debug
.
ProcessLocksList
},
0
,
0
,
{
(
DWORD_PTR
)(
__FILE__
": vectored_handlers_section"
)
}
};
static
RTL_CRITICAL_SECTION
vectored_handlers_section
=
{
&
critsect_debug
,
-
1
,
0
,
0
,
0
,
0
};
RtlInitializeResource
(
&
vectored_handlers_lock
);
}
/**********************************************************************
* wait_suspend
...
...
@@ -162,7 +165,7 @@ LONG call_vectored_handlers( EXCEPTION_RECORD *rec, CONTEXT *context )
except_ptrs
.
ExceptionRecord
=
rec
;
except_ptrs
.
ContextRecord
=
context
;
Rtl
EnterCriticalSection
(
&
vectored_handlers_section
);
Rtl
AcquireResourceShared
(
&
vectored_handlers_lock
,
TRUE
);
LIST_FOR_EACH
(
ptr
,
&
vectored_handlers
)
{
VECTORED_HANDLER
*
handler
=
LIST_ENTRY
(
ptr
,
VECTORED_HANDLER
,
entry
);
...
...
@@ -172,7 +175,7 @@ LONG call_vectored_handlers( EXCEPTION_RECORD *rec, CONTEXT *context )
TRACE
(
"handler at %p returned %x
\n
"
,
handler
->
func
,
ret
);
if
(
ret
==
EXCEPTION_CONTINUE_EXECUTION
)
break
;
}
Rtl
LeaveCriticalSection
(
&
vectored_handlers_section
);
Rtl
ReleaseResource
(
&
vectored_handlers_lock
);
return
ret
;
}
...
...
@@ -214,10 +217,10 @@ PVOID WINAPI RtlAddVectoredExceptionHandler( ULONG first, PVECTORED_EXCEPTION_HA
if
(
handler
)
{
handler
->
func
=
func
;
Rtl
EnterCriticalSection
(
&
vectored_handlers_section
);
Rtl
AcquireResourceExclusive
(
&
vectored_handlers_lock
,
TRUE
);
if
(
first
)
list_add_head
(
&
vectored_handlers
,
&
handler
->
entry
);
else
list_add_tail
(
&
vectored_handlers
,
&
handler
->
entry
);
Rtl
LeaveCriticalSection
(
&
vectored_handlers_section
);
Rtl
ReleaseResource
(
&
vectored_handlers_lock
);
}
return
handler
;
}
...
...
@@ -231,7 +234,7 @@ ULONG WINAPI RtlRemoveVectoredExceptionHandler( PVOID handler )
struct
list
*
ptr
;
ULONG
ret
=
FALSE
;
Rtl
EnterCriticalSection
(
&
vectored_handlers_section
);
Rtl
AcquireResourceExclusive
(
&
vectored_handlers_lock
,
TRUE
);
LIST_FOR_EACH
(
ptr
,
&
vectored_handlers
)
{
VECTORED_HANDLER
*
curr_handler
=
LIST_ENTRY
(
ptr
,
VECTORED_HANDLER
,
entry
);
...
...
@@ -242,7 +245,7 @@ ULONG WINAPI RtlRemoveVectoredExceptionHandler( PVOID handler )
break
;
}
}
Rtl
LeaveCriticalSection
(
&
vectored_handlers_section
);
Rtl
ReleaseResource
(
&
vectored_handlers_lock
);
if
(
ret
)
RtlFreeHeap
(
GetProcessHeap
(),
0
,
handler
);
return
ret
;
}
...
...
dlls/ntdll/ntdll_misc.h
View file @
eb0e82a7
...
...
@@ -71,6 +71,7 @@ extern void virtual_init(void);
extern
void
virtual_init_threading
(
void
);
extern
void
fill_cpu_info
(
void
);
extern
void
heap_set_debug_flags
(
HANDLE
handle
);
extern
void
exceptions_init
(
void
);
/* server support */
extern
timeout_t
server_start_time
;
...
...
dlls/ntdll/thread.c
View file @
eb0e82a7
...
...
@@ -296,6 +296,7 @@ HANDLE thread_init(void)
user_shared_data
->
TickCountMultiplier
=
1
<<
24
;
fill_cpu_info
();
exceptions_init
();
return
exe_file
;
}
...
...
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