ReactOS  0.4.14-dev-41-g31d7680
ntgdibad.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  tagFONTFAMILYINFO
 

Typedefs

typedef struct tagFONTFAMILYINFO FONTFAMILYINFO
 
typedef struct tagFONTFAMILYINFOPFONTFAMILYINFO
 

Functions

LONG NTAPI NtGdiGetFontFamilyInfo (HDC Dc, const LOGFONTW *LogFont, PFONTFAMILYINFO Info, LPLONG UnsafeInfoCount)
 
BOOL APIENTRY NtGdiGetViewportExtEx (HDC hDC, LPSIZE viewportExt)
 
BOOL APIENTRY NtGdiGetViewportOrgEx (HDC hDC, LPPOINT viewportOrg)
 
BOOL APIENTRY NtGdiGetWindowExtEx (HDC hDC, LPSIZE windowExt)
 
BOOL APIENTRY NtGdiGetWindowOrgEx (HDC hDC, LPPOINT windowOrg)
 
BOOL APIENTRY NtGdiOffsetViewportOrgEx (HDC hDC, int XOffset, int YOffset, LPPOINT Point)
 
BOOL APIENTRY NtGdiOffsetWindowOrgEx (HDC hDC, int XOffset, int YOffset, LPPOINT Point)
 
BOOL APIENTRY NtGdiSetViewportOrgEx (HDC hDC, int X, int Y, LPPOINT Point)
 
BOOL APIENTRY NtGdiSetWindowOrgEx (HDC hDC, int X, int Y, LPPOINT Point)
 

Typedef Documentation

◆ FONTFAMILYINFO

◆ PFONTFAMILYINFO

Function Documentation

◆ NtGdiGetFontFamilyInfo()

LONG NTAPI NtGdiGetFontFamilyInfo ( HDC  Dc,
const LOGFONTW LogFont,
PFONTFAMILYINFO  Info,
LPLONG  UnsafeInfoCount 
)

Definition at line 5918 of file freetype.c.

