https://git.reactos.org/?p=reactos.git;a=commitdiff;h=ba8f75557a062e09d5687…
commit ba8f75557a062e09d5687376f2b2947234653a8a
Author: Thomas Faber <thomas.faber(a)reactos.org>
AuthorDate: Fri Oct 27 12:32:26 2017 +0200
    [SHELL32][REGEDIT][MSCONFIG_NEW] Correctly check for presence of list view sort
header.
---
 base/applications/msconfig_new/comctl32ex/listview.c | 2 +-
 base/applications/regedit/listview.c                 | 2 +-
 dll/win32/shell32/CDefView.cpp                       | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/base/applications/msconfig_new/comctl32ex/listview.c
b/base/applications/msconfig_new/comctl32ex/listview.c
index 0eab585b3d..9e5f533998 100644
--- a/base/applications/msconfig_new/comctl32ex/listview.c
+++ b/base/applications/msconfig_new/comctl32ex/listview.c
@@ -49,7 +49,7 @@ ListView_SortEx(HWND hListView,
     BOOL bSortAsc;
     Sort sort;
-    if ((GetWindowLongPtr(hListView, GWL_STYLE) & ~LVS_NOSORTHEADER) == 0)
+    if (GetWindowLongPtr(hListView, GWL_STYLE) & LVS_NOSORTHEADER)
         return TRUE;
     hHeader = ListView_GetHeader(hListView);
diff --git a/base/applications/regedit/listview.c b/base/applications/regedit/listview.c
index 4d99cd7814..687fb2234b 100644
--- a/base/applications/regedit/listview.c
+++ b/base/applications/regedit/listview.c
@@ -478,7 +478,7 @@ static int CALLBACK CompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM
lParamSor
 static BOOL ListView_Sort(HWND hListView, int iSortingColumn, int iSortedColumn)
 {
-    if ( (GetWindowLongPtr(hListView, GWL_STYLE) & ~LVS_NOSORTHEADER) &&
+    if (!(GetWindowLongPtr(hListView, GWL_STYLE) & LVS_NOSORTHEADER) &&
          (iSortingColumn >= 0) )
     {
         BOOL bSortAscending;
diff --git a/dll/win32/shell32/CDefView.cpp b/dll/win32/shell32/CDefView.cpp
index f846cc1fd4..1492724e55 100644
--- a/dll/win32/shell32/CDefView.cpp
+++ b/dll/win32/shell32/CDefView.cpp
@@ -698,7 +698,7 @@ BOOL CDefView::_Sort()
     HWND hHeader;
     HDITEM hColumn;
-    if ((m_ListView.GetWindowLongPtr(GWL_STYLE) & ~LVS_NOSORTHEADER) == 0)
+    if (m_ListView.GetWindowLongPtr(GWL_STYLE) & LVS_NOSORTHEADER)
         return TRUE;
     hHeader = (HWND)m_ListView.SendMessage(LVM_GETHEADER, 0, 0);