ReactOS 0.4.16-dev-734-g364d6e0
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 6484 of file freetype.c.

6488{
6490 LOGFONTW LogFont;
6492 LONG GotCount, AvailCount, SafeInfoCount;
6494
6495 if (UnsafeLogFont == NULL || UnsafeInfo == NULL || UnsafeInfoCount == NULL)
6496 {
6498 return -1;
6499 }
6500
6501 Status = MmCopyFromCaller(&SafeInfoCount, UnsafeInfoCount, sizeof(SafeInfoCount));
6502 if (!NT_SUCCESS(Status))
6503 {
6505 return -1;
6506 }
6507 GotCount = 0;
6508 Status = MmCopyToCaller(UnsafeInfoCount, &GotCount, sizeof(*UnsafeInfoCount));
6509 if (!NT_SUCCESS(Status))
6510 {
6512 return -1;
6513 }
6514 Status = MmCopyFromCaller(&LogFont, UnsafeLogFont, sizeof(LOGFONTW));
6515 if (!NT_SUCCESS(Status))
6516 {
6518 return -1;
6519 }
6520 if (SafeInfoCount <= 0)
6521 {
6523 return -1;
6524 }
6525
6526 /* Allocate space for a safe copy */
6527 Status = RtlULongMult(SafeInfoCount, sizeof(FONTFAMILYINFO), &DataSize);
6529 {
6530 DPRINT1("Overflowed.\n");
6532 return -1;
6533 }
6535 if (Info == NULL)
6536 {
6538 return -1;
6539 }
6540
6541 /* Retrieve the information */
6542 AvailCount = IntGetFontFamilyInfo(Dc, &LogFont, Info, SafeInfoCount);
6543 GotCount = min(AvailCount, SafeInfoCount);
6544 SafeInfoCount = AvailCount;
6545
6546 /* Return data to caller */
6547 if (GotCount > 0)
6548 {
6549 Status = RtlULongMult(GotCount, sizeof(FONTFAMILYINFO), &DataSize);
6551 {
6552 DPRINT1("Overflowed.\n");
6555 return -1;
6556 }
6557 Status = MmCopyToCaller(UnsafeInfo, Info, DataSize);
6558 if (!NT_SUCCESS(Status))
6559 {
6562 return -1;
6563 }
6564 Status = MmCopyToCaller(UnsafeInfoCount, &SafeInfoCount, sizeof(*UnsafeInfoCount));
6565 if (!NT_SUCCESS(Status))
6566 {
6569 return -1;
6570 }
6571 }
6572
6574
6575 return GotCount;
6576}
LONG NTSTATUS
Definition: precomp.h:26
#define DPRINT1
Definition: precomp.h:8
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
#define NULL
Definition: types.h:112
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
#define PagedPool
Definition: env_spec_w32.h:308
LONG FASTCALL IntGetFontFamilyInfo(HDC Dc, const LOGFONTW *SafeLogFont, PFONTFAMILYINFO SafeInfo, LONG InfoCount)
Definition: freetype.c:6444
Status
Definition: gdiplustypes.h:25
#define LONG_MAX
Definition: intsafe.h:154
#define MmCopyToCaller(x, y, z)
Definition: mmcopy.h:19
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1109
#define min(a, b)
Definition: monoChain.cc:55
_In_ NDIS_STATUS _In_ ULONG _In_ USHORT _In_opt_ PVOID _In_ ULONG DataSize
Definition: ndis.h:4755
long LONG
Definition: pedump.c:60
#define MmCopyFromCaller
Definition: polytest.cpp:29
uint32_t ULONG
Definition: typedefs.h:59
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
Definition: wdfchildlist.h:690
#define GDITAG_TEXT
Definition: tags.h:172
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
Definition: error.c:22

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 556 of file coord.c.

