ReactOS  0.4.13-dev-92-gf251225
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 5454 of file freetype.c.

5458 {
5459  NTSTATUS Status;
5460  LOGFONTW LogFont;
5462  LONG GotCount, AvailCount, SafeInfoCount;
5463  ULONG DataSize;
5464 
5465  if (UnsafeLogFont == NULL || UnsafeInfo == NULL || UnsafeInfoCount == NULL)
5466  {
5468  return -1;
5469  }
5470 
5471  Status = MmCopyFromCaller(&SafeInfoCount, UnsafeInfoCount, sizeof(SafeInfoCount));
5472  if (!NT_SUCCESS(Status))
5473  {
5475  return -1;
5476  }
5477  GotCount = 0;
5478  Status = MmCopyToCaller(UnsafeInfoCount, &GotCount, sizeof(*UnsafeInfoCount));
5479  if (!NT_SUCCESS(Status))
5480  {
5482  return -1;
5483  }
5484  Status = MmCopyFromCaller(&LogFont, UnsafeLogFont, sizeof(LOGFONTW));
5485  if (!NT_SUCCESS(Status))
5486  {
5488  return -1;
5489  }
5490  if (SafeInfoCount <= 0)
5491  {
5493  return -1;
5494  }
5495 
5496  /* Allocate space for a safe copy */
5497  Status = RtlULongMult(SafeInfoCount, sizeof(FONTFAMILYINFO), &DataSize);
5498  if (!NT_SUCCESS(Status) || DataSize > LONG_MAX)
5499  {
5500  DPRINT1("Overflowed.\n");
5502  return -1;
5503  }
5505  if (Info == NULL)
5506  {
5508  return -1;
5509  }
5510 
5511  /* Retrieve the information */
5512  AvailCount = IntGetFontFamilyInfo(Dc, &LogFont, Info, SafeInfoCount);
5513  GotCount = min(AvailCount, SafeInfoCount);
5514  SafeInfoCount = AvailCount;
5515 
5516  /* Return data to caller */
5517  if (GotCount > 0)
5518  {
5519  Status = RtlULongMult(GotCount, sizeof(FONTFAMILYINFO), &DataSize);
5520  if (!NT_SUCCESS(Status) || DataSize > LONG_MAX)
5521  {
5522  DPRINT1("Overflowed.\n");
5525  return -1;
5526  }
5527  Status = MmCopyToCaller(UnsafeInfo, Info, DataSize);
5528  if (!NT_SUCCESS(Status))
5529  {
5532  return -1;
5533  }
5534  Status = MmCopyToCaller(UnsafeInfoCount, &SafeInfoCount, sizeof(*UnsafeInfoCount));
5535  if (!NT_SUCCESS(Status))
5536  {
5539  return -1;
5540  }
5541  }
5542 
5544 
5545  return GotCount;
5546 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
LONG FASTCALL IntGetFontFamilyInfo(HDC Dc, const LOGFONTW *SafeLogFont, PFONTFAMILYINFO SafeInfo, LONG InfoCount)
Definition: freetype.c:5415
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:4733
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 548 of file coord.c.

553 {
554  PDC dc;
555  PDC_ATTR pdcattr;
557 
558  dc = DC_LockDc(hDC);
559  if (!dc)
560  {
562  return FALSE;
563  }
564  pdcattr = dc->pdcattr;
565 
566  if (UnsafePoint)
567  {
568  _SEH2_TRY
569  {
570  ProbeForWrite(UnsafePoint, sizeof(POINT), 1);
571  UnsafePoint->x = pdcattr->ptlViewportOrg.x;
572  UnsafePoint->y = pdcattr->ptlViewportOrg.y;
573  if (pdcattr->dwLayout & LAYOUT_RTL)
574  {
575  UnsafePoint->x = -UnsafePoint->x;
576  }
577  }
579  {
581  }
582  _SEH2_END;
583 
584  if (!NT_SUCCESS(Status))
585  {
587  DC_UnlockDc(dc);
588  return FALSE;
589  }
590  }
591 
592  if (pdcattr->dwLayout & LAYOUT_RTL)
593  {
594  XOffset = -XOffset;
595  }
596  pdcattr->ptlViewportOrg.x += XOffset;
597  pdcattr->ptlViewportOrg.y += YOffset;
598  pdcattr->flXform |= PAGE_XLATE_CHANGED;
599 
600  DC_UnlockDc(dc);
601 
602  return TRUE;
603 }
POINTL ptlViewportOrg
Definition: ntgdihdl.h:340
#define TRUE
Definition: types.h:120
FORCEINLINE PDC DC_LockDc(HDC hdc)
Definition: dc.h:219
#define LAYOUT_RTL
Definition: wingdi.h:1353
#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:197
#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:342
VOID FASTCALL SetLastNtError(NTSTATUS Status)
Definition: error.c:36
Status
Definition: gdiplustypes.h:24
static HDC hDC
Definition: 3dtext.c:33
_SEH2_END
Definition: create.c:4424
FORCEINLINE VOID DC_UnlockDc(PDC pdc)
Definition: dc.h:237
DWORD dwLayout
Definition: ntgdihdl.h:336
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:6
#define _SEH2_GetExceptionCode()
Definition: pseh2_64.h:12
return STATUS_SUCCESS
Definition: btrfs.c:2725
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
Definition: error.c:27

Referenced by OffsetViewportOrgEx().

◆ NtGdiOffsetWindowOrgEx()

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

Definition at line 607 of file coord.c.

612 {
613  PDC dc;
614  PDC_ATTR pdcattr;
615 
616  dc = DC_LockDc(hDC);
617  if (!dc)
618  {
620  return FALSE;
621  }
622  pdcattr = dc->pdcattr;
623 
624  if (Point)
625  {
627 
628  _SEH2_TRY
629  {
630  ProbeForWrite(Point, sizeof(POINT), 1);
631  Point->x = pdcattr->ptlWindowOrg.x;
632  Point->y = pdcattr->ptlWindowOrg.y;
633  }
635  {
637  }
638  _SEH2_END;
639 
640  if (!NT_SUCCESS(Status))
641  {
643  DC_UnlockDc(dc);
644  return FALSE;
645  }
646  }
647 
648  pdcattr->ptlWindowOrg.x += XOffset;
649  pdcattr->ptlWindowOrg.y += YOffset;
651 
652  DC_UnlockDc(dc);
653 
654  return TRUE;
655 }
#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:197
#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:342
VOID FASTCALL SetLastNtError(NTSTATUS Status)
Definition: error.c:36
Status
Definition: gdiplustypes.h:24
static HDC hDC
Definition: 3dtext.c:33
_SEH2_END
Definition: create.c:4424
FORCEINLINE VOID DC_UnlockDc(PDC pdc)
Definition: dc.h:237
#define DEVICE_TO_WORLD_INVALID
Definition: ntgdihdl.h:188
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:6
#define _SEH2_GetExceptionCode()
Definition: pseh2_64.h:12
return STATUS_SUCCESS
Definition: btrfs.c:2725
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
Definition: error.c:27
POINTL ptlWindowOrg
Definition: ntgdihdl.h:338

Referenced by OffsetWindowOrgEx().

◆ NtGdiSetViewportOrgEx()

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

Definition at line 932 of file coord.c.

937 {
938  PDC dc;
939  PDC_ATTR pdcattr;
940 
941  dc = DC_LockDc(hDC);
942  if (!dc)
943  {
945  return FALSE;
946  }
947  pdcattr = dc->pdcattr;
948 
949  if (Point)
950  {
952 
953  _SEH2_TRY
954  {
955  ProbeForWrite(Point, sizeof(POINT), 1);
956  Point->x = pdcattr->ptlViewportOrg.x;
957  Point->y = pdcattr->ptlViewportOrg.y;
958  }
960  {
962  }
963  _SEH2_END;
964 
965  if (!NT_SUCCESS(Status))
966  {
968  DC_UnlockDc(dc);
969  return FALSE;
970  }
971  }
972 
973  pdcattr->ptlViewportOrg.x = X;
974  pdcattr->ptlViewportOrg.y = Y;
975  pdcattr->flXform |= PAGE_XLATE_CHANGED;
976 
977  DC_UnlockDc(dc);
978 
979  return TRUE;
980 }
POINTL ptlViewportOrg
Definition: ntgdihdl.h:340
#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:197
#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:342
VOID FASTCALL SetLastNtError(NTSTATUS Status)
Definition: error.c:36
Status
Definition: gdiplustypes.h:24
static HDC hDC
Definition: 3dtext.c:33
_SEH2_END
Definition: create.c:4424
FORCEINLINE VOID DC_UnlockDc(PDC pdc)
Definition: dc.h:237
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:6
#define _SEH2_GetExceptionCode()
Definition: pseh2_64.h:12
return STATUS_SUCCESS
Definition: btrfs.c:2725
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
Definition: error.c:27
#define X(b, s)

Referenced by SetViewportOrgEx().

◆ NtGdiSetWindowOrgEx()

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

Definition at line 984 of file coord.c.

989 {
990  PDC dc;
991  PDC_ATTR pdcattr;
992 
993  dc = DC_LockDc(hDC);
994  if (!dc)
995  {
997  return FALSE;
998  }
999  pdcattr = dc->pdcattr;
1000 
1001  if (Point)
1002  {
1004 
1005  _SEH2_TRY
1006  {
1007  ProbeForWrite(Point, sizeof(POINT), 1);
1008  Point->x = pdcattr->ptlWindowOrg.x;
1009  Point->y = pdcattr->ptlWindowOrg.y;
1010  }
1012  {
1014  }
1015  _SEH2_END;
1016 
1017  if (!NT_SUCCESS(Status))
1018  {
1020  DC_UnlockDc(dc);
1021  return FALSE;
1022  }
1023  }
1024 
1025  pdcattr->ptlWindowOrg.x = X;
1026  pdcattr->ptlWindowOrg.y = Y;
1027  pdcattr->flXform |= PAGE_XLATE_CHANGED;
1028 
1029  DC_UnlockDc(dc);
1030 
1031  return TRUE;
1032 }
#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:197
#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:342
VOID FASTCALL SetLastNtError(NTSTATUS Status)
Definition: error.c:36
Status
Definition: gdiplustypes.h:24
static HDC hDC
Definition: 3dtext.c:33
_SEH2_END
Definition: create.c:4424
FORCEINLINE VOID DC_UnlockDc(PDC pdc)
Definition: dc.h:237
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:6
#define _SEH2_GetExceptionCode()
Definition: pseh2_64.h:12
return STATUS_SUCCESS
Definition: btrfs.c:2725
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
Definition: error.c:27
#define X(b, s)
POINTL ptlWindowOrg
Definition: ntgdihdl.h:338

Referenced by SetWindowOrgEx().