Author: fireball
Date: Mon Oct 12 16:56:37 2009
New Revision: 43403

URL: http://svn.reactos.org/svn/reactos?rev=43403&view=rev
Log:
[arwinss]
- Sync up to Wine-1.1.31.

Modified:
    branches/arwinss/reactos/dll/win32/user32/   (props changed)
    branches/arwinss/reactos/dll/win32/user32/clipboard.c
    branches/arwinss/reactos/dll/win32/user32/cursoricon.c
    branches/arwinss/reactos/dll/win32/user32/message.c
    branches/arwinss/reactos/dll/win32/user32/sysparams.c
    branches/arwinss/reactos/dll/win32/user32/text.c
    branches/arwinss/reactos/dll/win32/user32/uitools.c

Propchange: branches/arwinss/reactos/dll/win32/user32/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Oct 12 16:56:37 2009
@@ -1,3 +1,3 @@
 
/branches/ros-amd64-bringup/reactos/dll/win32/user32:35746,35789,36614,36930,38148,38151,38265,38268,39333,39345,40991,41000,41027-41028,41050,41052,41082-41086,41549,43080
 /trunk/reactos/dll/win32/user32:42000-43126
-/vendor/wine/dlls/user32/current:43136,43149
+/vendor/wine/dlls/user32/current:43136,43149,43398

Modified: branches/arwinss/reactos/dll/win32/user32/clipboard.c
URL: 
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/user32/clipboard.c?rev=43403&r1=43402&r2=43403&view=diff
==============================================================================
--- branches/arwinss/reactos/dll/win32/user32/clipboard.c [iso-8859-1] 
(original)
+++ branches/arwinss/reactos/dll/win32/user32/clipboard.c [iso-8859-1] Mon Oct 
12 16:56:37 2009
@@ -188,6 +188,9 @@
     return bRet;
 }
 
+/**************************************************************************
+ *             CLIPBOARD_SetClipboardViewer
+ */
 static HWND CLIPBOARD_SetClipboardViewer( HWND hWnd )
 {
     HWND hwndPrev = 0;

Modified: branches/arwinss/reactos/dll/win32/user32/cursoricon.c
URL: 
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/user32/cursoricon.c?rev=43403&r1=43402&r2=43403&view=diff
==============================================================================
--- branches/arwinss/reactos/dll/win32/user32/cursoricon.c [iso-8859-1] 
(original)
+++ branches/arwinss/reactos/dll/win32/user32/cursoricon.c [iso-8859-1] Mon Oct 
12 16:56:37 2009
@@ -660,6 +660,37 @@
     return &dir->idEntries[n];
 }
 
