ReactOS 0.4.15-dev-8434-g155a7c7
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 6473 of file freetype.c.

6477{
6479 LOGFONTW LogFont;
6481 LONG GotCount, AvailCount, SafeInfoCount;
6483
6484 if (UnsafeLogFont == NULL || UnsafeInfo == NULL || UnsafeInfoCount == NULL)
6485 {
6487 return -1;
6488 }
6489
6490 Status = MmCopyFromCaller(&SafeInfoCount, UnsafeInfoCount, sizeof(SafeInfoCount));
6491 if (!NT_SUCCESS(Status))
6492 {
6494 return -1;
6495 }
6496 GotCount = 0;
6497 Status = MmCopyToCaller(UnsafeInfoCount, &GotCount, sizeof(*UnsafeInfoCount));
6498 if (!NT_SUCCESS(Status))
6499 {
6501 return -1;
6502 }
6503 Status = MmCopyFromCaller(&LogFont, UnsafeLogFont, sizeof(LOGFONTW));
6504 if (!NT_SUCCESS(Status))
6505 {
6507 return -1;
6508 }
6509 if (SafeInfoCount <= 0)
6510 {
6512 return -1;
6513 }
6514
6515 /* Allocate space for a safe copy */
6516 Status = RtlULongMult(SafeInfoCount, sizeof(FONTFAMILYINFO), &DataSize);
6518 {
6519 DPRINT1("Overflowed.\n");
6521 return -1;
6522 }
6524 if (Info == NULL)
6525 {
6527 return -1;
6528 }
6529
6530 /* Retrieve the information */
6531 AvailCount = IntGetFontFamilyInfo(Dc, &LogFont, Info, SafeInfoCount);
6532 GotCount = min(AvailCount, SafeInfoCount);
6533 SafeInfoCount = AvailCount;
6534
6535 /* Return data to caller */
6536 if (GotCount > 0)
6537 {
6538 Status = RtlULongMult(GotCount, sizeof(FONTFAMILYINFO), &DataSize);
6540 {
6541 DPRINT1("Overflowed.\n");
6544 return -1;
6545 }
6546 Status = MmCopyToCaller(UnsafeInfo, Info, DataSize);
6547 if (!NT_SUCCESS(Status))
6548 {
6551 return -1;
6552 }
6553 Status = MmCopyToCaller(UnsafeInfoCount, &SafeInfoCount, sizeof(*UnsafeInfoCount));
6554 if (!NT_SUCCESS(Status))
6555 {
6558 return -1;
6559 }
6560 }
6561
6563
6564 return GotCount;
6565}
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:6433
Status
Definition: gdiplustypes.h:25
#define LONG_MAX
Definition: limits.h:43
#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
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 _SEH2_END
Definition: filesup.c:22
#define _SEH2_TRY
Definition: filesup.c:19
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
static const WCHAR dc[]
#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 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}