2000-06-16 07:36:10 +00:00
|
|
|
#ifdef UNICODE
|
|
|
|
#undef UNICODE
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#undef WIN32_LEAN_AND_MEAN
|
2003-02-02 19:27:17 +00:00
|
|
|
#include <string.h>
|
2000-06-16 07:36:10 +00:00
|
|
|
#include <windows.h>
|
|
|
|
#include <ddk/ntddk.h>
|
|
|
|
#include <win32k/kapi.h>
|
|
|
|
|
|
|
|
BOOL
|
|
|
|
STDCALL
|
|
|
|
TextOutA(
|
|
|
|
HDC hDC,
|
|
|
|
int XStart,
|
|
|
|
int YStart,
|
|
|
|
LPCSTR String,
|
|
|
|
int Count)
|
|
|
|
{
|
|
|
|
ANSI_STRING StringA;
|
|
|
|
UNICODE_STRING StringU;
|
|
|
|
BOOL ret;
|
|
|
|
|
|
|
|
if (NULL != String)
|
|
|
|
{
|
|
|
|
RtlInitAnsiString(&StringA, (LPSTR)String);
|
|
|
|
RtlAnsiStringToUnicodeString(&StringU, &StringA, TRUE);
|
|
|
|
} else
|
|
|
|
StringU.Buffer = NULL;
|
|
|
|
|
|
|
|
ret = TextOutW(hDC, XStart, YStart, StringU.Buffer, Count);
|
|
|
|
RtlFreeUnicodeString(&StringU);
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
BOOL
|
|
|
|
STDCALL
|
|
|
|
TextOutW(
|
|
|
|
HDC hDC,
|
|
|
|
int XStart,
|
|
|
|
int YStart,
|
|
|
|
LPCWSTR String,
|
|
|
|
int Count)
|
|
|
|
{
|
|
|
|
return W32kTextOut(hDC, XStart, YStart, String, Count);
|
|
|
|
}
|
2001-05-02 12:35:06 +00:00
|
|
|
|
2002-09-17 23:41:44 +00:00
|
|
|
COLORREF STDCALL
|
|
|
|
SetTextColor(HDC hDC, COLORREF color)
|
2001-05-02 12:35:06 +00:00
|
|
|
{
|
2002-09-17 23:41:44 +00:00
|
|
|
return(W32kSetTextColor(hDC, color));
|
2001-05-02 12:35:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
BOOL
|
|
|
|
STDCALL
|
|
|
|
GetTextMetricsA(
|
|
|
|
HDC hdc,
|
2003-03-25 22:35:19 +00:00
|
|
|
LPTEXTMETRICA tm
|
2001-05-02 12:35:06 +00:00
|
|
|
)
|
|
|
|
{
|
2003-03-25 22:35:19 +00:00
|
|
|
return W32kGetTextMetrics(hdc, (LPTEXTMETRICW) tm);
|
2001-05-02 12:35:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
BOOL
|
|
|
|
STDCALL
|
|
|
|
GetTextMetricsW(
|
|
|
|
HDC hdc,
|
2003-03-25 22:35:19 +00:00
|
|
|
LPTEXTMETRICW tm
|
2001-05-02 12:35:06 +00:00
|
|
|
)
|
|
|
|
{
|
|
|
|
return W32kGetTextMetrics(hdc, tm);
|
|
|
|
}
|
|
|
|
|
|
|
|
BOOL
|
|
|
|
APIENTRY
|
|
|
|
GetTextExtentPointA(
|
|
|
|
HDC hDC,
|
|
|
|
LPCSTR String,
|
|
|
|
int Count,
|
|
|
|
LPSIZE Size
|
|
|
|
)
|
|
|
|
{
|
|
|
|
ANSI_STRING StringA;
|
|
|
|
UNICODE_STRING StringU;
|
|
|
|
BOOL ret;
|
|
|
|
|
|
|
|
RtlInitAnsiString(&StringA, (LPSTR)String);
|
|
|
|
RtlAnsiStringToUnicodeString(&StringU, &StringA, TRUE);
|
|
|
|
|
|
|
|
ret = GetTextExtentPointW(hDC, StringU.Buffer, Count, Size);
|
|
|
|
|
|
|
|
RtlFreeUnicodeString(&StringU);
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
BOOL
|
|
|
|
APIENTRY
|
|
|
|
GetTextExtentPointW(
|
|
|
|
HDC hDC,
|
|
|
|
LPCWSTR String,
|
|
|
|
int Count,
|
|
|
|
LPSIZE Size
|
|
|
|
)
|
|
|
|
{
|
|
|
|
return W32kGetTextExtentPoint(hDC, String, Count, Size);
|
|
|
|
}
|
|
|
|
|
|
|
|
BOOL
|
|
|
|
STDCALL
|
|
|
|
ExtTextOutA(
|
|
|
|
HDC hDC,
|
|
|
|
int X,
|
|
|
|
int Y,
|
|
|
|
UINT Options,
|
|
|
|
CONST RECT *Rect,
|
|
|
|
LPCSTR String,
|
|
|
|
UINT Count,
|
|
|
|
CONST INT *Spacings
|
|
|
|
)
|
|
|
|
{
|
|
|
|
ANSI_STRING StringA;
|
|
|
|
UNICODE_STRING StringU;
|
|
|
|
BOOL ret;
|
|
|
|
|
|
|
|
RtlInitAnsiString(&StringA, (LPSTR)String);
|
|
|
|
RtlAnsiStringToUnicodeString(&StringU, &StringA, TRUE);
|
|
|
|
|
|
|
|
ret = ExtTextOutW(hDC, X, Y, Options, Rect, StringU.Buffer, Count, Spacings);
|
|
|
|
|
|
|
|
RtlFreeUnicodeString(&StringU);
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
BOOL
|
|
|
|
STDCALL
|
|
|
|
ExtTextOutW(
|
|
|
|
HDC hDC,
|
|
|
|
int X,
|
|
|
|
int Y,
|
|
|
|
UINT Options,
|
|
|
|
CONST RECT *Rect,
|
|
|
|
LPCWSTR String,
|
|
|
|
UINT Count,
|
|
|
|
CONST INT *Spacings
|
|
|
|
)
|
|
|
|
{
|
|
|
|
return W32kTextOut(hDC, X, Y, String, Count);
|
|
|
|
}
|
|
|
|
|
|
|
|
HFONT
|
|
|
|
STDCALL
|
|
|
|
CreateFontIndirectA(
|
2003-03-26 08:11:53 +00:00
|
|
|
CONST LOGFONTA *lf
|
2001-05-02 12:35:06 +00:00
|
|
|
)
|
|
|
|
{
|
|
|
|
ANSI_STRING StringA;
|
|
|
|
UNICODE_STRING StringU;
|
2001-06-29 19:34:35 +00:00
|
|
|
HFONT ret;
|
2003-03-26 08:11:53 +00:00
|
|
|
LOGFONTW tlf;
|
2001-05-02 12:35:06 +00:00
|
|
|
|
|
|
|
RtlInitAnsiString(&StringA, (LPSTR)lf->lfFaceName);
|
|
|
|
RtlAnsiStringToUnicodeString(&StringU, &StringA, TRUE);
|
2003-03-26 08:11:53 +00:00
|
|
|
memcpy(&tlf, lf, sizeof(LOGFONTA));
|
2001-05-02 12:35:06 +00:00
|
|
|
memcpy(&tlf.lfFaceName, &StringU.Buffer, StringU.Length);
|
|
|
|
|
2003-03-26 08:11:53 +00:00
|
|
|
ret = CreateFontIndirectW(&tlf);
|
2001-05-02 12:35:06 +00:00
|
|
|
|
|
|
|
RtlFreeUnicodeString(&StringU);
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
HFONT
|
|
|
|
STDCALL
|
|
|
|
CreateFontIndirectW(
|
2003-03-26 08:11:53 +00:00
|
|
|
CONST LOGFONTW *lf
|
2001-05-02 12:35:06 +00:00
|
|
|
)
|
|
|
|
{
|
2003-03-26 08:11:53 +00:00
|
|
|
return W32kCreateFontIndirect((CONST LPLOGFONTW)lf);
|
2001-05-02 12:35:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
HFONT
|
|
|
|
STDCALL
|
|
|
|
CreateFontA(
|
|
|
|
int Height,
|
|
|
|
int Width,
|
|
|
|
int Escapement,
|
|
|
|
int Orientation,
|
|
|
|
int Weight,
|
|
|
|
DWORD Italic,
|
|
|
|
DWORD Underline,
|
|
|
|
DWORD StrikeOut,
|
|
|
|
DWORD CharSet,
|
|
|
|
DWORD OutputPrecision,
|
|
|
|
DWORD ClipPrecision,
|
|
|
|
DWORD Quality,
|
|
|
|
DWORD PitchAndFamily,
|
|
|
|
LPCSTR Face
|
|
|
|
)
|
|
|
|
{
|
|
|
|
ANSI_STRING StringA;
|
|
|
|
UNICODE_STRING StringU;
|
2001-06-29 19:34:35 +00:00
|
|
|
HFONT ret;
|
2001-05-02 12:35:06 +00:00
|
|
|
|
|
|
|
RtlInitAnsiString(&StringA, (LPSTR)Face);
|
|
|
|
RtlAnsiStringToUnicodeString(&StringU, &StringA, TRUE);
|
|
|
|
|
|
|
|
ret = CreateFontW(Height, Width, Escapement, Orientation, Weight, Italic, Underline, StrikeOut,
|
|
|
|
CharSet, OutputPrecision, ClipPrecision, Quality, PitchAndFamily, StringU.Buffer);
|
|
|
|
|
|
|
|
RtlFreeUnicodeString(&StringU);
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
HFONT
|
|
|
|
STDCALL
|
|
|
|
CreateFontW(
|
|
|
|
int Height,
|
|
|
|
int Width,
|
|
|
|
int Escapement,
|
|
|
|
int Orientation,
|
|
|
|
int Weight,
|
|
|
|
DWORD Italic,
|
|
|
|
DWORD Underline,
|
|
|
|
DWORD StrikeOut,
|
|
|
|
DWORD CharSet,
|
|
|
|
DWORD OutputPrecision,
|
|
|
|
DWORD ClipPrecision,
|
|
|
|
DWORD Quality,
|
|
|
|
DWORD PitchAndFamily,
|
|
|
|
LPCWSTR Face
|
|
|
|
)
|
|
|
|
{
|
|
|
|
return W32kCreateFont(Height, Width, Escapement, Orientation, Weight, Italic, Underline, StrikeOut,
|
|
|
|
CharSet, OutputPrecision, ClipPrecision, Quality, PitchAndFamily, Face);
|
|
|
|
}
|
2002-09-17 23:41:44 +00:00
|
|
|
|