Author: akhaldi
Date: Sun Mar  5 20:52:24 2017
New Revision: 74090

URL: http://svn.reactos.org/svn/reactos?rev=74090&view=rev
Log:
[COMCTL32] Sync with Wine Staging 2.2. CORE-12823

cc055c4 comctl32: Add support for PSPCB_ADDREF/PSPCB_RELEASE callback 
notifications. (v2)
83cde06 comctl32/propsheet: Implement PSM_SETHEADERSUBTITLE.
ce9c06b comctl32/propsheet: Implement PSM_SETHEADERTITLE.
1a750f7 comctl32/propsheet: Add helpers to do string duplication.
14a6c98 comctl32/pager: Don't block window size changes.
a6661ba comctl32/propsheet: Added PSM_INSERTPAGE implementation.
34dd326 comctl32/propsheet: Only use header bitmap when asked for it.
6eafebe comctl32/propsheet: Force wizard header if any of pages has 
title/subtitle.
70c9a96 comctl32: Fix some more spec file entries.
2dd0fb8 comctl32: Correctly set the colour table for ILC_COLOR4 and ILC_COLOR8 
imagelists.
a0e73a1 comctl32/syslink: Don't use exported StrCmpNIW().
970029b comctl32/toolbar: Fix TB_SETDRAWTEXTFLAGS handler.
99913e8 comctl32: Fix some spec file entries.
9d404dd comctl32/propsheet: Double size of a template buffer passed to 
PSCB_PRECREATE.
bb1d68e comctl32/trackbar: Fix TBM_SETRANGEMAX handling when new limit is less 
than current min boundary.
26067cc comctl32/toolbar: Protect from NULL pointer access in TB_GETBUTTONINFOW 
handler.
a6aabe0 comctl32/trackbar: Update thumb unconditionally on TBM_SETTICFREQ.
c7c8994 comctl32: Recompute the text width if necessary.
3ed6ba5 comctl32: Set the text and bkgnd colours to the default before the item 
pre-paint notification.
8915404 comctl32: Use wine_dbgstr_point in TRACES.

Modified:
    trunk/reactos/dll/win32/comctl32/comctl32.spec
    trunk/reactos/dll/win32/comctl32/datetime.c
    trunk/reactos/dll/win32/comctl32/imagelist.c
    trunk/reactos/dll/win32/comctl32/monthcal.c
    trunk/reactos/dll/win32/comctl32/pager.c
    trunk/reactos/dll/win32/comctl32/propsheet.c
    trunk/reactos/dll/win32/comctl32/rebar.c
    trunk/reactos/dll/win32/comctl32/syslink.c
    trunk/reactos/dll/win32/comctl32/toolbar.c
    trunk/reactos/dll/win32/comctl32/tooltips.c
    trunk/reactos/dll/win32/comctl32/trackbar.c
    trunk/reactos/dll/win32/comctl32/treeview.c
    trunk/reactos/media/doc/README.WINE

Modified: trunk/reactos/dll/win32/comctl32/comctl32.spec
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/comctl32.spec?rev=74090&r1=74089&r2=74090&view=diff
==============================================================================
--- trunk/reactos/dll/win32/comctl32/comctl32.spec      [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/comctl32/comctl32.spec      [iso-8859-1] Sun Mar  5 
20:52:24 2017
@@ -1,12 +1,12 @@
 2 stdcall MenuHelp(long long long long long long ptr)
 3 stdcall ShowHideMenuCtl(long long ptr)
-4 stdcall GetEffectiveClientRect(long long long)
+4 stdcall GetEffectiveClientRect(long ptr ptr)
 5 stdcall DrawStatusTextA(long ptr str long)
 6 stdcall CreateStatusWindowA(long str long long)
 7 stdcall CreateToolbar(long long long long long long ptr long)
 8 stdcall CreateMappedBitmap(long long long ptr long)
-9 stdcall -noname DPA_LoadStream(ptr ptr ptr long)
-10 stdcall -noname DPA_SaveStream(ptr ptr ptr long)
+9 stdcall -noname DPA_LoadStream(ptr ptr ptr ptr)
+10 stdcall -noname DPA_SaveStream(ptr ptr ptr ptr)
 11 stdcall -noname DPA_Merge(ptr ptr long ptr ptr long)
 12 stdcall CreatePropertySheetPage(ptr) CreatePropertySheetPageA
 13 stdcall MakeDragList(long)
@@ -105,10 +105,10 @@
 236 stdcall -ordinal Str_SetPtrW(wstr wstr)
 320 stdcall -ordinal DSA_Create(long long)
 321 stdcall -ordinal DSA_Destroy(ptr)
-322 stdcall -noname DSA_GetItem(ptr long long)
+322 stdcall -noname DSA_GetItem(ptr long ptr)
 323 stdcall -ordinal DSA_GetItemPtr(ptr long)
-324 stdcall -ordinal DSA_InsertItem(ptr long long)
-325 stdcall -noname DSA_SetItem (ptr long long)
+324 stdcall -ordinal DSA_InsertItem(ptr long ptr)
+325 stdcall -noname DSA_SetItem (ptr long ptr)
 326 stdcall -noname DSA_DeleteItem(ptr long)
 327 stdcall -ordinal DSA_DeleteAllItems(ptr)
 328 stdcall -ordinal DPA_Create(long)
@@ -126,7 +126,7 @@
 340 stdcall -noname DPA_CreateEx(long long)
 341 stdcall -noname SendNotify(long long long ptr)
 342 stdcall -noname SendNotifyEx(long long long ptr long)
-350 stdcall -noname -private StrChrA(str str)
+350 stdcall -noname -private StrChrA(str long)
 351 stdcall -noname -private StrRChrA(str str long)
 352 stdcall -noname -private StrCmpNA(str str long)
 353 stdcall -noname -private StrCmpNIA(str str long)
@@ -155,10 +155,10 @@
 382 stdcall -noname SmoothScrollWindow(ptr)
 383 stdcall -noname DoReaderMode(ptr)
 384 stdcall -noname SetPathWordBreakProc(ptr long)
-385 stdcall -ordinal DPA_EnumCallback(long long long)
-386 stdcall -ordinal DPA_DestroyCallback(ptr ptr long)
-387 stdcall -noname DSA_EnumCallback(ptr ptr long)
-388 stdcall -ordinal DSA_DestroyCallback(ptr ptr long)
+385 stdcall -ordinal DPA_EnumCallback(ptr ptr ptr)
+386 stdcall -ordinal DPA_DestroyCallback(ptr ptr ptr)
+387 stdcall -noname DSA_EnumCallback(ptr ptr ptr)
+388 stdcall -ordinal DSA_DestroyCallback(ptr ptr ptr)
 #389 CControl::v_OnNotify
 390 stdcall -noname ImageList_SetColorTable(ptr long long ptr)
 400 stdcall -ordinal CreateMRUListW(ptr)

Modified: trunk/reactos/dll/win32/comctl32/datetime.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/datetime.c?rev=74090&r1=74089&r2=74090&view=diff
==============================================================================
--- trunk/reactos/dll/win32/comctl32/datetime.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/comctl32/datetime.c [iso-8859-1] Sun Mar  5 
20:52:24 2017
@@ -804,7 +804,7 @@
 {
     int i;
 
-    TRACE ("%d, %d\n", pt.x, pt.y);
+    TRACE ("%s\n", wine_dbgstr_point(&pt));
 
     if (PtInRect (&infoPtr->calbutton, pt)) return DTHT_MCPOPUP;
     if (PtInRect (&infoPtr->checkbox, pt)) return DTHT_CHECKBOX;

Modified: trunk/reactos/dll/win32/comctl32/imagelist.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/imagelist.c?rev=74090&r1=74089&r2=74090&view=diff
==============================================================================
--- trunk/reactos/dll/win32/comctl32/imagelist.c        [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/comctl32/imagelist.c        [iso-8859-1] Sun Mar  5 
20:52:24 2017
@@ -72,6 +72,7 @@
     INT     cInitial;
     UINT    uBitsPixel;
     char   *has_alpha;
+    BOOL    color_table_set;
 
     LONG        ref;                       /* reference count */
 };
@@ -298,6 +299,9 @@
     return ret;
 }
 
+UINT WINAPI
+ImageList_SetColorTable(HIMAGELIST himl, UINT uStartIndex, UINT cEntries, 
const RGBQUAD *prgb);
+
 /*************************************************************************
  * IMAGELIST_InternalExpandBitmaps [Internal]
  *
@@ -420,7 +424,8 @@
 
     nImageCount = bmp.bmWidth / himl->cx;
 
-    TRACE("%p has %d images (%d x %d)\n", hbmImage, nImageCount, bmp.bmWidth, 
bmp.bmHeight);
+    TRACE("%p has %d images (%d x %d) bpp %d\n", hbmImage, nImageCount, 
bmp.bmWidth, bmp.bmHeight,
+          bmp.bmBitsPixel);
 
     IMAGELIST_InternalExpandBitmaps(himl, nImageCount);
 
@@ -436,6 +441,14 @@
     {
         hdcTemp = CreateCompatibleDC(0);
         SelectObject(hdcTemp, hbmMask);
+    }
+
+    if (himl->uBitsPixel <= 8 && bmp.bmBitsPixel <= 8 &&
+        !himl->color_table_set && himl->cCurImage == 0)
+    {
+        RGBQUAD colors[256];
+        UINT num = GetDIBColorTable( hdcBitmap, 0, 1 << bmp.bmBitsPixel, 
colors );
+        if (num) ImageList_SetColorTable( himl, 0, num, colors );
     }
 
     for (i=0; i<nImageCount; i++)
@@ -787,6 +800,7 @@
     himl->cGrow     = cGrow;
     himl->clrFg     = CLR_DEFAULT;
     himl->clrBk     = CLR_NONE;
+    himl->color_table_set = FALSE;
 
     /* initialize overlay mask indices */
     for (nCount = 0; nCount < MAX_OVERLAYIMAGE; nCount++)
@@ -3219,11 +3233,25 @@
 
        if (himl->uBitsPixel <= ILC_COLOR8)
        {
-            /* retrieve the default color map */
-            HBITMAP tmp = CreateBitmap( 1, 1, 1, 1, NULL );
-            GetDIBits( hdc, tmp, 0, 0, NULL, bmi, DIB_RGB_COLORS );
-            DeleteObject( tmp );
-       }
+            if (!himl->color_table_set)
+            {
+                /* retrieve the default color map */
+                HBITMAP tmp = CreateBitmap( 1, 1, 1, 1, NULL );
+                GetDIBits( hdc, tmp, 0, 0, NULL, bmi, DIB_RGB_COLORS );
+                DeleteObject( tmp );
+                if (ilc == ILC_COLOR4)
+                {
+                    RGBQUAD tmp;
+                    tmp = bmi->bmiColors[7];
+                    bmi->bmiColors[7] = bmi->bmiColors[8];
+                    bmi->bmiColors[8] = tmp;
+                }
+            }
+            else
+            {
+                GetDIBColorTable(himl->hdcImage, 0, 1 << himl->uBitsPixel, 
bmi->bmiColors);
+            }
+        }
        hbmNewBitmap = CreateDIBSection(hdc, bmi, DIB_RGB_COLORS, NULL, 0, 0);
     }
     else /*if (ilc == ILC_COLORDDB)*/
