Author: akhaldi
Date: Tue Jan 19 21:57:30 2016
New Revision: 70620
URL:
http://svn.reactos.org/svn/reactos?rev=70620&view=rev
Log:
[0.4.0] * Merge the win32k fixes by Timo in revisions 70482, 70485, 70486 and 70487.
CORE-10807
Modified:
branches/ros-branch-0_4_0/ (props changed)
branches/ros-branch-0_4_0/reactos/ (props changed)
branches/ros-branch-0_4_0/reactos/win32ss/gdi/ntgdi/bitmaps.c
branches/ros-branch-0_4_0/reactos/win32ss/gdi/ntgdi/bitmaps.h
branches/ros-branch-0_4_0/reactos/win32ss/gdi/ntgdi/dibobj.c
branches/ros-branch-0_4_0/reactos/win32ss/gdi/ntgdi/palette.c
Propchange: branches/ros-branch-0_4_0/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jan 19 21:57:30 2016
@@ -1 +1 @@
-/trunk:70000-70321,70323-70324,70328-70337,70339-70340,70347,70349,70354-70358,70360,70363,70369,70373,70375-70378,70381,70384-70385,70387-70389,70398,70400,70408,70424,70433-70437,70443,70445-70449,70454,70464,70468,70470,70477,70480,70497,70499-70501,70507-70510,70512-70513,70523,70527-70530,70536-70537,70545-70548,70552-70554,70557-70558,70576-70578,70583,70597,70606
+/trunk:70000-70321,70323-70324,70328-70337,70339-70340,70347,70349,70354-70358,70360,70363,70369,70373,70375-70378,70381,70384-70385,70387-70389,70398,70400,70408,70424,70433-70437,70443,70445-70449,70454,70464,70468,70470,70477,70480,70482,70485-70487,70497,70499-70501,70507-70510,70512-70513,70523,70527-70530,70536-70537,70545-70548,70552-70554,70557-70558,70576-70578,70583,70597,70606
Propchange: branches/ros-branch-0_4_0/reactos/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jan 19 21:57:30 2016
@@ -20,4 +20,4 @@
/branches/usb-bringup:51335,51337,51341-51343,51348,51350,51353,51355,51365-51369,51372,51384-54388,54396-54398,54736-54737,54752-54754,54756-54760,54762,54764-54765,54767-54768,54772,54774-54777,54781,54787,54790-54792,54797-54798,54806,54808,54834-54838,54843,54850,54852,54856,54858-54859
/branches/usb-bringup-trunk:55019-55543,55548-55554,55556-55567
/branches/wlan-bringup:54809-54998
-/trunk/reactos:70000-70321,70323-70324,70328-70337,70339-70340,70347,70349,70354-70358,70360,70363,70369,70373,70375-70378,70381,70384-70385,70387-70389,70398,70400,70408,70424,70433-70437,70443,70445-70449,70454,70464,70468,70470,70477,70480,70497,70501,70507-70510,70523,70527-70530,70536-70537,70545-70548,70552-70554,70557-70558,70576-70578,70583,70597,70606
+/trunk/reactos:70000-70321,70323-70324,70328-70337,70339-70340,70347,70349,70354-70358,70360,70363,70369,70373,70375-70378,70381,70384-70385,70387-70389,70398,70400,70408,70424,70433-70437,70443,70445-70449,70454,70464,70468,70470,70477,70480,70482,70485-70487,70497,70501,70507-70510,70523,70527-70530,70536-70537,70545-70548,70552-70554,70557-70558,70576-70578,70583,70597,70606
Modified: branches/ros-branch-0_4_0/reactos/win32ss/gdi/ntgdi/bitmaps.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-branch-0_4_0/reactos/win32s…
==============================================================================
--- branches/ros-branch-0_4_0/reactos/win32ss/gdi/ntgdi/bitmaps.c [iso-8859-1] (original)
+++ branches/ros-branch-0_4_0/reactos/win32ss/gdi/ntgdi/bitmaps.c [iso-8859-1] Tue Jan 19
21:57:30 2016
@@ -42,15 +42,15 @@
return GreSetObjectOwner(hbmp, ulOwner);
}
-static
-int
+BOOL
NTAPI
UnsafeSetBitmapBits(
- PSURFACE psurf,
- IN ULONG cjBits,
- IN PVOID pvBits)
-{
- PUCHAR pjDst, pjSrc;
+ _Inout_ PSURFACE psurf,
+ _In_ ULONG cjBits,
+ _In_ const VOID *pvBits)
+{
+ PUCHAR pjDst;
+ const UCHAR *pjSrc;
LONG lDeltaDst, lDeltaSrc;
ULONG nWidth, nHeight, cBitsPixel;
NT_ASSERT(psurf->flags & API_BITMAP);
@@ -69,7 +69,7 @@
/* Make sure the buffer is large enough*/
if (cjBits < (lDeltaSrc * nHeight))
- return 0;
+ return FALSE;
while (nHeight--)
{
@@ -79,7 +79,7 @@
pjDst += lDeltaDst;
}
- return 1;
+ return TRUE;
}
HBITMAP
Modified: branches/ros-branch-0_4_0/reactos/win32ss/gdi/ntgdi/bitmaps.h
URL:
http://svn.reactos.org/svn/reactos/branches/ros-branch-0_4_0/reactos/win32s…
==============================================================================
--- branches/ros-branch-0_4_0/reactos/win32ss/gdi/ntgdi/bitmaps.h [iso-8859-1] (original)
+++ branches/ros-branch-0_4_0/reactos/win32ss/gdi/ntgdi/bitmaps.h [iso-8859-1] Tue Jan 19
21:57:30 2016
@@ -43,3 +43,10 @@
IN FLONG fl,
IN UINT cjMaxBits,
IN HANDLE hcmXform);
+
+BOOL
+NTAPI
+UnsafeSetBitmapBits(
+ _Inout_ PSURFACE psurf,
+ _In_ ULONG cjBits,
+ _In_ const VOID *pvBits);
Modified: branches/ros-branch-0_4_0/reactos/win32ss/gdi/ntgdi/dibobj.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-branch-0_4_0/reactos/win32s…
==============================================================================
--- branches/ros-branch-0_4_0/reactos/win32ss/gdi/ntgdi/dibobj.c [iso-8859-1] (original)
+++ branches/ros-branch-0_4_0/reactos/win32ss/gdi/ntgdi/dibobj.c [iso-8859-1] Tue Jan 19
21:57:30 2016
@@ -261,16 +261,10 @@
PPALETTE ppalDIB = 0;
ULONG cjSizeImage;
- if (!bmi) return 0;
-
- /* Check if the header provided an image size */
- if (bmi->bmiHeader.biSizeImage != 0)
- {
- /* Use the given size */
- cjSizeImage = bmi->bmiHeader.biSizeImage;
- }
- /* Otherwise check for uncompressed formats */
- else if ((bmi->bmiHeader.biCompression == BI_RGB) ||
+ if (!bmi || !Bits) return 0;
+
+ /* Check for uncompressed formats */
+ if ((bmi->bmiHeader.biCompression == BI_RGB) ||
(bmi->bmiHeader.biCompression == BI_BITFIELDS))
{
/* Calculate the image size */
@@ -278,6 +272,12 @@
ScanLines,
bmi->bmiHeader.biBitCount);
}
+ /* Check if the header provided an image size */
+ else if (bmi->bmiHeader.biSizeImage != 0)
+ {
+ /* Use the given size */
+ cjSizeImage = bmi->bmiHeader.biSizeImage;
+ }
else
{
/* Compressed format without a size. This is invalid. */
@@ -286,9 +286,9 @@
}
/* Check if the size that we have is ok */
- if (cjSizeImage > cjMaxBits)
- {
- DPRINT1("Size too large! cjSizeImage = %lu, cjMaxBits = %lu\n",
+ if ((cjSizeImage > cjMaxBits) || (cjSizeImage == 0))
+ {
+ DPRINT1("Invalid bitmap size! cjSizeImage = %lu, cjMaxBits = %lu\n",
cjSizeImage, cjMaxBits);
return 0;
}
@@ -340,8 +340,6 @@
rcDst.right = psurfDst->SurfObj.sizlBitmap.cx;
ptSrc.x = 0;
ptSrc.y = 0;
-
- NT_ASSERT(psurfSrc->SurfObj.cjBits <= cjMaxBits);
result = IntEngCopyBits(&psurfDst->SurfObj,
&psurfSrc->SurfObj,
@@ -1456,6 +1454,11 @@
PBYTE safeBits = NULL;
HBITMAP hbmResult = NULL;
+ if (pjInit == NULL)
+ {
+ fInit &= ~CBM_INIT;
+ }
+
if(pjInit && (fInit & CBM_INIT))
{
if (cjMaxBits == 0) return NULL;
Modified: branches/ros-branch-0_4_0/reactos/win32ss/gdi/ntgdi/palette.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-branch-0_4_0/reactos/win32s…
==============================================================================
--- branches/ros-branch-0_4_0/reactos/win32ss/gdi/ntgdi/palette.c [iso-8859-1] (original)
+++ branches/ros-branch-0_4_0/reactos/win32ss/gdi/ntgdi/palette.c [iso-8859-1] Tue Jan 19
21:57:30 2016
@@ -786,9 +786,6 @@
{
PPALETTE palPtr;
UINT pal_entries;
- HDC hDC;
- PDC dc;
- PWND Wnd;
const PALETTEENTRY *pptr = PaletteColors;
palPtr = PALETTE_ShareLockPalette(hPal);
@@ -816,6 +813,16 @@
PALETTE_ShareUnlockPalette(palPtr);
+#if 0
+/* FIXME: This is completely broken! We cannot call UserGetDesktopWindow
+ without first acquiring the USER lock. But the whole process here is
+ screwed anyway. Instead of messing with the desktop DC, we need to
+ check, whether the palette is associated with a PDEV and whether that
+ PDEV supports palette operations. Then we need to call pfnDrvSetPalette.
+ But since IntGdiRealizePalette() is not even implemented for direct DCs,
+ we can as well just do nothing, that will at least not ASSERT!
+ I leave the whole thing here, to scare people away, who want to "fix" it.
*/
+
/* Immediately apply the new palette if current window uses it */
Wnd = UserGetDesktopWindow();
hDC = UserGetWindowDC(Wnd);
@@ -831,6 +838,7 @@
DC_UnlockDc(dc);
}
UserReleaseDC(Wnd,hDC, FALSE);
+#endif // 0
}
return ret;
}