+/***********************************************************************
+ *          stretch_blt_icon
+ *
+ * A helper function that stretches a bitmap buffer into an HBITMAP.
+ *
+ * PARAMS
+ *      hDest       [I] The handle of the destination bitmap.
+ *      pDestInfo   [I] The BITMAPINFO of the destination bitmap.
+ *      pSrcInfo    [I] The BITMAPINFO of the source bitmap.
+ *      pSrcBits    [I] A pointer to the source bitmap buffer.
+ **/
+static BOOL stretch_blt_icon(HBITMAP hDest, BITMAPINFO *pDestInfo, BITMAPINFO 
*pSrcInfo, char *pSrcBits)
+{
+    HBITMAP hOld;
+    BOOL res = FALSE;
+    HDC hdcMem = CreateCompatibleDC(screen_dc);
+
+    if (hdcMem)
+    {
+        hOld = SelectObject(hdcMem, hDest);
+        res = StretchDIBits(hdcMem,
+                            0, 0, pDestInfo->bmiHeader.biWidth, 
pDestInfo->bmiHeader.biHeight,
+                            0, 0, pSrcInfo->bmiHeader.biWidth, 
pSrcInfo->bmiHeader.biHeight,
+                            pSrcBits, pSrcInfo, DIB_RGB_COLORS, SRCCOPY);
+        SelectObject(hdcMem, hOld);
+        DeleteDC( hdcMem );
+    }
+
+    return res;
+}
+
 static HICON CURSORICON_CreateIconFromBMI( BITMAPINFO *bmi,
                                           POINT16 hotspot, BOOL bIcon,
                                           DWORD dwVersion,
@@ -667,12 +698,11 @@
                                           UINT cFlag )
 {
     HGLOBAL hObj;
-    static HDC hdcMem;
     int sizeAnd, sizeXor;
     HBITMAP hAndBits = 0, hXorBits = 0; /* error condition for later */
     BITMAP bmpXor, bmpAnd;
-    BOOL DoStretch;
     INT size;
+    BITMAPINFO *pSrcInfo, *pDestInfo;
 
     if (dwVersion == 0x00020000)
     {
@@ -694,11 +724,10 @@
 
     if (!width) width = bmi->bmiHeader.biWidth;
     if (!height) height = bmi->bmiHeader.biHeight/2;
-    DoStretch = (bmi->bmiHeader.biHeight/2 != height) ||
-      (bmi->bmiHeader.biWidth != width);
 
     /* Scale the hotspot */
-    if (DoStretch && hotspot.x != ICON_HOTSPOT && hotspot.y != ICON_HOTSPOT)
+    if (((bmi->bmiHeader.biHeight/2 != height) || (bmi->bmiHeader.biWidth != 
width)) &&
+        hotspot.x != ICON_HOTSPOT && hotspot.y != ICON_HOTSPOT)
     {
         hotspot.x = (hotspot.x * width) / bmi->bmiHeader.biWidth;
         hotspot.y = (hotspot.y * height) / (bmi->bmiHeader.biHeight / 2);
@@ -707,8 +736,6 @@
     if (!screen_dc) screen_dc = CreateDCW( DISPLAYW, NULL, NULL, NULL );
     if (screen_dc)
     {
-        BITMAPINFO* pInfo;
-
         /* Make sure we have room for the monochrome bitmap later on.
          * Note that BITMAPINFOINFO and BITMAPCOREHEADER are the same
          * up to and including the biBitCount. In-memory icon resource
@@ -720,40 +747,47 @@
          *   BYTE            icAND[]      // DIB bits for AND mask
          */
 
-        if ((pInfo = HeapAlloc( GetProcessHeap(), 0,
-                                max(size, sizeof(BITMAPINFOHEADER) + 
2*sizeof(RGBQUAD)))))
-        {
-            memcpy( pInfo, bmi, size );
-            pInfo->bmiHeader.biHeight /= 2;
+        pSrcInfo = HeapAlloc( GetProcessHeap(), 0,
+                              max(size, sizeof(BITMAPINFOHEADER) + 
2*sizeof(RGBQUAD)));
+        pDestInfo = HeapAlloc( GetProcessHeap(), 0,
+                              max(size, sizeof(BITMAPINFOHEADER) + 
2*sizeof(RGBQUAD)));
+        if (pSrcInfo && pDestInfo)
+        {
+            memcpy( pSrcInfo, bmi, size );
+            pSrcInfo->bmiHeader.biHeight /= 2;
+
+            memcpy( pDestInfo, bmi, size );
+            pDestInfo->bmiHeader.biWidth = width;
+            pDestInfo->bmiHeader.biHeight = height;
+            pDestInfo->bmiHeader.biSizeImage = 0;
 
             /* Create the XOR bitmap */
-
-            if (DoStretch) {
-                hXorBits = CreateCompatibleBitmap(screen_dc, width, height);
+            if(pSrcInfo->bmiHeader.biBitCount == 32)
+            {
+                void *pDIBBuffer = NULL;
+                hXorBits = CreateDIBSection(screen_dc, pDestInfo, 
DIB_RGB_COLORS, &pDIBBuffer, NULL, 0);
+
                 if(hXorBits)
                 {
-                HBITMAP hOld;
-                BOOL res = FALSE;
-
-                if (!hdcMem) hdcMem = CreateCompatibleDC(screen_dc);
-                if (hdcMem) {
-                    hOld = SelectObject(hdcMem, hXorBits);
-                    res = StretchDIBits(hdcMem, 0, 0, width, height, 0, 0,
-                                        bmi->bmiHeader.biWidth, 
bmi->bmiHeader.biHeight/2,
-                                        (char*)bmi + size, pInfo, 
DIB_RGB_COLORS, SRCCOPY);
-                    SelectObject(hdcMem, hOld);
+                    if (!stretch_blt_icon(hXorBits, pDestInfo, pSrcInfo, 
(char*)bmi + size))
+                    {
+                        DeleteObject(hXorBits);
+                        hXorBits = 0;
+                    }
                 }
-                if (!res) { DeleteObject(hXorBits); hXorBits = 0; }
-              }
-            } else {
-              if (is_dib_monochrome(bmi)) {
-                  hXorBits = CreateBitmap(width, height, 1, 1, NULL);
-                  SetDIBits(screen_dc, hXorBits, 0, height,
-                     (char*)bmi + size, pInfo, DIB_RGB_COLORS);
-              }
-              else
-                  hXorBits = CreateDIBitmap(screen_dc, &pInfo->bmiHeader,
-                     CBM_INIT, (char*)bmi + size, pInfo, DIB_RGB_COLORS); 
+            }
+            else
+            {
+                hXorBits = CreateCompatibleBitmap(screen_dc, width, height);
+
+                if(hXorBits)
+                {
+                    if(!stretch_blt_icon(hXorBits, pDestInfo, pSrcInfo, 
(char*)bmi + size))
+                    {
+                        DeleteObject(hXorBits);
+                        hXorBits = 0;
+                    }
+                }
             }
 
             if( hXorBits )
@@ -762,52 +796,43 @@
                     get_dib_width_bytes( bmi->bmiHeader.biWidth,
                                          bmi->bmiHeader.biBitCount ) * abs( 
bmi->bmiHeader.biHeight ) / 2;
 
-                pInfo->bmiHeader.biBitCount = 1;
-                if (pInfo->bmiHeader.biSize != sizeof(BITMAPCOREHEADER))
+                pSrcInfo->bmiHeader.biBitCount = 1;
+                if (pSrcInfo->bmiHeader.biSize != sizeof(BITMAPCOREHEADER))
                 {
-                    RGBQUAD *rgb = pInfo->bmiColors;
-
-                    pInfo->bmiHeader.biClrUsed = 
pInfo->bmiHeader.biClrImportant = 2;
+                    RGBQUAD *rgb = pSrcInfo->bmiColors;
+
+                    pSrcInfo->bmiHeader.biClrUsed = 
pSrcInfo->bmiHeader.biClrImportant = 2;
                     rgb[0].rgbBlue = rgb[0].rgbGreen = rgb[0].rgbRed = 0x00;
                     rgb[1].rgbBlue = rgb[1].rgbGreen = rgb[1].rgbRed = 0xff;
                     rgb[0].rgbReserved = rgb[1].rgbReserved = 0;
                 }
                 else
                 {
-                    RGBTRIPLE *rgb = (RGBTRIPLE *)(((BITMAPCOREHEADER *)pInfo) 
+ 1);
+                    RGBTRIPLE *rgb = (RGBTRIPLE *)(((BITMAPCOREHEADER 
*)pSrcInfo) + 1);
 
                     rgb[0].rgbtBlue = rgb[0].rgbtGreen = rgb[0].rgbtRed = 0x00;
                     rgb[1].rgbtBlue = rgb[1].rgbtGreen = rgb[1].rgbtRed = 0xff;
                 }
 
                 /* Create the AND bitmap */
-
-            if (DoStretch) {
-              if ((hAndBits = CreateBitmap(width, height, 1, 1, NULL))) {
-                HBITMAP hOld;
-                BOOL res = FALSE;
-
-                if (!hdcMem) hdcMem = CreateCompatibleDC(screen_dc);
-                if (hdcMem) {
-                    hOld = SelectObject(hdcMem, hAndBits);
-                    res = StretchDIBits(hdcMem, 0, 0, width, height, 0, 0,
-                                        pInfo->bmiHeader.biWidth, 
pInfo->bmiHeader.biHeight,
-                                        xbits, pInfo, DIB_RGB_COLORS, SRCCOPY);
-                    SelectObject(hdcMem, hOld);
+                hAndBits = CreateBitmap(width, height, 1, 1, NULL);
+
+                if(!stretch_blt_icon(hAndBits, pDestInfo, pSrcInfo, xbits))
+                {
+                    DeleteObject(hAndBits);
+                    hAndBits = 0;
                 }
-                if (!res) { DeleteObject(hAndBits); hAndBits = 0; }
-              }
-            } else {
-              hAndBits = CreateBitmap(width, height, 1, 1, NULL);
-
-              if (hAndBits) SetDIBits(screen_dc, hAndBits, 0, height,
-                             xbits, pInfo, DIB_RGB_COLORS);
-
+
+                if( !hAndBits )
+                {
+                    DeleteObject( hXorBits );
+                    hXorBits = 0;
+                }
             }
-                if( !hAndBits ) DeleteObject( hXorBits );
-            }
-            HeapFree( GetProcessHeap(), 0, pInfo );
-        }
+        }
+
+        HeapFree( GetProcessHeap(), 0, pSrcInfo );
+        HeapFree( GetProcessHeap(), 0, pDestInfo );
     }
 
     if( !hXorBits || !hAndBits )

Modified: branches/arwinss/reactos/dll/win32/user32/message.c
URL: 
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/user32/message.c?rev=43403&r1=43402&r2=43403&view=diff
==============================================================================
--- branches/arwinss/reactos/dll/win32/user32/message.c [iso-8859-1] (original)
+++ branches/arwinss/reactos/dll/win32/user32/message.c [iso-8859-1] Mon Oct 12 
16:56:37 2009
@@ -44,6 +44,7 @@
 #include "win.h"
 #include "controls.h"
 #include "wine/debug.h"
+#include "wine/exception.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(msg);
 WINE_DECLARE_DEBUG_CHANNEL(relay);
@@ -3067,8 +3068,20 @@
       /* Process timer messages */
     if ((msg->message == WM_TIMER) || (msg->message == WM_SYSTIMER))
     {
-        if (msg->lParam) return CallWindowProcA( (WNDPROC)msg->lParam, 
msg->hwnd,
-                                                 msg->message, msg->wParam, 
GetTickCount() );
+        if (msg->lParam)
+        {
+            __TRY
+            {
+                retval = CallWindowProcA( (WNDPROC)msg->lParam, msg->hwnd,
+                                          msg->message, msg->wParam, 
GetTickCount() );
+            }
+            __EXCEPT_PAGE_FAULT
+            {
+                retval = 0;
+            }
+            __ENDTRY
+            return retval;
+        }
     }
     if (!msg->hwnd) return 0;
 
@@ -3105,7 +3118,8 @@
  * If the lpMsg parameter points to a WM_TIMER message and the
  * parameter of the WM_TIMER message is not NULL, the lParam parameter
  * points to the function that is called instead of the window
- * procedure.
+ * procedure. The function stored in lParam (timer callback) is protected
+ * from causing page-faults.
  *
  * The message must be valid.
  *
@@ -3125,8 +3139,20 @@
       /* Process timer messages */
     if ((msg->message == WM_TIMER) || (msg->message == WM_SYSTIMER))
     {
-        if (msg->lParam) return CallWindowProcW( (WNDPROC)msg->lParam, 
msg->hwnd,
-                                                 msg->message, msg->wParam, 
GetTickCount() );
+        if (msg->lParam)
+        {
+            __TRY
+            {
+                retval = CallWindowProcW( (WNDPROC)msg->lParam, msg->hwnd,
+                                          msg->message, msg->wParam, 
GetTickCount() );
+            }
+            __EXCEPT_PAGE_FAULT
+            {
+                retval = 0;
+            }
+            __ENDTRY
+            return retval;
+        }
     }
     if (!msg->hwnd) return 0;
 

Modified: branches/arwinss/reactos/dll/win32/user32/sysparams.c
URL: 
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/user32/sysparams.c?rev=43403&r1=43402&r2=43403&view=diff
==============================================================================
--- branches/arwinss/reactos/dll/win32/user32/sysparams.c [iso-8859-1] 
(original)
+++ branches/arwinss/reactos/dll/win32/user32/sysparams.c [iso-8859-1] Mon Oct 
12 16:56:37 2009
@@ -2321,8 +2321,15 @@
     WINE_SPI_FIXME(SPI_SETMOUSESONAR);          /* 0x101D  _WIN32_WINNT >= 
0x510 || _WIN32_WINDOW >= 0x490*/
     WINE_SPI_FIXME(SPI_GETMOUSECLICKLOCK);      /* 0x101E  _WIN32_WINNT >= 
0x510 || _WIN32_WINDOW >= 0x490*/
     WINE_SPI_FIXME(SPI_SETMOUSECLICKLOCK);      /* 0x101F  _WIN32_WINNT >= 
0x510 || _WIN32_WINDOW >= 0x490*/
-    WINE_SPI_FIXME(SPI_GETMOUSEVANISH);         /* 0x1020  _WIN32_WINNT >= 
0x510 || _WIN32_WINDOW >= 0x490*/
-    WINE_SPI_FIXME(SPI_SETMOUSEVANISH);         /* 0x1021  _WIN32_WINNT >= 
0x510 || _WIN32_WINDOW >= 0x490*/
+
+    case SPI_GETMOUSEVANISH:
+        ret = get_user_pref_param( 2, 0x01, pvParam );
+        break;
+
+    case SPI_SETMOUSEVANISH:
+        ret = set_user_pref_param( 2, 0x01, PtrToUlong(pvParam), fWinIni );
+        break;
+
     case SPI_GETFLATMENU:
         ret = get_user_pref_param( 2, 0x02, pvParam );
         break;
@@ -2331,8 +2338,14 @@
         ret = set_user_pref_param( 2, 0x02, PtrToUlong(pvParam), fWinIni );
         break;
 
-    WINE_SPI_FIXME(SPI_GETDROPSHADOW);          /* 0x1024  _WIN32_WINNT >= 
0x510 */
-    WINE_SPI_FIXME(SPI_SETDROPSHADOW);          /* 0x1025  _WIN32_WINNT >= 
0x510 */
+    case SPI_GETDROPSHADOW:
+        ret = get_user_pref_param( 2, 0x04, pvParam );
+        break;
+
+    case SPI_SETDROPSHADOW:
+        ret = set_user_pref_param( 2, 0x04, PtrToUlong(pvParam), fWinIni );
+        break;
+
     WINE_SPI_FIXME(SPI_GETBLOCKSENDINPUTRESETS);
     WINE_SPI_FIXME(SPI_SETBLOCKSENDINPUTRESETS);
     case SPI_GETUIEFFECTS:

Modified: branches/arwinss/reactos/dll/win32/user32/text.c
URL: 
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/user32/text.c?rev=43403&r1=43402&r2=43403&view=diff
==============================================================================
--- branches/arwinss/reactos/dll/win32/user32/text.c [iso-8859-1] (original)
+++ branches/arwinss/reactos/dll/win32/user32/text.c [iso-8859-1] Mon Oct 12 
16:56:37 2009
@@ -855,6 +855,7 @@
     int tabwidth /* to keep gcc happy */ = 0;
     int prefix_offset;
     ellipsis_data ellip;
+    int invert_y=0;
 
     TRACE("%s, %d, [%s] %08x\n", debugstr_wn (str, count), count,
         wine_dbgstr_rect(rect), flags);
@@ -898,6 +899,15 @@
         }
     }
 
+    if (GetGraphicsMode(hdc) == GM_COMPATIBLE)
+    {
+        SIZE window_ext, viewport_ext;
+        GetWindowExtEx(hdc, &window_ext);
+        GetViewportExtEx(hdc, &viewport_ext);
+        if ((window_ext.cy > 0) != (viewport_ext.cy > 0))
+            invert_y = 1;
+    }
+
     if (dtp)
     {
         lmargin = dtp->iLeftMargin;
@@ -932,7 +942,10 @@
     do
     {
        len = sizeof(line)/sizeof(line[0]);
-        last_line = !(flags & DT_NOCLIP) && y + ((flags & DT_EDITCONTROL) ? 
2*lh-1 : lh) > rect->bottom;
+       if (invert_y)
+            last_line = !(flags & DT_NOCLIP) && y - ((flags & DT_EDITCONTROL) 
? 2*lh-1 : lh) < rect->bottom;
+       else
+            last_line = !(flags & DT_NOCLIP) && y + ((flags & DT_EDITCONTROL) 
? 2*lh-1 : lh) > rect->bottom;
        strPtr = TEXT_NextLineW(hdc, strPtr, &count, line, &len, width, flags, 
&size, last_line, &p_retstr, tabwidth, &prefix_offset, &ellip);
 
        if (flags & DT_CENTER) x = (rect->left + rect->right -
@@ -1001,7 +1014,10 @@
        else if (size.cx > max_width)
            max_width = size.cx;
 
-       y += lh;
+        if (invert_y)
+           y -= lh;
+        else
+           y += lh;
         if (dtp)
             dtp->uiLengthDrawn += len;
     }

Modified: branches/arwinss/reactos/dll/win32/user32/uitools.c
URL: 
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/user32/uitools.c?rev=43403&r1=43402&r2=43403&view=diff
==============================================================================
--- branches/arwinss/reactos/dll/win32/user32/uitools.c [iso-8859-1] (original)
+++ branches/arwinss/reactos/dll/win32/user32/uitools.c [iso-8859-1] Mon Oct 12 
16:56:37 2009
@@ -1534,7 +1534,7 @@
             return DrawTextA(hdc, (LPSTR)lp, (INT)wp, rc, dtflags);
 
     case DST_ICON:
-        return DrawIcon(hdc, rc->left, rc->top, (HICON)lp);
+        return DrawIconEx(hdc, rc->left, rc->top, (HICON)lp, 0, 0, 0, NULL, 
DI_NORMAL);
 
     case DST_BITMAP:
         memdc = CreateCompatibleDC(hdc);


Reply via email to