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
0669a8ac
Commit
0669a8ac
authored
Oct 22, 2013
by
Daniel Lehman
Committed by
Alexandre Julliard
Oct 24, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Don't use depth in RtlInterlockedFlushSList.
Depth wraps around at 65536 but list supports more elements.
parent
35f0cf26
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
3 deletions
+19
-3
sync.c
dlls/kernel32/tests/sync.c
+17
-1
rtl.c
dlls/ntdll/rtl.c
+2
-2
No files found.
dlls/kernel32/tests/sync.c
View file @
0669a8ac
...
...
@@ -244,8 +244,9 @@ static void test_slist(void)
}
item1
,
item2
,
item3
,
*
pitem
;
SLIST_HEADER
slist_header
;
PSLIST_ENTRY
entry
;
PSLIST_ENTRY
entry
,
next
;
USHORT
size
;
int
i
;
VOID
(
WINAPI
*
pInitializeSListHead
)(
PSLIST_HEADER
);
USHORT
(
WINAPI
*
pQueryDepthSList
)(
PSLIST_HEADER
);
...
...
@@ -323,6 +324,21 @@ static void test_slist(void)
}
ok
(((
struct
item
*
)
entry
)
->
value
==
2
,
"item 2 not in front of list
\n
"
);
ok
(((
struct
item
*
)
entry
->
Next
)
->
value
==
1
,
"item 1 not at the back of list
\n
"
);
for
(
i
=
0
;
i
<
65536
;
i
++
)
{
entry
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
entry
));
pInterlockedPushEntrySList
(
&
slist_header
,
entry
);
}
entry
=
pInterlockedFlushSList
(
&
slist_header
);
ok
(
entry
!=
NULL
,
"not flushed
\n
"
);
while
(
entry
)
{
next
=
entry
->
Next
;
HeapFree
(
GetProcessHeap
(),
0
,
entry
);
entry
=
next
;
}
}
static
void
test_event
(
void
)
...
...
dlls/ntdll/rtl.c
View file @
0669a8ac
...
...
@@ -1080,7 +1080,7 @@ PSLIST_ENTRY WINAPI RtlInterlockedFlushSList(PSLIST_HEADER list)
SLIST_HEADER
old
,
new
;
#ifdef _WIN64
if
(
!
list
->
Header16
.
Depth
)
return
NULL
;
if
(
!
list
->
Header16
.
NextEntry
)
return
NULL
;
new
.
s
.
Alignment
=
new
.
s
.
Region
=
0
;
new
.
Header16
.
HeaderType
=
1
;
/* we use the 16-byte header */
do
...
...
@@ -1090,7 +1090,7 @@ PSLIST_ENTRY WINAPI RtlInterlockedFlushSList(PSLIST_HEADER list)
}
while
(
!
interlocked_cmpxchg128
((
__int64
*
)
list
,
new
.
s
.
Region
,
new
.
s
.
Alignment
,
(
__int64
*
)
&
old
));
return
(
SLIST_ENTRY
*
)((
ULONG_PTR
)
old
.
Header16
.
NextEntry
<<
4
);
#else
if
(
!
list
->
s
.
Depth
)
return
NULL
;
if
(
!
list
->
s
.
Next
.
Next
)
return
NULL
;
new
.
Alignment
=
0
;
do
{
...
...
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