@@ -3258,6 +3286,8 @@
 UINT WINAPI
 ImageList_SetColorTable(HIMAGELIST himl, UINT uStartIndex, UINT cEntries, 
const RGBQUAD *prgb)
 {
+    TRACE("(%p, %d, %d, %p)\n", himl, uStartIndex, cEntries, prgb);
+    himl->color_table_set = TRUE;
     return SetDIBColorTable(himl->hdcImage, uStartIndex, cEntries, prgb);
 }
 

Modified: trunk/reactos/dll/win32/comctl32/monthcal.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/monthcal.c?rev=74090&r1=74089&r2=74090&view=diff
==============================================================================
--- trunk/reactos/dll/win32/comctl32/monthcal.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/comctl32/monthcal.c [iso-8859-1] Sun Mar  5 
20:52:24 2017
@@ -2157,7 +2157,7 @@
 
   hit = MONTHCAL_HitTest(infoPtr, &ht);
 
-  TRACE("%x at (%d, %d)\n", hit, ht.pt.x, ht.pt.y);
+  TRACE("%x at %s\n", hit, wine_dbgstr_point(&ht.pt));
 
   switch(hit)
   {

Modified: trunk/reactos/dll/win32/comctl32/pager.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/pager.c?rev=74090&r1=74089&r2=74090&view=diff
==============================================================================
--- trunk/reactos/dll/win32/comctl32/pager.c    [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/comctl32/pager.c    [iso-8859-1] Sun Mar  5 
20:52:24 2017
@@ -379,34 +379,6 @@
     return 0;
 }
 
-static LRESULT
-PAGER_WindowPosChanging(PAGER_INFO* infoPtr, WINDOWPOS *winpos)
-{
-    if ((infoPtr->dwStyle & CCS_NORESIZE) && !(winpos->flags & SWP_NOSIZE))
-    {
-        /* don't let the app resize the nonscrollable dimension of a control
-         * that was created with CCS_NORESIZE style
-         * (i.e. height for a horizontal pager, or width for a vertical one) */
-
-       /* except if the current dimension is 0 and app is setting for
-        * first time, then save amount as dimension. - GA 8/01 */
-
-        if (infoPtr->dwStyle & PGS_HORZ)
-           if (!infoPtr->nHeight && winpos->cy)
-               infoPtr->nHeight = winpos->cy;
-           else
-               winpos->cy = infoPtr->nHeight;
-        else
-           if (!infoPtr->nWidth && winpos->cx)
-               infoPtr->nWidth = winpos->cx;
-           else
-               winpos->cx = infoPtr->nWidth;
-       return 0;
-    }
-
-    return DefWindowProcW (infoPtr->hwndSelf, WM_WINDOWPOSCHANGING, 0, 
(LPARAM)winpos);
-}
-
 /******************************************************************
  * For the PGM_RECALCSIZE message (but not the other uses in      *
  * this module), the native control does only the following:      *
@@ -1027,6 +999,8 @@
 {
     PAGER_INFO *infoPtr = (PAGER_INFO *)GetWindowLongPtrW(hwnd, 0);
 
+    TRACE("(%p, %#x, %#lx, %#lx)\n", hwnd, uMsg, wParam, lParam);
+
     if (!infoPtr && (uMsg != WM_CREATE))
        return DefWindowProcW (hwnd, uMsg, wParam, lParam);
 
@@ -1084,9 +1058,6 @@
 
         case WM_NCPAINT:
             return PAGER_NCPaint (infoPtr, (HRGN)wParam);
-
-        case WM_WINDOWPOSCHANGING:
-            return PAGER_WindowPosChanging (infoPtr, (WINDOWPOS*)lParam);
 
         case WM_STYLECHANGED:
             return PAGER_StyleChanged(infoPtr, wParam, (LPSTYLESTRUCT)lParam);

Modified: trunk/reactos/dll/win32/comctl32/propsheet.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/propsheet.c?rev=74090&r1=74089&r2=74090&view=diff
==============================================================================
--- trunk/reactos/dll/win32/comctl32/propsheet.c        [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/comctl32/propsheet.c        [iso-8859-1] Sun Mar  5 
20:52:24 2017
@@ -32,10 +32,7 @@
  *   - Wizard 97 header resizing
  *   - Enforcing of minimal wizard size
  *   - Messages:
- *     o PSM_INSERTPAGE
  *     o PSM_RECALCPAGESIZES
- *     o PSM_SETHEADERSUBTITLE
- *     o PSM_SETHEADERTITLE
  *     o WM_HELP
  *     o WM_CONTEXTMENU
  *   - Notifications:
@@ -156,12 +153,31 @@
 static PADDING_INFO PROPSHEET_GetPaddingInfoWizard(HWND hwndDlg, const 
PropSheetInfo* psInfo);
 static BOOL PROPSHEET_DoCommand(HWND hwnd, WORD wID);
 static BOOL PROPSHEET_RemovePage(HWND hwndDlg, int index, HPROPSHEETPAGE 
hpage);
-static BOOL PROPSHEET_InsertPage(HWND hwndDlg, HPROPSHEETPAGE 
hpageInsertAfter, HPROPSHEETPAGE hpage);
 
 static INT_PTR CALLBACK
 PROPSHEET_DialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
 
 WINE_DEFAULT_DEBUG_CHANNEL(propsheet);
+
+static WCHAR *heap_strdupW(const WCHAR *str)
+{
+    int len = strlenW(str) + 1;
+    WCHAR *ret = Alloc(len * sizeof(WCHAR));
+    strcpyW(ret, str);
+    return ret;
+}
+
+static WCHAR *heap_strdupAtoW(const char *str)
+{
+    WCHAR *ret;
+    INT len;
+
+    len = MultiByteToWideChar(CP_ACP, 0, str, -1, 0, 0);
+    ret = Alloc(len * sizeof(WCHAR));
+    MultiByteToWideChar(CP_ACP, 0, str, -1, ret, len);
+
+    return ret;
+}
 
 #define add_flag(a) if (dwFlags & a) {strcat(string, #a );strcat(string," ");}
 /******************************************************************************
@@ -256,23 +272,6 @@
 }
 
 /******************************************************************************
- *            PROPSHEET_AtoW
- *
- * Convert ASCII to Unicode since all data is saved as Unicode.
- */
-static void PROPSHEET_AtoW(LPCWSTR *tostr, LPCSTR frstr)
-{
-    INT len;
-    WCHAR *to;
-
-    TRACE("<%s>\n", frstr);
-    len = MultiByteToWideChar(CP_ACP, 0, frstr, -1, 0, 0);
-    to = Alloc(len * sizeof(WCHAR));
-    MultiByteToWideChar(CP_ACP, 0, frstr, -1, to, len);
-    *tostr = to;
-}
-
-/******************************************************************************
  *            PROPSHEET_CollectSheetInfoCommon
  *
  * Common code for PROPSHEET_CollectSheetInfoA/W
@@ -360,12 +359,7 @@
   else
   {
      if (!IS_INTRESOURCE(lppsh->pszCaption))
-     {
-        int len = strlenW(lppsh->pszCaption);
-        WCHAR *caption = Alloc( (len+1)*sizeof(WCHAR) );
-
-        psInfo->ppshheader.pszCaption = strcpyW( caption, lppsh->pszCaption );
-     }
+       psInfo->ppshheader.pszCaption = heap_strdupW( lppsh->pszCaption );
   }
   psInfo->nPages = lppsh->nPages;
 
@@ -470,6 +464,9 @@
   p++;    /*   y      */
   width  = (WORD)*p; p++;
   height = (WORD)*p; p++;
+
+  if (lppsp->dwFlags & (PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE))
+    psInfo->ppshheader.dwFlags |= PSH_HEADER;
 
   /* Special calculation for interior wizard pages so the largest page is
    * calculated correctly. We need to add all the padding and space occupied
@@ -535,8 +532,6 @@
     WCHAR szTitle[256];
     const WCHAR *pTitle;
     static const WCHAR pszNull[] = { '(','n','u','l','l',')',0 };
-    WCHAR *text;
-    int len;
 
     if (IS_INTRESOURCE( lppsp->pszTitle ))
     {
@@ -550,9 +545,7 @@
     else
       pTitle = lppsp->pszTitle;
 
-    len = strlenW(pTitle);
-    text = Alloc( (len+1)*sizeof (WCHAR) );
-    psInfo->proppage[index].pszText = strcpyW( text, pTitle);
+    psInfo->proppage[index].pszText = heap_strdupW( pTitle );
   }
 
   /*
@@ -624,7 +617,7 @@
    */
   resSize = SizeofResource(COMCTL32_hModule, hRes);
 
-  temp = Alloc(resSize);
+  temp = Alloc(2 * resSize);
 
   if (!temp)
     return -1;
@@ -2226,16 +2219,108 @@
   return msgResult;
 }
 
