ReactOS  0.4.14-dev-49-gfb4591c
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 LPK_GTEP   4
 
#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 BOOL(WINAPILPKGTEP) (HDC hdc, LPCWSTR lpString, INT cString, INT nMaxExtent, LPINT lpnFit, LPINT lpnDx, LPSIZE lpSize, DWORD dwUnused, int unknown)
 
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)
 
HDC WINAPI GdiConvertAndCheckDC (HDC hdc)
 

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
 
LPKGTEP LpkGetTextExtentExPoint
 
CLOSEPRINTER fpClosePrinter
 
OPENPRINTERW fpOpenPrinterW
 
ULONG gcClientObj
 

Macro Definition Documentation

◆ FOtoF

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

Definition at line 492 of file gdi32p.h.

◆ HANDLE_LIST_INC

#define HANDLE_LIST_INC   20

Definition at line 74 of file gdi32p.h.

◆ 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:1119
#define GDI_HANDLE_GET_TYPE(h)
Definition: gdi.h:31
HDC hdc
Definition: main.c:9
uint32_t DWORD_PTR
Definition: typedefs.h:63

Definition at line 616 of file gdi32p.h.

◆ 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:1119
#define GDI_HANDLE_GET_TYPE(h)
Definition: gdi.h:31
HDC hdc
Definition: main.c:9
uint32_t DWORD_PTR
Definition: typedefs.h:63

Definition at line 606 of file gdi32p.h.

◆ HANDLE_METADC2

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

Definition at line 722 of file gdi32p.h.

◆ LOCALFONT_COUNT

#define LOCALFONT_COUNT   10

Definition at line 171 of file gdi32p.h.

◆ LPK_ETO

#define LPK_ETO   2

◆ LPK_GCP

#define LPK_GCP   3

◆ LPK_GTEP

#define LPK_GTEP   4

◆ LPK_INIT

#define LPK_INIT   1

◆ METAFILE_DISK

#define METAFILE_DISK   2

Definition at line 77 of file gdi32p.h.

◆ METAFILE_MEMORY

#define METAFILE_MEMORY   1

Definition at line 76 of file gdi32p.h.

◆ PDEV_UMPD_ID

#define PDEV_UMPD_ID   0xFEDCBA98

Definition at line 149 of file gdi32p.h.

◆ RCAST

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

Definition at line 89 of file gdi32p.h.

◆ ROP_USES_SOURCE

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

Definition at line 88 of file gdi32p.h.

◆ SAPCALLBACKDELAY

#define SAPCALLBACKDELAY   244

Definition at line 79 of file gdi32p.h.

◆ UMPDEV_NO_ESCAPE

#define UMPDEV_NO_ESCAPE   0x0002

Definition at line 151 of file gdi32p.h.

◆ UMPDEV_SUPPORT_ESCAPE

#define UMPDEV_SUPPORT_ESCAPE   0x0004

Definition at line 152 of file gdi32p.h.

Typedef Documentation

◆ ABORTPRINTER

typedef BOOL(WINAPI * ABORTPRINTER) (HANDLE)

Definition at line 178 of file gdi32p.h.

◆ CLOSEPRINTER

typedef BOOL(WINAPI * CLOSEPRINTER) (HANDLE)

Definition at line 179 of file gdi32p.h.

◆ CLOSESPOOLFILEHANDLE

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

Definition at line 180 of file gdi32p.h.

◆ COMMITSPOOLDATA

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

Definition at line 181 of file gdi32p.h.

◆ DCFUNC

typedef enum _DCFUNC DCFUNC

◆ DOCUMENTEVENT

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

Definition at line 202 of file gdi32p.h.

◆ DOCUMENTPROPERTIESW

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

Definition at line 182 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 183 of file gdi32p.h.

◆ ENDPAGEPRINTER

typedef BOOL(WINAPI * ENDPAGEPRINTER) (HANDLE)

Definition at line 184 of file gdi32p.h.

◆ ENHMETAFILE

◆ GETPRINTERDRIVERW

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

Definition at line 186 of file gdi32p.h.

◆ GETPRINTERW

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

Definition at line 185 of file gdi32p.h.

◆ GETSPOOLFILEHANDLE

typedef HANDLE(WINAPI * GETSPOOLFILEHANDLE) (HANDLE)

Definition at line 187 of file gdi32p.h.

◆ ISVALIDDEVMODEW

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

Definition at line 188 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)

◆ LPKGCP

typedef DWORD(WINAPI* LPKGCP) (HDC hdc, LPCWSTR lpString, INT uCount, INT nMaxExtent, LPGCP_RESULTSW lpResults, DWORD dwFlags, DWORD dwUnused)

◆ LPKGTEP

typedef BOOL(WINAPI* LPKGTEP) (HDC hdc, LPCWSTR lpString, INT cString, INT nMaxExtent, LPINT lpnFit, LPINT lpnDx, LPSIZE lpSize, DWORD dwUnused, int unknown)

◆ METAFILEDC

◆ MF_ENTRY

◆ OPENPRINTERW

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

Definition at line 189 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 204 of file gdi32p.h.

◆ QUERYREMOTEFONTS

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

Definition at line 207 of file gdi32p.h.

◆ QUERYSPOOLMODE

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

Definition at line 206 of file gdi32p.h.

◆ READPRINTER

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

Definition at line 190 of file gdi32p.h.

◆ RESETPRINTERW

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

Definition at line 191 of file gdi32p.h.

◆ SEEKPRINTER

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

Definition at line 196 of file gdi32p.h.

◆ SPLDRIVERUNLOADCOMPLETE

typedef BOOL(WINAPI * SPLDRIVERUNLOADCOMPLETE) (LPWSTR)

Definition at line 199 of file gdi32p.h.

◆ SPLREADPRINTER

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

Definition at line 197 of file gdi32p.h.

