ReactOS  0.4.14-dev-606-g14ebc0b
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 5840 of file freetype.c.

5844 {
5845  NTSTATUS Status;
5846  LOGFONTW LogFont;
5848  LONG GotCount, AvailCount, SafeInfoCount;
5849  ULONG DataSize;
5850 
5851  if (UnsafeLogFont == NULL || UnsafeInfo == NULL || UnsafeInfoCount == NULL)
5852  {
5854  return -1;
5855  }
5856 
5857  Status = MmCopyFromCaller(&SafeInfoCount, UnsafeInfoCount, sizeof(SafeInfoCount));
5858  if (!NT_SUCCESS(Status))
5859  {
5861  return -1;
5862  }
5863  GotCount = 0;
5864  Status = MmCopyToCaller(UnsafeInfoCount, &GotCount, sizeof(*UnsafeInfoCount));
5865  if (!NT_SUCCESS(Status))
5866  {
5868  return -1;
5869  }
5870  Status = MmCopyFromCaller(&LogFont, UnsafeLogFont, sizeof(LOGFONTW));
5871  if (!NT_SUCCESS(Status))
5872  {
5874  return -1;
5875  }
5876  if (SafeInfoCount <= 0)
5877  {
5879  return -1;
5880  }
5881 
5882  /* Allocate space for a safe copy */
5883  Status = RtlULongMult(SafeInfoCount, sizeof(FONTFAMILYINFO), &DataSize);
5884  if (!NT_SUCCESS(Status) || DataSize > LONG_MAX)
5885  {
5886  DPRINT1("Overflowed.\n");
5888  return -1;
5889  }
5891  if (Info == NULL)
5892  {
5894  return -1;
5895  }
5896 
5897  /* Retrieve the information */
5898  AvailCount = IntGetFontFamilyInfo(Dc, &LogFont, Info, SafeInfoCount);
5899  GotCount = min(AvailCount, SafeInfoCount);
5900  SafeInfoCount = AvailCount;
5901 
5902  /* Return data to caller */
5903  if (GotCount > 0)
5904  {
5905  Status = RtlULongMult(GotCount, sizeof(FONTFAMILYINFO), &DataSize);
5906  if (!NT_SUCCESS(Status) || DataSize > LONG_MAX)
5907  {
5908  DPRINT1("Overflowed.\n");
5911  return -1;
5912  }
5913  Status = MmCopyToCaller(UnsafeInfo, Info, DataSize);
5914  if (!NT_SUCCESS(Status))
5915  {
5918  return -1;
5919  }
5920  Status = MmCopyToCaller(UnsafeInfoCount, &SafeInfoCount, sizeof(*UnsafeInfoCount));
5921  if (!NT_SUCCESS(Status))
5922  {
5925  return -1;
5926  }
5927  }
5928 
5930 
5931  return GotCount;
5932 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
LONG FASTCALL IntGetFontFamilyInfo(HDC Dc, const LOGFONTW *SafeLogFont, PFONTFAMILYINFO SafeInfo, LONG InfoCount)
Definition: freetype.c:5801
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
VOID NTAPI ProbeForWrite(IN PVOID Address, IN SIZE_T Length, IN ULONG Alignment)
Definition: exintrin.c:143
LONG y
Definition: windef.h:330
_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:329
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
static const WCHAR dc[]
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:6
#define _SEH2_GetExceptionCode()
Definition: pseh2_64.h:12
return STATUS_SUCCESS
Definition: btrfs.c:2938
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
VOID NTAPI ProbeForWrite(IN PVOID Address, IN SIZE_T Length, IN ULONG Alignment)
Definition: exintrin.c:143
LONG y
Definition: windef.h:330
_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:329
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
static const WCHAR dc[]
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:6
#define _SEH2_GetExceptionCode()
Definition: pseh2_64.h:12
return STATUS_SUCCESS
Definition: btrfs.c:2938
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
VOID NTAPI ProbeForWrite(IN PVOID Address, IN SIZE_T Length, IN ULONG Alignment)
Definition: exintrin.c:143
LONG y
Definition: windef.h:330
_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:329
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
static const WCHAR dc[]
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:6
#define _SEH2_GetExceptionCode()
Definition: pseh2_64.h:12
return STATUS_SUCCESS
Definition: btrfs.c:2938
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
VOID NTAPI ProbeForWrite(IN PVOID Address, IN SIZE_T Length, IN ULONG Alignment)
Definition: exintrin.c:143
LONG y
Definition: windef.h:330
_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:329
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
static const WCHAR dc[]
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:6
#define _SEH2_GetExceptionCode()
Definition: pseh2_64.h:12
return STATUS_SUCCESS
Definition: btrfs.c:2938
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
Definition: error.c:27
#define X(b, s)
POINTL ptlWindowOrg
Definition: ntgdihdl.h:345