+/******************************************************************************
+ *            PROPSHEET_InsertPage
+ */
+static BOOL PROPSHEET_InsertPage(HWND hwndDlg, HPROPSHEETPAGE 
hpageInsertAfter, HPROPSHEETPAGE hpage)
+{
+  PropSheetInfo *psInfo = GetPropW(hwndDlg, PropSheetInfoStr);
+  PropPageInfo *ppi, *prev_ppi = psInfo->proppage;
+  HWND hwndTabControl = GetDlgItem(hwndDlg, IDC_TABCONTROL);
+  LPCPROPSHEETPAGEW ppsp = (LPCPROPSHEETPAGEW)hpage;
+  TCITEMW item;
+  int index;
+
+  TRACE("hwndDlg %p, hpageInsertAfter %p, hpage %p\n", hwndDlg, 
hpageInsertAfter, hpage);
+
+  if (IS_INTRESOURCE(hpageInsertAfter))
+    index = LOWORD(hpageInsertAfter);
+  else
+  {
+    index = PROPSHEET_GetPageIndex(hpageInsertAfter, psInfo, -1);
+    if (index < 0)
+    {
+      TRACE("Could not find page to insert after!\n");
+      return FALSE;
+    }
+    index++;
+  }
+
+  if (index > psInfo->nPages)
+    index = psInfo->nPages;
+
+  ppi = Alloc(sizeof(PropPageInfo) * (psInfo->nPages + 1));
+  if (!ppi)
+      return FALSE;
+
+  /*
+   * Fill in a new PropPageInfo entry.
+   */
+  if (index > 0)
+    memcpy(ppi, prev_ppi, index * sizeof(PropPageInfo));
+  memset(&ppi[index], 0, sizeof(PropPageInfo));
+  if (index < psInfo->nPages)
+    memcpy(&ppi[index + 1], &prev_ppi[index], (psInfo->nPages - index) * 
sizeof(PropPageInfo));
+  psInfo->proppage = ppi;
+
+  if (!PROPSHEET_CollectPageInfo(ppsp, psInfo, index, FALSE))
+  {
+     psInfo->proppage = prev_ppi;
+     Free(ppi);
+     return FALSE;
+  }
+
+  psInfo->proppage[index].hpage = hpage;
+
+  if (ppsp->dwFlags & PSP_PREMATURE)
+  {
+     /* Create the page but don't show it */
+     if (!PROPSHEET_CreatePage(hwndDlg, index, psInfo, ppsp))
+     {
+        psInfo->proppage = prev_ppi;
+        Free(ppi);
+        return FALSE;
+     }
+  }
+
+  Free(prev_ppi);
+  psInfo->nPages++;
+  if (index <= psInfo->active_page)
+    psInfo->active_page++;
+
+  /*
+   * Add a new tab to the tab control.
+   */
+  item.mask = TCIF_TEXT;
+  item.pszText = (LPWSTR) psInfo->proppage[index].pszText;
+  item.cchTextMax = MAX_TABTEXT_LENGTH;
+
+  if (psInfo->hImageList)
+    SendMessageW(hwndTabControl, TCM_SETIMAGELIST, 0, 
(LPARAM)psInfo->hImageList);
+
+  if (psInfo->proppage[index].hasIcon)
+  {
+    item.mask |= TCIF_IMAGE;
+    item.iImage = index;
+  }
+
+  SendMessageW(hwndTabControl, TCM_INSERTITEMW, index, (LPARAM)&item);
+
+  /* If it is the only page - show it */
+  if (psInfo->nPages == 1)
+     PROPSHEET_SetCurSel(hwndDlg, 0, 1, 0);
+
+  return TRUE;
+}
 
 /******************************************************************************
  *            PROPSHEET_AddPage
  */
-static BOOL PROPSHEET_AddPage(HWND hwndDlg,
-                              HPROPSHEETPAGE hpage)
+static BOOL PROPSHEET_AddPage(HWND hwndDlg, HPROPSHEETPAGE hpage)
 {
   PropSheetInfo * psInfo = GetPropW(hwndDlg, PropSheetInfoStr);
-  TRACE("hpage %p\n", hpage);
-  return PROPSHEET_InsertPage(hwndDlg, 
(HPROPSHEETPAGE)(ULONG_PTR)psInfo->nPages, hpage);
+  TRACE("hwndDlg %p, hpage %p\n", hwndDlg, hpage);
+  return PROPSHEET_InsertPage(hwndDlg, UlongToPtr(psInfo->nPages), hpage);
 }
 
 /******************************************************************************
@@ -2419,135 +2504,75 @@
 }
 
 /******************************************************************************
- *            PROPSHEET_InsertPage
- */
-static BOOL PROPSHEET_InsertPage(HWND hwndDlg, HPROPSHEETPAGE 
hpageInsertAfter, HPROPSHEETPAGE hpage)
-{
-  PropSheetInfo * psInfo = GetPropW(hwndDlg, PropSheetInfoStr);
-  PropPageInfo * ppi, * prev_ppi = psInfo->proppage;
-  HWND hwndTabControl = GetDlgItem(hwndDlg, IDC_TABCONTROL);
-  LPCPROPSHEETPAGEW ppsp = (LPCPROPSHEETPAGEW)hpage;
-  TCITEMW item;
-  int index;
-
-  TRACE("hwndDlg %p, hpageInsertAfter %p, hpage %p\n", hwndDlg, 
hpageInsertAfter, hpage);
-
-  if (IS_INTRESOURCE(hpageInsertAfter))
-    index = LOWORD(hpageInsertAfter);
-  else
-  {
-    index = PROPSHEET_GetPageIndex(hpageInsertAfter, psInfo, -1);
-    if (index < 0)
-    {
-      TRACE("Could not find page to insert after!\n");
-      return FALSE;
-    }
-    index++;
-  }
-
-  if (index > psInfo->nPages)
-    index = psInfo->nPages;
-
-  /*
-   * Allocate a new PropPageInfo entry.
-   */
-  ppi = Alloc(sizeof(PropPageInfo) * (psInfo->nPages + 1));
-  if (!ppi)
-      return FALSE;
-
-  /*
-   * Fill in a new PropPageInfo entry.
-   */
-  if (index > 0)
-    memcpy(ppi, prev_ppi, index * sizeof(PropPageInfo));
-  memset(&ppi[index], 0, sizeof(PropPageInfo));
-  if (index < psInfo->nPages)
-    memcpy(&ppi[index + 1], &prev_ppi[index], (psInfo->nPages - index) * 
sizeof(PropPageInfo));
-  psInfo->proppage = ppi;
-
-  if (!PROPSHEET_CollectPageInfo(ppsp, psInfo, index, FALSE))
-  {
-     psInfo->proppage = prev_ppi;
-     Free(ppi);
-     return FALSE;
-  }
-
-  psInfo->proppage[index].hpage = hpage;
-
-  if (ppsp->dwFlags & PSP_PREMATURE)
-  {
-     /* Create the page but don't show it */
-     if(!PROPSHEET_CreatePage(hwndDlg, index, psInfo, ppsp))
-     {
-        psInfo->proppage = prev_ppi;
-        Free(ppi);
-        return FALSE;
-     }
-  }
-
-  Free(prev_ppi);
-  psInfo->nPages++;
-  if (index <= psInfo->active_page)
-    psInfo->active_page++;
-
-  /*
-   * Add a new tab to the tab control.
-   */
-  item.mask = TCIF_TEXT;
-  item.pszText = (LPWSTR) psInfo->proppage[index].pszText;
-  item.cchTextMax = MAX_TABTEXT_LENGTH;
-
-  if (psInfo->hImageList)
-  {
-    SendMessageW(hwndTabControl, TCM_SETIMAGELIST, 0, 
(LPARAM)psInfo->hImageList);
-  }
-
-  if (psInfo->proppage[index].hasIcon)
-  {
-    item.mask |= TCIF_IMAGE;
-    item.iImage = index;
-  }
-
-  SendMessageW(hwndTabControl, TCM_INSERTITEMW, index,
-               (LPARAM)&item);
-
-  /* If it is the only page - show it */
-  if (psInfo->nPages == 1)
-     PROPSHEET_SetCurSel(hwndDlg, 0, 1, 0);
-
-  return TRUE;
-}
-
-/******************************************************************************
  *            PROPSHEET_SetHeaderTitleW
  */