◆ STARTDOCDLGW

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

Definition at line 192 of file gdi32p.h.

◆ STARTDOCPRINTERW

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

Definition at line 193 of file gdi32p.h.

◆ STARTPAGEPRINTER

typedef BOOL(WINAPI * STARTPAGEPRINTER) (HANDLE)

Definition at line 194 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 627 of file gdi32p.h.

628 {
629  //DCFUNC_AbortDoc,
631  DCFUNC_AlphaBlend, // UNIMPLEMENTED
632  DCFUNC_AngleArc, // UNIMPLEMENTED
633  DCFUNC_Arc,
634  DCFUNC_ArcTo, // UNIMPLEMENTED
636  //DCFUNC_BitBlt,
637  DCFUNC_Chord,
652  DCFUNC_GradientFill, // UNIMPLEMENTED
656  DCFUNC_MaskBlt, // UNIMPLEMENTED
662  DCFUNC_PathToRegion, // UNIMPLEMENTED
664  DCFUNC_Pie,
665  DCFUNC_PlgBlt, // UNIMPLEMENTED
692  //DCFUNC_SetMapMode,
709  DCFUNC_TransparentBlt, // UNIMPLEMENTED
711 
712 } DCFUNC;
enum _DCFUNC DCFUNC

Function Documentation

◆ _lrintf()

FORCEINLINE int _lrintf ( float  f)

Definition at line 498 of file gdi32p.h.

499 {
500 #if defined(_M_IX86) && defined(__GNUC__)
501  int result;
502  __asm__ __volatile__ ("fistpl %0" : "=m" (result) : "t" (f) : "st");
503  return result;
504 #elif defined(_M_IX86) && defined(_MSC_VER)
505  int result;
506  __asm
507  {
508  fld f;
509  fistp result;
510  }
511 #else
512  /* slow, but portable */
513  return (int)(f >= 0 ? f+0.5 : f-0.5);
514 #endif
515 }
__asm__("\t.globl GetPhys\n" "GetPhys:\t\n" "mflr 0\n\t" "stwu 0,-16(1)\n\t" "mfmsr 5\n\t" "andi. 6,5,0xffef\n\t" "mtmsr 6\n\t" "isync\n\t" "sync\n\t" "lwz 3,0(3)\n\t" "mtmsr 5\n\t" "isync\n\t" "sync\n\t" "lwz 0,0(1)\n\t" "addi 1,1,16\n\t" "mtlr 0\n\t" "blr")
GLfloat f
Definition: glext.h:7540
#define f
Definition: ke_i.h:83
GLuint64EXT * result
Definition: glext.h:11304

Referenced by GdiTransformPoints2().

◆ CalculateColorTableSize()

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

Definition at line 32 of file utils.c.

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

Referenced by ConvertBitmapInfo().

◆ 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 178 of file utils.c.

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

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

◆ 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.

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

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

◆ EndPagePrinterEx()

BOOL FASTCALL EndPagePrinterEx ( PVOID  ,
HANDLE   
)

Definition at line 178 of file printdrv.c.

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

Referenced by IntEndPage().

◆ EnumLogFontExW2A()

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

Definition at line 402 of file utils.c.

403 {
404  LogFontW2A( (LPLOGFONTA)fontA, (CONST LOGFONTW *)fontW );
405 
406  WideCharToMultiByte( CP_THREAD_ACP, 0, fontW->elfFullName, -1,
407  (LPSTR) fontA->elfFullName, LF_FULLFACESIZE, NULL, NULL );
408  fontA->elfFullName[LF_FULLFACESIZE-1] = '\0';
409  WideCharToMultiByte( CP_THREAD_ACP, 0, fontW->elfStyle, -1,
410  (LPSTR) fontA->elfStyle, LF_FACESIZE, NULL, NULL );
411  fontA->elfStyle[LF_FACESIZE-1] = '\0';
412  WideCharToMultiByte( CP_THREAD_ACP, 0, fontW->elfScript, -1,
413  (LPSTR) fontA->elfScript, LF_FACESIZE, NULL, NULL );
414  fontA->elfScript[LF_FACESIZE-1] = '\0';
415 }
#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:375
smooth NULL
Definition: ftsmooth.c:416
static const WCHAR fontW[]
Definition: editor.c:78
#define CP_THREAD_ACP
Definition: winnls.h:230
#define CONST
Definition: pedump.c:81

Referenced by CreateFontIndirectExA(), and GetFontObjectA().

◆ FONT_TextMetricWToA()

VOID FASTCALL FONT_TextMetricWToA ( const TEXTMETRICW ptmW,
LPTEXTMETRICA  ptmA 
)

Definition at line 79 of file font.c.

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:2384
BYTE tmUnderlined
Definition: wingdi.h:2394
LONG tmExternalLeading
Definition: wingdi.h:2382
char CHAR
Definition: xmlstorage.h:175
#define SYMBOL_CHARSET
Definition: wingdi.h:384
LONG tmAveCharWidth
Definition: wingdi.h:2383
LONG tmDescent
Definition: wingdi.h:2380
LONG tmAscent
Definition: wingdi.h:2379
LONG tmInternalLeading
Definition: wingdi.h:2381
LONG tmAveCharWidth
Definition: wingdi.h:2361
BYTE tmLastChar
Definition: wingdi.h:2368
LONG tmWeight
Definition: wingdi.h:2363
LONG tmDigitizedAspectY
Definition: wingdi.h:2366
BYTE tmPitchAndFamily
Definition: wingdi.h:2374
BYTE tmUnderlined
Definition: wingdi.h:2372
BYTE tmCharSet
Definition: wingdi.h:2375
BYTE tmFirstChar
Definition: wingdi.h:2367
BYTE tmPitchAndFamily
Definition: wingdi.h:2396
WCHAR tmBreakChar
Definition: wingdi.h:2392
BYTE tmStruckOut
Definition: wingdi.h:2395
BYTE tmDefaultChar
Definition: wingdi.h:2369
LONG tmHeight
Definition: wingdi.h:2356
LONG tmInternalLeading
Definition: wingdi.h:2359
LONG tmOverhang
Definition: wingdi.h:2386
LONG tmExternalLeading
Definition: wingdi.h:2360
LONG tmDescent
Definition: wingdi.h:2358
BYTE tmCharSet
Definition: wingdi.h:2397
LONG tmDigitizedAspectY
Definition: wingdi.h:2388
LONG tmAscent
Definition: wingdi.h:2357
LONG tmMaxCharWidth
Definition: wingdi.h:2362
BYTE tmStruckOut
Definition: wingdi.h:2373
BYTE tmItalic
Definition: wingdi.h:2371
LONG tmOverhang
Definition: wingdi.h:2364
#define min(a, b)
Definition: monoChain.cc:55
WCHAR tmDefaultChar
Definition: wingdi.h:2391
LONG tmDigitizedAspectX
Definition: wingdi.h:2365
LONG tmWeight
Definition: wingdi.h:2385
BYTE tmBreakChar
Definition: wingdi.h:2370
LONG tmHeight
Definition: wingdi.h:2378
#define CHAR(Char)
BYTE tmItalic
Definition: wingdi.h:2393
WCHAR tmFirstChar
Definition: wingdi.h:2389
WCHAR tmLastChar
Definition: wingdi.h:2390
LONG tmDigitizedAspectX
Definition: wingdi.h:2387

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

◆ GdiAddFontResourceW()

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

Definition at line 2404 of file font.c.

2408 {
2409  INT Ret;
2410  WCHAR lpszBuffer[MAX_PATH];
2411  WCHAR lpszAbsPath[MAX_PATH];
2412  UNICODE_STRING NtAbsPath;
2413 
2414  /* FIXME: We don't support multiple files passed in lpszFilename
2415  * as L"abcxxxxx.pfm|abcxxxxx.pfb"
2416  */
2417 
2418  /* Does the file exist in CurrentDirectory or in the Absolute Path passed? */
2419  GetCurrentDirectoryW(MAX_PATH, lpszBuffer);
2420 
2421  if (!SearchPathW(lpszBuffer, lpszFilename, NULL, MAX_PATH, lpszAbsPath, NULL))
2422  {
2423  /* Nope. Then let's check Fonts folder */
2424  GetWindowsDirectoryW(lpszBuffer, MAX_PATH);
2425  StringCbCatW(lpszBuffer, sizeof(lpszBuffer), L"\\Fonts");
2426 
2427  if (!SearchPathW(lpszBuffer, lpszFilename, NULL, MAX_PATH, lpszAbsPath, NULL))
2428  {
2429  DPRINT1("Font not found. The Buffer is: %ls, the FileName is: %S\n", lpszBuffer, lpszFilename);
2430  return 0;
2431  }
2432  }
2433 
2434  /* We found the font file so: */
2435  if (!RtlDosPathNameToNtPathName_U(lpszAbsPath, &NtAbsPath, NULL, NULL))
2436  {
2437  DPRINT1("Can't convert Path! Path: %ls\n", lpszAbsPath);
2438  return 0;
2439  }
2440 
2441  /* The Nt call expects a null-terminator included in cwc param. */
2442  ASSERT(NtAbsPath.Buffer[NtAbsPath.Length / sizeof(WCHAR)] == UNICODE_NULL);
2443  Ret = NtGdiAddFontResourceW(NtAbsPath.Buffer, NtAbsPath.Length / sizeof(WCHAR) + 1, 1, fl, 0, pdv);
2444 
2445  RtlFreeUnicodeString(&NtAbsPath);
2446 
2447  return Ret;
2448 }
_In_ ULONG_PTR _In_opt_ DESIGNVECTOR * pdv
Definition: winddi.h:3723
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
#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
__wchar_t WCHAR
Definition: xmlstorage.h:180
#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:1250
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)

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

◆ GdiAllocBatchCommand()

FORCEINLINE PVOID GdiAllocBatchCommand ( HDC  hdc,
USHORT  Cmd 
)

Definition at line 381 of file gdi32p.h.

