mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 16:36:33 +00:00
[WIN32K]
- only lock DC if asked to in NtGdiSetDIBits. svn path=/trunk/; revision=50948
This commit is contained in:
parent
d5954abbf2
commit
c77754b87d
1 changed files with 15 additions and 11 deletions
|
@ -336,7 +336,7 @@ NtGdiSetDIBits(
|
|||
CONST BITMAPINFO *bmi,
|
||||
UINT ColorUse)
|
||||
{
|
||||
PDC Dc;
|
||||
PDC Dc = NULL;
|
||||
INT Ret;
|
||||
NTSTATUS Status = STATUS_SUCCESS;
|
||||
|
||||
|
@ -364,21 +364,25 @@ NtGdiSetDIBits(
|
|||
return 0;
|
||||
}
|
||||
|
||||
Dc = DC_LockDc(hDC);
|
||||
if (NULL == Dc)
|
||||
/* Lock DC if asked to */
|
||||
if(ColorUse == DIB_PAL_COLORS)
|
||||
{
|
||||
EngSetLastError(ERROR_INVALID_HANDLE);
|
||||
return 0;
|
||||
}
|
||||
if (Dc->dctype == DC_TYPE_INFO)
|
||||
{
|
||||
DC_UnlockDc(Dc);
|
||||
return 0;
|
||||
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);
|
||||
|
||||
DC_UnlockDc(Dc);
|
||||
if(Dc) DC_UnlockDc(Dc);
|
||||
|
||||
return Ret;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue