ReactOS  0.4.12-dev-75-g00dd17e
gdi32p.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  tagMETAFILEDC
 
struct  tagMF_ENTRY
 
struct  tagENHMETAFILE
 
struct  _UMPDEV
 
struct  _LOCALFONT
 

Macros

#define HANDLE_LIST_INC   20
 
#define METAFILE_MEMORY   1
 
#define METAFILE_DISK   2
 
#define SAPCALLBACKDELAY   244
 
#define LPK_INIT   1
 
#define LPK_ETO   2
 
#define LPK_GCP   3
 
#define ROP_USES_SOURCE(Rop)   (((Rop) << 2 ^ Rop) & 0xCC0000)
 
#define RCAST(_Type, _Value)   (*((_Type*)&_Value))
 
#define PDEV_UMPD_ID   0xFEDCBA98
 
#define UMPDEV_NO_ESCAPE   0x0002
 
#define UMPDEV_SUPPORT_ESCAPE   0x0004
 
#define LOCALFONT_COUNT   10
 
#define FOtoF(pfo)   (*(pfo))
 
#define HANDLE_METADC0P(_RetType, _Func, dwError, hdc, ...)
 
#define HANDLE_METADC(_RetType, _Func, dwError, hdc, ...)
 
#define HANDLE_METADC2(_RetType, _Func, hdc, ...)
 

Typedefs

typedef INT(CALLBACKEMFPLAYPROC) (HDC hdc, INT iFunction, HANDLE hPageQuery)
 
typedef BOOL(WINAPILPKETO) (HDC hdc, int x, int y, UINT fuOptions, const RECT *lprc, LPCWSTR lpString, UINT uCount, const INT *lpDx, INT unknown)
 
typedef DWORD(WINAPILPKGCP) (HDC hdc, LPCWSTR lpString, INT uCount, INT nMaxExtent, LPGCP_RESULTSW lpResults, DWORD dwFlags, DWORD dwUnused)
 
typedef struct tagMETAFILEDC METAFILEDC
 
typedef struct tagMETAFILEDCPMETAFILEDC
 
typedef struct tagMF_ENTRY MF_ENTRY
 
typedef struct tagMF_ENTRYPMF_ENTRY
 
typedef struct tagENHMETAFILE ENHMETAFILE
 
typedef struct tagENHMETAFILEPENHMETAFILE
 
typedef struct _UMPDEV UMPDEV
 
typedef struct _UMPDEVPUMPDEV
 
typedef struct _LOCALFONT LOCALFONT
 
typedef struct _LOCALFONTPLOCALFONT
 
typedef BOOL(WINAPIABORTPRINTER) (HANDLE)
 
typedef BOOL(WINAPICLOSEPRINTER) (HANDLE)
 
typedef BOOL(WINAPICLOSESPOOLFILEHANDLE) (HANDLE, HANDLE)
 
typedef HANDLE(WINAPICOMMITSPOOLDATA) (HANDLE, HANDLE, DWORD)
 
typedef LONG(WINAPIDOCUMENTPROPERTIESW) (HWND, HANDLE, LPWSTR, PDEVMODEW, PDEVMODEW, DWORD)
 
typedef BOOL(WINAPIENDDOCPRINTER) (HANDLE)
 
typedef BOOL(WINAPIENDPAGEPRINTER) (HANDLE)
 
typedef BOOL(WINAPIGETPRINTERW) (HANDLE, DWORD, LPBYTE, DWORD, LPDWORD)
 
typedef BOOL(WINAPIGETPRINTERDRIVERW) (HANDLE, LPWSTR, DWORD, LPBYTE, DWORD, LPDWORD)
 
typedef HANDLE(WINAPIGETSPOOLFILEHANDLE) (HANDLE)
 
typedef BOOL(WINAPIISVALIDDEVMODEW) (PDEVMODEW, size_t)
 
typedef BOOL(WINAPIOPENPRINTERW) (LPWSTR, PHANDLE, LPPRINTER_DEFAULTSW)
 
typedef BOOL(WINAPIREADPRINTER) (HANDLE, PVOID, DWORD, PDWORD)
 
typedef BOOL(WINAPIRESETPRINTERW) (HANDLE, LPPRINTER_DEFAULTSW)
 
typedef LPWSTR(WINAPISTARTDOCDLGW) (HANDLE, DOCINFOW *)
 
typedef DWORD(WINAPISTARTDOCPRINTERW) (HANDLE, DWORD, PBYTE)
 
typedef BOOL(WINAPISTARTPAGEPRINTER) (HANDLE)
 
typedef BOOL(WINAPISEEKPRINTER) (HANDLE, LARGE_INTEGER, PLARGE_INTEGER, DWORD, BOOL)
 
typedef BOOL(WINAPISPLREADPRINTER) (HANDLE, LPBYTE *, DWORD)
 
typedef BOOL(WINAPISPLDRIVERUNLOADCOMPLETE) (LPWSTR)
 
typedef INT(WINAPIDOCUMENTEVENT) (HANDLE, HDC, INT, ULONG, PVOID, ULONG, PVOID)
 
typedef BOOL(WINAPIQUERYCOLORPROFILE) (HANDLE, PDEVMODEW, ULONG, VOID *, ULONG, FLONG)
 
typedef DWORD(WINAPIQUERYSPOOLMODE) (HANDLE, DWORD, DWORD)
 
typedef DWORD(WINAPIQUERYREMOTEFONTS) (DWORD, DWORD, DWORD)
 
typedef enum _DCFUNC DCFUNC
 

Enumerations

enum  _DCFUNC {
  DCFUNC_AbortPath, DCFUNC_AlphaBlend, DCFUNC_AngleArc, DCFUNC_Arc,
  DCFUNC_ArcTo, DCFUNC_BeginPath, DCFUNC_Chord, DCFUNC_CloseFigure,
  DCFUNC_Ellipse, DCFUNC_EndPath, DCFUNC_ExcludeClipRect, DCFUNC_ExtEscape,
  DCFUNC_ExtFloodFill, DCFUNC_ExtSelectClipRgn, DCFUNC_ExtTextOut, DCFUNC_FillPath,
  DCFUNC_FillRgn, DCFUNC_FlattenPath, DCFUNC_FrameRgn, DCFUNC_GetDeviceCaps,
  DCFUNC_GdiComment, DCFUNC_GradientFill, DCFUNC_IntersectClipRect, DCFUNC_InvertRgn,
  DCFUNC_LineTo, DCFUNC_MaskBlt, DCFUNC_ModifyWorldTransform, DCFUNC_MoveTo,
  DCFUNC_OffsetClipRgn, DCFUNC_OffsetViewportOrgEx, DCFUNC_OffsetWindowOrgEx, DCFUNC_PathToRegion,
  DCFUNC_PatBlt, DCFUNC_Pie, DCFUNC_PlgBlt, DCFUNC_PolyBezier,
  DCFUNC_PolyBezierTo, DCFUNC_PolyDraw, DCFUNC_Polygon, DCFUNC_Polyline,
  DCFUNC_PolylineTo, DCFUNC_PolyPolygon, DCFUNC_PolyPolyline, DCFUNC_RealizePalette,
  DCFUNC_Rectangle, DCFUNC_RestoreDC, DCFUNC_RoundRect, DCFUNC_SaveDC,
  DCFUNC_ScaleViewportExtEx, DCFUNC_ScaleWindowExtEx, DCFUNC_SelectBrush, DCFUNC_SelectClipPath,
  DCFUNC_SelectFont, DCFUNC_SelectPalette, DCFUNC_SelectPen, DCFUNC_SetDCBrushColor,
  DCFUNC_SetDCPenColor, DCFUNC_SetDIBitsToDevice, DCFUNC_SetBkColor, DCFUNC_SetBkMode,
  DCFUNC_SetLayout, DCFUNC_SetPixel, DCFUNC_SetPolyFillMode, DCFUNC_SetROP2,
  DCFUNC_SetStretchBltMode, DCFUNC_SetTextAlign, DCFUNC_SetTextCharacterExtra, DCFUNC_SetTextColor,
  DCFUNC_SetTextJustification, DCFUNC_SetViewportExtEx, DCFUNC_SetViewportOrgEx, DCFUNC_SetWindowExtEx,
  DCFUNC_SetWindowOrgEx, DCFUNC_SetWorldTransform, DCFUNC_StretchBlt, DCFUNC_StrokeAndFillPath,
  DCFUNC_StrokePath, DCFUNC_TransparentBlt, DCFUNC_WidenPath
}
 

Functions

PVOID HEAP_alloc (DWORD len)
 
NTSTATUS HEAP_strdupA2W (LPWSTR *ppszW, LPCSTR lpszA)
 
VOID HEAP_free (LPVOID memory)
 
VOID FASTCALL FONT_TextMetricWToA (const TEXTMETRICW *ptmW, LPTEXTMETRICA ptmA)
 
VOID FASTCALL NewTextMetricW2A (NEWTEXTMETRICA *tma, NEWTEXTMETRICW *tmw)
 
VOID FASTCALL NewTextMetricExW2A (NEWTEXTMETRICEXA *tma, NEWTEXTMETRICEXW *tmw)
 
BOOL FASTCALL DeleteRegion (HRGN)
 
BOOL WINAPI GdiValidateHandle (HGDIOBJ)
 
BOOL GdiGetHandleUserData (HGDIOBJ hGdiObj, DWORD ObjectType, PVOID *UserData)
 
PLDC FASTCALL GdiGetLDC (HDC hDC)
 
BOOL FASTCALL GdiSetLDC (HDC hdc, PVOID pvLDC)
 
HGDIOBJ WINAPI GdiFixUpHandle (HGDIOBJ hGO)
 
BOOL WINAPI CalculateColorTableSize (CONST BITMAPINFOHEADER *BitmapInfoHeader, UINT *ColorSpec, UINT *ColorTableSize)
 
LPBITMAPINFO WINAPI ConvertBitmapInfo (CONST BITMAPINFO *BitmapInfo, UINT ColorSpec, UINT *BitmapInfoSize, BOOL FollowedByData)
 
DWORD WINAPI GetAndSetDCDWord (_In_ HDC hdc, _In_ UINT u, _In_ DWORD dwIn, _In_ ULONG ulMFId, _In_ USHORT usMF16Id, _In_ DWORD dwError)
 
DWORD WINAPI GetDCDWord (_In_ HDC hdc, _In_ UINT u, _In_ DWORD dwError)
 
HGDIOBJ WINAPI GetDCObject (HDC, INT)
 
VOID NTAPI LogFontA2W (LPLOGFONTW pW, CONST LOGFONTA *pA)
 
VOID NTAPI LogFontW2A (LPLOGFONTA pA, CONST LOGFONTW *pW)
 
VOID WINAPI EnumLogFontExW2A (LPENUMLOGFONTEXA fontA, CONST ENUMLOGFONTEXW *fontW)
 
BOOL WINAPI LoadLPK (INT LpkFunctionID)
 
VOID WINAPI GdiInitializeLanguagePack (_In_ DWORD InitParam)
 
VOID WINAPI InitializeLpkHooks (_In_ FARPROC *hookfuncs)
 
BOOL WINAPI GetETM (HDC hdc, EXTTEXTMETRIC *petm)
 
UINT WINAPI UserRealizePalette (HDC hDC)
 
int WINAPI GdiAddFontResourceW (LPCWSTR lpszFilename, FLONG fl, DESIGNVECTOR *pdv)
 
VOID WINAPI GdiSetLastError (DWORD dwErrCode)
 
DWORD WINAPI GdiGetCodePage (HDC)
 
int WINAPI GdiGetBitmapBitsSize (BITMAPINFO *lpbmi)
 
VOID GdiSAPCallback (PLDC pldc)
 
HGDIOBJ FASTCALL hGetPEBHandle (HANDLECACHETYPE, COLORREF)
 
int FASTCALL DocumentEventEx (PVOID, HANDLE, HDC, int, ULONG, PVOID, ULONG, PVOID)
 
BOOL FASTCALL EndPagePrinterEx (PVOID, HANDLE)
 
BOOL FASTCALL LoadTheSpoolerDrv (VOID)
 
FORCEINLINE PVOID GdiAllocBatchCommand (HDC hdc, USHORT Cmd)
 
FORCEINLINE PDC_ATTR GdiGetDcAttr (HDC hdc)
 
FORCEINLINE PRGN_ATTR GdiGetRgnAttr (HRGN hrgn)
 
FORCEINLINE int _lrintf (float f)
 
HBRUSH WINAPI GdiSelectBrush (_In_ HDC hdc, _In_ HBRUSH hbr)
 
HPEN WINAPI GdiSelectPen (_In_ HDC hdc, _In_ HPEN hpen)
 
HFONT WINAPI GdiSelectFont (_In_ HDC hdc, _In_ HFONT hfont)
 
HGDIOBJ WINAPI GdiCreateClientObj (_In_ PVOID pvObject, _In_ GDILOOBJTYPE eObjType)
 
PVOID WINAPI GdiDeleteClientObj (_In_ HGDIOBJ hobj)
 
BOOL WINAPI GdiCreateClientObjLink (_In_ HGDIOBJ hobj, _In_ PVOID pvObject)
 
PVOID WINAPI GdiGetClientObjLink (_In_ HGDIOBJ hobj)
 
PVOID WINAPI GdiRemoveClientObjLink (_In_ HGDIOBJ hobj)
 
VOID WINAPI METADC_DeleteObject (HGDIOBJ hobj)
 
BOOL WINAPI METADC_DeleteDC (_In_ HDC hdc)
 
INT WINAPI METADC16_Escape (_In_ HDC hdc, _In_ INT nEscape, _In_ INT cbInput, _In_ LPCSTR lpvInData, _Out_ LPVOID lpvOutData)
 
BOOL WINAPI METADC_ExtTextOutW (HDC hdc, INT x, INT y, UINT fuOptions, const RECT *lprc, LPCWSTR lpString, UINT cchString, const INT *lpDx)
 
BOOL WINAPI METADC_PatBlt (_In_ HDC hdc, _In_ INT xLeft, _In_ INT yTop, _In_ INT nWidth, _In_ INT nHeight, _In_ DWORD dwRop)
 
BOOL METADC_Dispatch (_In_ DCFUNC eFunction, _Out_ PDWORD_PTR pdwResult, _In_ DWORD_PTR dwError, _In_ HDC hdc,...)
 
BOOL WINAPI METADC_GetAndSetDCDWord (_Out_ PDWORD pdwResult, _In_ HDC hdc, _In_ UINT u, _In_ DWORD dwIn, _In_ ULONG ulMFId, _In_ USHORT usMF16Id, _In_ DWORD dwError)
 

Variables

PGDI_TABLE_ENTRY GdiHandleTable
 
PGDI_SHARED_HANDLE_TABLE GdiSharedHandleTable
 
HANDLE hProcessHeap
 
HANDLE CurrentProcessId
 
DWORD GDI_BatchLimit
 
PDEVCAPS GdiDevCaps
 
BOOL gbLpk
 
HANDLE ghSpooler
 
RTL_CRITICAL_SECTION semLocal
 
HINSTANCE hLpk
 
LPKETO LpkExtTextOut
 
LPKGCP LpkGetCharacterPlacement
 
CLOSEPRINTER fpClosePrinter
 
OPENPRINTERW fpOpenPrinterW
 
ULONG gcClientObj
 

Macro Definition Documentation

◆ FOtoF

#define FOtoF (   pfo)    (*(pfo))

Definition at line 471 of file gdi32p.h.

Referenced by MatrixToXForm().

◆ HANDLE_LIST_INC

#define HANDLE_LIST_INC   20

◆ HANDLE_METADC

#define HANDLE_METADC (   _RetType,
  _Func,
  dwError,
  hdc,
  ... 
)
Value:
{ \
DWORD_PTR dwResult = 1; \
if (METADC_Dispatch(DCFUNC_##_Func, &dwResult, (DWORD_PTR)dwError, hdc, __VA_ARGS__)) \
{ \
return (_RetType)dwResult; \
} \
}
BOOL METADC_Dispatch(_In_ DCFUNC eFunction, _Out_ PDWORD_PTR pdwResult, _In_ DWORD_PTR dwError, _In_ HDC hdc,...)
Definition: rosglue.c:1117
HDC hdc
Definition: msvc.h:53
#define GDI_HANDLE_GET_TYPE(h)
Definition: gdi.h:31
uint32_t DWORD_PTR
Definition: typedefs.h:63

Definition at line 595 of file gdi32p.h.

Referenced by AngleArc(), Arc(), ArcTo(), BitBlt(), Chord(), Ellipse(), ExcludeClipRect(), ExtFloodFill(), ExtSelectClipRgn(), ExtTextOutW(), FillRgn(), FrameRgn(), GdiAlphaBlend(), GdiComment(), GdiGradientFill(), GdiSelectBrush(), GdiSelectFont(), GdiSelectPen(), GdiTransparentBlt(), GetDeviceCaps(), IntersectClipRect(), InvertRgn(), LineTo(), MaskBlt(), ModifyWorldTransform(), MoveToEx(), OffsetClipRgn(), OffsetViewportOrgEx(), OffsetWindowOrgEx(), PatBlt(), Pie(), PlgBlt(), PolyBezier(), PolyBezierTo(), PolyDraw(), Polygon(), Polyline(), PolylineTo(), PolyPolygon(), PolyPolyline(), Rectangle(), RestoreDC(), RoundRect(), ScaleViewportExtEx(), ScaleWindowExtEx(), SelectClipPath(), SelectPalette(), SetBkColor(), SetBkMode(), SetDCBrushColor(), SetDCPenColor(), SetDIBitsToDevice(), SetLayout(), SetPixel(), SetPolyFillMode(), SetROP2(), SetStretchBltMode(), SetTextAlign(), SetTextCharacterExtra(), SetTextColor(), SetTextJustification(), SetViewportExtEx(), SetViewportOrgEx(), SetWindowExtEx(), SetWindowOrgEx(), and StretchBlt().

◆ HANDLE_METADC0P

#define HANDLE_METADC0P (   _RetType,
  _Func,
  dwError,
  hdc,
  ... 
)
Value:
{ \
DWORD_PTR dwResult; \
if (METADC_Dispatch(DCFUNC_##_Func, &dwResult, (DWORD_PTR)dwError, hdc)) \
{ \
return (_RetType)dwResult; \
} \
}
BOOL METADC_Dispatch(_In_ DCFUNC eFunction, _Out_ PDWORD_PTR pdwResult, _In_ DWORD_PTR dwError, _In_ HDC hdc,...)
Definition: rosglue.c:1117
HDC hdc
Definition: msvc.h:53
#define GDI_HANDLE_GET_TYPE(h)
Definition: gdi.h:31
uint32_t DWORD_PTR
Definition: typedefs.h:63

Definition at line 585 of file gdi32p.h.

Referenced by AbortPath(), BeginPath(), CloseFigure(), EndPath(), FillPath(), FlattenPath(), PathToRegion(), RealizePalette(), SaveDC(), StrokeAndFillPath(), StrokePath(), and WidenPath().

◆ HANDLE_METADC2

#define HANDLE_METADC2 (   _RetType,
  _Func,
  hdc,
  ... 
)
Value:
{ \
_RetType result; \
if (METADC_##_Func(&result, hdc, __VA_ARGS__)) \
{ \
return result; \
} \
}
HDC hdc
Definition: msvc.h:53
#define GDI_HANDLE_GET_TYPE(h)
Definition: gdi.h:31
GLuint64EXT * result
Definition: glext.h:11304

Definition at line 701 of file gdi32p.h.

Referenced by GetAndSetDCDWord().

◆ LOCALFONT_COUNT

#define LOCALFONT_COUNT   10

Definition at line 156 of file gdi32p.h.

◆ LPK_ETO

#define LPK_ETO   2
Examples:
/srv/doxygen/reactos/win32ss/gdi/gdi32/objects/utils.c.

Definition at line 68 of file gdi32p.h.

Referenced by ExtTextOutW(), and LoadLPK().

◆ LPK_GCP

#define LPK_GCP   3
Examples:
/srv/doxygen/reactos/win32ss/gdi/gdi32/objects/utils.c.

Definition at line 69 of file gdi32p.h.

Referenced by GetCharacterPlacementW(), and LoadLPK().

◆ LPK_INIT

#define LPK_INIT   1

◆ METAFILE_DISK

◆ METAFILE_MEMORY

#define METAFILE_MEMORY   1

◆ PDEV_UMPD_ID

#define PDEV_UMPD_ID   0xFEDCBA98

Definition at line 134 of file gdi32p.h.

Referenced by EngGetDriverName(), and EngGetPrinterDataFileName().

◆ RCAST

#define RCAST (   _Type,
  _Value 
)    (*((_Type*)&_Value))

Definition at line 74 of file gdi32p.h.

Referenced by AngleArc().

◆ ROP_USES_SOURCE

#define ROP_USES_SOURCE (   Rop)    (((Rop) << 2 ^ Rop) & 0xCC0000)

Definition at line 73 of file gdi32p.h.

Referenced by BitBlt().

◆ SAPCALLBACKDELAY

#define SAPCALLBACKDELAY   244

Definition at line 65 of file gdi32p.h.

Referenced by GdiSAPCallback().

◆ UMPDEV_NO_ESCAPE

#define UMPDEV_NO_ESCAPE   0x0002

Definition at line 136 of file gdi32p.h.

◆ UMPDEV_SUPPORT_ESCAPE

#define UMPDEV_SUPPORT_ESCAPE   0x0004

Definition at line 137 of file gdi32p.h.

Typedef Documentation

◆ ABORTPRINTER

typedef BOOL(WINAPI * ABORTPRINTER) (HANDLE)

Definition at line 163 of file gdi32p.h.

◆ CLOSEPRINTER

typedef BOOL(WINAPI * CLOSEPRINTER) (HANDLE)

Definition at line 164 of file gdi32p.h.

◆ CLOSESPOOLFILEHANDLE

typedef BOOL(WINAPI * CLOSESPOOLFILEHANDLE) (HANDLE, HANDLE)

Definition at line 165 of file gdi32p.h.

◆ COMMITSPOOLDATA

typedef HANDLE(WINAPI * COMMITSPOOLDATA) (HANDLE, HANDLE, DWORD)

Definition at line 166 of file gdi32p.h.

◆ DCFUNC

typedef enum _DCFUNC DCFUNC

◆ DOCUMENTEVENT

typedef INT(WINAPI * DOCUMENTEVENT) (HANDLE, HDC, INT, ULONG, PVOID, ULONG, PVOID)

Definition at line 187 of file gdi32p.h.

◆ DOCUMENTPROPERTIESW

typedef LONG(WINAPI * DOCUMENTPROPERTIESW) (HWND, HANDLE, LPWSTR, PDEVMODEW, PDEVMODEW, DWORD)

Definition at line 167 of file gdi32p.h.

◆ EMFPLAYPROC

typedef INT(CALLBACK* EMFPLAYPROC) (HDC hdc, INT iFunction, HANDLE hPageQuery)

Definition at line 24 of file gdi32p.h.

◆ ENDDOCPRINTER

typedef BOOL(WINAPI * ENDDOCPRINTER) (HANDLE)

Definition at line 168 of file gdi32p.h.

◆ ENDPAGEPRINTER

typedef BOOL(WINAPI * ENDPAGEPRINTER) (HANDLE)

Definition at line 169 of file gdi32p.h.

◆ ENHMETAFILE

◆ GETPRINTERDRIVERW

typedef BOOL(WINAPI * GETPRINTERDRIVERW) (HANDLE, LPWSTR, DWORD, LPBYTE, DWORD, LPDWORD)

Definition at line 171 of file gdi32p.h.

◆ GETPRINTERW

typedef BOOL(WINAPI * GETPRINTERW) (HANDLE, DWORD, LPBYTE, DWORD, LPDWORD)

Definition at line 170 of file gdi32p.h.

◆ GETSPOOLFILEHANDLE

typedef HANDLE(WINAPI * GETSPOOLFILEHANDLE) (HANDLE)

Definition at line 172 of file gdi32p.h.

◆ ISVALIDDEVMODEW

typedef BOOL(WINAPI * ISVALIDDEVMODEW) (PDEVMODEW, size_t)

Definition at line 173 of file gdi32p.h.

◆ LOCALFONT

◆ LPKETO

typedef BOOL(WINAPI* LPKETO) (HDC hdc, int x, int y, UINT fuOptions, const RECT *lprc, LPCWSTR lpString, UINT uCount, const INT *lpDx, INT unknown)
Examples:
/srv/doxygen/reactos/win32ss/gdi/gdi32/objects/utils.c.

Definition at line 31 of file gdi32p.h.

◆ LPKGCP

typedef DWORD(WINAPI* LPKGCP) (HDC hdc, LPCWSTR lpString, INT uCount, INT nMaxExtent, LPGCP_RESULTSW lpResults, DWORD dwFlags, DWORD dwUnused)
Examples:
/srv/doxygen/reactos/win32ss/gdi/gdi32/objects/utils.c.

Definition at line 44 of file gdi32p.h.

◆ METAFILEDC

◆ MF_ENTRY

◆ OPENPRINTERW

typedef BOOL(WINAPI * OPENPRINTERW) (LPWSTR, PHANDLE, LPPRINTER_DEFAULTSW)

Definition at line 174 of file gdi32p.h.

◆ PENHMETAFILE

◆ PLOCALFONT

◆ PMETAFILEDC

◆ PMF_ENTRY

◆ PUMPDEV

typedef struct _UMPDEV * PUMPDEV

◆ QUERYCOLORPROFILE

typedef BOOL(WINAPI * QUERYCOLORPROFILE) (HANDLE, PDEVMODEW, ULONG, VOID *, ULONG, FLONG)

Definition at line 189 of file gdi32p.h.

◆ QUERYREMOTEFONTS

typedef DWORD(WINAPI * QUERYREMOTEFONTS) (DWORD, DWORD, DWORD)

Definition at line 192 of file gdi32p.h.

◆ QUERYSPOOLMODE

typedef DWORD(WINAPI * QUERYSPOOLMODE) (HANDLE, DWORD, DWORD)

Definition at line 191 of file gdi32p.h.

◆ READPRINTER

typedef BOOL(WINAPI * READPRINTER) (HANDLE, PVOID, DWORD, PDWORD)

Definition at line 175 of file gdi32p.h.

◆ RESETPRINTERW

typedef BOOL(WINAPI * RESETPRINTERW) (HANDLE, LPPRINTER_DEFAULTSW)

Definition at line 176 of file gdi32p.h.

◆ SEEKPRINTER

typedef BOOL(WINAPI * SEEKPRINTER) (HANDLE, LARGE_INTEGER, PLARGE_INTEGER, DWORD, BOOL)

Definition at line 181 of file gdi32p.h.

◆ SPLDRIVERUNLOADCOMPLETE

typedef BOOL(WINAPI * SPLDRIVERUNLOADCOMPLETE) (LPWSTR)

Definition at line 184 of file gdi32p.h.

◆ SPLREADPRINTER

typedef BOOL(WINAPI * SPLREADPRINTER) (HANDLE, LPBYTE *, DWORD)

Definition at line 182 of file gdi32p.h.

◆ STARTDOCDLGW

typedef LPWSTR(WINAPI * STARTDOCDLGW) (HANDLE, DOCINFOW *)

Definition at line 177 of file gdi32p.h.

◆ STARTDOCPRINTERW

typedef DWORD(WINAPI * STARTDOCPRINTERW) (HANDLE, DWORD, PBYTE)

Definition at line 178 of file gdi32p.h.

◆ STARTPAGEPRINTER

typedef BOOL(WINAPI * STARTPAGEPRINTER) (HANDLE)

Definition at line 179 of file gdi32p.h.

◆ UMPDEV

Enumeration Type Documentation

◆ _DCFUNC

Enumerator
DCFUNC_AbortPath 
DCFUNC_AlphaBlend 
DCFUNC_AngleArc 
DCFUNC_Arc 
DCFUNC_ArcTo 
DCFUNC_BeginPath 
DCFUNC_Chord 
DCFUNC_CloseFigure 
DCFUNC_Ellipse 
DCFUNC_EndPath 
DCFUNC_ExcludeClipRect 
DCFUNC_ExtEscape 
DCFUNC_ExtFloodFill 
DCFUNC_ExtSelectClipRgn 
DCFUNC_ExtTextOut 
DCFUNC_FillPath 
DCFUNC_FillRgn 
DCFUNC_FlattenPath 
DCFUNC_FrameRgn 
DCFUNC_GetDeviceCaps 
DCFUNC_GdiComment 
DCFUNC_GradientFill 
DCFUNC_IntersectClipRect 
DCFUNC_InvertRgn 
DCFUNC_LineTo 
DCFUNC_MaskBlt 
DCFUNC_ModifyWorldTransform 
DCFUNC_MoveTo 
DCFUNC_OffsetClipRgn 
DCFUNC_OffsetViewportOrgEx 
DCFUNC_OffsetWindowOrgEx 
DCFUNC_PathToRegion 
DCFUNC_PatBlt 
DCFUNC_Pie 
DCFUNC_PlgBlt 
DCFUNC_PolyBezier 
DCFUNC_PolyBezierTo 
DCFUNC_PolyDraw 
DCFUNC_Polygon 
DCFUNC_Polyline 
DCFUNC_PolylineTo 
DCFUNC_PolyPolygon 
DCFUNC_PolyPolyline 
DCFUNC_RealizePalette 
DCFUNC_Rectangle 
DCFUNC_RestoreDC 
DCFUNC_RoundRect 
DCFUNC_SaveDC 
DCFUNC_ScaleViewportExtEx 
DCFUNC_ScaleWindowExtEx 
DCFUNC_SelectBrush 
DCFUNC_SelectClipPath 
DCFUNC_SelectFont 
DCFUNC_SelectPalette 
DCFUNC_SelectPen 
DCFUNC_SetDCBrushColor 
DCFUNC_SetDCPenColor 
DCFUNC_SetDIBitsToDevice 
DCFUNC_SetBkColor 
DCFUNC_SetBkMode 
DCFUNC_SetLayout 
DCFUNC_SetPixel 
DCFUNC_SetPolyFillMode 
DCFUNC_SetROP2 
DCFUNC_SetStretchBltMode 
DCFUNC_SetTextAlign 
DCFUNC_SetTextCharacterExtra 
DCFUNC_SetTextColor 
DCFUNC_SetTextJustification 
DCFUNC_SetViewportExtEx 
DCFUNC_SetViewportOrgEx 
DCFUNC_SetWindowExtEx 
DCFUNC_SetWindowOrgEx 
DCFUNC_SetWorldTransform 
DCFUNC_StretchBlt 
DCFUNC_StrokeAndFillPath 
DCFUNC_StrokePath 
DCFUNC_TransparentBlt 
DCFUNC_WidenPath 

Definition at line 606 of file gdi32p.h.

607 {
608  //DCFUNC_AbortDoc,
610  DCFUNC_AlphaBlend, // UNIMPLEMENTED
611  DCFUNC_AngleArc, // UNIMPLEMENTED
612  DCFUNC_Arc,
613  DCFUNC_ArcTo, // UNIMPLEMENTED
615  //DCFUNC_BitBlt,
616  DCFUNC_Chord,
631  DCFUNC_GradientFill, // UNIMPLEMENTED
635  DCFUNC_MaskBlt, // UNIMPLEMENTED
641  DCFUNC_PathToRegion, // UNIMPLEMENTED
643  DCFUNC_Pie,
644  DCFUNC_PlgBlt, // UNIMPLEMENTED
671  //DCFUNC_SetMapMode,
688  DCFUNC_TransparentBlt, // UNIMPLEMENTED
690 
691 } DCFUNC;
enum _DCFUNC DCFUNC

Function Documentation

◆ _lrintf()

FORCEINLINE int _lrintf ( float  f)

Definition at line 477 of file gdi32p.h.

Referenced by GdiTransformPoints2().

478 {
479 #if defined(_M_IX86) && defined(__GNUC__)
480  int result;
481  __asm__ __volatile__ ("fistpl %0" : "=m" (result) : "t" (f) : "st");
482  return result;
483 #elif defined(_M_IX86) && defined(_MSC_VER)
484  int result;
485  __asm
486  {
487  fld f;
488  fistp result;
489  }
490 #else
491  /* slow, but portable */
492  return (int)(f >= 0 ? f+0.5 : f-0.5);
493 #endif
494 }
GLfloat f
Definition: glext.h:7540
__asm__("\globl GetPhys\ "GetPhys:\\" "mflr 0\\" "stwu 0,-16(1)\\" "mfmsr 5\\" "andi. 6, 5, 0xffef\\" "mtmsr 6\\" "isync\\" "sync\\" "lwz 3, 0(3)\\" "mtmsr 5\\" "isync\\" "sync\\" "lwz 0, 0(1)\\" "addi 1, 1, 16\\" "mtlr 0\\" "blr")
#define f
Definition: ke_i.h:83
GLuint64EXT * result
Definition: glext.h:11304

◆ CalculateColorTableSize()

BOOL WINAPI CalculateColorTableSize ( CONST BITMAPINFOHEADER BitmapInfoHeader,
UINT ColorSpec,
UINT ColorTableSize 
)
Examples:
/srv/doxygen/reactos/win32ss/gdi/gdi32/objects/utils.c.

Definition at line 31 of file utils.c.

Referenced by ConvertBitmapInfo().

35 {
36  WORD BitCount;
37  DWORD ClrUsed;
38  DWORD Compression;
39 
40  /*
41  * At first get some basic parameters from the passed BitmapInfoHeader
42  * structure. It can have one of the following formats:
43  * - BITMAPCOREHEADER (the oldest one with totally different layout
44  * from the others)
45  * - BITMAPINFOHEADER (the standard and most common header)
46  * - BITMAPV4HEADER (extension of BITMAPINFOHEADER)
47  * - BITMAPV5HEADER (extension of BITMAPV4HEADER)
48  */
49 
50  if (BitmapInfoHeader->biSize == sizeof(BITMAPCOREHEADER))
51  {
52  BitCount = ((LPBITMAPCOREHEADER)BitmapInfoHeader)->bcBitCount;
53  ClrUsed = 0;
54  Compression = BI_RGB;
55  }
56  else
57  {
58  BitCount = BitmapInfoHeader->biBitCount;
59  ClrUsed = BitmapInfoHeader->biClrUsed;
60  Compression = BitmapInfoHeader->biCompression;
61  }
62 
63  switch (Compression)
64  {
65  case BI_BITFIELDS:
66  if (*ColorSpec == DIB_PAL_COLORS)
67  *ColorSpec = DIB_RGB_COLORS;
68 
69  if (BitCount != 16 && BitCount != 32)
70  return FALSE;
71 
72  /*
73  * For BITMAPV4HEADER/BITMAPV5HEADER the masks are included in
74  * the structure itself (bV4RedMask, bV4GreenMask, and bV4BlueMask).
75  * For BITMAPINFOHEADER the color masks are stored in the palette.
76  */
77 
78  if (BitmapInfoHeader->biSize > sizeof(BITMAPINFOHEADER))
79  *ColorTableSize = 0;
80  else
81  *ColorTableSize = 3;
82 
83  return TRUE;
84 
85  case BI_RGB:
86  switch (BitCount)
87  {
88  case 1:
89  *ColorTableSize = ClrUsed ? min(ClrUsed, 2) : 2;
90  return TRUE;
91 
92  case 4:
93  *ColorTableSize = ClrUsed ? min(ClrUsed, 16) : 16;
94  return TRUE;
95 
96  case 8:
97  *ColorTableSize = ClrUsed ? min(ClrUsed, 256) : 256;
98  return TRUE;
99 
100  default:
101  if (*ColorSpec == DIB_PAL_COLORS)
102  *ColorSpec = DIB_RGB_COLORS;
103  if (BitCount != 16 && BitCount != 24 && BitCount != 32)
104  return FALSE;
105  *ColorTableSize = ClrUsed;
106  return TRUE;
107  }
108 
109  case BI_RLE4:
110  if (BitCount == 4)
111  {
112  *ColorTableSize = ClrUsed ? min(ClrUsed, 16) : 16;
113  return TRUE;
114  }
115  return FALSE;
116 
117  case BI_RLE8:
118  if (BitCount == 8)
119  {
120  *ColorTableSize = ClrUsed ? min(ClrUsed, 256) : 256;
121  return TRUE;
122  }
123  return FALSE;
124 
125  case BI_JPEG:
126  case BI_PNG:
127  *ColorTableSize = ClrUsed;
128  return TRUE;
129 
130  default:
131  return FALSE;
132  }
133 }
#define TRUE
Definition: types.h:120
#define DIB_PAL_COLORS
Definition: wingdi.h:364
#define BI_JPEG
Definition: wingdi.h:38
#define BI_BITFIELDS
Definition: mmreg.h:507
struct tagBITMAPCOREHEADER * LPBITMAPCOREHEADER
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned long DWORD
Definition: ntddk_ex.h:95
#define BI_PNG
Definition: wingdi.h:39
#define min(a, b)
Definition: monoChain.cc:55
#define BI_RLE4
Definition: precomp.h:36
#define DIB_RGB_COLORS
Definition: wingdi.h:365
#define BI_RLE8
Definition: wingdi.h:35
#define BI_RGB
Definition: precomp.h:35

◆ ConvertBitmapInfo()

LPBITMAPINFO WINAPI ConvertBitmapInfo ( CONST BITMAPINFO BitmapInfo,
UINT  ColorSpec,
UINT BitmapInfoSize,
BOOL  FollowedByData 
)
Examples:
/srv/doxygen/reactos/win32ss/gdi/gdi32/objects/utils.c.

Definition at line 177 of file utils.c.

Referenced by CreateDIBitmap(), CreateDIBPatternBrush(), CreateDIBPatternBrushPt(), CreateDIBSection(), ExtCreatePen(), SetDIBitsToDevice(), and StretchDIBits().

182 {
183  LPBITMAPINFO NewBitmapInfo = (LPBITMAPINFO)BitmapInfo;
184  LPBITMAPCOREINFO CoreBitmapInfo = (LPBITMAPCOREINFO)BitmapInfo;
185  DWORD Size = 0;
186  ULONG DataSize = 0;
187  UINT PaletteEntryCount = 0;
188 
189  /*
190  * At first check if the passed BitmapInfo structure has valid size. It
191  * can have one of these headers: BITMAPCOREHEADER, BITMAPINFOHEADER,
192  * BITMAPV4HEADER or BITMAPV5HEADER (see CalculateColorTableSize for
193  * description).
194  */
195 
196  if ( !BitmapInfo ||
197  (BitmapInfo->bmiHeader.biSize != sizeof(BITMAPCOREHEADER) &&
198  (BitmapInfo->bmiHeader.biSize < sizeof(BITMAPINFOHEADER) ||
199  BitmapInfo->bmiHeader.biSize > sizeof(BITMAPV5HEADER))))
200  {
201  return NULL;
202  }
203 
204  /*
205  * Now calculate the color table size. Also if the bitmap info contains
206  * invalid color information it's rejected here.
207  */
208 
209  if (!CalculateColorTableSize(&BitmapInfo->bmiHeader, &ColorSpec,
210  &PaletteEntryCount))
211  {
212  return NULL;
213  }
214 
215  /*
216  * Calculate the size of image data if applicable. We must be careful
217  * to do proper aligning on line ends.
218  */
219 
220  if (FollowedByData)
221  {
222  DataSize = GdiGetBitmapBitsSize((PBITMAPINFO)BitmapInfo );
223  }
224 
225  /*
226  * If BitmapInfo was originally BITMAPCOREINFO then we need to convert
227  * it to the standard BITMAPINFO layout.
228  */
229 
230  if (BitmapInfo->bmiHeader.biSize == sizeof(BITMAPCOREHEADER))
231  {
232  Size = sizeof(BITMAPINFOHEADER);
233  if (ColorSpec == DIB_RGB_COLORS)
234  Size += PaletteEntryCount * sizeof(RGBQUAD);
235  else
236  Size += PaletteEntryCount * sizeof(USHORT);
237  Size += DataSize;
238 
239  NewBitmapInfo = RtlAllocateHeap(RtlGetProcessHeap(), 0, Size);
240  if (NewBitmapInfo == NULL)
241  {
242  return NULL;
243  }
244 
245  NewBitmapInfo->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
246  NewBitmapInfo->bmiHeader.biWidth = CoreBitmapInfo->bmciHeader.bcWidth;
247  NewBitmapInfo->bmiHeader.biHeight = CoreBitmapInfo->bmciHeader.bcHeight;
248  NewBitmapInfo->bmiHeader.biPlanes = CoreBitmapInfo->bmciHeader.bcPlanes;
249  NewBitmapInfo->bmiHeader.biBitCount = CoreBitmapInfo->bmciHeader.bcBitCount;
250  NewBitmapInfo->bmiHeader.biCompression = BI_RGB;
251  NewBitmapInfo->bmiHeader.biSizeImage = 0;
252  NewBitmapInfo->bmiHeader.biXPelsPerMeter = 0;
253  NewBitmapInfo->bmiHeader.biYPelsPerMeter = 0;
254  NewBitmapInfo->bmiHeader.biClrUsed = 0;
255  NewBitmapInfo->bmiHeader.biClrImportant = 0;
256 
257  if (PaletteEntryCount != 0)
258  {
259  if (ColorSpec == DIB_RGB_COLORS)
260  {
261  ULONG Index;
262 
263  for (Index = 0; Index < PaletteEntryCount; Index++)
264  {
265  NewBitmapInfo->bmiColors[Index].rgbRed =
266  CoreBitmapInfo->bmciColors[Index].rgbtRed;
267  NewBitmapInfo->bmiColors[Index].rgbGreen =
268  CoreBitmapInfo->bmciColors[Index].rgbtGreen;
269  NewBitmapInfo->bmiColors[Index].rgbBlue =
270  CoreBitmapInfo->bmciColors[Index].rgbtBlue;
271  NewBitmapInfo->bmiColors[Index].rgbReserved = 0;
272  }
273  }
274  else
275  {
276  RtlCopyMemory(NewBitmapInfo->bmiColors,
277  CoreBitmapInfo->bmciColors,
278  PaletteEntryCount * sizeof(USHORT));
279  }
280  }
281 
282  if (FollowedByData)
283  {
284  ULONG_PTR NewDataPtr, OldDataPtr;
285 
286  if (ColorSpec == DIB_RGB_COLORS)
287  {
288  NewDataPtr = (ULONG_PTR)(NewBitmapInfo->bmiColors +
289  PaletteEntryCount);
290  OldDataPtr = (ULONG_PTR)(CoreBitmapInfo->bmciColors +
291  PaletteEntryCount);
292  }
293  else
294  {
295  NewDataPtr = (ULONG_PTR)(NewBitmapInfo->bmiColors) +
296  PaletteEntryCount * sizeof(USHORT);
297  OldDataPtr = (ULONG_PTR)(CoreBitmapInfo->bmciColors) +
298  PaletteEntryCount * sizeof(USHORT);
299  }
300 
301  RtlCopyMemory((PVOID)NewDataPtr, (PVOID)OldDataPtr, DataSize);
302  }
303  }
304  else
305  {
306  /* Verify some data validity */
307  switch (BitmapInfo->bmiHeader.biCompression)
308  {
309  case BI_RLE8:
310  if (BitmapInfo->bmiHeader.biBitCount != 8)
311  return NULL;
312  if (BitmapInfo->bmiHeader.biHeight < 0)
313  return NULL;
314  break;
315  case BI_RLE4:
316  if (BitmapInfo->bmiHeader.biBitCount != 4)
317  return NULL;
318  if (BitmapInfo->bmiHeader.biHeight < 0)
319  return NULL;
320  break;
321  default:
322  break;
323  }
324 
325  /* Non "standard" formats must have a valid size set */
326  if ((BitmapInfo->bmiHeader.biCompression != BI_RGB) &&
327  (BitmapInfo->bmiHeader.biCompression != BI_BITFIELDS))
328  {
329  if (BitmapInfo->bmiHeader.biSizeImage == 0)
330  return NULL;
331  }
332  }
333 
334  Size = NewBitmapInfo->bmiHeader.biSize;
335  if (ColorSpec == DIB_RGB_COLORS)
336  Size += PaletteEntryCount * sizeof(RGBQUAD);
337  else
338  Size += PaletteEntryCount * sizeof(USHORT);
339  Size += DataSize;
340  *BitmapInfoSize = Size;
341 
342  return NewBitmapInfo;
343 }
BYTE rgbtBlue
Definition: wingdi.h:1415
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
BITMAPINFOHEADER bmiHeader
Definition: wingdi.h:1453
DWORD biClrImportant
Definition: amvideo.idl:40
struct tagBITMAPINFO * LPBITMAPINFO
int WINAPI GdiGetBitmapBitsSize(BITMAPINFO *lpbmi)
Definition: bitmap.c:161
LONG biXPelsPerMeter
Definition: amvideo.idl:37
struct tagBITMAPINFOHEADER BITMAPINFOHEADER
LONG biYPelsPerMeter
Definition: amvideo.idl:38
#define BI_BITFIELDS
Definition: mmreg.h:507
UCHAR rgbBlue
Definition: inbv.c:118
uint32_t ULONG_PTR
Definition: typedefs.h:63
UCHAR rgbGreen
Definition: inbv.c:119
UCHAR rgbRed
Definition: inbv.c:120
BITMAPCOREHEADER bmciHeader
Definition: wingdi.h:1430
DWORD biCompression
Definition: amvideo.idl:35
smooth NULL
Definition: ftsmooth.c:416
RGBTRIPLE bmciColors[1]
Definition: wingdi.h:1431
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
Definition: heap.c:585
struct tagRGBQUAD RGBQUAD
RGBQUAD bmiColors[1]
Definition: wingdi.h:1454
unsigned int UINT
Definition: ndis.h:50
static const UCHAR Index[8]
Definition: usbohci.c:18
unsigned long DWORD
Definition: ntddk_ex.h:95
DWORD biSizeImage
Definition: amvideo.idl:36
struct _BITMAPCOREINFO * LPBITMAPCOREINFO
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:359
unsigned short USHORT
Definition: pedump.c:61
BYTE rgbtRed
Definition: wingdi.h:1417
#define BI_RLE4
Definition: precomp.h:36
unsigned int ULONG
Definition: retypes.h:1
#define ULONG_PTR
Definition: config.h:101
BYTE rgbtGreen
Definition: wingdi.h:1416
UCHAR rgbReserved
Definition: inbv.c:121
#define DIB_RGB_COLORS
Definition: wingdi.h:365
#define BI_RLE8
Definition: wingdi.h:35
#define BI_RGB
Definition: precomp.h:35
_In_ NDIS_STATUS _In_ ULONG _In_ USHORT _In_opt_ PVOID _In_ ULONG DataSize
Definition: ndis.h:4733
BOOL WINAPI CalculateColorTableSize(CONST BITMAPINFOHEADER *BitmapInfoHeader, UINT *ColorSpec, UINT *ColorTableSize)
Definition: utils.c:31

◆ DeleteRegion()

BOOL FASTCALL DeleteRegion ( HRGN  )

◆ DocumentEventEx()

int FASTCALL DocumentEventEx ( PVOID  ,
HANDLE  ,
HDC  ,
int  ,
ULONG  ,
PVOID  ,
ULONG  ,
PVOID   
)

Definition at line 152 of file printdrv.c.

Referenced by AbortDoc(), EndDoc(), IntEndPage(), StartDocW(), and StartPage().

162 {
163  return fpDocumentEvent(hPrinter,hdc,iEsc,cbIn,pvIn,cbOut,pvOut);
164 }
HDC hdc
Definition: msvc.h:53
_In_ ULONG iEsc
Definition: winddi.h:3529
static DOCUMENTEVENT fpDocumentEvent
Definition: printdrv.c:47

◆ EndPagePrinterEx()

BOOL FASTCALL EndPagePrinterEx ( PVOID  ,
HANDLE   
)

Definition at line 178 of file printdrv.c.

Referenced by IntEndPage().

182 {
183  return fpEndPagePrinter(hPrinter);
184 }
static ENDPAGEPRINTER fpEndPagePrinter
Definition: printdrv.c:50

◆ EnumLogFontExW2A()

VOID WINAPI EnumLogFontExW2A ( LPENUMLOGFONTEXA  fontA,
CONST ENUMLOGFONTEXW fontW 
)
Examples:
/srv/doxygen/reactos/win32ss/gdi/gdi32/objects/utils.c.

Definition at line 401 of file utils.c.

Referenced by CreateFontIndirectExA(), and GetFontObjectA().

402 {
403  LogFontW2A( (LPLOGFONTA)fontA, (CONST LOGFONTW *)fontW );
404 
405  WideCharToMultiByte( CP_THREAD_ACP, 0, fontW->elfFullName, -1,
406  (LPSTR) fontA->elfFullName, LF_FULLFACESIZE, NULL, NULL );
407  fontA->elfFullName[LF_FULLFACESIZE-1] = '\0';
408  WideCharToMultiByte( CP_THREAD_ACP, 0, fontW->elfStyle, -1,
409  (LPSTR) fontA->elfStyle, LF_FACESIZE, NULL, NULL );
410  fontA->elfStyle[LF_FACESIZE-1] = '\0';
411  WideCharToMultiByte( CP_THREAD_ACP, 0, fontW->elfScript, -1,
412  (LPSTR) fontA->elfScript, LF_FACESIZE, NULL, NULL );
413  fontA->elfScript[LF_FACESIZE-1] = '\0';
414 }
#define LF_FACESIZE
Definition: dimm.idl:39
#define LF_FULLFACESIZE
Definition: wingdi.h:41
#define WideCharToMultiByte
Definition: compat.h:101
char * LPSTR
Definition: xmlstorage.h:182
VOID WINAPI LogFontW2A(LPLOGFONTA pA, CONST LOGFONTW *pW)
Definition: utils.c:374
smooth NULL
Definition: ftsmooth.c:416
#define CONST
Definition: compiler.h:170
static const WCHAR fontW[]
Definition: editor.c:78
#define CP_THREAD_ACP
Definition: winnls.h:221

◆ FONT_TextMetricWToA()

VOID FASTCALL FONT_TextMetricWToA ( const TEXTMETRICW ptmW,
LPTEXTMETRICA  ptmA 
)

Definition at line 79 of file font.c.

Referenced by GetOutlineTextMetricsA(), GetTextMetricsA(), and NewTextMetricW2A().

80 {
81  ptmA->tmHeight = ptmW->tmHeight;
82  ptmA->tmAscent = ptmW->tmAscent;
83  ptmA->tmDescent = ptmW->tmDescent;
86  ptmA->tmAveCharWidth = ptmW->tmAveCharWidth;
87  ptmA->tmMaxCharWidth = ptmW->tmMaxCharWidth;
88  ptmA->tmWeight = ptmW->tmWeight;
89  ptmA->tmOverhang = ptmW->tmOverhang;
92  ptmA->tmFirstChar = min(ptmW->tmFirstChar, 255);
93  if (ptmW->tmCharSet == SYMBOL_CHARSET)
94  {
95  ptmA->tmFirstChar = 0x1e;
96  ptmA->tmLastChar = 0xff; /* win9x behaviour - we need the OS2 table data to calculate correctly */
97  }
98  else
99  {
100  ptmA->tmFirstChar = ptmW->tmDefaultChar - 1;
101  ptmA->tmLastChar = min(ptmW->tmLastChar, 0xff);
102  }
103  ptmA->tmDefaultChar = (CHAR)ptmW->tmDefaultChar;
104  ptmA->tmBreakChar = (CHAR)ptmW->tmBreakChar;
105  ptmA->tmItalic = ptmW->tmItalic;
106  ptmA->tmUnderlined = ptmW->tmUnderlined;
107  ptmA->tmStruckOut = ptmW->tmStruckOut;
108  ptmA->tmPitchAndFamily = ptmW->tmPitchAndFamily;
109  ptmA->tmCharSet = ptmW->tmCharSet;
110 }
LONG tmMaxCharWidth
Definition: wingdi.h:2366
BYTE tmUnderlined
Definition: wingdi.h:2376
LONG tmExternalLeading
Definition: wingdi.h:2364
char CHAR
Definition: xmlstorage.h:175
#define SYMBOL_CHARSET
Definition: wingdi.h:383
LONG tmAveCharWidth
Definition: wingdi.h:2365
LONG tmDescent
Definition: wingdi.h:2362
LONG tmAscent
Definition: wingdi.h:2361
LONG tmInternalLeading
Definition: wingdi.h:2363
LONG tmAveCharWidth
Definition: wingdi.h:2343
BYTE tmLastChar
Definition: wingdi.h:2350
LONG tmWeight
Definition: wingdi.h:2345
LONG tmDigitizedAspectY
Definition: wingdi.h:2348
BYTE tmPitchAndFamily
Definition: wingdi.h:2356
BYTE tmUnderlined
Definition: wingdi.h:2354
BYTE tmCharSet
Definition: wingdi.h:2357
BYTE tmFirstChar
Definition: wingdi.h:2349
BYTE tmPitchAndFamily
Definition: wingdi.h:2378
WCHAR tmBreakChar
Definition: wingdi.h:2374
BYTE tmStruckOut
Definition: wingdi.h:2377
BYTE tmDefaultChar
Definition: wingdi.h:2351
LONG tmHeight
Definition: wingdi.h:2338
LONG tmInternalLeading
Definition: wingdi.h:2341
LONG tmOverhang
Definition: wingdi.h:2368
LONG tmExternalLeading
Definition: wingdi.h:2342
LONG tmDescent
Definition: wingdi.h:2340
BYTE tmCharSet
Definition: wingdi.h:2379
LONG tmDigitizedAspectY
Definition: wingdi.h:2370
LONG tmAscent
Definition: wingdi.h:2339
LONG tmMaxCharWidth
Definition: wingdi.h:2344
BYTE tmStruckOut
Definition: wingdi.h:2355
BYTE tmItalic
Definition: wingdi.h:2353
LONG tmOverhang
Definition: wingdi.h:2346
#define min(a, b)
Definition: monoChain.cc:55
WCHAR tmDefaultChar
Definition: wingdi.h:2373
LONG tmDigitizedAspectX
Definition: wingdi.h:2347
LONG tmWeight
Definition: wingdi.h:2367
BYTE tmBreakChar
Definition: wingdi.h:2352
LONG tmHeight
Definition: wingdi.h:2360
#define CHAR(Char)
BYTE tmItalic
Definition: wingdi.h:2375
WCHAR tmFirstChar
Definition: wingdi.h:2371
WCHAR tmLastChar
Definition: wingdi.h:2372
LONG tmDigitizedAspectX
Definition: wingdi.h:2369

◆ GdiAddFontResourceW()

int WINAPI GdiAddFontResourceW ( LPCWSTR  lpszFilename,
FLONG  fl,
DESIGNVECTOR pdv 
)

Definition at line 2194 of file font.c.

Referenced by AddFontResourceA(), AddFontResourceExA(), AddFontResourceExW(), and AddFontResourceW().

2198 {
2199  INT Ret;
2200  WCHAR lpszBuffer[MAX_PATH];
2201  WCHAR lpszAbsPath[MAX_PATH];
2202  UNICODE_STRING NtAbsPath;
2203 
2204  /* FIXME: We don't support multiple files passed in lpszFilename
2205  * as L"abcxxxxx.pfm|abcxxxxx.pfb"
2206  */
2207 
2208  /* Does the file exist in CurrentDirectory or in the Absolute Path passed? */
2209  GetCurrentDirectoryW(MAX_PATH, lpszBuffer);
2210 
2211  if (!SearchPathW(lpszBuffer, lpszFilename, NULL, MAX_PATH, lpszAbsPath, NULL))
2212  {
2213  /* Nope. Then let's check Fonts folder */
2214  GetWindowsDirectoryW(lpszBuffer, MAX_PATH);
2215  StringCbCatW(lpszBuffer, sizeof(lpszBuffer), L"\\Fonts");
2216 
2217  if (!SearchPathW(lpszBuffer, lpszFilename, NULL, MAX_PATH, lpszAbsPath, NULL))
2218  {
2219  DPRINT1("Font not found. The Buffer is: %ls, the FileName is: %S\n", lpszBuffer, lpszFilename);
2220  return 0;
2221  }
2222  }
2223 
2224  /* We found the font file so: */
2225  if (!RtlDosPathNameToNtPathName_U(lpszAbsPath, &NtAbsPath, NULL, NULL))
2226  {
2227  DPRINT1("Can't convert Path! Path: %ls\n", lpszAbsPath);
2228  return 0;
2229  }
2230 
2231  /* The Nt call expects a null-terminator included in cwc param. */
2232  ASSERT(NtAbsPath.Buffer[NtAbsPath.Length / sizeof(WCHAR)] == UNICODE_NULL);
2233  Ret = NtGdiAddFontResourceW(NtAbsPath.Buffer, NtAbsPath.Length / sizeof(WCHAR) + 1, 1, fl, 0, pdv);
2234 
2235  RtlFreeUnicodeString(&NtAbsPath);
2236 
2237  return Ret;
2238 }
INT APIENTRY NtGdiAddFontResourceW(IN WCHAR *pwcFiles, IN ULONG cwc, IN ULONG cFiles, IN FLONG fl, IN DWORD dwPidTid, IN OPTIONAL DESIGNVECTOR *pdv)
Definition: font.c:446
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define GetCurrentDirectoryW(x, y)
Definition: compat.h:413
int32_t INT
Definition: typedefs.h:56
STRSAFEAPI StringCbCatW(STRSAFE_LPWSTR pszDest, size_t cbDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:342
UINT WINAPI GetWindowsDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: path.c:2351
_In_ FLONG fl
Definition: winddi.h:1279
#define UNICODE_NULL
smooth NULL
Definition: ftsmooth.c:416
#define MAX_PATH
Definition: compat.h:26
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
static const WCHAR L[]
Definition: oid.c:1087
DWORD WINAPI SearchPathW(IN LPCWSTR lpPath OPTIONAL, IN LPCWSTR lpFileName, IN LPCWSTR lpExtension OPTIONAL, IN DWORD nBufferLength, OUT LPWSTR lpBuffer, OUT LPWSTR *lpFilePart OPTIONAL)
Definition: path.c:1297
#define DPRINT1
Definition: precomp.h:8
NTSYSAPI BOOLEAN NTAPI RtlDosPathNameToNtPathName_U(_In_opt_z_ PCWSTR DosPathName, _Out_ PUNICODE_STRING NtPathName, _Out_opt_ PCWSTR *NtFileNamePart, _Out_opt_ PRTL_RELATIVE_NAME_U DirectoryInfo)

◆ GdiAllocBatchCommand()

FORCEINLINE PVOID GdiAllocBatchCommand ( HDC  hdc,
USHORT  Cmd 
)

Definition at line 366 of file gdi32p.h.

Referenced by DeleteRegion(), GdiDeleteBrushOrPen(), GdiSelectFont(), and SetBrushOrgEx().

369 {
370  PTEB pTeb;
371  USHORT cjSize;
372  PGDIBATCHHDR pHdr;
373 
374  /* Get a pointer to the TEB */
375  pTeb = NtCurrentTeb();
376 
377  /* Check if we have a valid environment */
378  if (!pTeb || !pTeb->Win32ThreadInfo) return NULL;
379 
380  /* Do we use a DC? */
381  if (hdc)
382  {
383  /* If the batch DC is NULL, we set this one as the new one */
384  if (!pTeb->GdiTebBatch.HDC) pTeb->GdiTebBatch.HDC = hdc;
385 
386  /* If not, check if the batch DC equal to our DC */
387  else if (pTeb->GdiTebBatch.HDC != hdc) return NULL;
388  }
389 
390  /* Get the size of the entry */
391  if (Cmd == GdiBCPatBlt) cjSize = 0;
392  else if (Cmd == GdiBCPolyPatBlt) cjSize = 0;
393  else if (Cmd == GdiBCTextOut) cjSize = 0;
394  else if (Cmd == GdiBCExtTextOut) cjSize = 0;
395  else if (Cmd == GdiBCSetBrushOrg) cjSize = sizeof(GDIBSSETBRHORG);
396  else if (Cmd == GdiBCExtSelClipRgn) cjSize = 0;
397  else if (Cmd == GdiBCSelObj) cjSize = sizeof(GDIBSOBJECT);
398  else if (Cmd == GdiBCDelRgn) cjSize = sizeof(GDIBSOBJECT);
399  else if (Cmd == GdiBCDelObj) cjSize = sizeof(GDIBSOBJECT);
400  else cjSize = 0;
401 
402  /* Unsupported operation */
403  if (cjSize == 0) return NULL;
404 
405  /* Check if the buffer is full */
406  if ((pTeb->GdiBatchCount >= GDI_BatchLimit) ||
408  {
409  /* Call win32k, the kernel will call NtGdiFlushUserBatch to flush
410  the current batch */
411  NtGdiFlush();
412  }
413 
414  /* Get the head of the entry */
415  pHdr = (PVOID)((PUCHAR)pTeb->GdiTebBatch.Buffer + pTeb->GdiTebBatch.Offset);
416 
417  /* Update Offset and batch count */
418  pTeb->GdiTebBatch.Offset += cjSize;
419  pTeb->GdiBatchCount++;
420 
421  /* Fill in the core fields */
422  pHdr->Cmd = Cmd;
423  pHdr->Size = cjSize;
424 
425  return pHdr;
426 }
struct _GDIBSSETBRHORG GDIBSSETBRHORG
DWORD GDI_BatchLimit
Definition: misc.c:36
SHORT Size
Definition: ntgdityp.h:452
PVOID Win32ThreadInfo
Definition: compat.h:495
unsigned char * PUCHAR
Definition: retypes.h:3
SHORT Cmd
Definition: ntgdityp.h:453
ULONG Buffer[GDI_BATCH_BUFFER_SIZE]
Definition: compat.h:482
struct _GDIBSOBJECT GDIBSOBJECT
#define GDIBATCHBUFSIZE
Definition: ntgdityp.h:197
HDC hdc
Definition: msvc.h:53
smooth NULL
Definition: ftsmooth.c:416
void * PVOID
Definition: retypes.h:9
__kernel_entry W32KAPI NTSTATUS APIENTRY NtGdiFlush(VOID)
Definition: gdibatch.c:152
GDI_TEB_BATCH GdiTebBatch
Definition: compat.h:506
ULONG GdiBatchCount
Definition: compat.h:536
Definition: sacdrv.h:278
Definition: compat.h:484
ULONG Offset
Definition: compat.h:480
FORCEINLINE struct _TEB * NtCurrentTeb(VOID)
Definition: psfuncs.h:420
unsigned short USHORT
Definition: pedump.c:61
_In_ ULONG cjSize
Definition: winddi.h:3634
HANDLE HDC
Definition: compat.h:481

◆ GdiCreateClientObj()

HGDIOBJ WINAPI GdiCreateClientObj ( _In_ PVOID  pvObject,
_In_ GDILOOBJTYPE  eObjType 
)

Definition at line 148 of file clientobj.c.

Referenced by _lrintf(), alloc_dc_ptr(), and alloc_gdi_handle().

151 {
152  HGDIOBJ hobj;
153 
154  /* Call win32k to create a client object handle */
155  hobj = NtGdiCreateClientObj(eObjType);
156  if (hobj == NULL)
157  {
158  return NULL;
159  }
160 
161  /* Create the client object link */
162  if (!GdiCreateClientObjLink(hobj, pvObject))
163  {
164  NtGdiDeleteClientObj(hobj);
165  return NULL;
166  }
167 
168  return hobj;
169 }
__kernel_entry W32KAPI BOOL APIENTRY NtGdiDeleteClientObj(_In_ HANDLE h)
BOOL WINAPI GdiCreateClientObjLink(_In_ HGDIOBJ hobj, _In_ PVOID pvObject)
Definition: clientobj.c:24
__kernel_entry W32KAPI HANDLE APIENTRY NtGdiCreateClientObj(_In_ ULONG ulType)
smooth NULL
Definition: ftsmooth.c:416

◆ GdiCreateClientObjLink()

BOOL WINAPI GdiCreateClientObjLink ( _In_ HGDIOBJ  hobj,
_In_ PVOID  pvObject 
)

Definition at line 24 of file clientobj.c.

Referenced by _lrintf(), GDI_hdc_using_object(), and GdiCreateClientObj().

27 {
28  PCLIENTOBJLINK pcol;
29  ULONG iHashIndex;
30 
31  /* Allocate a link structure */
32  pcol = HeapAlloc(GetProcessHeap(), 0, sizeof(*pcol));
33  if (pcol == NULL)
34  {
35  return FALSE;
36  }
37 
38  /* Setup the link structure */
39  pcol->hobj = hobj;
40  pcol->pvObj = pvObject;
41 
42  /* Calculate the hash index */
43  iHashIndex = (ULONG_PTR)hobj % _countof(gapcolHashTable);
44 
45  /* Enter the critical section */
47 
48  /* Insert the link structure */
49  pcol->pcolNext = gapcolHashTable[iHashIndex];
50  gapcolHashTable[iHashIndex] = pcol;
51  gcClientObj++;
52 
53  /* Leave the critical section */
55 
56  return TRUE;
57 }
#define TRUE
Definition: types.h:120
ULONG gcClientObj
Definition: clientobj.c:11
#define _countof(array)
Definition: fontsub.cpp:30
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
smooth NULL
Definition: ftsmooth.c:416
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
CRITICAL_SECTION gcsClientObjLinks
Definition: clientobj.c:10
PCLIENTOBJLINK gapcolHashTable[127]
Definition: clientobj.c:20
unsigned int ULONG
Definition: retypes.h:1
#define ULONG_PTR
Definition: config.h:101
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)

◆ GdiDeleteClientObj()

PVOID WINAPI GdiDeleteClientObj ( _In_ HGDIOBJ  hobj)

Definition at line 173 of file clientobj.c.

Referenced by _lrintf(), free_dc_ptr(), and free_gdi_handle().

175 {
176  PVOID pvObject;
177 
178  /* Remove the client object link */
179  pvObject = GdiRemoveClientObjLink(hobj);
180  if (pvObject == NULL)
181  {
182  return NULL;
183  }
184 
185  /* Call win32k to delete the handle */
186  if (!NtGdiDeleteClientObj(hobj))
187  {
188  ASSERT(FALSE);
189  }
190 
191  return pvObject;
192 }
__kernel_entry W32KAPI BOOL APIENTRY NtGdiDeleteClientObj(_In_ HANDLE h)
PVOID WINAPI GdiRemoveClientObjLink(_In_ HGDIOBJ hobj)
Definition: clientobj.c:98
smooth NULL
Definition: ftsmooth.c:416
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)

◆ GdiFixUpHandle()

HGDIOBJ WINAPI GdiFixUpHandle ( HGDIOBJ  hGO)

Definition at line 734 of file misc.c.

Referenced by GetObjectW(), and SelectObject().

735 {
737 
738  if (((ULONG_PTR)(hGdiObj)) & GDI_HANDLE_UPPER_MASK )
739  {
740  return hGdiObj;
741  }
742 
743  /* FIXME is this right ?? */
744 
745  Entry = GdiHandleTable + GDI_HANDLE_GET_INDEX(hGdiObj);
746 
747  /* Rebuild handle for Object */
748  return hGdiObj = (HGDIOBJ)(((LONG_PTR)(hGdiObj)) | (Entry->Type << GDI_ENTRY_UPPER_SHIFT));
749 }
#define GDI_HANDLE_GET_INDEX(h)
Definition: gdi.h:28
struct _Entry Entry
Definition: kefuncs.h:640
uint32_t ULONG_PTR
Definition: typedefs.h:63
PGDI_TABLE_ENTRY GdiHandleTable
Definition: misc.c:33
LONG Type
Definition: gdi.h:5
void * HGDIOBJ
Definition: windef.h:257
Definition: gdi.h:1
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define GDI_ENTRY_UPPER_SHIFT
Definition: ntgdihdl.h:35
#define GDI_HANDLE_UPPER_MASK
Definition: gdi.h:22

◆ GdiGetBitmapBitsSize()

int WINAPI GdiGetBitmapBitsSize ( BITMAPINFO lpbmi)
Examples:
/srv/doxygen/reactos/win32ss/gdi/gdi32/objects/utils.c.

Definition at line 161 of file bitmap.c.

Referenced by ConvertBitmapInfo(), CreateDIBitmap(), and StretchDIBits().

163 {
164  UINT Ret;
165 
166  if (!lpbmi)
167  return 0;
168 
169  if (lpbmi->bmiHeader.biSize == sizeof(BITMAPCOREHEADER))
170  {
171  PBITMAPCOREHEADER Core = (PBITMAPCOREHEADER) lpbmi;
172  Ret =
173  WIDTH_BYTES_ALIGN32(Core->bcWidth * Core->bcPlanes,
174  Core->bcBitCount) * Core->bcHeight;
175  }
176  else /* assume BITMAPINFOHEADER */
177  {
178  if (!(lpbmi->bmiHeader.biCompression) || (lpbmi->bmiHeader.biCompression == BI_BITFIELDS))
179  {
180  Ret = WIDTH_BYTES_ALIGN32(
181  lpbmi->bmiHeader.biWidth * lpbmi->bmiHeader.biPlanes,
182  lpbmi->bmiHeader.biBitCount) * abs(lpbmi->bmiHeader.biHeight);
183  }
184  else
185  {
186  Ret = lpbmi->bmiHeader.biSizeImage;
187  }
188  }
189  return Ret;
190 }
#define abs(i)
Definition: fconv.c:206
#define WIDTH_BYTES_ALIGN32(cx, bpp)
Definition: bitmap.c:7
BITMAPINFOHEADER bmiHeader
Definition: wingdi.h:1453
#define BI_BITFIELDS
Definition: mmreg.h:507
DWORD biCompression
Definition: amvideo.idl:35
unsigned int UINT
Definition: ndis.h:50
DWORD biSizeImage
Definition: amvideo.idl:36
struct tagBITMAPCOREHEADER * PBITMAPCOREHEADER

◆ GdiGetClientObjLink()

PVOID WINAPI GdiGetClientObjLink ( _In_ HGDIOBJ  hobj)

Definition at line 61 of file clientobj.c.

Referenced by _lrintf(), GDI_GetObjPtr(), and get_dc_ptr().

63 {
64  ULONG iHashIndex;
65  PCLIENTOBJLINK pcol;
66  PVOID pvObject = NULL;
67 
68  /* Calculate the hash index */
69  iHashIndex = (ULONG_PTR)hobj % _countof(gapcolHashTable);
70 
71  /* Enter the critical section */
73 
74  /* Loop the link entries in this hash bucket */
75  pcol = gapcolHashTable[iHashIndex];
76  while (pcol != NULL)
77  {
78  /* Check if this is the object we want */
79  if (pcol->hobj == hobj)
80  {
81  /* Get the object pointer and bail out */
82  pvObject = pcol->pvObj;
83  break;
84  }
85 
86  /* Go to the next entry */
87  pcol = pcol->pcolNext;
88  }
89 
90  /* Leave the critical section */
92 
93  return pvObject;
94 }
#define _countof(array)
Definition: fontsub.cpp:30
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
smooth NULL
Definition: ftsmooth.c:416
CRITICAL_SECTION gcsClientObjLinks
Definition: clientobj.c:10
PCLIENTOBJLINK gapcolHashTable[127]
Definition: clientobj.c:20
unsigned int ULONG
Definition: retypes.h:1
#define ULONG_PTR
Definition: config.h:101
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)

◆ GdiGetCodePage()

DWORD WINAPI GdiGetCodePage ( HDC  )

◆ GdiGetDcAttr()

FORCEINLINE PDC_ATTR GdiGetDcAttr ( HDC  hdc)

Definition at line 430 of file gdi32p.h.

Referenced by DPtoLP(), Escape(), GdiGetCodePage(), GdiGetLDC(), GdiSelectBrush(), GdiSelectFont(), GdiSelectPen(), GdiSetLDC(), GetBkColor(), GetBkMode(), GetClipRgn(), GetCurrentObject(), GetCurrentPositionEx(), GetDCBrushColor(), GetDCPenColor(), GetDeviceCaps(), GetGraphicsMode(), GetHFONT(), GetLayout(), GetMapMode(), GetPolyFillMode(), GetROP2(), GetStretchBltMode(), GetTextAlign(), GetTextCharacterExtra(), GetTextColor(), GetViewportExtEx(), GetViewportOrgEx(), GetWindowExtEx(), GetWindowOrgEx(), GetWorldTransform(), LPtoDP(), ModifyWorldTransform(), MoveToEx(), OffsetViewportOrgEx(), OffsetWindowOrgEx(), ScaleViewportExtEx(), ScaleWindowExtEx(), SetBkColor(), SetBkMode(), SetDCBrushColor(), SetDCPenColor(), SetGraphicsMode(), SetLayout(), SetLayoutWidth(), SetMapMode(), SetPolyFillMode(), SetROP2(), SetStretchBltMode(), SetTextAlign(), SetTextCharacterExtra(), SetTextColor(), SetTextJustification(), SetViewportExtEx(), SetViewportOrgEx(), SetWindowExtEx(), and SetWindowOrgEx().

431 {
432  GDILOOBJTYPE eDcObjType;
433  PDC_ATTR pdcattr;
434 
435  /* Check DC object type */
436  eDcObjType = GDI_HANDLE_GET_TYPE(hdc);
437  if ((eDcObjType != GDILoObjType_LO_DC_TYPE) &&
438  (eDcObjType != GDILoObjType_LO_ALTDC_TYPE))
439  {
440  return NULL;
441  }
442 
443  /* Get the DC attribute */
444  if (!GdiGetHandleUserData((HGDIOBJ)hdc, eDcObjType, (PVOID*)&pdcattr))
445  {
446  return NULL;
447  }
448 
449  return pdcattr;
450 }
HDC hdc
Definition: msvc.h:53
smooth NULL
Definition: ftsmooth.c:416
#define GDI_HANDLE_GET_TYPE(h)
Definition: gdi.h:31
BOOL GdiGetHandleUserData(HGDIOBJ hGdiObj, DWORD ObjectType, PVOID *UserData)
Definition: misc.c:761
enum GDILoObjType GDILOOBJTYPE

◆ GdiGetHandleUserData()

BOOL GdiGetHandleUserData ( HGDIOBJ  hGdiObj,
DWORD  ObjectType,
PVOID UserData 
)

Definition at line 761 of file misc.c.

Referenced by GdiGetDcAttr(), GdiGetRgnAttr(), and hGetPEBHandle().

762 {
764 
765  /* Check if twe have the correct type */
766  if (GDI_HANDLE_GET_TYPE(hGdiObj) != ObjectType ||
769  {
770  return FALSE;
771  }
772 
773  /* Check if we are the owner */
774  if ((HANDLE)((ULONG_PTR)Entry->ProcessId & ~0x1) != CurrentProcessId)
775  {
776  return FALSE;
777  }
778 
779  *UserData = Entry->UserData;
780  return TRUE;
781 }
#define GDI_HANDLE_GET_INDEX(h)
Definition: gdi.h:28
ObjectType
Definition: metafile.c:80
PVOID UserData
Definition: gdi.h:6
#define TRUE
Definition: types.h:120
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG x1
Definition: winddi.h:3706
HANDLE ProcessId
Definition: gdi.h:4
uint32_t ULONG_PTR
Definition: typedefs.h:63
#define GDI_ENTRY_BASETYPE_MASK
Definition: ntgdihdl.h:34
PGDI_TABLE_ENTRY GdiHandleTable
Definition: misc.c:33
#define GDI_HANDLE_GET_TYPE(h)
Definition: gdi.h:31
HANDLE CurrentProcessId
Definition: misc.c:35
LONG Type
Definition: gdi.h:5
Definition: gdi.h:1
#define GDI_ENTRY_UPPER_SHIFT
Definition: ntgdihdl.h:35
#define GDI_HANDLE_TYPE_MASK
Definition: gdi.h:17
base of all file and directory entries
Definition: entries.h:82

◆ GdiGetLDC()

PLDC FASTCALL GdiGetLDC ( HDC  hDC)

Definition at line 785 of file misc.c.

Referenced by AbortDoc(), CancelDC(), DeleteDC(), DeleteObject(), DrawEscape(), EndDoc(), free_dc_ptr(), GDI_GetObjPtr(), GdiConvertAndCheckDC(), GdiIsMetaFileDC(), GdiIsMetaPrintDC(), GdiIsPlayMetafileDC(), get_dc_ptr(), IntEndPage(), SetAbortProc(), SetBrushOrgEx(), SetColorSpace(), SetMetaRgn(), StartDocW(), StartPage(), and StretchDIBits().

786 {
787  PDC_ATTR pdcattr;
788 
789  /* Get the DC attribute */
790  pdcattr = GdiGetDcAttr(hdc);
791  if (pdcattr == NULL)
792  {
793  return NULL;
794  }
795 
796  /* Return the LDC pointer */
797  return pdcattr->pvLDC;
798 }
PVOID pvLDC
Definition: ntgdihdl.h:290
FORCEINLINE PDC_ATTR GdiGetDcAttr(HDC hdc)
Definition: gdi32p.h:430
HDC hdc
Definition: msvc.h:53
smooth NULL
Definition: ftsmooth.c:416

◆ GdiGetRgnAttr()

FORCEINLINE PRGN_ATTR GdiGetRgnAttr ( HRGN  hrgn)

Definition at line 454 of file gdi32p.h.

Referenced by CombineRgn(), and SetRectRgn().

455 {
456  PRGN_ATTR prgnattr;
457 
458  /* Get the region attribute */
460  {
461  return NULL;
462  }
463 
464  return prgnattr;
465 }
smooth NULL
Definition: ftsmooth.c:416
BOOL GdiGetHandleUserData(HGDIOBJ hGdiObj, DWORD ObjectType, PVOID *UserData)
Definition: misc.c:761
static HRGN hrgn
Definition: win.c:55

◆ GdiInitializeLanguagePack()

VOID WINAPI GdiInitializeLanguagePack ( _In_ DWORD  InitParam)

Referenced by GdiProcessSetup().

◆ GdiRemoveClientObjLink()

PVOID WINAPI GdiRemoveClientObjLink ( _In_ HGDIOBJ  hobj)

Definition at line 98 of file clientobj.c.

Referenced by _lrintf(), GDI_hdc_not_using_object(), GdiDeleteClientObj(), and METADC_DeleteObject().

100 {
101  PCLIENTOBJLINK pcol, *ppcol;
102  ULONG iHashIndex;
103  PVOID pvObject = NULL;
104 
105  /* Calculate the hash index */
106  iHashIndex = (ULONG_PTR)hobj % _countof(gapcolHashTable);
107 
108  /* Enter the critical section */
110 
111  /* Loop the link entries in this hash bucket */
112  ppcol = &gapcolHashTable[iHashIndex];
113  while (*ppcol != NULL)
114  {
115  /* Get the current client object link */
116  pcol = *ppcol;
117 
118  /* Check if this is the one we want */
119  if (pcol->hobj == hobj)
120  {
121  /* Update the link pointer, removing this link */
122  *ppcol = pcol->pcolNext;
123  gcClientObj--;
124 
125  /* Get the object pointer */
126  pvObject = pcol->pvObj;
127 
128  /* Free the link structure */
129  HeapFree(GetProcessHeap(), 0, pcol);
130 
131  /* We're done */
132  break;
133  }
134 
135  /* Go to the next link pointer */
136  ppcol = &(pcol->pcolNext);
137  }
138 
139  /* Leave the critical section */
141 
142  /* Return the object pointer, or NULL if we did not find it */
143  return pvObject;
144 }
ULONG gcClientObj
Definition: clientobj.c:11
#define _countof(array)
Definition: fontsub.cpp:30
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
smooth NULL
Definition: ftsmooth.c:416
#define GetProcessHeap()
Definition: compat.h:395
CRITICAL_SECTION gcsClientObjLinks
Definition: clientobj.c:10
PCLIENTOBJLINK gapcolHashTable[127]
Definition: clientobj.c:20
unsigned int ULONG
Definition: retypes.h:1
#define ULONG_PTR
Definition: config.h:101
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
#define HeapFree(x, y, z)
Definition: compat.h:394

◆ GdiSAPCallback()

VOID GdiSAPCallback ( PLDC  pldc)

Definition at line 819 of file misc.c.

Referenced by GdiConvertAndCheckDC(), IntEndPage(), and StartDocW().

820 {
821  DWORD Time, NewTime = GetTickCount();
822 
823  Time = NewTime - pldc->CallBackTick;
824 
825  if ( Time < SAPCALLBACKDELAY) return;
826 
827  pldc->CallBackTick = NewTime;
828 
829  if ( !pldc->pAbortProc(pldc->hDC, 0) )
830  {
831  CancelDC(pldc->hDC);
832  AbortDoc(pldc->hDC);
833  }
834 }
DWORD CallBackTick
Definition: ntgdihdl.h:279
DWORD WINAPI GetTickCount(VOID)
Definition: time.c:445
BOOL WINAPI CancelDC(_In_ HDC hdc)
INT WINAPI AbortDoc(_In_ HDC hdc)
HDC hDC
Definition: ntgdihdl.h:273
unsigned long DWORD
Definition: ntddk_ex.h:95
#define SAPCALLBACKDELAY
Definition: gdi32p.h:65
ABORTPROC pAbortProc
Definition: ntgdihdl.h:278
static PLARGE_INTEGER Time
Definition: time.c:105

◆ GdiSelectBrush()

HBRUSH WINAPI GdiSelectBrush ( _In_ HDC  hdc,
_In_ HBRUSH  hbr 
)

Definition at line 1386 of file dc.c.

Referenced by _lrintf(), and SelectObject().

1389 {
1390  PDC_ATTR pdcattr;
1391  HBRUSH hbrOld;
1392 
1393  HANDLE_METADC(HBRUSH, SelectBrush, NULL, hdc, hbr);
1394 
1395  /* Get the DC attribute */
1396  pdcattr = GdiGetDcAttr(hdc);
1397  if (pdcattr == NULL)
1398  {
1400  return NULL;
1401  }
1402 
1403  /* Get the current brush. If it matches the new brush, we're done */
1404  hbrOld = pdcattr->hbrush;
1405  if (hbrOld == hbr)
1406  return hbrOld;
1407 
1408  /* Set the new brush and update dirty flags */
1409  pdcattr->hbrush = hbr;
1410  pdcattr->ulDirty_ |= DC_BRUSH_DIRTY;
1411  return hbrOld;
1412 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
HANDLE hbrush
Definition: ntgdihdl.h:292
FORCEINLINE PDC_ATTR GdiGetDcAttr(HDC hdc)
Definition: gdi32p.h:430
#define HANDLE_METADC(_RetType, _Func, dwError, hdc,...)
Definition: gdi32p.h:595
HDC hdc
Definition: msvc.h:53
smooth NULL
Definition: ftsmooth.c:416
ULONG ulDirty_
Definition: ntgdihdl.h:291
#define SetLastError(x)
Definition: compat.h:409
#define DC_BRUSH_DIRTY
Definition: ntgdihdl.h:157
#define SelectBrush(hdc, hbr)
Definition: windowsx.h:485

◆ GdiSelectFont()

HFONT WINAPI GdiSelectFont ( _In_ HDC  hdc,
_In_ HFONT  hfont 
)

Definition at line 1446 of file dc.c.

Referenced by _lrintf(), and SelectObject().

1449 {
1450  PDC_ATTR pdcattr;
1451  HFONT hfontOld;
1452 
1454 
1455  /* Get the DC attribute */
1456  pdcattr = GdiGetDcAttr(hdc);
1457  if (pdcattr == NULL)
1458  {
1460  return NULL;
1461  }
1462 
1463  /* Get the current font. If it matches the new font, we're done */
1464  hfontOld = pdcattr->hlfntNew;
1465  if (hfontOld == hfont)
1466  return hfontOld;
1467 
1468  /* Set the new font and update dirty flags */
1469  pdcattr->hlfntNew = hfont;
1470  pdcattr->ulDirty_ &= ~SLOW_WIDTHS;
1471  pdcattr->ulDirty_ |= DIRTY_CHARSET;
1472 
1473  /* If the DC does not have a DIB section selected, try a batch command */
1474  if (!(pdcattr->ulDirty_ & DC_DIBSECTION))
1475  {
1476  PGDIBSOBJECT pgO;
1477 
1479  if (pgO)
1480  {
1481  pgO->hgdiobj = hfont;
1482  return hfontOld;
1483  }
1484  }
1485 
1486  /* We could not use the batch command, call win32k */
1487  return NtGdiSelectFont(hdc, hfont);
1488 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
#define DIRTY_CHARSET
Definition: ntgdihdl.h:149
FORCEINLINE PDC_ATTR GdiGetDcAttr(HDC hdc)
Definition: gdi32p.h:430
#define DC_DIBSECTION
Definition: ntgdihdl.h:159
#define HANDLE_METADC(_RetType, _Func, dwError, hdc,...)
Definition: gdi32p.h:595
HANDLE hlfntNew
Definition: ntgdihdl.h:327
HDC hdc
Definition: msvc.h:53
smooth NULL
Definition: ftsmooth.c:416
static HFONT hfont
ULONG ulDirty_
Definition: ntgdihdl.h:291
__kernel_entry W32KAPI HFONT APIENTRY NtGdiSelectFont(_In_ HDC hdc, _In_ HFONT hf)
Definition: dcobjs.c:597
HGDIOBJ hgdiobj
Definition: ntgdityp.h:546
#define SetLastError(x)
Definition: compat.h:409
#define SLOW_WIDTHS
Definition: ntgdihdl.h:150
#define SelectFont(hdc, hfont)
Definition: windowsx.h:486
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
FORCEINLINE PVOID GdiAllocBatchCommand(HDC hdc, USHORT Cmd)
Definition: gdi32p.h:366

◆ GdiSelectPen()

HPEN WINAPI GdiSelectPen ( _In_ HDC  hdc,
_In_ HPEN  hpen 
)

Definition at line 1416 of file dc.c.

Referenced by _lrintf(), and SelectObject().

1419 {
1420  PDC_ATTR pdcattr;
1421  HPEN hpenOld;
1422 
1423  HANDLE_METADC(HPEN, SelectPen, NULL, hdc, hpen);
1424 
1425  /* Get the DC attribute */
1426  pdcattr = GdiGetDcAttr(hdc);
1427  if (pdcattr == NULL)
1428  {
1430  return NULL;
1431  }
1432 
1433  /* Get the current pen. If it matches the new pen, we're done */
1434  hpenOld = pdcattr->hpen;
1435  if (hpenOld == hpen)
1436  return hpenOld;
1437 
1438  /* Set the new pen and update dirty flags */
1439  pdcattr->ulDirty_ |= DC_PEN_DIRTY;
1440  pdcattr->hpen = hpen;
1441  return hpenOld;
1442 }
HANDLE hpen
Definition: ntgdihdl.h:293
FORCEINLINE PDC_ATTR GdiGetDcAttr(HDC hdc)
Definition: gdi32p.h:430
#define DC_PEN_DIRTY
Definition: ntgdihdl.h:158
#define ERROR_INVALID_HANDLE
Definition: compat.h:88
static HPEN hpen
#define HANDLE_METADC(_RetType, _Func, dwError, hdc,...)
Definition: gdi32p.h:595
#define SelectPen(hdc, hpen)
Definition: windowsx.h:487
HDC hdc
Definition: msvc.h:53
smooth NULL
Definition: ftsmooth.c:416
ULONG ulDirty_
Definition: ntgdihdl.h:291
#define SetLastError(x)
Definition: compat.h:409

◆ GdiSetLastError()

VOID WINAPI GdiSetLastError ( DWORD  dwErrCode)

Definition at line 873 of file misc.c.

Referenced by CreateDIBitmap(), Escape(), GetDIBits(), GetTextFaceA(), GetTextFaceAliasW(), GetTextFaceW(), and TranslateCharsetInfo().

874 {
875  NtCurrentTeb()->LastErrorValue = (ULONG) dwErrCode;
876 }
FORCEINLINE struct _TEB * NtCurrentTeb(VOID)
Definition: psfuncs.h:420
unsigned int ULONG
Definition: retypes.h:1

◆ GdiSetLDC()

BOOL FASTCALL GdiSetLDC ( HDC  hdc,
PVOID  pvLDC 
)

Definition at line 802 of file misc.c.

Referenced by alloc_dc_ptr(), and free_dc_ptr().

803 {
804  PDC_ATTR pdcattr;
805 
806  /* Get the DC attribute */
807  pdcattr = GdiGetDcAttr(hdc);
808  if (pdcattr == NULL)
809  {
810  return FALSE;
811  }
812 
813  /* Set the LDC pointer */
814  pdcattr->pvLDC = pvLDC;
815  return TRUE;
816 }
#define TRUE
Definition: types.h:120
PVOID pvLDC
Definition: ntgdihdl.h:290
FORCEINLINE PDC_ATTR GdiGetDcAttr(HDC hdc)
Definition: gdi32p.h:430
HDC hdc
Definition: msvc.h:53
smooth NULL
Definition: ftsmooth.c:416

◆ GdiValidateHandle()

BOOL WINAPI GdiValidateHandle ( HGDIOBJ  )

Definition at line 712 of file misc.c.

Referenced by DeleteObject(), GetDIBits(), GetObjectType(), GetObjectW(), GetPixel(), GetStockObject(), MirrorRgnDC(), PolyPatBlt(), and SelectObject().

713 {
715  if ( (Entry->Type & GDI_ENTRY_BASETYPE_MASK) != 0 &&
716  ( (Entry->Type << GDI_ENTRY_UPPER_SHIFT) & GDI_HANDLE_TYPE_MASK ) ==
717  GDI_HANDLE_GET_TYPE(hobj) )
718  {
719  HANDLE pid = (HANDLE)((ULONG_PTR)Entry->ProcessId & ~0x1);
720  if(pid == NULL || pid == CurrentProcessId)
721  {
722  return TRUE;
723  }
724  }
725  return FALSE;
726 
727 }
#define GDI_HANDLE_GET_INDEX(h)
Definition: gdi.h:28
_In_ ULONG_PTR _In_ ULONG _Out_ ULONG_PTR * pid
Definition: winddi.h:3835
#define TRUE
Definition: types.h:120
HANDLE ProcessId
Definition: gdi.h:4
uint32_t ULONG_PTR
Definition: typedefs.h:63
#define GDI_ENTRY_BASETYPE_MASK
Definition: ntgdihdl.h:34
PGDI_TABLE_ENTRY GdiHandleTable
Definition: misc.c:33
smooth NULL
Definition: ftsmooth.c:416
#define GDI_HANDLE_GET_TYPE(h)
Definition: gdi.h:31
HANDLE CurrentProcessId
Definition: misc.c:35
LONG Type
Definition: gdi.h:5
PVOID HANDLE
Definition: typedefs.h:71
Definition: gdi.h:1
#define GDI_ENTRY_UPPER_SHIFT
Definition: ntgdihdl.h:35
#define GDI_HANDLE_TYPE_MASK
Definition: gdi.h:17
base of all file and directory entries
Definition: entries.h:82

◆ GetAndSetDCDWord()

DWORD WINAPI GetAndSetDCDWord ( _In_ HDC  hdc,
_In_ UINT  u,
_In_ DWORD  dwIn,
_In_ ULONG  ulMFId,
_In_ USHORT  usMF16Id,
_In_ DWORD  dwError 
)

Definition at line 735 of file dc.c.

Referenced by SetArcDirection(), SetMapMode(), and SetRelAbs().

742 {
743  DWORD dwResult;
744 
745  /* This is a special API, handle it appropriately */
746  HANDLE_METADC2(DWORD, GetAndSetDCDWord, hdc, u, dwIn, ulMFId, usMF16Id, dwError);
747 
748  /* Call win32k to do the real work */
749  if (!NtGdiGetAndSetDCDword(hdc, u, dwIn, &dwResult))
750  {
751  return dwError;
752  }
753 
754  return dwResult;
755 }
GLenum GLclampf GLint GLenum GLuint GLenum GLenum GLsizei GLenum const GLvoid GLfloat GLfloat GLfloat GLfloat GLclampd GLint GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean GLboolean GLboolean GLboolean GLint GLenum GLsizei const GLvoid GLenum GLint GLenum GLint GLint GLsizei GLint GLenum GLint GLint GLint GLint GLsizei GLenum GLsizei const GLuint GLboolean GLenum GLenum GLint GLsizei GLenum GLsizei GLenum const GLvoid GLboolean const GLboolean GLenum const GLdouble * u
Definition: glfuncs.h:88
HDC hdc
Definition: msvc.h:53
unsigned long DWORD
Definition: ntddk_ex.h:95
DWORD WINAPI GetAndSetDCDWord(_In_ HDC hdc, _In_ UINT u, _In_ DWORD dwIn, _In_ ULONG ulMFId, _In_ USHORT usMF16Id, _In_ DWORD dwError)
Definition: dc.c:735
_In_ UINT _In_ DWORD dwIn
Definition: ntgdi.h:248
#define HANDLE_METADC2(_RetType, _Func, hdc,...)
Definition: gdi32p.h:701

◆ GetDCDWord()

DWORD WINAPI GetDCDWord ( _In_ HDC  hdc,
_In_ UINT  u,
_In_ DWORD  dwError 
)

Definition at line 763 of file dc.c.

Referenced by DRIVER_RestoreDC(), GetArcDirection(), GetFontLanguageInfo(), GetObjectType(), and GetRelAbs().

767 {
768  DWORD dwResult;
769 
770  if (!NtGdiGetDCDword(hdc, u, &dwResult))
771  {
772  return dwError;
773  }
774 
775  return dwResult;
776 }
__kernel_entry W32KAPI BOOL APIENTRY NtGdiGetDCDword(_In_ HDC hdc, _In_ UINT u, _Out_ DWORD *Result)
GLenum GLclampf GLint GLenum GLuint GLenum GLenum GLsizei GLenum const GLvoid GLfloat GLfloat GLfloat GLfloat GLclampd GLint GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean GLboolean GLboolean GLboolean GLint GLenum GLsizei const GLvoid GLenum GLint GLenum GLint GLint GLsizei GLint GLenum GLint GLint GLint GLint GLsizei GLenum GLsizei const GLuint GLboolean GLenum GLenum GLint GLsizei GLenum GLsizei GLenum const GLvoid GLboolean const GLboolean GLenum const GLdouble * u
Definition: glfuncs.h:88
HDC hdc
Definition: msvc.h:53
unsigned long DWORD
Definition: ntddk_ex.h:95

◆ GetDCObject()

HGDIOBJ WINAPI GetDCObject ( HDC  ,
INT   
)

◆ GetETM()

BOOL WINAPI GetETM ( HDC  hdc,
EXTTEXTMETRIC petm 
)

Referenced by Escape().

◆ HEAP_alloc()

PVOID HEAP_alloc ( DWORD  len)

Definition at line 35 of file heap.c.

Referenced by HEAP_strdupA2W().

36 {
37  /* make sure hProcessHeap gets initialized by GdiProcessSetup before we get here */
39  return RtlAllocateHeap ( hProcessHeap, 0, len );
40 }
#define assert(x)
Definition: debug.h:53
HANDLE hProcessHeap
Definition: heap.c:31
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
Definition: heap.c:585
GLenum GLsizei len
Definition: glext.h:6722

◆ HEAP_free()

VOID HEAP_free ( LPVOID  memory)

Definition at line 63 of file heap.c.

Referenced by AddFontResourceA(), AddFontResourceExA(), CreateDCA(), CreateICA(), EnumFontsA(), GetStringBitmapA(), GetTextExtentExPointA(), RemoveFontResourceExA(), and ResetDCA().

64 {
65  /* make sure hProcessHeap gets initialized by GdiProcessSetup before we get here */
67 
68  RtlFreeHeap ( hProcessHeap, 0, memory );
69 }
BOOLEAN NTAPI RtlFreeHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID HeapBase)
Definition: heap.c:603
#define assert(x)
Definition: debug.h:53
HANDLE hProcessHeap
Definition: heap.c:31

◆ HEAP_strdupA2W()

NTSTATUS HEAP_strdupA2W ( LPWSTR ppszW,
LPCSTR  lpszA 
)

Definition at line 43 of file heap.c.

Referenced by AddFontResourceA(), AddFontResourceExA(), CreateICA(), EnumFontsA(), GetStringBitmapA(), GetTextExtentExPointA(), and RemoveFontResourceExA().

44 {
45  ULONG len;
47 
48  *ppszW = NULL;
49  if ( !lpszA )
50  return STATUS_SUCCESS;
51  len = lstrlenA(lpszA);
52 
53  *ppszW = HEAP_alloc ( (len+1) * sizeof(WCHAR) );
54  if ( !*ppszW )
55  return STATUS_NO_MEMORY;
56  Status = RtlMultiByteToUnicodeN ( *ppszW, len*sizeof(WCHAR), NULL, (PCHAR)lpszA, len );
57  (*ppszW)[len] = L'\0';
58  return Status;
59 }
signed char * PCHAR
Definition: retypes.h:7
NTSYSAPI NTSTATUS WINAPI RtlMultiByteToUnicodeN(LPWSTR, DWORD, LPDWORD, LPCSTR, DWORD)
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG NTSTATUS
Definition: precomp.h:26
PVOID HEAP_alloc(DWORD len)
Definition: heap.c:35
smooth NULL
Definition: ftsmooth.c:416
static const WCHAR L[]
Definition: oid.c:1087
GLenum GLsizei len
Definition: glext.h:6722
Status
Definition: gdiplustypes.h:24
int WINAPI lstrlenA(LPCSTR lpString)
Definition: lstring.c:145
#define STATUS_NO_MEMORY
Definition: ntstatus.h:246
unsigned int ULONG
Definition: retypes.h:1
return STATUS_SUCCESS
Definition: btrfs.c:2710

◆ hGetPEBHandle()

HGDIOBJ FASTCALL hGetPEBHandle ( HANDLECACHETYPE  ,
COLORREF   
)

Definition at line 880 of file misc.c.

Referenced by CreatePen(), and CreateRectRgn().

881 {
882  int Number, Offset, MaxNum, GdiType;
883  HANDLE Lock;
884  HGDIOBJ Handle = NULL;
885 
887  NtCurrentTeb(),
888  NULL );
889 
890  if (Lock) return Handle;
891 
892  Number = GdiHandleCache->ulNumHandles[Type];
893 
894  if (Type == hctBrushHandle)
895  {
896  Offset = 0;
897  MaxNum = CACHE_BRUSH_ENTRIES;
898  GdiType = GDILoObjType_LO_BRUSH_TYPE;
899  }
900  else if (Type == hctPenHandle)
901  {
902  Offset = CACHE_BRUSH_ENTRIES;
903  MaxNum = CACHE_PEN_ENTRIES;
904  GdiType = GDILoObjType_LO_PEN_TYPE;
905  }
906  else if (Type == hctRegionHandle)
907  {
909  MaxNum = CACHE_REGION_ENTRIES;
910  GdiType = GDILoObjType_LO_REGION_TYPE;
911  }
912  else // Font is not supported here.
913  {
914  return Handle;
915  }
916 
917  if ( Number && Number <= MaxNum )
918  {
919  PBRUSH_ATTR pBrush_Attr;
920  HGDIOBJ *hPtr;
921  hPtr = GdiHandleCache->Handle + Offset;
922  Handle = hPtr[Number - 1];
923 
924  if (GdiGetHandleUserData( Handle, GdiType, (PVOID) &pBrush_Attr))
925  {
926  if (pBrush_Attr->AttrFlags & ATTR_CACHED)
927  {
928  DPRINT("Get Handle! Type %d Count %lu PEB 0x%p\n", Type, GdiHandleCache->ulNumHandles[Type], NtCurrentTeb()->ProcessEnvironmentBlock);
929  pBrush_Attr->AttrFlags &= ~ATTR_CACHED;
930  hPtr[Number - 1] = NULL;
932  if ( Type == hctBrushHandle ) // Handle only brush.
933  {
934  if ( pBrush_Attr->lbColor != cr )
935  {
936  pBrush_Attr->lbColor = cr ;
937  pBrush_Attr->AttrFlags |= ATTR_NEW_COLOR;
938  }
939  }
940  }
941  }
942  else
943  {
944  Handle = NULL;
945  }
946  }
948  return Handle;
949 }
#define CACHE_PEN_ENTRIES
Definition: ntgdityp.h:333
Type
Definition: Type.h:6
#define CACHE_REGION_ENTRIES
Definition: ntgdityp.h:334
BOOL GdiGetHandleUserData(HGDIOBJ hGdiObj, DWORD ObjectType, PVOID *UserData)
Definition: misc.c:761
PGDIHANDLECACHE GdiHandleCache
Definition: dllmain.c:10
_In_ ULONG _In_ ULONG Offset
Definition: ntddpcm.h:101
#define InterlockedCompareExchangePointer
Definition: interlocked.h:129
smooth NULL
Definition: ftsmooth.c:416
void DPRINT(...)
Definition: polytest.cpp:61
_In_ HANDLE Handle
Definition: extypes.h:390
#define InterlockedExchangePointer(Target, Value)
Definition: dshow.h:45
#define CACHE_BRUSH_ENTRIES
Definition: ntgdityp.h:332
ULONG ulNumHandles[GDI_CACHED_HANDLE_TYPES]
Definition: ntgdityp.h:348
IN OUT PLONG IN OUT PLONG Addend IN OUT PLONG IN LONG IN OUT PLONG IN LONG Increment IN PNDIS_RW_LOCK Lock
Definition: CrNtStubs.h:75
_In_opt_ PENTER_STATE_SYSTEM_HANDLER _In_opt_ PVOID _In_ LONG _In_opt_ LONG volatile * Number
Definition: ntpoapi.h:204
FORCEINLINE struct _TEB * NtCurrentTeb(VOID)
Definition: psfuncs.h:420
#define ATTR_NEW_COLOR
Definition: ntgdihdl.h:204
static void(__cdecl *p__invalid_parameter)(const wchar_t *
HANDLE Handle[CACHE_BRUSH_ENTRIES+CACHE_PEN_ENTRIES+CACHE_REGION_ENTRIES+CACHE_LFONT_ENTRIES]
Definition: ntgdityp.h:349
#define ATTR_CACHED
Definition: ntgdihdl.h:202

◆ InitializeLpkHooks()

VOID WINAPI InitializeLpkHooks ( _In_ FARPROC hookfuncs)

◆ LoadLPK()

BOOL WINAPI LoadLPK ( INT  LpkFunctionID)
Examples:
/srv/doxygen/reactos/win32ss/gdi/gdi32/objects/utils.c.

Definition at line 422 of file utils.c.

Referenced by ExtTextOutW(), GdiInitializeLanguagePack(), and GetCharacterPlacementW().

423 {
424  if(!hLpk) // Check if the DLL is already loaded
425  hLpk = LoadLibraryW(L"lpk.dll");
426 
427  if (hLpk)
428  {
429  switch (LpkFunctionID)
430  {
431  case LPK_INIT:
432  return TRUE;
433 
434  case LPK_ETO:
435  if (!LpkExtTextOut) // Check if the function is already loaded
436  LpkExtTextOut = (LPKETO) GetProcAddress(hLpk, "LpkExtTextOut");
437 
438  if (!LpkExtTextOut)
439  {
440  FreeLibrary(hLpk);
441  return FALSE;
442  }
443 
444  return TRUE;
445 
446  case LPK_GCP:
447  if (!LpkGetCharacterPlacement) // Check if the function is already loaded
448  LpkGetCharacterPlacement = (LPKGCP) GetProcAddress(hLpk, "LpkGetCharacterPlacement");
449 
451  {
452  FreeLibrary(hLpk);
453  return FALSE;
454  }
455 
456  return TRUE;
457 
458  default:
459  FreeLibrary(hLpk);
460  return FALSE;
461  }
462  }
463 
464  else
465  return FALSE;
466 }
#define TRUE
Definition: types.h:120
LPKETO LpkExtTextOut
Definition: utils.c:5
#define LoadLibraryW(x)
Definition: compat.h:404
DWORD(WINAPI * LPKGCP)(HDC hdc, LPCWSTR lpString, INT uCount, INT nMaxExtent, LPGCP_RESULTSW lpResults, DWORD dwFlags, DWORD dwUnused)
Definition: gdi32p.h:44
HINSTANCE hLpk
Definition: utils.c:4
#define FreeLibrary(x)
Definition: compat.h:405
static const WCHAR L[]
Definition: oid.c:1087
#define LPK_ETO
Definition: gdi32p.h:68
#define LPK_INIT
Definition: gdi32p.h:67
#define LPK_GCP
Definition: gdi32p.h:69
#define GetProcAddress(x, y)
Definition: compat.h:410
LPKGCP LpkGetCharacterPlacement
Definition: utils.c:6
BOOL(WINAPI * LPKETO)(HDC hdc, int x, int y, UINT fuOptions, const RECT *lprc, LPCWSTR lpString, UINT uCount, const INT *lpDx, INT unknown)
Definition: gdi32p.h:31

◆ LoadTheSpoolerDrv()

BOOL FASTCALL LoadTheSpoolerDrv ( VOID  )

Definition at line 188 of file printdrv.c.

Referenced by IntCreateDICW().

189 {
190  HMODULE hModWinSpoolDrv;
191 
192  if ( !ghSpooler )
193  {
195 
196  hModWinSpoolDrv = LoadLibraryW(L"WINSPOOL.DRV");
197 
198  if (hModWinSpoolDrv)
199  {
200  fpAbortPrinter = (PVOID)GetProcAddress(hModWinSpoolDrv, "AbortPrinter");
201  fpClosePrinter = (PVOID)GetProcAddress(hModWinSpoolDrv, "ClosePrinter");
202  fpCloseSpoolFileHandle = (PVOID)GetProcAddress(hModWinSpoolDrv, "CloseSpoolFileHandle");
203  fpCommitSpoolData = (PVOID)GetProcAddress(hModWinSpoolDrv, "CommitSpoolData");
204  // fpConnectToLd64In32Server = (PVOID)GetProcAddress(hModWinSpoolDrv, (LPCSTR)224);
205  fpDocumentEvent = (PVOID)GetProcAddress(hModWinSpoolDrv,"DocumentEvent");
206  fpDocumentPropertiesW = (PVOID)GetProcAddress(hModWinSpoolDrv, "DocumentPropertiesW");
207  fpEndDocPrinter = (PVOID)GetProcAddress(hModWinSpoolDrv, "EndDocPrinter");
208  fpEndPagePrinter = (PVOID)GetProcAddress(hModWinSpoolDrv, "EndPagePrinter");
209  fpGetPrinterW = (PVOID)GetProcAddress( hModWinSpoolDrv,"GetPrinterW");
210  fpGetPrinterDriverW = (PVOID)GetProcAddress(hModWinSpoolDrv,"GetPrinterDriverW");
211  fpGetSpoolFileHandle = (PVOID)GetProcAddress(hModWinSpoolDrv, "GetSpoolFileHandle");
212  fpIsValidDevmodeW = (PVOID)GetProcAddress(hModWinSpoolDrv, "IsValidDevmodeW");
213  fpOpenPrinterW = (PVOID)GetProcAddress(hModWinSpoolDrv, "OpenPrinterW");
214  fpQueryColorProfile = (PVOID)GetProcAddress(hModWinSpoolDrv,"QueryColorProfile");
215  fpQueryRemoteFonts = (PVOID)GetProcAddress(hModWinSpoolDrv, "QueryRemoteFonts");
216  fpQuerySpoolMode = (PVOID)GetProcAddress(hModWinSpoolDrv, "QuerySpoolMode");
217  fpReadPrinter = (PVOID)GetProcAddress(hModWinSpoolDrv, "ReadPrinter");
218  fpResetPrinterW = (PVOID)GetProcAddress(hModWinSpoolDrv, "ResetPrinterW");
219  fpSeekPrinter = (PVOID)GetProcAddress(hModWinSpoolDrv, "SeekPrinter");
220  fpSplDriverUnloadComplete = (PVOID)GetProcAddress(hModWinSpoolDrv, "SplDriverUnloadComplete");
221  fpSplReadPrinter = (PVOID)GetProcAddress(hModWinSpoolDrv, (LPCSTR)205);
222  fpStartDocDlgW = (PVOID)GetProcAddress(hModWinSpoolDrv, "StartDocDlgW");
223  fpStartDocPrinterW = (PVOID)GetProcAddress(hModWinSpoolDrv, "StartDocPrinterW");
224  fpStartPagePrinter = (PVOID)GetProcAddress(hModWinSpoolDrv, "StartPagePrinter");
225 
226  if ( !fpAbortPrinter ||
227  !fpClosePrinter ||
230  !fpDocumentEvent ||
232  !fpEndDocPrinter ||
233  !fpEndPagePrinter ||
234  !fpGetPrinterW ||
238  !fpOpenPrinterW ||
241  !fpQuerySpoolMode ||
242  !fpReadPrinter ||
243  !fpResetPrinterW ||
244  !fpSeekPrinter ||
246  !fpSplReadPrinter ||
247  !fpStartDocDlgW ||
250  {
251  FreeLibrary(hModWinSpoolDrv);
252  hModWinSpoolDrv = NULL;
253  }
254  ghSpooler = hModWinSpoolDrv;
255  }
257  }
258  else
259  return TRUE;
260 
262 
263  return (ghSpooler != NULL);
264 }
static ABORTPRINTER fpAbortPrinter
Definition: printdrv.c:42
#define TRUE
Definition: types.h:120
static RESETPRINTERW fpResetPrinterW
Definition: printdrv.c:60
static DOCUMENTPROPERTIESW fpDocumentPropertiesW
Definition: printdrv.c:48
NTSYSAPI NTSTATUS NTAPI RtlEnterCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
static STARTDOCPRINTERW fpStartDocPrinterW
Definition: printdrv.c:65
static STARTDOCDLGW fpStartDocDlgW
Definition: printdrv.c:64
static GETSPOOLFILEHANDLE fpGetSpoolFileHandle
Definition: printdrv.c:51
NTSYSAPI NTSTATUS NTAPI RtlLeaveCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)
static SEEKPRINTER fpSeekPrinter
Definition: printdrv.c:61
static ISVALIDDEVMODEW fpIsValidDevmodeW
Definition: printdrv.c:54
#define LoadLibraryW(x)
Definition: compat.h:404
smooth NULL
Definition: ftsmooth.c:416
const char * LPCSTR
Definition: xmlstorage.h:183
void * PVOID
Definition: retypes.h:9
static GETPRINTERW fpGetPrinterW
Definition: printdrv.c:52
CLOSEPRINTER fpClosePrinter
Definition: printdrv.c:43
#define FreeLibrary(x)
Definition: compat.h:405
static SPLREADPRINTER fpSplReadPrinter
Definition: printdrv.c:63
static QUERYREMOTEFONTS fpQueryRemoteFonts
Definition: printdrv.c:57
static QUERYSPOOLMODE fpQuerySpoolMode
Definition: printdrv.c:56
#define SetLastError(x)
Definition: compat.h:409
static QUERYCOLORPROFILE fpQueryColorProfile
Definition: printdrv.c:58
static ENDDOCPRINTER fpEndDocPrinter
Definition: printdrv.c:49
HANDLE ghSpooler
Definition: printdrv.c:40
static const WCHAR L[]
Definition: oid.c:1087
static SPLDRIVERUNLOADCOMPLETE fpSplDriverUnloadComplete
Definition: printdrv.c:62
static DOCUMENTEVENT fpDocumentEvent
Definition: printdrv.c:47
OPENPRINTERW fpOpenPrinterW
Definition: printdrv.c:55
static GETPRINTERDRIVERW fpGetPrinterDriverW
Definition: printdrv.c:53
static COMMITSPOOLDATA fpCommitSpoolData
Definition: printdrv.c:45
RTL_CRITICAL_SECTION semLocal
Definition: dllmain.c:12
static READPRINTER fpReadPrinter
Definition: printdrv.c:59
#define GetProcAddress(x, y)
Definition: compat.h:410
static ENDPAGEPRINTER fpEndPagePrinter
Definition: printdrv.c:50
static STARTPAGEPRINTER fpStartPagePrinter
Definition: printdrv.c:66
static CLOSESPOOLFILEHANDLE fpCloseSpoolFileHandle
Definition: printdrv.c:44

◆ LogFontA2W()

VOID NTAPI LogFontA2W ( LPLOGFONTW  pW,
CONST LOGFONTA pA 
)
Examples:
/srv/doxygen/reactos/win32ss/gdi/gdi32/objects/utils.c.

Definition at line 347 of file utils.c.

Referenced by CreateFontIndirectA(), EnumFontFamiliesExA(), and RealSystemParametersInfoA().

348 {
349 #define COPYS(f,len) MultiByteToWideChar ( CP_THREAD_ACP, 0, pA->f, len, pW->f, len )
350 #define COPYN(f) pW->f = pA->f
351 
352  COPYN(lfHeight);
353  COPYN(lfWidth);
354  COPYN(lfEscapement);
355  COPYN(lfOrientation);
356  COPYN(lfWeight);
357  COPYN(lfItalic);
358  COPYN(lfUnderline);
359  COPYN(lfStrikeOut);
360  COPYN(lfCharSet);
361  COPYN(lfOutPrecision);
362  COPYN(lfClipPrecision);
363  COPYN(lfQuality);
364  COPYN(lfPitchAndFamily);
365  COPYS(lfFaceName,LF_FACESIZE);
366  pW->lfFaceName[LF_FACESIZE - 1] = '\0';
367 
368 #undef COPYN
369 #undef COPYS
370 }
#define COPYN(f)
#define LF_FACESIZE
Definition: dimm.idl:39
#define COPYS(f, len)
WCHAR lfFaceName[LF_FACESIZE]
Definition: wingdi.h:1887

◆ LogFontW2A()

VOID NTAPI LogFontW2A ( LPLOGFONTA  pA,
CONST LOGFONTW pW 
)
Examples:
/srv/doxygen/reactos/win32ss/gdi/gdi32/objects/utils.c.

Definition at line 374 of file utils.c.

Referenced by EnumLogFontExW2A(), IntEnumFontFamilies(), and RealSystemParametersInfoA().

375 {
376 #define COPYS(f,len) WideCharToMultiByte ( CP_THREAD_ACP, 0, pW->f, len, pA->f, len, NULL, NULL )
377 #define COPYN(f) pA->f = pW->f
378 
379  COPYN(lfHeight);
380  COPYN(lfWidth);
381  COPYN(lfEscapement);
382  COPYN(lfOrientation);
383  COPYN(lfWeight);
384  COPYN(lfItalic);
385  COPYN(lfUnderline);
386  COPYN(lfStrikeOut);
387  COPYN(lfCharSet);
388  COPYN(lfOutPrecision);
389  COPYN(lfClipPrecision);
390  COPYN(lfQuality);
391  COPYN(lfPitchAndFamily);
392  COPYS(lfFaceName,LF_FACESIZE);
393  pA->lfFaceName[LF_FACESIZE - 1] = '\0';
394 
395 #undef COPYN
396 #undef COPYS
397 }
#define COPYN(f)
#define LF_FACESIZE
Definition: dimm.idl:39
CHAR lfFaceName[LF_FACESIZE]
Definition: wingdi.h:1871
#define COPYS(f, len)

◆ METADC16_Escape()

INT WINAPI METADC16_Escape ( _In_ HDC  hdc,
_In_ INT  nEscape,
_In_ INT  cbInput,
_In_ LPCSTR  lpvInData,
_Out_ LPVOID  lpvOutData 
)

Definition at line 1271 of file rosglue.c.

Referenced by _lrintf(), and Escape().

1277 {
1278  DWORD_PTR dwResult;
1279 
1280  /* Do not record MFCOMMENT */
1281  if (nEscape == MFCOMMENT)
1282  {
1283  // HACK required by wine code...
1284  //return 1;
1285  }
1286 
1288  &dwResult,
1289  SP_ERROR,
1290  hdc,
1291  nEscape,
1292  cbInput,
1293  lpvInData,
1294  lpvOutData);
1295 
1296  return (INT)dwResult;
1297 }
#define SP_ERROR
Definition: wingdi.h:316
#define MFCOMMENT
Definition: wingdi.h:996
int32_t INT
Definition: typedefs.h:56
HDC hdc
Definition: msvc.h:53
uint32_t DWORD_PTR
Definition: typedefs.h:63
BOOL METADC_Dispatch(_In_ DCFUNC eFunction, _Out_ PDWORD_PTR pdwResult, _In_ DWORD_PTR dwError, _In_ HDC hdc,...)
Definition: rosglue.c:1117

◆ METADC_DeleteDC()

BOOL WINAPI METADC_DeleteDC ( _In_ HDC  hdc)

Definition at line 1256 of file rosglue.c.

Referenced by _lrintf(), and DeleteDC().

1258 {
1259  /* Only ALTDCs are supported */
1261  {
1262  DPRINT1("Trying to delete METADC %p\n", hdc);
1263  return FALSE;
1264  }
1265  // FIXME call the driver?
1266  return NtGdiDeleteObjectApp(hdc);
1267 }
HDC hdc
Definition: msvc.h:53
#define GDI_HANDLE_GET_TYPE(h)
Definition: gdi.h:31
__kernel_entry W32KAPI BOOL APIENTRY NtGdiDeleteObjectApp(_In_ HANDLE hobj)
#define DPRINT1
Definition: precomp.h:8

◆ METADC_DeleteObject()

VOID WINAPI METADC_DeleteObject ( HGDIOBJ  hobj)

Definition at line 1215 of file rosglue.c.

Referenced by _lrintf(), and DeleteObject().

1216 {
1217  GDILOOBJTYPE eObjectType;
1218  HDC hdc;
1219  PHYSDEV physdev;
1220 
1221  /* Check for one of the types we actually handle here */
1222  eObjectType = GDI_HANDLE_GET_TYPE(hobj);
1223  if ((eObjectType != GDILoObjType_LO_BRUSH_TYPE) &&
1224  (eObjectType != GDILoObjType_LO_PEN_TYPE) &&
1225  (eObjectType != GDILoObjType_LO_EXTPEN_TYPE) &&
1226  (eObjectType != GDILoObjType_LO_PALETTE_TYPE) &&
1227  (eObjectType != GDILoObjType_LO_FONT_TYPE))
1228  {
1229  return;
1230  }
1231 
1232  /* Check if we have a client object link and remove it if it was found.
1233  The link is the HDC that the object was selected into. */
1234  hdc = GdiRemoveClientObjLink(hobj);
1235  if (hdc == NULL)
1236  {
1237  /* The link was not found, so we are not handling this object here */
1238  return;
1239  }
1240 
1241  /* Get the physdev */
1242  physdev = GetPhysDev(hdc);
1243  if (physdev == NULL)
1244  {
1245  /* This happens, when the METADC is already closed, when we delete
1246  the object. Simply ignore it */
1247  DPRINT1("METADC was already closed, cannot delete object. Ignoring.\n");
1248  return;
1249  }
1250 
1251  physdev->funcs->pDeleteObject(physdev, hobj);
1252 }
#define HDC
Definition: msvc.h:22
PVOID WINAPI GdiRemoveClientObjLink(_In_ HGDIOBJ hobj)
Definition: clientobj.c:98
HDC hdc
Definition: msvc.h:53
smooth NULL
Definition: ftsmooth.c:416
#define GDI_HANDLE_GET_TYPE(h)
Definition: gdi.h:31
#define DPRINT1
Definition: precomp.h:8
const struct gdi_dc_funcs * funcs
Definition: gdi_driver.h:31
enum GDILoObjType GDILOOBJTYPE
static PHYSDEV GetPhysDev(HDC hdc)
Definition: rosglue.c:600

◆ METADC_Dispatch()

BOOL METADC_Dispatch ( _In_ DCFUNC  eFunction,
_Out_ PDWORD_PTR  pdwResult,
_In_ DWORD_PTR  dwError,
_In_ HDC  hdc,
  ... 
)

Definition at line 1117 of file rosglue.c.

Referenced by METADC16_Escape().

1123 {
1124  PHYSDEV physdev;
1125  va_list argptr;
1126 
1127  /* Handle only METADC16 and ALTDC */
1130  {
1131  /* Let the caller handle it */
1132  return FALSE;
1133  }
1134 
1135  physdev = GetPhysDev(hdc);
1136  if (physdev == NULL)
1137  {
1139  *pdwResult = dwError;
1140  return TRUE;
1141  }
1142 
1143  i = eFunction;
1144  va_start(argptr, hdc);
1145  *pdwResult = DRIVER_Dispatch(physdev, eFunction, argptr);
1146  va_end(argptr);
1147  i = 0;
1148 
1149  /* Return TRUE to indicate that we want to return from the parent */
1151  (*pdwResult == dwError));
1152 }
#define TRUE
Definition: types.h:120
#define ERROR_INVALID_HANDLE
Definition: compat.h:88
#define va_end(ap)
Definition: acmsvcex.h:90
HDC hdc
Definition: msvc.h:53
smooth NULL
Definition: ftsmooth.c:416
char * va_list
Definition: acmsvcex.h:78
#define GDI_HANDLE_GET_TYPE(h)
Definition: gdi.h:31
#define SetLastError(x)
Definition: compat.h:409
static INT i
Definition: rosglue.c:22
_In_ UINT _In_ DWORD _Out_ DWORD * pdwResult
Definition: ntgdi.h:248
static DWORD_PTR DRIVER_Dispatch(_In_ PHYSDEV physdev, _In_ DCFUNC eFunction, _In_ va_list argptr)
Definition: rosglue.c:740
#define va_start(ap, A)
Definition: acmsvcex.h:91
static PHYSDEV GetPhysDev(HDC hdc)
Definition: rosglue.c:600

◆ METADC_ExtTextOutW()

BOOL WINAPI METADC_ExtTextOutW ( HDC  hdc,
INT  x,
INT  y,
UINT  fuOptions,
const RECT lprc,
LPCWSTR  lpString,
UINT  cchString,
const INT lpDx 
)

Referenced by _lrintf().

◆ METADC_GetAndSetDCDWord()

BOOL WINAPI METADC_GetAndSetDCDWord ( _Out_ PDWORD  pdwResult,
_In_ HDC  hdc,
_In_ UINT  u,
_In_ DWORD  dwIn,
_In_ ULONG  ulMFId,
_In_ USHORT  usMF16Id,
_In_ DWORD  dwError 
)

◆ METADC_PatBlt()

BOOL WINAPI METADC_PatBlt ( _In_ HDC  hdc,
_In_ INT  xLeft,
_In_ INT  yTop,
_In_ INT  nWidth,
_In_ INT  nHeight,
_In_ DWORD  dwRop 
)

Referenced by _lrintf().

◆ NewTextMetricExW2A()

VOID FASTCALL NewTextMetricExW2A ( NEWTEXTMETRICEXA tma,
NEWTEXTMETRICEXW tmw 
)

Definition at line 201 of file font.c.

Referenced by IntEnumFontFamilies().

202 {
203  NewTextMetricW2A(&tma->ntmTm, &tmw->ntmTm);
204  tma->ntmFontSig = tmw->ntmFontSig;
205 }
VOID FASTCALL NewTextMetricW2A(NEWTEXTMETRICA *tma, NEWTEXTMETRICW *tmw)
Definition: font.c:191
NEWTEXTMETRICA ntmTm
Definition: wingdi.h:2648
NEWTEXTMETRICW ntmTm
Definition: wingdi.h:2652
FONTSIGNATURE ntmFontSig
Definition: wingdi.h:2649
FONTSIGNATURE ntmFontSig
Definition: wingdi.h:2653

◆ NewTextMetricW2A()

VOID FASTCALL NewTextMetricW2A ( NEWTEXTMETRICA tma,
NEWTEXTMETRICW tmw 
)

Definition at line 191 of file font.c.

Referenced by NewTextMetricExW2A().

192 {
193  FONT_TextMetricWToA((TEXTMETRICW *) tmw, (TEXTMETRICA *) tma);
194  tma->ntmFlags = tmw->ntmFlags;
195  tma->ntmSizeEM = tmw->ntmSizeEM;
196  tma->ntmCellHeight = tmw->ntmCellHeight;
197  tma->ntmAvgWidth = tmw->ntmAvgWidth;
198 }
VOID FASTCALL FONT_TextMetricWToA(const TEXTMETRICW *ptmW, LPTEXTMETRICA ptmA)
Definition: font.c:79
UINT ntmCellHeight
Definition: wingdi.h:2617

◆ UserRealizePalette()

UINT WINAPI UserRealizePalette ( HDC  hDC)

Definition at line 2336 of file painting.c.

Referenced by NtUserCallOneParam(), and RealizePalette().

2337 {
2338  HWND hWnd, hWndDesktop;
2339  DWORD Ret;
2340 
2341  Ret = IntGdiRealizePalette(hdc);
2342  if (Ret) // There was a change.
2343  {
2344  hWnd = IntWindowFromDC(hdc);
2345  if (hWnd) // Send broadcast if dc is associated with a window.
2346  { // FYI: Thread locked in CallOneParam.
2347  hWndDesktop = IntGetDesktopWindow();
2348  if ( hWndDesktop != hWnd )
2349  {
2350  PWND pWnd = UserGetWindowObject(hWndDesktop);
2351  ERR("RealizePalette Desktop.");
2352  hdc = UserGetWindowDC(pWnd);
2354  UserReleaseDC(pWnd,hdc,FALSE);
2355  }
2357  }
2358  }
2359  return Ret;
2360 }
BOOL FASTCALL UserSendNotifyMessage(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
Definition: message.c:1884
HWND hWnd
Definition: settings.c:17
HDC FASTCALL UserGetWindowDC(PWND Wnd)
Definition: windc.c:946
UINT_PTR WPARAM
Definition: windef.h:207
HDC hdc
Definition: msvc.h:53
BOOL FASTCALL IntPaintDesktop(HDC hDC)
Definition: desktop.c:1772
HWND FASTCALL IntWindowFromDC(HDC hDc)
Definition: windc.c:893
PWND FASTCALL UserGetWindowObject(HWND hWnd)
Definition: window.c:103
#define WM_PALETTECHANGED
Definition: winuser.h:1838
unsigned long DWORD
Definition: ntddk_ex.h:95
#define ERR(fmt,...)
Definition: debug.h:109
Definition: ntuser.h:657
HWND FASTCALL IntGetDesktopWindow(VOID)
Definition: desktop.c:1321
INT FASTCALL UserReleaseDC(PWND Window, HDC hDc, BOOL EndPaint)
Definition: windc.c:917
UINT FASTCALL IntGdiRealizePalette(HDC)
Definition: palette.c:728
#define HWND_BROADCAST
Definition: winuser.h:1190

Variable Documentation

◆ CurrentProcessId

HANDLE CurrentProcessId

Definition at line 35 of file misc.c.

Referenced by GdiProcessSetup().

◆ fpClosePrinter

CLOSEPRINTER fpClosePrinter

Definition at line 43 of file printdrv.c.

Referenced by DeleteDC(), and LoadTheSpoolerDrv().

◆ fpOpenPrinterW

OPENPRINTERW fpOpenPrinterW

Definition at line 55 of file printdrv.c.

Referenced by LoadTheSpoolerDrv().

◆ gbLpk

BOOL gbLpk

Definition at line 11 of file dllmain.c.

Referenced by GdiInitializeLanguagePack(), and GetFontLanguageInfo().

◆ gcClientObj

ULONG gcClientObj

Definition at line 11 of file clientobj.c.

Referenced by _lrintf(), DeleteObject(), GdiCreateClientObjLink(), and GdiRemoveClientObjLink().

◆ GDI_BatchLimit

DWORD GDI_BatchLimit

◆ GdiDevCaps

PDEVCAPS GdiDevCaps

Definition at line 9 of file dllmain.c.

Referenced by GetDeviceCaps().

◆ GdiHandleTable

PGDI_TABLE_ENTRY GdiHandleTable

Definition at line 26 of file gdihv.c.

◆ GdiSharedHandleTable

PGDI_SHARED_HANDLE_TABLE GdiSharedHandleTable

Definition at line 34 of file misc.c.

Referenced by DdQueryDisplaySettingsUniqueness(), GdiProcessSetup(), and STRUCT().

◆ ghSpooler

HANDLE ghSpooler

Definition at line 40 of file printdrv.c.

Referenced by IntCreateDICW().

◆ hLpk

◆ hProcessHeap

HANDLE hProcessHeap

Definition at line 25 of file kbswitch.c.

◆ LpkExtTextOut

LPKETO LpkExtTextOut
Examples:
/srv/doxygen/reactos/win32ss/gdi/gdi32/objects/utils.c.

Definition at line 5 of file utils.c.

Referenced by ExtTextOutW(), and LoadLPK().

◆ LpkGetCharacterPlacement

LPKGCP LpkGetCharacterPlacement
Examples:
/srv/doxygen/reactos/win32ss/gdi/gdi32/objects/utils.c.

Definition at line 6 of file utils.c.

Referenced by GetCharacterPlacementW(), and LoadLPK().

◆ semLocal

Definition at line 12 of file dllmain.c.

Referenced by LoadTheSpoolerDrv().