384 {
385  PTEB pTeb;
386  USHORT cjSize;
387  PGDIBATCHHDR pHdr;
388 
389  /* Get a pointer to the TEB */
390  pTeb = NtCurrentTeb();
391 
392  /* Check if we have a valid environment */
393  if (!pTeb || !pTeb->Win32ThreadInfo) return NULL;
394 
395  /* Get the size of the entry */
396  if (Cmd == GdiBCPatBlt) cjSize = sizeof(GDIBSPATBLT);
397  else if (Cmd == GdiBCPolyPatBlt) cjSize = sizeof(GDIBSPPATBLT);
398  else if (Cmd == GdiBCTextOut) cjSize = sizeof(GDIBSTEXTOUT);
399  else if (Cmd == GdiBCExtTextOut) cjSize = sizeof(GDIBSEXTTEXTOUT);
400  else if (Cmd == GdiBCSetBrushOrg) cjSize = sizeof(GDIBSSETBRHORG);
401  else if (Cmd == GdiBCExtSelClipRgn) cjSize = sizeof(GDIBSEXTSELCLPRGN);
402  else if (Cmd == GdiBCSelObj) cjSize = sizeof(GDIBSOBJECT);
403  else if (Cmd == GdiBCDelRgn) cjSize = sizeof(GDIBSOBJECT);
404  else if (Cmd == GdiBCDelObj) cjSize = sizeof(GDIBSOBJECT);
405  else cjSize = 0;
406 
407  /* Unsupported operation */
408  if (cjSize == 0) return NULL;
409 
410  /* Do we use a DC? */
411  if (hdc)
412  {
413  /* If the batch DC is NULL, we set this one as the new one */
414  if (!pTeb->GdiTebBatch.HDC) pTeb->GdiTebBatch.HDC = hdc;
415 
416  /* If not, check if the batch DC equal to our DC */
417  else if (pTeb->GdiTebBatch.HDC != hdc) return NULL;
418  }
419 
420  /* Check if the buffer is full */
421  if ((pTeb->GdiBatchCount >= GDI_BatchLimit) ||
423  {
424  /* Call win32k, the kernel will call NtGdiFlushUserBatch to flush
425  the current batch */
426  NtGdiFlush();
427 
428  // If Flushed, lose the hDC for this batch job! See CORE-15839.
429  if (hdc)
430  {
431  if (!pTeb->GdiTebBatch.HDC) pTeb->GdiTebBatch.HDC = hdc;
432  }
433  }
434 
435  /* Get the head of the entry */
436  pHdr = (PVOID)((PUCHAR)pTeb->GdiTebBatch.Buffer + pTeb->GdiTebBatch.Offset);
437 
438  /* Update Offset and batch count */
439  pTeb->GdiTebBatch.Offset += cjSize;
440  pTeb->GdiBatchCount++;
441 
442  /* Fill in the core fields */
443  pHdr->Cmd = Cmd;
444  pHdr->Size = cjSize;
445 
446  return pHdr;
447 }
struct _GDIBSSETBRHORG GDIBSSETBRHORG
DWORD GDI_BatchLimit
Definition: misc.c:36
SHORT Size
Definition: ntgdityp.h:457
PVOID Win32ThreadInfo
Definition: compat.h:495
unsigned char * PUCHAR
Definition: retypes.h:3
SHORT Cmd
Definition: ntgdityp.h:458
ULONG Buffer[GDI_BATCH_BUFFER_SIZE]
Definition: compat.h:482
struct _GDIBSPPATBLT GDIBSPPATBLT
struct _GDIBSOBJECT GDIBSOBJECT
#define GDIBATCHBUFSIZE
Definition: ntgdityp.h:199
smooth NULL
Definition: ftsmooth.c:416
void * PVOID
Definition: retypes.h:9
__kernel_entry W32KAPI NTSTATUS APIENTRY NtGdiFlush(VOID)
Definition: gdibatch.c:471
struct _GDIBSTEXTOUT GDIBSTEXTOUT
GDI_TEB_BATCH GdiTebBatch
Definition: compat.h:506
ULONG GdiBatchCount
Definition: compat.h:536
HDC hdc
Definition: main.c:9
Definition: sacdrv.h:277
struct _GDIBSEXTSELCLPRGN GDIBSEXTSELCLPRGN
Definition: compat.h:484
ULONG Offset
Definition: compat.h:480
struct _GDIBSPATBLT GDIBSPATBLT
struct _GDIBSEXTTEXTOUT GDIBSEXTTEXTOUT
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

Referenced by DeleteRegion(), ExtSelectClipRgn(), ExtTextOutW(), GdiDeleteBrushOrPen(), GdiSelectFont(), PatBlt(), PolyPatBlt(), and SetBrushOrgEx().

◆ GdiConvertAndCheckDC()

HDC WINAPI GdiConvertAndCheckDC ( HDC  hdc)

Definition at line 414 of file dc.c.

415 {
416  PLDC pldc;
417  ULONG hType = GDI_HANDLE_GET_TYPE(hdc);
419  return hdc;
420  pldc = GdiGetLDC(hdc);
421  if (pldc)
422  {
423  if (pldc->Flags & LDC_SAPCALLBACK) GdiSAPCallback(pldc);
424  if (pldc->Flags & LDC_KILL_DOCUMENT) return NULL;
425  if (pldc->Flags & LDC_STARTPAGE) StartPage(hdc);
426  return hdc;
427  }
429  return NULL;
430 }
#define ERROR_INVALID_HANDLE
Definition: compat.h:88
ULONG Flags
Definition: ntgdihdl.h:278
int WINAPI StartPage(_In_ HDC)
#define LDC_KILL_DOCUMENT
Definition: ntgdihdl.h:178
smooth NULL
Definition: ftsmooth.c:416
#define GDI_HANDLE_GET_TYPE(h)
Definition: gdi.h:31
#define LDC_STARTPAGE
Definition: ntgdihdl.h:175
VOID GdiSAPCallback(PLDC pldc)
Definition: misc.c:819
PLDC FASTCALL GdiGetLDC(HDC hDC)
Definition: misc.c:785
#define SetLastError(x)
Definition: compat.h:409
Definition: ntgdihdl.h:275
HDC hdc
Definition: main.c:9
#define LDC_SAPCALLBACK
Definition: ntgdihdl.h:172
unsigned int ULONG
Definition: retypes.h:1

Referenced by AngleArc(), Arc(), ArcTo(), BitBlt(), Chord(), Ellipse(), ExtFloodFill(), ExtTextOutW(), FillRgn(), FrameRgn(), GdiAlphaBlend(), GdiGradientFill(), GdiTransparentBlt(), InvertRgn(), LineTo(), MaskBlt(), PatBlt(), Pie(), PlgBlt(), PolyBezier(), PolyBezierTo(), PolyDraw(), Polygon(), Polyline(), PolylineTo(), PolyPolygon(), PolyPolyline(), Rectangle(), RoundRect(), SetPixel(), StretchBlt(), and StretchDIBits().

◆ GdiCreateClientObj()

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

Definition at line 148 of file clientobj.c.

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

Referenced by alloc_dc_ptr(), and alloc_gdi_handle().

◆ GdiCreateClientObjLink()

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

Definition at line 24 of file clientobj.c.

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)

Referenced by GDI_hdc_using_object(), and GdiCreateClientObj().

◆ GdiDeleteClientObj()

PVOID WINAPI GdiDeleteClientObj ( _In_ HGDIOBJ  hobj)

Definition at line 173 of file clientobj.c.

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)

Referenced by free_dc_ptr(), and free_gdi_handle().

◆ GdiFixUpHandle()

HGDIOBJ WINAPI GdiFixUpHandle ( HGDIOBJ  hGO)

Definition at line 734 of file misc.c.

735 {
737 
738  if (((ULONG_PTR)(hGdiObj)) & GDI_HANDLE_UPPER_MASK )
739  {
740  return hGdiObj;
741  }
742 
743  /* FIXME is this right ?? */
744 
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
void * HGDIOBJ
Definition: windef.h:252
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
base of all file and directory entries
Definition: entries.h:82

Referenced by GetObjectW(), and SelectObject().

◆ GdiGetBitmapBitsSize()

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

Definition at line 161 of file bitmap.c.

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:1471
#define BI_BITFIELDS
Definition: mmreg.h:507
DWORD biCompression
Definition: amvideo.idl:35
DWORD biSizeImage
Definition: amvideo.idl:36
struct tagBITMAPCOREHEADER * PBITMAPCOREHEADER
unsigned int UINT
Definition: ndis.h:50

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

◆ GdiGetClientObjLink()

PVOID WINAPI GdiGetClientObjLink ( _In_ HGDIOBJ  hobj)

Definition at line 61 of file clientobj.c.

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)

Referenced by GDI_GetObjPtr(), and get_dc_ptr().

◆ GdiGetCodePage()

DWORD WINAPI GdiGetCodePage ( HDC  )

◆ GdiGetDcAttr()

FORCEINLINE PDC_ATTR GdiGetDcAttr ( HDC  hdc)

Definition at line 451 of file gdi32p.h.

452 {
453  GDILOOBJTYPE eDcObjType;
454  PDC_ATTR pdcattr;
455 
456  /* Check DC object type */
457  eDcObjType = GDI_HANDLE_GET_TYPE(hdc);
458  if ((eDcObjType != GDILoObjType_LO_DC_TYPE) &&
459  (eDcObjType != GDILoObjType_LO_ALTDC_TYPE))
460  {
461  return NULL;
462  }
463 
464  /* Get the DC attribute */
465  if (!GdiGetHandleUserData((HGDIOBJ)hdc, eDcObjType, (PVOID*)&pdcattr))
466  {
467  return NULL;
468  }
469 
470  return pdcattr;
471 }
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
HDC hdc
Definition: main.c:9
enum GDILoObjType GDILOOBJTYPE

Referenced by DPtoLP(), Escape(), ExtSelectClipRgn(), ExtTextOutW(), 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(), PatBlt(), PolyPatBlt(), ScaleViewportExtEx(), ScaleWindowExtEx(), SetBkColor(), SetBkMode(), SetDCBrushColor(), SetDCPenColor(), SetGraphicsMode(), SetLayout(), SetLayoutWidth(), SetMapMode(), SetMapperFlags(), SetPolyFillMode(), SetROP2(), SetStretchBltMode(), SetTextAlign(), SetTextCharacterExtra(), SetTextColor(), SetTextJustification(), SetViewportExtEx(), SetViewportOrgEx(), SetWindowExtEx(), and SetWindowOrgEx().

◆ GdiGetHandleUserData()

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

Definition at line 761 of file misc.c.

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
#define TRUE
Definition: types.h:120
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG x1
Definition: winddi.h:3706
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
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

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

◆ GdiGetLDC()

PLDC FASTCALL GdiGetLDC ( HDC  hDC)

Definition at line 785 of file misc.c.

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:297
FORCEINLINE PDC_ATTR GdiGetDcAttr(HDC hdc)
Definition: gdi32p.h:451
smooth NULL
Definition: ftsmooth.c:416
HDC hdc
Definition: main.c:9

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

◆ GdiGetRgnAttr()

FORCEINLINE PRGN_ATTR GdiGetRgnAttr ( HRGN  hrgn)

Definition at line 475 of file gdi32p.h.

476 {
477  PRGN_ATTR prgnattr;
478 
479  /* Get the region attribute */
481  {
482  return NULL;
483  }
484 
485  return prgnattr;
486 }
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

Referenced by CombineRgn(), CreateRectRgn(), DeleteRegion(), ExtSelectClipRgn(), GetRgnBox(), OffsetRgn(), PtInRegion(), RectInRegion(), and SetRectRgn().

◆ 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.

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

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

◆ GdiSAPCallback()

VOID GdiSAPCallback ( PLDC  pldc)

Definition at line 819 of file misc.c.

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:283
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:277
unsigned long DWORD
Definition: ntddk_ex.h:95
#define SAPCALLBACKDELAY
Definition: gdi32p.h:79
ABORTPROC pAbortProc
Definition: ntgdihdl.h:282
static PLARGE_INTEGER Time
Definition: time.c:105

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

◆ GdiSelectBrush()

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

Definition at line 1386 of file dc.c.

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:299
FORCEINLINE PDC_ATTR GdiGetDcAttr(HDC hdc)
Definition: gdi32p.h:451
#define HANDLE_METADC(_RetType, _Func, dwError, hdc,...)
Definition: gdi32p.h:616
smooth NULL
Definition: ftsmooth.c:416
ULONG ulDirty_
Definition: ntgdihdl.h:298
#define SetLastError(x)
Definition: compat.h:409
HDC hdc
Definition: main.c:9
#define DC_BRUSH_DIRTY
Definition: ntgdihdl.h:157
#define SelectBrush(hdc, hbr)
Definition: windowsx.h:490

Referenced by SelectObject().

◆ GdiSelectFont()

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

Definition at line 1446 of file dc.c.

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:451
#define DC_DIBSECTION
Definition: ntgdihdl.h:159
#define HANDLE_METADC(_RetType, _Func, dwError, hdc,...)
Definition: gdi32p.h:616
HANDLE hlfntNew
Definition: ntgdihdl.h:334
smooth NULL
Definition: ftsmooth.c:416
static HFONT hfont
ULONG ulDirty_
Definition: ntgdihdl.h:298
__kernel_entry W32KAPI HFONT APIENTRY NtGdiSelectFont(_In_ HDC hdc, _In_ HFONT hf)
Definition: dcobjs.c:597
HGDIOBJ hgdiobj
Definition: ntgdityp.h:559
#define SetLastError(x)
Definition: compat.h:409
HDC hdc
Definition: main.c:9
#define SLOW_WIDTHS
Definition: ntgdihdl.h:150
#define SelectFont(hdc, hfont)
Definition: windowsx.h:491
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
FORCEINLINE PVOID GdiAllocBatchCommand(HDC hdc, USHORT Cmd)
Definition: gdi32p.h:381

Referenced by SelectObject().

◆ GdiSelectPen()

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

Definition at line 1416 of file dc.c.

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:300
FORCEINLINE PDC_ATTR GdiGetDcAttr(HDC hdc)
Definition: gdi32p.h:451
#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:616
#define SelectPen(hdc, hpen)
Definition: windowsx.h:492
smooth NULL
Definition: ftsmooth.c:416
ULONG ulDirty_
Definition: ntgdihdl.h:298
#define SetLastError(x)
Definition: compat.h:409
HDC hdc
Definition: main.c:9

Referenced by SelectObject().

◆ GdiSetLastError()

VOID WINAPI GdiSetLastError ( DWORD  dwErrCode)

Definition at line 873 of file misc.c.

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

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

◆ GdiSetLDC()

BOOL FASTCALL GdiSetLDC ( HDC  hdc,
PVOID  pvLDC 
)

Definition at line 802 of file misc.c.

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:297
FORCEINLINE PDC_ATTR GdiGetDcAttr(HDC hdc)
Definition: gdi32p.h:451
smooth NULL
Definition: ftsmooth.c:416
HDC hdc
Definition: main.c:9

Referenced by alloc_dc_ptr(), and free_dc_ptr().

◆ GdiValidateHandle()

BOOL WINAPI GdiValidateHandle ( HGDIOBJ  )

Definition at line 712 of file misc.c.

713 {
715  if ( (Entry->Type & GDI_ENTRY_BASETYPE_MASK) != 0 &&
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
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
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

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

◆ 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.

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 }
GLsizei GLenum const GLvoid GLsizei GLenum 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 const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
Definition: glfuncs.h:240
unsigned long DWORD
Definition: ntddk_ex.h:95
HDC hdc
Definition: main.c:9
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:722

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

◆ GetDCDWord()

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

Definition at line 763 of file dc.c.

767 {
768  DWORD dwResult;
769 
770  if (!NtGdiGetDCDword(hdc, u, &dwResult))
771  {
772  return dwError;
773  }
774 
775  return dwResult;
776 }
GLsizei GLenum const GLvoid GLsizei GLenum 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 const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
Definition: glfuncs.h:240
__kernel_entry W32KAPI BOOL APIENTRY NtGdiGetDCDword(_In_ HDC hdc, _In_ UINT u, _Out_ DWORD *Result)
unsigned long DWORD
Definition: ntddk_ex.h:95
HDC hdc
Definition: main.c:9

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

◆ 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.

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:588
GLenum GLsizei len
Definition: glext.h:6722

Referenced by HEAP_strdupA2W().

◆ HEAP_free()

VOID HEAP_free ( LPVOID  memory)

Definition at line 63 of file heap.c.

64 {
65  /* make sure hProcessHeap gets initialized by GdiProcessSetup before we get here */
67 
69 }
BOOLEAN NTAPI RtlFreeHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID HeapBase)
Definition: heap.c:606
#define assert(x)
Definition: debug.h:53
HANDLE hProcessHeap
Definition: heap.c:31
static char memory[1024 *256]
Definition: process.c:116

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

◆ HEAP_strdupA2W()

NTSTATUS HEAP_strdupA2W ( LPWSTR ppszW,
LPCSTR  lpszA 
)

Definition at line 43 of file heap.c.

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)
LONG NTSTATUS
Definition: precomp.h:26
PVOID HEAP_alloc(DWORD len)
Definition: heap.c:35
smooth NULL
Definition: ftsmooth.c:416
__wchar_t WCHAR
Definition: xmlstorage.h:180
static const WCHAR L[]
Definition: oid.c:1250
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:2966

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

◆ hGetPEBHandle()

HGDIOBJ FASTCALL hGetPEBHandle ( HANDLECACHETYPE  ,
COLORREF   
)