-static void PROPSHEET_SetHeaderTitleW(HWND hwndDlg, int iPageIndex, LPCWSTR 
pszHeaderTitle)
-{
-    FIXME("(%p, %d, %s): stub\n", hwndDlg, iPageIndex, 
debugstr_w(pszHeaderTitle));
+static void PROPSHEET_SetHeaderTitleW(HWND hwndDlg, UINT page_index, const 
WCHAR *title)
+{
+    PropSheetInfo *psInfo = GetPropW(hwndDlg, PropSheetInfoStr);
+    PROPSHEETPAGEW *page;
+
+    TRACE("(%p, %u, %s)\n", hwndDlg, page_index, debugstr_w(title));
+
+    if (page_index >= psInfo->nPages)
+        return;
+
+    page = (PROPSHEETPAGEW *)psInfo->proppage[page_index].hpage;
+
+    if (!IS_INTRESOURCE(page->pszHeaderTitle))
+        Free((void *)page->pszHeaderTitle);
+
+    page->pszHeaderTitle = heap_strdupW(title);
+    page->dwFlags |= PSP_USEHEADERTITLE;
 }
 
 /******************************************************************************
  *            PROPSHEET_SetHeaderTitleA
  */
-static void PROPSHEET_SetHeaderTitleA(HWND hwndDlg, int iPageIndex, LPCSTR 
pszHeaderTitle)
-{
-    FIXME("(%p, %d, %s): stub\n", hwndDlg, iPageIndex, 
debugstr_a(pszHeaderTitle));
+static void PROPSHEET_SetHeaderTitleA(HWND hwndDlg, UINT page_index, const 
char *title)
+{
+    WCHAR *titleW;
+
+    TRACE("(%p, %u, %s)\n", hwndDlg, page_index, debugstr_a(title));
+
+    titleW = heap_strdupAtoW(title);
+    PROPSHEET_SetHeaderTitleW(hwndDlg, page_index, titleW);
+    Free(titleW);
 }
 
 /******************************************************************************
  *            PROPSHEET_SetHeaderSubTitleW
  */
-static void PROPSHEET_SetHeaderSubTitleW(HWND hwndDlg, int iPageIndex, LPCWSTR 
pszHeaderSubTitle)
-{
-    FIXME("(%p, %d, %s): stub\n", hwndDlg, iPageIndex, 
debugstr_w(pszHeaderSubTitle));
+static void PROPSHEET_SetHeaderSubTitleW(HWND hwndDlg, UINT page_index, const 
WCHAR *subtitle)
+{
+    PropSheetInfo *psInfo = GetPropW(hwndDlg, PropSheetInfoStr);
+    PROPSHEETPAGEW *page;
+
+    TRACE("(%p, %u, %s)\n", hwndDlg, page_index, debugstr_w(subtitle));
+
+    if (page_index >= psInfo->nPages)
+        return;
+
+    page = (PROPSHEETPAGEW *)psInfo->proppage[page_index].hpage;
+
+    if (!IS_INTRESOURCE(page->pszHeaderSubTitle))
+        Free((void *)page->pszHeaderSubTitle);
+
+    page->pszHeaderSubTitle = heap_strdupW(subtitle);
+    page->dwFlags |= PSP_USEHEADERSUBTITLE;
 }
 
 /******************************************************************************
  *            PROPSHEET_SetHeaderSubTitleA
  */
-static void PROPSHEET_SetHeaderSubTitleA(HWND hwndDlg, int iPageIndex, LPCSTR 
pszHeaderSubTitle)
-{
-    FIXME("(%p, %d, %s): stub\n", hwndDlg, iPageIndex, 
debugstr_a(pszHeaderSubTitle));
+static void PROPSHEET_SetHeaderSubTitleA(HWND hwndDlg, UINT page_index, const 
char *subtitle)
+{
+    WCHAR *subtitleW;
+
+    TRACE("(%p, %u, %s)\n", hwndDlg, page_index, debugstr_a(subtitle));
+
+    subtitleW = heap_strdupAtoW(subtitle);
+    PROPSHEET_SetHeaderSubTitleW(hwndDlg, page_index, subtitleW);
+    Free(subtitleW);
 }
 
 /******************************************************************************
@@ -2963,15 +2988,15 @@
     if (ppsp->dwFlags & PSP_USEICONID)
     {
         if (!IS_INTRESOURCE( ppsp->u2.pszIcon ))
-            PROPSHEET_AtoW(&ppsp->u2.pszIcon, lpPropSheetPage->u2.pszIcon);
+            ppsp->u2.pszIcon = heap_strdupAtoW( lpPropSheetPage->u2.pszIcon );
     }
 
     if (ppsp->dwFlags & PSP_USETITLE)
     {
-        if (!IS_INTRESOURCE( ppsp->pszTitle ))
-            PROPSHEET_AtoW( &ppsp->pszTitle, lpPropSheetPage->pszTitle );
+        if (IS_INTRESOURCE( ppsp->pszTitle ))
+            ppsp->pszTitle = load_string( ppsp->hInstance, ppsp->pszTitle );
         else
-            ppsp->pszTitle = load_string( ppsp->hInstance, ppsp->pszTitle );
+            ppsp->pszTitle = heap_strdupAtoW( lpPropSheetPage->pszTitle );
     }
     else
         ppsp->pszTitle = NULL;
@@ -2981,24 +3006,27 @@
 
     if (ppsp->dwFlags & PSP_USEHEADERTITLE)
     {
-        if (!IS_INTRESOURCE( ppsp->pszHeaderTitle ))
-            PROPSHEET_AtoW(&ppsp->pszHeaderTitle, 
lpPropSheetPage->pszHeaderTitle);
+        if (IS_INTRESOURCE( ppsp->pszHeaderTitle ))
+            ppsp->pszHeaderTitle = load_string( ppsp->hInstance, 
ppsp->pszHeaderTitle );
         else
-            ppsp->pszHeaderTitle = load_string( ppsp->hInstance, 
ppsp->pszHeaderTitle );
+            ppsp->pszHeaderTitle = heap_strdupAtoW( 
lpPropSheetPage->pszHeaderTitle );
     }
     else
         ppsp->pszHeaderTitle = NULL;
 
     if (ppsp->dwFlags & PSP_USEHEADERSUBTITLE)
     {
-        if (!IS_INTRESOURCE( ppsp->pszHeaderSubTitle ))
-            PROPSHEET_AtoW(&ppsp->pszHeaderSubTitle, 
lpPropSheetPage->pszHeaderSubTitle);
+        if (IS_INTRESOURCE( ppsp->pszHeaderSubTitle ))
+            ppsp->pszHeaderSubTitle = load_string( ppsp->hInstance, 
ppsp->pszHeaderSubTitle );
         else
-            ppsp->pszHeaderSubTitle = load_string( ppsp->hInstance, 
ppsp->pszHeaderSubTitle );
+            ppsp->pszHeaderSubTitle = heap_strdupAtoW( 
lpPropSheetPage->pszHeaderSubTitle );
     }
     else
         ppsp->pszHeaderSubTitle = NULL;
 
+    if ((ppsp->dwFlags & PSH_USECALLBACK) && ppsp->pfnCallback)
+        ppsp->pfnCallback(0, PSPCB_ADDREF, ppsp);
+
     return (HPROPSHEETPAGE)ppsp;
 }
 
@@ -3018,23 +3046,13 @@
     if ( !(ppsp->dwFlags & PSP_DLGINDIRECT) )
     {
         if (!IS_INTRESOURCE( ppsp->u.pszTemplate ))
-        {
-            int len = strlenW(lpPropSheetPage->u.pszTemplate) + 1;
-            WCHAR *template = Alloc( len * sizeof (WCHAR) );
-
-            ppsp->u.pszTemplate = strcpyW( template, 
lpPropSheetPage->u.pszTemplate );
-        }
+            ppsp->u.pszTemplate = heap_strdupW( lpPropSheetPage->u.pszTemplate 
);
     }
 
     if ( ppsp->dwFlags & PSP_USEICONID )
     {
         if (!IS_INTRESOURCE( ppsp->u2.pszIcon ))
-        {
-            int len = strlenW(lpPropSheetPage->u2.pszIcon) + 1;
-            WCHAR *icon = Alloc( len * sizeof (WCHAR) );
-
-            ppsp->u2.pszIcon = strcpyW( icon, lpPropSheetPage->u2.pszIcon );
-        }
+            ppsp->u2.pszIcon = heap_strdupW( lpPropSheetPage->u2.pszIcon );
     }
 
     if (ppsp->dwFlags & PSP_USETITLE)
@@ -3055,6 +3073,9 @@
     else
         ppsp->pszHeaderSubTitle = NULL;
 
+    if ((ppsp->dwFlags & PSH_USECALLBACK) && ppsp->pfnCallback)
+        ppsp->pfnCallback(0, PSPCB_ADDREF, ppsp);
+
     return (HPROPSHEETPAGE)ppsp;
 }
 
@@ -3075,6 +3096,9 @@
 
   if (!psp)
      return FALSE;
+
+  if ((psp->dwFlags & PSH_USECALLBACK) && psp->pfnCallback)
+     psp->pfnCallback(0, PSPCB_RELEASE, psp);
 
   if (!(psp->dwFlags & PSP_DLGINDIRECT) && !IS_INTRESOURCE( psp->u.pszTemplate 
))
      Free ((LPVOID)psp->u.pszTemplate);
@@ -3251,61 +3275,65 @@
        COLORREF clrOld = 0;
        int oldBkMode = 0;
 
-       hbmp = SelectObject(hdcSrc, psInfo->ppshheader.u5.hbmHeader);
-       hOldFont = SelectObject(hdc, psInfo->hFontBold);
-
-       GetClientRect(hwndLineHeader, &r);
-       MapWindowPoints(hwndLineHeader, hwnd, (LPPOINT) &r, 2);
-       SetRect(&rzone, 0, 0, r.right + 1, r.top - 1);
-
-       GetObjectW(psInfo->ppshheader.u5.hbmHeader, sizeof(BITMAP), &bm);
-
-       if (psInfo->ppshheader.dwFlags & PSH_WIZARD97_OLD)
-       {
-           /* Fill the unoccupied part of the header with color of the
-            * left-top pixel, but do it only when needed.
-            */
-           if (bm.bmWidth < r.right || bm.bmHeight < r.bottom)
-           {
-               hbr = CreateSolidBrush(GetPixel(hdcSrc, 0, 0));
-                r = rzone;
-               if (bm.bmWidth < r.right)
-               {
-                   r.left = bm.bmWidth;
-                   FillRect(hdc, &r, hbr);
-               }
-               if (bm.bmHeight < r.bottom)
-               {
-                   r.left = 0;
-                   r.top = bm.bmHeight;
-                   FillRect(hdc, &r, hbr);
-               }
-               DeleteObject(hbr);
-           }
-
-           /* Draw the header itself. */
-           BitBlt(hdc, 0, 0,
-                  bm.bmWidth, min(bm.bmHeight, rzone.bottom),
-                  hdcSrc, 0, 0, SRCCOPY);
-       }
-       else
-       {
-            int margin;
-           hbr = GetSysColorBrush(COLOR_WINDOW);
-           FillRect(hdc, &rzone, hbr);
-
-           /* Draw the header bitmap. It's always centered like a
-            * common 49 x 49 bitmap. */
-            margin = (rzone.bottom - 49) / 2;
-           BitBlt(hdc, rzone.right - 49 - margin, margin,
-                   min(bm.bmWidth, 49), min(bm.bmHeight, 49),
-                   hdcSrc, 0, 0, SRCCOPY);
-
-           /* NOTE: Native COMCTL32 draws a white stripe over the bitmap
-            * if its height is smaller than 49 pixels. Because the reason
-            * for this bug is unknown the current code doesn't try to
-            * replicate it. */
-       }
+        GetClientRect(hwndLineHeader, &r);
+        MapWindowPoints(hwndLineHeader, hwnd, (LPPOINT) &r, 2);
+        SetRect(&rzone, 0, 0, r.right + 1, r.top - 1);
+
+        hOldFont = SelectObject(hdc, psInfo->hFontBold);
+
+        if (psInfo->ppshheader.dwFlags & PSH_USEHBMHEADER)
+        {
+            hbmp = SelectObject(hdcSrc, psInfo->ppshheader.u5.hbmHeader);
+
+            GetObjectW(psInfo->ppshheader.u5.hbmHeader, sizeof(BITMAP), &bm);
+            if (psInfo->ppshheader.dwFlags & PSH_WIZARD97_OLD)
+            {
+                /* Fill the unoccupied part of the header with color of the
+                 * left-top pixel, but do it only when needed.
+                 */
+                if (bm.bmWidth < r.right || bm.bmHeight < r.bottom)
+                {
+                    hbr = CreateSolidBrush(GetPixel(hdcSrc, 0, 0));
+                    r = rzone;
+                    if (bm.bmWidth < r.right)
+                    {
+                        r.left = bm.bmWidth;
+                        FillRect(hdc, &r, hbr);
+                    }
+                    if (bm.bmHeight < r.bottom)
+                    {
+                        r.left = 0;
+                        r.top = bm.bmHeight;
+                        FillRect(hdc, &r, hbr);
+                    }
+                    DeleteObject(hbr);
+                }
+
+                /* Draw the header itself. */
+                BitBlt(hdc, 0, 0, bm.bmWidth, min(bm.bmHeight, rzone.bottom),
+                        hdcSrc, 0, 0, SRCCOPY);
+            }
+            else
+            {
+                int margin;
+                hbr = GetSysColorBrush(COLOR_WINDOW);
+                FillRect(hdc, &rzone, hbr);
+
+                /* Draw the header bitmap. It's always centered like a
+                 * common 49 x 49 bitmap. */
+                margin = (rzone.bottom - 49) / 2;
+                BitBlt(hdc, rzone.right - 49 - margin, margin,
+                        min(bm.bmWidth, 49), min(bm.bmHeight, 49),
+                        hdcSrc, 0, 0, SRCCOPY);
+
+                /* NOTE: Native COMCTL32 draws a white stripe over the bitmap
+                 * if its height is smaller than 49 pixels. Because the reason
+                 * for this bug is unknown the current code doesn't try to
+                 * replicate it. */
+            }
+
+            SelectObject(hdcSrc, hbmp);
+        }
 
        clrOld = SetTextColor (hdc, 0x00000000);
        oldBkMode = SetBkMode (hdc, TRANSPARENT); 
@@ -3346,7 +3374,6 @@
        SetTextColor(hdc, clrOld);
        SetBkMode(hdc, oldBkMode);
        SelectObject(hdc, hOldFont);
-       SelectObject(hdcSrc, hbmp);
     }
 
     if ( (ppshpage && (ppshpage->dwFlags & PSP_HIDEHEADER)) &&
@@ -3754,19 +3781,19 @@
     }
 
     case PSM_SETHEADERTITLEW:
-        PROPSHEET_SetHeaderTitleW(hwnd, (int)wParam, (LPCWSTR)lParam);
+        PROPSHEET_SetHeaderTitleW(hwnd, wParam, (LPCWSTR)lParam);
         return TRUE;
 
     case PSM_SETHEADERTITLEA:
-        PROPSHEET_SetHeaderTitleA(hwnd, (int)wParam, (LPCSTR)lParam);
+        PROPSHEET_SetHeaderTitleA(hwnd, wParam, (LPCSTR)lParam);
         return TRUE;
 
     case PSM_SETHEADERSUBTITLEW:
-        PROPSHEET_SetHeaderSubTitleW(hwnd, (int)wParam, (LPCWSTR)lParam);
+        PROPSHEET_SetHeaderSubTitleW(hwnd, wParam, (LPCWSTR)lParam);
         return TRUE;
 
     case PSM_SETHEADERSUBTITLEA:
-        PROPSHEET_SetHeaderSubTitleA(hwnd, (int)wParam, (LPCSTR)lParam);
+        PROPSHEET_SetHeaderSubTitleA(hwnd, wParam, (LPCSTR)lParam);
         return TRUE;
 
     case PSM_HWNDTOINDEX:

Modified: trunk/reactos/dll/win32/comctl32/rebar.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/rebar.c?rev=74090&r1=74089&r2=74090&view=diff
==============================================================================
--- trunk/reactos/dll/win32/comctl32/rebar.c    [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/comctl32/rebar.c    [iso-8859-1] Sun Mar  5 
20:52:24 2017
@@ -3386,7 +3386,7 @@
              ret, i);
        ret = (LRESULT) i;
     }
-    TRACE("returning %ld, client point (%d,%d)\n", ret, clpt.x, clpt.y);
+    TRACE("returning %ld, client point %s\n", ret, wine_dbgstr_point(&clpt));
     return ret;
 }
 

