diff --git a/dll/win32/comctl32/comctl32.h b/dll/win32/comctl32/comctl32.h index fe4af2ad0d..40baabb24f 100644 --- a/dll/win32/comctl32/comctl32.h +++ b/dll/win32/comctl32/comctl32.h @@ -36,6 +36,13 @@ #include "commctrl.h" #include "windowsx.h" +#ifdef __REACTOS__ +// This is really ComCtl32 v5.82, the last one not supporting SxS +#undef COMCTL32_VERSION // Undefines what the PSDK gave to us +#define COMCTL32_VERSION 5 +#define COMCTL32_VERSION_MINOR 82 +#endif + extern HMODULE COMCTL32_hModule DECLSPEC_HIDDEN; extern HBRUSH COMCTL32_hPattern55AABrush DECLSPEC_HIDDEN; @@ -188,7 +195,9 @@ INT Str_GetPtrAtoW (LPCSTR lpSrc, LPWSTR lpDest, INT nMaxLen) DECLSPEC_HIDDEN; BOOL Str_SetPtrAtoW (LPWSTR *lppDest, LPCSTR lpSrc) DECLSPEC_HIDDEN; BOOL Str_SetPtrWtoA (LPSTR *lppDest, LPCWSTR lpSrc) DECLSPEC_HIDDEN; +#ifndef __REACTOS__ #define COMCTL32_VERSION_MINOR 81 +#endif /* Our internal stack structure of the window procedures to subclass */ typedef struct _SUBCLASSPROCS { diff --git a/dll/win32/comctl32/toolbar.c b/dll/win32/comctl32/toolbar.c index e2b6193b66..b725f3c512 100644 --- a/dll/win32/comctl32/toolbar.c +++ b/dll/win32/comctl32/toolbar.c @@ -6603,6 +6603,10 @@ TOOLBAR_Paint (TOOLBAR_INFO *infoPtr, WPARAM wParam) TRACE("psrect=(%s)\n", wine_dbgstr_rect(&ps.rcPaint)); +#ifdef __REACTOS__ + TOOLBAR_EraseBackground(infoPtr, (WPARAM)hdc, (LPARAM) 0); +#endif + TOOLBAR_Refresh (infoPtr, hdc, &ps); if (!wParam) EndPaint (infoPtr->hwndSelf, &ps); diff --git a/win32ss/gdi/ntgdi/dibobj.c b/win32ss/gdi/ntgdi/dibobj.c index 93208665b3..7b8cc330c7 100644 --- a/win32ss/gdi/ntgdi/dibobj.c +++ b/win32ss/gdi/ntgdi/dibobj.c @@ -951,25 +951,28 @@ GreGetDIBitsInternal( RECT rcDest; POINTL srcPoint; BOOL ret ; + int newLines = -1; - if (StartScan > (ULONG)psurf->SurfObj.sizlBitmap.cy) + if (StartScan >= abs(Info->bmiHeader.biHeight)) { - ScanLines = 0; + ScanLines = 1; goto done; } else { - ScanLines = min(ScanLines, psurf->SurfObj.sizlBitmap.cy - StartScan); + ScanLines = min(ScanLines, abs(Info->bmiHeader.biHeight) - StartScan); } + if (abs(Info->bmiHeader.biHeight) < psurf->SurfObj.sizlBitmap.cy) + { + StartScan += psurf->SurfObj.sizlBitmap.cy - abs(Info->bmiHeader.biHeight); + } /* Fixup values */ - Info->bmiHeader.biWidth = psurf->SurfObj.sizlBitmap.cx; Info->bmiHeader.biHeight = (height < 0) ? -(LONG)ScanLines : ScanLines; /* Create the DIB */ hBmpDest = DIB_CreateDIBSection(pDC, Info, Usage, &pDIBits, NULL, 0, 0); /* Restore them */ - Info->bmiHeader.biWidth = width; Info->bmiHeader.biHeight = height; if(!hBmpDest) @@ -982,27 +985,33 @@ GreGetDIBitsInternal( psurfDest = SURFACE_ShareLockSurface(hBmpDest); - RECTL_vSetRect(&rcDest, 0, 0, psurf->SurfObj.sizlBitmap.cx, ScanLines); - + RECTL_vSetRect(&rcDest, 0, 0, Info->bmiHeader.biWidth, ScanLines); + Info->bmiHeader.biWidth = width; srcPoint.x = 0; - if(height < 0) + if (abs(Info->bmiHeader.biHeight) <= psurf->SurfObj.sizlBitmap.cy) { - srcPoint.y = 0; - - if(ScanLines <= StartScan) - { - ScanLines = 1; - SURFACE_ShareUnlockSurface(psurfDest); - GreDeleteObject(hBmpDest); - goto done; - } - - ScanLines -= StartScan; + srcPoint.y = psurf->SurfObj.sizlBitmap.cy - StartScan - ScanLines; } else { - srcPoint.y = StartScan; + /* Determine the actual number of lines copied from the */ + /* original bitmap. It might be different from ScanLines. */ + newLines = abs(Info->bmiHeader.biHeight) - psurf->SurfObj.sizlBitmap.cy; + newLines = min((int)(StartScan + ScanLines - newLines), psurf->SurfObj.sizlBitmap.cy); + if (newLines > 0) + { + srcPoint.y = psurf->SurfObj.sizlBitmap.cy - newLines; + if (StartScan > psurf->SurfObj.sizlBitmap.cy) + { + newLines -= (StartScan - psurf->SurfObj.sizlBitmap.cy); + } + } + else + { + newLines = 0; + srcPoint.y = psurf->SurfObj.sizlBitmap.cy; + } } EXLATEOBJ_vInitialize(&exlo, psurf->ppal, psurfDest->ppal, 0xffffff, 0xffffff, 0); @@ -1022,7 +1031,11 @@ GreGetDIBitsInternal( { RtlCopyMemory(Bits, pDIBits, DIB_GetDIBImageBytes (width, ScanLines, bpp)); } - + /* Update if line count has changed */ + if (newLines != -1) + { + ScanLines = (UINT)newLines; + } GreDeleteObject(hBmpDest); EXLATEOBJ_vCleanup(&exlo); }