Definition at line 880 of file misc.c.

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 
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  {
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:338
Type
Definition: Type.h:6
#define CACHE_REGION_ENTRIES
Definition: ntgdityp.h:339
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:337
ULONG ulNumHandles[GDI_CACHED_HANDLE_TYPES]
Definition: ntgdityp.h:353
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:208
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:354
#define ATTR_CACHED
Definition: ntgdihdl.h:206

Referenced by CreatePen(), and CreateRectRgn().

◆ 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 423 of file utils.c.

424 {
425  if(!hLpk) // Check if the DLL is already loaded
426  hLpk = LoadLibraryW(L"lpk.dll");
427 
428  if (hLpk)
429  {
430  switch (LpkFunctionID)
431  {
432  case LPK_INIT:
433  return TRUE;
434 
435  case LPK_ETO:
436  if (!LpkExtTextOut) // Check if the function is already loaded
437  LpkExtTextOut = (LPKETO) GetProcAddress(hLpk, "LpkExtTextOut");
438 
439  if (!LpkExtTextOut)
440  {
441  FreeLibrary(hLpk);
442  return FALSE;
443  }
444 
445  return TRUE;
446 
447  case LPK_GCP:
448  if (!LpkGetCharacterPlacement) // Check if the function is already loaded
449  LpkGetCharacterPlacement = (LPKGCP) GetProcAddress(hLpk, "LpkGetCharacterPlacement");
450 
452  {
453  FreeLibrary(hLpk);
454  return FALSE;
455  }
456 
457  return TRUE;
458 
459  case LPK_GTEP:
460  if (!LpkGetTextExtentExPoint) // Check if the function is already loaded
461  LpkGetTextExtentExPoint = (LPKGTEP) GetProcAddress(hLpk, "LpkGetTextExtentExPoint");
462 
464  {
465  FreeLibrary(hLpk);
466  return FALSE;
467  }
468 
469  return TRUE;
470 
471  default:
472  FreeLibrary(hLpk);
473  return FALSE;
474  }
475  }
476 
477  else
478  return FALSE;
479 }
#define TRUE
Definition: types.h:120
LPKETO LpkExtTextOut
Definition: utils.c:5
LPKGTEP LpkGetTextExtentExPoint
Definition: utils.c:7
#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
BOOL(WINAPI * LPKGTEP)(HDC hdc, LPCWSTR lpString, INT cString, INT nMaxExtent, LPINT lpnFit, LPINT lpnDx, LPSIZE lpSize, DWORD dwUnused, int unknown)
Definition: gdi32p.h:55
#define LPK_GTEP
Definition: gdi32p.h:84
static const WCHAR L[]
Definition: oid.c:1250
#define LPK_ETO
Definition: gdi32p.h:82
#define LPK_INIT
Definition: gdi32p.h:81
#define LPK_GCP
Definition: gdi32p.h:83
#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

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

◆ LoadTheSpoolerDrv()

BOOL FASTCALL LoadTheSpoolerDrv ( VOID  )

Definition at line 188 of file printdrv.c.

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:1250
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

Referenced by IntCreateDICW().

◆ LogFontA2W()

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

Definition at line 348 of file utils.c.

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

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

◆ LogFontW2A()

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

Definition at line 375 of file utils.c.

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

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

◆ METADC16_Escape()

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

Definition at line 1284 of file rosglue.c.

1290 {
1291  DWORD_PTR dwResult;
1292 
1293  /* Do not record MFCOMMENT */
1294  if (nEscape == MFCOMMENT)
1295  {
1296  // HACK required by wine code...
1297  //return 1;
1298  }
1299 
1301  &dwResult,
1302  SP_ERROR,
1303  hdc,
1304  nEscape,
1305  cbInput,
1306  lpvInData,
1307  lpvOutData);
1308 
1309  return (INT)dwResult;
1310 }
#define SP_ERROR
Definition: wingdi.h:317
#define MFCOMMENT
Definition: wingdi.h:1007
int32_t INT
Definition: typedefs.h:56
HDC hdc
Definition: main.c:9
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:1119

Referenced by Escape().

◆ METADC_DeleteDC()

BOOL WINAPI METADC_DeleteDC ( _In_ HDC  hdc)

Definition at line 1269 of file rosglue.c.

1271 {
1272  /* Only ALTDCs are supported */
1274  {
1275  DPRINT1("Trying to delete METADC %p\n", hdc);
1276  return FALSE;
1277  }
1278  // FIXME call the driver?
1279  return NtGdiDeleteObjectApp(hdc);
1280 }
#define GDI_HANDLE_GET_TYPE(h)
Definition: gdi.h:31
HDC hdc
Definition: main.c:9
__kernel_entry W32KAPI BOOL APIENTRY NtGdiDeleteObjectApp(_In_ HANDLE hobj)
#define DPRINT1
Definition: precomp.h:8

Referenced by DeleteDC().

◆ METADC_DeleteObject()

VOID WINAPI METADC_DeleteObject ( HGDIOBJ  hobj)

Definition at line 1228 of file rosglue.c.

1229 {
1230  GDILOOBJTYPE eObjectType;
1231  HDC hdc;
1232  PHYSDEV physdev;
1233 
1234  /* Check for one of the types we actually handle here */
1235  eObjectType = GDI_HANDLE_GET_TYPE(hobj);
1236  if ((eObjectType != GDILoObjType_LO_BRUSH_TYPE) &&
1237  (eObjectType != GDILoObjType_LO_PEN_TYPE) &&
1238  (eObjectType != GDILoObjType_LO_EXTPEN_TYPE) &&
1239  (eObjectType != GDILoObjType_LO_PALETTE_TYPE) &&
1240  (eObjectType != GDILoObjType_LO_FONT_TYPE))
1241  {
1242  return;
1243  }
1244 
1245  /* Check if we have a client object link and remove it if it was found.
1246  The link is the HDC that the object was selected into. */
1247  hdc = GdiRemoveClientObjLink(hobj);
1248  if (hdc == NULL)
1249  {
1250  /* The link was not found, so we are not handling this object here */
1251  return;
1252  }
1253 
1254  /* Get the physdev */
1255  physdev = GetPhysDev(hdc);
1256  if (physdev == NULL)
1257  {
1258  /* This happens, when the METADC is already closed, when we delete
1259  the object. Simply ignore it */
1260  DPRINT1("METADC was already closed, cannot delete object. Ignoring.\n");
1261  return;
1262  }
1263 
1264  physdev->funcs->pDeleteObject(physdev, hobj);
1265 }
PVOID WINAPI GdiRemoveClientObjLink(_In_ HGDIOBJ hobj)
Definition: clientobj.c:98
static HDC
Definition: imagelist.c:92
smooth NULL
Definition: ftsmooth.c:416
#define GDI_HANDLE_GET_TYPE(h)
Definition: gdi.h:31
HDC hdc
Definition: main.c:9
#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:602