561{
562 PDC dc;
563 PDC_ATTR pdcattr;
565
566 dc = DC_LockDc(hDC);
567 if (!dc)
568 {
570 return FALSE;
571 }
572 pdcattr = dc->pdcattr;
573
574 if (UnsafePoint)
575 {
577 {
578 ProbeForWrite(UnsafePoint, sizeof(POINT), 1);
579 UnsafePoint->x = pdcattr->ptlViewportOrg.x;
580 UnsafePoint->y = pdcattr->ptlViewportOrg.y;
581 if (pdcattr->dwLayout & LAYOUT_RTL)
582 {
583 UnsafePoint->x = -UnsafePoint->x;
584 }
585 }
587 {
589 }
590 _SEH2_END;
591
592 if (!NT_SUCCESS(Status))
593 {
596 return FALSE;
597 }
598 }
599
600 if (pdcattr->dwLayout & LAYOUT_RTL)
601 {
602 XOffset = -XOffset;
603 }
604 pdcattr->ptlViewportOrg.x += XOffset;
605 pdcattr->ptlViewportOrg.y += YOffset;
607
609
610 return TRUE;
611}
static HDC hDC
Definition: 3dtext.c:33
HDC dc
Definition: cylfrac.c:34
FORCEINLINE VOID DC_UnlockDc(PDC pdc)
Definition: dc.h:238
FORCEINLINE PDC DC_LockDc(HDC hdc)
Definition: dc.h:220
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define ERROR_INVALID_HANDLE
Definition: compat.h:98
VOID NTAPI ProbeForWrite(IN PVOID Address, IN SIZE_T Length, IN ULONG Alignment)
Definition: exintrin.c:143
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:90
#define WORLD_XFORM_CHANGED
Definition: ntgdihdl.h:188
#define DEVICE_TO_WORLD_INVALID
Definition: ntgdihdl.h:177
#define PAGE_XLATE_CHANGED
Definition: ntgdihdl.h:186
#define _SEH2_GetExceptionCode()
Definition: pseh2_64.h:165
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:66
#define _SEH2_END
Definition: pseh2_64.h:155
#define _SEH2_TRY
Definition: pseh2_64.h:55
#define STATUS_SUCCESS
Definition: shellext.h:65
Definition: polytest.cpp:41
FLONG flXform
Definition: ntgdihdl.h:345
DWORD dwLayout
Definition: ntgdihdl.h:339
POINTL ptlViewportOrg
Definition: ntgdihdl.h:343
LONG y
Definition: windef.h:330
LONG x
Definition: windef.h:329
VOID FASTCALL SetLastNtError(_In_ NTSTATUS Status)
Definition: error.c:31
#define LAYOUT_RTL
Definition: wingdi.h:1371

◆ NtGdiOffsetWindowOrgEx()

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

Definition at line 615 of file coord.c.

620{
621 PDC dc;
622 PDC_ATTR pdcattr;
623
624 dc = DC_LockDc(hDC);
625 if (!dc)
626 {
628 return FALSE;
629 }
630 pdcattr = dc->pdcattr;
631
632 if (Point)
633 {
635
637 {
638 ProbeForWrite(Point, sizeof(POINT), 1);
639 Point->x = pdcattr->ptlWindowOrg.x;
640 Point->y = pdcattr->ptlWindowOrg.y;
641 }
643 {
645 }
646 _SEH2_END;
647
648 if (!NT_SUCCESS(Status))
649 {
652 return FALSE;
653 }
654 }
655
656 pdcattr->ptlWindowOrg.x += XOffset;
657 pdcattr->ptlWindowOrg.y += YOffset;
659
661
662 return TRUE;
663}
POINTL ptlWindowOrg
Definition: ntgdihdl.h:341

◆ NtGdiSetViewportOrgEx()

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

Definition at line 948 of file coord.c.

953{
954 PDC dc;
955 PDC_ATTR pdcattr;
956
957 dc = DC_LockDc(hDC);
958 if (!dc)
959 {
961 return FALSE;
962 }
963 pdcattr = dc->pdcattr;
964
965 if (Point)
966 {
968
970 {
971 ProbeForWrite(Point, sizeof(POINT), 1);
972 Point->x = pdcattr->ptlViewportOrg.x;
973 Point->y = pdcattr->ptlViewportOrg.y;
974 }
976 {
978 }
979 _SEH2_END;
980
981 if (!NT_SUCCESS(Status))
982 {
985 return FALSE;
986 }
987 }
988
989 pdcattr->ptlViewportOrg.x = X;
990 pdcattr->ptlViewportOrg.y = Y;
992
994
995 return TRUE;
996}
#define Y(I)
#define X(b, s)

◆ NtGdiSetWindowOrgEx()

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

Definition at line 1000 of file coord.c.

1005{
1006 PDC dc;
1007 PDC_ATTR pdcattr;
1008
1009 dc = DC_LockDc(hDC);
1010 if (!dc)
1011 {
1013 return FALSE;
1014 }
1015 pdcattr = dc->pdcattr;
1016
1017 if (Point)
1018 {
1020
1021 _SEH2_TRY
1022 {
1023 ProbeForWrite(Point, sizeof(POINT), 1);
1024 Point->x = pdcattr->ptlWindowOrg.x;
1025 Point->y = pdcattr->ptlWindowOrg.y;
1026 }
1028 {
1030 }
1031 _SEH2_END;
1032
1033 if (!NT_SUCCESS(Status))
1034 {
1036 DC_UnlockDc(dc);
1037 return FALSE;
1038 }
1039 }
1040
1041 pdcattr->ptlWindowOrg.x = X;
1042 pdcattr->ptlWindowOrg.y = Y;
1044
1045 DC_UnlockDc(dc);
1046
1047 return TRUE;
1048}