return;
}
- FileName.Buffer = ExAllocatePool(PagedPool, MAX_PATH);
+ FileName.Buffer = ExAllocatePool(PagedPool, MAX_PATH * sizeof(WCHAR));
if (FileName.Buffer == NULL)
{
ExFreePool(DirInfoBuffer);
return;
}
FileName.Length = 0;
- FileName.MaximumLength = MAX_PATH;
+ FileName.MaximumLength = MAX_PATH * sizeof(WCHAR);
while (1)
{
NTSTATUS Status;
HANDLE FileHandle;
OBJECT_ATTRIBUTES ObjectAttributes;
- FILE_STANDARD_INFORMATION FileStdInfo;
PVOID Buffer = NULL;
IO_STATUS_BLOCK Iosb;
INT Error;
Error = FT_New_Memory_Face(
library,
Buffer,
- FileStdInfo.EndOfFile.u.LowPart,
+ ViewSize,
0,
&Face);
IntUnLockFreeType;
FT_Face face;
FT_GlyphSlot glyph;
LONGLONG TextLeft, RealXStart;
- ULONG TextTop, pitch, previous, BackgroundLeft;
+ ULONG TextTop, previous, BackgroundLeft;
FT_Bool use_kerning;
RECTL DestRect, MaskRect, SpecifiedDestRect;
POINTL SourcePoint, BrushOrigin;
}
}
- BitmapObj = BITMAPOBJ_LockBitmap(DC_BITMAP(dc));
+ BitmapObj = BITMAPOBJ_LockBitmap(dc->w.hBitmap);
if ( !BitmapObj )
{
goto fail;
YStart = Start.y + dc->w.DCOrgY;
/* Create the brushes */
- PalDestGDI = PALETTE_LockPalette(DC_PALETTE(dc));
+ PalDestGDI = PALETTE_LockPalette(dc->w.hPalette);
if ( !PalDestGDI )
Mode = PAL_RGB;
else
Mode = PalDestGDI->Mode;
PALETTE_UnlockPalette(PalDestGDI);
}
- XlateObj = (XLATEOBJ*)IntEngCreateXlate(Mode, PAL_RGB, DC_PALETTE(dc), NULL);
+ XlateObj = (XLATEOBJ*)IntEngCreateXlate(Mode, PAL_RGB, dc->w.hPalette, NULL);
if ( !XlateObj )
{
goto fail;
}
- hBrushFg = NtGdiCreateSolidBrush(XLATEOBJ_iXlate(XlateObj, dc->w.textColor));
+ hBrushFg = NtGdiCreateSolidBrush(XLATEOBJ_iXlate(XlateObj, dc->w.textColor), 0);
if ( !hBrushFg )
{
goto fail;
IntGdiInitBrushInstance(&BrushFgInst, BrushFg, NULL);
if ((fuOptions & ETO_OPAQUE) || dc->w.backgroundMode == OPAQUE)
{
- hBrushBg = NtGdiCreateSolidBrush(XLATEOBJ_iXlate(XlateObj, dc->w.backgroundColor));
+ hBrushBg = NtGdiCreateSolidBrush(XLATEOBJ_iXlate(XlateObj, dc->w.backgroundColor), 0);
if ( !hBrushBg )
{
goto fail;
}
IntGdiInitBrushInstance(&BrushBgInst, BrushBg, NULL);
}
- XlateObj2 = (XLATEOBJ*)IntEngCreateXlate(PAL_RGB, Mode, NULL, DC_PALETTE(dc));
+ XlateObj2 = (XLATEOBJ*)IntEngCreateXlate(PAL_RGB, Mode, NULL, dc->w.hPalette);
if ( !XlateObj2 )
{
goto fail;
DestRect.top = SpecifiedDestRect.top + dc->w.DCOrgY;
DestRect.right = SpecifiedDestRect.right + dc->w.DCOrgX;
DestRect.bottom = SpecifiedDestRect.bottom + dc->w.DCOrgY;
+ IntLPtoDP(dc, (LPPOINT)&DestRect, 2);
IntEngBitBlt(
&BitmapObj->SurfObj,
NULL,
FontGDI = ObjToGDI(FontObj, FONT);
ASSERT(FontGDI);
+ IntLockFreeType;
face = FontGDI->face;
if (face->charmap == NULL)
{
{
DPRINT1("WARNING: Could not find desired charmap!\n");
}
- IntLockFreeType;
error = FT_Set_Charmap(face, found);
- IntUnLockFreeType;
- if (error)
+ if (error)
{
DPRINT1("WARNING: Could not set the charmap!\n");
}
else
RenderMode = FT_RENDER_MODE_MONO;
- IntLockFreeType;
error = FT_Set_Pixel_Sizes(
face,
TextObj->logfont.lfWidth,
(TextObj->logfont.lfHeight < 0 ?
- TextObj->logfont.lfHeight :
TextObj->logfont.lfHeight == 0 ? 11 : TextObj->logfont.lfHeight));
- IntUnLockFreeType;
if (error)
{
DPRINT1("Error in setting pixel sizes: %u\n", error);
+ IntUnLockFreeType;
goto fail;
}
for (i = Start; i < Count; i++)
{
- IntLockFreeType;
glyph_index = FT_Get_Char_Index(face, *TempText);
error = FT_Load_Glyph(face, glyph_index, FT_LOAD_DEFAULT);
- IntUnLockFreeType;
if (error)
{
if (use_kerning && previous && glyph_index)
{
FT_Vector delta;
- IntLockFreeType;
FT_Get_Kerning(face, previous, glyph_index, 0, &delta);
- IntUnLockFreeType;
TextWidth += delta.x;
}
for (i = 0; i < Count; i++)
{
- IntLockFreeType;
glyph_index = FT_Get_Char_Index(face, *String);
error = FT_Load_Glyph(face, glyph_index, FT_LOAD_DEFAULT);
- IntUnLockFreeType;
if (error)
{
DPRINT1("WARNING: Failed to load and render glyph! [index: %u]\n", glyph_index);
+ IntUnLockFreeType;
goto fail;
}
if (use_kerning && previous && glyph_index && NULL == Dx)
{
FT_Vector delta;
- IntLockFreeType;
FT_Get_Kerning(face, previous, glyph_index, 0, &delta);
- IntUnLockFreeType;
TextLeft += delta.x;
}
if (glyph->format == ft_glyph_format_outline)
{
- IntLockFreeType;
error = FT_Render_Glyph(glyph, RenderMode);
- IntUnLockFreeType;
if (error)
{
DPRINT1("WARNING: Failed to render glyph!\n");
goto fail;
}
- pitch = glyph->bitmap.pitch;
- } else {
- pitch = glyph->bitmap.width;
}
if (fuOptions & ETO_OPAQUE)
* We should create the bitmap out of the loop at the biggest possible
* glyph size. Then use memset with 0 to clear it and sourcerect to
* limit the work of the transbitblt.
+ *
+ * FIXME: DIB bitmaps should have an lDelta which is a multiple of 4.
+ * Here we pass in the pitch from the FreeType bitmap, which is not
+ * guaranteed to be a multiple of 4. If it's not, we should expand
+ * the FreeType bitmap to a temporary bitmap.
*/
- HSourceGlyph = EngCreateBitmap(bitSize, pitch, (glyph->bitmap.pixel_mode == ft_pixel_mode_grays) ? BMF_8BPP : BMF_1BPP, BMF_TOPDOWN, glyph->bitmap.buffer);
+ HSourceGlyph = EngCreateBitmap(bitSize, glyph->bitmap.pitch,
+ (glyph->bitmap.pixel_mode == ft_pixel_mode_grays) ?
+ BMF_8BPP : BMF_1BPP, BMF_TOPDOWN,
+ glyph->bitmap.buffer);
if ( !HSourceGlyph )
{
DPRINT1("WARNING: EngLockSurface() failed!\n");
+ IntUnLockFreeType;
goto fail;
}
SourceGlyphSurf = EngLockSurface((HSURF)HSourceGlyph);
{
EngDeleteSurface((HSURF)HSourceGlyph);
DPRINT1("WARNING: EngLockSurface() failed!\n");
+ IntUnLockFreeType;
goto fail;
}
String++;
}
+ IntUnLockFreeType;
+
EngDeleteXlate(XlateObj);
EngDeleteXlate(XlateObj2);
BITMAPOBJ_UnlockBitmap(BitmapObj);
return 0;
}
-DWORD
-STDCALL
-NtGdiGetGlyphOutline(HDC hDC,
- UINT Char,
- UINT Format,
- LPGLYPHMETRICS gm,
- DWORD Bufsize,
- LPVOID Buffer,
- CONST LPMAT2 mat2)
+ULONG
+APIENTRY
+NtGdiGetGlyphOutline(
+ IN HDC hdc,
+ IN WCHAR wch,
+ IN UINT iFormat,
+ OUT LPGLYPHMETRICS pgm,
+ IN ULONG cjBuf,
+ OUT OPTIONAL PVOID pvBuf,
+ IN LPMAT2 pmat2,
+ IN BOOL bIgnoreRotation)
{
UNIMPLEMENTED;
return 0;
}
BOOL
-STDCALL
-NtGdiGetRasterizerCaps(LPRASTERIZER_STATUS rs,
- UINT Size)
+APIENTRY
+NtGdiGetRasterizerCaps(
+ OUT LPRASTERIZER_STATUS praststat,
+ IN ULONG cjBytes)
{
UNIMPLEMENTED;
return FALSE;
return 0;
}
-UINT
-STDCALL
-NtGdiGetTextCharsetInfo(HDC hDC,
- LPFONTSIGNATURE Sig,
- DWORD Flags)
+INT
+APIENTRY
+NtGdiGetTextCharsetInfo(
+ IN HDC hdc,
+ OUT OPTIONAL LPFONTSIGNATURE lpSig,
+ IN DWORD dwFlags)
{
UNIMPLEMENTED;
return 0;
return Score;
}
-static inline VOID
+static __inline VOID
FindBestFontFromList(FONTOBJ **FontObj, UINT *MatchScore, LOGFONTW *LogFont,
PUNICODE_STRING FaceName, PLIST_ENTRY Head)
{
}
}
-static inline BOOLEAN
+static __inline BOOLEAN
SubstituteFontFamilyKey(PUNICODE_STRING FaceName,
LPCWSTR Key)
{
return NT_SUCCESS(Status);
}
-static inline void
+static __inline void
SubstituteFontFamily(PUNICODE_STRING FaceName, UINT Level)
{
if (10 < Level) /* Enough is enough */