📄 winddi.h
字号:
/*++
Copyright (c) Microsoft Corporation. All rights reserved.
Module Name:
winddi.h
Abstract:
Private entry points, defines and types for Windows NT GDI device
driver interface.
--*/
#ifndef _WINDDI_
#define _WINDDI_
//
// GUID definitions for use with kernel-mode GDI drivers
//
#ifndef _NO_DDRAWINT_NO_COM
#ifndef EXTERN_C
#ifdef __cplusplus
#define EXTERN_C extern "C"
#else // !defined(__cplusplus)
#define EXTERN_C extern
#endif // !defined(__cplusplus)
#endif // !defined(EXTERN_C)
#ifndef DEFINE_GUID
#ifndef INITGUID
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
EXTERN_C const GUID FAR name
#else // !defined(INITGUID)
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
EXTERN_C const GUID name \
= { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }
#endif // !defined(INITGUID)
#endif // !defined(DEFINE_GUID)
#ifndef DEFINE_GUIDEX
#define DEFINE_GUIDEX(name) EXTERN_C const CDECL GUID name
#endif // !defined(DEFINE_GUIDEX)
#ifndef STATICGUIDOF
#define STATICGUIDOF(guid) STATIC_##guid
#endif // !defined(STATICGUIDOF)
#ifndef GUID_DEFINED
#define GUID_DEFINED
typedef struct _GUID {
ULONG Data1;
USHORT Data2;
USHORT Data3;
UCHAR Data4[8];
} GUID;
#endif // !defined(GUID_DEFINED)
#ifndef IsEqualGUID
#define IsEqualGUID(guid1, guid2) \
(!memcmp((guid1), (guid2), sizeof(GUID)))
#endif // !defined(IsEqualGUID)
#ifndef IsEqualIID
#define IsEqualIID IsEqualGUID
#endif // !defined(IsEqualIID)
#endif // !defined(_NO_DDRAWINT_NO_COM)
//
// Standard DirectX HAL includes
//
#include <ddrawint.h>
#include <d3dnthal.h>
#ifdef __cplusplus
extern "C" {
#endif
//
// drivers and other components that include this should NOT include
// windows.h They should be system conponents that only use GDI internals
// and therefore only include wingdi.h
//
#if defined(_X86_) && !defined(USERMODE_DRIVER) && !defined(BUILD_WOW6432)
//
// x86 does not support floating-point instruction in the kernel mode,
// the floating-point data would like be handled 32bits value as double words.
//
typedef DWORD FLOATL;
#else
//
// Any platform that has support for floats in the kernel
//
typedef FLOAT FLOATL;
#endif // _X86_
typedef LONG PTRDIFF;
typedef PTRDIFF *PPTRDIFF;
typedef LONG FIX;
typedef FIX *PFIX;
typedef ULONG ROP4;
typedef ULONG MIX;
typedef ULONG HGLYPH;
typedef HGLYPH *PHGLYPH;
#define HGLYPH_INVALID ((HGLYPH)-1)
typedef ULONG IDENT;
//
// handles for font file and font context objects
//
typedef ULONG_PTR HFF;
typedef ULONG_PTR HFC;
#define HFF_INVALID ((HFF) 0)
#define HFC_INVALID ((HFC) 0)
#define FD_ERROR 0xFFFFFFFF
#define DDI_ERROR 0xFFFFFFFF
typedef struct _POINTE /* pte */
{
FLOATL x;
FLOATL y;
} POINTE, *PPOINTE;
typedef union _FLOAT_LONG
{
FLOATL e;
LONG l;
} FLOAT_LONG, *PFLOAT_LONG;
typedef struct _POINTFIX
{
FIX x;
FIX y;
} POINTFIX, *PPOINTFIX;
typedef struct _RECTFX
{
FIX xLeft;
FIX yTop;
FIX xRight;
FIX yBottom;
} RECTFX, *PRECTFX;
DECLARE_HANDLE(HBM);
DECLARE_HANDLE(HDEV);
DECLARE_HANDLE(HSURF);
DECLARE_HANDLE(DHSURF);
DECLARE_HANDLE(DHPDEV);
DECLARE_HANDLE(HDRVOBJ);
#define LTOFX(x) ((x)<<4)
#define FXTOL(x) ((x)>>4)
#define FXTOLFLOOR(x) ((x)>>4)
#define FXTOLCEILING(x) ((x + 0x0F)>>4)
#define FXTOLROUND(x) ((((x) >> 3) + 1) >> 1)
// context information
typedef struct _FD_XFORM {
FLOATL eXX;
FLOATL eXY;
FLOATL eYX;
FLOATL eYY;
} FD_XFORM, *PFD_XFORM;
typedef struct _FD_DEVICEMETRICS { // devm
FLONG flRealizedType;
POINTE pteBase;
POINTE pteSide;
LONG lD;
FIX fxMaxAscender;
FIX fxMaxDescender;
POINTL ptlUnderline1;
POINTL ptlStrikeOut;
POINTL ptlULThickness;
POINTL ptlSOThickness;
ULONG cxMax; // max pel width of bitmaps
// the fields formerly in REALIZE_EXTRA as well as some new fields:
ULONG cyMax; // did not use to be here
ULONG cjGlyphMax; // (cxMax + 7)/8 * cyMax, or at least it should be
FD_XFORM fdxQuantized;
LONG lNonLinearExtLeading;
LONG lNonLinearIntLeading;
LONG lNonLinearMaxCharWidth;
LONG lNonLinearAvgCharWidth;
// some new fields
LONG lMinA;
LONG lMinC;
LONG lMinD;
LONG alReserved[1]; // just in case we need it.
} FD_DEVICEMETRICS, *PFD_DEVICEMETRICS;
typedef struct _LIGATURE { /* lig */
ULONG culSize;
LPWSTR pwsz;
ULONG chglyph;
HGLYPH ahglyph[1];
} LIGATURE, *PLIGATURE;
typedef struct _FD_LIGATURE {
ULONG culThis;
ULONG ulType;
ULONG cLigatures;
LIGATURE alig[1];
} FD_LIGATURE;
// glyph handle must be 32 bit
// signed 16 bit integer type denoting number of FUnit's
typedef SHORT FWORD;
// point in the 32.32 bit precission
typedef struct _POINTQF // ptq
{
LARGE_INTEGER x;
LARGE_INTEGER y;
} POINTQF, *PPOINTQF;
//. Structures
// devm.flRealizedType flags
// FDM_TYPE_ZERO_BEARINGS // all glyphs have zero a and c spaces
// the following two features refer to all glyphs in this font realization
// FDM_TYPE_CHAR_INC_EQUAL_BM_BASE // base width == cx for horiz, == cy for vert.
// FDM_TYPE_MAXEXT_EQUAL_BM_SIDE // side width == cy for horiz, == cx for vert.
#define FDM_TYPE_BM_SIDE_CONST 0x00000001
#define FDM_TYPE_MAXEXT_EQUAL_BM_SIDE 0x00000002
#define FDM_TYPE_CHAR_INC_EQUAL_BM_BASE 0x00000004
#define FDM_TYPE_ZERO_BEARINGS 0x00000008
#define FDM_TYPE_CONST_BEARINGS 0x00000010
// structures for describing a supported set of glyphs in a font
typedef struct _WCRUN {
WCHAR wcLow; // lowest character in run inclusive
USHORT cGlyphs; // wcHighInclusive = wcLow + cGlyphs - 1;
HGLYPH *phg; // pointer to an array of cGlyphs HGLYPH's
} WCRUN, *PWCRUN;
// If phg is set to (HGLYPH *)NULL, for all wc's in this particular run
// the handle can be computed as simple zero extension:
// HGLYPH hg = (HGLYPH) wc;
//
// If phg is not NULL, memory pointed to by phg, allocated by the driver,
// WILL NOT MOVE.
typedef struct _FD_GLYPHSET {
ULONG cjThis; // size of this structure in butes
FLONG flAccel; // accel flags, bits to be explained below
ULONG cGlyphsSupported; // sum over all wcrun's of wcrun.cGlyphs
ULONG cRuns;
WCRUN awcrun[1]; // an array of cRun WCRUN structures
} FD_GLYPHSET, *PFD_GLYPHSET;
typedef struct _FD_GLYPHATTR {
ULONG cjThis; // size of this structure in butes
ULONG cGlyphs;
ULONG iMode;
BYTE aGlyphAttr[1]; // an array of byte
} FD_GLYPHATTR, *PFD_GLYPHATTR;
// If GS_UNICODE_HANDLES bit is set,
// for ALL WCRUNS in this FD_GLYPHSET the handles are
// obtained by zero extending unicode code points of
// the corresponding supported glyphs, i.e. all gs.phg's are NULL
#define GS_UNICODE_HANDLES 0x00000001
// If GS_8BIT_HANDLES bit is set, all handles are in 0-255 range.
// This is just an ansi font then and we are really making up all
// the unicode stuff about this font.
#define GS_8BIT_HANDLES 0x00000002
// all handles fit in 16 bits.
// to 8 bit handles as it should.
#define GS_16BIT_HANDLES 0x00000004
// ligatures
typedef struct _FD_KERNINGPAIR {
WCHAR wcFirst;
WCHAR wcSecond;
FWORD fwdKern;
} FD_KERNINGPAIR;
// IFIMETRICS constants
#define FM_VERSION_NUMBER 0x0
//
// IFIMETRICS::fsType flags
//
#define FM_TYPE_LICENSED 0x2
#define FM_READONLY_EMBED 0x4
#define FM_EDITABLE_EMBED 0x8
#define FM_NO_EMBEDDING FM_TYPE_LICENSED
//
// IFIMETRICS::flInfo flags
//
#define FM_INFO_TECH_TRUETYPE 0x00000001
#define FM_INFO_TECH_BITMAP 0x00000002
#define FM_INFO_TECH_STROKE 0x00000004
#define FM_INFO_TECH_OUTLINE_NOT_TRUETYPE 0x00000008
#define FM_INFO_ARB_XFORMS 0x00000010
#define FM_INFO_1BPP 0x00000020
#define FM_INFO_4BPP 0x00000040
#define FM_INFO_8BPP 0x00000080
#define FM_INFO_16BPP 0x00000100
#define FM_INFO_24BPP 0x00000200
#define FM_INFO_32BPP 0x00000400
#define FM_INFO_INTEGER_WIDTH 0x00000800
#define FM_INFO_CONSTANT_WIDTH 0x00001000
#define FM_INFO_NOT_CONTIGUOUS 0x00002000
#define FM_INFO_TECH_MM 0x00004000
#define FM_INFO_RETURNS_OUTLINES 0x00008000
#define FM_INFO_RETURNS_STROKES 0x00010000
#define FM_INFO_RETURNS_BITMAPS 0x00020000
#define FM_INFO_DSIG 0x00040000 // FM_INFO_UNICODE_COMPLIANT
#define FM_INFO_RIGHT_HANDED 0x00080000
#define FM_INFO_INTEGRAL_SCALING 0x00100000
#define FM_INFO_90DEGREE_ROTATIONS 0x00200000
#define FM_INFO_OPTICALLY_FIXED_PITCH 0x00400000
#define FM_INFO_DO_NOT_ENUMERATE 0x00800000
#define FM_INFO_ISOTROPIC_SCALING_ONLY 0x01000000
#define FM_INFO_ANISOTROPIC_SCALING_ONLY 0x02000000
#define FM_INFO_TECH_CFF 0x04000000
#define FM_INFO_FAMILY_EQUIV 0x08000000
#define FM_INFO_DBCS_FIXED_PITCH 0x10000000
#define FM_INFO_NONNEGATIVE_AC 0x20000000
#define FM_INFO_IGNORE_TC_RA_ABLE 0x40000000
#define FM_INFO_TECH_TYPE1 0x80000000
// max number of charsets supported in a tt font, 16 according to win95 guys
#define MAXCHARSETS 16
//
// IFIMETRICS::ulPanoseCulture
//
#define FM_PANOSE_CULTURE_LATIN 0x0
//
// IFMETRICS::fsSelection flags
//
#define FM_SEL_ITALIC 0x0001
#define FM_SEL_UNDERSCORE 0x0002
#define FM_SEL_NEGATIVE 0x0004
#define FM_SEL_OUTLINED 0x0008
#define FM_SEL_STRIKEOUT 0x0010
#define FM_SEL_BOLD 0x0020
#define FM_SEL_REGULAR 0x0040
//
// The FONTDIFF structure contains all of the fields that could
// possibly change under simulation
//
typedef struct _FONTDIFF {
BYTE jReserved1; // 0x0
BYTE jReserved2; // 0x1
BYTE jReserved3; // 0x2
BYTE bWeight; // 0x3 Panose Weight
USHORT usWinWeight; // 0x4
FSHORT fsSelection; // 0x6
FWORD fwdAveCharWidth; // 0x8
FWORD fwdMaxCharInc; // 0xA
POINTL ptlCaret; // 0xC
} FONTDIFF;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -