Daniel Lehman : kernel32: Don't use depth in RtlInterlockedFlushSList.

Alexandre Julliard julliard at winehq.org
Fri Jan 10 14:44:53 CST 2014


Module: wine
Branch: stable
Commit: cae03c156dd654beb13aaa0535c84e7cb78a7dfc
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=cae03c156dd654beb13aaa0535c84e7cb78a7dfc

Author: Daniel Lehman <dlehman at esri.com>
Date:   Tue Oct 22 22:47:26 2013 -0700

kernel32: Don't use depth in RtlInterlockedFlushSList.

Depth wraps around at 65536 but list supports more elements.
(cherry picked from commit 0669a8aca2dec4eaf6632e368832a8aec1c48ffd)

---

 dlls/ntdll/rtl.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/dlls/ntdll/rtl.c b/dlls/ntdll/rtl.c
index bbcd454..0bad4a0 100644
--- a/dlls/ntdll/rtl.c
+++ b/dlls/ntdll/rtl.c
@@ -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
     {




More information about the wine-cvs mailing list