Referenced by DeleteObject().

◆ METADC_Dispatch()

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

Definition at line 1119 of file rosglue.c.

1125 {
1126  PHYSDEV physdev;
1127  va_list argptr;
1128 
1129  /* Handle only METADC16 and ALTDC */
1132  {
1133  /* Let the caller handle it */
1134  return FALSE;
1135  }
1136 
1137  // See if this is other than a METADATA issue.
1139  {
1140  WINEDC* pwdc = (WINEDC*)GdiGetLDC(hdc);
1141  if (pwdc && pwdc->iType != LDC_EMFLDC)
1142  {
1143  /* Let the caller handle it */
1144  return FALSE;
1145  }
1146  }
1147 
1148  physdev = GetPhysDev(hdc);
1149  if (physdev == NULL)
1150  {
1152  *pdwResult = dwError;
1153  return TRUE;
1154  }
1155 
1156  i = eFunction;
1157  va_start(argptr, hdc);
1158  *pdwResult = DRIVER_Dispatch(physdev, eFunction, argptr);
1159  va_end(argptr);
1160  i = 0;
1161 
1162  /* Return TRUE to indicate that we want to return from the parent */
1164  (*pdwResult == dwError));
1165 }
#define TRUE
Definition: types.h:120
#define ERROR_INVALID_HANDLE
Definition: compat.h:88
#define va_end(ap)
Definition: acmsvcex.h:90
smooth NULL
Definition: ftsmooth.c:416
char * va_list
Definition: acmsvcex.h:78
#define GDI_HANDLE_GET_TYPE(h)
Definition: gdi.h:31
PLDC FASTCALL GdiGetLDC(HDC hDC)
Definition: misc.c:785
#define SetLastError(x)
Definition: compat.h:409
HDC hdc
Definition: main.c:9
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:742
#define va_start(ap, A)
Definition: acmsvcex.h:91
static PHYSDEV GetPhysDev(HDC hdc)
Definition: rosglue.c:602
#define LDC_EMFLDC
Definition: gdi_private.h:57

Referenced by METADC16_Escape().

◆ METADC_ExtTextOutW()

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

◆ 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 
)

◆ NewTextMetricExW2A()

VOID FASTCALL NewTextMetricExW2A ( NEWTEXTMETRICEXA tma,
NEWTEXTMETRICEXW tmw 
)

Definition at line 201 of file font.c.

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:2666
NEWTEXTMETRICW ntmTm
Definition: wingdi.h:2670
FONTSIGNATURE ntmFontSig
Definition: wingdi.h:2667
FONTSIGNATURE ntmFontSig
Definition: wingdi.h:2671

Referenced by IntEnumFontFamilies().

◆ NewTextMetricW2A()

VOID FASTCALL NewTextMetricW2A ( NEWTEXTMETRICA tma,
NEWTEXTMETRICW tmw 
)

Definition at line 191 of file font.c.

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:2635

Referenced by NewTextMetricExW2A().

◆ UserRealizePalette()

UINT WINAPI UserRealizePalette ( HDC  hDC)

Definition at line 2336 of file painting.c.

2337 {
2338  HWND hWnd, hWndDesktop;
2339  DWORD Ret;
2340 
2341  Ret = IntGdiRealizePalette(hdc);
2342  if (Ret) // There was a change.
2343  {
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:1874
HWND hWnd
Definition: settings.c:17
HDC FASTCALL UserGetWindowDC(PWND Wnd)
Definition: windc.c:946
UINT_PTR WPARAM
Definition: windef.h:207
BOOL FASTCALL IntPaintDesktop(HDC hDC)
Definition: desktop.c:1791
HWND FASTCALL IntWindowFromDC(HDC hDc)
Definition: windc.c:893
PWND FASTCALL UserGetWindowObject(HWND hWnd)
Definition: window.c:103
#define WM_PALETTECHANGED
Definition: winuser.h:1859
unsigned long DWORD
Definition: ntddk_ex.h:95
HDC hdc
Definition: main.c:9
#define ERR(fmt,...)
Definition: debug.h:109
Definition: ntuser.h:657
HWND FASTCALL IntGetDesktopWindow(VOID)
Definition: desktop.c:1338
INT FASTCALL UserReleaseDC(PWND Window, HDC hDc, BOOL EndPaint)
Definition: windc.c:917
UINT FASTCALL IntGdiRealizePalette(HDC)
Definition: palette.c:731
#define HWND_BROADCAST
Definition: winuser.h:1190

Referenced by NtUserCallOneParam(), and RealizePalette().

Variable Documentation

◆ CurrentProcessId

HANDLE CurrentProcessId

Definition at line 35 of file misc.c.

Referenced by GdiGetHandleUserData(), GdiProcessSetup(), and GdiValidateHandle().

◆ 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 DeleteObject(), GdiCreateClientObjLink(), and GdiRemoveClientObjLink().

◆ GDI_BatchLimit

DWORD GDI_BatchLimit

Definition at line 36 of file misc.c.

Referenced by GdiAllocBatchCommand(), GdiGetBatchLimit(), GdiProcessSetup(), and GdiSetBatchLimit().

◆ GdiDevCaps

PDEVCAPS GdiDevCaps

Definition at line 9 of file dllmain.c.

Referenced by GdiProcessSetup(), and 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(), and LoadTheSpoolerDrv().

◆ 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

◆ LpkGetTextExtentExPoint

LPKGTEP LpkGetTextExtentExPoint
Examples
/srv/doxygen/reactos/win32ss/gdi/gdi32/objects/utils.c.

Definition at line 7 of file utils.c.

Referenced by GetTextExtentExPointW(), and LoadLPK().

◆ semLocal

Definition at line 12 of file dllmain.c.

Referenced by GdiProcessSetup(), GdiProcessShutdown(), and LoadTheSpoolerDrv().