5922 {
5923  NTSTATUS Status;
5924  LOGFONTW LogFont;
5926  LONG GotCount, AvailCount, SafeInfoCount;
5927  ULONG DataSize;
5928 
5929  if (UnsafeLogFont == NULL || UnsafeInfo == NULL || UnsafeInfoCount == NULL)
5930  {
5932  return -1;
5933  }
5934 
5935  Status = MmCopyFromCaller(&SafeInfoCount, UnsafeInfoCount, sizeof(SafeInfoCount));
5936  if (!NT_SUCCESS(Status))
5937  {
5939  return -1;
5940  }
5941  GotCount = 0;
5942  Status = MmCopyToCaller(UnsafeInfoCount, &GotCount, sizeof(*UnsafeInfoCount));
5943  if (!NT_SUCCESS(Status))
5944  {
5946  return -1;
5947  }
5948  Status = MmCopyFromCaller(&LogFont, UnsafeLogFont, sizeof(LOGFONTW));
5949  if (!NT_SUCCESS(Status))
5950  {
5952  return -1;
5953  }
5954  if (SafeInfoCount <= 0)
5955  {
5957  return -1;
5958  }
5959 
5960  /* Allocate space for a safe copy */
5961  Status = RtlULongMult(SafeInfoCount, sizeof(FONTFAMILYINFO), &DataSize);
5962  if (!NT_SUCCESS(Status) || DataSize > LONG_MAX)
5963  {
5964  DPRINT1("Overflowed.\n");
5966  return -1;
5967  }
5969  if (Info == NULL)
5970  {
5972  return -1;
5973  }
5974 
5975  /* Retrieve the information */
5976  AvailCount = IntGetFontFamilyInfo(Dc, &LogFont, Info, SafeInfoCount);
5977  GotCount = min(AvailCount, SafeInfoCount);
5978  SafeInfoCount = AvailCount;
5979 
5980  /* Return data to caller */
5981  if (GotCount > 0)
5982  {
5983  Status = RtlULongMult(GotCount, sizeof(FONTFAMILYINFO), &DataSize);
5984  if (!NT_SUCCESS(Status) || DataSize > LONG_MAX)
5985  {
5986  DPRINT1("Overflowed.\n");
5989  return -1;
5990  }
5991  Status = MmCopyToCaller(UnsafeInfo, Info, DataSize);
5992  if (!NT_SUCCESS(Status))
5993  {
5996  return -1;
5997  }
5998  Status = MmCopyToCaller(UnsafeInfoCount, &SafeInfoCount, sizeof(*UnsafeInfoCount));
5999  if (!NT_SUCCESS(Status))
6000  {
6003  return -1;
6004  }
6005  }
6006 
6008 
6009  return GotCount;
6010 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
LONG FASTCALL IntGetFontFamilyInfo(HDC Dc, const LOGFONTW *SafeLogFont, PFONTFAMILYINFO SafeInfo, LONG InfoCount)
Definition: freetype.c:5879
LONG NTSTATUS
Definition: precomp.h:26
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
#define MmCopyFromCaller
Definition: polytest.cpp:29
#define MmCopyToCaller(x, y, z)
Definition: mmcopy.h:19
struct TraceInfo Info
long LONG
Definition: pedump.c:60
smooth NULL
Definition: ftsmooth.c:416
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define LONG_MAX
Definition: limits.h:43
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
Status
Definition: gdiplustypes.h:24
#define GDITAG_TEXT
Definition: tags.h:171
#define min(a, b)
Definition: monoChain.cc:55
#define DPRINT1
Definition: precomp.h:8
unsigned int ULONG
Definition: retypes.h:1
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1099
_In_ NDIS_STATUS _In_ ULONG _In_ USHORT _In_opt_ PVOID _In_ ULONG DataSize
Definition: ndis.h:4751
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
Definition: error.c:27

Referenced by IntEnumFontFamilies().

◆ NtGdiGetViewportExtEx()

BOOL APIENTRY NtGdiGetViewportExtEx ( HDC  hDC,
LPSIZE  viewportExt 
)

◆ NtGdiGetViewportOrgEx()

BOOL APIENTRY NtGdiGetViewportOrgEx ( HDC  hDC,
LPPOINT  viewportOrg 
)

◆ NtGdiGetWindowExtEx()

BOOL APIENTRY NtGdiGetWindowExtEx ( HDC  hDC,
LPSIZE  windowExt 
)

◆ NtGdiGetWindowOrgEx()

BOOL APIENTRY NtGdiGetWindowOrgEx ( HDC  hDC,
LPPOINT  windowOrg 
)

◆ NtGdiOffsetViewportOrgEx()

BOOL APIENTRY NtGdiOffsetViewportOrgEx ( HDC  hDC,
int  XOffset,
int  YOffset,
LPPOINT  Point 
)

Definition at line 553 of file coord.c.

558 {
559  PDC dc;
560  PDC_ATTR pdcattr;
562 
563  dc = DC_LockDc(hDC);
564  if (!dc)
565  {
567  return FALSE;
568  }
569  pdcattr = dc->pdcattr;
570 
571  if (UnsafePoint)
572  {
573  _SEH2_TRY
574  {
575  ProbeForWrite(UnsafePoint, sizeof(POINT), 1);
576  UnsafePoint->x = pdcattr->ptlViewportOrg.x;
577  UnsafePoint->y = pdcattr->ptlViewportOrg.y;
578  if (pdcattr->dwLayout & LAYOUT_RTL)
579  {
580  UnsafePoint->x = -UnsafePoint->x;
581  }
582  }
584  {
586  }
587  _SEH2_END;
588 
589  if (!NT_SUCCESS(Status))
590  {
592  DC_UnlockDc(dc);
593  return FALSE;
594  }
595  }
596 
597  if (pdcattr->dwLayout & LAYOUT_RTL)
598  {
599  XOffset = -XOffset;
600  }
601  pdcattr->ptlViewportOrg.x += XOffset;
602  pdcattr->ptlViewportOrg.y += YOffset;
604 
605  DC_UnlockDc(dc);
606 
607  return TRUE;
608 }
POINTL ptlViewportOrg
Definition: ntgdihdl.h:347
#define TRUE
Definition: types.h:120
FORCEINLINE PDC DC_LockDc(HDC hdc)
Definition: dc.h:219
#define LAYOUT_RTL
Definition: wingdi.h:1370
#define ERROR_INVALID_HANDLE
Definition: compat.h:88
LONG NTSTATUS
Definition: precomp.h:26
HDC dc
Definition: cylfrac.c:34
VOID NTAPI ProbeForWrite(IN PVOID Address, IN SIZE_T Length, IN ULONG Alignment)
Definition: exintrin.c:143
LONG y
Definition: windef.h:315
_SEH2_TRY
Definition: create.c:4250
#define PAGE_XLATE_CHANGED
Definition: ntgdihdl.h:201
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
Definition: polytest.cpp:40
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
LONG x
Definition: windef.h:314
FLONG flXform
Definition: ntgdihdl.h:349
VOID FASTCALL SetLastNtError(NTSTATUS Status)
Definition: error.c:36
Status
Definition: gdiplustypes.h:24
static HDC hDC
Definition: 3dtext.c:33
#define WORLD_XFORM_CHANGED
Definition: ntgdihdl.h:203
_SEH2_END
Definition: create.c:4424
FORCEINLINE VOID DC_UnlockDc(PDC pdc)
Definition: dc.h:237
#define DEVICE_TO_WORLD_INVALID
Definition: ntgdihdl.h:192
DWORD dwLayout
Definition: ntgdihdl.h:343
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:6
#define _SEH2_GetExceptionCode()
Definition: pseh2_64.h:12
return STATUS_SUCCESS
Definition: btrfs.c:2966
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
Definition: error.c:27

◆ NtGdiOffsetWindowOrgEx()

BOOL APIENTRY NtGdiOffsetWindowOrgEx ( HDC  hDC,
int  XOffset,
int  YOffset,
LPPOINT  Point 
)

Definition at line 612 of file coord.c.

617 {
618  PDC dc;
619  PDC_ATTR pdcattr;
620 
621  dc = DC_LockDc(hDC);
622  if (!dc)
623  {
625  return FALSE;
626  }
627  pdcattr = dc->pdcattr;
628 
629  if (Point)
630  {
632 
633  _SEH2_TRY
634  {
635  ProbeForWrite(Point, sizeof(POINT), 1);
636  Point->x = pdcattr->ptlWindowOrg.x;
637  Point->y = pdcattr->ptlWindowOrg.y;
638  }
640  {
642  }
643  _SEH2_END;
644 
645  if (!NT_SUCCESS(Status))
646  {
648  DC_UnlockDc(dc);
649  return FALSE;
650  }
651  }
652 
653  pdcattr->ptlWindowOrg.x += XOffset;
654  pdcattr->ptlWindowOrg.y += YOffset;
656 
657  DC_UnlockDc(dc);
658 
659  return TRUE;
660 }
#define TRUE
Definition: types.h:120
FORCEINLINE PDC DC_LockDc(HDC hdc)
Definition: dc.h:219
#define ERROR_INVALID_HANDLE
Definition: compat.h:88
LONG NTSTATUS
Definition: precomp.h:26
HDC dc
Definition: cylfrac.c:34
VOID NTAPI ProbeForWrite(IN PVOID Address, IN SIZE_T Length, IN ULONG Alignment)
Definition: exintrin.c:143
LONG y
Definition: windef.h:315
_SEH2_TRY
Definition: create.c:4250
#define PAGE_XLATE_CHANGED
Definition: ntgdihdl.h:201
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
Definition: polytest.cpp:40
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
LONG x
Definition: windef.h:314
FLONG flXform
Definition: ntgdihdl.h:349
VOID FASTCALL SetLastNtError(NTSTATUS Status)
Definition: error.c:36
Status
Definition: gdiplustypes.h:24
static HDC hDC
Definition: 3dtext.c:33
#define WORLD_XFORM_CHANGED
Definition: ntgdihdl.h:203
_SEH2_END
Definition: create.c:4424
FORCEINLINE VOID DC_UnlockDc(PDC pdc)
Definition: dc.h:237
#define DEVICE_TO_WORLD_INVALID
Definition: ntgdihdl.h:192
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:6
#define _SEH2_GetExceptionCode()
Definition: pseh2_64.h:12
return STATUS_SUCCESS
Definition: btrfs.c:2966
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
Definition: error.c:27
POINTL ptlWindowOrg
Definition: ntgdihdl.h:345

◆ NtGdiSetViewportOrgEx()

BOOL APIENTRY NtGdiSetViewportOrgEx ( HDC  hDC,
int  X,
int  Y,
LPPOINT  Point 
)

Definition at line 945 of file coord.c.

950 {
951  PDC dc;
952  PDC_ATTR pdcattr;
953 
954  dc = DC_LockDc(hDC);
955  if (!dc)
956  {
958  return FALSE;
959  }
960  pdcattr = dc->pdcattr;
961 
962  if (Point)
963  {
965 
966  _SEH2_TRY
967  {
968  ProbeForWrite(Point, sizeof(POINT), 1);
969  Point->x = pdcattr->ptlViewportOrg.x;
970  Point->y = pdcattr->ptlViewportOrg.y;
971  }
973  {
975  }
976  _SEH2_END;
977 
978  if (!NT_SUCCESS(Status))
979  {
981  DC_UnlockDc(dc);
982  return FALSE;
983  }
984  }
985 
986  pdcattr->ptlViewportOrg.x = X;
987  pdcattr->ptlViewportOrg.y = Y;
989 
990  DC_UnlockDc(dc);
991 
992  return TRUE;
993 }
POINTL ptlViewportOrg
Definition: ntgdihdl.h:347
#define TRUE
Definition: types.h:120
FORCEINLINE PDC DC_LockDc(HDC hdc)
Definition: dc.h:219
#define Y(I)
#define ERROR_INVALID_HANDLE
Definition: compat.h:88
LONG NTSTATUS
Definition: precomp.h:26
HDC dc
Definition: cylfrac.c:34
VOID NTAPI ProbeForWrite(IN PVOID Address, IN SIZE_T Length, IN ULONG Alignment)
Definition: exintrin.c:143
LONG y
Definition: windef.h:315
_SEH2_TRY
Definition: create.c:4250
#define PAGE_XLATE_CHANGED
Definition: ntgdihdl.h:201
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
Definition: polytest.cpp:40
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
LONG x
Definition: windef.h:314
FLONG flXform
Definition: ntgdihdl.h:349
VOID FASTCALL SetLastNtError(NTSTATUS Status)
Definition: error.c:36
Status
Definition: gdiplustypes.h:24
static HDC hDC
Definition: 3dtext.c:33
#define WORLD_XFORM_CHANGED
Definition: ntgdihdl.h:203
_SEH2_END
Definition: create.c:4424
FORCEINLINE VOID DC_UnlockDc(PDC pdc)
Definition: dc.h:237
#define DEVICE_TO_WORLD_INVALID
Definition: ntgdihdl.h:192
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:6
#define _SEH2_GetExceptionCode()
Definition: pseh2_64.h:12
return STATUS_SUCCESS
Definition: btrfs.c:2966
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
Definition: error.c:27
#define X(b, s)

◆ NtGdiSetWindowOrgEx()

BOOL APIENTRY NtGdiSetWindowOrgEx ( HDC  hDC,
int  X,
int  Y,
LPPOINT  Point 
)

Definition at line 997 of file coord.c.

1002 {
1003  PDC dc;
1004  PDC_ATTR pdcattr;
1005 
1006  dc = DC_LockDc(hDC);
1007  if (!dc)
1008  {
1010  return FALSE;
1011  }
1012  pdcattr = dc->pdcattr;
1013 
1014  if (Point)
1015  {
1017 
1018  _SEH2_TRY
1019  {
1020  ProbeForWrite(Point, sizeof(POINT), 1);
1021  Point->x = pdcattr->ptlWindowOrg.x;
1022  Point->y = pdcattr->ptlWindowOrg.y;
1023  }
1025  {
1027  }
1028  _SEH2_END;
1029 
1030  if (!NT_SUCCESS(Status))
1031  {
1033  DC_UnlockDc(dc);
1034  return FALSE;
1035  }
1036  }
1037 
1038  pdcattr->ptlWindowOrg.x = X;
1039  pdcattr->ptlWindowOrg.y = Y;
1041 
1042  DC_UnlockDc(dc);
1043 
1044  return TRUE;
1045 }
#define TRUE
Definition: types.h:120
FORCEINLINE PDC DC_LockDc(HDC hdc)
Definition: dc.h:219
#define Y(I)
#define ERROR_INVALID_HANDLE
Definition: compat.h:88
LONG NTSTATUS
Definition: precomp.h:26
HDC dc
Definition: cylfrac.c:34
VOID NTAPI ProbeForWrite(IN PVOID Address, IN SIZE_T Length, IN ULONG Alignment)
Definition: exintrin.c:143
LONG y
Definition: windef.h:315
_SEH2_TRY
Definition: create.c:4250
#define PAGE_XLATE_CHANGED
Definition: ntgdihdl.h:201
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
Definition: polytest.cpp:40
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
LONG x
Definition: windef.h:314
FLONG flXform
Definition: ntgdihdl.h:349
VOID FASTCALL SetLastNtError(NTSTATUS Status)
Definition: error.c:36
Status
Definition: gdiplustypes.h:24
static HDC hDC
Definition: 3dtext.c:33
#define WORLD_XFORM_CHANGED
Definition: ntgdihdl.h:203
_SEH2_END
Definition: create.c:4424
FORCEINLINE VOID DC_UnlockDc(PDC pdc)
Definition: dc.h:237
#define DEVICE_TO_WORLD_INVALID
Definition: ntgdihdl.h:192
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:6
#define _SEH2_GetExceptionCode()
Definition: pseh2_64.h:12
return STATUS_SUCCESS
Definition: btrfs.c:2966
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
Definition: error.c:27
#define X(b, s)
POINTL ptlWindowOrg
Definition: ntgdihdl.h:345