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
14c6d8c7
Commit
14c6d8c7
authored
Jan 29, 2019
by
Zebediah Figura
Committed by
Alexandre Julliard
Jan 30, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntoskrnl.exe: Avoid accessing fields of sync objects outside of the sync CS.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
ec5edb4f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
sync.c
dlls/ntoskrnl.exe/sync.c
+10
-10
No files found.
dlls/ntoskrnl.exe/sync.c
View file @
14c6d8c7
...
...
@@ -191,14 +191,14 @@ void WINAPI KeInitializeEvent( PRKEVENT event, EVENT_TYPE type, BOOLEAN state )
*/
LONG
WINAPI
KeSetEvent
(
PRKEVENT
event
,
KPRIORITY
increment
,
BOOLEAN
wait
)
{
HANDLE
handle
=
event
->
Header
.
WaitListHead
.
Blink
;
HANDLE
handle
;
LONG
ret
;
TRACE
(
"event %p, increment %d, wait %u.
\n
"
,
event
,
increment
,
wait
);
EnterCriticalSection
(
&
sync_cs
);
ret
=
InterlockedExchange
(
&
event
->
Header
.
SignalState
,
TRUE
);
if
(
handle
)
if
(
(
handle
=
event
->
Header
.
WaitListHead
.
Blink
)
)
SetEvent
(
handle
);
LeaveCriticalSection
(
&
sync_cs
);
...
...
@@ -210,14 +210,14 @@ LONG WINAPI KeSetEvent( PRKEVENT event, KPRIORITY increment, BOOLEAN wait )
*/
LONG
WINAPI
KeResetEvent
(
PRKEVENT
event
)
{
HANDLE
handle
=
event
->
Header
.
WaitListHead
.
Blink
;
HANDLE
handle
;
LONG
ret
;
TRACE
(
"event %p.
\n
"
,
event
);
EnterCriticalSection
(
&
sync_cs
);
ret
=
InterlockedExchange
(
&
event
->
Header
.
SignalState
,
FALSE
);
if
(
handle
)
if
(
(
handle
=
event
->
Header
.
WaitListHead
.
Blink
)
)
ResetEvent
(
handle
);
LeaveCriticalSection
(
&
sync_cs
);
...
...
@@ -252,7 +252,7 @@ void WINAPI KeInitializeSemaphore( PRKSEMAPHORE semaphore, LONG count, LONG limi
LONG
WINAPI
KeReleaseSemaphore
(
PRKSEMAPHORE
semaphore
,
KPRIORITY
increment
,
LONG
count
,
BOOLEAN
wait
)
{
HANDLE
handle
=
semaphore
->
Header
.
WaitListHead
.
Blink
;
HANDLE
handle
;
LONG
ret
;
TRACE
(
"semaphore %p, increment %d, count %d, wait %u.
\n
"
,
...
...
@@ -260,7 +260,7 @@ LONG WINAPI KeReleaseSemaphore( PRKSEMAPHORE semaphore, KPRIORITY increment,
EnterCriticalSection
(
&
sync_cs
);
ret
=
InterlockedExchangeAdd
(
&
semaphore
->
Header
.
SignalState
,
count
);
if
(
handle
)
if
(
(
handle
=
semaphore
->
Header
.
WaitListHead
.
Blink
)
)
ReleaseSemaphore
(
handle
,
count
,
NULL
);
LeaveCriticalSection
(
&
sync_cs
);
...
...
@@ -285,7 +285,6 @@ void WINAPI KeInitializeMutex( PRKMUTEX mutex, ULONG level )
*/
LONG
WINAPI
KeReleaseMutex
(
PRKMUTEX
mutex
,
BOOLEAN
wait
)
{
HANDLE
handle
=
mutex
->
Header
.
WaitListHead
.
Blink
;
LONG
ret
;
TRACE
(
"mutex %p, wait %u.
\n
"
,
mutex
,
wait
);
...
...
@@ -294,7 +293,7 @@ LONG WINAPI KeReleaseMutex( PRKMUTEX mutex, BOOLEAN wait )
ret
=
mutex
->
Header
.
SignalState
++
;
if
(
!
ret
&&
!
mutex
->
Header
.
WaitListHead
.
Flink
)
{
CloseHandle
(
handle
);
CloseHandle
(
mutex
->
Header
.
WaitListHead
.
Blink
);
mutex
->
Header
.
WaitListHead
.
Blink
=
NULL
;
}
LeaveCriticalSection
(
&
sync_cs
);
...
...
@@ -330,7 +329,6 @@ void WINAPI KeInitializeTimer( KTIMER *timer )
*/
BOOLEAN
WINAPI
KeSetTimerEx
(
KTIMER
*
timer
,
LARGE_INTEGER
duetime
,
LONG
period
,
KDPC
*
dpc
)
{
BOOL
manual
=
timer
->
Header
.
Type
==
TYPE_MANUAL_TIMER
;
BOOL
ret
;
TRACE
(
"timer %p, duetime %s, period %d, dpc %p.
\n
"
,
...
...
@@ -343,10 +341,12 @@ BOOLEAN WINAPI KeSetTimerEx( KTIMER *timer, LARGE_INTEGER duetime, LONG period,
}
EnterCriticalSection
(
&
sync_cs
);
ret
=
timer
->
Header
.
Inserted
;
timer
->
Header
.
Inserted
=
TRUE
;
timer
->
Header
.
WaitListHead
.
Blink
=
CreateWaitableTimerW
(
NULL
,
manual
,
NULL
);
timer
->
Header
.
WaitListHead
.
Blink
=
CreateWaitableTimerW
(
NULL
,
timer
->
Header
.
Type
==
TYPE_MANUAL_TIMER
,
NULL
);
SetWaitableTimer
(
timer
->
Header
.
WaitListHead
.
Blink
,
&
duetime
,
period
,
NULL
,
NULL
,
FALSE
);
LeaveCriticalSection
(
&
sync_cs
);
return
ret
;
...
...
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