return result;
}
-// FIXME by Removing NtGdiSetDIBits!!!
-// This is a victim of the Win32k Initialization BUG!!!!!
-// Converts a DIB to a device-dependent bitmap
-INT
-APIENTRY
-NtGdiSetDIBits(
- HDC hDC,
- HBITMAP hBitmap,
- UINT StartScan,
- UINT ScanLines,
- CONST VOID *Bits,
- CONST BITMAPINFO *bmi,
- UINT ColorUse)
-{
- PDC Dc = NULL;
- INT Ret;
- NTSTATUS Status = STATUS_SUCCESS;
-
- if (!Bits) return 0;
-
- _SEH2_TRY
- {
- ProbeForRead(&bmi->bmiHeader.biSize, sizeof(DWORD), 1);
- ProbeForRead(bmi, bmi->bmiHeader.biSize, 1);
- ProbeForRead(bmi, DIB_BitmapInfoSize(bmi, ColorUse), 1);
- ProbeForRead(Bits,
- DIB_GetDIBImageBytes(bmi->bmiHeader.biWidth,
- ScanLines,
- bmi->bmiHeader.biBitCount),
- 1);
- }
- _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
- {
- Status = _SEH2_GetExceptionCode();
- }
- _SEH2_END
-
- if (!NT_SUCCESS(Status))
- {
- return 0;
- }
-
- /* Lock DC if asked to */
- if(ColorUse == DIB_PAL_COLORS)
- {
- Dc = DC_LockDc(hDC);
- if (NULL == Dc)
- {
- EngSetLastError(ERROR_INVALID_HANDLE);
- return 0;
- }
- if (Dc->dctype == DC_TYPE_INFO)
- {
- DC_UnlockDc(Dc);
- return 0;
- }
- }
-
- Ret = IntSetDIBits(Dc, hBitmap, StartScan, ScanLines, Bits, bmi, ColorUse);
-
- if(Dc) DC_UnlockDc(Dc);
-
- return Ret;
-}
-
W32KAPI
INT
APIENTRY