mirror of
https://github.com/reactos/reactos.git
synced 2024-10-15 05:37:44 +00:00
Fix memory DC so CreateCompatibleDC with null will create it. Based on msdn2 info, we need to setup display surface, etc.
svn path=/trunk/; revision=28375
This commit is contained in:
parent
f0415590e9
commit
2a6ac07ef7
|
@ -789,15 +789,12 @@ GetObjectType(
|
|||
case GDI_OBJECT_TYPE_ENHMETAFILE:
|
||||
Ret = OBJ_ENHMETAFILE;
|
||||
break;
|
||||
case GDI_OBJECT_TYPE_ENHMETADC:
|
||||
Ret = OBJ_ENHMETADC;
|
||||
case GDI_OBJECT_TYPE_METADC:
|
||||
Ret = OBJ_METADC;
|
||||
break;
|
||||
case GDI_OBJECT_TYPE_EXTPEN:
|
||||
Ret = OBJ_EXTPEN;
|
||||
break;
|
||||
case GDI_OBJECT_TYPE_MEMDC:
|
||||
Ret = OBJ_MEMDC;
|
||||
break;
|
||||
|
||||
default:
|
||||
DPRINT1("GetObjectType: Magic 0x%08x not implemented\n", Type);
|
||||
|
|
|
@ -166,6 +166,7 @@ NtGdiCreateCompatibleDC(HDC hDC)
|
|||
HDC hNewDC, DisplayDC;
|
||||
HRGN hVisRgn;
|
||||
UNICODE_STRING DriverName;
|
||||
INT DC_Type = DC_TYPE_DIRECT;
|
||||
|
||||
DisplayDC = NULL;
|
||||
if (hDC == NULL)
|
||||
|
@ -177,6 +178,7 @@ NtGdiCreateCompatibleDC(HDC hDC)
|
|||
return NULL;
|
||||
}
|
||||
hDC = DisplayDC;
|
||||
DC_Type = DC_TYPE_MEMORY; // Null hDC == Memory DC.
|
||||
}
|
||||
|
||||
/* Allocate a new DC based on the original DC's device */
|
||||
|
@ -205,6 +207,7 @@ NtGdiCreateCompatibleDC(HDC hDC)
|
|||
/* Copy information from original DC to new DC */
|
||||
NewDC->hSelf = hNewDC;
|
||||
NewDC->IsIC = FALSE;
|
||||
NewDC->DC_Type = DC_Type;
|
||||
|
||||
NewDC->PDev = OrigDC->PDev;
|
||||
memcpy(NewDC->FillPatternSurfaces,
|
||||
|
@ -891,6 +894,7 @@ IntGdiCreateDC(PUNICODE_STRING Driver,
|
|||
return NULL;
|
||||
}
|
||||
|
||||
NewDC->DC_Type = DC_TYPE_DIRECT;
|
||||
NewDC->IsIC = CreateAsIC;
|
||||
NewDC->DevInfo = &PrimarySurface.DevInfo;
|
||||
NewDC->GDIInfo = &PrimarySurface.GDIInfo;
|
||||
|
@ -2174,12 +2178,7 @@ NtGdiGetDCDword(
|
|||
case GdiGetFontLanguageInfo:
|
||||
break;
|
||||
case GdiGetIsMemDc:
|
||||
{
|
||||
if (dc->w.flags & DC_MEMORY)
|
||||
SafeResult = DC_TYPE_MEMORY; // = dc->DC_Type;
|
||||
else
|
||||
SafeResult = DC_TYPE_DIRECT;
|
||||
}
|
||||
SafeResult = dc->DC_Type;
|
||||
break;
|
||||
case GdiGetMapMode:
|
||||
SafeResult = dc->Dc_Attr.iMapMode;
|
||||
|
|
|
@ -84,8 +84,6 @@ GDI_OBJ_INFO ObjInfo[] =
|
|||
{GDI_OBJECT_TYPE_METADC, sizeof(DC), GDI_CleanupDummy},
|
||||
{GDI_OBJECT_TYPE_METAFILE, sizeof(DC), GDI_CleanupDummy},
|
||||
{GDI_OBJECT_TYPE_ENHMETAFILE, 0, GDI_CleanupDummy},
|
||||
{GDI_OBJECT_TYPE_ENHMETADC, 0, GDI_CleanupDummy},
|
||||
{GDI_OBJECT_TYPE_MEMDC, 0, GDI_CleanupDummy},
|
||||
{GDI_OBJECT_TYPE_EMF, 0, GDI_CleanupDummy}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue