ReactOS  0.4.13-dev-464-g6b95727
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 5478 of file freetype.c.

5482 {
5483  NTSTATUS Status;
5484  LOGFONTW LogFont;
5486  LONG GotCount, AvailCount, SafeInfoCount;
5487  ULONG DataSize;
5488 
5489  if (UnsafeLogFont == NULL || UnsafeInfo == NULL || UnsafeInfoCount == NULL)
5490  {
5492  return -1;
5493  }
5494 
5495  Status = MmCopyFromCaller(&SafeInfoCount, UnsafeInfoCount, sizeof(SafeInfoCount));
5496  if (!NT_SUCCESS(Status))
5497  {
5499  return -1;
5500  }
5501  GotCount = 0;
5502  Status = MmCopyToCaller(UnsafeInfoCount, &GotCount, sizeof(*UnsafeInfoCount));
5503  if (!NT_SUCCESS(Status))
5504  {
5506  return -1;
5507  }
5508  Status = MmCopyFromCaller(&LogFont, UnsafeLogFont, sizeof(LOGFONTW));
5509  if (!NT_SUCCESS(Status))
5510  {
5512  return -1;
5513  }
5514  if (SafeInfoCount <= 0)
5515  {
5517  return -1;
5518  }
5519 
5520  /* Allocate space for a safe copy */
5521  Status = RtlULongMult(SafeInfoCount, sizeof(FONTFAMILYINFO), &DataSize);
5522  if (!NT_SUCCESS(Status) || DataSize > LONG_MAX)
5523  {
5524  DPRINT1("Overflowed.\n");
5526  return -1;
5527  }
5529  if (Info == NULL)
5530  {
5532  return -1;
5533  }
5534 
5535  /* Retrieve the information */
5536  AvailCount = IntGetFontFamilyInfo(Dc, &LogFont, Info, SafeInfoCount);
5537  GotCount = min(AvailCount, SafeInfoCount);
5538  SafeInfoCount = AvailCount;
5539 
5540  /* Return data to caller */
5541  if (GotCount > 0)
5542  {
5543  Status = RtlULongMult(GotCount, sizeof(FONTFAMILYINFO), &DataSize);
5544  if (!NT_SUCCESS(Status) || DataSize > LONG_MAX)
5545  {
5546  DPRINT1("Overflowed.\n");
5549  return -1;
5550  }
5551  Status = MmCopyToCaller(UnsafeInfo, Info, DataSize);
5552  if (!NT_SUCCESS(Status))
5553  {
5556  return -1;
5557  }
5558  Status = MmCopyToCaller(UnsafeInfoCount, &SafeInfoCount, sizeof(*UnsafeInfoCount));
5559  if (!NT_SUCCESS(Status))
5560  {
5563  return -1;
5564  }
5565  }
5566 
5568 
5569  return GotCount;
5570 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
LONG FASTCALL IntGetFontFamilyInfo(HDC Dc, const LOGFONTW *SafeLogFont, PFONTFAMILYINFO SafeInfo, LONG InfoCount)
Definition: freetype.c:5439
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: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
#define WORLD_XFORM_CHANGED
Definition: ntgdihdl.h:199
_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
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:2777
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: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
#define WORLD_XFORM_CHANGED
Definition: ntgdihdl.h:199
_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:2777
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
Definition: error.c:27
POINTL ptlWindowOrg
Definition: ntgdihdl.h:338

◆ 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: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
#define WORLD_XFORM_CHANGED
Definition: ntgdihdl.h:199
_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:2777
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: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
#define WORLD_XFORM_CHANGED
Definition: ntgdihdl.h:199
_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:2777
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
Definition: error.c:27
#define X(b, s)
POINTL ptlWindowOrg
Definition: ntgdihdl.h:338