Modified: trunk/reactos/dll/win32/comctl32/syslink.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/syslink.c?rev=74090&r1=74089&r2=74090&view=diff
==============================================================================
--- trunk/reactos/dll/win32/comctl32/syslink.c  [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/comctl32/syslink.c  [iso-8859-1] Sun Mar  5 
20:52:24 2017
@@ -33,8 +33,6 @@
 
 WINE_DEFAULT_DEBUG_CHANNEL(syslink);
 
-INT WINAPI StrCmpNIW(LPCWSTR,LPCWSTR,INT);
-
 typedef struct
 {
     int nChars;
@@ -90,11 +88,6 @@
     BOOL      IgnoreReturn; /* (infoPtr->Style & LWS_IGNORERETURN) on creation 
*/
 } SYSLINK_INFO;
 
-static const WCHAR SL_LINKOPEN[] =  { '<','a', 0 };
-static const WCHAR SL_HREF[] =      { 'h','r','e','f','=','\"',0 };
-static const WCHAR SL_ID[] =        { 'i','d','=','\"',0 };
-static const WCHAR SL_LINKCLOSE[] = { '<','/','a','>',0 };
-
 /* Control configuration constants */
 
 #define SL_LEFTMARGIN   (0)
@@ -167,32 +160,16 @@
 }
 
 /***********************************************************************
- * SYSLINK_StrCmpNIW
- * Wrapper for StrCmpNIW to ensure 'len' is not too big.
- */
-static INT SYSLINK_StrCmpNIW (LPCWSTR str, LPCWSTR comp, INT len)
-{
-    INT i;
-
-    for(i = 0; i < len; i++)
-    {
-        if(!str[i])
-        {
-            len = i + 1;
-            break;
-        }
-    }
-
-    return StrCmpNIW(str, comp, len);
-}
-
-/***********************************************************************
  * SYSLINK_ParseText
  * Parses the window text string and creates a document. Returns the
  * number of document items created.
  */
 static UINT SYSLINK_ParseText (SYSLINK_INFO *infoPtr, LPCWSTR Text)
 {
+    static const WCHAR SL_LINKOPEN[] =  { '<','a' };
+    static const WCHAR SL_HREF[] =      { 'h','r','e','f','=','\"' };
+    static const WCHAR SL_ID[] =        { 'i','d','=','\"' };
+    static const WCHAR SL_LINKCLOSE[] = { '<','/','a','>' };
     LPCWSTR current, textstart = NULL, linktext = NULL, firsttag = NULL;
     int taglen = 0, textlen = 0, linklen = 0, docitems = 0;
     PDOC_ITEM Last = NULL;
@@ -206,7 +183,7 @@
     {
         if(*current == '<')
         {
-            if(!SYSLINK_StrCmpNIW(current, SL_LINKOPEN, 2) && (CurrentType == 
slText))
+            if(!strncmpiW(current, SL_LINKOPEN, 
sizeof(SL_LINKOPEN)/sizeof(SL_LINKOPEN[0])) && (CurrentType == slText))
             {
                 BOOL ValidParam = FALSE, ValidLink = FALSE;
 
@@ -234,14 +211,14 @@
                     
 CheckParameter:
                     /* compare the current position with all known parameters 
*/
-                    if(!SYSLINK_StrCmpNIW(tmp, SL_HREF, 6))
+                    if(!strncmpiW(tmp, SL_HREF, 
sizeof(SL_HREF)/sizeof(SL_HREF[0])))
                     {
                         taglen += 6;
                         ValidParam = TRUE;
                         CurrentParameter = &lpUrl;
                         CurrentParameterLen = &lenUrl;
                     }
-                    else if(!SYSLINK_StrCmpNIW(tmp, SL_ID, 4))
+                    else if(!strncmpiW(tmp, SL_ID, 
sizeof(SL_ID)/sizeof(SL_ID[0])))
                     {
                         taglen += 4;
                         ValidParam = TRUE;
@@ -315,7 +292,7 @@
                     }
                 }
             }
-            else if(!SYSLINK_StrCmpNIW(current, SL_LINKCLOSE, 4) && 
(CurrentType == slLink) && firsttag)
+            else if(!strncmpiW(current, SL_LINKCLOSE, 
sizeof(SL_LINKCLOSE)/sizeof(SL_LINKCLOSE[0])) && (CurrentType == slLink) && 
firsttag)
             {
                 /* there's a <a...> tag opened, first add the previous text, 
if present */
                 if(textstart != NULL && textlen > 0 && firsttag > textstart)

Modified: trunk/reactos/dll/win32/comctl32/toolbar.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/toolbar.c?rev=74090&r1=74089&r2=74090&view=diff
==============================================================================
--- trunk/reactos/dll/win32/comctl32/toolbar.c  [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/comctl32/toolbar.c  [iso-8859-1] Sun Mar  5 
20:52:24 2017
@@ -3484,7 +3484,7 @@
                 Str_GetPtrW(lpText, lpTbInfo->pszText, lpTbInfo->cchText);
             else
                 Str_GetPtrWtoA(lpText, (LPSTR)lpTbInfo->pszText, 
lpTbInfo->cchText);
-        } else
+        } else if (!bUnicode || lpTbInfo->pszText)
             lpTbInfo->pszText[0] = '\0';
     }
     return nIndex;
@@ -4663,17 +4663,16 @@
 
 
 static LRESULT
-TOOLBAR_SetDrawTextFlags (TOOLBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
-{
-    DWORD dwTemp;
-
-    TRACE("hwnd = %p, dwMask = 0x%08x, dwDTFlags = 0x%08x\n", 
infoPtr->hwndSelf, (DWORD)wParam, (DWORD)lParam);
-
-    dwTemp = infoPtr->dwDTFlags;
-    infoPtr->dwDTFlags =
-       (infoPtr->dwDTFlags & (DWORD)wParam) | (DWORD)lParam;
-
-    return (LRESULT)dwTemp;
+TOOLBAR_SetDrawTextFlags (TOOLBAR_INFO *infoPtr, DWORD mask, DWORD flags)
+{
+    DWORD old_flags;
+
+    TRACE("hwnd = %p, mask = 0x%08x, flags = 0x%08x\n", infoPtr->hwndSelf, 
mask, flags);
+
+    old_flags = infoPtr->dwDTFlags;
+    infoPtr->dwDTFlags = (old_flags & ~mask) | (flags & mask);
+
+    return (LRESULT)old_flags;
 }
 
 /* This function differs a bit from what MSDN says it does:

Modified: trunk/reactos/dll/win32/comctl32/tooltips.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/tooltips.c?rev=74090&r1=74089&r2=74090&view=diff
==============================================================================
--- trunk/reactos/dll/win32/comctl32/tooltips.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/comctl32/tooltips.c [iso-8859-1] Sun Mar  5 
20:52:24 2017
@@ -1521,7 +1521,7 @@
                                                       &pt);
            TRACE("tool (%p) %d %d %d\n", infoPtr->hwndSelf, nOldTool,
                  infoPtr->nTool, infoPtr->nCurrentTool);
-            TRACE("WM_MOUSEMOVE (%p %d %d)\n", infoPtr->hwndSelf, pt.x, pt.y);
+            TRACE("WM_MOUSEMOVE (%p %s)\n", infoPtr->hwndSelf, 
wine_dbgstr_point(&pt));
 
            if (infoPtr->nTool != nOldTool) {
                if(infoPtr->nTool == -1) { /* Moved out of all tools */

Modified: trunk/reactos/dll/win32/comctl32/trackbar.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/trackbar.c?rev=74090&r1=74089&r2=74090&view=diff
==============================================================================
--- trunk/reactos/dll/win32/comctl32/trackbar.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/comctl32/trackbar.c [iso-8859-1] Sun Mar  5 
20:52:24 2017
@@ -436,7 +436,7 @@
     LONG dir = TRACKBAR_GetAutoPageDirection(infoPtr, clickPoint);
     LONG prevPos = infoPtr->lPos;
 
-    TRACE("x=%d, y=%d, dir=%d\n", clickPoint.x, clickPoint.y, dir);
+    TRACE("clickPoint=%s, dir=%d\n", wine_dbgstr_point(&clickPoint), dir);
 
     if (dir > 0 && (infoPtr->flags & TB_AUTO_PAGE_RIGHT))
        TRACKBAR_PageDown(infoPtr);
@@ -1261,10 +1261,11 @@
 TRACKBAR_SetRangeMax (TRACKBAR_INFO *infoPtr, BOOL redraw, LONG lMax)
 {
     BOOL changed = infoPtr->lRangeMax != lMax;
+    LONG rightmost = max(lMax, infoPtr->lRangeMin);
 
     infoPtr->lRangeMax = lMax;
-    if (infoPtr->lPos > infoPtr->lRangeMax) {
-        infoPtr->lPos = infoPtr->lRangeMax;
+    if (infoPtr->lPos > rightmost) {
+        infoPtr->lPos = rightmost;
         infoPtr->flags |= TB_THUMBPOSCHANGED;
     }
 
@@ -1415,6 +1416,7 @@
        TRACKBAR_InvalidateAll(infoPtr);
     }
 
+    TRACKBAR_UpdateThumb (infoPtr);
     return 0;
 }
 

Modified: trunk/reactos/dll/win32/comctl32/treeview.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/treeview.c?rev=74090&r1=74089&r2=74090&view=diff
==============================================================================
--- trunk/reactos/dll/win32/comctl32/treeview.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/comctl32/treeview.c [iso-8859-1] Sun Mar  5 
20:52:24 2017
@@ -2531,6 +2531,8 @@
     }
 
     hOldFont = SelectObject(hdc, TREEVIEW_FontForItem(infoPtr, item));
+    oldTextColor = SetTextColor(hdc, nmcdhdr.clrText);
+    oldTextBkColor = SetBkColor(hdc, nmcdhdr.clrTextBk);
 
     /* The custom draw handler can query the text rectangle,
      * so get ready. */
@@ -2565,9 +2567,9 @@
 
     TREEVIEW_DrawItemLines(infoPtr, hdc, item);
 
-    /* Set colors. Custom draw handler can change these so we do this after 
it. */
-    oldTextColor = SetTextColor(hdc, nmcdhdr.clrText);
-    oldTextBkColor = SetBkColor(hdc, nmcdhdr.clrTextBk);
+    /* reset colors. Custom draw handler can change them */
+    SetTextColor(hdc, nmcdhdr.clrText);
+    SetBkColor(hdc, nmcdhdr.clrTextBk);
 
     centery = (item->rect.top + item->rect.bottom) / 2;
 
@@ -3686,6 +3688,9 @@
        lpht->flags = TVHT_NOWHERE;
         return NULL;
     }
+
+    if (!item->textWidth)
+        TREEVIEW_ComputeTextWidth(infoPtr, item, 0);
 
     if (x >= item->textOffset + item->textWidth)
     {

Modified: trunk/reactos/media/doc/README.WINE
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=74090&r1=74089&r2=74090&view=diff
==============================================================================
--- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original)
+++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Sun Mar  5 20:52:24 2017
@@ -54,7 +54,7 @@
 reactos/dll/win32/cabinet             # Synced to WineStaging-2.2
 reactos/dll/win32/clusapi             # Synced to WineStaging-1.9.11
 reactos/dll/win32/comcat              # Synced to WineStaging-1.9.11
-reactos/dll/win32/comctl32            # Synced to WineStaging-1.9.23
+reactos/dll/win32/comctl32            # Synced to WineStaging-2.2
 reactos/dll/win32/comdlg32            # Synced to WineStaging-1.9.23
 reactos/dll/win32/compstui            # Synced to WineStaging-2.2
 reactos/dll/win32/credui              # Synced to WineStaging-2.2


Reply via email to