X-Git-Url: https://git.reactos.org/?p=reactos.git;a=blobdiff_plain;f=reactos%2Fdll%2Fwin32%2Fgdi32%2Fobjects%2Fbitmap.c;h=024ac81f4cb28251e2f29040763e251f9ec53086;hp=969beb6ad44983994348fb8c161a10e9dbc4a35b;hb=b84b85e485f602343d55c7a40aa9cf1844fe999e;hpb=d53444e50b8c99331c4679c37eeba96599f6c98a diff --git a/reactos/dll/win32/gdi32/objects/bitmap.c b/reactos/dll/win32/gdi32/objects/bitmap.c index 969beb6ad44..024ac81f4cb 100644 --- a/reactos/dll/win32/gdi32/objects/bitmap.c +++ b/reactos/dll/win32/gdi32/objects/bitmap.c @@ -531,7 +531,6 @@ CreateDIBitmap( HDC hDC, return hBmp; } -#if 0 // FIXME!!! This is a victim of the Win32k Initialization BUG!!!!! /* * @implemented */ @@ -623,60 +622,6 @@ SetDIBits(HDC hDC, return LinesCopied; } -#endif - -INT -WINAPI -SetDIBits(HDC hdc, - HBITMAP hbmp, - UINT uStartScan, - UINT cScanLines, - CONST VOID *lpvBits, - CONST BITMAPINFO *lpbmi, - UINT fuColorUse) -{ - PBITMAPINFO pConvertedInfo; - UINT ConvertedInfoSize; - INT LinesCopied = 0; - UINT cjBmpScanSize = 0; - PVOID pvSafeBits = (PVOID)lpvBits; - -// This needs to be almost the sames as SetDIBitsToDevice - - if ( !cScanLines || !lpbmi || !lpvBits || (GDI_HANDLE_GET_TYPE(hbmp) != GDI_OBJECT_TYPE_BITMAP)) - return 0; - - if ( fuColorUse && fuColorUse != DIB_PAL_COLORS && fuColorUse != DIB_PAL_COLORS+1 ) - return 0; - - pConvertedInfo = ConvertBitmapInfo(lpbmi, fuColorUse, - &ConvertedInfoSize, FALSE); - if (!pConvertedInfo) - return 0; - - cjBmpScanSize = DIB_BitmapMaxBitsSize((LPBITMAPINFO)lpbmi, cScanLines); - - if ( lpvBits ) - { - pvSafeBits = RtlAllocateHeap(GetProcessHeap(), 0, cjBmpScanSize); - if (pvSafeBits) - RtlCopyMemory( pvSafeBits, lpvBits, cjBmpScanSize); - } - - LinesCopied = NtGdiSetDIBits( hdc, - hbmp, - uStartScan, - cScanLines, - pvSafeBits, - pConvertedInfo, - fuColorUse); - - if ( lpvBits != pvSafeBits) - RtlFreeHeap(RtlGetProcessHeap(), 0, pvSafeBits); - if (lpbmi != pConvertedInfo) - RtlFreeHeap(RtlGetProcessHeap(), 0, pConvertedInfo); - return LinesCopied; -} /* * @implemented