Full Code of snowie2000/mactype for AI

directwrite 4f16c40bb9a8 cached
88 files
1.8 MB
542.3k tokens
1527 symbols
1 requests
Download .txt
Showing preview only (1,912K chars total). Download the full file or copy to clipboard to get everything.
Repository: snowie2000/mactype
Branch: directwrite
Commit: 4f16c40bb9a8
Files: 88
Total size: 1.8 MB

Directory structure:
gitextract_gw64c59c/

├── .gitignore
├── EventLogging.cpp
├── EventLogging.h
├── GdiPlusTypes2.h
├── LICENSE
├── Makefile
├── Makefile.vc2005
├── README.md
├── README_ja-JP.md
├── VersionHelper.cpp
├── VersionHelper.h
├── array.h
├── build.vc2005.bat
├── cache.cpp
├── cache.h
├── colorinvert.h
├── common.cpp
├── common.h
├── crc32.h
├── detours.h
├── directwrite.cpp
├── directwrite.h
├── dll.cpp
├── dll.h
├── doc/
│   ├── HOWTOBUILD.md
│   └── glyph_to_bitmapex.diff
├── dynCodeHelper.cpp
├── dynCodeHelper.h
├── easyhook.h
├── expfunc.cpp
├── expfunc.def
├── ft - non-ref.cpp
├── ft.cpp
├── ft.h
├── ft2build.h
├── ft2vert.c
├── ft2vert.h
├── fteng.cpp
├── fteng.h
├── ftref.c
├── ftref.h
├── gdiPlusFlat2.cpp
├── gdiPlusFlat2.h
├── gdidll.rc
├── gdipp.icproj
├── gdipp.sln
├── gdipp.vcxproj
├── gdipp.vcxproj.filters
├── hash_list.cpp
├── hash_list.h
├── hook.cpp
├── hookCounter.cpp
├── hookCounter.h
├── hooklist.h
├── ivs_otft.h
├── json.hpp
├── macloader.rc
├── macloader.vcxproj
├── makelib.cmd
├── misc.cpp
├── optimize/
│   ├── UpgradeLog.XML
│   ├── UpgradeLog2.XML
│   ├── _UpgradeReport_Files/
│   │   ├── UpgradeReport.css
│   │   └── UpgradeReport.xslt
│   ├── mem_amd.icproj
│   ├── mem_amd.sln
│   ├── mem_amd.sln_old
│   ├── mem_amd.vcproj
│   ├── memcpy__amd.cpp
│   ├── memcpy_amd.c
│   ├── memcpy_amd.h
│   └── optimize.h
├── override.cpp
├── override.h
├── ownedcs.cpp
├── ownedcs.h
├── resource
├── resource.h
├── run.cpp
├── settings.cpp
├── settings.h
├── stdint.h
├── strtoken.h
├── supinfo.h
├── tlsdata.h
├── undocAPI.h
├── wow64ext.h
└── wow64layer.h

================================================
FILE CONTENTS
================================================

================================================
FILE: .gitignore
================================================
.vs/
.vscode/
deps/
lib/
Debug*/
Rel*/
x64/
*.vcxproj.user
*.DotSettings.user


================================================
FILE: EventLogging.cpp
================================================
// EventLogging.cpp: implementation of the EventLogging class.
//
//////////////////////////////////////////////////////////////////////

#include "EventLogging.h"

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

EventLogging::EventLogging()
//*******************************************************************************
//	Default Constructor is used register the event source
//******************************************************************************
{
	// returns a handle that links the source to the registry 
	this->m_hEventLinker = RegisterEventSource(NULL,L"MacType");

}

EventLogging::~EventLogging()
//*******************************************************************************
//	Destructor is used deregister the event source
//*******************************************************************************
{
	// Releases the handle to the registry
	DeregisterEventSource(m_hEventLinker);
}



void EventLogging::LogIt(WORD CategoryID, DWORD EventID, LPCTSTR ArrayOfStrings[],
						 UINT NumOfArrayStr,LPVOID RawData,DWORD RawDataSize)
//*******************************************************************************
//	Function is used to log the event into the .evt file.
//	Input:	CategoryID is the events category classification
//			EventID is the events event classification
//			ArrayOfStrings is an array of pointers to strings that are passed for additional information gathering
//			NumOfArrayStr is the number of of strings in ArrayOfStrings
//			RawData is a void pointer to hold additional raw data for event reporting
//			RawDataSize is the size of RawData in bytes
//*******************************************************************************
{

	// Writes data to the event log
	ReportEvent(m_hEventLinker,EVENTLOG_INFORMATION_TYPE,CategoryID,
		EventID,NULL,NumOfArrayStr,RawDataSize,ArrayOfStrings,RawData);	

}


================================================
FILE: EventLogging.h
================================================
// EventLogging.h: interface for the EventLogging class.
//
//////////////////////////////////////////////////////////////////////
#include "common.h"
#if !defined(AFX_EVENTLOGGING_H__4AED0DCC_4C48_4312_BA6F_E6B90AC47F32__INCLUDED_)
#define AFX_EVENTLOGGING_H__4AED0DCC_4C48_4312_BA6F_E6B90AC47F32__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

class EventLogging 
{
public:
	EventLogging();
	virtual ~EventLogging();

	// Wrapper for ReportEvent that take care of Handle and EventType
	virtual void LogIt(WORD CategoryID, DWORD EventID, LPCTSTR ArrayOfStrings[] = NULL,
		UINT NumOfArrayStr = 0,LPVOID RawData = NULL,DWORD RawDataSize = 0);
	// data member to contain handle to registry
	HANDLE m_hEventLinker;


};

#endif // !defined(AFX_EVENTLOGGING_H__4AED0DCC_4C48_4312_BA6F_E6B90AC47F32__INCLUDED_)


================================================
FILE: GdiPlusTypes2.h
================================================
/**************************************************************************\
*
* Copyright (c) 1998-2001, Microsoft Corp.  All Rights Reserved.
*
* Module Name:
*
*   GdiplusTypes.h
*
* Abstract:
*
*   GDI+ Types
*
\**************************************************************************/

#ifndef _GDIPLUSTYPES_H
#define _GDIPLUSTYPES_H

//--------------------------------------------------------------------------
// Callback functions
//--------------------------------------------------------------------------

extern "C" {
typedef BOOL (CALLBACK * ImageAbort)(VOID *);
typedef ImageAbort DrawImageAbort;
typedef ImageAbort GetThumbnailImageAbort;
}

// Callback for EnumerateMetafile methods.  The parameters are:

//      recordType      WMF, EMF, or EMF+ record type
//      flags           (always 0 for WMF/EMF records)
//      dataSize        size of the record data (in bytes), or 0 if no data
//      data            pointer to the record data, or NULL if no data
//      callbackData    pointer to callbackData, if any

// This method can then call Metafile::PlayRecord to play the
// record that was just enumerated.  If this method  returns
// FALSE, the enumeration process is aborted.  Otherwise, it continues.


#if (GDIPVER >= 0x0110)
// This is the main GDI+ Abort interface

struct __declspec(novtable) GdiplusAbort
{
    virtual HRESULT __stdcall Abort(void) = 0;
};
#endif //(GDIPVER >= 0x0110)

//--------------------------------------------------------------------------
// Primitive data types
//
// NOTE:
//  Types already defined in standard header files:
//      INT8
//      UINT8
//      INT16
//      UINT16
//      INT32
//      UINT32
//      INT64
//      UINT64
//
//  Avoid using the following types:
//      LONG - use INT
//      ULONG - use UINT
//      DWORD - use UINT32
//--------------------------------------------------------------------------

typedef float REAL;

#define REAL_MAX            FLT_MAX
#define REAL_MIN            FLT_MIN
#define REAL_TOLERANCE     (FLT_MIN * 100)
#define REAL_EPSILON        1.192092896e-07F        /* FLT_EPSILON */

//--------------------------------------------------------------------------
// Forward declarations of common classes
//--------------------------------------------------------------------------

class Size;
class SizeF;
class Point;
class PointF;
class Rect;
class RectF;
class CharacterRange;

//--------------------------------------------------------------------------
// Status return values from GDI+ methods
//--------------------------------------------------------------------------

enum Status
{
    Ok = 0,
    GenericError = 1,
    InvalidParameter = 2,
    OutOfMemory = 3,
    ObjectBusy = 4,
    InsufficientBuffer = 5,
    NotImplemented = 6,
    Win32Error = 7,
    WrongState = 8,
    Aborted = 9,
    FileNotFound = 10,
    ValueOverflow = 11,
    AccessDenied = 12,
    UnknownImageFormat = 13,
    FontFamilyNotFound = 14,
    FontStyleNotFound = 15,
    NotTrueTypeFont = 16,
    UnsupportedGdiplusVersion = 17,
    GdiplusNotInitialized = 18,
    PropertyNotFound = 19,
    PropertyNotSupported = 20,
#if (GDIPVER >= 0x0110)
    ProfileNotFound = 21,
#endif //(GDIPVER >= 0x0110)
};

//--------------------------------------------------------------------------
// Represents a dimension in a 2D coordinate system (floating-point coordinates)
//--------------------------------------------------------------------------

class SizeF
{
public:
    SizeF()
    {
        Width = Height = 0.0f;
    }

    SizeF(IN const SizeF& size)
    {
        Width = size.Width;
        Height = size.Height;
    }

    SizeF(IN REAL width,
          IN REAL height)
    {
        Width = width;
        Height = height;
    }

    SizeF operator+(IN const SizeF& sz) const
    {
        return SizeF(Width + sz.Width,
                     Height + sz.Height);
    }

    SizeF operator-(IN const SizeF& sz) const
    {
        return SizeF(Width - sz.Width,
                     Height - sz.Height);
    }

    BOOL Equals(IN const SizeF& sz) const
    {
        return (Width == sz.Width) && (Height == sz.Height);
    }

    BOOL Empty() const
    {
        return (Width == 0.0f && Height == 0.0f);
    }

public:

    REAL Width;
    REAL Height;
};

//--------------------------------------------------------------------------
// Represents a dimension in a 2D coordinate system (integer coordinates)
//--------------------------------------------------------------------------

class Size
{
public:
    Size()
    {
        Width = Height = 0;
    }

    Size(IN const Size& size)
    {
        Width = size.Width;
        Height = size.Height;
    }

    Size(IN INT width,
         IN INT height)
    {
        Width = width;
        Height = height;
    }

    Size operator+(IN const Size& sz) const
    {
        return Size(Width + sz.Width,
                    Height + sz.Height);
    }

    Size operator-(IN const Size& sz) const
    {
        return Size(Width - sz.Width,
                    Height - sz.Height);
    }

    BOOL Equals(IN const Size& sz) const
    {
        return (Width == sz.Width) && (Height == sz.Height);
    }

    BOOL Empty() const
    {
        return (Width == 0 && Height == 0);
    }

public:

    INT Width;
    INT Height;
};

//--------------------------------------------------------------------------
// Represents a location in a 2D coordinate system (floating-point coordinates)
//--------------------------------------------------------------------------

class PointF
{
public:
   PointF()
   {
       X = Y = 0.0f;
   }

   PointF(IN const PointF &point)
   {
       X = point.X;
       Y = point.Y;
   }

   PointF(IN const SizeF &size)
   {
       X = size.Width;
       Y = size.Height;
   }

   PointF(IN REAL x,
          IN REAL y)
   {
       X = x;
       Y = y;
   }

   PointF operator+(IN const PointF& point) const
   {
       return PointF(X + point.X,
                     Y + point.Y);
   }

   PointF operator-(IN const PointF& point) const
   {
       return PointF(X - point.X,
                     Y - point.Y);
   }

   BOOL Equals(IN const PointF& point)
   {
       return (X == point.X) && (Y == point.Y);
   }

public:

    REAL X;
    REAL Y;
};

//--------------------------------------------------------------------------
// Represents a location in a 2D coordinate system (integer coordinates)
//--------------------------------------------------------------------------

class Point
{
public:
   Point()
   {
       X = Y = 0;
   }

   Point(IN const Point &point)
   {
       X = point.X;
       Y = point.Y;
   }

   Point(IN const Size &size)
   {
       X = size.Width;
       Y = size.Height;
   }

   Point(IN INT x,
         IN INT y)
   {
       X = x;
       Y = y;
   }

   Point operator+(IN const Point& point) const
   {
       return Point(X + point.X,
                    Y + point.Y);
   }

   Point operator-(IN const Point& point) const
   {
       return Point(X - point.X,
                    Y - point.Y);
   }

   BOOL Equals(IN const Point& point)
   {
       return (X == point.X) && (Y == point.Y);
   }

public:

    INT X;
    INT Y;
};

//--------------------------------------------------------------------------
// Represents a rectangle in a 2D coordinate system (floating-point coordinates)
//--------------------------------------------------------------------------

class RectF
{
public:

    RectF()
    {
        X = Y = Width = Height = 0.0f;
    }

    RectF(IN REAL x,
          IN REAL y,
          IN REAL width,
          IN REAL height)
    {
        X = x;
        Y = y;
        Width = width;
        Height = height;
    }

    RectF(IN const PointF& location,
          IN const SizeF& size)
    {
        X = location.X;
        Y = location.Y;
        Width = size.Width;
        Height = size.Height;
    }

    RectF* Clone() const
    {
        return new RectF(X, Y, Width, Height);
    }

    VOID GetLocation(OUT PointF* point) const
    {
        point->X = X;
        point->Y = Y;
    }

    VOID GetSize(OUT SizeF* size) const
    {
        size->Width = Width;
        size->Height = Height;
    }

    VOID GetBounds(OUT RectF* rect) const
    {
        rect->X = X;
        rect->Y = Y;
        rect->Width = Width;
        rect->Height = Height;
    }

    REAL GetLeft() const
    {
        return X;
    }

    REAL GetTop() const
    {
        return Y;
    }

    REAL GetRight() const
    {
        return X+Width;
    }

    REAL GetBottom() const
    {
        return Y+Height;
    }

    BOOL IsEmptyArea() const
    {
        return (Width <= REAL_EPSILON) || (Height <= REAL_EPSILON);
    }

    BOOL Equals(IN const RectF & rect) const
    {
        return X == rect.X &&
               Y == rect.Y &&
               Width == rect.Width &&
               Height == rect.Height;
    }

    BOOL Contains(IN REAL x,
                  IN REAL y) const
    {
        return x >= X && x < X+Width &&
               y >= Y && y < Y+Height;
    }

    BOOL Contains(IN const PointF& pt) const
    {
        return Contains(pt.X, pt.Y);
    }

    BOOL Contains(IN const RectF& rect) const
    {
        return (X <= rect.X) && (rect.GetRight() <= GetRight()) &&
               (Y <= rect.Y) && (rect.GetBottom() <= GetBottom());
    }

    VOID Inflate(IN REAL dx,
                 IN REAL dy)
    {
        X -= dx;
        Y -= dy;
        Width += 2*dx;
        Height += 2*dy;
    }

    VOID Inflate(IN const PointF& point)
    {
        Inflate(point.X, point.Y);
    }

    BOOL Intersect(IN const RectF& rect)
    {
        return Intersect(*this, *this, rect);
    }

    static BOOL Intersect(OUT RectF& c,
                          IN const RectF& a,
                          IN const RectF& b)
    {
        REAL right = min(a.GetRight(), b.GetRight());
        REAL bottom = min(a.GetBottom(), b.GetBottom());
        REAL left = max(a.GetLeft(), b.GetLeft());
        REAL top = max(a.GetTop(), b.GetTop());

        c.X = left;
        c.Y = top;
        c.Width = right - left;
        c.Height = bottom - top;
        return !c.IsEmptyArea();
    }

    BOOL IntersectsWith(IN const RectF& rect) const
    {
        return (GetLeft() < rect.GetRight() &&
                GetTop() < rect.GetBottom() &&
                GetRight() > rect.GetLeft() &&
                GetBottom() > rect.GetTop());
    }

    static BOOL Union(OUT RectF& c,
                      IN const RectF& a,
                      IN const RectF& b)
    {
        REAL right = max(a.GetRight(), b.GetRight());
        REAL bottom = max(a.GetBottom(), b.GetBottom());
        REAL left = min(a.GetLeft(), b.GetLeft());
        REAL top = min(a.GetTop(), b.GetTop());

        c.X = left;
        c.Y = top;
        c.Width = right - left;
        c.Height = bottom - top;
        return !c.IsEmptyArea();
    }

    VOID Offset(IN const PointF& point)
    {
        Offset(point.X, point.Y);
    }

    VOID Offset(IN REAL dx,
                IN REAL dy)
    {
        X += dx;
        Y += dy;
    }

public:

    REAL X;
    REAL Y;
    REAL Width;
    REAL Height;
};

//--------------------------------------------------------------------------
// Represents a rectangle in a 2D coordinate system (integer coordinates)
//--------------------------------------------------------------------------

class Rect
{
public:

    Rect()
    {
        X = Y = Width = Height = 0;
    }

    Rect(IN INT x,
         IN INT y,
         IN INT width,
         IN INT height)
    {
        X = x;
        Y = y;
        Width = width;
        Height = height;
    }

    Rect(IN const Point& location,
         IN const Size& size)
    {
        X = location.X;
        Y = location.Y;
        Width = size.Width;
        Height = size.Height;
    }

    Rect* Clone() const
    {
        return new Rect(X, Y, Width, Height);
    }

    VOID GetLocation(OUT Point* point) const
    {
        point->X = X;
        point->Y = Y;
    }

    VOID GetSize(OUT Size* size) const
    {
        size->Width = Width;
        size->Height = Height;
    }

    VOID GetBounds(OUT Rect* rect) const
    {
        rect->X = X;
        rect->Y = Y;
        rect->Width = Width;
        rect->Height = Height;
    }

    INT GetLeft() const
    {
        return X;
    }

    INT GetTop() const
    {
        return Y;
    }

    INT GetRight() const
    {
        return X+Width;
    }

    INT GetBottom() const
    {
        return Y+Height;
    }

    BOOL IsEmptyArea() const
    {
        return (Width <= 0) || (Height <= 0);
    }

    BOOL Equals(IN const Rect & rect) const
    {
        return X == rect.X &&
               Y == rect.Y &&
               Width == rect.Width &&
               Height == rect.Height;
    }

    BOOL Contains(IN INT x,
                  IN INT y) const
    {
        return x >= X && x < X+Width &&
               y >= Y && y < Y+Height;
    }

    BOOL Contains(IN const Point& pt) const
    {
        return Contains(pt.X, pt.Y);
    }

    BOOL Contains(IN Rect& rect) const
    {
        return (X <= rect.X) && (rect.GetRight() <= GetRight()) &&
               (Y <= rect.Y) && (rect.GetBottom() <= GetBottom());
    }

    VOID Inflate(IN INT dx,
                 IN INT dy)
    {
        X -= dx;
        Y -= dy;
        Width += 2*dx;
        Height += 2*dy;
    }

    VOID Inflate(IN const Point& point)
    {
        Inflate(point.X, point.Y);
    }

    BOOL Intersect(IN const Rect& rect)
    {
        return Intersect(*this, *this, rect);
    }

    static BOOL Intersect(OUT Rect& c,
                          IN const Rect& a,
                          IN const Rect& b)
    {
        INT right = min(a.GetRight(), b.GetRight());
        INT bottom = min(a.GetBottom(), b.GetBottom());
        INT left = max(a.GetLeft(), b.GetLeft());
        INT top = max(a.GetTop(), b.GetTop());

        c.X = left;
        c.Y = top;
        c.Width = right - left;
        c.Height = bottom - top;
        return !c.IsEmptyArea();
    }

    BOOL IntersectsWith(IN const Rect& rect) const
    {
        return (GetLeft() < rect.GetRight() &&
                GetTop() < rect.GetBottom() &&
                GetRight() > rect.GetLeft() &&
                GetBottom() > rect.GetTop());
    }

    static BOOL Union(OUT Rect& c,
                      IN const Rect& a,
                      IN const Rect& b)
    {
        INT right = max(a.GetRight(), b.GetRight());
        INT bottom = max(a.GetBottom(), b.GetBottom());
        INT left = min(a.GetLeft(), b.GetLeft());
        INT top = min(a.GetTop(), b.GetTop());

        c.X = left;
        c.Y = top;
        c.Width = right - left;
        c.Height = bottom - top;
        return !c.IsEmptyArea();
    }

    VOID Offset(IN const Point& point)
    {
        Offset(point.X, point.Y);
    }

    VOID Offset(IN INT dx,
                IN INT dy)
    {
        X += dx;
        Y += dy;
    }

public:

    INT X;
    INT Y;
    INT Width;
    INT Height;
};

class PathData
{
public:
    PathData()
    {
        Count = 0;
        Points = NULL;
        Types = NULL;
    }

    ~PathData()
    {
        if (Points != NULL)
        {
            delete [] Points;
        }

        if (Types != NULL)
        {
            delete [] Types;
        }
    }

private:
    PathData(const PathData &);
    PathData& operator=(const PathData &);

public:
    INT Count;
    PointF* Points;
    __field_ecount_opt(Count) BYTE* Types;
};

class CharacterRange
{
public:
    CharacterRange(
        INT first,
        INT length
    ) :
        First   (first),
        Length  (length)
    {}

    CharacterRange() : First(0), Length(0)
    {}

    CharacterRange & operator = (const CharacterRange &rhs)
    {
        First  = rhs.First;
        Length = rhs.Length;
        return *this;
    }

    INT First;
    INT Length;
};

#endif // !_GDIPLUSTYPES_HPP



================================================
FILE: LICENSE
================================================
                    GNU GENERAL PUBLIC LICENSE
                       Version 3, 29 June 2007

 Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
 Everyone is permitted to copy and distribute verbatim copies
 of this license document, but changing it is not allowed.

                            Preamble

  The GNU General Public License is a free, copyleft license for
software and other kinds of works.

  The licenses for most software and other practical works are designed
to take away your freedom to share and change the works.  By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users.  We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors.  You can apply it to
your programs, too.

  When we speak of free software, we are referring to freedom, not
price.  Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.

  To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights.  Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.

  For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received.  You must make sure that they, too, receive
or can get the source code.  And you must show them these terms so they
know their rights.

  Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.

  For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software.  For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.

  Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so.  This is fundamentally incompatible with the aim of
protecting users' freedom to change the software.  The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable.  Therefore, we
have designed this version of the GPL to prohibit the practice for those
products.  If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.

  Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary.  To prevent this, the GPL assures that
patents cannot be used to render the program non-free.

  The precise terms and conditions for copying, distribution and
modification follow.

                       TERMS AND CONDITIONS

  0. Definitions.

  "This License" refers to version 3 of the GNU General Public License.

  "Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.

  "The Program" refers to any copyrightable work licensed under this
License.  Each licensee is addressed as "you".  "Licensees" and
"recipients" may be individuals or organizations.

  To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy.  The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.

  A "covered work" means either the unmodified Program or a work based
on the Program.

  To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy.  Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.

  To "convey" a work means any kind of propagation that enables other
parties to make or receive copies.  Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.

  An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License.  If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.

  1. Source Code.

  The "source code" for a work means the preferred form of the work
for making modifications to it.  "Object code" means any non-source
form of a work.

  A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.

  The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form.  A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.

  The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities.  However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work.  For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.

  The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.

  The Corresponding Source for a work in source code form is that
same work.

  2. Basic Permissions.

  All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met.  This License explicitly affirms your unlimited
permission to run the unmodified Program.  The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work.  This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.

  You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force.  You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright.  Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.

  Conveying under any other circumstances is permitted solely under
the conditions stated below.  Sublicensing is not allowed; section 10
makes it unnecessary.

  3. Protecting Users' Legal Rights From Anti-Circumvention Law.

  No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.

  When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.

  4. Conveying Verbatim Copies.

  You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.

  You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.

  5. Conveying Modified Source Versions.

  You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:

    a) The work must carry prominent notices stating that you modified
    it, and giving a relevant date.

    b) The work must carry prominent notices stating that it is
    released under this License and any conditions added under section
    7.  This requirement modifies the requirement in section 4 to
    "keep intact all notices".

    c) You must license the entire work, as a whole, under this
    License to anyone who comes into possession of a copy.  This
    License will therefore apply, along with any applicable section 7
    additional terms, to the whole of the work, and all its parts,
    regardless of how they are packaged.  This License gives no
    permission to license the work in any other way, but it does not
    invalidate such permission if you have separately received it.

    d) If the work has interactive user interfaces, each must display
    Appropriate Legal Notices; however, if the Program has interactive
    interfaces that do not display Appropriate Legal Notices, your
    work need not make them do so.

  A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit.  Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.

  6. Conveying Non-Source Forms.

  You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:

    a) Convey the object code in, or embodied in, a physical product
    (including a physical distribution medium), accompanied by the
    Corresponding Source fixed on a durable physical medium
    customarily used for software interchange.

    b) Convey the object code in, or embodied in, a physical product
    (including a physical distribution medium), accompanied by a
    written offer, valid for at least three years and valid for as
    long as you offer spare parts or customer support for that product
    model, to give anyone who possesses the object code either (1) a
    copy of the Corresponding Source for all the software in the
    product that is covered by this License, on a durable physical
    medium customarily used for software interchange, for a price no
    more than your reasonable cost of physically performing this
    conveying of source, or (2) access to copy the
    Corresponding Source from a network server at no charge.

    c) Convey individual copies of the object code with a copy of the
    written offer to provide the Corresponding Source.  This
    alternative is allowed only occasionally and noncommercially, and
    only if you received the object code with such an offer, in accord
    with subsection 6b.

    d) Convey the object code by offering access from a designated
    place (gratis or for a charge), and offer equivalent access to the
    Corresponding Source in the same way through the same place at no
    further charge.  You need not require recipients to copy the
    Corresponding Source along with the object code.  If the place to
    copy the object code is a network server, the Corresponding Source
    may be on a different server (operated by you or a third party)
    that supports equivalent copying facilities, provided you maintain
    clear directions next to the object code saying where to find the
    Corresponding Source.  Regardless of what server hosts the
    Corresponding Source, you remain obligated to ensure that it is
    available for as long as needed to satisfy these requirements.

    e) Convey the object code using peer-to-peer transmission, provided
    you inform other peers where the object code and Corresponding
    Source of the work are being offered to the general public at no
    charge under subsection 6d.

  A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.

  A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling.  In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage.  For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product.  A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.

  "Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source.  The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.

  If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information.  But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).

  The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed.  Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.

  Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.

  7. Additional Terms.

  "Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law.  If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.

  When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it.  (Additional permissions may be written to require their own
removal in certain cases when you modify the work.)  You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.

  Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:

    a) Disclaiming warranty or limiting liability differently from the
    terms of sections 15 and 16 of this License; or

    b) Requiring preservation of specified reasonable legal notices or
    author attributions in that material or in the Appropriate Legal
    Notices displayed by works containing it; or

    c) Prohibiting misrepresentation of the origin of that material, or
    requiring that modified versions of such material be marked in
    reasonable ways as different from the original version; or

    d) Limiting the use for publicity purposes of names of licensors or
    authors of the material; or

    e) Declining to grant rights under trademark law for use of some
    trade names, trademarks, or service marks; or

    f) Requiring indemnification of licensors and authors of that
    material by anyone who conveys the material (or modified versions of
    it) with contractual assumptions of liability to the recipient, for
    any liability that these contractual assumptions directly impose on
    those licensors and authors.

  All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10.  If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term.  If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.

  If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.

  Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.

  8. Termination.

  You may not propagate or modify a covered work except as expressly
provided under this License.  Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).

  However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.

  Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.

  Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License.  If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.

  9. Acceptance Not Required for Having Copies.

  You are not required to accept this License in order to receive or
run a copy of the Program.  Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance.  However,
nothing other than this License grants you permission to propagate or
modify any covered work.  These actions infringe copyright if you do
not accept this License.  Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.

  10. Automatic Licensing of Downstream Recipients.

  Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License.  You are not responsible
for enforcing compliance by third parties with this License.

  An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations.  If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.

  You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License.  For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.

  11. Patents.

  A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based.  The
work thus licensed is called the contributor's "contributor version".

  A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version.  For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.

  Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.

  In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement).  To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.

  If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients.  "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.

  If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.

  A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License.  You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.

  Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.

  12. No Surrender of Others' Freedom.

  If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License.  If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all.  For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.

  13. Use with the GNU Affero General Public License.

  Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work.  The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.

  14. Revised Versions of this License.

  The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time.  Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.

  Each version is given a distinguishing version number.  If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation.  If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.

  If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.

  Later license versions may give you additional or different
permissions.  However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.

  15. Disclaimer of Warranty.

  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.

  16. Limitation of Liability.

  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.

  17. Interpretation of Sections 15 and 16.

  If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.

                     END OF TERMS AND CONDITIONS

            How to Apply These Terms to Your New Programs

  If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.

  To do so, attach the following notices to the program.  It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.

    <one line to give the program's name and a brief idea of what it does.>
    Copyright (C) <year>  <name of author>

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <https://www.gnu.org/licenses/>.

Also add information on how to contact you by electronic and paper mail.

  If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:

    <program>  Copyright (C) <year>  <name of author>
    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
    This is free software, and you are welcome to redistribute it
    under certain conditions; type `show c' for details.

The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License.  Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".

  You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.

  The GNU General Public License does not permit incorporating your program
into proprietary programs.  If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library.  If this is what you want to do, use the GNU Lesser General
Public License instead of this License.  But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.


================================================
FILE: Makefile
================================================
# usage:
#  nmake            release build
#  nmake debug=1    debug build
#  nmake ddk=1      using DDK compiler
#  nmake sse=1      build for SSE capable CPUs (uses with ddk=1)
#  nmake clean      clean all file(s)
#  nmake cleanobj   clean object file(s)

GDI_PREFIX = ..\gdi++
GDI_PREFIX_DDK = ..\gdi++
GDI_PREFIX_SSE = ..\gdi++_sse

TARGET_EXE = $(GDI_PREFIX).exe
TARGET_DLL = $(GDI_PREFIX).dll

EXE_OBJS = run.obj gdiexe.res
DLL_OBJS = hook.obj override.obj settings.obj cache.obj misc.obj expfunc.obj ft.obj fteng.obj ft2vert.obj gdidll.res
LINK_LIBS  = memcpy_amd.lib

EXE_PREFIX = ..\gdiexe
DLL_PREFIX = ..\gdidll

.SUFFIXES: .c .cpp .obj .rc .res

CPPFLAGS   = /nologo /D "WIN32"
LINKFLAGS  = /nologo
LINK_EXE   = /map:$(EXE_PREFIX).map
LINK_DLL   = /map:$(DLL_PREFIX).map

CPPOPT     = /G6 /Gy /QI0f- /QIfdiv-
LINKOPT    = /opt:nowin98 /opt:icf /opt:ref

!ifdef ddk
TARGET_DLL = $(GDI_PREFIX_DDK).dll
DLL_PREFIX = ..\gdidll

!ifdef sse
TARGET_EXE = $(GDI_PREFIX_SSE).exe
TARGET_DLL = $(GDI_PREFIX_SSE).dll
CPPOPT     = $(CPPOPT) /GL /arch:SSE
!else
CPPOPT     = /G7 /Gy /QI0f- /QIfdiv- /GL /arch:SSE2
!endif

LINKOPT    = $(LINKOPT) /ltcg /ignore:4070,4078 bufferoverflowU.lib
LINK_LIBS  = detoured_.lib detours_.lib $(LINK_LIBS)

!else
LINK_LIBS  = detoured.lib detours.lib $(LINK_LIBS)
!endif

!ifdef ftstatic
CPPFLAGS  = $(CPPFLAGS) /D "FREETYPE_STATIC"
FTLIB     = freetypeMT
!else
FTLIB     = freetype
!endif

!ifdef debug
CPPFLAGS  = $(CPPFLAGS) /Od /MDd /FD /GZ /Zi /D "DEBUG" /D "_DEBUG"
LINKFLAGS = $(LINKFLAGS) /incremental:no /debug /machine:I386 /opt:ref /opt:noicf
LINK_EXE  = $(LINK_EXE) /pdb:$(EXE_PREFIX).pdb
#LINK_DLL  = $(LINK_DLL) $(FTLIB)D.lib /pdb:$(DLL_PREFIX).pdb
LINK_DLL  = $(LINK_DLL) $(FTLIB).lib /pdb:$(DLL_PREFIX).pdb
!else
CPPFLAGS  = $(CPPFLAGS) $(CPPOPT) /O2 /MD
LINK_DLL  = $(LINK_DLL) $(LINKOPT) $(FTLIB).lib
LINK_EXE  = $(LINK_EXE) $(LINKOPT)
!endif

all: $(TARGET_EXE) $(TARGET_DLL)

$(TARGET_EXE): $(EXE_OBJS)
	link $(LINKFLAGS) $(LINK_EXE) $(LINK_LIBS) /out:$@ $(EXE_OBJS)

$(TARGET_DLL): $(DLL_OBJS) expfunc.def
	link /dll $(LINKFLAGS) $(LINK_DLL) $(LINK_LIBS) /def:expfunc.def /out:$@ $(DLL_OBJS)

.c.obj:
	cl $(CPPFLAGS) /GF /GA /W3 /Fo$@ /c $<

.cpp.obj:
	cl $(CPPFLAGS) /GF /GA /W3 /Fo$@ /c $<

.rc.res:
	rc /l 0x411 $<

clean: cleanobj
	@-erase "$(TARGET_EXE)"
	@-erase "$(TARGET_DLL)"

cleanobj:
	@-erase $(EXE_OBJS)
	@-erase $(DLL_OBJS)
	@-erase ..\gdi???.map
	@-erase vc??.pdb
	@-erase vc??.idb
	@-erase "$(EXE_PREFIX).pdb"
	@-erase "$(DLL_PREFIX).pdb"
	@-erase "$(GDI_PREFIX).exp"
	@-erase "$(GDI_PREFIX).lib"
	@-erase "$(GDI_PREFIX_DDK).exp"
	@-erase "$(GDI_PREFIX_DDK).lib"
	@-erase "$(GDI_PREFIX_SSE).exp"
	@-erase "$(GDI_PREFIX_SSE).lib"

hook.obj:     hook.cpp ft.h hooklist.h override.h common.h array.h cache.h settings.h tlsdata.h fteng.h
override.obj: override.cpp ft.h hooklist.h override.h common.h array.h cache.h settings.h tlsdata.h fteng.h supinfo.h
cache.obj:    cache.cpp hooklist.h override.h common.h array.h cache.h
misc.obj:     misc.cpp common.h array.h
settings.obj: settings.cpp common.h array.h cache.h settings.h strtoken.h supinfo.h fteng.h
expfunc.obj:  expfunc.cpp common.h array.h cache.h settings.h
ft.obj:       ft.cpp ft.h override.h common.h array.h cache.h settings.h fteng.h ft2vert.h
fteng.obj:    fteng.cpp ft.h override.h common.h array.h cache.h settings.h fteng.h
ft2vert.obj:  ft2vert.c ft2vert.h
run.obj:      run.cpp expfunc.cpp supinfo.h gdiexe.rc
gdiexe.res:   gdiexe.rc gdidll.rc


================================================
FILE: Makefile.vc2005
================================================
# usage:
#  nmake            release build
#  nmake debug=1    debug build
#  nmake ddk=1      using DDK compiler
#  nmake oldpsdk=1  using old platform sdk (dynamic load SHILCreateFromPath()/SHFree())
#  nmake clean      clean all file(s)
#  nmake cleanobj   clean object file(s)

TARGET_EXE = ..\gdi++.exe
TARGET_DLL = ..\gdi++.dll

EXE_OBJS = run.obj gdiexe.res
DLL_OBJS = hook.obj override.obj settings.obj cache.obj misc.obj expfunc.obj ft.obj fteng.obj ft2vert.obj gdidll.res memcpy_amd.obj
DLL_LIBS = advapi32.lib

GDI_PREFIX = ..\gdi++
EXE_PREFIX = ..\gdiexe
DLL_PREFIX = ..\gdidll

.SUFFIXES: .c .cpp .obj .rc .res

CPPFLAGS  = /nologo /D "WIN32" /I. /EHsc /D
LINKFLAGS = /nologo
LINK_EXE  = /map:$(EXE_PREFIX).map
LINK_DLL  = /map:$(DLL_PREFIX).map

CPPOPT    = /Gy /arch:SSE
LINKOPT   = /opt:nowin98 /opt:icf /opt:ref

!ifdef ddk
GDI_PREFIX = ..\gdi++_G7-GS-SSE2_ddk
TARGET_DLL = ..\gdi++_G7-GS-SSE2_ddk.dll
DLL_PREFIX = ..\gdidll_G7-GS-SSE2_ddk
CPPOPT     = /G7 /Gy /GL /GS /arch:SSE2
LINKOPT    = $(LINKOPT) /ltcg /ignore:4070,4078 bufferoverflowU.lib
!endif

!ifdef oldpsdk
CPPFLAGS  = $(CPPFLAGS) /D "OLD_PSDK"
!endif

!ifdef usetrace
CPPFLAGS  = $(CPPFLAGS) /D "USE_TRACE"
!endif

!ifdef ftstatic
CPPFLAGS  = $(CPPFLAGS) /D "FREETYPE_STATIC"
FTLIB     = freetypeMT
!else
FTLIB     = freetype
!endif

!ifdef debug
CPPFLAGS  = $(CPPFLAGS) /Od /MTd /FD /GZ /Zi /D "DEBUG" /D "_DEBUG"
LINKFLAGS = $(LINKFLAGS) /incremental:no /debug /machine:I386 /opt:ref /opt:noicf /Fm
LINK_EXE  = $(LINK_EXE) /pdb:$(EXE_PREFIX).pdb
LINK_DLL  = $(LINK_DLL) $(FTLIB)D.lib /pdb:$(DLL_PREFIX).pdb
!else
CPPFLAGS  = $(CPPFLAGS) $(CPPOPT) /O2 /MT /GF /GL
LINK_DLL  = $(LINK_DLL) $(LINKOPT) $(FTLIB).lib
LINK_EXE  = $(LINK_EXE) $(LINKOPT)
!endif

!ifdef ddk
all: $(TARGET_DLL)
!else
all: $(TARGET_EXE) $(TARGET_DLL)
!endif

$(TARGET_EXE): $(EXE_OBJS)
	link $(LINKFLAGS) $(LINK_EXE) /LTCG /out:$@ $(EXE_OBJS)

$(TARGET_DLL): $(DLL_OBJS) expfunc.def
	link /dll $(LINKFLAGS) $(LINK_DLL) /LTCG /def:expfunc.def /out:$@ $(DLL_OBJS) $(DLL_LIBS)
	if exist $@.manifest mt -manifest $@.manifest -outputresource:$@;2

pgi:
	-del gdi++*.pg*
	link /dll $(LINKFLAGS) $(LINK_DLL) /LTCG:PGI /def:expfunc.def /out:gdi++.dll $(DLL_OBJS) $(DLL_LIBS)

pgo:
	link /dll $(LINKFLAGS) $(LINK_DLL) /LTCG:PGO /def:expfunc.def /out:gdi++.dll $(DLL_OBJS) $(DLL_LIBS)

.c.obj:
	cl $(CPPFLAGS) /W3 /Fo$@ /c $<

.cpp.obj:
	cl $(CPPFLAGS) /W3 /Fo$@ /c $<

.rc.res:
	rc /l 0x411 $<

clean: cleanobj
	@-erase "$(TARGET_EXE)"
	@-erase "$(TARGET_DLL)"

cleanobj:
	@-erase $(EXE_OBJS)
	@-erase $(DLL_OBJS)
	@-erase vc??.pdb
	@-erase vc??.idb
	@-erase "$(EXE_PREFIX).pdb"
	@-erase "$(DLL_PREFIX).pdb"
	@-erase "$(EXE_PREFIX).map"
	@-erase "$(DLL_PREFIX).map"
	@-erase "$(GDI_PREFIX).exp"
	@-erase "$(GDI_PREFIX).lib"

memcpy_amd.obj: optimize/memcpy__amd.cpp optimize/memcpy_amd.h
	cl $(CPPFLAGS) /W3 /Fomemcpy_amd.obj /c optimize/memcpy__amd.cpp

hook.obj:     hook.cpp ft.h hooklist.h override.h common.h array.h cache.h settings.h tlsdata.h fteng.h
override.obj: override.cpp ft.h hooklist.h override.h common.h array.h cache.h settings.h tlsdata.h fteng.h
cache.obj:    cache.cpp hooklist.h override.h common.h array.h cache.h
misc.obj:     misc.cpp common.h array.h
settings.obj: settings.cpp common.h array.h cache.h settings.h strtoken.h
expfunc.obj:  expfunc.cpp common.h array.h cache.h settings.h
ft.obj:       ft.cpp ft.h override.h common.h array.h cache.h settings.h fteng.h ft2vert.h
fteng.obj:    fteng.cpp ft.h override.h common.h array.h cache.h settings.h fteng.h
ft2vert.obj:  ft2vert.c ft2vert.h
run.obj:      run.cpp expfunc.cpp gdiexe.rc
gdiexe.res:   gdiexe.rc gdidll.rc
gdidll.res:   gdidll.rc


================================================
FILE: README.md
================================================
MacType
========================
[日本語](./README_ja-JP.md)

Better font rendering for Windows.

Latest build
------------------

[Download](https://github.com/snowie2000/mactype/releases/latest)

Official site
------------------

MacType official site: 

http://www.mactype.net (An archived version is restored)

What's new?
------------------

- Win11 compatible
- CET compatible
- Updated FreeType
- Support for color fonts :sunglasses:
- New installer
- Lots of bug fixes
- Updates for multi-monitor support
- Tray app can intercept explorer in Service Mode now
- Tweaks for diacritics
- Updates to EasyHook
- Lower CPU in Tray Mode
- Better DirectWrite support thanks to [しらいと](http://silight.hatenablog.jp)
- Separate DirectWrite parameter adjustment
- Traditional Chinese localization greatly improved thanks to GT Wang
- English localization improved
- Added Korea localization, thanks to 조현희
- MultiLang system improved

Donation
------------------

MacType now accepts donations. 

Please visit http://www.mactype.net and keep an eye on the bottom right corner :heart:

Thank you for your support! Your donations will keep the server running, keep me updating, and buy more coffees :coffee:

Known issues
---------------

- Please backup your profiles before upgrading!

- Only Chinese simplified/Traditional and English are fully localized, some options may missing in MacType Tuner due to the strings missing in the language file. You can help with translations!

- If you want to use MacType-patch together with MacType official release, remember to add DirectWrite=0 to your profile or you will have mysterious problems

- If you're running 64 bit Windows, antimalware/antivirus software may conflict with MacType, because it sees MacType trying to modify running software. One possible workaround is to try running in Service Mode (recommended), or add HookChildProcesses=0 to your profile. See https://github.com/snowie2000/mactype/wiki/HookChildProcesses for an explanation

- Office 2013 does not use DirectWrite or GDI (it uses its own custom rendering), so Office 2013 doesn't work with MacType. If this bothers you you can use Office 2010 which uses GDI or Office 2016+ which uses DirectWrite.

- WPS has a built in defense that **UNLOADS** MacType automatically. The latest version has a workaround [here](https://github.com/snowie2000/mactype/wiki/WPS) thanks to wmjordan.

How to get registry mode back
-------------

It is no longer possible to enable registry mode via the wizard in Windows 10. 

We have a detailed guide on how you can enable the registry mode manually in [wiki](https://github.com/snowie2000/mactype/wiki/Enable-registry-mode-manually), get your screwdrivers ready before you head over to it.

How to build
-------------

Check how to build [document](https://github.com/snowie2000/mactype/blob/directwrite/doc/HOWTOBUILD.md)



================================================
FILE: README_ja-JP.md
================================================
MacType
========================

Windows のフォントレンダリングを改善。

最新ビルド
------------------

[ダウンロード](https://github.com/snowie2000/mactype/releases/latest)

公式サイト
------------------

MacType 公式サイト: 

http://www.mactype.net

What's new?
------------------

- Win11 の互換性
- CET の互換性
- 更新された FreeType
- カラーフォントのサポート :sunglasses:
- 新しいインストーラー
- 多くのバグ修正
- マルチモニターのサポートを更新
- サービスモードでエクスプローラーのトレイアプリを傍受
- ダイアクリティカルマークの調整
- EasyHook を更新
- トレイモードで CPU の低負荷設定
- [しらいと](http://silight.hatenablog.jp)氏による DirectWrite のサポートの向上
- DirectWrite パラメータの個別調整 
- GT Wang による繁体字中国語の大幅な改善
- 英語訳の改善
- 韓国語訳の追加、조현희に感謝
- 多言語システムの改善

寄付
------------------

MacType は現在寄付を受付中です。

http://www.mactype.net にアクセスして右下の隅にご注目ください :heart:

ご支援ありがとうございます! 寄付金はサーバーの維持費、更新の継続、そしてコーヒーの購入に役立てられます :coffee:

既知の問題
---------------

- 更新をする前にプロファイルをバックアップしてください。

- 中国語 (繁体字/簡体字) と英語のみが完全にローカライズされており、言語ファイルに文字列の欠落があります。MacType Tuner で一部のオプションに欠落がある可能性があります。翻訳にご協力ください。

- MacType-patch を MacType 公式ビルドと一緒に使用したい場合は、プロファイルに「DirectWrite=0」を追加することを忘れないでください。この操作を忘れると動作に問題が発生します。

- 64 ビットの Windows を使用している場合、マルウェアまたはウィルス対策ソフトで MacType が競合する可能性があります。これは、MacType が実行中のソフトウェアを変更しようと認識するために発生します。回避策としてはサービスモード (推奨) で実行するか、プロファイルに「HookChildProcesses=0」を追加してください。<br>
詳細な説明は https://github.com/snowie2000/mactype/wiki/HookChildProcesses を参照してください。

- Office 2013 は DirectWrite または GDI を使用していません (独自のカスタムレンダリングを使用しています)。そのため、Office 2013 で MacType は動作しません。これが気になる方は、GDI を使用している Office 2010 か DirectWrite を使用している Office 2016 以降を使用してください。 

- WPS には MacType を自動的に **アンロード** する防御機能が組み込まれています。最新のバージョンでは、wmjordan の協力により[こちら](https://github.com/snowie2000/mactype/wiki/WPS)の回避策が用意されています。

レジストリモードを戻す方法
-------------

Windows 10 以降ではウィザードを使用したレジストリモードの有効化はできなくなりました。 

レジストリモードを手動で有効化する方法については、[Wiki](https://github.com/snowie2000/mactype/wiki/Enable-registry-mode-manually) に詳しいガイドがあります。<br>
アクセスする前にスクリュードライバーを準備してくださいね。

ビルドのやり方
-------------

ビルドについては[ドキュメント](https://github.com/snowie2000/mactype/blob/directwrite/doc/HOWTOBUILD.md)をご確認ください。



================================================
FILE: VersionHelper.cpp
================================================
#include "VersionHelper.h"


//////////////////////////////////////////////////////////////////////
// Konstruktion/Destruktion
//////////////////////////////////////////////////////////////////////

CVersionHelper::CVersionHelper()
{

}

CVersionHelper::~CVersionHelper()
{

}

/***********************************************************************************/
/*                                                                                 */
/* Class:   CVersionHelper                                                       */
/* Method:  GetVersionInfo                                                         */
/*                                                                                 */
/* Parameters:                                                                     */
/* -----------                                                                     */
/*   HMODULE hLib                                                                  */
/*                Handle to the module that contains the resource (EXE or DLL)     */
/*                A value of NULL specifies the current applications resources     */
/*                                                                                 */
/*   CString csEntry                                                               */
/*                Specifies the name of the resource. For more information,        */
/*                see the Remarks section.                                         */
/*                                                                                 */
/* Return Values:                                                                  */
/* --------------                                                                  */
/* If the function succeeds, the return value is a string containing the value     */
/* of the specified resource.                                                      */
/* If the function fails, the returned string is empty. To get extended error      */
/* information, call GetLastError.                                                 */
/*                                                                                 */
/* Remarks:                                                                        */
/* --------                                                                        */
/* Since the Win32 API resource information is encoded in Unicode, this method     */
/* also strips the strings from Unicode.                                           */
/*                                                                                 */
/* The following valid values for csEntry, as specified by Microsoft are:          */
/*   CompanyName, FileDescription, FileVersion, InternalName, LegalCopyright,      */
/*   OriginalFilename, ProductName, ProductVersion, Comments, LegalTrademarks,     */
/*   PrivateBuild, SpecialBuild                                                    */
/*                                                                                 */
/* Opening the rc-file as "text" or with a text-editor allows you to add further   */
/* entries to your version information structure and it is retrievable using       */
/* this same method.                                                               */
/*                                                                                 */
/***********************************************************************************/

wstring CVersionHelper::GetVersionInfo(HMODULE hLib, wstring csEntry)
{
	wstring csRet;

	if (hLib == NULL)
		return TEXT("");

	HRSRC hVersion = FindResource(hLib, MAKEINTRESOURCE(VS_VERSION_INFO), RT_VERSION);
	if (hVersion != NULL)
	{
		HGLOBAL hGlobal = LoadResource(hLib, hVersion);
		if (hGlobal != NULL)
		{

			LPVOID versionInfo = LockResource(hGlobal);
			if (versionInfo != NULL)
			{

				char    *pchVI = (char*)versionInfo;
				int dwSize = SizeofResource(hLib, hVersion);
				if (IsBadReadPtr(versionInfo, dwSize))
					dwSize -= 4;
				char    *pchVIcopy = new char[dwSize * 2 + 4];

				memcpy(pchVIcopy, pchVI, (int)(dwSize * 2 + 4));

				DWORD vLen, langD;
				BOOL retVal;

				LPVOID retbuf = NULL;

				static TCHAR fileEntry[256];

				wsprintf(fileEntry, TEXT("\\VarFileInfo\\Translation"));
				retVal = VerQueryValue(pchVIcopy, fileEntry, &retbuf, (UINT *)&vLen);
				if (retVal && vLen == 4)
				{
					memcpy(&langD, retbuf, 4);
					wsprintf(fileEntry, TEXT("\\StringFileInfo\\%02X%02X%02X%02X\\%s"),
						(langD & 0xff00) >> 8, langD & 0xff, (langD & 0xff000000) >> 24,
						(langD & 0xff0000) >> 16, csEntry);
				}
				else
					wsprintf(fileEntry, TEXT("\\StringFileInfo\\%04X04B0\\%s"), GetUserDefaultLangID(), csEntry);

				if (VerQueryValue(pchVIcopy, fileEntry, &retbuf, (UINT *)&vLen))
					csRet = (TCHAR*)retbuf;
				delete pchVIcopy;
			}
		}

		UnlockResource(hGlobal);
		FreeResource(hGlobal);
	}

	return csRet;
}

/***********************************************************************************/
/*                                                                                 */
/* Class:   CGlobalFunctions                                                       */
/* Method:  FormatVersion                                                          */
/*                                                                                 */
/* Parameters:                                                                     */
/* -----------                                                                     */
/*   CString cs                                                                    */
/*                Specifies a version number such as "FileVersion" or              */
/*                "ProductVersion" in the format "m, n, o, p"                      */
/*                (e.g. "1, 2, 3, a")                                              */
/*                                                                                 */
/* Return Values:                                                                  */
/* --------------                                                                  */
/* If the function succeeds, the return value is a string containing the version   */
/* in the format "m.nop" (e.g. "1.23a")                                            */
/*                                                                                 */
/* If the function fails, the returned string is empty.                            */
/*                                                                                 */
/***********************************************************************************/
wstring CVersionHelper::FormatVersion(wstring cs)
{
	wstring csRet;
	if (!cs.length())
	{
		rtrim(cs);
		int iPos = cs.find(',');
		if (iPos == -1)
			return TEXT("");
		ltrim(cs);
		rtrim(cs);
		csRet.Format(TEXT("%s."), cs.copy(iPos));

		while (1)
		{
			cs = cs.Mid(iPos + 1);
			ltrim(cs);
			iPos = cs.find(',');
			if (iPos == -1)
			{
				csRet += cs;
				break;
			}
			csRet += cs.Left(iPos);
		}
	}

	return csRet;
}

/***********************************************************************************/
/*                                                                                 */
/* Class:   CGlobalFunctions                                                       */
/* Method:  GetFileVersionX                                                        */
/*                                                                                 */
/* Parameters:                                                                     */
/* -----------                                                                     */
/*                                                                                 */
/* Return Values:                                                                  */
/* --------------                                                                  */
/* If the function succeeds, the return value is a wstring containing the           */
/* "FileVersion" in the format "m.nop" (e.g. "1.23a")                              */
/*                                                                                 */
/* If the function fails, the returned wstring is empty.                            */
/*                                                                                 */
/***********************************************************************************/
wstring CVersionHelper::GetFileVersionX()
{
	if (!m_csFileVersion.length())
	{
		wstring csVersion = FormatVersion(GetVersionInfo(NULL, TEXT("FileVersion")));
		m_csFileVersion.Format(TEXT("Version %s (Build %s)"), csVersion, GetVersionInfo(NULL, TEXT("SpecialBuild")));
	}

	return m_csFileVersion;
}

/***********************************************************************************/
/*                                                                                 */
/* Class:   CGlobalFunctions                                                       */
/* Method:  GetFileVersionX                                                        */
/*                                                                                 */
/* Parameters:                                                                     */
/* -----------                                                                     */
/*                                                                                 */
/* Return Values:                                                                  */
/* --------------                                                                  */
/* If the function succeeds, the return value is a string containing the           */
/* "ProductVersion" in the format "m.nop" (e.g. "1.23a")                           */
/*                                                                                 */
/* If the function fails, the returned string is empty.                            */
/*                                                                                 */
/***********************************************************************************/
wstring CVersionHelper::GetProductVersionX()
{
	if (!m_csProductVersion.length())
		m_csProductVersion = FormatVersion(GetVersionInfo(NULL, TEXT("ProductVersion")));

	return m_csProductVersion;
}

================================================
FILE: VersionHelper.h
================================================
#pragma once
#include <xstring>
#include <windows.h>
#include <algorithm>
#include <cctype>
using namespace std;

class CVersionHelper
{
public:
	CVersionHelper();
	virtual ~CVersionHelper();

public:
	wstring GetFileVersionX();
	wstring GetProductVersionX();
	wstring GetVersionInfo(HMODULE hLib, wstring csEntry);
	wstring FormatVersion(wstring cs);

private:
	wstring m_csFileVersion;
	wstring m_csProductVersion;

};


// cited: https://stackoverflow.com/questions/216823/whats-the-best-way-to-trim-stdstring
// trim from start (in place)
static inline void ltrim(std::wstring &s) {
	s.erase(s.begin(), std::find_if(s.begin(), s.end(), [](int ch) {
		return !std::isspace(ch);
	}));
}

// trim from end (in place)
static inline void rtrim(std::wstring &s) {
	s.erase(std::find_if(s.rbegin(), s.rend(), [](int ch) {
		return !std::isspace(ch);
	}).base(), s.end());
}

================================================
FILE: array.h
================================================
#pragma once

#ifndef _INC_SHLWAPI
#define NO_SHLWAPI_STRFCNS
#define NO_SHLWAPI_PATH
#define NO_SHLWAPI_REG
#define NO_SHLWAPI_STREAM
#define NO_SHLWAPI_GDI
#include <shlwapi.h>
#endif

#if !defined(_INC_SHLWAPI) || defined(NOSHLWAPI) || defined(NO_SHLWAPI_PATH)
BOOL WINAPI PathIsRelative(LPCTSTR pszPath);
BOOL WINAPI PathRemoveFileSpec(LPTSTR pszPath);
LPTSTR WINAPI PathFindExtension(LPCTSTR pszPath);
LPTSTR WINAPI PathAddBackslash(LPTSTR pszPath);
LPTSTR WINAPI PathCombine(LPTSTR pszDest, LPCTSTR pszDir, LPCTSTR pszFile);
#endif

#include <atlbase.h>

template <class T>
class CArray : public CSimpleArray<T>
{
public:
	T* Begin() const
	{
		return m_aT;
	}
	T* End() const
	{
		return m_aT + m_nSize;
	}
};

template <class T>
class CValArray : public CSimpleValArray<T>
{
public:
	T* Begin() const
	{
		return m_aT;
	}
	T* End() const
	{
		return m_aT + m_nSize;
	}
};

template <class T>
class CPtrArray : public CValArray<T*>
{
};

template <class TKey, class TVal>
class CMap : public CSimpleMap<TKey, TVal>
{
};


================================================
FILE: build.vc2005.bat
================================================
@echo off

setlocal

set INCLUDE=..\..\..\freetype2\include;%INCLUDE%
set LIB=..\..;%LIB%

:go
nmake -f Makefile.vc2005 %*
if errorlevel 1 goto err
goto end

:err
pause
goto go

:end
endlocal
rem pause


================================================
FILE: cache.cpp
================================================
#include "override.h"

//CreateDIB计数,将在绘制下列次数后更新DIB区
#define BITMAP_REDUCE_COUNTER	256//默认1024


HDC CBitmapCache::CreateDC(HDC dc)
{
	if(!m_hdc) {
		m_hdc = CreateCompatibleDC(dc);
		m_exthdc = dc;
	}
	return m_hdc;
}

HBITMAP CBitmapCache::CreateDIB(int width, int height, BYTE** lplpPixels)
{
	SIZE& dibSize = m_dibSize;
	width  = (width + 3) & ~3;

	if (dibSize.cx >= width && dibSize.cy >= height) {
		if (++m_counter < BITMAP_REDUCE_COUNTER) {
			*lplpPixels = m_lpPixels;
			return m_hbmp;
		}
		//カウンタ超過
		//ただしサイズが全く同じなら再生成しない
		if (dibSize.cx == width && dibSize.cy == height) {
			m_counter   = 0;
			*lplpPixels = m_lpPixels;
			return m_hbmp;
		}
	} else {
		if (dibSize.cx > width) {
			width  = dibSize.cx;
		}
		if (dibSize.cy > height) {
			height = dibSize.cy;
		}
	}

	BITMAPINFOHEADER bmiHeader = { sizeof(BITMAPINFOHEADER), width, -height, 1, 32, BI_RGB };
	HBITMAP hbmpNew = CreateDIBSection(CreateDC(m_exthdc), (BITMAPINFO*)&bmiHeader, DIB_RGB_COLORS, (LPVOID*)lplpPixels, NULL, 0);
	if (!hbmpNew) {
		return NULL;
	}
	TRACE(_T("width=%d, height=%d\n"), width, height);

	//メモリ不足等でhbmpNew==NULLの場合を想定し、
	//成功したときのみキャッシュを更新
	if (m_hbmp) {
		DeleteBitmap(m_hbmp);
	}

	m_hbmp		= hbmpNew;
	dibSize.cx	= width;
	dibSize.cy	= height;
	//CreateDIBSectionは多分ページ境界かセグメント境界
	m_lpPixels	= *lplpPixels;
	m_counter	= 0;
	return m_hbmp;
}

void CBitmapCache::FillSolidRect(COLORREF rgb, const RECT* lprc)
{

	if (!m_brush || rgb!=m_bkColor)
	{
		if (m_brush)
			DeleteObject(m_brush);
		m_brush = CreateSolidBrush(rgb);
		m_bkColor = rgb;
	}
	FillRect(m_hdc, lprc, m_brush);


	//DrawHorizontalLine(lprc->left, lprc->top, lprc->right, rgb, lprc->bottom - lprc->top);
/*	LPBYTE lpPixels = m_lpPixels;
	const DWORD dwBmpBytes		= m_dibSize.cx * m_dibSize.cy;
	rgb = RGB2DIB(rgb);

	//TODO: MMX or SSE化
	__asm {
		mov edi, dword ptr [lpPixels]
		mov ecx, dword ptr [dwBmpBytes]
		mov eax, dword ptr [rgb]
		cld
		rep stosd
	}*/
//	DWORD* p = (DWORD*)m_lpPixels;
//	DWORD* const pend = p + dwBmpBytes;
//	while (p < pend) {
//		*p++ = rgb;
//	}
}

//水平線を引く
//(X1,Y1)           (X2,Y1)
//   +-----------------+   ^
//   |       rgb       |   | width
//   +-----------------+   v
void CBitmapCache::DrawHorizontalLine(int X1, int Y1, int X2, COLORREF rgb, int width)
{
	if (!m_dibSize.cx || !m_dibSize.cy) {
		return;
	}

	if (X1 > X2) {
		const int xx = X1;
		X1 = X2;
		X2 = xx;
	}

	//クリッピング
	const int xSize = m_dibSize.cx;
	const int ySize = m_dibSize.cy;
	X1 = Bound(X1, 0, xSize);
	X2 = Bound(X2, 0, xSize);
	Y1 = Bound(Y1, 0, ySize);
	width = Max(width, 1);
	const int Y2 = Bound(Y1 + width, 0, ySize);

	rgb = RGB2DIB(rgb);

	DWORD* lpPixels = (DWORD*)m_lpPixels + (Y1 * xSize + X1);
	const int Xd = X2 - X1;
	const int Yd = Y2 - Y1;
/*	for (int yy=Y1; yy<Y2; yy++) {
		for (int xx=X1; xx<X2; xx++) {
			_SetPixelV(xx, yy, rgb);
		}
	}

	for (int yy=Y1; yy<Y2; yy++, lpPixels += xSize) {
		__asm {
			mov edi, dword ptr [lpPixels]
			mov ecx, dword ptr [Xd]
			mov eax, dword ptr [rgb]
			cld
			rep stosd
		}
	}*/

/*#ifdef _M_IX86
	//無意味にアセンブリ化
	__asm {
		mov ebx, dword ptr [Yd]
		mov edx, dword ptr [lpPixels]
		mov esi, dword ptr [xSize]
		cld
L1:
		mov edi, edx
		mov ecx, dword ptr [Xd]
		mov eax, dword ptr [rgb]
		rep stosd
		lea edx, dword ptr [edx+esi*4]
		dec ebx
		jnz L1
	}
#else*/	//对于64位系统,使用C语言
	for (int yy=Y1; yy<Y2; yy++) {
		for (int xx=X1; xx<X2; xx++) {
			*( (DWORD*)m_lpPixels + (yy * xSize + xx) ) = rgb;
		}
	}
//#endif

}


================================================
FILE: cache.h
================================================
#pragma once

template <int BUFSIZE, bool ignoreCase>
class StringHashT
{
private:
	DWORD	m_dwHash;
	TCHAR	m_szBuffer[BUFSIZE];

	void UpdateHash()
	{
		DWORD dw = 0;
		LPWSTR p, end = m_szBuffer + BUFSIZE;
		for (p = m_szBuffer; *p && p < end; p++) {
			dw <<= 3;
			if (ignoreCase) {
				dw ^= _totlower(*p);
			} else {
				dw ^= *p;
			}
		}
		m_dwHash = dw;
	}

public:
	StringHashT()
		: m_dwHash(0)
	{
		ZeroMemory(m_szBuffer, sizeof(m_szBuffer));
	}
	StringHashT(LPCTSTR psz)
	{
		this->StringHashT::StringHashT();
		_tcsncpy(m_szBuffer, psz, BUFSIZE - 1);
		UpdateHash();
	}

	bool operator ==(const StringHashT<BUFSIZE, ignoreCase>& x) const
	{
		if (ignoreCase) {
			return !(m_dwHash != x.m_dwHash || _tcsicmp(m_szBuffer, x.m_szBuffer));
		} else {
			return !(m_dwHash != x.m_dwHash || _tcscmp(m_szBuffer, x.m_szBuffer));
		}
	}

	DWORD Hash() const
	{
		return m_dwHash;
	}
	LPCTSTR c_str() const
	{
		return m_szBuffer;
	}
};

typedef StringHashT<LF_FACESIZE,true>	StringHashFont;
typedef StringHashT<MAX_PATH,true>		StringHashModule;


//COLORREF(RR GG BB 00) を DIB32(BB GG RR 00) に変換
#define RGB2DIB(rgb)	RGB(GetBValue(rgb), GetGValue(rgb), GetRValue(rgb))
#define DIB2RGB(dib)	RGB2DIB(dib)

// ExtTextOutWのビットマップキャッシュ
class CBitmapCache
{
private:
	HBRUSH	m_brush;
	HDC		m_hdc;
	HDC		m_exthdc;
	HBITMAP	m_hbmp;
	BYTE*	m_lpPixels;
	SIZE	m_dibSize;
	int		m_counter;
	DWORD*	m_CurrentPixel;
	COLORREF m_bkColor;

	NOCOPY(CBitmapCache);

public:
	CBitmapCache()
		: m_hdc(NULL)
		, m_hbmp(NULL)
		, m_lpPixels(NULL)
		, m_counter(0)
		, m_CurrentPixel(NULL)
		, m_exthdc(NULL)
		, m_brush(NULL)
		, m_bkColor(NULL)
	{
		m_dibSize.cx = m_dibSize.cy = 0;
	}

	~CBitmapCache()
	{
		if (m_hdc) {
			DeleteDC(m_hdc);
		}
		if (m_hbmp)	{
			DeleteBitmap(m_hbmp);
		}
		if (m_brush) 
			DeleteObject(m_brush);
		m_hdc = NULL;
		m_hbmp = NULL;
		m_brush = NULL;
		m_dibSize.cx = 0;
		m_dibSize.cy = 0;
	}

	const SIZE& Size() const
	{
		return m_dibSize;
	}
	BYTE* GetPixels()
	{
		Assert(m_lpPixels != NULL);
		return m_lpPixels;
	}

	DWORD GetPixel(int X, int Y) {
		if ((unsigned)X >= (unsigned)m_dibSize.cx || (unsigned)Y >= (unsigned)m_dibSize.cy) {
			return CLR_INVALID;
		}
		DWORD* lpPixels = (DWORD*)m_lpPixels;
		m_CurrentPixel = &lpPixels[Y * m_dibSize.cx + X];
		DWORD dib = *m_CurrentPixel;
		return DIB2RGB(dib);
	}

	void SetPixelV(int X, int Y, COLORREF rgb) {
		// if ((unsigned)X >= (unsigned)m_dibSize.cx || (unsigned)Y >= (unsigned)m_dibSize.cy) {
		// 	return;
		// }
		DWORD* lpPixels = (DWORD*)m_lpPixels;
		m_CurrentPixel = &lpPixels[Y * m_dibSize.cx + X];
		SetCurrentPixel(rgb);
	}

	void SetCurrentPixel(COLORREF rgb) {
		*m_CurrentPixel = RGB2DIB(rgb);
	}

	//本体はcache.cpp
	HDC CreateDC(HDC dc);
	HBITMAP CreateDIB(int width, int height, BYTE** lplpPixels);
	void FillSolidRect(COLORREF rgb, const RECT* lprc);
	void DrawHorizontalLine(int X1, int Y1, int X2, COLORREF rgb, int width);

};


================================================
FILE: colorinvert.h
================================================
#pragma once
//formula: (x+482)^2+(y+481)^2=880^2
unsigned char InvertTable[260] = { 255,255,254,253,253,252,251,251,250,249,249,248,247,247,246,245,245,244,243,242,242,241,240,240,239,238,238,237,236,235,235,234,233,233,232,231,230,230,229,228,227,227,226,225,224,224,223,222,221,221,220,219,218,218,217,216,215,215,214,213,212,211,211,210,209,208,208,207,206,205,204,204,203,202,201,200,199,199,198,197,196,195,195,194,193,192,191,190,189,189,188,187,186,185,184,183,183,182,181,180,179,178,177,176,176,175,174,173,172,171,170,169,168,167,166,166,165,164,163,162,161,160,159,158,157,156,155,154,153,152,151,150,149,148,147,146,145,144,143,143,142,141,140,138,137,136,135,134,133,132,131,130,129,128,127,126,125,124,123,122,121,120,119,118,117,115,114,113,112,111,110,109,108,107,106,104,103,102,101,100,99,98,96,95,94,93,92,91,90,88,87,86,85,84,82,81,80,79,78,76,75,74,73,71,70,69,68,66,65,64,63,61,60,59,58,56,55,54,52,51,50,48,47,46,44,43,42,40,39,38,36,35,33,32,31,29,28,26,25,24,22,21,19,18,16,15,13,12,10,9,7,6,4,3,1,0,0,0,0,0};


================================================
FILE: common.cpp
================================================
#include "common.h"

std::wstring to_utf16le(const std::wstring& input) {
	std::wstring utf16_string;
	int len = input.length();
	char* content = (char*)input.c_str();
	utf16_string.reserve(len);
	for (size_t i = 0; i < len; i += 2) {
		char16_t code_unit = (static_cast<char16_t>(content[i]) << 8) |
			static_cast<char16_t>(content[i + 1]);
		utf16_string.push_back(code_unit);
	}
	return utf16_string;
}

std::wstring to_wide_string(const std::string& input)
{
	std::wstring_convert<std::codecvt_utf8<wchar_t>> converter;
	return converter.from_bytes(input);
}
// convert wstring to string 
std::string to_byte_string(const std::wstring& input)
{
	//std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>> converter;
	std::wstring_convert<std::codecvt_utf8<wchar_t>> converter;
	return converter.to_bytes(input);
}

wstring to_lower_case(wstring str) {
	transform(str.begin(), str.end(), str.begin(), ::tolower);
	return str;
}


================================================
FILE: common.h
================================================
#pragma once

#define _CRT_SECURE_NO_DEPRECATE 1
#ifdef _WIN64
#define _WIN32_WINNT _WIN32_WINNT_WIN10
#define WINVER _WIN32_WINNT_VISTA
#else
#define _WIN32_WINNT _WIN32_WINNT_WIN10
#define WINVER _WIN32_WINNT_WIN10
#endif
#define NTDDI_VERSION NTDDI_WIN10_RS3
#define WIN32_LEAN_AND_MEAN 1
#define UNICODE  1
#define _UNICODE 1

#define NOMINMAX
#include <Windows.h>
#include <Uxtheme.h>
#include <usp10.h>
//#include <limits>
#include <functional>
//#include <iterator>
#include <algorithm>
#include <memory>
#include "array.h"
#include <set>
#include "ownedcs.h"
#include "undocAPI.h"
#include <d2d1.h>
#include <d2d1_1.h>
#include <d2d1_3.h>
#include <dwrite.h>
#include <dwrite_1.h>
#include <dwrite_2.h>
#include <dwrite_3.h>
#include <string>
#include <locale>
#include <codecvt>
//#include <wincodec.h>
//#include <wincodecsdk.h>

#define for if(0);else for

#include <tchar.h>
#include <stddef.h>
#define STRSAFE_NO_DEPRECATE
#include <strsafe.h>

#define _CRTDBG_MAP_ALLOC
#include <cstdlib>
#include <malloc.h>
#include <crtdbg.h>

#include <map>
#include <string>
using namespace std;
#ifdef _M_IX86
//#include "optimize/optimize.h"
#endif

#define FONT_MAGIC_NUMBER 0xA8

#define ASSERT			_ASSERTE
#define Assert			_ASSERTE
#ifdef _DEBUG
#define new				new(_NORMAL_BLOCK, __FILE__, __LINE__)
#endif

#ifndef NOP_FUNCTION
#if (_MSC_VER >= 1210)
#define NOP_FUNCTION	__noop
#else
#define NOP_FUNCTION	(void)0
#endif	//_MSC_VER
#endif	//!NOP_FUNCTION
#ifndef C_ASSERT
#define C_ASSERT(e)		typedef char __C_ASSERT__[(e)?1:-1]
#endif	//!C_ASSERT
#ifndef FORCEINLINE
#if (_MSC_VER >= 1200)
#define FORCEINLINE		__forceinline
#else
#define FORCEINLINE		__inline
#endif	//_MSC_VER
#endif	//!FORCEINLINE


void Log(char* Msg);
void Log(wchar_t* Msg);


// convert string to wstring
std::wstring to_wide_string(const std::string & input);

// convert wstring to string 
std::string to_byte_string(const std::wstring & input);

// convert a utf-16be string back to utf-16le string
std::wstring to_utf16le(const std::wstring& input);

wstring to_lower_case(wstring str);

FORCEINLINE HINSTANCE GetDLLInstance()
{
	extern HINSTANCE g_hinstDLL;
	return g_hinstDLL;
}

//排他制御
class CCriticalSectionLock
{
#define MAX_CRITICAL_COUNT 20
private:
	static CRITICAL_SECTION m_cs[MAX_CRITICAL_COUNT];
	friend class CCriticalSectionLockTry;
	int m_index;
public:
	enum {
		CS_LIBRARY,
		CS_CACHEDFONT,
		CS_FONTENG,
		//CS_CMAPCACHE,
		//CS_IMAGECACHE,
		CS_SETTING,
		CS_MAIN,
		CS_FONTCACHE,
		CS_MANAGER,
		CS_CREATEFONT,
		CS_FONTLINK,
		CS_FONTMAP,
		CS_OWNEDCS,
		CS_VIRTMEM,
		CS_DWRITE,
		CS_DCRELATION,
	};
	CCriticalSectionLock(int index=CS_LIBRARY):
	  m_index(index)
	{
		::EnterCriticalSection(&m_cs[index]);
	}
	~CCriticalSectionLock()
	{
		::LeaveCriticalSection(&m_cs[m_index]);
	}
	static void Init()
	{
		for (int i=0;i<MAX_CRITICAL_COUNT;i++)
			::InitializeCriticalSection(&m_cs[i]);
	}
	static void Term()
	{
		for (int i=0;i<MAX_CRITICAL_COUNT;i++)
			::DeleteCriticalSection(&m_cs[i]);
	}
};

#ifdef _DEBUG
#define TRACE	_Trace
#include <stdarg.h>	//va_list
#include <stdio.h>	//_vsnwprintf

static void _Trace(LPCTSTR pszFormat, ...)
{
	CCriticalSectionLock __lock;
	va_list argptr;
	va_start(argptr, pszFormat);
	//w(v)sprintfは1024文字以上返してこない
	TCHAR szBuffer[10240];
	wvsprintf(szBuffer, pszFormat, argptr);

	//デバッガをアタッチしてる時はデバッガにメッセージを出す
	//if (IsDebuggerPresent()) {
	OutputDebugString(szBuffer);
	return;
	//}

	extern HANDLE g_hfDbgText;
	HANDLE hf = g_hfDbgText;
	if (!hf) {
		TCHAR szFileName[MAX_PATH+16];
		GetModuleFileName(GetDLLInstance(), szFileName, MAX_PATH);
		TCHAR *p1 = _tcsrchr(szFileName, _T('\\'));
		if (p1 && p1 > szFileName) {
			*p1 = 0;
			TCHAR *p2 = _tcsrchr(szFileName, _T('\\'));
			if (p2)
				memmove(p2 + 1, p1 + 1, (_tcslen(p1) + 1) * sizeof(TCHAR));
		}
		_tcscpy(szFileName + _tcslen(szFileName) - 4, L"_dbg.txt");
		g_hfDbgText = hf = CreateFile(szFileName, GENERIC_WRITE, FILE_SHARE_READ, NULL, CREATE_ALWAYS, 0, NULL);
		if(hf != INVALID_HANDLE_VALUE) {
			SetFilePointer(hf, 0, NULL, FILE_BEGIN);
#ifdef _UNICODE
			WORD w = 0xfeff;
			DWORD cb;
			WriteFile(hf, &w, sizeof(WORD), &cb, NULL);
#endif
		}
	}
	if(hf != INVALID_HANDLE_VALUE) {
		DWORD cb;
		WriteFile(hf, szBuffer, _tcslen(szBuffer) * sizeof(TCHAR), &cb, NULL);
	}
}
#else	//!_DEBUG
#define TRACE	NOP_FUNCTION
//↓PSDK 2003R2のwinnt.h
//#ifndef NOP_FUNCTION
//#if (_MSC_VER >= 1210)
//#define NOP_FUNCTION __noop
//#else
//#define NOP_FUNCTION (void)0
//#endif
//#endif
#endif	//_DEBUG

//TRACEマクロ
//使用例: TRACE(_T("cx: %d\n"), cx);
#ifdef USE_TRACE
#define TRACE2	_Trace2
#define TRACE2_STR	_Trace2_Str
#define TRACE2_BIN	_Trace2_Bin
#include <stdarg.h>	//va_list
#include <stdio.h>	//_vsnwprintf

static void _Trace2(LPCTSTR pszFormat, ...)
{
	CCriticalSectionLock __lock;
	va_list argptr;
	va_start(argptr, pszFormat);
	//w(v)sprintfは1024文字以上返してこない
	TCHAR szBuffer[1024];
	wvsprintf(szBuffer, pszFormat, argptr);
	OutputDebugString(szBuffer);
}

static void _Trace2_Bin(LPWSTR func, int line, LPVOID lpString, UINT cbString)
{
	const PBYTE srcp = (const PBYTE)lpString;
	WCHAR buf[0x1000];
	LPWSTR p = buf;
	for (UINT i = 0; i < 32 && i < cbString; ++i) {
		wsprintf(p, L"%02x ", srcp[i]);
		p += lstrlen(p);
	}
	*p = 0;
	TRACE(_T("%s %d: %d %08x %s\n"), func, line, cbString, lpString, buf);
}

static void _Trace2_Str(LPWSTR func, int line, LPCWSTR lpString, UINT cbString)
{
	WCHAR buf[0x1000];
	UINT len = Min(cbString, countof(buf) - 1);
	lstrcpyn(buf, lpString, len + 1);
	buf[countof(buf) - 1] = 0;
	TRACE(_T("%s %d: %d %s\n"), func, line, cbString, buf);
	LPWSTR p = buf;
	for (UINT i = 0; i < 32 && i < cbString; ++i) {
		wsprintf(p, L"%04x ", lpString[i]);
		p += lstrlen(p);
	}
	TRACE(_T("%s %d: %d %08x %s\n"), func, line, cbString, lpString, buf);
}

#else	//!USE_TRACE
#define TRACE2	NOP_FUNCTION
#define TRACE2_STR	NOP_FUNCTION
#define TRACE2_BIN	NOP_FUNCTION
#endif	//USE_TRACE


class COwnedCriticalSectionLock
{
private:
	static OWNED_CRITIAL_SECTION m_cs[2];
	WORD FOwner;
	int m_index;
public:
	enum {
		OCS_FREETYPE,
		OCS_DC
	};
	COwnedCriticalSectionLock():FOwner(0), m_index(OCS_FREETYPE)
	{
		EnterOwnedCritialSection(&m_cs[m_index], FOwner);
	}
	COwnedCriticalSectionLock(WORD Owner, int index=OCS_FREETYPE):FOwner(Owner), m_index(index)
	{
		EnterOwnedCritialSection(&m_cs[m_index], Owner);
	}
	~COwnedCriticalSectionLock()
	{
		LeaveOwnedCritialSection(&m_cs[m_index], FOwner);
	}
	static void Init()
	{
		for (int i=0;i<2;i++)
		{
			InitializeOwnedCritialSection(&m_cs[i]);
		}
	}
	static void Term()
	{
		for (int i=0;i<2;i++)
		{
			DeleteOwnedCritialSection(&m_cs[i]);
		}
	}
};

class CThreadCounter
{
private:
	static LONG interlock;
public:
	CThreadCounter()
	{
		InterlockedIncrement(&interlock);
	}
	~CThreadCounter()
	{
		InterlockedDecrement(&interlock);
	}
	static void Init()
	{
		interlock = 0;
	}
	static int Count()
	{
		return InterlockedExchange(&interlock, interlock);
	}
};

class CCriticalSectionLockTry
{
public:
	BOOL TryEnter(int index=CCriticalSectionLock::CS_LIBRARY)
	{
		return ::TryEnterCriticalSection(&CCriticalSectionLock::m_cs[index]);
	}
	int CritalCount(int index=CCriticalSectionLock::CS_LIBRARY)
	{
		return CCriticalSectionLock::m_cs[index].RecursionCount;
	}
	void Leave(int index=CCriticalSectionLock::CS_LIBRARY)
	{
		::LeaveCriticalSection(&CCriticalSectionLock::m_cs[index]);
	}
};

// 使用後はfreeで開放する事
LPWSTR _StrDupExAtoW(LPCSTR pszMB, int cchMB, LPWSTR pszStack, int cchStack, int* pcchWC, int nACP = CP_ACP);
static inline LPWSTR _StrDupAtoW(LPCSTR pszMB, int cchMB = -1, int* pcchWC = NULL)
{
	return _StrDupExAtoW(pszMB, cchMB, NULL, 0, pcchWC);
}

// useful macros
#define NOCOPY(T)					T(const T&); T& operator=(const T&)
#define countof(array)				(sizeof(array)/sizeof(array[0]))
#define sizeof_struct(s, m)			(((int)((char*)(&((s*)0)->m) - ((char*)((s*)0)))) + sizeof(((s*)0)->m))
#ifndef offsetof
#define offsetof(s,m)				(size_t)&(((s*)0)->m)
#endif
#ifdef _DEBUG
#define Verify(expr)				_ASSERTE(expr)
#else
#define Verify(expr)				(expr)
#endif

template<typename T> FORCEINLINE T Min(T x, T y) { return (x < y) ? x : y; }
template<typename T> FORCEINLINE T Max(T x, T y) { return (y < x) ? x : y; }
template<typename T> FORCEINLINE T Bound(T x, T m, T M) { return (x < m) ? m : ((x > M) ? M : x); }
template<typename T> FORCEINLINE int Sgn(T x, T y) { return (x > y) ? 1 : ((x < y) ? -1 : 0); }


//型チェック機能つきDeleteXXX/SelectXXX
//SelectObject/DeleteObjectは使用できなくなる

#ifdef _DEBUG
#undef DeletePen
#undef DeleteBrush
#undef DeleteRgn
#undef DeleteFont
#undef DeleteBitmap
#undef SelectPen
#undef SelectBrush
#undef SelectRgn
#undef SelectFont
#undef SelectBitmap

#define _IsValidPen(hPen)		\
	(hPen == NULL || ::GetObjectType(hPen) == OBJ_PEN || ::GetObjectType(hPen) == OBJ_EXTPEN)
#define _IsValidBrush(hBrush)	\
	(hBrush == NULL || ::GetObjectType(hBrush) == OBJ_BRUSH)
#define _IsValidRgn(hRgn)		\
	(hRgn == NULL || ::GetObjectType(hRgn) == OBJ_REGION)
#define _IsValidFont(hFont)		\
	(hFont == NULL || ::GetObjectType(hFont) == OBJ_FONT)
#define _IsValidBitmap(hBitmap)	\
	(hBitmap == NULL || ::GetObjectType(hBitmap) == OBJ_BITMAP)

#define DEFINE_DELETE_FUNCTION(type, name) \
	FORCEINLINE BOOL WINAPI Delete##name(type h##name) \
	{ \
		_ASSERTE(_IsValid##name(h##name)); \
		return ::DeleteObject(h##name); \
	}

#define DEFINE_SELECT_FUNCTION(type, name) \
	FORCEINLINE type WINAPI Select##name(HDC hDC, type h##name) \
	{ \
		_ASSERTE(hDC != NULL); \
		if (!_IsValid##name(h##name)) { \
		TRACE(_T("Select object %x for DC %x"), (DWORD)h##name, (DWORD)hDC); \
			}; \
		return (type)::SelectObject(hDC, h##name); \
	}

DEFINE_DELETE_FUNCTION(HPEN,	Pen)
DEFINE_DELETE_FUNCTION(HBRUSH,	Brush)
DEFINE_DELETE_FUNCTION(HRGN,	Rgn)
DEFINE_DELETE_FUNCTION(HFONT,	Font)
DEFINE_DELETE_FUNCTION(HBITMAP,	Bitmap)

DEFINE_SELECT_FUNCTION(HPEN,	Pen)
DEFINE_SELECT_FUNCTION(HBRUSH,	Brush)
DEFINE_SELECT_FUNCTION(HRGN,	Rgn)
DEFINE_SELECT_FUNCTION(HFONT,	Font)
DEFINE_SELECT_FUNCTION(HBITMAP,	Bitmap)

#undef _IsValidPen
#undef _IsValidBrush
#undef _IsValidRgn
#undef _IsValidFont
#undef _IsValidBitmap
#undef DEFINE_DELETE_FUNCTION
#undef DEFINE_SELECT_FUNCTION

#if (_MSC_VER >= 1300)
#pragma deprecated(DeleteObject)
#pragma deprecated(SelectObject)
#else	//_MSC_VER < 1300
#undef DeleteObject
#define DeleteObject		DeleteObject_instead_use_DeleteXXX
#undef SelectObject
#define SelectObject		SelectObject_instead_use_DeleteXXX
#endif	//_MSC_VER

#else	//!_DEBUG
#ifndef _INC_WINDOWSX
#define DeletePen			::DeleteObject
#define DeleteBrush			::DeleteObject
#define DeleteRgn			::DeleteObject
#define DeleteFont			::DeleteObject
#define DeleteBitmap		::DeleteObject

#define SelectPen(d,o)		(HPEN)::SelectObject(d,o)
#define SelectBrush(d,o)	(HBRUSH)::SelectObject(d,o)
#define SelectRgn(d,o)		(HRGN)::SelectObject(d,o)
#define SelectFont(d,o)		(HFONT)::SelectObject(d,o)
#define SelectBitmap(d,o)	(HBITMAP)::SelectObject(d,o)
#endif	//!_INC_WINDOWSX
#endif	//_DEBUG


//TRACEマクロ
//使用例: TRACE(_T("cx: %d\n"), cx);
#ifndef _WIN64
#ifdef _DEBUG
FORCEINLINE static __int64 GetClockCount()
{
	LARGE_INTEGER cycles;
	__asm {
		rdtsc
		mov cycles.LowPart,  eax
		mov cycles.HighPart, edx
	}
	return cycles.QuadPart;
}

//使用例
//{
//   CDebugElapsedCounter _cntr("hogehoge");
//     : (適当な処理)
//}
//出力例: "hogehoge: 10000 clocks"
class CDebugElapsedCounter
{
private:
	__int64 m_ilClk;
	LPCSTR m_pszName;
public:
	CDebugElapsedCounter(LPCSTR psz)
		: m_ilClk(GetClockCount())
		, m_pszName(psz)
	{
	}
	~CDebugElapsedCounter()
	{
		TRACE(_T("%hs: %u clocks\n"), m_pszName, (DWORD)(GetClockCount() - m_ilClk));
	}
};
#else
class CDebugElapsedCounter
{
public:
	CDebugElapsedCounter(LPCSTR psz)
	{
	}
};
#endif
#endif


//String to int等系列函数的定义
/*
int _StrToInt(LPCTSTR pStr, int nDefault)
{
#define isspace(ch)		(ch == _T('\t') || ch == _T(' '))
#define isdigit(ch)		((_TUCHAR)(ch - _T('0')) <= 9)

	int ret;
	bool neg = false;
	LPCTSTR pStart;

	for (; isspace(*pStr); pStr++);
	switch (*pStr) {
	case _T('-'):
		neg = true;
	case _T('+'):
		pStr++;
		break;
	}

	pStart = pStr;
	ret = 0;
	for (; isdigit(*pStr); pStr++) {
		ret = 10 * ret + (*pStr - _T('0'));
	}

	if (pStr == pStart) {
		return nDefault;
	}
	return neg ? -ret : ret;

#undef isspace
#undef isdigit
}

int _httoi(const TCHAR *value)
{
	struct CHexMap
	{
		TCHAR chr;
		int value;
	};
	const int HexMapL = 16;
	CHexMap HexMap[HexMapL] =
	{
		{'0', 0}, {'1', 1},
		{'2', 2}, {'3', 3},
		{'4', 4}, {'5', 5},
		{'6', 6}, {'7', 7},
		{'8', 8}, {'9', 9},
		{'A', 10}, {'B', 11},
		{'C', 12}, {'D', 13},
		{'E', 14}, {'F', 15}
	};
	TCHAR *mstr = _tcsupr(_tcsdup(value));
	TCHAR *s = mstr;
	int result = 0;
	if (*s == '0' && *(s + 1) == 'X') s += 2;
	bool firsttime = true;
	while (*s != '\0')
	{
		bool found = false;
		for (int i = 0; i < HexMapL; i++)
		{
			if (*s == HexMap[i].chr)
			{
				if (!firsttime) result <<= 4;
				result |= HexMap[i].value;
				found = true;
				break;
			}
		}
		if (!found) break;
		s++;
		firsttime = false;
	}
	free(mstr);
	return result;
}

//atofにデフォルト値を返せるようにしたような物
float _StrToFloat(LPCTSTR pStr, float fDefault)
{
#define isspace(ch)		(ch == _T('\t') || ch == _T(' '))
#define isdigit(ch)		((_TUCHAR)(ch - _T('0')) <= 9)

	int ret_i;
	int ret_d;
	float ret;
	bool neg = false;
	LPCTSTR pStart;

	for (; isspace(*pStr); pStr++);
	switch (*pStr) {
	case _T('-'):
		neg = true;
	case _T('+'):
		pStr++;
		break;
	}

	pStart = pStr;
	ret = 0;
	ret_i = 0;
	ret_d = 1;
	for (; isdigit(*pStr); pStr++) {
		ret_i = 10 * ret_i + (*pStr - _T('0'));
	}
	if (*pStr == _T('.')) {
		pStr++;
		for (; isdigit(*pStr); pStr++) {
			ret_i = 10 * ret_i + (*pStr - _T('0'));
			ret_d *= 10;
		}
	}
	ret = (float)ret_i / (float)ret_d;

	if (pStr == pStart) {
		return fDefault;
	}
	return neg ? -ret : ret;

#undef isspace
#undef isdigit
}*/

void HookD2DDll();
bool HookD2D1();
void HookGdiplus();
void ChangeFileName(LPWSTR lpSrc, int nSize, LPCWSTR lpNewFileName);
std::wstring MakeUniqueFontName(const std::wstring strFullName, const std::wstring strFamilyName, const std::wstring strStyleName);
std::string WstringToString(const std::wstring str);


================================================
FILE: crc32.h
================================================
#pragma once
#ifndef CRC32_H
#define CRC32_H

static unsigned int crc32_tab[] = {
	0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f,
	0xe963a535, 0x9e6495a3,    0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988,
	0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, 0x1db71064, 0x6ab020f2,
	0xf3b97148, 0x84be41de,    0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7,
	0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec,    0x14015c4f, 0x63066cd9,
	0xfa0f3d63, 0x8d080df5,    0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172,
	0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b,    0x35b5a8fa, 0x42b2986c,
	0xdbbbc9d6, 0xacbcf940,    0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59,
	0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423,
	0xcfba9599, 0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924,
	0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d,    0x76dc4190, 0x01db7106,
	0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433,
	0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d,
	0x91646c97, 0xe6635c01, 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e,
	0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950,
	0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65,
	0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7,
	0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0,
	0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa,
	0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f,
	0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81,
	0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a,
	0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, 0xe3630b12, 0x94643b84,
	0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1,
	0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb,
	0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc,
	0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, 0xd6d6a3e8, 0xa1d1937e,
	0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b,
	0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55,
	0x316e8eef, 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236,
	0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe, 0xb2bd0b28,
	0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d,
	0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f,
	0x72076785, 0x05005713, 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38,
	0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242,
	0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777,
	0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69,
	0x616bffd3, 0x166ccf45, 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2,
	0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc,
	0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9,
	0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693,
	0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94,
	0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d
};
class crc32
{
public:
	static const unsigned int getCrc32(unsigned int crc, const void *buf, int size) {
		const unsigned char *p;
		p = (unsigned char *)buf;
		crc = crc ^ ~0U;
		while (size--) {
			crc = crc32_tab[(crc ^ *p++) & 0xFF] ^ (crc >> 8);
		}
		return crc ^ ~0U;
	}
};
#endif


================================================
FILE: detours.h
================================================
/////////////////////////////////////////////////////////////////////////////
//
//  Core Detours Functionality (detours.h of detours.lib)
//
//  Microsoft Research Detours Package, Version 4.0.1
//
//  Copyright (c) Microsoft Corporation.  All rights reserved.
//

#pragma once
#ifndef _DETOURS_H_
#define _DETOURS_H_

#define DETOURS_VERSION     0x4c0c1   // 0xMAJORcMINORcPATCH

//////////////////////////////////////////////////////////////////////////////
//

#undef DETOURS_X64
#undef DETOURS_X86
#undef DETOURS_IA64
#undef DETOURS_ARM
#undef DETOURS_ARM64
#undef DETOURS_BITS
#undef DETOURS_32BIT
#undef DETOURS_64BIT

#if defined(_X86_)
#define DETOURS_X86
#define DETOURS_OPTION_BITS 64

#elif defined(_AMD64_)
#define DETOURS_X64
#define DETOURS_OPTION_BITS 32

#elif defined(_IA64_)
#define DETOURS_IA64
#define DETOURS_OPTION_BITS 32

#elif defined(_ARM_)
#define DETOURS_ARM

#elif defined(_ARM64_)
#define DETOURS_ARM64

#else
#error Unknown architecture (x86, amd64, ia64, arm, arm64)
#endif

#ifdef _WIN64
#undef DETOURS_32BIT
#define DETOURS_64BIT 1
#define DETOURS_BITS 64
// If all 64bit kernels can run one and only one 32bit architecture.
//#define DETOURS_OPTION_BITS 32
#else
#define DETOURS_32BIT 1
#undef DETOURS_64BIT
#define DETOURS_BITS 32
// If all 64bit kernels can run one and only one 32bit architecture.
//#define DETOURS_OPTION_BITS 32
#endif

#define VER_DETOURS_BITS    DETOUR_STRINGIFY(DETOURS_BITS)

//////////////////////////////////////////////////////////////////////////////
//

#if (_MSC_VER < 1299)
typedef LONG LONG_PTR;
typedef ULONG ULONG_PTR;
#endif

///////////////////////////////////////////////// SAL 2.0 Annotations w/o SAL.
//
//  These definitions are include so that Detours will build even if the
//  compiler doesn't have full SAL 2.0 support.
//
#ifndef DETOURS_DONT_REMOVE_SAL_20

#ifdef DETOURS_TEST_REMOVE_SAL_20
#undef _Analysis_assume_
#undef _Benign_race_begin_
#undef _Benign_race_end_
#undef _Field_range_
#undef _Field_size_
#undef _In_
#undef _In_bytecount_
#undef _In_count_
#undef _In_opt_
#undef _In_opt_bytecount_
#undef _In_opt_count_
#undef _In_opt_z_
#undef _In_range_
#undef _In_reads_
#undef _In_reads_bytes_
#undef _In_reads_opt_
#undef _In_reads_opt_bytes_
#undef _In_reads_or_z_
#undef _In_z_
#undef _Inout_
#undef _Inout_opt_
#undef _Inout_z_count_
#undef _Out_
#undef _Out_opt_
#undef _Out_writes_
#undef _Outptr_result_maybenull_
#undef _Readable_bytes_
#undef _Success_
#undef _Writable_bytes_
#undef _Pre_notnull_
#endif

#if defined(_Deref_out_opt_z_) && !defined(_Outptr_result_maybenull_)
#define _Outptr_result_maybenull_ _Deref_out_opt_z_
#endif

#if defined(_In_count_) && !defined(_In_reads_)
#define _In_reads_(x) _In_count_(x)
#endif

#if defined(_In_opt_count_) && !defined(_In_reads_opt_)
#define _In_reads_opt_(x) _In_opt_count_(x)
#endif

#if defined(_In_opt_bytecount_) && !defined(_In_reads_opt_bytes_)
#define _In_reads_opt_bytes_(x) _In_opt_bytecount_(x)
#endif

#if defined(_In_bytecount_) && !defined(_In_reads_bytes_)
#define _In_reads_bytes_(x) _In_bytecount_(x)
#endif

#ifndef _In_
#define _In_
#endif

#ifndef _In_bytecount_
#define _In_bytecount_(x)
#endif

#ifndef _In_count_
#define _In_count_(x)
#endif

#ifndef _In_opt_
#define _In_opt_
#endif

#ifndef _In_opt_bytecount_
#define _In_opt_bytecount_(x)
#endif

#ifndef _In_opt_count_
#define _In_opt_count_(x)
#endif

#ifndef _In_opt_z_
#define _In_opt_z_
#endif

#ifndef _In_range_
#define _In_range_(x,y)
#endif

#ifndef _In_reads_
#define _In_reads_(x)
#endif

#ifndef _In_reads_bytes_
#define _In_reads_bytes_(x)
#endif

#ifndef _In_reads_opt_
#define _In_reads_opt_(x)
#endif

#ifndef _In_reads_opt_bytes_
#define _In_reads_opt_bytes_(x)
#endif

#ifndef _In_reads_or_z_
#define _In_reads_or_z_
#endif

#ifndef _In_z_
#define _In_z_
#endif

#ifndef _Inout_
#define _Inout_
#endif

#ifndef _Inout_opt_
#define _Inout_opt_
#endif

#ifndef _Inout_z_count_
#define _Inout_z_count_(x)
#endif

#ifndef _Out_
#define _Out_
#endif

#ifndef _Out_opt_
#define _Out_opt_
#endif

#ifndef _Out_writes_
#define _Out_writes_(x)
#endif

#ifndef _Outptr_result_maybenull_
#define _Outptr_result_maybenull_
#endif

#ifndef _Writable_bytes_
#define _Writable_bytes_(x)
#endif

#ifndef _Readable_bytes_
#define _Readable_bytes_(x)
#endif

#ifndef _Success_
#define _Success_(x)
#endif

#ifndef _Pre_notnull_
#define _Pre_notnull_
#endif

#ifdef DETOURS_INTERNAL

#pragma warning(disable:4615) // unknown warning type (suppress with older compilers)

#ifndef _Benign_race_begin_
#define _Benign_race_begin_
#endif

#ifndef _Benign_race_end_
#define _Benign_race_end_
#endif

#ifndef _Field_size_
#define _Field_size_(x)
#endif

#ifndef _Field_range_
#define _Field_range_(x,y)
#endif

#ifndef _Analysis_assume_
#define _Analysis_assume_(x)
#endif

#endif // DETOURS_INTERNAL
#endif // DETOURS_DONT_REMOVE_SAL_20

//////////////////////////////////////////////////////////////////////////////
//
#ifndef GUID_DEFINED
#define GUID_DEFINED
typedef struct  _GUID
{
    DWORD Data1;
    WORD Data2;
    WORD Data3;
    BYTE Data4[ 8 ];
} GUID;

#ifdef INITGUID
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
        const GUID name \
                = { l, w1, w2, { b1, b2,  b3,  b4,  b5,  b6,  b7,  b8 } }
#else
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
    const GUID name
#endif // INITGUID
#endif // !GUID_DEFINED

#if defined(__cplusplus)
#ifndef _REFGUID_DEFINED
#define _REFGUID_DEFINED
#define REFGUID             const GUID &
#endif // !_REFGUID_DEFINED
#else // !__cplusplus
#ifndef _REFGUID_DEFINED
#define _REFGUID_DEFINED
#define REFGUID             const GUID * const
#endif // !_REFGUID_DEFINED
#endif // !__cplusplus

#ifndef ARRAYSIZE
#define ARRAYSIZE(x)    (sizeof(x)/sizeof(x[0]))
#endif

//
//////////////////////////////////////////////////////////////////////////////

#ifdef __cplusplus
extern "C" {
#endif // __cplusplus

/////////////////////////////////////////////////// Instruction Target Macros.
//
#define DETOUR_INSTRUCTION_TARGET_NONE          ((PVOID)0)
#define DETOUR_INSTRUCTION_TARGET_DYNAMIC       ((PVOID)(LONG_PTR)-1)
#define DETOUR_SECTION_HEADER_SIGNATURE         0x00727444   // "Dtr\0"

extern const GUID DETOUR_EXE_RESTORE_GUID;
extern const GUID DETOUR_EXE_HELPER_GUID;

#define DETOUR_TRAMPOLINE_SIGNATURE             0x21727444  // Dtr!
typedef struct _DETOUR_TRAMPOLINE DETOUR_TRAMPOLINE, *PDETOUR_TRAMPOLINE;

/////////////////////////////////////////////////////////// Binary Structures.
//
#pragma pack(push, 8)
typedef struct _DETOUR_SECTION_HEADER
{
    DWORD       cbHeaderSize;
    DWORD       nSignature;
    DWORD       nDataOffset;
    DWORD       cbDataSize;

    DWORD       nOriginalImportVirtualAddress;
    DWORD       nOriginalImportSize;
    DWORD       nOriginalBoundImportVirtualAddress;
    DWORD       nOriginalBoundImportSize;

    DWORD       nOriginalIatVirtualAddress;
    DWORD       nOriginalIatSize;
    DWORD       nOriginalSizeOfImage;
    DWORD       cbPrePE;

    DWORD       nOriginalClrFlags;
    DWORD       reserved1;
    DWORD       reserved2;
    DWORD       reserved3;

    // Followed by cbPrePE bytes of data.
} DETOUR_SECTION_HEADER, *PDETOUR_SECTION_HEADER;

typedef struct _DETOUR_SECTION_RECORD
{
    DWORD       cbBytes;
    DWORD       nReserved;
    GUID        guid;
} DETOUR_SECTION_RECORD, *PDETOUR_SECTION_RECORD;

typedef struct _DETOUR_CLR_HEADER
{
    // Header versioning
    ULONG                   cb;
    USHORT                  MajorRuntimeVersion;
    USHORT                  MinorRuntimeVersion;

    // Symbol table and startup information
    IMAGE_DATA_DIRECTORY    MetaData;
    ULONG                   Flags;

    // Followed by the rest of the IMAGE_COR20_HEADER
} DETOUR_CLR_HEADER, *PDETOUR_CLR_HEADER;

typedef struct _DETOUR_EXE_RESTORE
{
    DWORD               cb;
    DWORD               cbidh;
    DWORD               cbinh;
    DWORD               cbclr;

    PBYTE               pidh;
    PBYTE               pinh;
    PBYTE               pclr;

    IMAGE_DOS_HEADER    idh;
    union {
        IMAGE_NT_HEADERS    inh;
        IMAGE_NT_HEADERS32  inh32;
        IMAGE_NT_HEADERS64  inh64;
        BYTE                raw[sizeof(IMAGE_NT_HEADERS64) +
                                sizeof(IMAGE_SECTION_HEADER) * 32];
    };
    DETOUR_CLR_HEADER   clr;

} DETOUR_EXE_RESTORE, *PDETOUR_EXE_RESTORE;

typedef struct _DETOUR_EXE_HELPER
{
    DWORD               cb;
    DWORD               pid;
    DWORD               nDlls;
    CHAR                rDlls[4];
} DETOUR_EXE_HELPER, *PDETOUR_EXE_HELPER;

#pragma pack(pop)

#define DETOUR_SECTION_HEADER_DECLARE(cbSectionSize) \
{ \
      sizeof(DETOUR_SECTION_HEADER),\
      DETOUR_SECTION_HEADER_SIGNATURE,\
      sizeof(DETOUR_SECTION_HEADER),\
      (cbSectionSize),\
      \
      0,\
      0,\
      0,\
      0,\
      \
      0,\
      0,\
      0,\
      0,\
}

/////////////////////////////////////////////////////////////// Helper Macros.
//
#define DETOURS_STRINGIFY(x)    DETOURS_STRINGIFY_(x)
#define DETOURS_STRINGIFY_(x)    #x

///////////////////////////////////////////////////////////// Binary Typedefs.
//
typedef BOOL (CALLBACK *PF_DETOUR_BINARY_BYWAY_CALLBACK)(
    _In_opt_ PVOID pContext,
    _In_opt_ LPCSTR pszFile,
    _Outptr_result_maybenull_ LPCSTR *ppszOutFile);

typedef BOOL (CALLBACK *PF_DETOUR_BINARY_FILE_CALLBACK)(
    _In_opt_ PVOID pContext,
    _In_ LPCSTR pszOrigFile,
    _In_ LPCSTR pszFile,
    _Outptr_result_maybenull_ LPCSTR *ppszOutFile);

typedef BOOL (CALLBACK *PF_DETOUR_BINARY_SYMBOL_CALLBACK)(
    _In_opt_ PVOID pContext,
    _In_ ULONG nOrigOrdinal,
    _In_ ULONG nOrdinal,
    _Out_ ULONG *pnOutOrdinal,
    _In_opt_ LPCSTR pszOrigSymbol,
    _In_opt_ LPCSTR pszSymbol,
    _Outptr_result_maybenull_ LPCSTR *ppszOutSymbol);

typedef BOOL (CALLBACK *PF_DETOUR_BINARY_COMMIT_CALLBACK)(
    _In_opt_ PVOID pContext);

typedef BOOL (CALLBACK *PF_DETOUR_ENUMERATE_EXPORT_CALLBACK)(_In_opt_ PVOID pContext,
                                                             _In_ ULONG nOrdinal,
                                                             _In_opt_ LPCSTR pszName,
                                                             _In_opt_ PVOID pCode);

typedef BOOL (CALLBACK *PF_DETOUR_IMPORT_FILE_CALLBACK)(_In_opt_ PVOID pContext,
                                                        _In_opt_ HMODULE hModule,
                                                        _In_opt_ LPCSTR pszFile);

typedef BOOL (CALLBACK *PF_DETOUR_IMPORT_FUNC_CALLBACK)(_In_opt_ PVOID pContext,
                                                        _In_ DWORD nOrdinal,
                                                        _In_opt_ LPCSTR pszFunc,
                                                        _In_opt_ PVOID pvFunc);

// Same as PF_DETOUR_IMPORT_FUNC_CALLBACK but extra indirection on last parameter.
typedef BOOL (CALLBACK *PF_DETOUR_IMPORT_FUNC_CALLBACK_EX)(_In_opt_ PVOID pContext,
                                                           _In_ DWORD nOrdinal,
                                                           _In_opt_ LPCSTR pszFunc,
                                                           _In_opt_ PVOID* ppvFunc);

typedef VOID * PDETOUR_BINARY;
typedef VOID * PDETOUR_LOADED_BINARY;

//////////////////////////////////////////////////////////// Transaction APIs.
//
LONG WINAPI DetourTransactionBegin(VOID);
LONG WINAPI DetourTransactionAbort(VOID);
LONG WINAPI DetourTransactionCommit(VOID);
LONG WINAPI DetourTransactionCommitEx(_Out_opt_ PVOID **pppFailedPointer);

LONG WINAPI DetourUpdateThread(_In_ HANDLE hThread);

LONG WINAPI DetourAttach(_Inout_ PVOID *ppPointer,
                         _In_ PVOID pDetour);

LONG WINAPI DetourAttachEx(_Inout_ PVOID *ppPointer,
                           _In_ PVOID pDetour,
                           _Out_opt_ PDETOUR_TRAMPOLINE *ppRealTrampoline,
                           _Out_opt_ PVOID *ppRealTarget,
                           _Out_opt_ PVOID *ppRealDetour);

LONG WINAPI DetourDetach(_Inout_ PVOID *ppPointer,
                         _In_ PVOID pDetour);

BOOL WINAPI DetourSetIgnoreTooSmall(_In_ BOOL fIgnore);
BOOL WINAPI DetourSetRetainRegions(_In_ BOOL fRetain);
PVOID WINAPI DetourSetSystemRegionLowerBound(_In_ PVOID pSystemRegionLowerBound);
PVOID WINAPI DetourSetSystemRegionUpperBound(_In_ PVOID pSystemRegionUpperBound);

////////////////////////////////////////////////////////////// Code Functions.
//
PVOID WINAPI DetourFindFunction(_In_ LPCSTR pszModule,
                                _In_ LPCSTR pszFunction);
PVOID WINAPI DetourCodeFromPointer(_In_ PVOID pPointer,
                                   _Out_opt_ PVOID *ppGlobals);
PVOID WINAPI DetourCopyInstruction(_In_opt_ PVOID pDst,
                                   _Inout_opt_ PVOID *ppDstPool,
                                   _In_ PVOID pSrc,
                                   _Out_opt_ PVOID *ppTarget,
                                   _Out_opt_ LONG *plExtra);
BOOL WINAPI DetourSetCodeModule(_In_ HMODULE hModule,
                                _In_ BOOL fLimitReferencesToModule);

///////////////////////////////////////////////////// Loaded Binary Functions.
//
HMODULE WINAPI DetourGetContainingModule(_In_ PVOID pvAddr);
HMODULE WINAPI DetourEnumerateModules(_In_opt_ HMODULE hModuleLast);
PVOID WINAPI DetourGetEntryPoint(_In_opt_ HMODULE hModule);
ULONG WINAPI DetourGetModuleSize(_In_opt_ HMODULE hModule);
BOOL WINAPI DetourEnumerateExports(_In_ HMODULE hModule,
                                   _In_opt_ PVOID pContext,
                                   _In_ PF_DETOUR_ENUMERATE_EXPORT_CALLBACK pfExport);
BOOL WINAPI DetourEnumerateImports(_In_opt_ HMODULE hModule,
                                   _In_opt_ PVOID pContext,
                                   _In_opt_ PF_DETOUR_IMPORT_FILE_CALLBACK pfImportFile,
                                   _In_opt_ PF_DETOUR_IMPORT_FUNC_CALLBACK pfImportFunc);

BOOL WINAPI DetourEnumerateImportsEx(_In_opt_ HMODULE hModule,
                                     _In_opt_ PVOID pContext,
                                     _In_opt_ PF_DETOUR_IMPORT_FILE_CALLBACK pfImportFile,
                                     _In_opt_ PF_DETOUR_IMPORT_FUNC_CALLBACK_EX pfImportFuncEx);

_Writable_bytes_(*pcbData)
_Readable_bytes_(*pcbData)
_Success_(return != NULL)
PVOID WINAPI DetourFindPayload(_In_opt_ HMODULE hModule,
                               _In_ REFGUID rguid,
                               _Out_ DWORD *pcbData);

_Writable_bytes_(*pcbData)
_Readable_bytes_(*pcbData)
_Success_(return != NULL)
PVOID WINAPI DetourFindPayloadEx(_In_ REFGUID rguid,
                                 _Out_ DWORD * pcbData);

DWORD WINAPI DetourGetSizeOfPayloads(_In_opt_ HMODULE hModule);

///////////////////////////////////////////////// Persistent Binary Functions.
//

PDETOUR_BINARY WINAPI DetourBinaryOpen(_In_ HANDLE hFile);

_Writable_bytes_(*pcbData)
_Readable_bytes_(*pcbData)
_Success_(return != NULL)
PVOID WINAPI DetourBinaryEnumeratePayloads(_In_ PDETOUR_BINARY pBinary,
                                           _Out_opt_ GUID *pGuid,
                                           _Out_ DWORD *pcbData,
                                           _Inout_ DWORD *pnIterator);

_Writable_bytes_(*pcbData)
_Readable_bytes_(*pcbData)
_Success_(return != NULL)
PVOID WINAPI DetourBinaryFindPayload(_In_ PDETOUR_BINARY pBinary,
                                     _In_ REFGUID rguid,
                                     _Out_ DWORD *pcbData);

PVOID WINAPI DetourBinarySetPayload(_In_ PDETOUR_BINARY pBinary,
                                    _In_ REFGUID rguid,
                                    _In_reads_opt_(cbData) PVOID pData,
                                    _In_ DWORD cbData);
BOOL WINAPI DetourBinaryDeletePayload(_In_ PDETOUR_BINARY pBinary, _In_ REFGUID rguid);
BOOL WINAPI DetourBinaryPurgePayloads(_In_ PDETOUR_BINARY pBinary);
BOOL WINAPI DetourBinaryResetImports(_In_ PDETOUR_BINARY pBinary);
BOOL WINAPI DetourBinaryEditImports(_In_ PDETOUR_BINARY pBinary,
                                    _In_opt_ PVOID pContext,
                                    _In_opt_ PF_DETOUR_BINARY_BYWAY_CALLBACK pfByway,
                                    _In_opt_ PF_DETOUR_BINARY_FILE_CALLBACK pfFile,
                                    _In_opt_ PF_DETOUR_BINARY_SYMBOL_CALLBACK pfSymbol,
                                    _In_opt_ PF_DETOUR_BINARY_COMMIT_CALLBACK pfCommit);
BOOL WINAPI DetourBinaryWrite(_In_ PDETOUR_BINARY pBinary, _In_ HANDLE hFile);
BOOL WINAPI DetourBinaryClose(_In_ PDETOUR_BINARY pBinary);

/////////////////////////////////////////////////// Create Process & Load Dll.
//
typedef BOOL (WINAPI *PDETOUR_CREATE_PROCESS_ROUTINEA)(
    _In_opt_ LPCSTR lpApplicationName,
    _Inout_opt_ LPSTR lpCommandLine,
    _In_opt_ LPSECURITY_ATTRIBUTES lpProcessAttributes,
    _In_opt_ LPSECURITY_ATTRIBUTES lpThreadAttributes,
    _In_ BOOL bInheritHandles,
    _In_ DWORD dwCreationFlags,
    _In_opt_ LPVOID lpEnvironment,
    _In_opt_ LPCSTR lpCurrentDirectory,
    _In_ LPSTARTUPINFOA lpStartupInfo,
    _Out_ LPPROCESS_INFORMATION lpProcessInformation);

typedef BOOL (WINAPI *PDETOUR_CREATE_PROCESS_ROUTINEW)(
    _In_opt_ LPCWSTR lpApplicationName,
    _Inout_opt_ LPWSTR lpCommandLine,
    _In_opt_ LPSECURITY_ATTRIBUTES lpProcessAttributes,
    _In_opt_ LPSECURITY_ATTRIBUTES lpThreadAttributes,
    _In_ BOOL bInheritHandles,
    _In_ DWORD dwCreationFlags,
    _In_opt_ LPVOID lpEnvironment,
    _In_opt_ LPCWSTR lpCurrentDirectory,
    _In_ LPSTARTUPINFOW lpStartupInfo,
    _Out_ LPPROCESS_INFORMATION lpProcessInformation);

BOOL WINAPI DetourCreateProcessWithDllA(_In_opt_ LPCSTR lpApplicationName,
                                        _Inout_opt_ LPSTR lpCommandLine,
                                        _In_opt_ LPSECURITY_ATTRIBUTES lpProcessAttributes,
                                        _In_opt_ LPSECURITY_ATTRIBUTES lpThreadAttributes,
                                        _In_ BOOL bInheritHandles,
                                        _In_ DWORD dwCreationFlags,
                                        _In_opt_ LPVOID lpEnvironment,
                                        _In_opt_ LPCSTR lpCurrentDirectory,
                                        _In_ LPSTARTUPINFOA lpStartupInfo,
                                        _Out_ LPPROCESS_INFORMATION lpProcessInformation,
                                        _In_ LPCSTR lpDllName,
                                        _In_opt_ PDETOUR_CREATE_PROCESS_ROUTINEA pfCreateProcessA);

BOOL WINAPI DetourCreateProcessWithDllW(_In_opt_ LPCWSTR lpApplicationName,
                                        _Inout_opt_ LPWSTR lpCommandLine,
                                        _In_opt_ LPSECURITY_ATTRIBUTES lpProcessAttributes,
                                        _In_opt_ LPSECURITY_ATTRIBUTES lpThreadAttributes,
                                        _In_ BOOL bInheritHandles,
                                        _In_ DWORD dwCreationFlags,
                                        _In_opt_ LPVOID lpEnvironment,
                                        _In_opt_ LPCWSTR lpCurrentDirectory,
                                        _In_ LPSTARTUPINFOW lpStartupInfo,
                                        _Out_ LPPROCESS_INFORMATION lpProcessInformation,
                                        _In_ LPCSTR lpDllName,
                                        _In_opt_ PDETOUR_CREATE_PROCESS_ROUTINEW pfCreateProcessW);

#ifdef UNICODE
#define DetourCreateProcessWithDll      DetourCreateProcessWithDllW
#define PDETOUR_CREATE_PROCESS_ROUTINE  PDETOUR_CREATE_PROCESS_ROUTINEW
#else
#define DetourCreateProcessWithDll      DetourCreateProcessWithDllA
#define PDETOUR_CREATE_PROCESS_ROUTINE  PDETOUR_CREATE_PROCESS_ROUTINEA
#endif // !UNICODE

BOOL WINAPI DetourCreateProcessWithDllExA(_In_opt_ LPCSTR lpApplicationName,
                                          _Inout_opt_ LPSTR lpCommandLine,
                                          _In_opt_ LPSECURITY_ATTRIBUTES lpProcessAttributes,
                                          _In_opt_ LPSECURITY_ATTRIBUTES lpThreadAttributes,
                                          _In_ BOOL bInheritHandles,
                                          _In_ DWORD dwCreationFlags,
                                          _In_opt_ LPVOID lpEnvironment,
                                          _In_opt_ LPCSTR lpCurrentDirectory,
                                          _In_ LPSTARTUPINFOA lpStartupInfo,
                                          _Out_ LPPROCESS_INFORMATION lpProcessInformation,
                                          _In_ LPCSTR lpDllName,
                                          _In_opt_ PDETOUR_CREATE_PROCESS_ROUTINEA pfCreateProcessA);

BOOL WINAPI DetourCreateProcessWithDllExW(_In_opt_ LPCWSTR lpApplicationName,
                                          _Inout_opt_  LPWSTR lpCommandLine,
                                          _In_opt_ LPSECURITY_ATTRIBUTES lpProcessAttributes,
                                          _In_opt_ LPSECURITY_ATTRIBUTES lpThreadAttributes,
                                          _In_ BOOL bInheritHandles,
                                          _In_ DWORD dwCreationFlags,
                                          _In_opt_ LPVOID lpEnvironment,
                                          _In_opt_ LPCWSTR lpCurrentDirectory,
                                          _In_ LPSTARTUPINFOW lpStartupInfo,
                                          _Out_ LPPROCESS_INFORMATION lpProcessInformation,
                                          _In_ LPCSTR lpDllName,
                                          _In_opt_ PDETOUR_CREATE_PROCESS_ROUTINEW pfCreateProcessW);

#ifdef UNICODE
#define DetourCreateProcessWithDllEx    DetourCreateProcessWithDllExW
#else
#define DetourCreateProcessWithDllEx    DetourCreateProcessWithDllExA
#endif // !UNICODE

BOOL WINAPI DetourCreateProcessWithDllsA(_In_opt_ LPCSTR lpApplicationName,
                                         _Inout_opt_ LPSTR lpCommandLine,
                                         _In_opt_ LPSECURITY_ATTRIBUTES lpProcessAttributes,
                                         _In_opt_ LPSECURITY_ATTRIBUTES lpThreadAttributes,
                                         _In_ BOOL bInheritHandles,
                                         _In_ DWORD dwCreationFlags,
                                         _In_opt_ LPVOID lpEnvironment,
                                         _In_opt_ LPCSTR lpCurrentDirectory,
                                         _In_ LPSTARTUPINFOA lpStartupInfo,
                                         _Out_ LPPROCESS_INFORMATION lpProcessInformation,
                                         _In_ DWORD nDlls,
                                         _In_reads_(nDlls) LPCSTR *rlpDlls,
                                         _In_opt_ PDETOUR_CREATE_PROCESS_ROUTINEA pfCreateProcessA);

BOOL WINAPI DetourCreateProcessWithDllsW(_In_opt_ LPCWSTR lpApplicationName,
                                         _Inout_opt_ LPWSTR lpCommandLine,
                                         _In_opt_ LPSECURITY_ATTRIBUTES lpProcessAttributes,
                                         _In_opt_ LPSECURITY_ATTRIBUTES lpThreadAttributes,
                                         _In_ BOOL bInheritHandles,
                                         _In_ DWORD dwCreationFlags,
                                         _In_opt_ LPVOID lpEnvironment,
                                         _In_opt_ LPCWSTR lpCurrentDirectory,
                                         _In_ LPSTARTUPINFOW lpStartupInfo,
                                         _Out_ LPPROCESS_INFORMATION lpProcessInformation,
                                         _In_ DWORD nDlls,
                                         _In_reads_(nDlls) LPCSTR *rlpDlls,
                                         _In_opt_ PDETOUR_CREATE_PROCESS_ROUTINEW pfCreateProcessW);

#ifdef UNICODE
#define DetourCreateProcessWithDlls     DetourCreateProcessWithDllsW
#else
#define DetourCreateProcessWithDlls     DetourCreateProcessWithDllsA
#endif // !UNICODE

BOOL WINAPI DetourProcessViaHelperA(_In_ DWORD dwTargetPid,
                                    _In_ LPCSTR lpDllName,
                                    _In_ PDETOUR_CREATE_PROCESS_ROUTINEA pfCreateProcessA);

BOOL WINAPI DetourProcessViaHelperW(_In_ DWORD dwTargetPid,
                                    _In_ LPCSTR lpDllName,
                                    _In_ PDETOUR_CREATE_PROCESS_ROUTINEW pfCreateProcessW);

#ifdef UNICODE
#define DetourProcessViaHelper          DetourProcessViaHelperW
#else
#define DetourProcessViaHelper          DetourProcessViaHelperA
#endif // !UNICODE

BOOL WINAPI DetourProcessViaHelperDllsA(_In_ DWORD dwTargetPid,
                                        _In_ DWORD nDlls,
                                        _In_reads_(nDlls) LPCSTR *rlpDlls,
                                        _In_ PDETOUR_CREATE_PROCESS_ROUTINEA pfCreateProcessA);

BOOL WINAPI DetourProcessViaHelperDllsW(_In_ DWORD dwTargetPid,
                                        _In_ DWORD nDlls,
                                        _In_reads_(nDlls) LPCSTR *rlpDlls,
                                        _In_ PDETOUR_CREATE_PROCESS_ROUTINEW pfCreateProcessW);

#ifdef UNICODE
#define DetourProcessViaHelperDlls      DetourProcessViaHelperDllsW
#else
#define DetourProcessViaHelperDlls      DetourProcessViaHelperDllsA
#endif // !UNICODE

BOOL WINAPI DetourUpdateProcessWithDll(_In_ HANDLE hProcess,
                                       _In_reads_(nDlls) LPCSTR *rlpDlls,
                                       _In_ DWORD nDlls);

BOOL WINAPI DetourUpdateProcessWithDllEx(_In_ HANDLE hProcess,
                                         _In_ HMODULE hImage,
                                         _In_ BOOL bIs32Bit,
                                         _In_reads_(nDlls) LPCSTR *rlpDlls,
                                         _In_ DWORD nDlls);

BOOL WINAPI DetourCopyPayloadToProcess(_In_ HANDLE hProcess,
                                       _In_ REFGUID rguid,
                                       _In_reads_bytes_(cbData) PVOID pvData,
                                       _In_ DWORD cbData);
BOOL WINAPI DetourRestoreAfterWith(VOID);
BOOL WINAPI DetourRestoreAfterWithEx(_In_reads_bytes_(cbData) PVOID pvData,
                                     _In_ DWORD cbData);
BOOL WINAPI DetourIsHelperProcess(VOID);
VOID CALLBACK DetourFinishHelperProcess(_In_ HWND,
                                        _In_ HINSTANCE,
                                        _In_ LPSTR,
                                        _In_ INT);

//
//////////////////////////////////////////////////////////////////////////////
#ifdef __cplusplus
}
#endif // __cplusplus

//////////////////////////////////////////////// Detours Internal Definitions.
//
#ifdef __cplusplus
#ifdef DETOURS_INTERNAL

#define NOTHROW
// #define NOTHROW (nothrow)

//////////////////////////////////////////////////////////////////////////////
//
#if (_MSC_VER < 1299)
#include <imagehlp.h>
typedef IMAGEHLP_MODULE IMAGEHLP_MODULE64;
typedef PIMAGEHLP_MODULE PIMAGEHLP_MODULE64;
typedef IMAGEHLP_SYMBOL SYMBOL_INFO;
typedef PIMAGEHLP_SYMBOL PSYMBOL_INFO;

static inline
LONG InterlockedCompareExchange(_Inout_ LONG *ptr, _In_ LONG nval, _In_ LONG oval)
{
    return (LONG)::InterlockedCompareExchange((PVOID*)ptr, (PVOID)nval, (PVOID)oval);
}
#else
#pragma warning(push)
#pragma warning(disable:4091) // empty typedef
#include <dbghelp.h>
#pragma warning(pop)
#endif

#ifdef IMAGEAPI // defined by DBGHELP.H
typedef LPAPI_VERSION (NTAPI *PF_ImagehlpApiVersionEx)(_In_ LPAPI_VERSION AppVersion);

typedef BOOL (NTAPI *PF_SymInitialize)(_In_ HANDLE hProcess,
                                       _In_opt_ LPCSTR UserSearchPath,
                                       _In_ BOOL fInvadeProcess);
typedef DWORD (NTAPI *PF_SymSetOptions)(_In_ DWORD SymOptions);
typedef DWORD (NTAPI *PF_SymGetOptions)(VOID);
typedef DWORD64 (NTAPI *PF_SymLoadModule64)(_In_ HANDLE hProcess,
                                            _In_opt_ HANDLE hFile,
                                            _In_ LPSTR ImageName,
                                            _In_opt_ LPSTR ModuleName,
                                            _In_ DWORD64 BaseOfDll,
                                            _In_opt_ DWORD SizeOfDll);
typedef BOOL (NTAPI *PF_SymGetModuleInfo64)(_In_ HANDLE hProcess,
                                            _In_ DWORD64 qwAddr,
                                            _Out_ PIMAGEHLP_MODULE64 ModuleInfo);
typedef BOOL (NTAPI *PF_SymFromName)(_In_ HANDLE hProcess,
                                     _In_ LPSTR Name,
                                     _Out_ PSYMBOL_INFO Symbol);

typedef struct _DETOUR_SYM_INFO
{
    HANDLE                  hProcess;
    HMODULE                 hDbgHelp;
    PF_ImagehlpApiVersionEx pfImagehlpApiVersionEx;
    PF_SymInitialize        pfSymInitialize;
    PF_SymSetOptions        pfSymSetOptions;
    PF_SymGetOptions        pfSymGetOptions;
    PF_SymLoadModule64      pfSymLoadModule64;
    PF_SymGetModuleInfo64   pfSymGetModuleInfo64;
    PF_SymFromName          pfSymFromName;
} DETOUR_SYM_INFO, *PDETOUR_SYM_INFO;

PDETOUR_SYM_INFO DetourLoadImageHlp(VOID);

#endif // IMAGEAPI

#if defined(_INC_STDIO) && !defined(_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS)
#error detours.h must be included before stdio.h (or at least define _CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS earlier)
#endif
#define _CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS 1

#ifndef DETOUR_TRACE
#if DETOUR_DEBUG
#define DETOUR_TRACE(x) printf x
#define DETOUR_BREAK()  __debugbreak()
#include <stdio.h>
#include <limits.h>
#else
#define DETOUR_TRACE(x)
#define DETOUR_BREAK()
#endif
#endif

#if 1 || defined(DETOURS_IA64)

//
// IA64 instructions are 41 bits, 3 per bundle, plus 5 bit bundle template => 128 bits per bundle.
//

#define DETOUR_IA64_INSTRUCTIONS_PER_BUNDLE (3)

#define DETOUR_IA64_TEMPLATE_OFFSET (0)
#define DETOUR_IA64_TEMPLATE_SIZE   (5)

#define DETOUR_IA64_INSTRUCTION_SIZE (41)
#define DETOUR_IA64_INSTRUCTION0_OFFSET (DETOUR_IA64_TEMPLATE_SIZE)
#define DETOUR_IA64_INSTRUCTION1_OFFSET (DETOUR_IA64_TEMPLATE_SIZE + DETOUR_IA64_INSTRUCTION_SIZE)
#define DETOUR_IA64_INSTRUCTION2_OFFSET (DETOUR_IA64_TEMPLATE_SIZE + DETOUR_IA64_INSTRUCTION_SIZE + DETOUR_IA64_INSTRUCTION_SIZE)

C_ASSERT(DETOUR_IA64_TEMPLATE_SIZE + DETOUR_IA64_INSTRUCTIONS_PER_BUNDLE * DETOUR_IA64_INSTRUCTION_SIZE == 128);

__declspec(align(16)) struct DETOUR_IA64_BUNDLE
{
  public:
    union
    {
        BYTE    data[16];
        UINT64  wide[2];
    };

    enum {
        A_UNIT  = 1u,
        I_UNIT  = 2u,
        M_UNIT  = 3u,
        B_UNIT  = 4u,
        F_UNIT  = 5u,
        L_UNIT  = 6u,
        X_UNIT  = 7u,
    };
    struct DETOUR_IA64_METADATA
    {
        ULONG       nTemplate       : 8;    // Instruction template.
        ULONG       nUnit0          : 4;    // Unit for slot 0
        ULONG       nUnit1          : 4;    // Unit for slot 1
        ULONG       nUnit2          : 4;    // Unit for slot 2
    };

  protected:
    static const DETOUR_IA64_METADATA s_rceCopyTable[33];

    UINT RelocateBundle(_Inout_ DETOUR_IA64_BUNDLE* pDst, _Inout_opt_ DETOUR_IA64_BUNDLE* pBundleExtra) const;

    bool RelocateInstruction(_Inout_ DETOUR_IA64_BUNDLE* pDst,
                             _In_ BYTE slot,
                             _Inout_opt_ DETOUR_IA64_BUNDLE* pBundleExtra) const;

    // 120 112 104 96 88 80 72 64 56 48 40 32 24 16  8  0
    //  f.  e.  d. c. b. a. 9. 8. 7. 6. 5. 4. 3. 2. 1. 0.

    //                                      00
    // f.e. d.c. b.a. 9.8. 7.6. 5.4. 3.2. 1.0.
    // 0000 0000 0000 0000 0000 0000 0000 001f : Template [4..0]
    // 0000 0000 0000 0000 0000 03ff ffff ffe0 : Zero [ 41..  5]
    // 0000 0000 0000 0000 0000 3c00 0000 0000 : Zero [ 45.. 42]
    // 0000 0000 0007 ffff ffff c000 0000 0000 : One  [ 82.. 46]
    // 0000 0000 0078 0000 0000 0000 0000 0000 : One  [ 86.. 83]
    // 0fff ffff ff80 0000 0000 0000 0000 0000 : Two  [123.. 87]
    // f000 0000 0000 0000 0000 0000 0000 0000 : Two  [127..124]
    BYTE    GetTemplate() const;
    // Get 4 bit opcodes.
    BYTE    GetInst0() const;
    BYTE    GetInst1() const;
    BYTE    GetInst2() const;
    BYTE    GetUnit(BYTE slot) const;
    BYTE    GetUnit0() const;
    BYTE    GetUnit1() const;
    BYTE    GetUnit2() const;
    // Get 37 bit data.
    UINT64  GetData0() const;
    UINT64  GetData1() const;
    UINT64  GetData2() const;

    // Get/set the full 41 bit instructions.
    UINT64  GetInstruction(BYTE slot) const;
    UINT64  GetInstruction0() const;
    UINT64  GetInstruction1() const;
    UINT64  GetInstruction2() const;
    void    SetInstruction(BYTE slot, UINT64 instruction);
    void    SetInstruction0(UINT64 instruction);
    void    SetInstruction1(UINT64 instruction);
    void    SetInstruction2(UINT64 instruction);

    // Get/set bitfields.
    static UINT64 GetBits(UINT64 Value, UINT64 Offset, UINT64 Count);
    static UINT64 SetBits(UINT64 Value, UINT64 Offset, UINT64 Count, UINT64 Field);

    // Get specific read-only fields.
    static UINT64 GetOpcode(UINT64 instruction); // 4bit opcode
    static UINT64 GetX(UINT64 instruction); // 1bit opcode extension
    static UINT64 GetX3(UINT64 instruction); // 3bit opcode extension
    static UINT64 GetX6(UINT64 instruction); // 6bit opcode extension

    // Get/set specific fields.
    static UINT64 GetImm7a(UINT64 instruction);
    static UINT64 SetImm7a(UINT64 instruction, UINT64 imm7a);
    static UINT64 GetImm13c(UINT64 instruction);
    static UINT64 SetImm13c(UINT64 instruction, UINT64 imm13c);
    static UINT64 GetSignBit(UINT64 instruction);
    static UINT64 SetSignBit(UINT64 instruction, UINT64 signBit);
    static UINT64 GetImm20a(UINT64 instruction);
    static UINT64 SetImm20a(UINT64 instruction, UINT64 imm20a);
    static UINT64 GetImm20b(UINT64 instruction);
    static UINT64 SetImm20b(UINT64 instruction, UINT64 imm20b);

    static UINT64 SignExtend(UINT64 Value, UINT64 Offset);

    BOOL    IsMovlGp() const;

    VOID    SetInst(BYTE Slot, BYTE nInst);
    VOID    SetInst0(BYTE nInst);
    VOID    SetInst1(BYTE nInst);
    VOID    SetInst2(BYTE nInst);
    VOID    SetData(BYTE Slot, UINT64 nData);
    VOID    SetData0(UINT64 nData);
    VOID    SetData1(UINT64 nData);
    VOID    SetData2(UINT64 nData);
    BOOL    SetNop(BYTE Slot);
    BOOL    SetNop0();
    BOOL    SetNop1();
    BOOL    SetNop2();

  public:
    BOOL    IsBrl() const;
    VOID    SetBrl();
    VOID    SetBrl(UINT64 target);
    UINT64  GetBrlTarget() const;
    VOID    SetBrlTarget(UINT64 target);
    VOID    SetBrlImm(UINT64 imm);
    UINT64  GetBrlImm() const;

    UINT64  GetMovlGp() const;
    VOID    SetMovlGp(UINT64 gp);

    VOID    SetStop();

    UINT    Copy(_Out_ DETOUR_IA64_BUNDLE *pDst, _Inout_opt_ DETOUR_IA64_BUNDLE* pBundleExtra = NULL) const;
};
#endif // DETOURS_IA64

#ifdef DETOURS_ARM

#define DETOURS_PFUNC_TO_PBYTE(p)  ((PBYTE)(((ULONG_PTR)(p)) & ~(ULONG_PTR)1))
#define DETOURS_PBYTE_TO_PFUNC(p)  ((PBYTE)(((ULONG_PTR)(p)) | (ULONG_PTR)1))

#endif // DETOURS_ARM

//////////////////////////////////////////////////////////////////////////////

#ifdef __cplusplus
extern "C" {
#endif // __cplusplus

#define DETOUR_OFFLINE_LIBRARY(x)                                       \
PVOID WINAPI DetourCopyInstruction##x(_In_opt_ PVOID pDst,              \
                                      _Inout_opt_ PVOID *ppDstPool,     \
                                      _In_ PVOID pSrc,                  \
                                      _Out_opt_ PVOID *ppTarget,        \
                                      _Out_opt_ LONG *plExtra);         \
                                                                        \
BOOL WINAPI DetourSetCodeModule##x(_In_ HMODULE hModule,                \
                                   _In_ BOOL fLimitReferencesToModule); \

DETOUR_OFFLINE_LIBRARY(X86)
DETOUR_OFFLINE_LIBRARY(X64)
DETOUR_OFFLINE_LIBRARY(ARM)
DETOUR_OFFLINE_LIBRARY(ARM64)
DETOUR_OFFLINE_LIBRARY(IA64)

#undef DETOUR_OFFLINE_LIBRARY

//////////////////////////////////////////////////////////////////////////////
//
// Helpers for manipulating page protection.
//

_Success_(return != FALSE)
BOOL WINAPI DetourVirtualProtectSameExecuteEx(_In_  HANDLE hProcess,
                                              _In_  PVOID pAddress,
                                              _In_  SIZE_T nSize,
                                              _In_  DWORD dwNewProtect,
                                              _Out_ PDWORD pdwOldProtect);

_Success_(return != FALSE)
BOOL WINAPI DetourVirtualProtectSameExecute(_In_  PVOID pAddress,
                                            _In_  SIZE_T nSize,
                                            _In_  DWORD dwNewProtect,
                                            _Out_ PDWORD pdwOldProtect);
#ifdef __cplusplus
}
#endif // __cplusplus

//////////////////////////////////////////////////////////////////////////////

#define MM_ALLOCATION_GRANULARITY 0x10000

//////////////////////////////////////////////////////////////////////////////

#endif // DETOURS_INTERNAL
#endif // __cplusplus

#endif // _DETOURS_H_
//
////////////////////////////////////////////////////////////////  End of File.


================================================
FILE: directwrite.cpp
================================================
#include "directwrite.h"
#include "settings.h"
#include "dynCodeHelper.h"

void MyDebug(const TCHAR * sz, ...)
{
#ifdef DEBUG
	TCHAR szData[512] = { 0 };

	va_list args;
	va_start(args, sz);
	StringCchVPrintf(szData, sizeof(szData)-1, sz, args);
	va_end(args);

	OutputDebugString(szData);
#endif
}

#define SET_VAL(x, y) *(DWORD_PTR*)&(x) = *(DWORD_PTR*)&(y)
// To hook a method, add HOOK_MANUALLY() in hooklist.h and use this.

#ifdef EASYHOOK
#define ISHOOKED(name) (!!HOOK_##name.Link)
#else
#define ISHOOKED(name) (IsHooked_##name)
#endif

#define HOOK(obj, name, index) { \
	if (!ISHOOKED(name)) {  \
		AutoEnableDynamicCodeGen dynHelper(true);  \
		SET_VAL(ORIG_##name, (*reinterpret_cast<void***>(obj.p))[index]);  \
		hook_demand_##name(false);  \
		if (!ISHOOKED(name)) { MyDebug(L"##name hook failed"); }  \
	}  \
};

struct ComMethodHooker {
	// The target function if it has been hooked
	BOOL (*lpIsHooked)();
	// The method the vftable refers to
	void*(*lpGetMethod)(IUnknown* obj);
	// Hook the method
	void(*lpHookFunc)(IUnknown* obj);
};

#define COM_METHOD_HOOKER(type, name, index) ComMethodHooker { \
	[]() -> BOOL { \
		return ISHOOKED(name); \
	}, \
	[](IUnknown* obj) -> void* { \
		return (*reinterpret_cast<void***>(obj))[index]; \
	}, \
	[](IUnknown* obj) -> void { \
		CComPtr<type> ptr = (type*)obj; \
		HOOK(ptr, name, index); \
	} \
}

#define COM_METHOD_HOOKER_EMPTY() ComMethodHooker { \
	[]() -> BOOL { \
		return false; \
	}, \
	[](IUnknown* obj) -> void* { \
		return NULL; \
	}, \
	[](IUnknown* obj) -> void { \
		return; \
	} \
}

struct Params {
	D2D1_TEXT_ANTIALIAS_MODE AntialiasMode;
	// Don't access directly. Use Get(D2D|DW)RenderingParams().
	IDWriteRenderingParams *RenderingParams;

	FLOAT Gamma;
	FLOAT EnhancedContrast;
	FLOAT ClearTypeLevel;
	DWRITE_PIXEL_GEOMETRY PixelGeometry;
	// RenderingMode=6 is invalid for DWrite interface
	DWRITE_RENDERING_MODE RenderingMode;
	FLOAT GrayscaleEnhancedContrast;
	DWRITE_GRID_FIT_MODE GridFitMode;
	DWRITE_RENDERING_MODE1 RenderingMode1;

	Params();
	void CreateParams(IDWriteFactory* dw_factory);
};

//IDWriteFactory* g_pDWriteFactory = NULL;
CComPtr<IDWriteGdiInterop> g_pGdiInterop = NULL;

enum D2D1RenderTargetCategory {
	D2D1_RENDER_TARGET_CATEGORY = 1,
	// ID2D1DCRenderTarget, ID2D1HwndRenderTarget, ID2D1BitmapRenderTarget
	D2D1_RENDER_TARGET1_CATEGORY,
	D2D1_DEVICE_CONTEXT_CATEGORY
};

template<typename Intf>
inline HRESULT IfSupport(IUnknown* pUnknown, void(*lpFunc)(Intf*)) {
	CComPtr<Intf> comObject;
	HRESULT hr = pUnknown->QueryInterface(&comObject);
	if (SUCCEEDED(hr)) {
		lpFunc(comObject);
	}
	return hr;
}

void Params::CreateParams(IDWriteFactory *dw_factory)
{
	IDWriteFactory3* dw3 = NULL;
	IDWriteFactory2* dw2 = NULL;
	IDWriteFactory1* dw1 = NULL;
	IDWriteRenderingParams3* r3 = NULL;
	IDWriteRenderingParams2* r2 = NULL;
	IDWriteRenderingParams1* r1 = NULL;
	IDWriteRenderingParams* r0 = NULL;

	CComPtr<IDWriteFactory> pDWriteFactory;
	if (NULL == dw_factory) {
		ORIG_DWriteCreateFactory(DWRITE_FACTORY_TYPE_SHARED,
			__uuidof(IDWriteFactory),
			reinterpret_cast<IUnknown**>(&pDWriteFactory));
		dw_factory = pDWriteFactory;
	}

	HRESULT hr = dw_factory->QueryInterface(&dw3);
	if SUCCEEDED(hr) {
		hr = dw3->CreateCustomRenderingParams(
			this->Gamma,
			this->EnhancedContrast,
			this->GrayscaleEnhancedContrast,
			this->ClearTypeLevel,
			this->PixelGeometry,
			this->RenderingMode1,
			this->GridFitMode,
			&r3);
		dw3->Release();
		if SUCCEEDED(hr) {
			RenderingParams = r3;
			return;
		}
	}

	hr = dw_factory->QueryInterface(&dw2);
	if SUCCEEDED(hr) {
		hr = dw2->CreateCustomRenderingParams(
			this->Gamma,
			this->EnhancedContrast,
			this->GrayscaleEnhancedContrast,
			this->ClearTypeLevel,
			this->PixelGeometry,
			this->RenderingMode,
			this->GridFitMode,
			&r2);
		dw2->Release();
		if SUCCEEDED(hr) {
			RenderingParams = r2;
			return;
		}
	}

	hr = dw_factory->QueryInterface(&dw1);
	if SUCCEEDED(hr) {
		hr = dw1->CreateCustomRenderingParams(
			this->Gamma,
			this->EnhancedContrast,
			this->GrayscaleEnhancedContrast,
			this->ClearTypeLevel,
			this->PixelGeometry,
			this->RenderingMode,
			&r1);
		dw1->Release();
		if SUCCEEDED(hr) {
			RenderingParams = r1;
			return;
		}
	}

	hr = dw_factory->CreateCustomRenderingParams(
		this->Gamma,
		this->EnhancedContrast,
		this->ClearTypeLevel,
		this->PixelGeometry,
		this->RenderingMode,
		&r0);
	if (SUCCEEDED(hr)) {
		RenderingParams = r0;
		return;
	}

	RenderingParams = NULL;
}

Params::Params() {
	//MessageBox(NULL, L"MakeParam", NULL, MB_OK);
	const CGdippSettings* pSettings = CGdippSettings::GetInstanceNoInit();
	//
	Gamma = pSettings->GammaValueForDW();	//user defined value preferred.
	//if (Gamma == 0)
	//	Gamma = pSettings->GammaValue()*pSettings->GammaValue() > 1.3 ? pSettings->GammaValue()*pSettings->GammaValue() / 2 : 0.7f;
	EnhancedContrast = pSettings->ContrastForDW();
	ClearTypeLevel = pSettings->ClearTypeLevelForDW();
	AntialiasMode = (D2D1_TEXT_ANTIALIAS_MODE)D2D1_TEXT_ANTIALIAS_MODE_DEFAULT;
	switch (pSettings->AntiAliasModeForDW())
	{
		case 2:
		case 4:
			PixelGeometry = DWRITE_PIXEL_GEOMETRY_RGB;
			break;
		case 3:
		case 5:
			PixelGeometry = DWRITE_PIXEL_GEOMETRY_BGR;
			break;
		default:
			PixelGeometry = DWRITE_PIXEL_GEOMETRY_FLAT;
			AntialiasMode = D2D1_TEXT_ANTIALIAS_MODE_GRAYSCALE;
	}
	
	RenderingMode = (DWRITE_RENDERING_MODE)pSettings->RenderingModeForDW();
	GrayscaleEnhancedContrast = pSettings->ContrastForDW();
	switch (pSettings->GetFontSettings().GetHintingMode())
	{
		case 0: GridFitMode = DWRITE_GRID_FIT_MODE_DEFAULT;
			break;
		case 1: GridFitMode = DWRITE_GRID_FIT_MODE_DISABLED;
			break;
		default:
			GridFitMode = DWRITE_GRID_FIT_MODE_ENABLED;
			break;
	}
	RenderingMode1 = (DWRITE_RENDERING_MODE1)pSettings->RenderingModeForDW();
	RenderingParams = NULL;
}

Params* GetD2DParams() {
	static Params d2dParams;
	return &d2dParams;
}

Params* GetDWParams() {
	static Params dwParams = [] {
		const CGdippSettings* pSettings = CGdippSettings::GetInstanceNoInit();

		Params p;
		if (pSettings->RenderingModeForDW() == 6) {	//DW rendering in mode6 is horrible
			p.RenderingMode = DWRITE_RENDERING_MODE_NATURAL_SYMMETRIC;
			p.RenderingMode1 = DWRITE_RENDERING_MODE1_NATURAL_SYMMETRIC;
		}
		//g_DWParams.Gamma = powf(g_D2DParams.Gamma, 1.0 / 3.0);
		return p;
	}();
	return &dwParams;
}

IDWriteRenderingParams* GetD2DRenderingParams(IDWriteRenderingParams* default) {
	Params* params = GetD2DParams();
	static bool inited = [&] {
		params->CreateParams(NULL);
		return true;
	}();

	if (params->RenderingParams)
		return params->RenderingParams;
	else
		return default;
}

IDWriteRenderingParams* GetDWRenderingParams(IDWriteRenderingParams* default) {
	Params* params = GetDWParams();
	static bool inited = [&] {
		params->CreateParams(NULL);
		return true;
	}();

	if (params->RenderingParams)
		return params->RenderingParams;
	else
		return default;
}

// Hook the implementation rather than an interface.
// There are many versions but inside the DLL there's only one implementation
// that supports the latest available one. Older versions are just upcasts,
// they share the same vftable.
void HookFactory(ID2D1Factory* pD2D1Factory) {
	static bool loaded = [&] {
		HRESULT hr;
		CComPtr<ID2D1Factory> ptr = pD2D1Factory;
		// index is the index in the vftable. Their order is the same as
		// methods declared in the header.
		HOOK(ptr, CreateWicBitmapRenderTarget, 13);
		HOOK(ptr, CreateHwndRenderTarget, 14);
		HOOK(ptr, CreateDxgiSurfaceRenderTarget, 15);
		HOOK(ptr, CreateDCRenderTarget, 16);
		MyDebug(L"ID2D1Factory hooked");

		CComPtr<ID2D1Factory1> ptr1;
		hr = pD2D1Factory->QueryInterface(&ptr1);
		if (SUCCEEDED(hr)){
			HOOK(ptr1, CreateDevice1, 17);
			MyDebug(L"ID2D1Factory1 hooked");
		}

		CComPtr<ID2D1Factory2> ptr2;
		hr = pD2D1Factory->QueryInterface(&ptr2);
		if (SUCCEEDED(hr)){
			HOOK(ptr2, CreateDevice2, 27);
			MyDebug(L"ID2D1Factory2 hooked");
		}

		CComPtr<ID2D1Factory3> ptr3;
		hr = pD2D1Factory->QueryInterface(&ptr3);
		if (SUCCEEDED(hr)){
			HOOK(ptr3, CreateDevice3, 28);
			MyDebug(L"ID2D1Factory3 hooked");
		}

		CComPtr<ID2D1Factory4> ptr4;
		hr = pD2D1Factory->QueryInterface(&ptr4);
		if (SUCCEEDED(hr)){
			HOOK(ptr4, CreateDevice4, 29);
			MyDebug(L"ID2D1Factory4 hooked");
		}

		CComPtr<ID2D1Factory5> ptr5;
		hr = pD2D1Factory->QueryInterface(&ptr5);
		if (SUCCEEDED(hr)){
			HOOK(ptr5, CreateDevice5, 30);
			MyDebug(L"ID2D1Factory5 hooked");
		}

		CComPtr<ID2D1Factory6> ptr6;
		hr = pD2D1Factory->QueryInterface(&ptr6);
		if (SUCCEEDED(hr)){
			HOOK(ptr6, CreateDevice6, 31);
			MyDebug(L"ID2D1Factory6 hooked");
		}

		CComPtr<ID2D1Factory7> ptr7;
		hr = pD2D1Factory->QueryInterface(&ptr7);
		if (SUCCEEDED(hr)){
			HOOK(ptr7, CreateDevice7, 32);
			MyDebug(L"ID2D1Factory7 hooked");
		}
		return true;
	}();
}

void HookDevice(ID2D1Device* d2dDevice){
	static bool loaded = [&] {
		CComPtr<ID2D1Device> ptr = d2dDevice;
		HOOK(ptr, CreateDeviceContext, 4);
		MyDebug(L"ID2D1Device hooked");

		CComPtr<ID2D1Device1> ptr2;
		HRESULT hr = (d2dDevice)->QueryInterface(&ptr2);
		if SUCCEEDED(hr) {
			HOOK(ptr2, CreateDeviceContext2, 11);
			MyDebug(L"ID2D1Device1 hooked");
		}
		CComPtr<ID2D1Device2> ptr3;
		hr = (d2dDevice)->QueryInterface(&ptr3);
		if SUCCEEDED(hr) {
			HOOK(ptr3, CreateDeviceContext3, 12);
			MyDebug(L"ID2D1Device2 hooked");
		}
		CComPtr<ID2D1Device3> ptr4;
		hr = (d2dDevice)->QueryInterface(&ptr4);
		if SUCCEEDED(hr) {
			HOOK(ptr4, CreateDeviceContext4, 15);
			MyDebug(L"ID2D1Device3 hooked");
		}
		CComPtr<ID2D1Device4> ptr5;
		hr = (d2dDevice)->QueryInterface(&ptr5);
		if SUCCEEDED(hr) {
			HOOK(ptr5, CreateDeviceContext5, 16);
			MyDebug(L"ID2D1Device4 hooked");
		}
		CComPtr<ID2D1Device5> ptr6;
		hr = (d2dDevice)->QueryInterface(&ptr6);
		if SUCCEEDED(hr) {
			HOOK(ptr6, CreateDeviceContext6, 19);
			MyDebug(L"ID2D1Device5 hooked");
		}
		CComPtr<ID2D1Device6> ptr7;
		hr = (d2dDevice)->QueryInterface(&ptr7);
		if SUCCEEDED(hr) {
			HOOK(ptr7, CreateDeviceContext7, 20);
			MyDebug(L"ID2D1Device6 hooked");
		}
		return true;
	}();
}

// Hook the method if it has not been hooked. It's not thread safe.
void HookRenderTargetMethod(
	ID2D1RenderTarget* pD2D1RenderTarget,
	D2D1RenderTargetCategory hookCategory,
	ComMethodHooker methodHookers[]
	) {
	void* method = methodHookers[hookCategory].lpGetMethod(pD2D1RenderTarget);
	if (!method || methodHookers[hookCategory].lpIsHooked()) return;	// fn is not available or already hooked

	methodHookers[hookCategory].lpHookFunc(pD2D1RenderTarget);
}

void HookRenderTarget(
	ID2D1RenderTarget* pD2D1RenderTarget,
	D2D1RenderTargetCategory hookCategory
	){
	MyDebug(L"HookRenderTarget %d", hookCategory);
	static bool loaded = [&] {
		CComPtr<ID2D1RenderTarget> ptr = pD2D1RenderTarget;
		HOOK(ptr, CreateCompatibleRenderTarget, 12);
		HOOK(ptr, D2D1RenderTarget_DrawTextLayout, 28);

		ID2D1Factory* pD2D1Factory;
		pD2D1RenderTarget->GetFactory(&pD2D1Factory);
		if (pD2D1Factory)
			HookFactory(pD2D1Factory);

		// Actually it always implements ID2D1DeviceContext regardless of
		// hookCategory.
		CComPtr<ID2D1DeviceContext> ptr1;
		HRESULT hr = pD2D1RenderTarget->QueryInterface(&ptr1);
		if (SUCCEEDED(hr)) {
			ID2D1Device* pD2D1Device;
			ptr1->GetDevice(&pD2D1Device);
			if (pD2D1Device)
				HookDevice(pD2D1Device);
		}
		return true;
	}();

	// Some methods are duplicated across interfaces. Hook them whenever they're
	// available from an instance. Make sure don't hook the same function
	// multiple times.
	//
	// Up to two instances of the same function
	static ComMethodHooker hookDrawText[] = {
		COM_METHOD_HOOKER_EMPTY(),
		COM_METHOD_HOOKER(ID2D1RenderTarget, D2D1RenderTarget_DrawText, 27),
		COM_METHOD_HOOKER(ID2D1RenderTarget, D2D1RenderTarget_DrawText, 27),
		COM_METHOD_HOOKER(ID2D1DeviceContext, D2D1DeviceContext_DrawText, 27)
	};
	// Up to three instances of the same function
	static ComMethodHooker hookDrawGlyphRun[] = {
		COM_METHOD_HOOKER_EMPTY(),
		COM_METHOD_HOOKER(ID2D1RenderTarget, D2D1RenderTarget_DrawGlyphRun, 29),
		COM_METHOD_HOOKER(ID2D1RenderTarget, D2D1RenderTarget1_DrawGlyphRun, 29),
		COM_METHOD_HOOKER(ID2D1DeviceContext, D2D1DeviceContext_DrawGlyphRun, 29)
	};
	static ComMethodHooker hookSetTextAntialiasMode[] = {
		COM_METHOD_HOOKER_EMPTY(),
		COM_METHOD_HOOKER(ID2D1RenderTarget, D2D1RenderTarget_SetTextAntialiasMode, 34),
		COM_METHOD_HOOKER(ID2D1RenderTarget, D2D1RenderTarget_SetTextAntialiasMode, 34),
		COM_METHOD_HOOKER(ID2D1DeviceContext, D2D1DeviceContext_SetTextAntialiasMode, 34)
	};
	static ComMethodHooker hookSetTextRenderingParams[] = {
		COM_METHOD_HOOKER_EMPTY(),
		COM_METHOD_HOOKER(ID2D1RenderTarget, D2D1RenderTarget_SetTextRenderingParams, 36),
		COM_METHOD_HOOKER(ID2D1RenderTarget, D2D1RenderTarget_SetTextRenderingParams, 36),
		COM_METHOD_HOOKER(ID2D1DeviceContext, D2D1DeviceContext_SetTextRenderingParams, 36)
	};
	// Note that there's a branch in the inheritance hierarchy in
	// ID2D1RenderTarget. But the implementation always supports
	// ID2D1DeviceContext, thus multiple inheritance should take place. The
	// vftable for ID2D1DeviceContext is different if hookCategory is not
	// D2D1_DEVICE_CONTEXT_CATEGORY. It consists of thunks each of which adjusts
	// the this pointer and then jumps to the corresponding method for
	// ID2D1RenderTarget (So we don't have to hook them as well), and the other
	// functions for ID2D1DeviceContext.
	static ComMethodHooker hookDrawGlyphRun1[] = {
		COM_METHOD_HOOKER_EMPTY(),
		COM_METHOD_HOOKER(ID2D1RenderTarget, D2D1RenderTarget_DrawGlyphRun1, 82),
		COM_METHOD_HOOKER(ID2D1RenderTarget, D2D1RenderTarget1_DrawGlyphRun1, 82),
		COM_METHOD_HOOKER(ID2D1DeviceContext, D2D1DeviceContext_DrawGlyphRun1, 82)
	};

	if (hookCategory == D2D1_RENDER_TARGET_CATEGORY) {
		static bool loaded1 = [&] {			
			CCriticalSectionLock __lock(CCriticalSectionLock::CS_DWRITE);
			HookRenderTargetMethod(pD2D1RenderTarget, hookCategory, hookDrawText);
			HookRenderTargetMethod(pD2D1RenderTarget, hookCategory, hookDrawGlyphRun);
			HookRenderTargetMethod(pD2D1RenderTarget, hookCategory, hookSetTextAntialiasMode);
			HookRenderTargetMethod(pD2D1RenderTarget, hookCategory, hookSetTextRenderingParams);

			CComPtr<ID2D1DeviceContext> ptr;
			HRESULT hr = pD2D1RenderTarget->QueryInterface(&ptr);
			if (SUCCEEDED(hr)) {
				HookRenderTargetMethod(ptr, hookCategory, hookDrawGlyphRun1);
			}
			return true;
		}();
	} else if (hookCategory == D2D1_RENDER_TARGET1_CATEGORY) {
		static bool loaded2 = [&] {
			CCriticalSectionLock __lock(CCriticalSectionLock::CS_DWRITE);
			HookRenderTargetMethod(pD2D1RenderTarget, hookCategory, hookDrawText);
			HookRenderTargetMethod(pD2D1RenderTarget, hookCategory, hookDrawGlyphRun);
			HookRenderTargetMethod(pD2D1RenderTarget, hookCategory, hookSetTextAntialiasMode);
			HookRenderTargetMethod(pD2D1RenderTarget, hookCategory, hookSetTextRenderingParams);

			CComPtr<ID2D1DeviceContext> ptr;
			HRESULT hr = pD2D1RenderTarget->QueryInterface(&ptr);
			if (SUCCEEDED(hr)) {
				HookRenderTargetMethod(ptr, hookCategory, hookDrawGlyphRun1);
			}
			return true;
		}();
	} else if (hookCategory == D2D1_DEVICE_CONTEXT_CATEGORY) {
		static bool loaded3 = [&] {
			CCriticalSectionLock __lock(CCriticalSectionLock::CS_DWRITE);
			HookRenderTargetMethod(pD2D1RenderTarget, hookCategory, hookDrawText);
			HookRenderTargetMethod(pD2D1RenderTarget, hookCategory, hookDrawGlyphRun);
			HookRenderTargetMethod(pD2D1RenderTarget, hookCategory, hookSetTextAntialiasMode);
			HookRenderTargetMethod(pD2D1RenderTarget, hookCategory, hookSetTextRenderingParams);
			HookRenderTargetMethod(pD2D1RenderTarget, hookCategory, hookDrawGlyphRun1);
			return true;
		}();
	}

	//pD2D1RenderTarget->SetTextAntialiasMode(D2D1_TEXT_ANTIALIAS_MODE_DEFAULT);
	pD2D1RenderTarget->SetTextAntialiasMode(GetD2DParams()->AntialiasMode);
	if (GetD2DRenderingParams(NULL)) {
		pD2D1RenderTarget->SetTextRenderingParams(GetD2DRenderingParams(NULL));
	}
}


//DWrite hooks
HRESULT WINAPI IMPL_CreateGlyphRunAnalysis(
	IDWriteFactory* This,
	DWRITE_GLYPH_RUN const* glyphRun,
	FLOAT pixelsPerDip,
	DWRITE_MATRIX const* transform,
	DWRITE_RENDERING_MODE renderingMode,
	DWRITE_MEASURING_MODE measuringMode,
	FLOAT baselineOriginX,
	FLOAT baselineOriginY,
	IDWriteGlyphRunAnalysis** glyphRunAnalysis)
{
	HRESULT hr = E_FAIL;
	if (FAILED(hr) && renderingMode != DWRITE_RENDERING_MODE_ALIASED) {
		MyDebug(L"Try DW2");
		IDWriteFactory2* f;
		hr = This->QueryInterface(&f);
		if (SUCCEEDED(hr)) {
			DWRITE_MATRIX m = {};
			if (transform) {
				m = *transform;
				m.m11 *= pixelsPerDip;
				m.m12 *= pixelsPerDip;
				m.m21 *= pixelsPerDip;
				m.m22 *= pixelsPerDip;
				m.dx *= pixelsPerDip;
				m.dy *= pixelsPerDip;
			}
			else {
				m.m11 = pixelsPerDip;
				m.m22 = pixelsPerDip;
			}
			hr = f->CreateGlyphRunAnalysis(
				glyphRun,
				&m,
				renderingMode,
				measuringMode,
				DWRITE_GRID_FIT_MODE_DEFAULT,
				DWRITE_TEXT_ANTIALIAS_MODE_CLEARTYPE,
				baselineOriginX,
				baselineOriginY,
				glyphRunAnalysis
				);
			f->Release();
		}
	}

	if (FAILED(hr) && renderingMode != DWRITE_RENDERING_MODE_ALIASED) {
		MyDebug(L"Try DW1");
		Params* dwParams = GetDWParams();
		DWRITE_MATRIX m;
		DWRITE_MATRIX const* pm = transform;
		if (dwParams->GridFitMode == DWRITE_GRID_FIT_MODE_DISABLED) {
			if (transform) {
				m = *transform;
				m.m12 += 1.0f / 0xFFFF;
				m.m21 += 1.0f / 0xFFFF;
			}
			else {
				m = { 1, 1.0f / 0xFFFF, 1.0f / 0xFFFF, 1 };
			}
			pm = &m;
		}
		hr = ORIG_CreateGlyphRunAnalysis(
			This,
			glyphRun,
			pixelsPerDip,
			pm,
			dwParams->RenderingMode,
			measuringMode,
			baselineOriginX,
			baselineOriginY,
			glyphRunAnalysis
			);
	}
	if (FAILED(hr)) {
		MyDebug(L"Try Original Params");
		hr = ORIG_CreateGlyphRunAnalysis(
			This,
			glyphRun,
			pixelsPerDip,
			transform,
			renderingMode,
			measuringMode,
			baselineOriginX,
			baselineOriginY,
			glyphRunAnalysis
			);
	}
	if (SUCCEEDED(hr)) {
		MyDebug(L"CreateGlyphRunAnalysis hooked");
		static bool loaded = [&] {
			CComPtr<IDWriteGlyphRunAnalysis> ptr = *glyphRunAnalysis;
			HOOK(ptr, GetAlphaBlendParams, 5);
			return true;
		}();
	}
	return hr;
}

HRESULT WINAPI IMPL_GetGdiInterop(
	IDWriteFactory* This,
	IDWriteGdiInterop** gdiInterop
	) 
{
	HRESULT hr = ORIG_GetGdiInterop(This, gdiInterop);
	static bool loaded = [&] {
		CComPtr<IDWriteGdiInterop> gdip = *gdiInterop;
		HOOK(gdip, CreateBitmapRenderTarget, 7);
		return true;
	}();
	MyDebug(L"IMPL_GetGdiInterop hooked");
	return hr;
}

HRESULT WINAPI IMPL_CreateBitmapRenderTarget(
	IDWriteGdiInterop* This,
	HDC hdc,
	UINT32 width,
	UINT32 height,
	IDWriteBitmapRenderTarget** renderTarget
	)
{
	HRESULT hr = ORIG_CreateBitmapRenderTarget(
		This,
		hdc,
		width,
		height,
		renderTarget
		);
	if (SUCCEEDED(hr)) {
		static bool loaded = [&] {
			CComPtr<IDWriteBitmapRenderTarget> ptr = *renderTarget;
			HOOK(ptr, BitmapRenderTarget_DrawGlyphRun, 3);
			return true;
		}();
	}
	MyDebug(L"CreateBitmapRenderTarget hooked");
	return hr;
}

HRESULT WINAPI IMPL_GetAlphaBlendParams(
	IDWriteGlyphRunAnalysis* This,
	IDWriteRenderingParams* renderingParams,
	FLOAT* blendGamma,
	FLOAT* blendEnhancedContrast,
	FLOAT* blendClearTypeLevel
	)
{
	HRESULT hr = E_FAIL;
	if (FAILED(hr)) {
		hr = ORIG_GetAlphaBlendParams(
			This,
			GetDWRenderingParams(renderingParams),
			blendGamma,
			blendEnhancedContrast,
			blendClearTypeLevel
			);
	}
	if (FAILED(hr)) {
		hr = ORIG_GetAlphaBlendParams(
			This,
			renderingParams,
			blendGamma,
			blendEnhancedContrast,
			blendClearTypeLevel
			);
	}
	MyDebug(L"GetAlphaBlendParams hooked");
	return hr;
}

HRESULT WINAPI IMPL_CreateGlyphRunAnalysis2(
	IDWriteFactory2* This,
	DWRITE_GLYPH_RUN const* glyphRun,
	DWRITE_MATRIX const* transform,
	DWRITE_RENDERING_MODE renderingMode,
	DWRITE_MEASURING_MODE measuringMode,
	DWRITE_GRID_FIT_MODE gridFitMode,
	DWRITE_TEXT_ANTIALIAS_MODE antialiasMode,
	FLOAT baselineOriginX,
	FLOAT baselineOriginY,
	IDWriteGlyphRunAnalysis** glyphRunAnalysis
	) 
{
	HRESULT hr = E_FAIL;
	if (FAILED(hr) && renderingMode != DWRITE_RENDERING_MODE_ALIASED) {
		IDWriteFactory3* f;
		hr = This->QueryInterface(&f);
		if (SUCCEEDED(hr)) {
			hr = f->CreateGlyphRunAnalysis(
				glyphRun,
				transform,
				(DWRITE_RENDERING_MODE1)renderingMode,
				measuringMode,
				gridFitMode,
				antialiasMode,
				baselineOriginX,
				baselineOriginY,
				glyphRunAnalysis
				);
			f->Release();
		}
	}

	Params* dwParams = GetDWParams();
	if (FAILED(hr) && renderingMode != DWRITE_RENDERING_MODE_ALIASED) {
		hr = ORIG_CreateGlyphRunAnalysis2(
			This,
			glyphRun,
			transform,
			dwParams->RenderingMode,
			measuringMode,
			dwParams->GridFitMode,
			antialiasMode,
			baselineOriginX,
			baselineOriginY,
			glyphRunAnalysis
			);
	}
	if (FAILED(hr)) {
		DWRITE_MATRIX m = {};
		DWRITE_MATRIX const* pm = transform;
		if (dwParams->GridFitMode == DWRITE_GRID_FIT_MODE_DISABLED) {
			if (transform) {
				m = *transform;
				m.m12 += 1.0f / 0xFFFF;
				m.m21 += 1.0f / 0xFFFF;
			}
			else {
				m = { 1, 1.0f / 0xFFFF, 1.0f / 0xFFFF, 1 };
			}
			pm = &m;
		}
		hr = ORIG_CreateGlyphRunAnalysis2(
			This,
			glyphRun,
			pm,
			renderingMode,
			measuringMode,
			gridFitMode,
			antialiasMode,
			baselineOriginX,
			baselineOriginY,
			glyphRunAnalysis
			);
	}
	if (FAILED(hr)) {
		hr = ORIG_CreateGlyphRunAnalysis2(
			This,
			glyphRun,
			transform,
			renderingMode,
			measuringMode,
			gridFitMode,
			antialiasMode,
			baselineOriginX,
			baselineOriginY,
			glyphRunAnalysis
			);
	}
	if (SUCCEEDED(hr)) {
		MyDebug(L"CreateGlyphRunAnalysis2 hooked");
		static bool loaded = [&] {
			CComPtr<IDWriteGlyphRunAnalysis> ptr = *glyphRunAnalysis;
			HOOK(ptr, GetAlphaBlendParams, 5);
			return true;
		}();
	}
	return hr;
}

HRESULT WINAPI IMPL_CreateGlyphRunAnalysis3(
	IDWriteFactory3* This,
	DWRITE_GLYPH_RUN const* glyphRun,
	DWRITE_MATRIX const* transform,
	DWRITE_RENDERING_MODE1 renderingMode,
	DWRITE_MEASURING_MODE measuringMode,
	DWRITE_GRID_FIT_MODE gridFitMode,
	DWRITE_TEXT_ANTIALIAS_MODE antialiasMode,
	FLOAT baselineOriginX,
	FLOAT baselineOriginY,
	IDWriteGlyphRunAnalysis** glyphRunAnalysis
	)
{
	MyDebug(L"CreateGlyphRunAnalysis3 hooked");
	Params* dwParams = GetDWParams();
	HRESULT hr = E_FAIL;
	if (FAILED(hr) && renderingMode != DWRITE_RENDERING_MODE1_ALIASED) {
		hr = ORIG_CreateGlyphRunAnalysis3(
			This,
			glyphRun,
			transform,
			dwParams->RenderingMode1,
			measuringMode,
			dwParams->GridFitMode,
			antialiasMode,
			baselineOriginX,
			baselineOriginY,
			glyphRunAnalysis
			);
	}
	if (FAILED(hr)) {
		MyDebug(L"try again with only transformation");
		DWRITE_MATRIX m = {};
		DWRITE_MATRIX const* pm = transform;
		if (dwParams->GridFitMode == DWRITE_GRID_FIT_MODE_DISABLED) {
			if (transform) {
				m = *transform;
				m.m12 += 1.0f / 0xFFFF;
				m.m21 += 1.0f / 0xFFFF;
			}
			else {
				m = { 1, 1.0f / 0xFFFF, 1.0f / 0xFFFF, 1 };
			}
			pm = &m;
		}
		hr = ORIG_CreateGlyphRunAnalysis3(
			This,
			glyphRun,
			pm,
			renderingMode,
			measuringMode,
			gridFitMode,
			antialiasMode,
			baselineOriginX,
			baselineOriginY,
			glyphRunAnalysis
			);
	}
	if (FAILED(hr)) {
		MyDebug(L"fallback to original params");
		hr = ORIG_CreateGlyphRunAnalysis3(
			This,
			glyphRun,
			transform,
			renderingMode,
			measuringMode,
			gridFitMode,
			antialiasMode,
			baselineOriginX,
			baselineOriginY,
			glyphRunAnalysis
			);
	}
	if (SUCCEEDED(hr)) {
		MyDebug(L"CreateGlyphRunAnalysis3 hooked");
		static bool loaded = [&] {
			CComPtr<IDWriteGlyphRunAnalysis> ptr = *glyphRunAnalysis;
			HOOK(ptr, GetAlphaBlendParams, 5);
			return true;
		}();
	}
	return hr;
}


//d2d1 hooks
HRESULT WINAPI IMPL_D2D1CreateDevice(
	IDXGIDevice* dxgiDevice,
	CONST D2D1_CREATION_PROPERTIES* creationProperties,
	ID2D1Device** d2dDevice) {
	HRESULT hr = ORIG_D2D1CreateDevice(
		dxgiDevice,
		creationProperties,
		d2dDevice
		);
	if (SUCCEEDED(hr)) {
		HookDevice(*d2dDevice);
	}
	MyDebug(L"IMPL_D2D1CreateDevice hooked");
	return hr;
}

HRESULT WINAPI IMPL_D2D1CreateDeviceContext(
	IDXGISurface* dxgiSurface,
	CONST D2D1_CREATION_PROPERTIES* creationProperties,
	ID2D1DeviceContext** d2dDeviceContext){
	HRESULT hr = ORIG_D2D1CreateDeviceContext(
		dxgiSurface,
		creationProperties,
		d2dDeviceContext
		);
	if SUCCEEDED(hr) {
		HookRenderTarget(*d2dDeviceContext, D2D1_DEVICE_CONTEXT_CATEGORY);
	}
	MyDebug(L"IMPL_D2D1CreateDeviceContext hooked");
	return hr;
}

HRESULT WINAPI IMPL_D2D1CreateFactory(
	D2D1_FACTORY_TYPE factoryType,
	REFIID riid,
	const D2D1_FACTORY_OPTIONS* pFactoryOptions,
	void** ppIFactory){
	HRESULT hr = ORIG_D2D1CreateFactory(factoryType, riid, pFactoryOptions, ppIFactory);
	if (SUCCEEDED(hr)) {
		auto pUnknown = reinterpret_cast<IUnknown*>(*ppIFactory);
		ID2D1Factory* pD2D1Factory;
		HRESULT hr2 = pUnknown->QueryInterface(&pD2D1Factory);
		if (SUCCEEDED(hr2)) {
			HookFactory(pD2D1Factory);
			pD2D1Factory->Release();
		}
	}
	return hr;
}

HRESULT WINAPI IMPL_CreateWicBitmapRenderTarget(
	ID2D1Factory* This,
	IWICBitmap* target,
	const D2D1_RENDER_TARGET_PROPERTIES* renderTargetProperties,
	ID2D1RenderTarget** renderTarget 
	) {
	HRESULT hr = ORIG_CreateWicBitmapRenderTarget(
		This,
		target,
		renderTargetProperties,
		renderTarget
		);
	if (SUCCEEDED(hr)) {
		HookRenderTarget(*renderTarget, D2D1_RENDER_TARGET_CATEGORY);
	}
	MyDebug(L"IMPL_CreateWicBitmapRenderTarget hooked");
	return hr;
}

HRESULT WINAPI IMPL_CreateHwndRenderTarget(
	ID2D1Factory* This,
	const D2D1_RENDER_TARGET_PROPERTIES* renderTargetProperties,
	const D2D1_HWND_RENDER_TARGET_PROPERTIES* hwndRenderTargetProperties,
	ID2D1HwndRenderTarget** hwndRenderTarget
	) {
	HRESULT hr = ORIG_CreateHwndRenderTarget(
		This,
		renderTargetProperties,
		hwndRenderTargetProperties,
		hwndRenderTarget
		);
	if (SUCCEEDED(hr)) {
		HookRenderTarget(*hwndRenderTarget, D2D1_RENDER_TARGET1_CATEGORY);
	}
	MyDebug(L"IMPL_CreateHwndRenderTarget hooked");
	return hr;
}

HRESULT WINAPI IMPL_CreateDxgiSurfaceRenderTarget(
	ID2D1Factory* This,
	IDXGISurface* dxgiSurface,
	const D2D1_RENDER_TARGET_PROPERTIES* renderTargetProperties,
	ID2D1RenderTarget** renderTarget
	) {
	HRESULT hr = ORIG_CreateDxgiSurfaceRenderTarget(
		This,
		dxgiSurface,
		renderTargetProperties,
		renderTarget
		);
	if (SUCCEEDED(hr)) {
		HookRenderTarget(*renderTarget, D2D1_RENDER_TARGET_CATEGORY);
	}
	MyDebug(L"IMPL_CreateDxgiSurfaceRenderTarget hooked");
	return hr;
}

HRESULT WINAPI IMPL_CreateDCRenderTarget(
	ID2D1Factory* This,
	const D2D1_RENDER_TARGET_PROPERTIES* renderTargetProperties,
	ID2D1DCRenderTarget** dcRenderTarget
	) {
	HRESULT hr = ORIG_CreateDCRenderTarget(
		This,
		renderTargetProperties,
		dcRenderTarget
		);
	if (SUCCEEDED(hr)) {
		HookRenderTarget(*dcRenderTarget, D2D1_RENDER_TARGET1_CATEGORY);
	}
	MyDebug(L"IMPL_CreateDCRenderTarget hooked");
	return hr;
}

HRESULT WINAPI IMPL_CreateCompatibleRenderTarget(
	ID2D1RenderTarget* This,
	CONST D2D1_SIZE_F* desiredSize,
	CONST D2D1_SIZE_U* desiredPixelSize,
	CONST D2D1_PIXEL_FORMAT* desiredFormat,
	D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS options,
	ID2D1BitmapRenderTarget** bitmapRenderTarget
	) {
	HRESULT hr = ORIG_CreateCompatibleRenderTarget(
		This,
		desiredSize,
		desiredPixelSize,
		desiredFormat,
		options,
		bitmapRenderTarget
		);
	if (SUCCEEDED(hr)) {
		HookRenderTarget(*bitmapRenderTarget, D2D1_RENDER_TARGET1_CATEGORY);
	}
	MyDebug(L"IMPL_CreateCompatibleRenderTarget hooked");
	return hr;
}

void WINAPI IMPL_D2D1RenderTarget_SetTextAntialiasMode(
	ID2D1RenderTarget* This,
	D2D1_TEXT_ANTIALIAS_MODE textAntialiasMode
	) {
	MyDebug(L"IMPL_D2D1RenderTarget_SetTextAntialiasMode hooked");
	ORIG_D2D1RenderTarget_SetTextAntialiasMode(This, GetD2DParams()->AntialiasMode);
}

void WINAPI IMPL_D2D1DeviceContext_SetTextAntialiasMode(
	ID2D1DeviceContext* This,
	D2D1_TEXT_ANTIALIAS_MODE textAntialiasMode
	) {
	MyDebug(L"IMPL_D2D1DeviceContext_SetTextAntialiasMode hooked");
	ORIG_D2D1DeviceContext_SetTextAntialiasMode(This, GetD2DParams()->AntialiasMode);
}

void WINAPI IMPL_D2D1RenderTarget_SetTextRenderingParams(
	ID2D1RenderTarget* This,
	_In_opt_ IDWriteRenderingParams* textRenderingParams
	) {
	MyDebug(L"IMPL_D2D1RenderTarget_SetTextRenderingParams hooked");
	ORIG_D2D1RenderTarget_SetTextRenderingParams(This, GetD2DRenderingParams(textRenderingParams));
}

void WINAPI IMPL_D2D1DeviceContext_SetTextRenderingParams(
	ID2D1DeviceContext* This,
	_In_opt_ IDWriteRenderingParams* textRenderingParams
	) {
	MyDebug(L"IMPL_D2D1DeviceContext_SetTextRenderingParams hooked");
	ORIG_D2D1DeviceContext_SetTextRenderingParams(This, GetD2DRenderingParams(textRenderingParams));
}

HRESULT WINAPI IMPL_CreateDeviceContext(
	ID2D1Device* This,
	D2D1_DEVICE_CONTEXT_OPTIONS options,
	ID2D1DeviceContext** deviceContext
	) {
	HRESULT hr = ORIG_CreateDeviceContext(
		This,
		options,
		deviceContext
		);
	if (SUCCEEDED(hr)) {
		HookRenderTarget(*deviceContext, D2D1_DEVICE_CONTEXT_CATEGORY);
	}
	MyDebug(L"IMPL_CreateDeviceContext hooked");
	return hr;
}

HRESULT WINAPI IMPL_CreateDeviceContext2(
	ID2D1Device1* This,
	D2D1_DEVICE_CONTEXT_OPTIONS options,
	ID2D1DeviceContext1** deviceContext1
	) {
	HRESULT hr = ORIG_CreateDeviceContext2(
		This,
		options,
		deviceContext1
		);
	if (SUCCEEDED(hr)) {
		HookRenderTarget(*deviceContext1, D2D1_DEVICE_CONTEXT_CATEGORY);
	}
	MyDebug(L"IMPL_CreateDeviceContext2 hooked");
	return hr;
}

HRESULT WINAPI IMPL_CreateDeviceContext3(
	ID2D1Device2* This,
	D2D1_DEVICE_CONTEXT_OPTIONS options,
	ID2D1DeviceContext2** deviceContext2
	) {
	HRESULT hr = ORIG_CreateDeviceContext3(
		This,
		options,
		deviceContext2
		);
	if (SUCCEEDED(hr)) {
		HookRenderTarget(*deviceContext2, D2D1_DEVICE_CONTEXT_CATEGORY);
	}
	MyDebug(L"IMPL_CreateDeviceContext3 hooked");
	return hr;
}

HRESULT WINAPI IMPL_CreateDeviceContext4(
	ID2D1Device3* This,
	D2D1_DEVICE_CONTEXT_OPTIONS options,
	ID2D1DeviceContext3** deviceContext2
	) {
	HRESULT hr = ORIG_CreateDeviceContext4(
		This,
		options,
		deviceContext2
		);
	if (SUCCEEDED(hr)) {
		HookRenderTarget(*deviceContext2, D2D1_DEVICE_CONTEXT_CATEGORY);
	}
	MyDebug(L"IMPL_CreateDeviceContext4 hooked");
	return hr;
}

HRESULT WINAPI IMPL_CreateDeviceContext5(
	ID2D1Device4* This,
	D2D1_DEVICE_CONTEXT_OPTIONS options,
	ID2D1DeviceContext4** deviceContext
	) {
	HRESULT hr = ORIG_CreateDeviceContext5(
		This,
		options,
		deviceContext
		);
	if (SUCCEEDED(hr)) {
		HookRenderTarget(*deviceContext, D2D1_DEVICE_CONTEXT_CATEGORY);
	}
	MyDebug(L"IMPL_CreateDeviceContext5 hooked");
	return hr;
}

HRESULT WINAPI IMPL_CreateDeviceContext6(
	ID2D1Device5* This,
	D2D1_DEVICE_CONTEXT_OPTIONS options,
	ID2D1DeviceContext5** deviceContext
	) {
	HRESULT hr = ORIG_CreateDeviceContext6(
		This,
		options,
		deviceContext
		);
	if (SUCCEEDED(hr)) {
		HookRenderTarget(*deviceContext, D2D1_DEVICE_CONTEXT_CATEGORY);
	}
	MyDebug(L"IMPL_CreateDeviceContext6 hooked");
	return hr;
}

HRESULT WINAPI IMPL_CreateDeviceContext7(
	ID2D1Device6* This,
	D2D1_DEVICE_CONTEXT_OPTIONS options,
	ID2D1DeviceContext6** deviceContext
	) {
	HRESULT hr = ORIG_CreateDeviceContext7(
		This,
		options,
		deviceContext
		);
	if (SUCCEEDED(hr)) {
		HookRenderTarget(*deviceContext, D2D1_DEVICE_CONTEXT_CATEGORY);
	}
	MyDebug(L"IMPL_CreateDeviceContext7 hooked");
	return hr;
}

HRESULT WINAPI IMPL_CreateDevice1(
	ID2D1Factory1* This,
	IDXGIDevice* dxgiDevice,
	ID2D1Device** d2dDevice
	) {
	HRESULT hr = ORIG_CreateDevice1(
		This,
		dxgiDevice,
		d2dDevice
		);
	if (SUCCEEDED(hr)) {
		HookDevice(*d2dDevice);
	}
	MyDebug(L"IMPL_CreateDevice1 hooked");
	return hr;
}

HRESULT WINAPI IMPL_CreateDevice2(
	ID2D1Factory2* This,
	IDXGIDevice* dxgiDevice,
	ID2D1Device1** d2dDevice1
	){
	HRESULT hr = ORIG_CreateDevice2(
		This,
		dxgiDevice,
		d2dDevice1
		);
	if (SUCCEEDED(hr)) {
		HookDevice(*d2dDevice1);
	}
	MyDebug(L"IMPL_CreateDevice2 hooked");
	return hr;
}

HRESULT WINAPI IMPL_CreateDevice3(
	ID2D1Factory3* This,
	IDXGIDevice* dxgiDevice,
	ID2D1Device2** d2dDevice2
	){
	HRESULT hr = ORIG_CreateDevice3(
		This,
		dxgiDevice,
		d2dDevice2
		);
	if (SUCCEEDED(hr)) {
		HookDevice(*d2dDevice2);
	}
	MyDebug(L"IMPL_CreateDevice3 hooked");
	return hr;
}

HRESULT WINAPI IMPL_CreateDevice4(
	ID2D1Factory4* This,
	IDXGIDevice* dxgiDevice,
	ID2D1Device3** d2dDevice3
	){
	HRESULT hr = ORIG_CreateDevice4(
		This,
		dxgiDevice,
		d2dDevice3
		);
	if (SUCCEEDED(hr)) {
		HookDevice(*d2dDevice3);
	}
	MyDebug(L"IMPL_CreateDevice4 hooked");
	return hr;
}

HRESULT WINAPI IMPL_CreateDevice5(
	ID2D1Factory5* This,
	IDXGIDevice* dxgiDevice,
	ID2D1Device4** d2dDevice4
	){
	HRESULT hr = ORIG_CreateDevice5(
		This,
		dxgiDevice,
		d2dDevice4
		);
	if (SUCCEEDED(hr)) {
		HookDevice(*d2dDevice4);
	}
	MyDebug(L"IMPL_CreateDevice5 hooked");
	return hr;
}

HRESULT WINAPI IMPL_CreateDevice6(
	ID2D1Factory6* This,
	IDXGIDevice* dxgiDevice,
	ID2D1Device5** d2dDevice5
	){
	HRESULT hr = ORIG_CreateDevice6(
		This,
		dxgiDevice,
		d2dDevice5
		);
	if (SUCCEEDED(hr)) {
		HookDevice(*d2dDevice5);
	}
	MyDebug(L"IMPL_CreateDevice6 hooked");
	return hr;
}

HRESULT WINAPI IMPL_CreateDevice7(
	ID2D1Factory7* This,
	IDXGIDevice* dxgiDevice,
	ID2D1Device6** d2dDevice6
	){
	HRESULT hr = ORIG_CreateDevice7(
		This,
		dxgiDevice,
		d2dDevice6
		);
	if (SUCCEEDED(hr)) {
		HookDevice(*d2dDevice6);
	}
	MyDebug(L"IMPL_CreateDevice7 hooked");
	return hr;
}


/*
bool CreateFontFace(IDWriteGdiInterop* gdi, IDWriteFont*** dfont, LOGFONT* lf)
{
__try
{
gdi->CreateFontFromLOGFONT(lf, *dfont);
return true;
}
__except(EXCEPTION_EXECUTE_HANDLER)
{
return false;
}
}*/

/*
void WINAPI IMPL_SetTextRenderingParams(ID2D1RenderTarget* self, __in_opt IDWriteRenderingParams *textRenderingParams = NULL)
{
return ORIG_SetTextRenderingParams(self, g_D2DParamsLarge.RenderingParams);
}

void WINAPI IMPL_SetTextAntialiasMode(ID2D1RenderTarget* self,  D2D1_TEXT_ANTIALIAS_MODE textAntialiasMode)
{
return ORIG_SetTextAntialiasMode(self, g_D2DParamsLarge.AntialiasMode);
}*/

bool hookD2D1() {
	//MessageBox(NULL, L"HookD2D1", NULL, MB_OK);
	static bool loaded = [&] {
		return true;
	}();
	return loaded;
}

#define FAILEXIT { /*CoUninitialize();*/ return false;}
bool hookFontCreation(CComPtr<IDWriteFactory>& pDWriteFactory) {
	if (FAILED(pDWriteFactory->GetGdiInterop(&g_pGdiInterop))) FAILEXIT;	//判断不正确

/*
	HDC dc = CreateCompatibleDC(0);
	CComQIPtr<IDWriteBitmapRenderTarget> rt;
	g_pGdiInterop->CreateBitmapRenderTarget(dc, 1, 1, &rt);	//used to trigger CreateBitmapRenderTarget->DrawGlyphRun hook
	rt.Release();
	DeleteDC(dc);*/

	HOOK(pDWriteFactory, CreateTextFormat, 15);
	CComPtr<IDWriteFont> dfont = NULL;
	CComPtr<IDWriteFontCollection> fontcollection = NULL;
	CComPtr<IDWriteFontFamily> ffamily = NULL;
	if (FAILED(pDWriteFactory->GetSystemFontCollection(&fontcollection, false))) FAILEXIT;
	if (FAILED(fontcollection->GetFontFamily(0, &ffamily))) FAILEXIT;
	if (FAILED(ffamily->GetFont(0, &dfont))) FAILEXIT;

	CComPtr<IDWriteFont3> dfont3 = NULL;
	HRESULT hr = dfont->QueryInterface(&dfont3);
	if (FAILED(hr)) {
		HOOK(dfont, CreateFontFace, 13);
	} else {
		// IDWriteFont::CreateFontFace just wraps this
		HOOK(dfont3, CreateFontFace, 19);
	}
	return true;
}

bool hookDirectWrite(IUnknown ** factory)	//此函数需要改进以判断是否成功hook
{
	//CoInitialize(NULL);
#ifdef DEBUG
	//MessageBox(NULL, L"HookDW", NULL, MB_OK);
#endif
	static bool loaded = [&] {
		CComPtr<IDWriteFactory> pDWriteFactory;
		HRESULT hr1 = (*factory)->QueryInterface(&pDWriteFactory);
		if (FAILED(hr1)) FAILEXIT;
		HOOK(pDWriteFactory, CreateGlyphRunAnalysis, 23);
		HOOK(pDWriteFactory, GetGdiInterop, 17);
		const CGdippSettings* pSettings = CGdippSettings::GetInstance();
		// Windows8/8.1 is too buggy, GDIinterpo doesn't work correctly
		if (!pSettings->IsWindows81() && !pSettings->IsWindows8() && pSettings->DelayedInited() && pSettings->GetFontSubstitutesInfo().GetSize())
			hookFontCreation(pDWriteFactory);
		MyDebug(L"DW1 hooked");

		CComPtr<IDWriteFactory2> pDWriteFactory2;
		HRESULT hr2 = (*factory)->QueryInterface(&pDWriteFactory2);
		if (FAILED(hr2)) FAILEXIT;
		HOOK(pDWriteFactory2, CreateGlyphRunAnalysis2, 30);
		MyDebug(L"DW2 hooked");

		CComPtr<IDWriteFactory3> pDWriteFactory3;
		HRESULT hr3 = (*factory)->QueryInterface(&pDWriteFactory3);
		if (FAILED(hr3)) FAILEXIT;
		HOOK(pDWriteFactory3, CreateGlyphRunAnalysis3, 31);
		MyDebug(L"DW3 hooked");
		return true;
	}();
	return loaded;
}

#undef FAILEXIT
#define FAILEXIT {return;}
void TriggerHook(ID2D1Factory* d2d_factory) {
	const D2D1_PIXEL_FORMAT format = D2D1::PixelFormat(DXGI_FORMAT_B8G8R8A8_UNORM, D2D1_ALPHA_MODE_PREMULTIPLIED);
	const D2D1_RENDER_TARGET_PROPERTIES properties =
		D2D1::RenderTargetProperties(D2D1_RENDER_TARGET_TYPE_DEFAULT, format, 0.0f, 0.0f, D2D1_RENDER_TARGET_USAGE_NONE);
	CComPtr<ID2D1DCRenderTarget>target;
	if (FAILED(d2d_factory->CreateDCRenderTarget(&properties, &target))) FAILEXIT;
}

// The entry point of DirectWrite hooking

// D2D1CreateFactory
// 	HookFactory
// 		ID2D1Factory
// 			CreateWicBitmapRenderTarget
// 			CreateHwndRenderTarget
// 			CreateDxgiSurfaceRenderTarget
// 			CreateDCRenderTarget
// 				HookRenderTarget ->
// 		ID2D1Factory<N>
// 			CreateDevice<N>
// 				HookDevice ->

// D2D1CreateDevice
// 	HookDevice
// 		ID2D1Device<N>
// 			CreateDeviceContext<N>
// 				HookRenderTarget ->

// D2D1CreateDeviceContext
// 	HookRenderTarget
// 		ID2D1RenderTarget
// 			CreateCompatibleRenderTarget
// 				HookRenderTarget ->
// 			DrawText
// 			DrawTextLayout
// 			DrawGlyphRun
// 			SetTextAntialiasMode
// 			SetTextRenderingParams
// 			GetFactory()
// 				HookFactory ->

// 		ID2D1DeviceContext
// 			DrawGlyphRun1
// 			GetDevice()
// 				HookDevice ->

// DWriteCreateFactory
// 	hookDirectWrite
// 		IDWriteFactory
// 			GetGdiInterop
// 				CreateBitmapRenderTarget
// 					IDWriteBitmapRenderTarget
// 						DrawGlyphRun

// 			CreateGlyphRunAnalysis
// 				IDWriteGlyphRunAnalysis
// 					GetAlphaBlendParams

// 			hookFontCreation
// 				CreateTextFormat
// 					IDWriteTextFormat
// 				IDWriteFont
// 					CreateFontFace
// 						IDWriteFontFace
// 				IDWriteFont3
// 					   CreateFontFace
// 					GetFontFaceReference()
// 						IDWriteFontFaceReference
// 							CreateFontFace
// 							CreateFontFaceWithSimulations

// 		IDWriteFactory<N>
// 			CreateGlyphRunAnalysis<N>
// 				IDWriteGlyphRunAnalysis
// 					GetAlphaBlendParams
void HookD2DDll()
{
	typedef HRESULT (WINAPI *PFN_DWriteCreateFactory)(
		_In_ DWRITE_FACTORY_TYPE factoryType,
		_In_ REFIID iid,
		_COM_Outptr_ IUnknown **factory
		);

	typedef HRESULT (WINAPI *PFN_D2D1CreateFactory)(
		D2D1_FACTORY_TYPE factoryType,
		REFIID riid,
		const D2D1_FACTORY_OPTIONS* pFactoryOptions,
		void** ppIFactory
		);
	//Sleep(30 * 1000);
#ifdef DEBUG
	MessageBox(0, L"HookD2DDll", NULL, MB_OK);
#endif
	HMODULE d2d1 = GetModuleHandle(_T("d2d1.dll"));
	HMODULE dw = GetModuleHandle(_T("dwrite.dll"));

	if (!d2d1)
		d2d1 = LoadLibrary(_T("d2d1.dll"));
	if (!dw)
		dw = LoadLibrary(_T("dwrite.dll"));
	void* D2D1Factory = GetProcAddress(d2d1, "D2D1CreateFactory");
	void* D2D1Device = GetProcAddress(d2d1, "D2D1CreateDevice");
	void* D2D1Context = GetProcAddress(d2d1, "D2D1CreateDeviceContext");
	void* DWFactory = GetProcAddress(dw, "DWriteCreateFactory");
	*(DWORD_PTR*)&ORIG_D2D1CreateFactory = (DWORD_PTR)D2D1Factory;
	*(DWORD_PTR*)&ORIG_D2D1CreateDevice = (DWORD_PTR)D2D1Device;
	*(DWORD_PTR*)&ORIG_D2D1CreateDeviceContext = (DWORD_PTR)D2D1Context;
	*(DWORD_PTR*)&ORIG_DWriteCreateFactory = (DWORD_PTR)DWFactory;
	if (DWFactory) {
		hook_demand_DWriteCreateFactory();
	}
	if (D2D1Factory){
		hook_demand_D2D1CreateFactory();
	}
	if (D2D1Device) {
		hook_demand_D2D1CreateDevice();
	}
	if (D2D1Context) {
		hook_demand_D2D1CreateDeviceContext();
	}
}

/*
void HookGdiplus()
{
InitGdiplusFuncs();
//*(DWORD_PTR*)&ORIG_D2D1CreateFactory = (DWORD_PTR)D2D1Factory;
*(DWORD_PTR*)&ORIG_GdipDrawString = (DWORD_PTR)pfnGdipDrawString;
hook_demand_GdipDrawString();
}

GpStatus WINAPI IMPL_GdipDrawString(
GpGraphics               *graphics,
GDIPCONST WCHAR          *string,
INT                       length,
GDIPCONST GpFont         *font,
GDIPCONST RectF          *layoutRect,
GDIPCONST GpStringFormat *stringFormat,
GDIPCONST GpBrush        *brush
)
{
#define GDIPEXEC ORIG_GdipDrawString(graphics, string, length, font, layoutRect, stringFormat, brush)
#define GDIPCHECK(x) if ((x)!=Ok) return GDIPEXEC
if (string)
{
HDC dc = NULL;
LOGFONTW lf = {0};
GpBrushType bt;
ARGB FontColor=0 ,bkColor = 0;
//GDIPLUS to gdi32 data preparation
GDIPCHECK(pfnGdipGetLogFontW((GpFont*)font, graphics, &lf));
GDIPCHECK(pfnGdipGetBrushType((GpBrush*)brush, &bt));
if (bt!=BrushTypeSolidColor) return GDIPEXEC; //only solid brush is supported by GDI32
GDIPCHECK(pfnGdipGetSolidFillColor((GpSolidFill*)brush, &FontColor));
if (FontColor>>24!=0xFF) return GDIPEXEC;	//only transparent and Opaque is supported.
GDIPCHECK(pfnGdipGetDC(graphics, &dc));
HFONT ft = CreateFontIndirectW(&lf);
HFONT oldfont = SelectFont(dc, ft);

SetTextColor(dc, FontColor & 0x00FFFFFF);
SetBkMode(dc, TRANSPARENT);
RECT gdiRect = {ROUND(layoutRect->X), ROUND(layoutRect->Y), ROUND(layoutRect->X+layoutRect->Width), ROUND(layoutRect->Y+layoutRect->Height)};
DrawText(dc, string, length, &gdiRect, DT_WORDBREAK);
//ExtTextOutW(dc, gdiRect.left, gdiRect.top, 0, &gdiRect, string, wcslen(string), NULL);

SelectObject(dc, oldfont);
DeleteObject(ft);
pfnGdipReleaseDC(graphics, dc);
return Ok;
}
else
return ORIG_GdipDrawString(graphics, string, length, font, layoutRect, stringFormat, brush);
#undef GDIPCHECK
#undef GDIPEXEC
}
*/
HRESULT WINAPI IMPL_DWriteCreateFactory(__in DWRITE_FACTORY_TYPE factoryType,
	__in REFIID iid,
	__out IUnknown **factory)
{
	HRESULT ret = ORIG_DWriteCreateFactory(factoryType, iid, factory); 
	if (SUCCEEDED(ret))
		hookDirectWrite(factory);
	return ret;
}

HRESULT WINAPI IMPL_CreateFontFace(IDWriteFont* self,
	__out IDWriteFontFace** fontFace)
{
	HRESULT ret = ORIG_CreateFontFace(self, fontFace);
	if (ret == S_OK)
	{
		/*static bool loaded = [&] {
			CComPtr<IDWriteFontFace3> dfont3 = NULL;
			HRESULT hr = self->QueryInterface(&dfont3);
			if (SUCCEEDED(hr)) {
				CComPtr<IDWriteFontFaceReference> ffref;
				if (SUCCEEDED(dfont3->GetFontFaceReference(&ffref)) && ffref) {
					// Same as IDWriteFontFaceReference1::CreateFontFace
					HOOK(ffref, DWriteFontFaceReference_CreateFontFace, 3);
					HOOK(ffref, DWriteFontFaceReference_CreateFontFaceWithSimulations, 4);
				}
			}
			return true;
		}();*/

		LOGFONT lf = { 0 };
		if (FAILED(g_pGdiInterop->ConvertFontFaceToLOGFONT(*fontFace, &lf)))
			return ret;
		const CGdippSettings* pSettings = CGdippSettings::GetInstance();
		if (pSettings->CopyForceFont(lf, lf))
		{
			IDWriteFont* writefont = NULL;
			if (FAILED(g_pGdiInterop->CreateFontFromLOGFONT(&lf, &writefont)))
				return ret;
			(*fontFace)->Release();
			ORIG_CreateFontFace(writefont, fontFace);
			writefont->Release();
		}
	}
	return ret;
}

bool SubstituteDWriteFont3(__out IDWriteFontFace3** fontFace3)
{
	LOGFONT lf = { 0 };
	if (FAILED(g_pGdiInterop->ConvertFontFaceToLOGFONT(*fontFace3, &lf)))
		return false;
	const CGdippSettings* pSettings = CGdippSettings::GetInstance();
	if (pSettings->CopyForceFont(lf, lf))
	{
		CComPtr<IDWriteFont> writefont;
		if (FAILED(g_pGdiInterop->CreateFontFromLOGFONT(&lf, &writefont)))
			return false;

		CComPtr<IDWriteFontFace> fontFaceOut;
		ORIG_CreateFontFace(writefont, &fontFaceOut);
		IDWriteFontFace3* fontFace3Out;
		if (FAILED(fontFaceOut->QueryInterface(&fontFace3Out)))
			return false;
		
		(*fontFace3)->Release();
		*fontFace3 = fontFace3Out;
	}
	return true;
}

HRESULT WINAPI IMPL_DWriteFontFaceReference_CreateFontFace(
	IDWriteFontFaceReference* self,
	__out IDWriteFontFace3** fontFace)
{
	HRESULT ret = ORIG_DWriteFontFaceReference_CreateFontFace(self, fontFace);
	if (ret == S_OK) {
		SubstituteDWriteFont3(fontFace);
	}
	return ret;
}

HRESULT WINAPI IMPL_DWriteFontFaceReference_CreateFontFaceWithSimulations(
	IDWriteFontFaceReference* self,
	DWRITE_FONT_SIMULATIONS fontFaceSimulationFlags,
	__out IDWriteFontFace3** fontFace)
{
	HRESULT ret = ORIG_DWriteFontFaceReference_CreateFontFaceWithSimulations(self,
		fontFaceSimulationFlags, fontFace);
	if (ret == S_OK) {
		SubstituteDWriteFont3(fontFace);
	}
	return ret;
}

HRESULT  WINAPI IMPL_CreateTextFormat(IDWriteFactory* self,
	__in_z WCHAR const* fontFamilyName,
	__maybenull IDWriteFontCollection* fontCollection,
	DWRITE_FONT_WEIGHT fontWeight,
	DWRITE_FONT_STYLE fontStyle,
	DWRITE_FONT_STRETCH fontStretch,
	FLOAT fontSize,
	__in_z WCHAR const* localeName,
	__out IDWriteTextFormat** textFormat)
{
	LOGFONT lf = { 0 };
	StringCchCopy(lf.lfFaceName, LF_FACESIZE, fontFamilyName);
	const CGdippSettings* pSettings = CGdippSettings::GetInstance();
	if (pSettings->CopyForceFont(lf, lf))
		return ORIG_CreateTextFormat(self, lf.lfFaceName, fontCollection, fontWeight, fontStyle, fontStretch, fontSize, localeName, textFormat);
	else
		return ORIG_CreateTextFormat(self, fontFamilyName, fontCollection, fontWeight, fontStyle, fontStretch, fontSize, localeName, textFormat);
}

void WINAPI IMPL_D2D1RenderTarget_DrawGlyphRun1(
	ID2D1DeviceContext *This,
	D2D1_POINT_2F baselineOrigin,
	CONST DWRITE_GLYPH_RUN *glyphRun,
	CONST DWRITE_GLYPH_RUN_DESCRIPTION *glyphRunDescription,
	ID2D1Brush *foregroundBrush,
	DWRITE_MEASURING_MODE measuringMode
	) {
	Params* dwParams = GetDWParams();
	if (dwParams->GridFitMode == DWRITE_GRID_FIT_MODE_DISABLED) {
		D2D1_MATRIX_3X2_F prev;
		This->GetTransform(&prev);
		D2D1_MATRIX_3X2_F rotate = prev;
		rotate.m12 += 1.0f / 0xFFFF;
		rotate.m21 += 1.0f / 0xFFFF;
		This->SetTransform(&rotate);
		ORIG_D2D1RenderTarget_DrawGlyphRun1(
			This,
			baselineOrigin,
			glyphRun,
			glyphRunDescription,
			foregroundBrush,
			measuringMode
			);
		This->SetTransform(&prev);
	}
	else {
		ORIG_D2D1RenderTarget_DrawGlyphRun1(
			This,
			baselineOrigin,
			glyphRun,
			glyphRunDescription,
			foregroundBrush,
			measuringMode
			);
	}
}

void WINAPI IMPL_D2D1RenderTarget1_DrawGlyphRun1(
	ID2D1DeviceContext *This,
	D2D1_POINT_2F baselineOrigin,
	CONST DWRITE_GLYPH_RUN *glyphRun,
	CONST DWRITE_GLYPH_RUN_DESCRIPTION *glyphRunDescription,
	ID2D1Brush *foregroundBrush,
	DWRITE_MEASURING_MODE measuringMode
	) {
	Params* dwParams = GetDWParams();
	if (dwParams->GridFitMode == DWRITE_GRID_FIT_MODE_DISABLED) {
		D2D1_MATRIX_3X2_F prev;
		This->GetTransform(&prev);
		D2D1_MATRIX_3X2_F rotate = prev;
		rotate.m12 += 1.0f / 0xFFFF;
		rotate.m21 += 1.0f / 0xFFFF;
		This->SetTransform(&rotate);
		ORIG_D2D1RenderTarget1_DrawGlyphRun1(
			This,
			baselineOrigin,
			glyphRun,
			glyphRunDescription,
			foregroundBrush,
			measuringMode
			);
		This->SetTransform(&prev);
	}
	else {
		ORIG_D2D1RenderTarget1_DrawGlyphRun1(
			This,
			baselineOrigin,
			glyphRun,
			glyphRunDescription,
			foregroundBrush,
			measuringMode
			);
	}
}

void WINAPI IMPL_D2D1DeviceContext_DrawGlyphRun1(
	ID2D1DeviceContext *This,
	D2D1_POINT_2F baselineOrigin,
	CONST DWRITE_GLYPH_RUN *glyphRun,
	CONST DWRITE_GLYPH_RUN_DESCRIPTION *glyphRunDescription,
	ID2D1Brush *foregroundBrush,
	DWRITE_MEASURING_MODE measuringMode
	) {
	Params* dwParams = GetDWParams();
	if (dwParams->GridFitMode == DWRITE_GRID_FIT_MODE_DISABLED) {
		D2D1_MATRIX_3X2_F prev;
		This->GetTransform(&prev);
		D2D1_MATRIX_3X2_F rotate = prev;
		rotate.m12 += 1.0f / 0xFFFF;
		rotate.m21 += 1.0f / 0xFFFF;
		This->SetTransform(&rotate);
		ORIG_D2D1DeviceContext_DrawGlyphRun1(
			This,
			baselineOrigin,
			glyphRun,
			glyphRunDescription,
			foregroundBrush,
			measuringMode
			);
		This->SetTransform(&prev);
	}
	else {
		ORIG_D2D1DeviceContext_DrawGlyphRun1(
			This,
			baselineOrigin,
			glyphRun,
			glyphRunDescription,
			foregroundBrush,
			measuringMode
			);
	}
}

void WINAPI IMPL_D2D1RenderTarget_DrawGlyphRun(
	ID2D1RenderTarget* This,
	D2D1_POINT_2F baselineOrigin,
	CONST DWRITE_GLYPH_RUN *glyphRun,
	ID2D1Brush *foregroundBrush,
	DWRITE_MEASURING_MODE measuringMode
	) {
	Params* dwParams = GetDWParams();
	if (dwParams->GridFitMode == DWRITE_GRID_FIT_MODE_DISABLED) {
		D2D1_MATRIX_3X2_F prev;
		This->GetTransform(&prev);
		D2D1_MATRIX_3X2_F rotate = prev;
		rotate.m12 += 1.0f / 0xFFFF;
		rotate.m21 += 1.0f / 0xFFFF;
		This->SetTransform(&rotate);
		ORIG_D2D1RenderTarget_DrawGlyphRun(
			This,
			baselineOrigin,
			glyphRun,
			foregroundBrush,
			measuringMode
			);
		This->SetTransform(&prev);
	}
	else {
		ORIG_D2D1RenderTarget_DrawGlyphRun(
			This,
			baselineOrigin,
			glyphRun,
			foregroundBrush,
			measuringMode
			);
	}
}

void WINAPI IMPL_D2D1RenderTarget1_DrawGlyphRun(
	ID2D1RenderTarget* This,
	D2D1_POINT_2F baselineOrigin,
	CONST DWRITE_GLYPH_RUN *glyphRun,
	ID2D1Brush *foregroundBrush,
	DWRITE_MEASURING_MODE measuringMode
	) {
	Params* dwParams = GetDWParams();
	if (dwParams->GridFitMode == DWRITE_GRID_FIT_MODE_DISABLED) {
		D2D1_MATRIX_3X2_F prev;
		This->GetTransform(&prev);
		D2D1_MATRIX_3X2_F rotate = prev;
		rotate.m12 += 1.0f / 0xFFFF;
		rotate.m21 += 1.0f / 0xFFFF;
		This->SetTransform(&rotate);
		ORIG_D2D1RenderTarget1_DrawGlyphRun(
			This,
			baselineOrigin,
			glyphRun,
			foregroundBrush,
			measuringMode
			);
		This->SetTransform(&prev);
	}
	else {
		ORIG_D2D1RenderTarget1_DrawGlyphRun(
			This,
			baselineOrigin,
			glyphRun,
			foregroundBrush,
			measuringMode
			);
	}
}

void WINAPI IMPL_D2D1DeviceContext_DrawGlyphRun(
	ID2D1DeviceContext* This,
	D2D1_POINT_2F baselineOrigin,
	CONST DWRITE_GLYPH_RUN *glyphRun,
	ID2D1Brush *foregroundBrush,
	DWRITE_MEASURING_MODE measuringMode
	) {
	Params* dwParams = GetDWParams();
	if (dwParams->GridFitMode == DWRITE_GRID_FIT_MODE_DISABLED) {
		D2D1_MATRIX_3X2_F prev;
		This->GetTransform(&prev);
		D2D1_MATRIX_3X2_F rotate = prev;
		rotate.m12 += 1.0f / 0xFFFF;
		rotate.m21 += 1.0f / 0xFFFF;
		This->SetTransform(&rotate);
		ORIG_D2D1DeviceContext_DrawGlyphRun(
			This,
			baselineOrigin,
			glyphRun,
			foregroundBrush,
			measuringMode
			);
		This->SetTransform(&prev);
	}
	else {
		ORIG_D2D1DeviceContext_DrawGlyphRun(
			This,
			baselineOrigin,
			glyphRun,
			foregroundBrush,
			measuringMode
			);
	}
}

HRESULT WINAPI IMPL_BitmapRenderTarget_DrawGlyphRun(
	IDWriteBitmapRenderTarget* This,
	FLOAT baselineOriginX,
	FLOAT baselineOriginY,
	DWRITE_MEASURING_MODE measuringMode,
	DWRITE_GLYPH_RUN const* glyphRun,
	IDWriteRenderingParams* renderingParams,
	COLORREF textColor,
	RECT* blackBoxRect)
{
	Params* dwParams = GetDWParams();
	HRESULT hr = E_FAIL;
	if (dwParams->GridFitMode == DWRITE_GRID_FIT_MODE_DISABLED) {
		DWRITE_MATRIX prev;
		hr = This->GetCurrentTransform(&prev);
		if (SUCCEEDED(hr)) {
			DWRITE_MATRIX rotate = prev;
			rotate.m12 += 1.0f / 0xFFFF;
			rotate.m21 += 1.0f / 0xFFFF;
			hr = This->SetCurrentTransform(&rotate);
			if (SUCCEEDED(hr)) {
				hr = ORIG_BitmapRenderTarget_DrawGlyphRun(
					This,
					baselineOriginX,
					baselineOriginY,
					measuringMode,
					glyphRun,
					GetDWRenderingParams(renderingParams),
					textColor,
					blackBoxRect
					);
				This->SetCurrentTransform(&prev);
			}
		}
	}
	if (FAILED(hr)) {
		hr = ORIG_BitmapRenderTarget_DrawGlyphRun(
			This,
			baselineOriginX,
			baselineOriginY,
			measuringMode,
			glyphRun,
			GetDWRenderingParams(renderingParams),
			textColor,
			blackBoxRect
			);
		if SUCCEEDED(hr) {
			MyDebug(L"DrawGlyphRun hooked");
		}
	}
	if (FAILED(hr)) {
		hr = ORIG_BitmapRenderTarget_DrawGlyphRun(
			This,
			baselineOriginX,
			baselineOriginY,
			measuringMode,
			glyphRun,
			renderingParams,
			textColor,
			blackBoxRect
			);
		if SUCCEEDED(hr) {
			MyDebug(L"DrawGlyphRun failed");
		}
	}
	MyDebug(L"DrawGlyphRun hooked");
	return hr;
}


void WINAPI IMPL_D2D1RenderTarget_DrawText(
	ID2D1RenderTarget* This,
	CONST WCHAR *string,
	UINT32 stringLength,
	IDWriteTextFormat *textFormat,
	CONST D2D1_RECT_F *layoutRect,
	ID2D1Brush *defaultForegroundBrush,
	D2D1_DRAW_TEXT_OPTIONS options,
	DWRITE_MEASURING_MODE measuringMode
	) {
	Params* dwParams = GetDWParams();
	if (dwParams->GridFitMode == DWRITE_GRID_FIT_MODE_DISABLED) {
		D2D1_MATRIX_3X2_F prev;
		This->GetTransform(&prev);
		D2D1_MATRIX_3X2_F rotate = prev;
		rotate.m12 += 1.0f / 0xFFFF;
		rotate.m21 += 1.0f / 0xFFFF;
		This->SetTransform(&rotate);
		ORIG_D2D1RenderTarget_DrawText(
			This,
			string,
			stringLength,
			textFormat,
			layoutRect,
			defaultForegroundBrush,
			options,
			measuringMode
			);
		This->SetTransform(&prev);
	}
	else {
		ORIG_D2D1RenderTarget_DrawText(
			This,
			string,
			stringLength,
			textFormat,
			layoutRect,
			defaultForegroundBrush,
			options,
			measuringMode
			);
	}
}

void WINAPI IMPL_D2D1DeviceContext_DrawText(
	ID2D1DeviceContext* This,
	CONST WCHAR *string,
	UINT32 stringLength,
	IDWriteTextFormat *textFormat,
	CONST D2D1_RECT_F *layoutRect,
	ID2D1Brush *defaultForegroundBrush,
	D2D1_DRAW_TEXT_OPTIONS options,
	DWRITE_MEASURING_MODE measuringMode
	) {
	Params* dwParams = GetDWParams();
	if (dwParams->GridFitMode == D
Download .txt
gitextract_gw64c59c/

├── .gitignore
├── EventLogging.cpp
├── EventLogging.h
├── GdiPlusTypes2.h
├── LICENSE
├── Makefile
├── Makefile.vc2005
├── README.md
├── README_ja-JP.md
├── VersionHelper.cpp
├── VersionHelper.h
├── array.h
├── build.vc2005.bat
├── cache.cpp
├── cache.h
├── colorinvert.h
├── common.cpp
├── common.h
├── crc32.h
├── detours.h
├── directwrite.cpp
├── directwrite.h
├── dll.cpp
├── dll.h
├── doc/
│   ├── HOWTOBUILD.md
│   └── glyph_to_bitmapex.diff
├── dynCodeHelper.cpp
├── dynCodeHelper.h
├── easyhook.h
├── expfunc.cpp
├── expfunc.def
├── ft - non-ref.cpp
├── ft.cpp
├── ft.h
├── ft2build.h
├── ft2vert.c
├── ft2vert.h
├── fteng.cpp
├── fteng.h
├── ftref.c
├── ftref.h
├── gdiPlusFlat2.cpp
├── gdiPlusFlat2.h
├── gdidll.rc
├── gdipp.icproj
├── gdipp.sln
├── gdipp.vcxproj
├── gdipp.vcxproj.filters
├── hash_list.cpp
├── hash_list.h
├── hook.cpp
├── hookCounter.cpp
├── hookCounter.h
├── hooklist.h
├── ivs_otft.h
├── json.hpp
├── macloader.rc
├── macloader.vcxproj
├── makelib.cmd
├── misc.cpp
├── optimize/
│   ├── UpgradeLog.XML
│   ├── UpgradeLog2.XML
│   ├── _UpgradeReport_Files/
│   │   ├── UpgradeReport.css
│   │   └── UpgradeReport.xslt
│   ├── mem_amd.icproj
│   ├── mem_amd.sln
│   ├── mem_amd.sln_old
│   ├── mem_amd.vcproj
│   ├── memcpy__amd.cpp
│   ├── memcpy_amd.c
│   ├── memcpy_amd.h
│   └── optimize.h
├── override.cpp
├── override.h
├── ownedcs.cpp
├── ownedcs.h
├── resource
├── resource.h
├── run.cpp
├── settings.cpp
├── settings.h
├── stdint.h
├── strtoken.h
├── supinfo.h
├── tlsdata.h
├── undocAPI.h
├── wow64ext.h
└── wow64layer.h
Copy disabled (too large) Download .txt
Showing preview only (55,759K chars total). Download the full file to get everything.
SYMBOL INDEX (1527 symbols across 49 files)

FILE: EventLogging.h
  function class (line 12) | class EventLogging

FILE: GdiPlusTypes2.h
  type ImageAbort (line 24) | typedef ImageAbort DrawImageAbort;
  type ImageAbort (line 25) | typedef ImageAbort GetThumbnailImageAbort;
  type GdiplusAbort (line 44) | struct __declspec(novtable) GdiplusAbort
  type REAL (line 70) | typedef float REAL;
  type Status (line 93) | enum Status
  function class (line 125) | class SizeF
  function BOOL (line 158) | BOOL Equals(IN const SizeF& sz) const
  function class (line 178) | class Size
  function BOOL (line 211) | BOOL Equals(IN const Size& sz) const
  function class (line 231) | class PointF
  function BOOL (line 270) | BOOL Equals(IN const PointF& point)
  function class (line 285) | class Point
  function BOOL (line 324) | BOOL Equals(IN const Point& point)
  function class (line 339) | class RectF
  function RectF (line 368) | RectF* Clone() const
  function VOID (line 373) | VOID GetLocation(OUT PointF* point) const
  function VOID (line 379) | VOID GetSize(OUT SizeF* size) const
  function VOID (line 385) | VOID GetBounds(OUT RectF* rect) const
  function BOOL (line 418) | BOOL Equals(IN const RectF & rect) const
  function BOOL (line 426) | BOOL Contains(IN REAL x,
  function BOOL (line 433) | BOOL Contains(IN const PointF& pt) const
  function BOOL (line 438) | BOOL Contains(IN const RectF& rect) const
  function VOID (line 444) | VOID Inflate(IN REAL dx,
  function VOID (line 453) | VOID Inflate(IN const PointF& point)
  function BOOL (line 458) | BOOL Intersect(IN const RectF& rect)
  function BOOL (line 463) | static BOOL Intersect(OUT RectF& c,
  function BOOL (line 479) | BOOL IntersectsWith(IN const RectF& rect) const
  function BOOL (line 487) | static BOOL Union(OUT RectF& c,
  function VOID (line 503) | VOID Offset(IN const PointF& point)
  function VOID (line 508) | VOID Offset(IN REAL dx,
  function class (line 527) | class Rect
  function Rect (line 556) | Rect* Clone() const
  function VOID (line 561) | VOID GetLocation(OUT Point* point) const
  function VOID (line 567) | VOID GetSize(OUT Size* size) const
  function VOID (line 573) | VOID GetBounds(OUT Rect* rect) const
  function BOOL (line 606) | BOOL Equals(IN const Rect & rect) const
  function BOOL (line 614) | BOOL Contains(IN INT x,
  function BOOL (line 621) | BOOL Contains(IN const Point& pt) const
  function BOOL (line 626) | BOOL Contains(IN Rect& rect) const
  function VOID (line 632) | VOID Inflate(IN INT dx,
  function VOID (line 641) | VOID Inflate(IN const Point& point)
  function BOOL (line 646) | BOOL Intersect(IN const Rect& rect)
  function BOOL (line 651) | static BOOL Intersect(OUT Rect& c,
  function BOOL (line 667) | BOOL IntersectsWith(IN const Rect& rect) const
  function BOOL (line 675) | static BOOL Union(OUT Rect& c,
  function VOID (line 691) | VOID Offset(IN const Point& point)
  function VOID (line 696) | VOID Offset(IN INT dx,
  function class (line 711) | class PathData
  function class (line 744) | class CharacterRange

FILE: VersionHelper.cpp
  function wstring (line 56) | wstring CVersionHelper::GetVersionInfo(HMODULE hLib, wstring csEntry)
  function wstring (line 134) | wstring CVersionHelper::FormatVersion(wstring cs)
  function wstring (line 180) | wstring CVersionHelper::GetFileVersionX()
  function wstring (line 207) | wstring CVersionHelper::GetProductVersionX()

FILE: VersionHelper.h
  function class (line 8) | class CVersionHelper
  function ltrim (line 29) | static inline void ltrim(std::wstring &s) {
  function rtrim (line 36) | static inline void rtrim(std::wstring &s) {

FILE: array.h
  function T (line 30) | T* End() const
  function T (line 44) | T* End() const

FILE: cache.cpp
  function HDC (line 7) | HDC CBitmapCache::CreateDC(HDC dc)
  function HBITMAP (line 16) | HBITMAP CBitmapCache::CreateDIB(int width, int height, BYTE** lplpPixels)

FILE: cache.h
  function UpdateHash (line 10) | void UpdateHash()
  type StringHashT (line 57) | typedef StringHashT<LF_FACESIZE,true>	StringHashFont;
  type StringHashT (line 58) | typedef StringHashT<MAX_PATH,true>		StringHashModule;
  function class (line 66) | class CBitmapCache
  function BYTE (line 116) | BYTE* GetPixels()
  function DWORD (line 122) | DWORD GetPixel(int X, int Y) {
  function SetPixelV (line 132) | void SetPixelV(int X, int Y, COLORREF rgb) {
  function SetCurrentPixel (line 141) | void SetCurrentPixel(COLORREF rgb) {

FILE: common.cpp
  function to_utf16le (line 3) | std::wstring to_utf16le(const std::wstring& input) {
  function to_wide_string (line 16) | std::wstring to_wide_string(const std::string& input)
  function to_byte_string (line 22) | std::string to_byte_string(const std::wstring& input)
  function wstring (line 29) | wstring to_lower_case(wstring str) {

FILE: common.h
  function FORCEINLINE (line 103) | FORCEINLINE HINSTANCE GetDLLInstance()
  function class (line 110) | class CCriticalSectionLock
  function Init (line 145) | static void Init()
  function Term (line 150) | static void Term()
  function _Trace (line 162) | static void _Trace(LPCTSTR pszFormat, ...)
  function _Trace2 (line 226) | static void _Trace2(LPCTSTR pszFormat, ...)
  function _Trace2_Bin (line 237) | static void _Trace2_Bin(LPWSTR func, int line, LPVOID lpString, UINT cbS...
  function _Trace2_Str (line 250) | static void _Trace2_Str(LPWSTR func, int line, LPCWSTR lpString, UINT cb...
  function class (line 272) | class COwnedCriticalSectionLock
  function Init (line 295) | static void Init()
  function Term (line 302) | static void Term()
  function class (line 311) | class CThreadCounter
  function class (line 334) | class CCriticalSectionLockTry
  function FORCEINLINE (line 471) | FORCEINLINE static __int64 GetClockCount()
  function class (line 488) | class CDebugElapsedCounter
  function class (line 505) | class CDebugElapsedCounter

FILE: crc32.h
  function class (line 50) | class crc32

FILE: detours.h
  type LONG (line 70) | typedef LONG LONG_PTR;
  type ULONG (line 71) | typedef ULONG ULONG_PTR;
  type GUID (line 265) | typedef struct  _GUID
  type DETOUR_TRAMPOLINE (line 316) | typedef struct _DETOUR_TRAMPOLINE DETOUR_TRAMPOLINE, *PDETOUR_TRAMPOLINE;
  type DETOUR_SECTION_HEADER (line 321) | typedef struct _DETOUR_SECTION_HEADER
  type DETOUR_SECTION_RECORD (line 346) | typedef struct _DETOUR_SECTION_RECORD
  type DETOUR_CLR_HEADER (line 353) | typedef struct _DETOUR_CLR_HEADER
  type DETOUR_EXE_RESTORE (line 367) | typedef struct _DETOUR_EXE_RESTORE
  type DETOUR_EXE_HELPER (line 390) | typedef struct _DETOUR_EXE_HELPER
  type VOID (line 468) | typedef VOID * PDETOUR_BINARY;
  type VOID (line 469) | typedef VOID * PDETOUR_LOADED_BINARY;
  type IMAGEHLP_MODULE (line 778) | typedef IMAGEHLP_MODULE IMAGEHLP_MODULE64;
  type PIMAGEHLP_MODULE (line 779) | typedef PIMAGEHLP_MODULE PIMAGEHLP_MODULE64;
  type IMAGEHLP_SYMBOL (line 780) | typedef IMAGEHLP_SYMBOL SYMBOL_INFO;
  type PIMAGEHLP_SYMBOL (line 781) | typedef PIMAGEHLP_SYMBOL PSYMBOL_INFO;
  function LONG (line 783) | static inline
  type DETOUR_SYM_INFO (line 816) | typedef struct _DETOUR_SYM_INFO
  type DETOUR_IA64_BUNDLE (line 868) | struct DETOUR_IA64_BUNDLE

FILE: directwrite.cpp
  function MyDebug (line 5) | void MyDebug(const TCHAR * sz, ...)
  type ComMethodHooker (line 37) | struct ComMethodHooker {
  type Params (line 71) | struct Params {
  type D2D1RenderTargetCategory (line 93) | enum D2D1RenderTargetCategory {
  function HRESULT (line 101) | inline HRESULT IfSupport(IUnknown* pUnknown, void(*lpFunc)(Intf*)) {
  function SUCCEEDED (line 129) | SUCCEEDED(hr) {
  function SUCCEEDED (line 147) | SUCCEEDED(hr) {
  function SUCCEEDED (line 165) | SUCCEEDED(hr) {
  function Params (line 237) | Params* GetD2DParams() {
  function Params (line 242) | Params* GetDWParams() {
  function IDWriteRenderingParams (line 257) | IDWriteRenderingParams* GetD2DRenderingParams(IDWriteRenderingParams* de...
  function IDWriteRenderingParams (line 270) | IDWriteRenderingParams* GetDWRenderingParams(IDWriteRenderingParams* def...
  function HookFactory (line 287) | void HookFactory(ID2D1Factory* pD2D1Factory) {
  function HookDevice (line 351) | void HookDevice(ID2D1Device* d2dDevice){
  function HookRenderTargetMethod (line 398) | void HookRenderTargetMethod(
  function HookRenderTarget (line 409) | void HookRenderTarget(
  function HRESULT (line 533) | HRESULT WINAPI IMPL_CreateGlyphRunAnalysis(
  function HRESULT (line 632) | HRESULT WINAPI IMPL_GetGdiInterop(
  function HRESULT (line 647) | HRESULT WINAPI IMPL_CreateBitmapRenderTarget(
  function HRESULT (line 673) | HRESULT WINAPI IMPL_GetAlphaBlendParams(
  function HRESULT (line 704) | HRESULT WINAPI IMPL_CreateGlyphRunAnalysis2(
  function HRESULT (line 804) | HRESULT WINAPI IMPL_CreateGlyphRunAnalysis3(
  function HRESULT (line 890) | HRESULT WINAPI IMPL_D2D1CreateDevice(
  function HRESULT (line 906) | HRESULT WINAPI IMPL_D2D1CreateDeviceContext(
  function HRESULT (line 922) | HRESULT WINAPI IMPL_D2D1CreateFactory(
  function HRESULT (line 940) | HRESULT WINAPI IMPL_CreateWicBitmapRenderTarget(
  function HRESULT (line 959) | HRESULT WINAPI IMPL_CreateHwndRenderTarget(
  function HRESULT (line 978) | HRESULT WINAPI IMPL_CreateDxgiSurfaceRenderTarget(
  function HRESULT (line 997) | HRESULT WINAPI IMPL_CreateDCRenderTarget(
  function HRESULT (line 1014) | HRESULT WINAPI IMPL_CreateCompatibleRenderTarget(
  function IMPL_D2D1RenderTarget_SetTextAntialiasMode (line 1037) | void WINAPI IMPL_D2D1RenderTarget_SetTextAntialiasMode(
  function IMPL_D2D1DeviceContext_SetTextAntialiasMode (line 1045) | void WINAPI IMPL_D2D1DeviceContext_SetTextAntialiasMode(
  function IMPL_D2D1RenderTarget_SetTextRenderingParams (line 1053) | void WINAPI IMPL_D2D1RenderTarget_SetTextRenderingParams(
  function IMPL_D2D1DeviceContext_SetTextRenderingParams (line 1061) | void WINAPI IMPL_D2D1DeviceContext_SetTextRenderingParams(
  function HRESULT (line 1069) | HRESULT WINAPI IMPL_CreateDeviceContext(
  function HRESULT (line 1086) | HRESULT WINAPI IMPL_CreateDeviceContext2(
  function HRESULT (line 1103) | HRESULT WINAPI IMPL_CreateDeviceContext3(
  function HRESULT (line 1120) | HRESULT WINAPI IMPL_CreateDeviceContext4(
  function HRESULT (line 1137) | HRESULT WINAPI IMPL_CreateDeviceContext5(
  function HRESULT (line 1154) | HRESULT WINAPI IMPL_CreateDeviceContext6(
  function HRESULT (line 1171) | HRESULT WINAPI IMPL_CreateDeviceContext7(
  function HRESULT (line 1188) | HRESULT WINAPI IMPL_CreateDevice1(
  function HRESULT (line 1205) | HRESULT WINAPI IMPL_CreateDevice2(
  function HRESULT (line 1222) | HRESULT WINAPI IMPL_CreateDevice3(
  function HRESULT (line 1239) | HRESULT WINAPI IMPL_CreateDevice4(
  function HRESULT (line 1256) | HRESULT WINAPI IMPL_CreateDevice5(
  function HRESULT (line 1273) | HRESULT WINAPI IMPL_CreateDevice6(
  function HRESULT (line 1290) | HRESULT WINAPI IMPL_CreateDevice7(
  function hookD2D1 (line 1333) | bool hookD2D1() {
  function hookFontCreation (line 1342) | bool hookFontCreation(CComPtr<IDWriteFactory>& pDWriteFactory) {
  function hookDirectWrite (line 1371) | bool hookDirectWrite(IUnknown ** factory)	//此函数需要改进以判断是否成功hook
  function TriggerHook (line 1407) | void TriggerHook(ID2D1Factory* d2d_factory) {
  function HookD2DDll (line 1482) | void HookD2DDll()
  function HRESULT (line 1583) | HRESULT WINAPI IMPL_DWriteCreateFactory(__in DWRITE_FACTORY_TYPE factory...
  function HRESULT (line 1593) | HRESULT WINAPI IMPL_CreateFontFace(IDWriteFont* self,
  function SubstituteDWriteFont3 (line 1630) | bool SubstituteDWriteFont3(__out IDWriteFontFace3** fontFace3)
  function HRESULT (line 1654) | HRESULT WINAPI IMPL_DWriteFontFaceReference_CreateFontFace(
  function HRESULT (line 1665) | HRESULT WINAPI IMPL_DWriteFontFaceReference_CreateFontFaceWithSimulations(
  function HRESULT (line 1678) | HRESULT  WINAPI IMPL_CreateTextFormat(IDWriteFactory* self,
  function IMPL_D2D1RenderTarget_DrawGlyphRun1 (line 1697) | void WINAPI IMPL_D2D1RenderTarget_DrawGlyphRun1(
  function IMPL_D2D1RenderTarget1_DrawGlyphRun1 (line 1735) | void WINAPI IMPL_D2D1RenderTarget1_DrawGlyphRun1(
  function IMPL_D2D1DeviceContext_DrawGlyphRun1 (line 1773) | void WINAPI IMPL_D2D1DeviceContext_DrawGlyphRun1(
  function IMPL_D2D1RenderTarget_DrawGlyphRun (line 1811) | void WINAPI IMPL_D2D1RenderTarget_DrawGlyphRun(
  function IMPL_D2D1RenderTarget1_DrawGlyphRun (line 1846) | void WINAPI IMPL_D2D1RenderTarget1_DrawGlyphRun(
  function IMPL_D2D1DeviceContext_DrawGlyphRun (line 1881) | void WINAPI IMPL_D2D1DeviceContext_DrawGlyphRun(
  function HRESULT (line 1916) | HRESULT WINAPI IMPL_BitmapRenderTarget_DrawGlyphRun(
  function IMPL_D2D1RenderTarget_DrawText (line 1986) | void WINAPI IMPL_D2D1RenderTarget_DrawText(
  function IMPL_D2D1DeviceContext_DrawText (line 2030) | void WINAPI IMPL_D2D1DeviceContext_DrawText(
  function IMPL_D2D1RenderTarget_DrawTextLayout (line 2074) | void WINAPI IMPL_D2D1RenderTarget_DrawTextLayout(

FILE: dll.cpp
  function BOOL (line 26) | BOOL CMemLoadDll::MemLoadLibrary(void* lpFileData, int DataLength, bool ...
  function FARPROC (line 85) | FARPROC  CMemLoadDll::MemGetProcAddress(LPCSTR lpProcName)
  function BOOL (line 182) | BOOL CMemLoadDll::FillRavAddress(void *pImageBase)
  function BOOL (line 255) | BOOL CMemLoadDll::CheckDataValide(void* lpFileData, int DataLength)

FILE: dll.h
  type BOOL (line 3) | typedef   BOOL (__stdcall *ProcDllMain)(HINSTANCE, DWORD,  LPVOID );
  function class (line 5) | class CMemLoadDll

FILE: dynCodeHelper.h
  function class (line 3) | class AutoEnableDynamicCodeGen

FILE: easyhook.h
  type BOOL (line 32) | typedef int BOOL;
  type HOOK_ACL (line 83) | typedef struct _HOOK_ACL_
  type _LOCAL_HOOK_INFO_ (line 90) | struct _LOCAL_HOOK_INFO_
  type HOOK_TRACE_INFO (line 92) | typedef struct _HOOK_TRACE_INFO_
  type LOCAL_HOOK_INFO (line 97) | typedef struct _LOCAL_HOOK_INFO_
  type _MODULE_INFORMATION_ (line 215) | struct _MODULE_INFORMATION_
  type MODULE_INFORMATION (line 217) | typedef struct _MODULE_INFORMATION_
  type EASYHOOK_INTERFACE_API_v_1 (line 255) | typedef struct _EASYHOOK_INTERFACE_API_v_1_
  type EASYHOOK_DEVICE_EXTENSION (line 277) | typedef struct _EASYHOOK_DEVICE_EXTENSION_
  function NTSTATUS (line 284) | static NTSTATUS EasyHookQueryInterface(
  type REMOTE_ENTRY_INFO (line 388) | typedef struct _REMOTE_ENTRY_INFO_
  type _GACUTIL_INFO_ (line 443) | struct _GACUTIL_INFO_

FILE: expfunc.cpp
  function EXTERN_C (line 26) | EXTERN_C LRESULT CALLBACK GetMsgProc(int code, WPARAM wParam, LPARAM lPa...
  function EXTERN_C (line 32) | EXTERN_C HRESULT WINAPI GdippDllGetVersion(DLLVERSIONINFO* pdvi)
  function LONG (line 92) | LONG hook_term()
  function LONG (line 115) | static LONG hook_term()
  function HMODULE (line 126) | HMODULE GetSelfModuleHandle()
  function EXTERN_C (line 134) | EXTERN_C void WINAPI CreateControlCenter(IControlCenter** ret)
  function EXTERN_C (line 139) | EXTERN_C void WINAPI ReloadConfig()
  function EXTERN_C (line 145) | EXTERN_C void SafeUnload()
  function ChangeFileName (line 177) | void ChangeFileName(LPWSTR lpSrc, int nSize, LPCWSTR lpNewFileName) {
  function WstringToString (line 187) | std::string WstringToString(const std::wstring str)
  function MakeUniqueFontName (line 199) | std::wstring MakeUniqueFontName(const std::wstring strFullName, const st...
  function FARPROC (line 215) | FARPROC K32GetProcAddress(LPCSTR lpProcName)
  type _UNICODE_STRING64 (line 276) | struct _UNICODE_STRING64 {
  class opcode_data (line 283) | class opcode_data {
    method opcode_data (line 293) | opcode_data()
    method initWow64 (line 298) | bool initWow64(LPDWORD remoteaddr, LONG orgEIP)	//Wow64初始化
    method init32 (line 606) | bool init32(LPDWORD remoteaddr, LONG orgEIP)	//32位程序初始化
    method init64From32 (line 654) | bool init64From32(DWORD64 remoteaddr, DWORD64 orgEIP)
    method init64From32 (line 711) | bool init64From32(DWORD64 remoteaddr, DWORD64 orgEIP, DWORD dwLoaderOf...
    method init (line 815) | bool init(DWORD_PTR* remoteaddr, DWORD_PTR orgEIP)
  function VOID (line 1234) | VOID SafeGetNativeSystemInfo(__out LPSYSTEM_INFO lpSystemInfo)
  function GetSystemBits (line 1250) | int GetSystemBits()
  function EXTERN_C (line 1266) | EXTERN_C BOOL WINAPI GdippInjectDLL(const PROCESS_INFORMATION* ppi)
  function EXTERN_C (line 1332) | EXTERN_C BOOL WINAPI GdippInjectDLL(const PROCESS_INFORMATION* ppi)
  function strlendb (line 1391) | int strlendb(const _TCHAR* psz)
  function _TCHAR (line 1402) | _TCHAR* strdupdb(const _TCHAR* psz, int pad)
  function MultiSzToArray (line 1414) | bool MultiSzToArray(LPWSTR p, CArray<LPWSTR>& arr)
  function LPWSTR (line 1428) | LPWSTR ArrayToMultiSz(CArray<LPWSTR>& arr)
  function AddPathEnv (line 1448) | bool AddPathEnv(CArray<LPWSTR>& arr, LPWSTR dir, int dirlen)
  function AddX64Env (line 1494) | bool AddX64Env(CArray<LPWSTR>& arr)
  function EXTERN_C (line 1513) | EXTERN_C LPWSTR WINAPI GdippEnvironment(DWORD& dwCreationFlags, LPVOID l...
  function DebugOut (line 1601) | void DebugOut(const WCHAR* szFormat, ...) {

FILE: ft - non-ref.cpp
  function COLORREF (line 68) | COLORREF GetPaletteColor(HDC hdc, UINT paletteindex)
  function Log (line 79) | void Log(char* Msg)
  function Log (line 89) | void Log(wchar_t* Msg)
  class CAlphaBlend (line 99) | class CAlphaBlend
    method CAlphaBlend (line 125) | CAlphaBlend() { }
    method conv1 (line 132) | inline int conv1(BYTE n) {
    method BYTE (line 135) | inline BYTE conv2(int n) {
    method convalpha (line 139) | inline int convalpha(int alpha) {
  function BYTE (line 262) | BYTE CAlphaBlend::rconv1(int n)
  class CAlphaBlendColorOne (line 280) | class CAlphaBlendColorOne
    method CAlphaBlendColorOne (line 290) | CAlphaBlendColorOne()
  function FORCEINLINE (line 297) | FORCEINLINE void CAlphaBlendColorOne::init(BYTE f, const int *tbl)
  function FORCEINLINE (line 304) | FORCEINLINE BYTE CAlphaBlendColorOne::doAB(BYTE bg, int alpha)
  class CAlphaBlendColor (line 313) | class CAlphaBlendColor
    method COLORREF (line 324) | COLORREF doAB(COLORREF baseColor, int alpha, BOOL bClearAlpha) {
    method CAlphaBlendColor (line 328) | CAlphaBlendColor() { }
  function FORCEINLINE (line 331) | FORCEINLINE CAlphaBlendColor::CAlphaBlendColor( COLORREF newColor, int p...
  function FORCEINLINE (line 347) | FORCEINLINE COLORREF CAlphaBlendColor::doAB(COLORREF baseColor, int alph...
  function FORCEINLINE (line 365) | FORCEINLINE BYTE CAlphaBlend::doAB(BYTE fg, BYTE bg, int alpha)
  function FORCEINLINE (line 377) | FORCEINLINE BYTE DoAlphaBlend(BYTE fg, BYTE bg, int alpha)
  function FORCEINLINE (line 383) | static FORCEINLINE
  function FORCEINLINE (line 411) | static FORCEINLINE
  function FreeTypeDrawBitmapPixelModeMono (line 451) | static void FreeTypeDrawBitmapPixelModeMono(FreeTypeGlyphInfo& FTGInfo,
  function FreeTypeDrawBitmapPixelModeLCD (line 498) | static void FreeTypeDrawBitmapPixelModeLCD(FreeTypeGlyphInfo& FTGInfo,
  function FreeTypeDrawBitmapGray (line 614) | static void FreeTypeDrawBitmapGray(FreeTypeGlyphInfo& FTGInfo, CAlphaBle...
  function FreeTypeDrawBitmap (line 663) | static void FreeTypeDrawBitmap(
  function FreeTypeDrawBitmapPixelModeMonoV (line 687) | static void FreeTypeDrawBitmapPixelModeMonoV(FreeTypeGlyphInfo& FTGInfo,
  function FreeTypeDrawBitmapPixelModeLCDV (line 721) | static void FreeTypeDrawBitmapPixelModeLCDV(FreeTypeGlyphInfo& FTGInfo,
  function FreeTypeDrawBitmapGrayV (line 809) | void FreeTypeDrawBitmapGrayV(FreeTypeGlyphInfo& FTGInfo, CAlphaBlendColo...
  function FreeTypeDrawBitmapV (line 842) | static void FreeTypeDrawBitmapV(FreeTypeGlyphInfo& FTGInfo, CAlphaBlendC...
  class CGGOGlyphLoader (line 860) | class CGGOGlyphLoader
    method CGGOGlyphLoader (line 868) | CGGOGlyphLoader() : m_lib(NULL), m_clazz(NULL) {}
    method FT_Library (line 871) | FT_Library getlib() { return m_lib; }
    method FT_Glyph_Class (line 872) | const FT_Glyph_Class * getclazz() { return m_clazz; }
    method BYTE (line 873) | BYTE convbgpixel(BYTE val) { return bgtbl[val]; }
  class CGGOOutlineGlyph (line 949) | class CGGOOutlineGlyph
    method FT_F26Dot6 (line 953) | static FT_F26Dot6 toF26Dot6(const FIXED& fx) {
    method FT_Fixed (line 956) | static FT_Fixed toFixed(const short n) {
    method getTag (line 959) | static char getTag(char tag, const FT_Vector& point) {
    method CGGOOutlineGlyph (line 969) | CGGOOutlineGlyph() : m_ptr(NULL) { _ASSERTE(s_GGOGlyphLoader.getlib()); }
  class CTempMem (line 1098) | class CTempMem
    method CTempMem (line 1105) | CTempMem() : m_size(sizeof m_localbuf), m_ptr((T)m_localbuf) {
    method T (line 1110) | T init(DWORD size) {
    method done (line 1118) | void done() {
    method DWORD (line 1127) | DWORD getsize() { return m_size; }
  function BOOL (line 1130) | BOOL FreeTypePrepare(FreeTypeDrawInfo& FTInfo)
  function IsVerticalChar (line 1381) | inline bool IsVerticalChar(WCHAR wch){
  type CGGOFont (line 1390) | struct CGGOFont
    method CGGOFont (line 1395) | CGGOFont(HDC hdc, const LOGFONT& olf) : m_hdc(hdc), m_hfont(NULL), m_h...
    method change (line 1408) | void change() {
    method restore (line 1411) | void restore() {
  class ClpDx (line 1418) | class ClpDx
    method ClpDx (line 1424) | ClpDx(const INT *lpDx, UINT etoOptions) : p(lpDx), step((etoOptions & ...
    method get (line 1428) | int get(int val) {
  function BOOL (line 1465) | BOOL ForEachGetGlyphFT(FreeTypeDrawInfo& FTInfo, LPCTSTR lpString, int c...
  function BOOL (line 1924) | BOOL ForEachGetGlyphGGO(FreeTypeDrawInfo& FTInfo, LPCTSTR lpString, int ...
  function BOOL (line 2317) | BOOL GetLogFontFromDC(HDC hdc, LOGFONT& lf)
  function BOOL (line 2334) | BOOL CALLBACK TextOutCallback(FreeTypeGlyphInfo& FTGInfo)
  function IsColorDark (line 2379) | int IsColorDark(DWORD Color, double Gamma)
  function BOOL (line 2452) | BOOL FreeTypeTextOut(
  function BOOL (line 2611) | BOOL FreeTypeGetGlyph(	//获得所有图形和需要的宽度
  function VertFinalizer (line 2642) | void VertFinalizer(void *object){
  function FT_Error (line 2719) | FT_Error face_requester(
  function FT_Error (line 2797) | FT_Error New_FT_Outline_Embolden( FT_Outline*  outline, FT_Pos str_h, FT...
  function FT_Error (line 2830) | FT_Error Old_FT_Outline_Embolden( FT_Outline*  outline, FT_Pos strength )
  function FT_Error (line 2918) | FT_Error Vert_FT_Outline_Embolden( FT_Outline*  outline, FT_Pos strength )
  function FT_Library_SetLcdFilter_Dummy (line 3007) | FT_Library_SetLcdFilter_Dummy( FT_Library    /*library*/,
  function BOOL (line 3013) | BOOL FontLInit(void){
  function FontLFree (line 3071) | void FontLFree(void){
  function RefreshAlphaTable (line 3083) | void RefreshAlphaTable()
  function UpdateLcdFilter (line 3088) | void UpdateLcdFilter()

FILE: ft.cpp
  function COLORREF (line 73) | COLORREF GetPaletteColor(HDC hdc, UINT paletteindex)
  function EmBoldVariableFont (line 83) | bool EmBoldVariableFont(const FT_Face face, int boldWeight) {
  function Log (line 127) | void Log(char* Msg)
  function Log (line 137) | void Log(wchar_t* Msg)
  class CAlphaBlend (line 156) | class CAlphaBlend
    method CAlphaBlend (line 182) | CAlphaBlend() :
    method conv1 (line 205) | inline int conv1(BYTE n) {
    method BYTE (line 208) | inline BYTE conv2(int n) {
    method convalpha (line 212) | inline int convalpha(int alpha) {
  function BYTE (line 345) | BYTE CAlphaBlend::rconv1(int n)
  class CAlphaBlendColorOne (line 364) | class CAlphaBlendColorOne
    method CAlphaBlendColorOne (line 374) | CAlphaBlendColorOne()
  function FORCEINLINE (line 381) | FORCEINLINE void CAlphaBlendColorOne::init(BYTE f, const int* tbl)
  function FORCEINLINE (line 388) | FORCEINLINE BYTE CAlphaBlendColorOne::doAB(BYTE bg, int alpha)
  class CAlphaBlendColor (line 397) | class CAlphaBlendColor
    method COLORREF (line 408) | COLORREF doAB(COLORREF baseColor, int alpha, BOOL bClearAlpha) {
    method CAlphaBlendColor (line 412) | CAlphaBlendColor() { }
  function FORCEINLINE (line 415) | FORCEINLINE CAlphaBlendColor::CAlphaBlendColor(COLORREF newColor, int pa...
  function FORCEINLINE (line 432) | FORCEINLINE COLORREF CAlphaBlendColor::doAB(COLORREF baseColor, int alph...
  function FORCEINLINE (line 450) | FORCEINLINE BYTE CAlphaBlend::doAB(BYTE fg, BYTE bg, int alpha)
  function FORCEINLINE (line 462) | FORCEINLINE BYTE DoAlphaBlend(BYTE fg, BYTE bg, int alpha)
  function FORCEINLINE (line 468) | static FORCEINLINE
  function FORCEINLINE (line 496) | static FORCEINLINE
  function FreeTypeDrawBitmapPixelModeMono (line 537) | static void FreeTypeDrawBitmapPixelModeMono(FreeTypeGlyphInfo& FTGInfo,
  function FreeTypeDrawBitmapPixelModeLCD (line 585) | static void FreeTypeDrawBitmapPixelModeLCD(FreeTypeGlyphInfo& FTGInfo,
  function COLORREF (line 703) | COLORREF _rgbamixer(COLORREF bkColor, int b, int g, int r, int a) {
  function COLORREF (line 709) | COLORREF _invert_rgbamixer(COLORREF bkColor, int b, int g, int r, int a) {
  function FreeTypeDrawBitmapPixelModeBGRA (line 727) | static void FreeTypeDrawBitmapPixelModeBGRA(FreeTypeGlyphInfo& FTGInfo, ...
  function FreeTypeDrawBitmapGray (line 792) | static void FreeTypeDrawBitmapGray(FreeTypeGlyphInfo& FTGInfo, CAlphaBle...
  function FreeTypeDrawBitmap (line 842) | static bool FreeTypeDrawBitmap(
  function FreeTypeDrawBitmapPixelModeMonoV (line 870) | static void FreeTypeDrawBitmapPixelModeMonoV(FreeTypeGlyphInfo& FTGInfo,
  function FreeTypeDrawBitmapPixelModeLCDV (line 904) | static void FreeTypeDrawBitmapPixelModeLCDV(FreeTypeGlyphInfo& FTGInfo,
  function FreeTypeDrawBitmapGrayV (line 994) | void FreeTypeDrawBitmapGrayV(FreeTypeGlyphInfo& FTGInfo, CAlphaBlendColo...
  function FreeTypeDrawBitmapV (line 1027) | static bool FreeTypeDrawBitmapV(FreeTypeGlyphInfo& FTGInfo, CAlphaBlendC...
  class CGGOGlyphLoader (line 1050) | class CGGOGlyphLoader
    method CGGOGlyphLoader (line 1058) | CGGOGlyphLoader() : m_lib(NULL), m_clazz(NULL) {}
    method FT_Library (line 1061) | FT_Library getlib() { return m_lib; }
    method FT_Glyph_Class (line 1062) | const FT_Glyph_Class* getclazz() { return m_clazz; }
    method BYTE (line 1063) | BYTE convbgpixel(BYTE val) { return bgtbl[val]; }
  class CGGOOutlineGlyph (line 1139) | class CGGOOutlineGlyph
    method FT_F26Dot6 (line 1143) | static FT_F26Dot6 toF26Dot6(const FIXED& fx) {
    method FT_Fixed (line 1146) | static FT_Fixed toFixed(const short n) {
    method getTag (line 1149) | static char getTag(char tag, const FT_Vector& point) {
    method CGGOOutlineGlyph (line 1159) | CGGOOutlineGlyph() : m_ptr(NULL) { _ASSERTE(s_GGOGlyphLoader.getlib()); }
  class CTempMem (line 1288) | class CTempMem
    method CTempMem (line 1295) | CTempMem() : m_size(sizeof m_localbuf), m_ptr((T)m_localbuf) {
    method T (line 1300) | T init(DWORD size) {
    method done (line 1308) | void done() {
    method DWORD (line 1317) | DWORD getsize() { return m_size; }
  function IsSFNTNameMatch (line 1320) | bool IsSFNTNameMatch(const FT_Face& face, FT_UInt nameID, wstring name) {
  function VarFontByAlias (line 1380) | void VarFontByAlias(const FT_Face& face, const wstring& lfStyleName) {
  function BOOL (line 1401) | BOOL FreeTypePrepare(FreeTypeDrawInfo& FTInfo)
  function IsVerticalChar (line 1657) | inline bool IsVerticalChar(WCHAR wch) {
  type CGGOFont (line 1666) | struct CGGOFont
    method CGGOFont (line 1671) | CGGOFont(HDC hdc, const LOGFONT& olf) : m_hdc(hdc), m_hfont(NULL), m_h...
    method change (line 1684) | void change() {
    method restore (line 1687) | void restore() {
  class ClpDx (line 1694) | class ClpDx
    method ClpDx (line 1700) | ClpDx(const INT* lpDx, UINT etoOptions) : p(lpDx), step((etoOptions& E...
    method get (line 1704) | int get(int val) {
    method gety (line 1715) | int gety(int val) {	// you must call gety BEFORE call get, gety won't ...
  function BOOL (line 1753) | BOOL ForEachGetGlyphFT(FreeTypeDrawInfo& FTInfo, LPCTSTR lpString, int c...
  function BOOL (line 2273) | BOOL ForEachGetGlyphGGO(FreeTypeDrawInfo& FTInfo, LPCTSTR lpString, int ...
  function BOOL (line 2678) | BOOL GetLogFontFromDC(HDC hdc, LOGFONT& lf)
  function BOOL (line 2695) | BOOL CALLBACK TextOutCallback(FreeTypeGlyphInfo& FTGInfo)
  function IsColorDark (line 2750) | int IsColorDark(DWORD Color, double Gamma)
  function BOOL (line 2823) | BOOL FreeTypeTextOut(
  function BOOL (line 3037) | BOOL FreeTypeGetGlyph(	//获得所有图形和需要的宽度
  function VertFinalizer (line 3068) | void VertFinalizer(void* object) {
  function FT_Error (line 3145) | FT_Error face_requester(
  function FT_Error (line 3227) | FT_Error New_FT_Outline_Embolden(FT_Outline* outline, FT_Pos str_h, FT_P...
  function FT_Error (line 3260) | FT_Error Old_FT_Outline_Embolden(FT_Outline* outline, FT_Pos strength)
  function FT_Error (line 3348) | FT_Error Vert_FT_Outline_Embolden(FT_Outline* outline, FT_Pos strength)
  function BOOL (line 3435) | BOOL FontLInit(void) {
  function FontLFree (line 3479) | void FontLFree(void) {
  function RefreshAlphaTable (line 3491) | void RefreshAlphaTable()

FILE: ft.h
  type FT_DRAW_STATE (line 16) | enum FT_DRAW_STATE{
  function class (line 28) | class CDCTransformer {
  function class (line 141) | class ControlIder
  type FREETYPE_PARAMS (line 189) | struct FREETYPE_PARAMS
  function get (line 260) | int get(WORD first, WORD second) {
  function FreeTypeDrawInfo (line 275) | struct FreeTypeDrawInfo
  function FT_Face (line 358) | FT_Face GetFace(int index)	// get face list
  function Validate (line 380) | void Validate()

FILE: ft2vert.c
  type ivs_otft_desc (line 31) | struct ivs_otft_desc {
  type ft2vert_st (line 81) | struct ft2vert_st {
  type RangeRecord_st (line 108) | struct RangeRecord_st {
  function isInIndex (line 114) | int isInIndex(FT_Bytes s, int index) {
  function print_offset (line 131) | void print_offset(char *message, const FT_Bytes ptr) {
  function hex_dump (line 144) | void hex_dump(const FT_Bytes top) {
  function scan_Coverage (line 160) | void scan_Coverage(struct ft2vert_st *ret, const FT_Bytes top, const int...
  function scan_SubTable (line 196) | void scan_SubTable(struct ft2vert_st *ret, const FT_Bytes top, const int...
  function scan_Lookup (line 228) | void scan_Lookup(struct ft2vert_st *ret, const FT_Bytes top, const int l) {
  function scan_LookupList (line 257) | void scan_LookupList(struct ft2vert_st *ret, const FT_Bytes top) {
  function scan_FeatureList (line 280) | void scan_FeatureList(struct ft2vert_st *ret, const FT_Bytes top) {
  function scan_LangSys (line 317) | void scan_LangSys(struct ft2vert_st *ret, const FT_Bytes top, const FT_T...
  function scan_Script (line 322) | void scan_Script(struct ft2vert_st *ret, const FT_Bytes top, const FT_Ta...
  function scan_ScriptList (line 343) | void scan_ScriptList(struct ft2vert_st *ret, const FT_Bytes top) {
  function scan_GSUB_Header (line 361) | void scan_GSUB_Header(struct ft2vert_st *ret, const FT_Bytes top) {
  type ft2vert_st (line 390) | struct ft2vert_st
  type ft2vert_st (line 391) | struct ft2vert_st
  function ft2vert_final (line 439) | void ft2vert_final(FT_Face face, struct ft2vert_st *vert){
  function FT_UInt (line 463) | static FT_UInt get_vert_nth_gid(struct SubTable_st *t, FT_UInt gid, int ...
  function FT_UInt (line 477) | FT_UInt ft2gsub_get_gid(const struct ft2vert_st *ft2vert, const FT_UInt ...
  function FT_UInt (line 510) | FT_UInt ft2vert_get_gid(const struct ft2vert_st *ft2vert, const FT_UInt ...
  function glyphs_comp (line 515) | int glyphs_comp(const void *_a, const void *_b) {
  function FT_UInt (line 526) | FT_UInt ft2_subst_uvs(const FT_Face face, const FT_UInt gid, const FT_UI...

FILE: ft2vert.h
  type ft2vert_st (line 7) | struct ft2vert_st
  type ft2vert_st (line 8) | struct ft2vert_st
  type ft2vert_st (line 12) | struct ft2vert_st

FILE: fteng.cpp
  function EnumFontCallBack (line 28) | int CALLBACK EnumFontCallBack(const LOGFONT *lplf, const TEXTMETRIC *lpt...
  function GetFontLocalName (line 38) | bool GetFontLocalName(TCHAR* pszFontName, __out TCHAR* pszNameOut)	//获得字...
  function LOGFONTW (line 59) | LOGFONTW* GetFontNameFromFile(LPCWSTR Filename)	//获得一个字体文件内包含的所有字体名称s
  type GCCounterSortFunc (line 102) | struct GCCounterSortFunc : public std::binary_function<const T*, const T...
  type DeleteCharFunc (line 112) | struct DeleteCharFunc : public std::unary_function<FreeTypeCharData*&, v...
  function CompactMap (line 124) | void CompactMap(T& pp, int count, int reduce)
  function Compact (line 139) | void Compact(T** pp, int count, int reduce)
  function FreeTypeFontCache (line 441) | FreeTypeFontCache* FreeTypeFontInfo::GetCache(FTC_ScalerRec& scaler, con...
  function BOOL (line 493) | BOOL FreeTypeFontEngine::RemoveFont(FreeTypeFontInfo* fontinfo)
  function BOOL (line 525) | BOOL FreeTypeFontEngine::RemoveThisFont(FreeTypeFontInfo* fontinfo, LOGF...
  function BOOL (line 542) | BOOL FreeTypeFontEngine::RemoveFont(LPCWSTR FontName)
  function GetFaceID (line 586) | int GetFaceID(void)
  function ReleaseFaceID (line 591) | void ReleaseFaceID(void)
  function FreeTypeFontInfo (line 596) | FreeTypeFontInfo* FreeTypeFontEngine::AddFont(void* lpparams)
  function FreeTypeFontInfo (line 672) | FreeTypeFontInfo* FreeTypeFontEngine::AddFont(LPCTSTR lpFaceName, int we...
  function FreeTypeFontInfo (line 758) | FreeTypeFontInfo* FreeTypeFontEngine::FindFont(void* lpparams)
  function FreeTypeFontInfo (line 775) | FreeTypeFontInfo* FreeTypeFontEngine::FindFont(LPCTSTR lpFaceName, int w...
  function FreeTypeFontInfo (line 808) | FreeTypeFontInfo* FreeTypeFontEngine::FindFont(int faceid)
  function FreeTypeSysFontData (line 837) | FreeTypeSysFontData* FreeTypeSysFontData::CreateInstance(LPCTSTR name, i...

FILE: fteng.h
  type set (line 20) | typedef set<CBitmapCache*> CTLSDCArray;
  type CFontSetCache (line 26) | struct CFontSetCache
  function CFontSettings (line 49) | const CFontSettings*& Get(FTC_FaceID faceid) const
  function hash (line 55) | struct myfont
  function class (line 125) | class FreeTypeMruCounter
  function class (line 143) | class FreeTypeCharData : public FreeTypeMruCounter
  function FreeTypeCharData (line 223) | FreeTypeCharData** _GetChar(WCHAR wch)
  function FreeTypeCharData (line 232) | FreeTypeCharData** _GetGlyph(UINT glyph)
  function TEXTMETRIC (line 246) | const TEXTMETRIC& GetTextMetric(HDC hdc)
  function Equals (line 254) | bool Equals(int px, int weight, bool italic) const
  function FreeTypeCharData (line 258) | FreeTypeCharData* FindChar(WCHAR wch)
  function FreeTypeCharData (line 268) | FreeTypeCharData* FindGlyphIndex(UINT glyph)
  function Activate (line 278) | bool Activate()
  function Deactive (line 288) | void Deactive() { m_active = false; }
  type map (line 315) | typedef map<UINT, FreeTypeFontCache*>	CacheArray;
  function Release (line 329) | void Release() {
  function TT_OS2 (line 333) | TT_OS2* GetOS2Table()
  function BOOL (line 349) | BOOL FontHasHinting()
  function wstring (line 369) | wstring GetFullName() {return m_fullname;}
  function UINT (line 372) | UINT getCacheHash(int px, int weight, bool italic, int width) {return ((...
  function HFONT (line 439) | HFONT GetGGOFont(){return m_ggoFont;}
  function CalcBoldWeight (line 444) | int CalcBoldWeight(int weight) const
  function CalcBoldWeight (line 454) | int CalcBoldWeight(const LOGFONT& lf) const
  function CalcItalicSlant (line 458) | void CalcItalicSlant(FT_Matrix& matrix) const
  function Equals (line 467) | bool Equals(const StringHashFont& hash, int weight, bool italic) const
  function UpdateFontSetting (line 472) | void UpdateFontSetting()
  function GetFTLink (line 482) | int GetFTLink(FTC_FaceID** llplink)
  function GetGGOLink (line 490) | int GetGGOLink(HFONT** llplink)
  function FTC_FaceID (line 498) | FTC_FaceID GetSimSunID() {return m_SimSunID;}
  function SetFontSettings (line 510) | void SetFontSettings(const CFontSettings& set) { m_set = set;}
  function Erase (line 515) | void Erase()
  function class (line 527) | class FreeTypeFontEngine : public FreeTypeGCCounter
  function FT_Face (line 696) | FT_Face GetFace()

FILE: ftref.c
  function FT_Error (line 7) | FT_Error FT_Glyph_Ref_Copy( FT_Referenced_Glyph source,  FT_Referenced_G...
  function FT_Done_Ref_Glyph (line 18) | void FT_Done_Ref_Glyph( FT_Referenced_Glyph *glyph )
  function FT_Glyph_To_Ref_Glyph (line 29) | void FT_Glyph_To_Ref_Glyph( FT_Glyph source, FT_Referenced_Glyph *target)
  function FT_Referenced_Glyph (line 36) | FT_Referenced_Glyph New_FT_Ref_Glyph()

FILE: ftref.h
  type FT_Referenced_GlyphRec (line 8) | typedef struct
  type FT_Referenced_BitmapGlyphRec (line 14) | typedef struct

FILE: gdiPlusFlat2.cpp
  function InitGdiplusFuncs (line 15) | bool InitGdiplusFuncs(){

FILE: gdiPlusFlat2.h
  type Status (line 12) | typedef Status GpStatus;

FILE: hash_list.cpp
  function TCHAR (line 25) | TCHAR * CHashedStringList::Find(TCHAR * String)

FILE: hash_list.h
  type std (line 8) | typedef std::map<std::wstring, LPTSTR> strmap;
  function class (line 10) | class CHashedStringList

FILE: hook.cpp
  function hook_initinternal (line 78) | static void hook_initinternal()
  function LONG (line 92) | static LONG hook_init()
  function hook_term (line 134) | static void hook_term()
  function hook_initinternal (line 181) | static void hook_initinternal()
  function LONG (line 198) | static LONG hook_init()
  function LONG (line 245) | static LONG hook_term()
  function BOOL (line 279) | BOOL WINAPI IsRunAsUser(VOID)
  function BOOL (line 411) | BOOL AddEasyHookEnv()
  function HookFontCreation (line 434) | void HookFontCreation() {
  function EZHookMain (line 459) | void EZHookMain(HINSTANCE instance, DWORD reason, LPVOID lpReserved) {
  function BOOL (line 494) | BOOL WINAPI  DllMain(HINSTANCE instance, DWORD reason, LPVOID lpReserved)

FILE: hookCounter.h
  function class (line 6) | class HCounter {

FILE: json.hpp
  type nlohmann (line 97) | namespace nlohmann
    type detail (line 99) | namespace detail
      type value_t (line 129) | enum class value_t : std::uint8_t
      type make_void (line 2238) | struct make_void
      type nonesuch (line 2252) | struct nonesuch
        method nonesuch (line 2254) | nonesuch() = delete;
        method nonesuch (line 2256) | nonesuch(nonesuch const&) = delete;
        method nonesuch (line 2257) | nonesuch(nonesuch const&&) = delete;
      type detector (line 2266) | struct detector
      type is_detected_lazy (line 2283) | struct is_detected_lazy : is_detected<Op, Args...> { }
      function replace_substring (line 2725) | inline void replace_substring(std::string& s, const std::string& f,
      function escape (line 2743) | inline std::string escape(std::string s)
      function unescape (line 2757) | static void unescape(std::string& s)
      type position_t (line 2776) | struct position_t
      class exception (line 2808) | class exception : public std::exception
        method JSON_HEDLEY_NON_NULL (line 2821) | JSON_HEDLEY_NON_NULL(3)
        method name (line 2824) | static std::string name(const std::string& ename, int id_)
        method diagnostics (line 2830) | static std::string diagnostics(const BasicJsonType& leaf_element)
      class parse_error (line 2900) | class parse_error : public exception
        method parse_error (line 2913) | static parse_error create(int id_, const position_t& pos, const st...
        method parse_error (line 2921) | static parse_error create(int id_, std::size_t byte_, const std::s...
        method parse_error (line 2941) | parse_error(int id_, std::size_t byte_, const char* what_arg)
        method position_string (line 2944) | static std::string position_string(const position_t& pos)
      class invalid_iterator (line 2953) | class invalid_iterator : public exception
        method invalid_iterator (line 2957) | static invalid_iterator create(int id_, const std::string& what_ar...
        method JSON_HEDLEY_NON_NULL (line 2964) | JSON_HEDLEY_NON_NULL(3)
      class type_error (line 2971) | class type_error : public exception
        method type_error (line 2975) | static type_error create(int id_, const std::string& what_arg, con...
        method JSON_HEDLEY_NON_NULL (line 2982) | JSON_HEDLEY_NON_NULL(3)
      class out_of_range (line 2988) | class out_of_range : public exception
        method out_of_range (line 2992) | static out_of_range create(int id_, const std::string& what_arg, c...
        method JSON_HEDLEY_NON_NULL (line 2999) | JSON_HEDLEY_NON_NULL(3)
      class other_error (line 3005) | class other_error : public exception
        method other_error (line 3009) | static other_error create(int id_, const std::string& what_arg, co...
        method JSON_HEDLEY_NON_NULL (line 3016) | JSON_HEDLEY_NON_NULL(3)
      type integer_sequence (line 3082) | struct integer_sequence
        method size (line 3085) | static constexpr std::size_t size() noexcept
      type utility_internal (line 3099) | namespace utility_internal
        type Extend (line 3103) | struct Extend
        type Gen (line 3121) | struct Gen
        type Gen<T, 0> (line 3128) | struct Gen<T, 0>
      type priority_tag (line 3166) | struct priority_tag : priority_tag < N - 1 > {}
      type priority_tag<0> (line 3167) | struct priority_tag<0> {}
      type static_const (line 3171) | struct static_const
      type identity_tag (line 3190) | struct identity_tag {}
      type iterator_types (line 3220) | struct iterator_types {}
      type iterator_types <
    It,
    void_t<typename It::difference_type, typename It::value_type, typename It::pointer,
    typename It::reference, typename It::iterator_category >> (line 3223) | struct iterator_types <
      type iterator_traits (line 3238) | struct iterator_traits
      type iterator_traits < T, enable_if_t < !std::is_pointer<T>::value >> (line 3243) | struct iterator_traits < T, enable_if_t < !std::is_pointer<T>::value >>
      type iterator_traits<T*, enable_if_t<std::is_object<T>::value>> (line 3249) | struct iterator_traits<T*, enable_if_t<std::is_object<T>::value>>
      type is_basic_json (line 3378) | struct is_basic_json : std::false_type {}
      class json_ref (line 3388) | class json_ref
        method json_ref (line 13084) | json_ref(value_type&& value)
        method json_ref (line 13088) | json_ref(const value_type& value)
        method json_ref (line 13092) | json_ref(std::initializer_list<json_ref> init)
        method json_ref (line 13099) | json_ref(Args && ... args)
        method json_ref (line 13104) | json_ref(json_ref&&) noexcept = default;
        method json_ref (line 13105) | json_ref(const json_ref&) = delete;
        method json_ref (line 13106) | json_ref& operator=(const json_ref&) = delete;
        method json_ref (line 13107) | json_ref& operator=(json_ref&&) = delete;
        method value_type (line 13110) | value_type moved_or_copied() const
        method value_type (line 13119) | value_type const& operator*() const
        method value_type (line 13124) | value_type const* operator->() const
      type is_json_ref (line 3391) | struct is_json_ref : std::false_type {}
      type is_json_ref<json_ref<T>> (line 3394) | struct is_json_ref<json_ref<T>> : std::true_type {}
      type has_from_json (line 3432) | struct has_from_json : std::false_type {}
      type is_getable (line 3439) | struct is_getable
      type has_from_json < BasicJsonType, T, enable_if_t < !is_basic_json<T>::value >> (line 3445) | struct has_from_json < BasicJsonType, T, enable_if_t < !is_basic_jso...
      type has_non_default_from_json (line 3457) | struct has_non_default_from_json : std::false_type {}
      type has_non_default_from_json < BasicJsonType, T, enable_if_t < !is_basic_json<T>::value >> (line 3460) | struct has_non_default_from_json < BasicJsonType, T, enable_if_t < !...
      type has_to_json (line 3472) | struct has_to_json : std::false_type {}
      type has_to_json < BasicJsonType, T, enable_if_t < !is_basic_json<T>::value >> (line 3475) | struct has_to_json < BasicJsonType, T, enable_if_t < !is_basic_json<...
      type conjunction (line 3490) | struct conjunction : std::true_type { }
      type conjunction<B1> (line 3491) | struct conjunction<B1> : B1 { }
      type negation (line 3497) | struct negation : std::integral_constant < bool, !B::value > { }
      type is_default_constructible (line 3503) | struct is_default_constructible : std::is_default_constructible<T> {}
      type is_default_constructible<std::pair<T1, T2>> (line 3506) | struct is_default_constructible<std::pair<T1, T2>>
      type is_default_constructible<const std::pair<T1, T2>> (line 3510) | struct is_default_constructible<const std::pair<T1, T2>>
      type is_constructible (line 3523) | struct is_constructible : std::is_constructible<T, Args...> {}
      type is_constructible<std::pair<T1, T2>> (line 3526) | struct is_constructible<std::pair<T1, T2>> : is_default_constructibl...
      type is_constructible<const std::pair<T1, T2>> (line 3529) | struct is_constructible<const std::pair<T1, T2>> : is_default_constr...
      type is_iterator_traits (line 3539) | struct is_iterator_traits : std::false_type {}
      type is_iterator_traits<iterator_traits<T>> (line 3542) | struct is_iterator_traits<iterator_traits<T>>
      type is_range (line 3557) | struct is_range
      type is_complete_type (line 3586) | struct is_complete_type : std::false_type {}
      type is_complete_type<T, decltype(void(sizeof(T)))> (line 3589) | struct is_complete_type<T, decltype(void(sizeof(T)))> : std::true_ty...
      type is_compatible_object_type_impl (line 3593) | struct is_compatible_object_type_impl : std::false_type {}
      type is_compatible_object_type_impl <
    BasicJsonType, CompatibleObjectType,
    enable_if_t < is_detected<mapped_type_t, CompatibleObjectType>::value&&
    is_detected<key_type_t, CompatibleObjectType>::value >> (line 3596) | struct is_compatible_object_type_impl <
      type is_compatible_object_type (line 3612) | struct is_compatible_object_type
      type is_constructible_object_type_impl (line 3617) | struct is_constructible_object_type_impl : std::false_type {}
      type is_constructible_object_type_impl <
    BasicJsonType, ConstructibleObjectType,
    enable_if_t < is_detected<mapped_type_t, ConstructibleObjectType>::value&&
    is_detected<key_type_t, ConstructibleObjectType>::value >> (line 3620) | struct is_constructible_object_type_impl <
      type is_constructible_object_type (line 3644) | struct is_constructible_object_type
      type is_compatible_string_type (line 3649) | struct is_compatible_string_type
      type is_constructible_string_type (line 3656) | struct is_constructible_string_type
      type is_compatible_array_type_impl (line 3664) | struct is_compatible_array_type_impl : std::false_type {}
      type is_compatible_array_type (line 3682) | struct is_compatible_array_type
      type is_constructible_array_type_impl (line 3686) | struct is_constructible_array_type_impl : std::false_type {}
      type is_constructible_array_type_impl <
    BasicJsonType, ConstructibleArrayType,
    enable_if_t<std::is_same<ConstructibleArrayType,
    typename BasicJsonType::value_type>::value >> (line 3689) | struct is_constructible_array_type_impl <
      type is_constructible_array_type (line 3726) | struct is_constructible_array_type
      type is_compatible_integer_type_impl (line 3731) | struct is_compatible_integer_type_impl : std::false_type {}
      type is_compatible_integer_type_impl <
    RealIntegerType, CompatibleNumberIntegerType,
    enable_if_t < std::is_integral<RealIntegerType>::value&&
    std::is_integral<CompatibleNumberIntegerType>::value&&
    !std::is_same<bool, CompatibleNumberIntegerType>::value >> (line 3734) | struct is_compatible_integer_type_impl <
      type is_compatible_integer_type (line 3752) | struct is_compatible_integer_type
      type is_compatible_type_impl (line 3757) | struct is_compatible_type_impl: std::false_type {}
      type is_compatible_type_impl <
    BasicJsonType, CompatibleType,
    enable_if_t<is_complete_type<CompatibleType>::value >> (line 3760) | struct is_compatible_type_impl <
      type is_compatible_type (line 3769) | struct is_compatible_type
      type is_constructible_tuple (line 3773) | struct is_constructible_tuple : std::false_type {}
      type is_ordered_map (line 3781) | struct is_ordered_map
        type two (line 3785) | struct two
      function T (line 3798) | T conditional_static_cast(U value)
      function T (line 3804) | T conditional_static_cast(U value)
      function from_json (line 3834) | void from_json(const BasicJsonType& j, typename std::nullptr_t& n)
      function get_arithmetic_value (line 3848) | void get_arithmetic_value(const BasicJsonType& j, ArithmeticType& val)
      function from_json (line 3881) | void from_json(const BasicJsonType& j, typename BasicJsonType::boole...
      function from_json (line 3891) | void from_json(const BasicJsonType& j, typename BasicJsonType::strin...
      function from_json (line 3907) | void from_json(const BasicJsonType& j, ConstructibleStringType& s)
      function from_json (line 3918) | void from_json(const BasicJsonType& j, typename BasicJsonType::numbe...
      function from_json (line 3924) | void from_json(const BasicJsonType& j, typename BasicJsonType::numbe...
      function from_json (line 3930) | void from_json(const BasicJsonType& j, typename BasicJsonType::numbe...
      function from_json (line 3937) | void from_json(const BasicJsonType& j, EnumType& e)
      function from_json (line 3947) | void from_json(const BasicJsonType& j, std::forward_list<T, Allocato...
      function from_json (line 3964) | void from_json(const BasicJsonType& j, std::valarray<T>& l)
      function from_json (line 3979) | auto from_json(const BasicJsonType& j, T (&arr)[N])  // NOLINT(cppco...
      function from_json_array_impl (line 3989) | void from_json_array_impl(const BasicJsonType& j, typename BasicJson...
      function from_json_array_impl (line 3995) | auto from_json_array_impl(const BasicJsonType& j, std::array<T, N>& ...
      function from_json_array_impl (line 4009) | auto from_json_array_impl(const BasicJsonType& j, ConstructibleArray...
      function from_json_array_impl (line 4033) | void from_json_array_impl(const BasicJsonType& j, ConstructibleArray...
      function from_json (line 4058) | auto from_json(const BasicJsonType& j, ConstructibleArrayType& arr)
      function from_json_inplace_array_impl (line 4072) | std::array<T, sizeof...(Idx)> from_json_inplace_array_impl(BasicJson...
      function from_json (line 4079) | auto from_json(BasicJsonType&& j, identity_tag<std::array<T, N>> tag)
      function from_json (line 4091) | void from_json(const BasicJsonType& j, typename BasicJsonType::binar...
      function from_json (line 4103) | void from_json(const BasicJsonType& j, ConstructibleObjectType& obj)
      function from_json (line 4135) | void from_json(const BasicJsonType& j, ArithmeticType& val)
      function from_json_tuple_impl_base (line 4172) | std::tuple<Args...> from_json_tuple_impl_base(BasicJsonType&& j, ind...
      function from_json_tuple_impl (line 4178) | std::pair<A1, A2> from_json_tuple_impl(BasicJsonType&& j, identity_t...
      function from_json_tuple_impl (line 4185) | void from_json_tuple_impl(BasicJsonType&& j, std::pair<A1, A2>& p, p...
      function from_json_tuple_impl (line 4191) | std::tuple<Args...> from_json_tuple_impl(BasicJsonType&& j, identity...
      function from_json_tuple_impl (line 4197) | void from_json_tuple_impl(BasicJsonType&& j, std::tuple<Args...>& t,...
      function from_json (line 4203) | auto from_json(BasicJsonType&& j, TupleRelated&& t)
      function from_json (line 4217) | void from_json(const BasicJsonType& j, std::map<Key, Value, Compare,...
      function from_json (line 4237) | void from_json(const BasicJsonType& j, std::unordered_map<Key, Value...
      function from_json (line 4256) | void from_json(const BasicJsonType& j, std_fs::path& p)
      type from_json_fn (line 4266) | struct from_json_fn
      function int_to_string (line 4320) | void int_to_string( string_type& target, std::size_t value )
      class iteration_proxy_value (line 4326) | class iteration_proxy_value
        method iteration_proxy_value (line 4349) | explicit iteration_proxy_value(IteratorType it) noexcept
        method iteration_proxy_value (line 4354) | iteration_proxy_value& operator*()
        method iteration_proxy_value (line 4360) | iteration_proxy_value& operator++()
        method string_type (line 4381) | const string_type& key() const
        method value (line 4417) | typename IteratorType::reference value() const
      class iteration_proxy (line 4424) | class iteration_proxy
        method iteration_proxy (line 4432) | explicit iteration_proxy(typename IteratorType::reference cont) no...
        method begin (line 4436) | iteration_proxy_value<IteratorType> begin() noexcept
        method end (line 4442) | iteration_proxy_value<IteratorType> end() noexcept
      function get (line 4451) | auto get(const nlohmann::detail::iteration_proxy_value<IteratorType>...
      function get (line 4459) | auto get(const nlohmann::detail::iteration_proxy_value<IteratorType>...
      type external_constructor (line 4530) | struct external_constructor
      type external_constructor<value_t::boolean> (line 4533) | struct external_constructor<value_t::boolean>
        method construct (line 4536) | static void construct(BasicJsonType& j, typename BasicJsonType::bo...
      type external_constructor<value_t::string> (line 4546) | struct external_constructor<value_t::string>
        method construct (line 4549) | static void construct(BasicJsonType& j, const typename BasicJsonTy...
        method construct (line 4558) | static void construct(BasicJsonType& j, typename BasicJsonType::st...
        method construct (line 4569) | static void construct(BasicJsonType& j, const CompatibleStringType...
      type external_constructor<value_t::binary> (line 4579) | struct external_constructor<value_t::binary>
        method construct (line 4582) | static void construct(BasicJsonType& j, const typename BasicJsonTy...
        method construct (line 4591) | static void construct(BasicJsonType& j, typename BasicJsonType::bi...
      type external_constructor<value_t::number_float> (line 4601) | struct external_constructor<value_t::number_float>
        method construct (line 4604) | static void construct(BasicJsonType& j, typename BasicJsonType::nu...
      type external_constructor<value_t::number_unsigned> (line 4614) | struct external_constructor<value_t::number_unsigned>
        method construct (line 4617) | static void construct(BasicJsonType& j, typename BasicJsonType::nu...
      type external_constructor<value_t::number_integer> (line 4627) | struct external_constructor<value_t::number_integer>
        method construct (line 4630) | static void construct(BasicJsonType& j, typename BasicJsonType::nu...
      type external_constructor<value_t::array> (line 4640) | struct external_constructor<value_t::array>
        method construct (line 4643) | static void construct(BasicJsonType& j, const typename BasicJsonTy...
        method construct (line 4653) | static void construct(BasicJsonType& j, typename BasicJsonType::ar...
        method construct (line 4665) | static void construct(BasicJsonType& j, const CompatibleArrayType&...
        method construct (line 4678) | static void construct(BasicJsonType& j, const std::vector<bool>& arr)
        method construct (line 4694) | static void construct(BasicJsonType& j, const std::valarray<T>& arr)
      type external_constructor<value_t::object> (line 4710) | struct external_constructor<value_t::object>
        method construct (line 4713) | static void construct(BasicJsonType& j, const typename BasicJsonTy...
        method construct (line 4723) | static void construct(BasicJsonType& j, typename BasicJsonType::ob...
        method construct (line 4734) | static void construct(BasicJsonType& j, const CompatibleObjectType...
      function to_json (line 4753) | void to_json(BasicJsonType& j, T b) noexcept
      function to_json (line 4760) | void to_json(BasicJsonType& j, const CompatibleString& s)
      function to_json (line 4766) | void to_json(BasicJsonType& j, typename BasicJsonType::string_t&& s)
      function to_json (line 4773) | void to_json(BasicJsonType& j, FloatType val) noexcept
      function to_json (line 4780) | void to_json(BasicJsonType& j, CompatibleNumberUnsignedType val) noe...
      function to_json (line 4787) | void to_json(BasicJsonType& j, CompatibleNumberIntegerType val) noex...
      function to_json (line 4794) | void to_json(BasicJsonType& j, EnumType e) noexcept
      function to_json (line 4801) | void to_json(BasicJsonType& j, const std::vector<bool>& e)
      function to_json (line 4814) | void to_json(BasicJsonType& j, const CompatibleArrayType& arr)
      function to_json (line 4820) | void to_json(BasicJsonType& j, const typename BasicJsonType::binary_...
      function to_json (line 4827) | void to_json(BasicJsonType& j, const std::valarray<T>& arr)
      function to_json (line 4833) | void to_json(BasicJsonType& j, typename BasicJsonType::array_t&& arr)
      function to_json (line 4840) | void to_json(BasicJsonType& j, const CompatibleObjectType& obj)
      function to_json (line 4846) | void to_json(BasicJsonType& j, typename BasicJsonType::object_t&& obj)
      function to_json (line 4856) | void to_json(BasicJsonType& j, const T(&arr)[N]) // NOLINT(cppcoregu...
      function to_json (line 4862) | void to_json(BasicJsonType& j, const std::pair<T1, T2>& p)
      function to_json (line 4870) | void to_json(BasicJsonType& j, const T& b)
      function to_json_tuple_impl (line 4876) | void to_json_tuple_impl(BasicJsonType& j, const Tuple& t, index_sequ...
      function to_json (line 4882) | void to_json(BasicJsonType& j, const T& t)
      function to_json (line 4889) | void to_json(BasicJsonType& j, const std_fs::path& p)
      type to_json_fn (line 4895) | struct to_json_fn
      function combine (line 5079) | inline std::size_t combine(std::size_t seed, std::size_t h) noexcept
      function hash (line 5097) | std::size_t hash(const BasicJsonType& j)
      type input_format_t (line 5233) | enum class input_format_t { json, cbor, msgpack, ubjson, bson }
      class file_input_adapter (line 5244) | class file_input_adapter
        method file_input_adapter (line 5250) | explicit file_input_adapter(std::FILE* f) noexcept
        method file_input_adapter (line 5255) | file_input_adapter(const file_input_adapter&) = delete;
        method file_input_adapter (line 5256) | file_input_adapter(file_input_adapter&&) noexcept = default;
        method file_input_adapter (line 5257) | file_input_adapter& operator=(const file_input_adapter&) = delete;
        method file_input_adapter (line 5258) | file_input_adapter& operator=(file_input_adapter&&) = delete;
        method get_character (line 5261) | std::char_traits<char>::int_type get_character() noexcept
      class input_stream_adapter (line 5281) | class input_stream_adapter
        method input_stream_adapter (line 5296) | explicit input_stream_adapter(std::istream& i)
        method input_stream_adapter (line 5301) | input_stream_adapter(const input_stream_adapter&) = delete;
        method input_stream_adapter (line 5302) | input_stream_adapter& operator=(input_stream_adapter&) = delete;
        method input_stream_adapter (line 5303) | input_stream_adapter& operator=(input_stream_adapter&&) = delete;
        method input_stream_adapter (line 5305) | input_stream_adapter(input_stream_adapter&& rhs) noexcept
        method get_character (line 5315) | std::char_traits<char>::int_type get_character()
      class iterator_input_adapter (line 5336) | class iterator_input_adapter
        method iterator_input_adapter (line 5341) | iterator_input_adapter(IteratorType first, IteratorType last)
        method get_character (line 5345) | typename std::char_traits<char_type>::int_type get_character()
        method empty (line 5364) | bool empty() const
      type wide_string_input_helper (line 5372) | struct wide_string_input_helper
      type wide_string_input_helper<BaseInputAdapter, 4> (line 5375) | struct wide_string_input_helper<BaseInputAdapter, 4>
        method fill_buffer (line 5378) | static void fill_buffer(BaseInputAdapter& input,
      type wide_string_input_helper<BaseInputAdapter, 2> (line 5433) | struct wide_string_input_helper<BaseInputAdapter, 2>
        method fill_buffer (line 5436) | static void fill_buffer(BaseInputAdapter& input,
      class wide_string_input_adapter (line 5496) | class wide_string_input_adapter
        method wide_string_input_adapter (line 5501) | wide_string_input_adapter(BaseInputAdapter base)
        method get_character (line 5504) | typename std::char_traits<char>::int_type get_character() noexcept
        method fill_buffer (line 5525) | void fill_buffer()
      type iterator_input_adapter_factory (line 5541) | struct iterator_input_adapter_factory
        method adapter_type (line 5547) | static adapter_type create(IteratorType first, IteratorType last)
      type is_iterator_of_multibyte (line 5554) | struct is_iterator_of_multibyte
      type iterator_input_adapter_factory<IteratorType, enable_if_t<is_iterator_of_multibyte<IteratorType>::value>> (line 5564) | struct iterator_input_adapter_factory<IteratorType, enable_if_t<is_i...
        method adapter_type (line 5571) | static adapter_type create(IteratorType first, IteratorType last)
      function input_adapter (line 5579) | typename iterator_input_adapter_factory<IteratorType>::adapter_type ...
      type container_input_adapter_factory_impl (line 5589) | namespace container_input_adapter_factory_impl
        type container_input_adapter_factory (line 5596) | struct container_input_adapter_factory {}
        type container_input_adapter_factory< ContainerType,
       void_t<decltype(begin(std::declval<ContainerType>()), end(std::declval<ContainerType>()))>> (line 5599) | struct container_input_adapter_factory< ContainerType,
          method adapter_type (line 5604) | static adapter_type create(const ContainerType& container)
      function input_adapter (line 5613) | typename container_input_adapter_factory_impl::container_input_adapt...
      function file_input_adapter (line 5620) | inline file_input_adapter input_adapter(std::FILE* file)
        method file_input_adapter (line 5250) | explicit file_input_adapter(std::FILE* f) noexcept
        method file_input_adapter (line 5255) | file_input_adapter(const file_input_adapter&) = delete;
        method file_input_adapter (line 5256) | file_input_adapter(file_input_adapter&&) noexcept = default;
        method file_input_adapter (line 5257) | file_input_adapter& operator=(const file_input_adapter&) = delete;
        method file_input_adapter (line 5258) | file_input_adapter& operator=(file_input_adapter&&) = delete;
        method get_character (line 5261) | std::char_traits<char>::int_type get_character() noexcept
      function input_stream_adapter (line 5625) | inline input_stream_adapter input_adapter(std::istream& stream)
        method input_stream_adapter (line 5296) | explicit input_stream_adapter(std::istream& i)
        method input_stream_adapter (line 5301) | input_stream_adapter(const input_stream_adapter&) = delete;
        method input_stream_adapter (line 5302) | input_stream_adapter& operator=(input_stream_adapter&) = delete;
        method input_stream_adapter (line 5303) | input_stream_adapter& operator=(input_stream_adapter&&) = delete;
        method input_stream_adapter (line 5305) | input_stream_adapter(input_stream_adapter&& rhs) noexcept
        method get_character (line 5315) | std::char_traits<char>::int_type get_character()
      function input_stream_adapter (line 5630) | inline input_stream_adapter input_adapter(std::istream&& stream)
        method input_stream_adapter (line 5296) | explicit input_stream_adapter(std::istream& i)
        method input_stream_adapter (line 5301) | input_stream_adapter(const input_stream_adapter&) = delete;
        method input_stream_adapter (line 5302) | input_stream_adapter& operator=(input_stream_adapter&) = delete;
        method input_stream_adapter (line 5303) | input_stream_adapter& operator=(input_stream_adapter&&) = delete;
        method input_stream_adapter (line 5305) | input_stream_adapter(input_stream_adapter&& rhs) noexcept
        method get_character (line 5315) | std::char_traits<char>::int_type get_character()
      function contiguous_bytes_input_adapter (line 5646) | contiguous_bytes_input_adapter input_adapter(CharT b)
      function input_adapter (line 5654) | auto input_adapter(T (&array)[N]) -> decltype(input_adapter(array, a...
      class span_input_adapter (line 5662) | class span_input_adapter
        method span_input_adapter (line 5671) | span_input_adapter(CharT b, std::size_t l)
        method span_input_adapter (line 5678) | span_input_adapter(IteratorType first, IteratorType last)
        method contiguous_bytes_input_adapter (line 5681) | contiguous_bytes_input_adapter&& get()
      class json_sax_dom_parser (line 5848) | class json_sax_dom_parser
        method json_sax_dom_parser (line 5862) | explicit json_sax_dom_parser(BasicJsonType& r, const bool allow_ex...
        method json_sax_dom_parser (line 5867) | json_sax_dom_parser(const json_sax_dom_parser&) = delete;
        method json_sax_dom_parser (line 5868) | json_sax_dom_parser(json_sax_dom_parser&&) = default;
        method json_sax_dom_parser (line 5869) | json_sax_dom_parser& operator=(const json_sax_dom_parser&) = delete;
        method json_sax_dom_parser (line 5870) | json_sax_dom_parser& operator=(json_sax_dom_parser&&) = default;
        method null (line 5873) | bool null()
        method boolean (line 5879) | bool boolean(bool val)
        method number_integer (line 5885) | bool number_integer(number_integer_t val)
        method number_unsigned (line 5891) | bool number_unsigned(number_unsigned_t val)
        method number_float (line 5897) | bool number_float(number_float_t val, const string_t& /*unused*/)
        method string (line 5903) | bool string(string_t& val)
        method binary (line 5909) | bool binary(binary_t& val)
        method start_object (line 5915) | bool start_object(std::size_t len)
        method key (line 5927) | bool key(string_t& val)
        method end_object (line 5934) | bool end_object()
        method start_array (line 5941) | bool start_array(std::size_t len)
        method end_array (line 5953) | bool end_array()
        method parse_error (line 5961) | bool parse_error(std::size_t /*unused*/, const std::string& /*unus...
        method is_errored (line 5973) | constexpr bool is_errored() const
        method JSON_HEDLEY_RETURNS_NON_NULL (line 5986) | JSON_HEDLEY_RETURNS_NON_NULL
      class json_sax_dom_callback_parser (line 6022) | class json_sax_dom_callback_parser
        method json_sax_dom_callback_parser (line 6033) | json_sax_dom_callback_parser(BasicJsonType& r,
        method json_sax_dom_callback_parser (line 6042) | json_sax_dom_callback_parser(const json_sax_dom_callback_parser&) ...
        method json_sax_dom_callback_parser (line 6043) | json_sax_dom_callback_parser(json_sax_dom_callback_parser&&) = def...
        method json_sax_dom_callback_parser (line 6044) | json_sax_dom_callback_parser& operator=(const json_sax_dom_callbac...
        method json_sax_dom_callback_parser (line 6045) | json_sax_dom_callback_parser& operator=(json_sax_dom_callback_pars...
        method null (line 6048) | bool null()
        method boolean (line 6054) | bool boolean(bool val)
        method number_integer (line 6060) | bool number_integer(number_integer_t val)
        method number_unsigned (line 6066) | bool number_unsigned(number_unsigned_t val)
        method number_float (line 6072) | bool number_float(number_float_t val, const string_t& /*unused*/)
        method string (line 6078) | bool string(string_t& val)
        method binary (line 6084) | bool binary(binary_t& val)
        method start_object (line 6090) | bool start_object(std::size_t len)
        method key (line 6108) | bool key(string_t& val)
        method end_object (line 6125) | bool end_object()
        method start_array (line 6161) | bool start_array(std::size_t len)
        method end_array (line 6178) | bool end_array()
        method parse_error (line 6211) | bool parse_error(std::size_t /*unused*/, const std::string& /*unus...
        method is_errored (line 6223) | constexpr bool is_errored() const
        method handle_value (line 6245) | std::pair<bool, BasicJsonType*> handle_value(Value&& v, const bool...
      class json_sax_acceptor (line 6329) | class json_sax_acceptor
        method null (line 6338) | bool null()
        method boolean (line 6343) | bool boolean(bool /*unused*/)
        method number_integer (line 6348) | bool number_integer(number_integer_t /*unused*/)
        method number_unsigned (line 6353) | bool number_unsigned(number_unsigned_t /*unused*/)
        method number_float (line 6358) | bool number_float(number_float_t /*unused*/, const string_t& /*unu...
        method string (line 6363) | bool string(string_t& /*unused*/)
        method binary (line 6368) | bool binary(binary_t& /*unused*/)
        method start_object (line 6373) | bool start_object(std::size_t /*unused*/ = static_cast<std::size_t...
        method key (line 6378) | bool key(string_t& /*unused*/)
        method end_object (line 6383) | bool end_object()
        method start_array (line 6388) | bool start_array(std::size_t /*unused*/ = static_cast<std::size_t>...
        method end_array (line 6393) | bool end_array()
        method parse_error (line 6398) | bool parse_error(std::size_t /*unused*/, const std::string& /*unus...
      class lexer_base (line 6436) | class lexer_base
        type token_type (line 6440) | enum class token_type
      class lexer (line 6513) | class lexer : public lexer_base<BasicJsonType>
        method lexer (line 6525) | explicit lexer(InputAdapterType&& adapter, bool ignore_comments_ =...
        method lexer (line 6532) | lexer(const lexer&) = delete;
        method lexer (line 6533) | lexer(lexer&&) = default;
        method lexer (line 6534) | lexer& operator=(lexer&) = delete;
        method lexer (line 6535) | lexer& operator=(lexer&&) = default;
        method JSON_HEDLEY_PURE (line 6544) | JSON_HEDLEY_PURE
        method get_codepoint (line 6571) | int get_codepoint()
        method next_byte_in_range (line 6619) | bool next_byte_in_range(std::initializer_list<char_int_type> ranges)
        method token_type (line 6656) | token_type scan_string()
        method scan_comment (line 7246) | bool scan_comment()
        method strtof (line 7314) | static void strtof(float& f, const char* str, char** endptr) noexcept
        method strtof (line 7320) | static void strtof(double& f, const char* str, char** endptr) noex...
        method strtof (line 7326) | static void strtof(long double& f, const char* str, char** endptr)...
        method token_type (line 7371) | token_type scan_number()  // lgtm [cpp/use-of-goto]
      type is_sax (line 8104) | struct is_sax
      type is_sax_static_asserts (line 8135) | struct is_sax_static_asserts
      type cbor_tag_handler_t (line 8201) | enum class cbor_tag_handler_t
      function little_endianness (line 8215) | static inline bool little_endianness(int num = 1) noexcept
      class binary_reader (line 8229) | class binary_reader
        method binary_reader (line 8246) | explicit binary_reader(InputAdapterType&& adapter) noexcept : ia(s...
        method binary_reader (line 8252) | binary_reader(const binary_reader&) = delete;
        method binary_reader (line 8253) | binary_reader(binary_reader&&) = default;
        method binary_reader (line 8254) | binary_reader& operator=(const binary_reader&) = delete;
        method binary_reader (line 8255) | binary_reader& operator=(binary_reader&&) = default;
        method JSON_HEDLEY_NON_NULL (line 8266) | JSON_HEDLEY_NON_NULL(3)
        method parse_bson_internal (line 8329) | bool parse_bson_internal()
        method get_bson_cstr (line 8354) | bool get_bson_cstr(string_t& result)
        method get_bson_string (line 8384) | bool get_bson_string(const NumberType len, string_t& result)
        method get_bson_binary (line 8405) | bool get_bson_binary(const NumberType len, binary_t& result)
        method parse_bson_element_internal (line 8431) | bool parse_bson_element_internal(const char_int_type element_type,
        method parse_bson_element_list (line 8509) | bool parse_bson_element_list(const bool is_array)
        method parse_bson_array (line 8547) | bool parse_bson_array()
        method parse_cbor_internal (line 8577) | bool parse_cbor_internal(const bool get_char,
        method get_cbor_string (line 9065) | bool get_cbor_string(string_t& result)
        method get_cbor_binary (line 9160) | bool get_cbor_binary(binary_t& result)
        method get_cbor_array (line 9254) | bool get_cbor_array(const std::size_t len,
        method get_cbor_object (line 9292) | bool get_cbor_object(const std::size_t len,
        method parse_msgpack_internal (line 9348) | bool parse_msgpack_internal()
        method get_msgpack_string (line 9728) | bool get_msgpack_string(string_t& result)
        method get_msgpack_binary (line 9810) | bool get_msgpack_binary(binary_t& result)
        method get_msgpack_array (line 9921) | bool get_msgpack_array(const std::size_t len)
        method get_msgpack_object (line 9943) | bool get_msgpack_object(const std::size_t len)
        method parse_ubjson_internal (line 9980) | bool parse_ubjson_internal(const bool get_char = true)
        method get_ubjson_string (line 9999) | bool get_ubjson_string(string_t& result, const bool get_char = true)
        method get_ubjson_size_value (line 10053) | bool get_ubjson_size_value(std::size_t& result)
        method get_ubjson_size_type (line 10130) | bool get_ubjson_size_type(std::pair<std::size_t, char_int_type>& r...
        method get_ubjson_value (line 10171) | bool get_ubjson_value(const char_int_type prefix)
        method get_ubjson_array (line 10272) | bool get_ubjson_array()
        method get_ubjson_object (line 10334) | bool get_ubjson_object()
        method get_ubjson_high_precision_number (line 10409) | bool get_ubjson_high_precision_number()
        method char_int_type (line 10485) | char_int_type get()
        method char_int_type (line 10494) | char_int_type get_ignore_noop()
        method get_number (line 10519) | bool get_number(const input_format_t format, NumberType& result)
        method get_string (line 10562) | bool get_string(const input_format_t format,
        method get_binary (line 10595) | bool get_binary(const input_format_t format,
        method JSON_HEDLEY_NON_NULL (line 10618) | JSON_HEDLEY_NON_NULL(3)
        method get_token_string (line 10632) | std::string get_token_string() const
        method exception_message (line 10645) | std::string exception_message(const input_format_t format,
      type parse_event_t (line 10733) | enum class parse_event_t : std::uint8_t
      class parser (line 10759) | class parser
        method parser (line 10770) | explicit parser(InputAdapterType&& adapter,
        method parse (line 10792) | void parse(const bool strict, BasicJsonType& result)
        method accept (line 10852) | bool accept(const bool strict = true)
        method sax_parse (line 10860) | bool sax_parse(SAX* sax, const bool strict = true)
        method sax_parse_internal (line 10879) | bool sax_parse_internal(SAX* sax)
        method token_type (line 11160) | token_type get_token()
        method exception_message (line 11165) | std::string exception_message(const token_type expected, const std...
      class primitive_iterator_t (line 11233) | class primitive_iterator_t
        method difference_type (line 11245) | constexpr difference_type get_value() const noexcept
        method set_begin (line 11251) | void set_begin() noexcept
        method set_end (line 11257) | void set_end() noexcept
        method is_begin (line 11263) | constexpr bool is_begin() const noexcept
        method is_end (line 11269) | constexpr bool is_end() const noexcept
        method primitive_iterator_t (line 11284) | primitive_iterator_t operator+(difference_type n) noexcept
        method difference_type (line 11291) | constexpr difference_type operator-(primitive_iterator_t lhs, prim...
        method primitive_iterator_t (line 11296) | primitive_iterator_t& operator++() noexcept
        method primitive_iterator_t (line 11302) | primitive_iterator_t const operator++(int) noexcept // NOLINT(read...
        method primitive_iterator_t (line 11309) | primitive_iterator_t& operator--() noexcept
        method primitive_iterator_t (line 11315) | primitive_iterator_t const operator--(int) noexcept // NOLINT(read...
        method primitive_iterator_t (line 11322) | primitive_iterator_t& operator+=(difference_type n) noexcept
        method primitive_iterator_t (line 11328) | primitive_iterator_t& operator-=(difference_type n) noexcept
      type internal_iterator (line 11348) | struct internal_iterator
      class iteration_proxy (line 11386) | class iteration_proxy
        method iteration_proxy (line 4432) | explicit iteration_proxy(typename IteratorType::reference cont) no...
        method begin (line 4436) | iteration_proxy_value<IteratorType> begin() noexcept
        method end (line 4442) | iteration_proxy_value<IteratorType> end() noexcept
      class iteration_proxy_value (line 11387) | class iteration_proxy_value
        method iteration_proxy_value (line 4349) | explicit iteration_proxy_value(IteratorType it) noexcept
        method iteration_proxy_value (line 4354) | iteration_proxy_value& operator*()
        method iteration_proxy_value (line 4360) | iteration_proxy_value& operator++()
        method string_type (line 4381) | const string_type& key() const
        method value (line 4417) | typename IteratorType::reference value() const
      function set_end (line 11406) | class iter_impl // NOLINT(cppcoreguidelines-special-member-functions...
      class json_reverse_iterator (line 12144) | class json_reverse_iterator : public std::reverse_iterator<Base>
        method json_reverse_iterator (line 12154) | explicit json_reverse_iterator(const typename base_iterator::itera...
        method json_reverse_iterator (line 12158) | explicit json_reverse_iterator(const base_iterator& it) noexcept :...
        method json_reverse_iterator (line 12161) | json_reverse_iterator const operator++(int) // NOLINT(readability-...
        method json_reverse_iterator (line 12167) | json_reverse_iterator& operator++()
        method json_reverse_iterator (line 12173) | json_reverse_iterator const operator--(int) // NOLINT(readability-...
        method json_reverse_iterator (line 12179) | json_reverse_iterator& operator--()
        method json_reverse_iterator (line 12185) | json_reverse_iterator& operator+=(difference_type i)
        method json_reverse_iterator (line 12191) | json_reverse_iterator operator+(difference_type i) const
        method json_reverse_iterator (line 12197) | json_reverse_iterator operator-(difference_type i) const
        method difference_type (line 12203) | difference_type operator-(const json_reverse_iterator& other) const
        method reference (line 12209) | reference operator[](difference_type n) const
        method key (line 12215) | auto key() const -> decltype(std::declval<Base>().key())
        method reference (line 12222) | reference value() const
      class json_ref (line 13079) | class json_ref
        method json_ref (line 13084) | json_ref(value_type&& value)
        method json_ref (line 13088) | json_ref(const value_type& value)
        method json_ref (line 13092) | json_ref(std::initializer_list<json_ref> init)
        method json_ref (line 13099) | json_ref(Args && ... args)
        method json_ref (line 13104) | json_ref(json_ref&&) noexcept = default;
        method json_ref (line 13105) | json_ref(const json_ref&) = delete;
        method json_ref (line 13106) | json_ref& operator=(const json_ref&) = delete;
        method json_ref (line 13107) | json_ref& operator=(json_ref&&) = delete;
        method value_type (line 13110) | value_type moved_or_copied() const
        method value_type (line 13119) | value_type const& operator*() const
        method value_type (line 13124) | value_type const* operator->() const
      type output_adapter_protocol (line 13183) | struct output_adapter_protocol
        method output_adapter_protocol (line 13189) | output_adapter_protocol() = default;
        method output_adapter_protocol (line 13190) | output_adapter_protocol(const output_adapter_protocol&) = default;
        method output_adapter_protocol (line 13191) | output_adapter_protocol(output_adapter_protocol&&) noexcept = defa...
        method output_adapter_protocol (line 13192) | output_adapter_protocol& operator=(const output_adapter_protocol&)...
        method output_adapter_protocol (line 13193) | output_adapter_protocol& operator=(output_adapter_protocol&&) noex...
      class output_vector_adapter (line 13202) | class output_vector_adapter : public output_adapter_protocol<CharType>
        method output_vector_adapter (line 13205) | explicit output_vector_adapter(std::vector<CharType, AllocatorType...
        method write_character (line 13209) | void write_character(CharType c) override
        method JSON_HEDLEY_NON_NULL (line 13214) | JSON_HEDLEY_NON_NULL(2)
      class output_stream_adapter (line 13227) | class output_stream_adapter : public output_adapter_protocol<CharType>
        method output_stream_adapter (line 13230) | explicit output_stream_adapter(std::basic_ostream<CharType>& s) no...
        method write_character (line 13234) | void write_character(CharType c) override
        method JSON_HEDLEY_NON_NULL (line 13239) | JSON_HEDLEY_NON_NULL(2)
      class output_string_adapter (line 13252) | class output_string_adapter : public output_adapter_protocol<CharType>
        method output_string_adapter (line 13255) | explicit output_string_adapter(StringType& s) noexcept
        method write_character (line 13259) | void write_character(CharType c) override
        method JSON_HEDLEY_NON_NULL (line 13264) | JSON_HEDLEY_NON_NULL(2)
      class output_adapter (line 13275) | class output_adapter
        method output_adapter (line 13279) | output_adapter(std::vector<CharType, AllocatorType>& vec)
        method output_adapter (line 13283) | output_adapter(std::basic_ostream<CharType>& s)
        method output_adapter (line 13287) | output_adapter(StringType& s)
      class binary_writer (line 13314) | class binary_writer
        method binary_writer (line 13326) | explicit binary_writer(output_adapter_t<CharType> adapter) : oa(st...
        method write_bson (line 13335) | void write_bson(const BasicJsonType& j)
        method write_cbor (line 13364) | void write_cbor(const BasicJsonType& j)
        method write_msgpack (line 13688) | void write_msgpack(const BasicJsonType& j)
        method write_ubjson (line 14013) | void write_ubjson(const BasicJsonType& j, const bool use_count,
        method calc_bson_entry_header_size (line 14221) | static std::size_t calc_bson_entry_header_size(const string_t& nam...
        method write_bson_entry_header (line 14236) | void write_bson_entry_header(const string_t& name,
        method write_bson_boolean (line 14248) | void write_bson_boolean(const string_t& name,
        method write_bson_double (line 14258) | void write_bson_double(const string_t& name,
        method calc_bson_string_size (line 14268) | static std::size_t calc_bson_string_size(const string_t& value)
        method write_bson_string (line 14276) | void write_bson_string(const string_t& name,
        method write_bson_null (line 14290) | void write_bson_null(const string_t& name)
        method calc_bson_integer_size (line 14298) | static std::size_t calc_bson_integer_size(const std::int64_t value)
        method write_bson_integer (line 14308) | void write_bson_integer(const string_t& name,
        method calc_bson_unsigned_size (line 14326) | static constexpr std::size_t calc_bson_unsigned_size(const std::ui...
        method write_bson_unsigned (line 14336) | void write_bson_unsigned(const string_t& name,
        method write_bson_object_entry (line 14358) | void write_bson_object_entry(const string_t& name,
        method calc_bson_array_size (line 14368) | static std::size_t calc_bson_array_size(const typename BasicJsonTy...
        method calc_bson_binary_size (line 14383) | static std::size_t calc_bson_binary_size(const typename BasicJsonT...
        method write_bson_array (line 14391) | void write_bson_array(const string_t& name,
        method write_bson_binary (line 14410) | void write_bson_binary(const string_t& name,
        method calc_bson_element_size (line 14425) | static std::size_t calc_bson_element_size(const string_t& name,
        method write_bson_element (line 14473) | void write_bson_element(const string_t& name,
        method calc_bson_object_size (line 14520) | static std::size_t calc_bson_object_size(const typename BasicJsonT...
        method write_bson_object (line 14535) | void write_bson_object(const typename BasicJsonType::object_t& value)
        method CharType (line 14551) | static constexpr CharType get_cbor_float_prefix(float /*unused*/)
        method CharType (line 14556) | static constexpr CharType get_cbor_float_prefix(double /*unused*/)
        method CharType (line 14565) | static constexpr CharType get_msgpack_float_prefix(float /*unused*/)
        method CharType (line 14570) | static constexpr CharType get_msgpack_float_prefix(double /*unused*/)
        method write_number_with_ubjson_prefix (line 14582) | void write_number_with_ubjson_prefix(const NumberType n,
        method write_number_with_ubjson_prefix (line 14595) | void write_number_with_ubjson_prefix(const NumberType n,
        method write_number_with_ubjson_prefix (line 14658) | void write_number_with_ubjson_prefix(const NumberType n,
        method CharType (line 14722) | CharType ubjson_prefix(const BasicJsonType& j) const noexcept
        method CharType (line 14803) | static constexpr CharType get_ubjson_float_prefix(float /*unused*/)
        method CharType (line 14808) | static constexpr CharType get_ubjson_float_prefix(double /*unused*/)
        method write_number (line 14829) | void write_number(const NumberType n)
        method write_compact_float (line 14845) | void write_compact_float(const number_float_t n, detail::input_for...
        method CharType (line 14879) | static constexpr CharType to_char_type(std::uint8_t x) noexcept
        method CharType (line 14886) | static CharType to_char_type(std::uint8_t x) noexcept
        method CharType (line 14897) | static constexpr CharType to_char_type(std::uint8_t x) noexcept
        method CharType (line 14908) | static constexpr CharType to_char_type(InputCharType x) noexcept
      type dtoa_impl (line 14979) | namespace dtoa_impl
        function Target (line 14983) | Target reinterpret_bits(const Source source)
        type diyfp (line 14992) | struct diyfp // f * 2^e
          method diyfp (line 14999) | constexpr diyfp(std::uint64_t f_, int e_) noexcept : f(f_), e(e_...
          method diyfp (line 15005) | static diyfp sub(const diyfp& x, const diyfp& y) noexcept
          method diyfp (line 15017) | static diyfp mul(const diyfp& x, const diyfp& y) noexcept
          method diyfp (line 15082) | static diyfp normalize(diyfp x) noexcept
          method diyfp (line 15099) | static diyfp normalize_to(const diyfp& x, const int target_expon...
        type boundaries (line 15110) | struct boundaries
        function boundaries (line 15124) | boundaries compute_boundaries(FloatType value)
        type cached_power (line 15249) | struct cached_power // c = f * 2^e ~= 10^k
        function cached_power (line 15263) | inline cached_power get_cached_power_for_binary_exponent(int e)
        function find_largest_pow10 (line 15427) | inline int find_largest_pow10(const std::uint32_t n, std::uint32_t...
        function grisu2_round (line 15481) | inline void grisu2_round(char* buf, int len, std::uint64_t dist, s...
        function grisu2_digit_gen (line 15522) | inline void grisu2_digit_gen(char* buffer, int& length, int& decim...
        function grisu2 (line 15763) | inline void grisu2(char* buf, int& len, int& decimal_exponent,
        function JSON_HEDLEY_NON_NULL (line 15822) | JSON_HEDLEY_NON_NULL(1)
      type error_handler_t (line 16077) | enum class error_handler_t
      class serializer (line 16085) | class serializer
        method serializer (line 16101) | serializer(output_adapter_t<char> s, const char ichar,
        method serializer (line 16113) | serializer(const serializer&) = delete;
        method serializer (line 16114) | serializer& operator=(const serializer&) = delete;
        method serializer (line 16115) | serializer(serializer&&) = delete;
        method serializer (line 16116) | serializer& operator=(serializer&&) = delete;
        method dump (line 16141) | void dump(const BasicJsonType& val,
        method switch (line 16439) | switch (decode(state, codepoint, byte))
    type detail (line 2236) | namespace detail
      type value_t (line 129) | enum class value_t : std::uint8_t
      type make_void (line 2238) | struct make_void
      type nonesuch (line 2252) | struct nonesuch
        method nonesuch (line 2254) | nonesuch() = delete;
        method nonesuch (line 2256) | nonesuch(nonesuch const&) = delete;
        method nonesuch (line 2257) | nonesuch(nonesuch const&&) = delete;
      type detector (line 2266) | struct detector
      type is_detected_lazy (line 2283) | struct is_detected_lazy : is_detected<Op, Args...> { }
      function replace_substring (line 2725) | inline void replace_substring(std::string& s, const std::string& f,
      function escape (line 2743) | inline std::string escape(std::string s)
      function unescape (line 2757) | static void unescape(std::string& s)
      type position_t (line 2776) | struct position_t
      class exception (line 2808) | class exception : public std::exception
        method JSON_HEDLEY_NON_NULL (line 2821) | JSON_HEDLEY_NON_NULL(3)
        method name (line 2824) | static std::string name(const std::string& ename, int id_)
        method diagnostics (line 2830) | static std::string diagnostics(const BasicJsonType& leaf_element)
      class parse_error (line 2900) | class parse_error : public exception
        method parse_error (line 2913) | static parse_error create(int id_, const position_t& pos, const st...
        method parse_error (line 2921) | static parse_error create(int id_, std::size_t byte_, const std::s...
        method parse_error (line 2941) | parse_error(int id_, std::size_t byte_, const char* what_arg)
        method position_string (line 2944) | static std::string position_string(const position_t& pos)
      class invalid_iterator (line 2953) | class invalid_iterator : public exception
        method invalid_iterator (line 2957) | static invalid_iterator create(int id_, const std::string& what_ar...
        method JSON_HEDLEY_NON_NULL (line 2964) | JSON_HEDLEY_NON_NULL(3)
      class type_error (line 2971) | class type_error : public exception
        method type_error (line 2975) | static type_error create(int id_, const std::string& what_arg, con...
        method JSON_HEDLEY_NON_NULL (line 2982) | JSON_HEDLEY_NON_NULL(3)
      class out_of_range (line 2988) | class out_of_range : public exception
        method out_of_range (line 2992) | static out_of_range create(int id_, const std::string& what_arg, c...
        method JSON_HEDLEY_NON_NULL (line 2999) | JSON_HEDLEY_NON_NULL(3)
      class other_error (line 3005) | class other_error : public exception
        method other_error (line 3009) | static other_error create(int id_, const std::string& what_arg, co...
        method JSON_HEDLEY_NON_NULL (line 3016) | JSON_HEDLEY_NON_NULL(3)
      type integer_sequence (line 3082) | struct integer_sequence
        method size (line 3085) | static constexpr std::size_t size() noexcept
      type utility_internal (line 3099) | namespace utility_internal
        type Extend (line 3103) | struct Extend
        type Gen (line 3121) | struct Gen
        type Gen<T, 0> (line 3128) | struct Gen<T, 0>
      type priority_tag (line 3166) | struct priority_tag : priority_tag < N - 1 > {}
      type priority_tag<0> (line 3167) | struct priority_tag<0> {}
      type static_const (line 3171) | struct static_const
      type identity_tag (line 3190) | struct identity_tag {}
      type iterator_types (line 3220) | struct iterator_types {}
      type iterator_types <
    It,
    void_t<typename It::difference_type, typename It::value_type, typename It::pointer,
    typename It::reference, typename It::iterator_category >> (line 3223) | struct iterator_types <
      type iterator_traits (line 3238) | struct iterator_traits
      type iterator_traits < T, enable_if_t < !std::is_pointer<T>::value >> (line 3243) | struct iterator_traits < T, enable_if_t < !std::is_pointer<T>::value >>
      type iterator_traits<T*, enable_if_t<std::is_object<T>::value>> (line 3249) | struct iterator_traits<T*, enable_if_t<std::is_object<T>::value>>
      type is_basic_json (line 3378) | struct is_basic_json : std::false_type {}
      class json_ref (line 3388) | class json_ref
        method json_ref (line 13084) | json_ref(value_type&& value)
        method json_ref (line 13088) | json_ref(const value_type& value)
        method json_ref (line 13092) | json_ref(std::initializer_list<json_ref> init)
        method json_ref (line 13099) | json_ref(Args && ... args)
        method json_ref (line 13104) | json_ref(json_ref&&) noexcept = default;
        method json_ref (line 13105) | json_ref(const json_ref&) = delete;
        method json_ref (line 13106) | json_ref& operator=(const json_ref&) = delete;
        method json_ref (line 13107) | json_ref& operator=(json_ref&&) = delete;
        method value_type (line 13110) | value_type moved_or_copied() const
        method value_type (line 13119) | value_type const& operator*() const
        method value_type (line 13124) | value_type const* operator->() const
      type is_json_ref (line 3391) | struct is_json_ref : std::false_type {}
      type is_json_ref<json_ref<T>> (line 3394) | struct is_json_ref<json_ref<T>> : std::true_type {}
      type has_from_json (line 3432) | struct has_from_json : std::false_type {}
      type is_getable (line 3439) | struct is_getable
      type has_from_json < BasicJsonType, T, enable_if_t < !is_basic_json<T>::value >> (line 3445) | struct has_from_json < BasicJsonType, T, enable_if_t < !is_basic_jso...
      type has_non_default_from_json (line 3457) | struct has_non_default_from_json : std::false_type {}
      type has_non_default_from_json < BasicJsonType, T, enable_if_t < !is_basic_json<T>::value >> (line 3460) | struct has_non_default_from_json < BasicJsonType, T, enable_if_t < !...
      type has_to_json (line 3472) | struct has_to_json : std::false_type {}
      type has_to_json < BasicJsonType, T, enable_if_t < !is_basic_json<T>::value >> (line 3475) | struct has_to_json < BasicJsonType, T, enable_if_t < !is_basic_json<...
      type conjunction (line 3490) | struct conjunction : std::true_type { }
      type conjunction<B1> (line 3491) | struct conjunction<B1> : B1 { }
      type negation (line 3497) | struct negation : std::integral_constant < bool, !B::value > { }
      type is_default_constructible (line 3503) | struct is_default_constructible : std::is_default_constructible<T> {}
      type is_default_constructible<std::pair<T1, T2>> (line 3506) | struct is_default_constructible<std::pair<T1, T2>>
      type is_default_constructible<const std::pair<T1, T2>> (line 3510) | struct is_default_constructible<const std::pair<T1, T2>>
      type is_constructible (line 3523) | struct is_constructible : std::is_constructible<T, Args...> {}
      type is_constructible<std::pair<T1, T2>> (line 3526) | struct is_constructible<std::pair<T1, T2>> : is_default_constructibl...
      type is_constructible<const std::pair<T1, T2>> (line 3529) | struct is_constructible<const std::pair<T1, T2>> : is_default_constr...
      type is_iterator_traits (line 3539) | struct is_iterator_traits : std::false_type {}
      type is_iterator_traits<iterator_traits<T>> (line 3542) | struct is_iterator_traits<iterator_traits<T>>
      type is_range (line 3557) | struct is_range
      type is_complete_type (line 3586) | struct is_complete_type : std::false_type {}
      type is_complete_type<T, decltype(void(sizeof(T)))> (line 3589) | struct is_complete_type<T, decltype(void(sizeof(T)))> : std::true_ty...
      type is_compatible_object_type_impl (line 3593) | struct is_compatible_object_type_impl : std::false_type {}
      type is_compatible_object_type_impl <
    BasicJsonType, CompatibleObjectType,
    enable_if_t < is_detected<mapped_type_t, CompatibleObjectType>::value&&
    is_detected<key_type_t, CompatibleObjectType>::value >> (line 3596) | struct is_compatible_object_type_impl <
      type is_compatible_object_type (line 3612) | struct is_compatible_object_type
      type is_constructible_object_type_impl (line 3617) | struct is_constructible_object_type_impl : std::false_type {}
      type is_constructible_object_type_impl <
    BasicJsonType, ConstructibleObjectType,
    enable_if_t < is_detected<mapped_type_t, ConstructibleObjectType>::value&&
    is_detected<key_type_t, ConstructibleObjectType>::value >> (line 3620) | struct is_constructible_object_type_impl <
      type is_constructible_object_type (line 3644) | struct is_constructible_object_type
      type is_compatible_string_type (line 3649) | struct is_compatible_string_type
      type is_constructible_string_type (line 3656) | struct is_constructible_string_type
      type is_compatible_array_type_impl (line 3664) | struct is_compatible_array_type_impl : std::false_type {}
      type is_compatible_array_type (line 3682) | struct is_compatible_array_type
      type is_constructible_array_type_impl (line 3686) | struct is_constructible_array_type_impl : std::false_type {}
      type is_constructible_array_type_impl <
    BasicJsonType, ConstructibleArrayType,
    enable_if_t<std::is_same<ConstructibleArrayType,
    typename BasicJsonType::value_type>::value >> (line 3689) | struct is_constructible_array_type_impl <
      type is_constructible_array_type (line 3726) | struct is_constructible_array_type
      type is_compatible_integer_type_impl (line 3731) | struct is_compatible_integer_type_impl : std::false_type {}
      type is_compatible_integer_type_impl <
    RealIntegerType, CompatibleNumberIntegerType,
    enable_if_t < std::is_integral<RealIntegerType>::value&&
    std::is_integral<CompatibleNumberIntegerType>::value&&
    !std::is_same<bool, CompatibleNumberIntegerType>::value >> (line 3734) | struct is_compatible_integer_type_impl <
      type is_compatible_integer_type (line 3752) | struct is_compatible_integer_type
      type is_compatible_type_impl (line 3757) | struct is_compatible_type_impl: std::false_type {}
      type is_compatible_type_impl <
    BasicJsonType, CompatibleType,
    enable_if_t<is_complete_type<CompatibleType>::value >> (line 3760) | struct is_compatible_type_impl <
      type is_compatible_type (line 3769) | struct is_compatible_type
      type is_constructible_tuple (line 3773) | struct is_constructible_tuple : std::false_type {}
      type is_ordered_map (line 3781) | struct is_ordered_map
        type two (line 3785) | struct two
      function T (line 3798) | T conditional_static_cast(U value)
      function T (line 3804) | T conditional_static_cast(U value)
      function from_json (line 3834) | void from_json(const BasicJsonType& j, typename std::nullptr_t& n)
      function get_arithmetic_value (line 3848) | void get_arithmetic_value(const BasicJsonType& j, ArithmeticType& val)
      function from_json (line 3881) | void from_json(const BasicJsonType& j, typename BasicJsonType::boole...
      function from_json (line 3891) | void from_json(const BasicJsonType& j, typename BasicJsonType::strin...
      function from_json (line 3907) | void from_json(const BasicJsonType& j, ConstructibleStringType& s)
      function from_json (line 3918) | void from_json(const BasicJsonType& j, typename BasicJsonType::numbe...
      function from_json (line 3924) | void from_json(const BasicJsonType& j, typename BasicJsonType::numbe...
      function from_json (line 3930) | void from_json(const BasicJsonType& j, typename BasicJsonType::numbe...
      function from_json (line 3937) | void from_json(const BasicJsonType& j, EnumType& e)
      function from_json (line 3947) | void from_json(const BasicJsonType& j, std::forward_list<T, Allocato...
      function from_json (line 3964) | void from_json(const BasicJsonType& j, std::valarray<T>& l)
      function from_json (line 3979) | auto from_json(const BasicJsonType& j, T (&arr)[N])  // NOLINT(cppco...
      function from_json_array_impl (line 3989) | void from_json_array_impl(const BasicJsonType& j, typename BasicJson...
      function from_json_array_impl (line 3995) | auto from_json_array_impl(const BasicJsonType& j, std::array<T, N>& ...
      function from_json_array_impl (line 4009) | auto from_json_array_impl(const BasicJsonType& j, ConstructibleArray...
      function from_json_array_impl (line 4033) | void from_json_array_impl(const BasicJsonType& j, ConstructibleArray...
      function from_json (line 4058) | auto from_json(const BasicJsonType& j, ConstructibleArrayType& arr)
      function from_json_inplace_array_impl (line 4072) | std::array<T, sizeof...(Idx)> from_json_inplace_array_impl(BasicJson...
      function from_json (line 4079) | auto from_json(BasicJsonType&& j, identity_tag<std::array<T, N>> tag)
      function from_json (line 4091) | void from_json(const BasicJsonType& j, typename BasicJsonType::binar...
      function from_json (line 4103) | void from_json(const BasicJsonType& j, ConstructibleObjectType& obj)
      function from_json (line 4135) | void from_json(const BasicJsonType& j, ArithmeticType& val)
      function from_json_tuple_impl_base (line 4172) | std::tuple<Args...> from_json_tuple_impl_base(BasicJsonType&& j, ind...
      function from_json_tuple_impl (line 4178) | std::pair<A1, A2> from_json_tuple_impl(BasicJsonType&& j, identity_t...
      function from_json_tuple_impl (line 4185) | void from_json_tuple_impl(BasicJsonType&& j, std::pair<A1, A2>& p, p...
      function from_json_tuple_impl (line 4191) | std::tuple<Args...> from_json_tuple_impl(BasicJsonType&& j, identity...
      function from_json_tuple_impl (line 4197) | void from_json_tuple_impl(BasicJsonType&& j, std::tuple<Args...>& t,...
      function from_json (line 4203) | auto from_json(BasicJsonType&& j, TupleRelated&& t)
      function from_json (line 4217) | void from_json(const BasicJsonType& j, std::map<Key, Value, Compare,...
      function from_json (line 4237) | void from_json(const BasicJsonType& j, std::unordered_map<Key, Value...
      function from_json (line 4256) | void from_json(const BasicJsonType& j, std_fs::path& p)
      type from_json_fn (line 4266) | struct from_json_fn
      function int_to_string (line 4320) | void int_to_string( string_type& target, std::size_t value )
      class iteration_proxy_value (line 4326) | class iteration_proxy_value
        method iteration_proxy_value (line 4349) | explicit iteration_proxy_value(IteratorType it) noexcept
        method iteration_proxy_value (line 4354) | iteration_proxy_value& operator*()
        method iteration_proxy_value (line 4360) | iteration_proxy_value& operator++()
        method string_type (line 4381) | const string_type& key() const
        method value (line 4417) | typename IteratorType::reference value() const
      class iteration_proxy (line 4424) | class iteration_proxy
        method iteration_proxy (line 4432) | explicit iteration_proxy(typename IteratorType::reference cont) no...
        method begin (line 4436) | iteration_proxy_value<IteratorType> begin() noexcept
        method end (line 4442) | iteration_proxy_value<IteratorType> end() noexcept
      function get (line 4451) | auto get(const nlohmann::detail::iteration_proxy_value<IteratorType>...
      function get (line 4459) | auto get(const nlohmann::detail::iteration_proxy_value<IteratorType>...
      type external_constructor (line 4530) | struct external_constructor
      type external_constructor<value_t::boolean> (line 4533) | struct external_constructor<value_t::boolean>
        method construct (line 4536) | static void construct(BasicJsonType& j, typename BasicJsonType::bo...
      type external_constructor<value_t::string> (line 4546) | struct external_constructor<value_t::string>
        method construct (line 4549) | static void construct(BasicJsonType& j, const typename BasicJsonTy...
        method construct (line 4558) | static void construct(BasicJsonType& j, typename BasicJsonType::st...
        method construct (line 4569) | static void construct(BasicJsonType& j, const CompatibleStringType...
      type external_constructor<value_t::binary> (line 4579) | struct external_constructor<value_t::binary>
        method construct (line 4582) | static void construct(BasicJsonType& j, const typename BasicJsonTy...
        method construct (line 4591) | static void construct(BasicJsonType& j, typename BasicJsonType::bi...
      type external_constructor<value_t::number_float> (line 4601) | struct external_constructor<value_t::number_float>
        method construct (line 4604) | static void construct(BasicJsonType& j, typename BasicJsonType::nu...
      type external_constructor<value_t::number_unsigned> (line 4614) | struct external_constructor<value_t::number_unsigned>
        method construct (line 4617) | static void construct(BasicJsonType& j, typename BasicJsonType::nu...
      type external_constructor<value_t::number_integer> (line 4627) | struct external_constructor<value_t::number_integer>
        method construct (line 4630) | static void construct(BasicJsonType& j, typename BasicJsonType::nu...
      type external_constructor<value_t::array> (line 4640) | struct external_constructor<value_t::array>
        method construct (line 4643) | static void construct(BasicJsonType& j, const typename BasicJsonTy...
        method construct (line 4653) | static void construct(BasicJsonType& j, typename BasicJsonType::ar...
        method construct (line 4665) | static void construct(BasicJsonType& j, const CompatibleArrayType&...
        method construct (line 4678) | static void construct(BasicJsonType& j, const std::vector<bool>& arr)
        method construct (line 4694) | static void construct(BasicJsonType& j, const std::valarray<T>& arr)
      type external_constructor<value_t::object> (line 4710) | struct external_constructor<value_t::object>
        method construct (line 4713) | static void construct(BasicJsonType& j, const typename BasicJsonTy...
        method construct (line 4723) | static void construct(BasicJsonType& j, typename BasicJsonType::ob...
        method construct (line 4734) | static void construct(BasicJsonType& j, const CompatibleObjectType...
      function to_json (line 4753) | void to_json(BasicJsonType& j, T b) noexcept
      function to_json (line 4760) | void to_json(BasicJsonType& j, const CompatibleString& s)
      function to_json (line 4766) | void to_json(BasicJsonType& j, typename BasicJsonType::string_t&& s)
      function to_json (line 4773) | void to_json(BasicJsonType& j, FloatType val) noexcept
      function to_json (line 4780) | void to_json(BasicJsonType& j, CompatibleNumberUnsignedType val) noe...
      function to_json (line 4787) | void to_json(BasicJsonType& j, CompatibleNumberIntegerType val) noex...
      function to_json (line 4794) | void to_json(BasicJsonType& j, EnumType e) noexcept
      function to_json (line 4801) | void to_json(BasicJsonType& j, const std::vector<bool>& e)
      function to_json (line 4814) | void to_json(BasicJsonType& j, const CompatibleArrayType& arr)
      function to_json (line 4820) | void to_json(BasicJsonType& j, const typename BasicJsonType::binary_...
      function to_json (line 4827) | void to_json(BasicJsonType& j, const std::valarray<T>& arr)
      function to_json (line 4833) | void to_json(BasicJsonType& j, typename BasicJsonType::array_t&& arr)
      function to_json (line 4840) | void to_json(BasicJsonType& j, const CompatibleObjectType& obj)
      function to_json (line 4846) | void to_json(BasicJsonType& j, typename BasicJsonType::object_t&& obj)
      function to_json (line 4856) | void to_json(BasicJsonType& j, const T(&arr)[N]) // NOLINT(cppcoregu...
      function to_json (line 4862) | void to_json(BasicJsonType& j, const std::pair<T1, T2>& p)
      function to_json (line 4870) | void to_json(BasicJsonType& j, const T& b)
      function to_json_tuple_impl (line 4876) | void to_json_tuple_impl(BasicJsonType& j, const Tuple& t, index_sequ...
      function to_json (line 4882) | void to_json(BasicJsonType& j, const T& t)
      function to_json (line 4889) | void to_json(BasicJsonType& j, const std_fs::path& p)
      type to_json_fn (line 4895) | struct to_json_fn
      function combine (line 5079) | inline std::size_t combine(std::size_t seed, std::size_t h) noexcept
      function hash (line 5097) | std::size_t hash(const BasicJsonType& j)
      type input_format_t (line 5233) | enum class input_format_t { json, cbor, msgpack, ubjson, bson }
      class file_input_adapter (line 5244) | class file_input_adapter
        method file_input_adapter (line 5250) | explicit file_input_adapter(std::FILE* f) noexcept
        method file_input_adapter (line 5255) | file_input_adapter(const file_input_adapter&) = delete;
        method file_input_adapter (line 5256) | file_input_adapter(file_input_adapter&&) noexcept = default;
        method file_input_adapter (line 5257) | file_input_adapter& operator=(const file_input_adapter&) = delete;
        method file_input_adapter (line 5258) | file_input_adapter& operator=(file_input_adapter&&) = delete;
        method get_character (line 5261) | std::char_traits<char>::int_type get_character() noexcept
      class input_stream_adapter (line 5281) | class input_stream_adapter
        method input_stream_adapter (line 5296) | explicit input_stream_adapter(std::istream& i)
        method input_stream_adapter (line 5301) | input_stream_adapter(const input_stream_adapter&) = delete;
        method input_stream_adapter (line 5302) | input_stream_adapter& operator=(input_stream_adapter&) = delete;
        method input_stream_adapter (line 5303) | input_stream_adapter& operator=(input_stream_adapter&&) = delete;
        method input_stream_adapter (line 5305) | input_stream_adapter(input_stream_adapter&& rhs) noexcept
        method get_character (line 5315) | std::char_traits<char>::int_type get_character()
      class iterator_input_adapter (line 5336) | class iterator_input_adapter
        method iterator_input_adapter (line 5341) | iterator_input_adapter(IteratorType first, IteratorType last)
        method get_character (line 5345) | typename std::char_traits<char_type>::int_type get_character()
        method empty (line 5364) | bool empty() const
      type wide_string_input_helper (line 5372) | struct wide_string_input_helper
      type wide_string_input_helper<BaseInputAdapter, 4> (line 5375) | struct wide_string_input_helper<BaseInputAdapter, 4>
        method fill_buffer (line 5378) | static void fill_buffer(BaseInputAdapter& input,
      type wide_string_input_helper<BaseInputAdapter, 2> (line 5433) | struct wide_string_input_helper<BaseInputAdapter, 2>
        method fill_buffer (line 5436) | static void fill_buffer(BaseInputAdapter& input,
      class wide_string_input_adapter (line 5496) | class wide_string_input_adapter
        method wide_string_input_adapter (line 5501) | wide_string_input_adapter(BaseInputAdapter base)
        method get_character (line 5504) | typename std::char_traits<char>::int_type get_character() noexcept
        method fill_buffer (line 5525) | void fill_buffer()
      type iterator_input_adapter_factory (line 5541) | struct iterator_input_adapter_factory
        method adapter_type (line 5547) | static adapter_type create(IteratorType first, IteratorType last)
      type is_iterator_of_multibyte (line 5554) | struct is_iterator_of_multibyte
      type iterator_input_adapter_factory<IteratorType, enable_if_t<is_iterator_of_multibyte<IteratorType>::value>> (line 5564) | struct iterator_input_adapter_factory<IteratorType, enable_if_t<is_i...
        method adapter_type (line 5571) | static adapter_type create(IteratorType first, IteratorType last)
      function input_adapter (line 5579) | typename iterator_input_adapter_factory<IteratorType>::adapter_type ...
      type container_input_adapter_factory_impl (line 5589) | namespace container_input_adapter_factory_impl
        type container_input_adapter_factory (line 5596) | struct container_input_adapter_factory {}
        type container_input_adapter_factory< ContainerType,
       void_t<decltype(begin(std::declval<ContainerType>()), end(std::declval<ContainerType>()))>> (line 5599) | struct container_input_adapter_factory< ContainerType,
          method adapter_type (line 5604) | static adapter_type create(const ContainerType& container)
      function input_adapter (line 5613) | typename container_input_adapter_factory_impl::container_input_adapt...
      function file_input_adapter (line 5620) | inline file_input_adapter input_adapter(std::FILE* file)
        method file_input_adapter (line 5250) | explicit file_input_adapter(std::FILE* f) noexcept
        method file_input_adapter (line 5255) | file_input_adapter(const file_input_adapter&) = delete;
        method file_input_adapter (line 5256) | file_input_adapter(file_input_adapter&&) noexcept = default;
        method file_input_adapter (line 5257) | file_input_adapter& operator=(const file_input_adapter&) = delete;
        method file_input_adapter (line 5258) | file_input_adapter& operator=(file_input_adapter&&) = delete;
        method get_character (line 5261) | std::char_traits<char>::int_type get_character() noexcept
      function input_stream_adapter (line 5625) | inline input_stream_adapter input_adapter(std::istream& stream)
        method input_stream_adapter (line 5296) | explicit input_stream_adapter(std::istream& i)
        method input_stream_adapter (line 5301) | input_stream_adapter(const input_stream_adapter&) = delete;
        method input_stream_adapter (line 5302) | input_stream_adapter& operator=(input_stream_adapter&) = delete;
        method input_stream_adapter (line 5303) | input_stream_adapter& operator=(input_stream_adapter&&) = delete;
        method input_stream_adapter (line 5305) | input_stream_adapter(input_stream_adapter&& rhs) noexcept
        method get_character (line 5315) | std::char_traits<char>::int_type get_character()
      function input_stream_adapter (line 5630) | inline input_stream_adapter input_adapter(std::istream&& stream)
        method input_stream_adapter (line 5296) | explicit input_stream_adapter(std::istream& i)
        method input_stream_adapter (line 5301) | input_stream_adapter(const input_stream_adapter&) = delete;
        method input_stream_adapter (line 5302) | input_stream_adapter& operator=(input_stream_adapter&) = delete;
        method input_stream_adapter (line 5303) | input_stream_adapter& operator=(input_stream_adapter&&) = delete;
        method input_stream_adapter (line 5305) | input_stream_adapter(input_stream_adapter&& rhs) noexcept
        method get_character (line 5315) | std::char_traits<char>::int_type get_character()
      function contiguous_bytes_input_adapter (line 5646) | contiguous_bytes_input_adapter input_adapter(CharT b)
      function input_adapter (line 5654) | auto input_adapter(T (&array)[N]) -> decltype(input_adapter(array, a...
      class span_input_adapter (line 5662) | class span_input_adapter
        method span_input_adapter (line 5671) | span_input_adapter(CharT b, std::size_t l)
        method span_input_adapter (line 5678) | span_input_adapter(IteratorType first, IteratorType last)
        method contiguous_bytes_input_adapter (line 5681) | contiguous_bytes_input_adapter&& get()
      class json_sax_dom_parser (line 5848) | class json_sax_dom_parser
        method json_sax_dom_parser (line 5862) | explicit json_sax_dom_parser(BasicJsonType& r, const bool allow_ex...
        method json_sax_dom_parser (line 5867) | json_sax_dom_parser(const json_sax_dom_parser&) = delete;
        method json_sax_dom_parser (line 5868) | json_sax_dom_parser(json_sax_dom_parser&&) = default;
        method json_sax_dom_parser (line 5869) | json_sax_dom_parser& operator=(const json_sax_dom_parser&) = delete;
        method json_sax_dom_parser (line 5870) | json_sax_dom_parser& operator=(json_sax_dom_parser&&) = default;
        method null (line 5873) | bool null()
        method boolean (line 5879) | bool boolean(bool val)
        method number_integer (line 5885) | bool number_integer(number_integer_t val)
        method number_unsigned (line 5891) | bool number_unsigned(number_unsigned_t val)
        method number_float (line 5897) | bool number_float(number_float_t val, const string_t& /*unused*/)
        method string (line 5903) | bool string(string_t& val)
        method binary (line 5909) | bool binary(binary_t& val)
        method start_object (line 5915) | bool start_object(std::size_t len)
        method key (line 5927) | bool key(string_t& val)
        method end_object (line 5934) | bool end_object()
        method start_array (line 5941) | bool start_array(std::size_t len)
        method end_array (line 5953) | bool end_array()
        method parse_error (line 5961) | bool parse_error(std::size_t /*unused*/, const std::string& /*unus...
        method is_errored (line 5973) | constexpr bool is_errored() const
        method JSON_HEDLEY_RETURNS_NON_NULL (line 5986) | JSON_HEDLEY_RETURNS_NON_NULL
      class json_sax_dom_callback_parser (line 6022) | class json_sax_dom_callback_parser
        method json_sax_dom_callback_parser (line 6033) | json_sax_dom_callback_parser(BasicJsonType& r,
        method json_sax_dom_callback_parser (line 6042) | json_sax_dom_callback_parser(const json_sax_dom_callback_parser&) ...
        method json_sax_dom_callback_parser (line 6043) | json_sax_dom_callback_parser(json_sax_dom_callback_parser&&) = def...
        method json_sax_dom_callback_parser (line 6044) | json_sax_dom_callback_parser& operator=(const json_sax_dom_callbac...
        method json_sax_dom_callback_parser (line 6045) | json_sax_dom_callback_parser& operator=(json_sax_dom_callback_pars...
        method null (line 6048) | bool null()
        method boolean (line 6054) | bool boolean(bool val)
        method number_integer (line 6060) | bool number_integer(number_integer_t val)
        method number_unsigned (line 6066) | bool number_unsigned(number_unsigned_t val)
        method number_float (line 6072) | bool number_float(number_float_t val, const string_t& /*unused*/)
        method string (line 6078) | bool string(string_t& val)
        method binary (line 6084) | bool binary(binary_t& val)
        method start_object (line 6090) | bool start_object(std::size_t len)
        method key (line 6108) | bool key(string_t& val)
        method end_object (line 6125) | bool end_object()
        method start_array (line 6161) | bool start_array(std::size_t len)
        method end_array (line 6178) | bool end_array()
        method parse_error (line 6211) | bool parse_error(std::size_t /*unused*/, const std::string& /*unus...
        method is_errored (line 6223) | constexpr bool is_errored() const
        method handle_value (line 6245) | std::pair<bool, BasicJsonType*> handle_value(Value&& v, const bool...
      class json_sax_acceptor (line 6329) | class json_sax_acceptor
        method null (line 6338) | bool null()
        method boolean (line 6343) | bool boolean(bool /*unused*/)
        method number_integer (line 6348) | bool number_integer(number_integer_t /*unused*/)
        method number_unsigned (line 6353) | bool number_unsigned(number_unsigned_t /*unused*/)
        method number_float (line 6358) | bool number_float(number_float_t /*unused*/, const string_t& /*unu...
        method string (line 6363) | bool string(string_t& /*unused*/)
        method binary (line 6368) | bool binary(binary_t& /*unused*/)
        method start_object (line 6373) | bool start_object(std::size_t /*unused*/ = static_cast<std::size_t...
        method key (line 6378) | bool key(string_t& /*unused*/)
        method end_object (line 6383) | bool end_object()
        method start_array (line 6388) | bool start_array(std::size_t /*unused*/ = static_cast<std::size_t>...
        method end_array (line 6393) | bool end_array()
        method parse_error (line 6398) | bool parse_error(std::size_t /*unused*/, const std::string& /*unus...
      class lexer_base (line 6436) | class lexer_base
        type token_type (line 6440) | enum class token_type
      class lexer (line 6513) | class lexer : public lexer_base<BasicJsonType>
        method lexer (line 6525) | explicit lexer(InputAdapterType&& adapter, bool ignore_comments_ =...
        method lexer (line 6532) | lexer(const lexer&) = delete;
        method lexer (line 6533) | lexer(lexer&&) = default;
        method lexer (line 6534) | lexer& operator=(lexer&) = delete;
        method lexer (line 6535) | lexer& operator=(lexer&&) = default;
        method JSON_HEDLEY_PURE (line 6544) | JSON_HEDLEY_PURE
        method get_codepoint (line 6571) | int get_codepoint()
        method next_byte_in_range (line 6619) | bool next_byte_in_range(std::initializer_list<char_int_type> ranges)
        method token_type (line 6656) | token_type scan_string()
        method scan_comment (line 7246) | bool scan_comment()
        method strtof (line 7314) | static void strtof(float& f, const char* str, char** endptr) noexcept
        method strtof (line 7320) | static void strtof(double& f, const char* str, char** endptr) noex...
        method strtof (line 7326) | static void strtof(long double& f, const char* str, char** endptr)...
        method token_type (line 7371) | token_type scan_number()  // lgtm [cpp/use-of-goto]
      type is_sax (line 8104) | struct is_sax
      type is_sax_static_asserts (line 8135) | struct is_sax_static_asserts
      type cbor_tag_handler_t (line 8201) | enum class cbor_tag_handler_t
      function little_endianness (line 8215) | static inline bool little_endianness(int num = 1) noexcept
      class binary_reader (line 8229) | class binary_reader
        method binary_reader (line 8246) | explicit binary_reader(InputAdapterType&& adapter) noexcept : ia(s...
        method binary_reader (line 8252) | binary_reader(const binary_reader&) = delete;
        method binary_reader (line 8253) | binary_reader(binary_reader&&) = default;
        method binary_reader (line 8254) | binary_reader& operator=(const binary_reader&) = delete;
        method binary_reader (line 8255) | binary_reader& operator=(binary_reader&&) = default;
        method JSON_HEDLEY_NON_NULL (line 8266) | JSON_HEDLEY_NON_NULL(3)
        method parse_bson_internal (line 8329) | bool parse_bson_internal()
        method get_bson_cstr (line 8354) | bool get_bson_cstr(string_t& result)
        method get_bson_string (line 8384) | bool get_bson_string(const NumberType len, string_t& result)
        method get_bson_binary (line 8405) | bool get_bson_binary(const NumberType len, binary_t& result)
        method parse_bson_element_internal (line 8431) | bool parse_bson_element_internal(const char_int_type element_type,
        method parse_bson_element_list (line 8509) | bool parse_bson_element_list(const bool is_array)
        method parse_bson_array (line 8547) | bool parse_bson_array()
        method parse_cbor_internal (line 8577) | bool parse_cbor_internal(const bool get_char,
        method get_cbor_string (line 9065) | bool get_cbor_string(string_t& result)
        method get_cbor_binary (line 9160) | bool get_cbor_binary(binary_t& result)
        method get_cbor_array (line 9254) | bool get_cbor_array(const std::size_t len,
        method get_cbor_object (line 9292) | bool get_cbor_object(const std::size_t len,
        method parse_msgpack_internal (line 9348) | bool parse_msgpack_internal()
        method get_msgpack_string (line 9728) | bool get_msgpack_string(string_t& result)
        method get_msgpack_binary (line 9810) | bool get_msgpack_binary(binary_t& result)
        method get_msgpack_array (line 9921) | bool get_msgpack_array(const std::size_t len)
        method get_msgpack_object (line 9943) | bool get_msgpack_object(const std::size_t len)
        method parse_ubjson_internal (line 9980) | bool parse_ubjson_internal(const bool get_char = true)
        method get_ubjson_string (line 9999) | bool get_ubjson_string(string_t& result, const bool get_char = true)
        method get_ubjson_size_value (line 10053) | bool get_ubjson_size_value(std::size_t& result)
        method get_ubjson_size_type (line 10130) | bool get_ubjson_size_type(std::pair<std::size_t, char_int_type>& r...
        method get_ubjson_value (line 10171) | bool get_ubjson_value(const char_int_type prefix)
        method get_ubjson_array (line 10272) | bool get_ubjson_array()
        method get_ubjson_object (line 10334) | bool get_ubjson_object()
        method get_ubjson_high_precision_number (line 10409) | bool get_ubjson_high_precision_number()
        method char_int_type (line 10485) | char_int_type get()
        method char_int_type (line 10494) | char_int_type get_ignore_noop()
        method get_number (line 10519) | bool get_number(const input_format_t format, NumberType& result)
        method get_string (line 10562) | bool get_string(const input_format_t format,
        method get_binary (line 10595) | bool get_binary(const input_format_t format,
        method JSON_HEDLEY_NON_NULL (line 10618) | JSON_HEDLEY_NON_NULL(3)
        method get_token_string (line 10632) | std::string get_token_string() const
        method exception_message (line 10645) | std::string exception_message(const input_format_t format,
      type parse_event_t (line 10733) | enum class parse_event_t : std::uint8_t
      class parser (line 10759) | class parser
        method parser (line 10770) | explicit parser(InputAdapterType&& adapter,
        method parse (line 10792) | void parse(const bool strict, BasicJsonType& result)
        method accept (line 10852) | bool accept(const bool strict = true)
        method sax_parse (line 10860) | bool sax_parse(SAX* sax, const bool strict = true)
        method sax_parse_internal (line 10879) | bool sax_parse_internal(SAX* sax)
        method token_type (line 11160) | token_type get_token()
        method exception_message (line 11165) | std::string exception_message(const token_type expected, const std...
      class primitive_iterator_t (line 11233) | class primitive_iterator_t
        method difference_type (line 11245) | constexpr difference_type get_value() const noexcept
        method set_begin (line 11251) | void set_begin() noexcept
        method set_end (line 11257) | void set_end() noexcept
        method is_begin (line 11263) | constexpr bool is_begin() const noexcept
        method is_end (line 11269) | constexpr bool is_end() const noexcept
        method primitive_iterator_t (line 11284) | primitive_iterator_t operator+(difference_type n) noexcept
        method difference_type (line 11291) | constexpr difference_type operator-(primitive_iterator_t lhs, prim...
        method primitive_iterator_t (line 11296) | primitive_iterator_t& operator++() noexcept
        method primitive_iterator_t (line 11302) | primitive_iterator_t const operator++(int) noexcept // NOLINT(read...
        method primitive_iterator_t (line 11309) | primitive_iterator_t& operator--() noexcept
        method primitive_iterator_t (line 11315) | primitive_iterator_t const operator--(int) noexcept // NOLINT(read...
        method primitive_iterator_t (line 11322) | primitive_iterator_t& operator+=(difference_type n) noexcept
        method primitive_iterator_t (line 11328) | primitive_iterator_t& operator-=(difference_type n) noexcept
      type internal_iterator (line 11348) | struct internal_iterator
      class iteration_proxy (line 11386) | class iteration_proxy
        method iteration_proxy (line 4432) | explicit iteration_proxy(typename IteratorType::reference cont) no...
        method begin (line 4436) | iteration_proxy_value<IteratorType> begin() noexcept
        method end (line 4442) | iteration_proxy_value<IteratorType> end() noexcept
      class iteration_proxy_value (line 11387) | class iteration_proxy_value
        method iteration_proxy_value (line 4349) | explicit iteration_proxy_value(IteratorType it) noexcept
        method iteration_proxy_value (line 4354) | iteration_proxy_value& operator*()
        method iteration_proxy_value (line 4360) | iteration_proxy_value& operator++()
        method string_type (line 4381) | const string_type& key() const
        method value (line 4417) | typename IteratorType::reference value() const
      function set_end (line 11406) | class iter_impl // NOLINT(cppcoreguidelines-special-member-functions...
      class json_reverse_iterator (line 12144) | class json_reverse_iterator : public std::reverse_iterator<Base>
        method json_reverse_iterator (line 12154) | explicit json_reverse_iterator(const typename base_iterator::itera...
        method json_reverse_iterator (line 12158) | explicit json_reverse_iterator(const base_iterator& it) noexcept :...
        method json_reverse_iterator (line 12161) | json_reverse_iterator const operator++(int) // NOLINT(readability-...
        method json_reverse_iterator (line 12167) | json_reverse_iterator& operator++()
        method json_reverse_iterator (line 12173) | json_reverse_iterator const operator--(int) // NOLINT(readability-...
        method json_reverse_iterator (line 12179) | json_reverse_iterator& operator--()
        method json_reverse_iterator (line 12185) | json_reverse_iterator& operator+=(difference_type i)
        method json_reverse_iterator (line 12191) | json_reverse_iterator operator+(difference_type i) const
        method json_reverse_iterator (line 12197) | json_reverse_iterator operator-(difference_type i) const
        method difference_type (line 12203) | difference_type operator-(const json_reverse_iterator& other) const
        method reference (line 12209) | reference operator[](difference_type n) const
        method key (line 12215) | auto key() const -> decltype(std::declval<Base>().key())
        method reference (line 12222) | reference value() const
      class json_ref (line 13079) | class json_ref
        method json_ref (line 13084) | json_ref(value_type&& value)
        method json_ref (line 13088) | json_ref(const value_type& value)
        method json_ref (line 13092) | json_ref(std::initializer_list<json_ref> init)
        method json_ref (line 13099) | json_ref(Args && ... args)
        method json_ref (line 13104) | json_ref(json_ref&&) noexcept = default;
        method json_ref (line 13105) | json_ref(const json_ref&) = delete;
        method json_ref (line 13106) | json_ref& operator=(const json_ref&) = delete;
        method json_ref (line 13107) | json_ref& operator=(json_ref&&) = delete;
        method value_type (line 13110) | value_type moved_or_copied() const
        method value_type (line 13119) | value_type const& operator*() const
        method value_type (line 13124) | value_type const* operator->() const
      type output_adapter_protocol (line 13183) | struct output_adapter_protocol
        method output_adapter_protocol (line 13189) | output_adapter_protocol() = default;
        method output_adapter_protocol (line 13190) | output_adapter_protocol(const output_adapter_protocol&) = default;
        method output_adapter_protocol (line 13191) | output_adapter_protocol(output_adapter_protocol&&) noexcept = defa...
        method output_adapter_protocol (line 13192) | output_adapter_protocol& operator=(const output_adapter_protocol&)...
        method output_adapter_protocol (line 13193) | output_adapter_protocol& operator=(output_adapter_protocol&&) noex...
      class output_vector_adapter (line 13202) | class output_vector_adapter : public output_adapter_protocol<CharType>
        method output_vector_adapter (line 13205) | explicit output_vector_adapter(std::vector<CharType, AllocatorType...
        method write_character (line 13209) | void write_character(CharType c) override
        method JSON_HEDLEY_NON_NULL (line 13214) | JSON_HEDLEY_NON_NULL(2)
      class output_stream_adapter (line 13227) | class output_stream_adapter : public output_adapter_protocol<CharType>
        method output_stream_adapter (line 13230) | explicit output_stream_adapter(std::basic_ostream<CharType>& s) no...
        method write_character (line 13234) | void write_character(CharType c) override
        method JSON_HEDLEY_NON_NULL (line 13239) | JSON_HEDLEY_NON_NULL(2)
      class output_string_adapter (line 13252) | class output_string_adapter : public output_adapter_protocol<CharType>
        method output_string_adapter (line 13255) | explicit output_string_adapter(StringType& s) noexcept
        method write_character (line 13259) | void write_character(CharType c) override
        method JSON_HEDLEY_NON_NULL (line 13264) | JSON_HEDLEY_NON_NULL(2)
      class output_adapter (line 13275) | class output_adapter
        method output_adapter (line 13279) | output_adapter(std::vector<CharType, AllocatorType>& vec)
        method output_adapter (line 13283) | output_adapter(std::basic_ostream<CharType>& s)
        method output_adapter (line 13287) | output_adapter(StringType& s)
      class binary_writer (line 13314) | class binary_writer
        method binary_writer (line 13326) | explicit binary_writer(output_adapter_t<CharType> adapter) : oa(st...
        method write_bson (line 13335) | void write_bson(const BasicJsonType& j)
        method write_cbor (line 13364) | void write_cbor(const BasicJsonType& j)
        method write_msgpack (line 13688) | void write_msgpack(const BasicJsonType& j)
        method write_ubjson (line 14013) | void write_ubjson(const BasicJsonType& j, const bool use_count,
        method calc_bson_entry_header_size (line 14221) | static std::size_t calc_bson_entry_header_size(const string_t& nam...
        method write_bson_entry_header (line 14236) | void write_bson_entry_header(const string_t& name,
        method write_bson_boolean (line 14248) | void write_bson_boolean(const string_t& name,
        method write_bson_double (line 14258) | void write_bson_double(const string_t& name,
        method calc_bson_string_size (line 14268) | static std::size_t calc_bson_string_size(const string_t& value)
        method write_bson_string (line 14276) | void write_bson_string(const string_t& name,
        method write_bson_null (line 14290) | void write_bson_null(const string_t& name)
        method calc_bson_integer_size (line 14298) | static std::size_t calc_bson_integer_size(const std::int64_t value)
        method write_bson_integer (line 14308) | void write_bson_integer(const string_t& name,
        method calc_bson_unsigned_size (line 14326) | static constexpr std::size_t calc_bson_unsigned_size(const std::ui...
        method write_bson_unsigned (line 14336) | void write_bson_unsigned(const string_t& name,
        method write_bson_object_entry (line 14358) | void write_bson_object_entry(const string_t& name,
        method calc_bson_array_size (line 14368) | static std::size_t calc_bson_array_size(const typename BasicJsonTy...
        method calc_bson_binary_size (line 14383) | static std::size_t calc_bson_binary_size(const typename BasicJsonT...
        method write_bson_array (line 14391) | void write_bson_array(const string_t& name,
        method write_bson_binary (line 14410) | void write_bson_binary(const string_t& name,
        method calc_bson_element_size (line 14425) | static std::size_t calc_bson_element_size(const string_t& name,
        method write_bson_element (line 14473) | void write_bson_element(const string_t& name,
        method calc_bson_object_size (line 14520) | static std::size_t calc_bson_object_size(const typename BasicJsonT...
        method write_bson_object (line 14535) | void write_bson_object(const typename BasicJsonType::object_t& value)
        method CharType (line 14551) | static constexpr CharType get_cbor_float_prefix(float /*unused*/)
        method CharType (line 14556) | static constexpr CharType get_cbor_float_prefix(double /*unused*/)
        method CharType (line 14565) | static constexpr CharType get_msgpack_float_prefix(float /*unused*/)
        method CharType (line 14570) | static constexpr CharType get_msgpack_float_prefix(double /*unused*/)
        method write_number_with_ubjson_prefix (line 14582) | void write_number_with_ubjson_prefix(const NumberType n,
        method write_number_with_ubjson_prefix (line 14595) | void write_number_with_ubjson_prefix(const NumberType n,
        method write_number_with_ubjson_prefix (line 14658) | void write_number_with_ubjson_prefix(const NumberType n,
        method CharType (line 14722) | CharType ubjson_prefix(const BasicJsonType& j) const noexcept
        method CharType (line 14803) | static constexpr CharType get_ubjson_float_prefix(float /*unused*/)
        method CharType (line 14808) | static constexpr CharType get_ubjson_float_prefix(double /*unused*/)
        method write_number (line 14829) | void write_number(const NumberType n)
        method write_compact_float (line 14845) | void write_compact_float(const number_float_t n, detail::input_for...
        method CharType (line 14879) | static constexpr CharType to_char_type(std::uint8_t x) noexcept
        method CharType (line 14886) | static CharType to_char_type(std::uint8_t x) noexcept
        method CharType (line 14897) | static constexpr CharType to_char_type(std::uint8_t x) noexcept
        method CharType (line 14908) | static constexpr CharType to_char_type(InputCharType x) noexcept
      type dtoa_impl (line 14979) | namespace dtoa_impl
        function Target (line 14983) | Target reinterpret_bits(const Source source)
        type diyfp (line 14992) | struct diyfp // f * 2^e
          method diyfp (line 14999) | constexpr diyfp(std::uint64_t f_, int e_) noexcept : f(f_), e(e_...
          method diyfp (line 15005) | static diyfp sub(const diyfp& x, const diyfp& y) noexcept
          method diyfp (line 15017) | static diyfp mul(const diyfp& x, const diyfp& y) noexcept
          method diyfp (line 15082) | static diyfp normalize(diyfp x) noexcept
          method diyfp (line 15099) | static diyfp normalize_to(const diyfp& x, const int target_expon...
        type boundaries (line 15110) | struct boundaries
        function boundaries (line 15124) | boundaries compute_boundaries(FloatType value)
        type cached_power (line 15249) | struct cached_power // c = f * 2^e ~= 10^k
        function cached_power (line 15263) | inline cached_power get_cached_power_for_binary_exponent(int e)
        function find_largest_pow10 (line 15427) | inline int find_largest_pow10(const std::uint32_t n, std::uint32_t...
        function grisu2_round (line 15481) | inline void grisu2_round(char* buf, int len, std::uint64_t dist, s...
        function grisu2_digit_gen (line 15522) | inline void grisu2_digit_gen(char* buffer, int& length, int& decim...
        function grisu2 (line 15763) | inline void grisu2(char* buf, int& len, int& decimal_exponent,
        function JSON_HEDLEY_NON_NULL (line 15822) | JSON_HEDLEY_NON_NULL(1)
      type error_handler_t (line 16077) | enum class error_handler_t
      class serializer (line 16085) | class serializer
        method serializer (line 16101) | serializer(output_adapter_t<char> s, const char ichar,
        method serializer (line 16113) | serializer(const serializer&) = delete;
        method serializer (line 16114) | serializer& operator=(const serializer&) = delete;
        method serializer (line 16115) | serializer(serializer&&) = delete;
        method serializer (line 16116) | serializer& operator=(serializer&&) = delete;
        method dump (line 16141) | void dump(const BasicJsonType& val,
        method switch (line 16439) | switch (decode(state, codepoint, byte))
    type detail (line 2250) | namespace detail
      type value_t (line 129) | enum class value_t : std::uint8_t
      type make_void (line 2238) | struct make_void
      type nonesuch (line 2252) | struct nonesuch
        method nonesuch (line 2254) | nonesuch() = delete;
        method nonesuch (line 2256) | nonesuch(nonesuch const&) = delete;
        method nonesuch (line 2257) | nonesuch(nonesuch const&&) = delete;
      type detector (line 2266) | struct detector
      type is_detected_lazy (line 2283) | struct is_detected_lazy : is_detected<Op, Args...> { }
      function replace_substring (line 2725) | inline void replace_substring(std::string& s, const std::string& f,
      function escape (line 2743) | inline std::string escape(std::string s)
      function unescape (line 2757) | static void unescape(std::string& s)
      type position_t (line 2776) | struct position_t
      class exception (line 2808) | class exception : public std::exception
        method JSON_HEDLEY_NON_NULL (line 2821) | JSON_HEDLEY_NON_NULL(3)
        method name (line 2824) | static std::string name(const std::string& ename, int id_)
        method diagnostics (line 2830) | static std::string diagnostics(const BasicJsonType& leaf_element)
      class parse_error (line 2900) | class parse_error : public exception
        method parse_error (line 2913) | static parse_error create(int id_, const position_t& pos, const st...
        method parse_error (line 2921) | static parse_error create(int id_, std::size_t byte_, const std::s...
        method parse_error (line 2941) | parse_error(int id_, std::size_t byte_, const char* what_arg)
        method position_string (line 2944) | static std::string position_string(const position_t& pos)
      class invalid_iterator (line 2953) | class invalid_iterator : public exception
        method invalid_iterator (line 2957) | static invalid_iterator create(int id_, const std::string& what_ar...
        method JSON_HEDLEY_NON_NULL (line 2964) | JSON_HEDLEY_NON_NULL(3)
      class type_error (line 2971) | class type_error : public exception
        method type_error (line 2975) | static type_error create(int id_, const std::string& what_arg, con...
        method JSON_HEDLEY_NON_NULL (line 2982) | JSON_HEDLEY_NON_NULL(3)
      class out_of_range (line 2988) | class out_of_range : public exception
        method out_of_range (line 2992) | static out_of_range create(int id_, const std::string& what_arg, c...
        method JSON_HEDLEY_NON_NULL (line 2999) | JSON_HEDLEY_NON_NULL(3)
      class other_error (line 3005) | class other_error : public exception
        method other_error (line 3009) | static other_error create(int id_, const std::string& what_arg, co...
        method JSON_HEDLEY_NON_NULL (line 3016) | JSON_HEDLEY_NON_NULL(3)
      type integer_sequence (line 3082) | struct integer_sequence
        method size (line 3085) | static constexpr std::size_t size() noexcept
      type utility_internal (line 3099) | namespace utility_internal
        type Extend (line 3103) | struct Extend
        type Gen (line 3121) | struct Gen
        type Gen<T, 0> (line 3128) | struct Gen<T, 0>
      type priority_tag (line 3166) | struct priority_tag : priority_tag < N - 1 > {}
      type priority_tag<0> (line 3167) | struct priority_tag<0> {}
      type static_const (line 3171) | struct static_const
      type identity_tag (line 3190) | struct identity_tag {}
      type iterator_types (line 3220) | struct iterator_types {}
      type iterator_types <
    It,
    void_t<typename It::difference_type, typename It::value_type, typename It::pointer,
    typename It::reference, typename It::iterator_category >> (line 3223) | struct iterator_types <
      type iterator_traits (line 3238) | struct iterator_traits
      type iterator_traits < T, enable_if_t < !std::is_pointer<T>::value >> (line 3243) | struct iterator_traits < T, enable_if_t < !std::is_pointer<T>::value >>
      type iterator_traits<T*, enable_if_t<std::is_object<T>::value>> (line 3249) | struct iterator_traits<T*, enable_if_t<std::is_object<T>::value>>
      type is_basic_json (line 3378) | struct is_basic_json : std::false_type {}
      class json_ref (line 3388) | class json_ref
        method json_ref (line 13084) | json_ref(value_type&& value)
        method json_ref (line 13088) | json_ref(const value_type& value)
        method json_ref (line 13092) | json_ref(std::initializer_list<json_ref> init)
        method json_ref (line 13099) | json_ref(Args && ... args)
        method json_ref (line 13104) | json_ref(json_ref&&) noexcept = default;
        method json_ref (line 13105) | json_ref(const json_ref&) = delete;
        method json_ref (line 13106) | json_ref& operator=(const json_ref&) = delete;
        method json_ref (line 13107) | json_ref& operator=(json_ref&&) = delete;
        method value_type (line 13110) | value_type moved_or_copied() const
        method value_type (line 13119) | value_type const& operator*() const
        method value_type (line 13124) | value_type const* operator->() const
      type is_json_ref (line 3391) | struct is_json_ref : std::false_type {}
      type is_json_ref<json_ref<T>> (line 3394) | struct is_json_ref<json_ref<T>> : std::true_type {}
      type has_from_json (line 3432) | struct has_from_json : std::false_type {}
      type is_getable (line 3439) | struct is_getable
      type has_from_json < BasicJsonType, T, enable_if_t < !is_basic_json<T>::value >> (line 3445) | struct has_from_json < BasicJsonType, T, enable_if_t < !is_basic_jso...
      type has_non_default_from_json (line 3457) | struct has_non_default_from_json : std::false_type {}
      type has_non_default_from_json < BasicJsonType, T, enable_if_t < !is_basic_json<T>::value >> (line 3460) | struct has_non_default_from_json < BasicJsonType, T, enable_if_t < !...
      type has_to_json (line 3472) | struct has_to_json : std::false_type {}
      type has_to_json < BasicJsonType, T, enable_if_t < !is_basic_json<T>::value >> (line 3475) | struct has_to_json < BasicJsonType, T, enable_if_t < !is_basic_json<...
      type conjunction (line 3490) | struct conjunction : std::true_type { }
      type conjunction<B1> (line 3491) | struct conjunction<B1> : B1 { }
      type negation (line 3497) | struct negation : std::integral_constant < bool, !B::value > { }
      type is_default_constructible (line 3503) | struct is_default_constructible : std::is_default_constructible<T> {}
      type is_default_constructible<std::pair<T1, T2>> (line 3506) | struct is_default_constructible<std::pair<T1, T2>>
      type is_default_constructible<const std::pair<T1, T2>> (line 3510) | struct is_default_constructible<const std::pair<T1, T2>>
      type is_constructible (line 3523) | struct is_constructible : std::is_constructible<T, Args...> {}
      type is_constructible<std::pair<T1, T2>> (line 3526) | struct is_constructible<std::pair<T1, T2>> : is_default_constructibl...
      type is_constructible<const std::pair<T1, T2>> (line 3529) | struct is_constructible<const std::pair<T1, T2>> : is_default_constr...
      type is_iterator_traits (line 3539) | struct is_iterator_traits : std::false_type {}
      type is_iterator_traits<iterator_traits<T>> (line 3542) | struct is_iterator_traits<iterator_traits<T>>
      type is_range (line 3557) | struct is_range
      type is_complete_type (line 3586) | struct is_complete_type : std::false_type {}
      type is_complete_type<T, decltype(void(sizeof(T)))> (line 3589) | struct is_complete_type<T, decltype(void(sizeof(T)))> : std::true_ty...
      type is_compatible_object_type_impl (line 3593) | struct is_compatible_object_type_impl : std::false_type {}
      type is_compatible_object_type_impl <
    BasicJsonType, CompatibleObjectType,
    enable_if_t < is_detected<mapped_type_t, CompatibleObjectType>::value&&
    is_detected<key_type_t, CompatibleObjectType>::value >> (line 3596) | struct is_compatible_object_type_impl <
      type is_compatible_object_type (line 3612) | struct is_compatible_object_type
      type is_constructible_object_type_impl (line 3617) | struct is_constructible_object_type_impl : std::false_type {}
      type is_constructible_object_type_impl <
    BasicJsonType, ConstructibleObjectType,
    enable_if_t < is_detected<mapped_type_t, ConstructibleObjectType>::value&&
    is_detected<key_type_t, ConstructibleObjectType>::value >> (line 3620) | struct is_constructible_object_type_impl <
      type is_constructible_object_type (line 3644) | struct is_constructible_object_type
      type is_compatible_string_type (line 3649) | struct is_compatible_string_type
      type is_constructible_string_type (line 3656) | struct is_constructible_string_type
      type is_compatible_array_type_impl (line 3664) | struct is_compatible_array_type_impl : std::false_type {}
      type is_compatible_array_type (line 3682) | struct is_compatible_array_type
      type is_constructible_array_type_impl (line 3686) | struct is_constructible_array_type_impl : std::false_type {}
      type is_constructible_array_type_impl <
    BasicJsonType, ConstructibleArrayType,
    enable_if_t<std::is_same<ConstructibleArrayType,
    typename BasicJsonType::value_type>::value >> (line 3689) | struct is_constructible_array_type_impl <
      type is_constructible_array_type (line 3726) | struct is_constructible_array_type
      type is_compatible_integer_type_impl (line 3731) | struct is_compatible_integer_type_impl : std::false_type {}
      type is_compatible_integer_type_impl <
    RealIntegerType, CompatibleNumberIntegerType,
    enable_if_t < std::is_integral<RealIntegerType>::value&&
    std::is_integral<CompatibleNumberIntegerType>::value&&
    !std::is_same<bool, CompatibleNumberIntegerType>::value >> (line 3734) | struct is_compatible_integer_type_impl <
      type is_compatible_integer_type (line 3752) | struct is_compatible_integer_type
      type is_compatible_type_impl (line 3757) | struct is_compatible_type_impl: std::false_type {}
      type is_compatible_type_impl <
    BasicJsonType, CompatibleType,
    enable_if_t<is_complete_type<CompatibleType>::value >> (line 3760) | struct is_compatible_type_impl <
      type is_compatible_type (line 3769) | struct is_compatible_type
      type is_constructible_tuple (line 3773) | struct is_constructible_tuple : std::false_type {}
      type is_ordered_map (line 3781) | struct is_ordered_map
        type two (line 3785) | struct two
      function T (line 3798) | T conditional_static_cast(U value)
      function T (line 3804) | T conditional_static_cast(U value)
      function from_json (line 3834) | void from_json(const BasicJsonType& j, typename std::nullptr_t& n)
      function get_arithmetic_value (line 3848) | void get_arithmetic_value(const BasicJsonType& j, ArithmeticType& val)
      function from_json (line 3881) | void from_json(const BasicJsonType& j, typename BasicJsonType::boole...
      function from_json (line 3891) | void from_json(const BasicJsonType& j, typename BasicJsonType::strin...
      function from_json (line 3907) | void from_json(const BasicJsonType& j, ConstructibleStringType& s)
      function from_json (line 3918) | void from_json(const BasicJsonType& j, typename BasicJsonType::numbe...
      function from_json (line 3924) | void from_json(const BasicJsonType& j, typename BasicJsonType::numbe...
      function from_json (line 3930) | void from_json(const BasicJsonType& j, typename BasicJsonType::numbe...
      function from_json (line 3937) | void from_json(const BasicJsonType& j, EnumType& e)
      function from_json (line 3947) | void from_json(const BasicJsonType& j, std::forward_list<T, Allocato...
      function from_json (line 3964) | void from_json(const BasicJsonType& j, std::valarray<T>& l)
      function from_json (line 3979) | auto from_json(const BasicJsonType& j, T (&arr)[N])  // NOLINT(cppco...
      function from_json_array_impl (line 3989) | void from_json_array_impl(const BasicJsonType& j, typename BasicJson...
      function from_json_array_impl (line 3995) | auto from_json_array_impl(const BasicJsonType& j, std::array<T, N>& ...
      function from_json_array_impl (line 4009) | auto from_json_array_impl(const BasicJsonType& j, ConstructibleArray...
      function from_json_array_impl (line 4033) | void from_json_array_impl(const BasicJsonType& j, ConstructibleArray...
      function from_json (line 4058) | auto from_json(const BasicJsonType& j, ConstructibleArrayType& arr)
      function from_json_inplace_array_impl (line 4072) | std::array<T, sizeof...(Idx)> from_json_inplace_array_impl(BasicJson...
      function from_json (line 4079) | auto from_json(BasicJsonType&& j, identity_tag<std::array<T, N>> tag)
      function from_json (line 4091) | void from_json(const BasicJsonType& j, typename BasicJsonType::binar...
      function from_json (line 4103) | void from_json(const BasicJsonType& j, ConstructibleObjectType& obj)
      function from_json (line 4135) | void from_json(const BasicJsonType& j, ArithmeticType& val)
      function from_json_tuple_impl_base (line 4172) | std::tuple<Args...> from_json_tuple_impl_base(BasicJsonType&& j, ind...
      function from_json_tuple_impl (line 4178) | std::pair<A1, A2> from_json_tuple_impl(BasicJsonType&& j, identity_t...
      function from_json_tuple_impl (line 4185) | void from_json_tuple_impl(BasicJsonType&& j, std::pair<A1, A2>& p, p...
      function from_json_tuple_impl (line 4191) | std::tuple<Args...> from_json_tuple_impl(BasicJsonType&& j, identity...
      function from_json_tuple_impl (line 4197) | void from_json_tuple_impl(BasicJsonType&& j, std::tuple<Args...>& t,...
      function from_json (line 4203) | auto from_json(BasicJsonType&& j, TupleRelated&& t)
      function from_json (line 4217) | void from_json(const BasicJsonType& j, std::map<Key, Value, Compare,...
      function from_json (line 4237) | void from_json(const BasicJsonType& j, std::unordered_map<Key, Value...
      function from_json (line 4256) | void from_json(const BasicJsonType& j, std_fs::path& p)
      type from_json_fn (line 4266) | struct from_json_fn
      function int_to_string (line 4320) | void int_to_string( string_type& target, std::size_t value )
      class iteration_proxy_value (line 4326) | class iteration_proxy_value
        method iteration_proxy_value (line 4349) | explicit iteration_proxy_value(IteratorType it) noexcept
        method iteration_proxy_value (line 4354) | iteration_proxy_value& operator*()
        method iteration_proxy_value (line 4360) | iteration_proxy_value& operator++()
        method string_type (line 4381) | const string_type& key() const
        method value (line 4417) | typename IteratorType::reference value() const
      class iteration_proxy (line 4424) | class iteration_proxy
        method iteration_proxy (line 4432) | explicit iteration_proxy(typename IteratorType::reference cont) no...
        method begin (line 4436) | iteration_proxy_value<IteratorType> begin() noexcept
        method end (line 4442) | iteration_proxy_value<IteratorType> end() noexcept
      function get (line 4451) | auto get(const nlohmann::detail::iteration_proxy_value<IteratorType>...
      function get (line 4459) | auto get(const nlohmann::detail::iteration_proxy_value<IteratorType>...
      type external_constructor (line 4530) | struct external_constructor
      type external_constructor<value_t::boolean> (line 4533) | struct external_constructor<value_t::boolean>
        method construct (line 4536) | static void construct(BasicJsonType& j, typename BasicJsonType::bo...
      type external_constructor<value_t::string> (line 4546) | struct external_constructor<value_t::string>
        method construct (line 4549) | static void construct(BasicJsonType& j, const typename BasicJsonTy...
        method construct (line 4558) | static void construct(BasicJsonType& j, typename BasicJsonType::st...
        method construct (line 4569) | static void construct(BasicJsonType& j, const CompatibleStringType...
      type external_constructor<value_t::binary> (line 4579) | struct external_constructor<value_t::binary>
        method construct (line 4582) | static void construct(BasicJsonType& j, const typename BasicJsonTy...
        method construct (line 4591) | static void construct(BasicJsonType& j, typename BasicJsonType::bi...
      type external_constructor<value_t::number_float> (line 4601) | struct external_constructor<value_t::number_float>
        method construct (line 4604) | static void construct(BasicJsonType& j, typename BasicJsonType::nu...
      type external_constructor<value_t::number_unsigned> (line 4614) | struct external_constructor<value_t::number_unsigned>
        method construct (line 4617) | static void construct(BasicJsonType& j, typename BasicJsonType::nu...
      type external_constructor<value_t::number_integer> (line 4627) | struct external_constructor<value_t::number_integer>
        method construct (line 4630) | static void construct(BasicJsonType& j, typename BasicJsonType::nu...
      type external_constructor<value_t::array> (line 4640) | struct external_constructor<value_t::array>
        method construct (line 4643) | static void construct(BasicJsonType& j, const typename BasicJsonTy...
        method construct (line 4653) | static void construct(BasicJsonType& j, typename BasicJsonType::ar...
        method construct (line 4665) | static void construct(BasicJsonType& j, const CompatibleArrayType&...
        method construct (line 4678) | static void construct(BasicJsonType& j, const std::vector<bool>& arr)
        method construct (line 4694) | static void construct(BasicJsonType& j, const std::valarray<T>& arr)
      type external_constructor<value_t::object> (line 4710) | struct external_constructor<value_t::object>
        method construct (line 4713) | static void construct(BasicJsonType& j, const typename BasicJsonTy...
        method construct (line 4723) | static void construct(BasicJsonType& j, typename BasicJsonType::ob...
        method construct (line 4734) | static void construct(BasicJsonType& j, const CompatibleObjectType...
      function to_json (line 4753) | void to_json(BasicJsonType& j, T b) noexcept
      function to_json (line 4760) | void to_json(BasicJsonType& j, const CompatibleString& s)
      function to_json (line 4766) | void to_json(BasicJsonType& j, typename BasicJsonType::string_t&& s)
      function to_json (line 4773) | void to_json(BasicJsonType& j, FloatType val) noexcept
      function to_json (line 4780) | void to_json(BasicJsonType& j, CompatibleNumberUnsignedType val) noe...
      function to_json (line 4787) | void to_json(BasicJsonType& j, CompatibleNumberIntegerType val) noex...
      function to_json (line 4794) | void to_json(BasicJsonType& j, EnumType e) noexcept
      function to_json (line 4801) | void to_json(BasicJsonType& j, const std::vector<bool>& e)
      function to_json (line 4814) | void to_json(BasicJsonType& j, const CompatibleArrayType& arr)
      function to_json (line 4820) | void to_json(BasicJsonType& j, const typename BasicJsonType::binary_...
      function to_json (line 4827) | void to_json(BasicJsonType& j, const std::valarray<T>& arr)
      function to_json (line 4833) | void to_json(BasicJsonType& j, typename BasicJsonType::array_t&& arr)
      function to_json (line 4840) | void to_json(BasicJsonType& j, const CompatibleObjectType& obj)
      function to_json (line 4846) | void to_json(BasicJsonType& j, typename BasicJsonType::object_t&& obj)
      function to_json (line 4856) | void to_json(BasicJsonType& j, const T(&arr)[N]) // NOLINT(cppcoregu...
      function to_json (line 4862) | void to_json(BasicJsonType& j, const std::pair<T1, T2>& p)
      function to_json (line 4870) | void to_json(BasicJsonType& j, const T& b)
      function to_json_tuple_impl (line 4876) | void to_json_tuple_impl(BasicJsonType& j, const Tuple& t, index_sequ...
      function to_json (line 4882) | void to_json(BasicJsonType& j, const T& t)
      function to_json (line 4889) | void to_json(BasicJsonType& j, const std_fs::path& p)
      type to_json_fn (line 4895) | struct to_json_fn
      function combine (line 5079) | inline std::size_t combine(std::size_t seed, std::size_t h) noexcept
      function hash (line 5097) | std::size_t hash(const BasicJsonType& j)
      type input_format_t (line 5233) | enum class input_format_t { json, cbor, msgpack, ubjson, bson }
      class file_input_adapter (line 5244) | class file_input_adapter
        method file_input_adapter (line 5250) | explicit file_input_adapter(std::FILE* f) noexcept
        method file_input_adapter (line 5255) | file_input_adapter(const file_input_adapter&) = delete;
        method file_input_adapter (line 5256) | file_input_adapter(file_input_adapter&&) noexcept = default;
        method file_input_adapter (line 5257) | file_input_adapter& operator=(const file_input_adapter&) = delete;
        method file_input_adapter (line 5258) | file_input_adapter& operator=(file_input_adapter&&) = delete;
        method get_character (line 5261) | std::char_traits<char>::int_type get_character() noexcept
      class input_stream_adapter (line 5281) | class input_stream_adapter
        method input_stream_adapter (line 5296) | explicit input_stream_adapter(std::istream& i)
        method input_stream_adapter (line 5301) | input_stream_adapter(const input_stream_adapter&) = delete;
        method input_stream_adapter (line 5302) | input_stream_adapter& operator=(input_stream_adapter&) = delete;
        method input_stream_adapter (line 5303) | input_stream_adapter& operator=(input_stream_adapter&&) = delete;
        method input_stream_adapter (line 5305) | input_stream_adapter(input_stream_adapter&& rhs) noexcept
        method get_character (line 5315) | std::char_traits<char>::int_type get_character()
      class iterator_input_adapter (line 5336) | class iterator_input_adapter
        method iterator_input_adapter (line 5341) | iterator_input_adapter(IteratorType first, IteratorType last)
        method get_character (line 5345) | typename std::char_traits<char_type>::int_type get_character()
        method empty (line 5364) | bool empty() const
      type wide_string_input_helper (line 5372) | struct wide_string_input_helper
      type wide_string_input_helper<BaseInputAdapter, 4> (line 5375) | struct wide_string_input_helper<BaseInputAdapter, 4>
        method fill_buffer (line 5378) | static void fill_buffer(BaseInputAdapter& input,
      type wide_string_input_helper<BaseInputAdapter, 2> (line 5433) | struct wide_string_input_helper<BaseInputAdapter, 2>
        method fill_buffer (line 5436) | static void fill_buffer(BaseInputAdapter& input,
      class wide_string_input_adapter (line 5496) | class wide_string_input_adapter
        method wide_string_input_adapter (line 5501) | wide_string_input_adapter(BaseInputAdapter base)
        method get_character (line 5504) | typename std::char_traits<char>::int_type get_character() noexcept
        method fill_buffer (line 5525) | void fill_buffer()
      type iterator_input_adapter_factory (line 5541) | struct iterator_input_adapter_factory
        method adapter_type (line 5547) | static adapter_type create(IteratorType first, IteratorType last)
      type is_iterator_of_multibyte (line 5554) | struct is_iterator_of_multibyte
      type iterator_input_adapter_factory<IteratorType, enable_if_t<is_iterator_of_multibyte<IteratorType>::value>> (line 5564) | struct iterator_input_adapter_factory<IteratorType, enable_if_t<is_i...
        method adapter_type (line 5571) | static adapter_type create(IteratorType first, IteratorType last)
      function input_adapter (line 5579) | typename iterator_input_adapter_factory<IteratorType>::adapter_type ...
      type container_input_adapter_factory_impl (line 5589) | namespace container_input_adapter_factory_impl
        type container_input_adapter_factory (line 5596) | struct container_input_adapter_factory {}
        type container_input_adapter_factory< ContainerType,
       void_t<decltype(begin(std::declval<ContainerType>()), end(std::declval<ContainerType>()))>> (line 5599) | struct container_input_adapter_factory< ContainerType,
          method adapter_type (line 5604) | static adapter_type create(const ContainerType& container)
      function input_adapter (line 5613) | typename container_input_adapter_factory_impl::container_input_adapt...
      function file_input_adapter (line 5620) | inline file_input_adapter input_adapter(std::FILE* file)
        method file_input_adapter (line 5250) | explicit file_input_adapter(std::FILE* f) noexcept
        method file_input_adapter (line 5255) | file_input_adapter(const file_input_adapter&) = delete;
        method file_input_adapter (line 5256) | file_input_adapter(file_input_adapter&&) noexcept = default;
        method file_input_adapter (line 5257) | file_input_adapter& operator=(const file_input_adapter&) = delete;
        method file_input_adapter (line 5258) | file_input_adapter& operator=(file_input_adapter&&) = delete;
        method get_character (line 5261) | std::char_traits<char>::int_type get_character() noexcept
      function input_stream_adapter (line 5625) | inline input_stream_adapter input_adapter(std::istream& stream)
        method input_stream_adapter (line 5296) | explicit input_stream_adapter(std::istream& i)
        method input_stream_adapter (line 5301) | input_stream_adapter(const input_stream_adapter&) = delete;
        method input_stream_adapter (line 5302) | input_stream_adapter& operator=(input_stream_adapter&) = delete;
        method input_stream_adapter (line 5303) | input_stream_adapter& operator=(input_stream_adapter&&) = delete;
        method input_stream_adapter (line 5305) | input_stream_adapter(input_stream_adapter&& rhs) noexcept
        method get_character (line 5315) | std::char_traits<char>::int_type get_character()
      function input_stream_adapter (line 5630) | inline input_stream_adapter input_adapter(std::istream&& stream)
        method input_stream_adapter (line 5296) | explicit input_stream_adapter(std::istream& i)
        method input_stream_adapter (line 5301) | input_stream_adapter(const input_stream_adapter&) = delete;
        method input_stream_adapter (line 5302) | input_stream_adapter& operator=(input_stream_adapter&) = delete;
        method input_stream_adapter (line 5303) | input_stream_adapter& operator=(input_stream_adapter&&) = delete;
        method input_stream_adapter (line 5305) | input_stream_adapter(input_stream_adapter&& rhs) noexcept
        method get_character (line 5315) | std::char_traits<char>::int_type get_character()
      function contiguous_bytes_input_adapter (line 5646) | contiguous_bytes_input_adapter input_adapter(CharT b)
      function input_adapter (line 5654) | auto input_adapter(T (&array)[N]) -> decltype(input_adapter(array, a...
      class span_input_adapter (line 5662) | class span_input_adapter
        method span_input_adapter (line 5671) | span_input_adapter(CharT b, std::size_t l)
        method span_input_adapter (line 5678) | span_input_adapter(IteratorType first, IteratorType last)
        method contiguous_bytes_input_adapter (line 5681) | contiguous_bytes_input_adapter&& get()
      class json_sax_dom_parser (line 5848) | class json_sax_dom_parser
        method json_sax_dom_parser (line 5862) | explicit json_sax_dom_parser(BasicJsonType& r, const bool allow_ex...
        method json_sax_dom_parser (line 5867) | json_sax_dom_parser(const json_sax_dom_parser&) = delete;
        method json_sax_dom_parser (line 5868) | json_sax_dom_parser(json_sax_dom_parser&&) = default;
        method json_sax_dom_parser (line 5869) | json_sax_dom_parser& operator=(const json_sax_dom_parser&) = delete;
        method json_sax_dom_parser (line 5870) | json_sax_dom_parser& operator=(json_sax_dom_parser&&) = default;
        method null (line 5873) | bool null()
        method boolean (line 5879) | bool boolean(bool val)
        method number_integer (line 5885) | bool number_integer(number_integer_t val)
        method number_unsigned (line 5891) | bool number_unsigned(number_unsigned_t val)
        method number_float (line 5897) | bool number_float(number_float_t val, const string_t& /*unused*/)
        method string (line 5903) | bool string(string_t& val)
        method binary (line 5909) | bool binary(binary_t& val)
        method start_object (line 5915) | bool start_object(std::size_t len)
        method key (line 5927) | bool key(string_t& val)
        method end_object (line 5934) | bool end_object()
        method start_array (line 5941) | bool start_array(std::size_t len)
        method end_array (line 5953) | bool end_array()
        method parse_error (line 5961) | bool parse_error(std::size_t /*unused*/, const std::string& /*unus...
        method is_errored (line 5973) | constexpr bool is_errored() const
        method JSON_HEDLEY_RETURNS_NON_NULL (line 5986) | JSON_HEDLEY_RETURNS_NON_NULL
      class json_sax_dom_callback_parser (line 6022) | class json_sax_dom_callback_parser
        method json_sax_dom_callback_parser (line 6033) | json_sax_dom_callback_parser(BasicJsonType& r,
        method json_sax_dom_callback_parser (line 6042) | json_sax_dom_callback_parser(const json_sax_dom_callback_parser&) ...
        method json_sax_dom_callback_parser (line 6043) | json_sax_dom_callback_parser(json_sax_dom_callback_parser&&) = def...
        method json_sax_dom_callback_parser (line 6044) | json_sax_dom_callback_parser& operator=(const json_sax_dom_callbac...
        method json_sax_dom_callback_parser (line 6045) | json_sax_dom_callback_parser& operator=(json_sax_dom_callback_pars...
        method null (line 6048) | bool null()
        method boolean (line 6054) | bool boolean(bool val)
        method number_integer (line 6060) | bool number_integer(number_integer_t val)
        method number_unsigned (line 6066) | bool number_unsigned(number_unsigned_t val)
        method number_float (line 6072) | bool number_float(number_float_t val, const string_t& /*unused*/)
        method string (line 6078) | bool string(string_t& val)
        method binary (line 6084) | bool binary(binary_t& val)
        method start_object (line 6090) | bool start_object(std::size_t len)
        method key (line 6108) | bool key(string_t& val)
        method end_object (line 6125) | bool end_object()
        method start_array (line 6161) | bool start_array(std::size_t len)
        method end_array (line 6178) | bool end_array()
        method parse_error (line 6211) | bool parse_error(std::size_t /*unused*/, const std::string& /*unus...
        method is_errored (line 6223) | constexpr bool is_errored() const
        method handle_value (line 6245) | std::pair<bool, BasicJsonType*> handle_value(Value&& v, const bool...
      class json_sax_acceptor (line 6329) | class json_sax_acceptor
        method null (line 6338) | bool null()
        method boolean (line 6343) | bool boolean(bool /*unused*/)
        method number_integer (line 6348) | bool number_integer(number_integer_t /*unused*/)
        method number_unsigned (line 6353) | bool number_unsigned(number_unsigned_t /*unused*/)
        method number_float (line 6358) | bool number_float(number_float_t /*unused*/, const string_t& /*unu...
        method string (line 6363) | bool string(string_t& /*unused*/)
        method binary (line 6368) | bool binary(binary_t& /*unused*/)
        method start_object (line 6373) | bool start_object(std::size_t /*unused*/ = static_cast<std::size_t...
        method key (line 6378) | bool key(string_t& /*unused*/)
        method end_object (line 6383) | bool end_object()
        method start_array (line 6388) | bool start_array(std::size_t /*unused*/ = static_cast<std::size_t>...
        method end_array (line 6393) | bool end_array()
        method parse_error (line 6398) | bool parse_error(std::size_t /*unused*/, const std::string& /*unus...
      class lexer_base (line 6436) | class lexer_base
        type token_type (line 6440) | enum class token_type
      class lexer (line 6513) | class lexer : public lexer_base<BasicJsonType>
        method lexer (line 6525) | explicit lexer(InputAdapterType&& adapter, bool ignore_comments_ =...
        method lexer (line 6532) | lexer(const lexer&) = delete;
        method lexer (line 6533) | lexer(lexer&&) = default;
        method lexer (line 6534) | lexer& operator=(lexer&) = delete;
        method lexer (line 6535) | lexer& operator=(lexer&&) = default;
        method JSON_HEDLEY_PURE (line 6544) | JSON_HEDLEY_PURE
        method get_codepoint (line 6571) | int get_codepoint()
        method next_byte_in_range (line 6619) | bool next_byte_in_range(std::initializer_list<char_int_type> ranges)
        method token_type (line 6656) | token_type scan_string()
        method scan_comment (line 7246) | bool scan_comment()
        method strtof (line 7314) | static void strtof(float& f, const char* str, char** endptr) noexcept
        method strtof (line 7320) | static void strtof(double& f, const char* str, char** endptr) noex...
        method strtof (line 7326) | static void strtof(long double& f, const char* str, char** endptr)...
        method token_type (line 7371) | token_type scan_number()  // lgtm [cpp/use-of-goto]
      type is_sax (line 8104) | struct is_sax
      type is_sax_static_asserts (line 8135) | struct is_sax_static_asserts
      type cbor_tag_handler_t (line 8201) | enum class cbor_tag_handler_t
      function little_endianness (line 8215) | static inline bool little_endianness(int num = 1) noexcept
      class binary_reader (line 8229) | class binary_reader
        method binary_reader (line 8246) | explicit binary_reader(InputAdapterType&& adapter) noexcept : ia(s...
        method binary_reader (line 8252) | binary_reader(const binary_reader&) = delete;
        method binary_reader (line 8253) | binary_reader(binary_reader&&) = default;
        method binary_reader (line 8254) | binary_reader& operator=(const binary_reader&) = delete;
        method binary_reader (line 8255) | binary_reader& operator=(binary_reader&&) = default;
        method JSON_HEDLEY_NON_NULL (line 8266) | JSON_HEDLEY_NON_NULL(3)
        method parse_bson_internal (line 8329) | bool parse_bson_internal()
        method get_bson_cstr (line 8354) | bool get_bson_cstr(string_t& result)
        method get_bson_string (line 8384) | bool get_bson_string(const NumberType len, string_t& result)
        method get_bson_binary (line 8405) | bool get_bson_binary(const NumberType len, binary_t& result)
        method parse_bson_element_internal (line 8431) | bool parse_bson_element_internal(const char_int_type element_type,
        method parse_bson_element_list (line 8509) | bool parse_bson_element_list(const bool is_array)
        method parse_bson_array (line 8547) | bool parse_bson_array()
        method parse_cbor_internal (line 8577) | bool parse_cbor_internal(const bool get_char,
        method get_cbor_string (line 9065) | bool get_cbor_string(string_t& result)
        method get_cbor_binary (line 9160) | bool get_cbor_binary(binary_t& result)
        method get_cbor_array (line 9254) | bool get_cbor_array(const std::size_t len,
        method get_cbor_object (line 9292) | bool get_cbor_object(const std::size_t len,
        method parse_msgpack_internal (line 9348) | bool parse_msgpack_internal()
        method get_msgpack_string (line 9728) | bool get_msgpack_string(string_t& result)
        method get_msgpack_binary (line 9810) | bool get_msgpack_binary(binary_t& result)
        method get_msgpack_array (line 9921) | bool get_msgpack_array(const std::size_t len)
        method get_msgpack_object (line 9943) | bool get_msgpack_object(const std::size_t len)
        method parse_ubjson_internal (line 9980) | bool parse_ubjson_internal(const bool get_char = true)
        method get_ubjson_string (line 9999) | bool get_ubjson_string(string_t& result, const bool get_char = true)
        method get_ubjson_size_value (line 10053) | bool get_ubjson_size_value(std::size_t& result)
        method get_ubjson_size_type (line 10130) | bool get_ubjson_size_type(std::pair<std::size_t, char_int_type>& r...
        method get_ubjson_value (line 10171) | bool get_ubjson_value(const char_int_type prefix)
        method get_ubjson_array (line 10272) | bool get_ubjson_array()
        method get_ubjson_object (line 10334) | bool get_ubjson_object()
        method get_ubjson_high_precision_number (line 10409) | bool get_ubjson_high_precision_number()
        method char_int_type (line 10485) | char_int_type get()
        method char_int_type (line 10494) | char_int_type get_ignore_noop()
        method get_number (line 10519) | bool get_number(const input_format_t format, NumberType& result)
        method get_string (line 10562) | bool get_string(const input_format_t format,
        method get_binary (line 10595) | bool get_binary(const input_format_t format,
        method JSON_HEDLEY_NON_NULL (line 10618) | JSON_HEDLEY_NON_NULL(3)
        method get_token_string (line 10632) | std::string get_token_string() const
        method exception_message (line 10645) | std::string exception_message(const input_format_t format,
      type parse_event_t (line 10733) | enum class parse_event_t : std::uint8_t
      class parser (line 10759) | class parser
        method parser (line 10770) | explicit parser(InputAdapterType&& adapter,
        method parse (line 10792) | void parse(const bool strict, BasicJsonType& result)
        method accept (line 10852) | bool accept(const bool strict = true)
        method sax_parse (line 10860) | bool sax_parse(SAX* sax, const bool strict = true)
        method sax_parse_internal (line 10879) | bool sax_parse_internal(SAX* sax)
        method token_type (line 11160) | token_type get_token()
        method exception_message (line 11165) | std::string exception_message(const token_type expected, const std...
      class primitive_iterator_t (line 11233) | class primitive_iterator_t
        method difference_type (line 11245) | constexpr difference_type get_value() const noexcept
        method set_begin (line 11251) | void set_begin() noexcept
        method set_end (line 11257) | void set_end() noexcept
        method is_begin (line 11263) | constexpr bool is_begin() const noexcept
        method is_end (line 11269) | constexpr bool is_end() const noexcept
        method primitive_iterator_t (line 11284) | primitive_iterator_t operator+(difference_type n) noexcept
        method difference_type (line 11291) | constexpr difference_type operator-(primitive_iterator_t lhs, prim...
        method primitive_iterator_t (line 11296) | primitive_iterator_t& operator++() noexcept
        method primitive_iterator_t (line 11302) | primitive_iterator_t const operator++(int) noexcept // NOLINT(read...
        method primitive_iterator_t (line 11309) | primitive_iterator_t& operator--() noexcept
        method primitive_iterator_t (line 11315) | primitive_iterator_t const operator--(int) noexcept // NOLINT(read...
        method primitive_iterator_t (line 11322) | primitive_iterator_t& operator+=(difference_type n) noexcept
        method primitive_iterator_t (line 11328) | primitive_iterator_t& operator-=(difference_type n) noexcept
      type internal_iterator (line 11348) | struct internal_iterator
      class iteration_proxy (line 11386) | class iteration_proxy
        method iteration_proxy (line 4432) | explicit iteration_proxy(typename IteratorType::reference cont) no...
        method begin (line 4436) | iteration_proxy_value<IteratorType> begin() noexcept
        method end (line 4442) | iteration_proxy_value<IteratorType> end() noexcept
      class iteration_proxy_value (line 11387) | class iteration_proxy_value
        method iteration_proxy_value (line 4349) | explicit iteration_proxy_value(IteratorType it) noexcept
        method iteration_proxy_value (line 4354) | iteration_proxy_value& operator*()
        method iteration_proxy_value (line 4360) | iteration_proxy_value& operator++()
        method string_type (line 4381) | const string_type& key() const
        method value (line 4417) | typename IteratorType::reference value() const
      function set_end (line 11406) | class iter_impl // NOLINT(cppcoreguidelines-special-member-functions...
      class json_reverse_iterator (line 12144) | class json_reverse_iterator : public std::reverse_iterator<Base>
        method json_reverse_iterator (line 12154) | explicit json_reverse_iterator(const typename base_iterator::itera...
        method json_reverse_iterator (line 12158) | explicit json_reverse_iterator(const base_iterator& it) noexcept :...
        method json_reverse_iterator (line 12161) | json_reverse_iterator const operator++(int) // NOLINT(readability-...
        method json_reverse_iterator (line 12167) | json_reverse_iterator& operator++()
        method json_reverse_iterator (line 12173) | json_reverse_iterator const operator--(int) // NOLINT(readability-...
        method json_reverse_iterator (line 12179) | json_reverse_iterator& operator--()
        method json_reverse_iterator (line 12185) | json_reverse_iterator& operator+=(difference_type i)
        method json_reverse_iterator (line 12191) | json_reverse_iterator operator+(difference_type i) const
        method json_reverse_iterator (line 12197) | json_reverse_iterator operator-(difference_type i) const
        method difference_type (line 12203) | difference_type operator-(const json_reverse_iterator& other) const
        method reference (line 12209) | reference operator[](difference_type n) const
        method key (line 12215) | auto key() const -> decltype(std::declval<Base>().key())
        method reference (line 12222) | reference value() const
      class json_ref (line 13079) | class json_ref
        method json_ref (line 13084) | json_ref(value_type&& value)
        method json_ref (line 13088) | json_ref(const value_type& value)
        method json_ref (line 13092) | json_ref(std::initializer_list<json_ref> init)
        method json_ref (line 13099) | json_ref(Args && ... args)
        method json_ref (line 13104) | json_ref(json_ref&&) noexcept = default;
        method json_ref (line 13105) | json_ref(const json_ref&) = delete;
        method json_ref (line 13106) | json_ref& operator=(const json_ref&) = delete;
        method json_ref (line 13107) | json_ref& operator=(json_ref&&) = delete;
        method value_type (line 13110) | value_type moved_or_copied() const
        method value_type (line 13119) | value_type const& operator*() const
        method value_type (line 13124) | value_type const* operator->() const
      type output_adapter_protocol (line 13183) | struct output_adapter_protocol
        method output_adapter_protocol (line 13189) | output_adapter_protocol() = default;
        method output_adapter_protocol (line 13190) | output_adapter_protocol(const output_adapter_protocol&) = default;
        method output_adapter_protocol (line 13191) | output_adapter_protocol(output_adapter_protocol&&) noexcept = defa...
        method output_adapter_protocol (line 13192) | output_adapter_protocol& operator=(const output_adapter_protocol&)...
        method output_adapter_protocol (line 13193) | output_adapter_protocol& operator=(output_adapter_protocol&&) noex...
      class output_vector_adapter (line 13202) | class output_vector_adapter : public output_adapter_protocol<CharType>
        method output_vector_adapter (line 13205) | explicit output_vector_adapter(std::vector<CharType, AllocatorType...
        method write_character (line 13209) | void write_character(CharType c) override
        method JSON_HEDLEY_NON_NULL (line 13214) | JSON_HEDLEY_NON_NULL(2)
      class output_stream_adapter (line 13227) | class output_stream_adapter : public output_adapter_protocol<CharType>
        method output_stream_adapter (line 13230) | explicit output_stream_adapter(std::basic_ostream<CharType>& s) no...
        method write_character (line 13234) | void write_character(CharType c) override
        method JSON_HEDLEY_NON_NULL (line 13239) | JSON_HEDLEY_NON_NULL(2)
      class output_string_adapter (line 13252) | class output_string_adapter : public output_adapter_protocol<CharType>
        method output_string_adapter (line 13255) | explicit output_string_adapter(StringType& s) noexcept
        method write_character (line 13259) | void write_character(CharType c) override
        method JSON_HEDLEY_NON_NULL (line 13264) | JSON_HEDLEY_NON_NULL(2)
      class output_adapter (line 13275) | class output_adapter
        method output_adapter (line 13279) | output_adapter(std::vector<CharType, AllocatorType>& vec)
        method output_adapter (line 13283) | output_adapter(std::basic_ostream<CharType>& s)
        method output_adapter (line 13287) | output_adapter(StringType& s)
      class binary_writer (line 13314) | class binary_writer
        method binary_writer (line 13326) | explicit binary_writer(output_adapter_t<CharType> adapter) : oa(st...
        method write_bson (line 13335) | void write_bson(const BasicJsonType& j)
        method write_cbor (line 13364) | void write_cbor(const BasicJsonType& j)
        method write_msgpack (line 13688) | void write_msgpack(const BasicJsonType& j)
        method write_ubjson (line 14013) | void write_ubjson(const BasicJsonType& j, const bool use_count,
        method calc_bson_entry_header_size (line 14221) | static std::size_t calc_bson_entry_header_size(const string_t& nam...
        method write_bson_entry_header (line 14236) | void write_bson_entry_header(const string_t& name,
        method write_bson_boolean (line 14248) | void write_bson_boolean(const string_t& name,
        method write_bson_double (line 14258) | void write_bson_double(const string_t& name,
        method calc_bson_string_size (line 14268) | static std::size_t calc_bson_string_size(const string_t& value)
        method write_bson_string (line 14276) | void write_bson_string(const string_t& name,
        method write_bson_null (line 14290) | void write_bson_null(const string_t& name)
        method calc_bson_integer_size (line 14298) | static std::size_t calc_bson_integer_size(const std::int64_t value)
        method write_bson_integer (line 14308) | void write_bson_integer(const string_t& name,
        method calc_bson_unsigned_size (line 14326) | static constexpr std::size_t calc_bson_unsigned_size(const std::ui...
        method write_bson_unsigned (line 14336) | void write_bson_unsigned(const string_t& name,
        method write_bson_object_entry (line 14358) | void write_bson_object_entry(const string_t& name,
        method calc_bson_array_size (line 14368) | static std::size_t calc_bson_array_size(const typename BasicJsonTy...
        method calc_bson_binary_size (line 14383) | static std::size_t calc_bson_binary_size(const typename BasicJsonT...
        method write_bson_array (line 14391) | void write_bson_array(const string_t& name,
        method write_bson_binary (line 14410) | void write_bson_binary(const string_t& name,
        method calc_bson_element_size (line 14425) | static std::size_t calc_bson_element_size(const string_t& name,
        method write_bson_element (line 14473) | void write_bson_element(const string_t& name,
        method calc_bson_object_size (line 14520) | static std::size_t calc_bson_object_size(const typename BasicJsonT...
        method write_bson_object (line 14535) | void write_bson_object(const typename BasicJsonType::object_t& value)
        method CharType (line 14551) | static constexpr CharType get_cbor_float_prefix(float /*unused*/)
        method CharType (line 14556) | static constexpr CharType get_cbor_float_prefix(double /*unused*/)
        method CharType (line 14565) | static constexpr CharType get_msgpack_float_prefix(float /*unused*/)
        method CharType (line 14570) | static constexpr CharType get_msgpack_float_prefix(double /*unused*/)
        method write_number_with_ubjson_prefix (line 14582) | void write_number_with_ubjson_prefix(const NumberType n,
        method write_number_with_ubjson_prefix (line 14595) | void write_number_with_ubjson_prefix(const NumberType n,
        method write_number_with_ubjson_prefix (line 14658) | void write_number_with_ubjson_prefix(const NumberType n,
        method CharType (line 14722) | CharType ubjson_prefix(const BasicJsonType& j) const noexcept
        method CharType (line 14803) | static constexpr CharType get_ubjson_float_prefix(float /*unused*/)
        method CharType (line 14808) | static constexpr CharType get_ubjson_float_prefix(double /*unused*/)
        method write_number (line 14829) | void write_number(const NumberType n)
        method write_compact_float (line 14845) | void write_compact_float(const number_float_t n, detail::input_for...
        method CharType (line 14879) | static constexpr CharType to_char_type(std::uint8_t x) noexcept
        method CharType (line 14886) | static CharType to_char_type(std::uint8_t x) noexcept
        method CharType (line 14897) | static constexpr CharType to_char_type(std::uint8_t x) noexcept
        method CharType (line 14908) | static constexpr CharType to_char_type(InputCharType x) noexcept
      type dtoa_impl (line 14979) | namespace dtoa_impl
        function Target (line 14983) | Target reinterpret_bits(const Source source)
        type diyfp (line 14992) | struct diyfp // f * 2^e
          method diyfp (line 14999) | constexpr diyfp(std::uint64_t f_, int e_) noexcept : f(f_), e(e_...
          method diyfp (line 15005) | static diyfp sub(const diyfp& x, const diyfp& y) noexcept
          method diyfp (line 15017) | static diyfp mul(const diyfp& x, const diyfp& y) noexcept
          method diyfp (line 15082) | static diyfp normalize(diyfp x) noexcept
          method diyfp (line 15099) | static diyfp normalize_to(const diyfp& x, const int target_expon...
        type boundaries (line 15110) | struct boundaries
        function boundaries (line 15124) | boundaries compute_boundaries(FloatType value)
        type cached_power (line 15249) | struct cached_power // c = f * 2^e ~= 10^k
        function cached_power (line 15263) | inline cached_power get_cached_power_for_binary_exponent(int e)
        function find_largest_pow10 (line 15427) | inline int find_largest_pow10(const std::uint32_t n, std::uint32_t...
        function grisu2_round (line 15481) | inline void grisu2_round(char* buf, int len, std::uint64_t dist, s...
        function grisu2_digit_gen (line 15522) | inline void grisu2_digit_gen(char* buffer, int& length, int& decim...
        function grisu2 (line 15763) | inline void grisu2(char* buf, int& len, int& decimal_exponent,
        function JSON_HEDLEY_NON_NULL (line 15822) | JSON_HEDLEY_NON_NULL(1)
      type error_handler_t (line 16077) | enum class error_handler_t
      class serializer (line 16085) | class serializer
        method serializer (line 16101) | serializer(output_adapter_t<char> s, const char ichar,
        method serializer (line 16113) | serializer(const serializer&) = delete;
        method serializer (line 16114) | serializer& operator=(const serializer&) = delete;
        method serializer (line 16115) | serializer(serializer&&) = delete;
        method serializer (line 16116) | serializer& operator=(serializer&&) = delete;
        method dump (line 16141) | void dump(const BasicJsonType& val,
        method switch (line 16439) | switch (decode(state, codepoint, byte))
    type detail (line 2709) | namespace detail
      type value_t (line 129) | enum class value_t : std::uint8_t
      type make_void (line 2238) | struct make_void
      type nonesuch (line 2252) | struct nonesuch
        method nonesuch (line 2254) | nonesuch() = delete;
        method nonesuch (line 2256) | nonesuch(nonesuch const&) = delete;
        method nonesuch (line 2257) | nonesuch(nonesuch const&&) = delete;
      type detector (line 2266) | struct detector
      type is_detected_lazy (line 2283) | struct is_detected_lazy : is_detected<Op, Args...> { }
      function replace_substring (line 2725) | inline void replace_substring(std::string& s, const std::string& f,
      function escape (line 2743) | inline std::string escape(std::string s)
      function unescape (line 2757) | static void unescape(std::string& s)
      type position_t (line 2776) | struct position_t
      class exception (line 2808) | class exception : public std::exception
        method JSON_HEDLEY_NON_NULL (line 2821) | JSON_HEDLEY_NON_NULL(3)
        method name (line 2824) | static std::string name(const std::string& ename, int id_)
        method diagnostics (line 2830) | static std::string diagnostics(const BasicJsonType& leaf_element)
      class parse_error (line 2900) | class parse_error : public exception
        method parse_error (line 2913) | static parse_error create(int id_, const position_t& pos, const st...
        method parse_error (line 2921) | static parse_error create(int id_, std::size_t byte_, const std::s...
        method parse_error (line 2941) | parse_error(int id_, std::size_t byte_, const char* what_arg)
        method position_string (line 2944) | static std::string position_string(const position_t& pos)
      class invalid_iterator (line 2953) | class invalid_iterator : public exception
        method invalid_iterator (line 2957) | static invalid_iterator create(int id_, const std::string& what_ar...
        method JSON_HEDLEY_NON_NULL (line 2964) | JSON_HEDLEY_NON_NULL(3)
      class type_error (line 2971) | class type_error : public exception
        method type_error (line 2975) | static type_error create(int id_, const std::string& what_arg, con...
        method JSON_HEDLEY_NON_NULL (line 2982) | JSON_HEDLEY_NON_NULL(3)
      class out_of_range (line 2988) | class out_of_range : public exception
        method out_of_range (line 2992) | static out_of_range create(int id_, const std::string& what_arg, c...
        method JSON_HEDLEY_NON_NULL (line 2999) | JSON_HEDLEY_NON_NULL(3)
      class other_error (line 3005) | class other_error : public exception
        method other_error (line 3009) | static other_error create(int id_, const std::string& what_arg, co...
        method JSON_HEDLEY_NON_NULL (line 3016) | JSON_HEDLEY_NON_NULL(3)
      type integer_sequence (line 3082) | struct integer_sequence
        method size (line 3085) | static constexpr std::size_t size() noexcept
      type utility_internal (line 3099) | namespace utility_internal
        type Extend (line 3103) | struct Extend
        type Gen (line 3121) | struct Gen
        type Gen<T, 0> (line 3128) | struct Gen<T, 0>
      type priority_tag (line 3166) | struct priority_tag : priority_tag < N - 1 > {}
      type priority_tag<0> (line 3167) | struct priority_tag<0> {}
      type static_const (line 3171) | struct static_const
      type identity_tag (line 3190) | struct identity_tag {}
      type iterator_types (line 3220) | struct iterator_types {}
      type iterator_types <
    It,
    void_t<typename It::difference_type, typename It::value_type, typename It::pointer,
    typename It::reference, typename It::iterator_category >> (line 3223) | struct iterator_types <
      type iterator_traits (line 3238) | struct iterator_traits
      type iterator_traits < T, enable_if_t < !std::is_pointer<T>::value >> (line 3243) | struct iterator_traits < T, enable_if_t < !std::is_pointer<T>::value >>
      type iterator_traits<T*, enable_if_t<std::is_object<T>::value>> (line 3249) | struct iterator_traits<T*, enable_if_t<std::is_object<T>::value>>
      type is_basic_json (line 3378) | struct is_basic_json : std::false_type {}
      class json_ref (line 3388) | class json_ref
        method json_ref (line 13084) | json_ref(value_type&& value)
        method json_ref (line 13088) | json_ref(const value_type& value)
        method json_ref (line 13092) | json_ref(std::initializer_list<json_ref> init)
        method json_ref (line 13099) | json_ref(Args && ... args)
        method json_ref (line 13104) | json_ref(json_ref&&) noexcept = default;
        method json_ref (line 13105) | json_ref(const json_ref&) = delete;
        method json_ref (line 13106) | json_ref& operator=(const json_ref&) = delete;
        method json_ref (line 13107) | json_ref& operator=(json_ref&&) = delete;
        method value_type (line 13110) | value_type moved_or_copied() const
        method value_type (line 13119) | value_type const& operator*() const
        method value_type (line 13124) | value_type const* operator->() const
      type is_json_ref (line 3391) | struct is_json_ref : std::false_type {}
      type is_json_ref<json_ref<T>> (line 3394) | struct is_json_ref<json_ref<T>> : std::true_type {}
      type has_from_json (line 3432) | struct has_from_json : std::false_type {}
      type is_getable (line 3439) | struct is_getable
      type has_from_json < BasicJsonType, T, enable_if_t < !is_basic_json<T>::value >> (line 3445) | struct has_from_json < BasicJsonType, T, enable_if_t < !is_basic_jso...
      type has_non_default_from_json (line 3457) | struct has_non_default_from_json : std::false_type {}
      type has_non_default_from_json < BasicJsonType, T, enable_if_t < !is_basic_json<T>::value >> (line 3460) | struct has_non_default_from_json < BasicJsonType, T, enable_if_t < !...
      type has_to_json (line 3472) | struct has_to_json : std::false_type {}
      type has_to_json < BasicJsonType, T, enable_if_t < !is_basic_json<T>::value >> (line 3475) | struct has_to_json < BasicJsonType, T, enable_if_t < !is_basic_json<...
      type conjunction (line 3490) | struct conjunction : std::true_type { }
      type conjunction<B1> (line 3491) | struct conjunction<B1> : B1 { }
      type negation (line 3497) | struct negation : std::integral_constant < bool, !B::value > { }
      type is_default_constructible (line 3503) | struct is_default_constructible : std::is_default_constructible<T> {}
      type is_default_constructible<std::pair<T1, T2>> (line 3506) | struct is_default_constructible<std::pair<T1, T2>>
      type is_default_constructible<const std::pair<T1, T2>> (line 3510) | struct is_default_constructible<const std::pair<T1, T2>>
      type is_constructible (line 3523) | struct is_constructible : std::is_constructible<T, Args...> {}
      type is_constructible<std::pair<T1, T2>> (line 3526) | struct is_constructible<std::pair<T1, T2>> : is_default_constructibl...
      type is_constructible<const std::pair<T1, T2>> (line 3529) | struct is_constructible<const std::pair<T1, T2>> : is_default_constr...
      type is_iterator_traits (line 3539) | s
Condensed preview — 88 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (2,027K chars).
[
  {
    "path": ".gitignore",
    "chars": 78,
    "preview": ".vs/\n.vscode/\ndeps/\nlib/\nDebug*/\nRel*/\nx64/\n*.vcxproj.user\n*.DotSettings.user\n"
  },
  {
    "path": "EventLogging.cpp",
    "chars": 2138,
    "preview": "// EventLogging.cpp: implementation of the EventLogging class.\r\n//\r\n////////////////////////////////////////////////////"
  },
  {
    "path": "EventLogging.h",
    "chars": 858,
    "preview": "// EventLogging.h: interface for the EventLogging class.\r\n//\r\n//////////////////////////////////////////////////////////"
  },
  {
    "path": "GdiPlusTypes2.h",
    "chars": 15898,
    "preview": "/**************************************************************************\\\n*\n* Copyright (c) 1998-2001, Microsoft Corp"
  },
  {
    "path": "LICENSE",
    "chars": 35149,
    "preview": "                    GNU GENERAL PUBLIC LICENSE\n                       Version 3, 29 June 2007\n\n Copyright (C) 2007 Free "
  },
  {
    "path": "Makefile",
    "chars": 3486,
    "preview": "# usage:\n#  nmake            release build\n#  nmake debug=1    debug build\n#  nmake ddk=1      using DDK compiler\n#  nma"
  },
  {
    "path": "Makefile.vc2005",
    "chars": 3672,
    "preview": "# usage:\n#  nmake            release build\n#  nmake debug=1    debug build\n#  nmake ddk=1      using DDK compiler\n#  nma"
  },
  {
    "path": "README.md",
    "chars": 2870,
    "preview": "MacType\n========================\n[日本語](./README_ja-JP.md)\n\nBetter font rendering for Windows.\n\nLatest build\n------------"
  },
  {
    "path": "README_ja-JP.md",
    "chars": 1982,
    "preview": "MacType\n========================\n\nWindows のフォントレンダリングを改善。\n\n最新ビルド\n------------------\n\n[ダウンロード](https://github.com/snowie2"
  },
  {
    "path": "VersionHelper.cpp",
    "chars": 10537,
    "preview": "#include \"VersionHelper.h\"\r\n\r\n\r\n//////////////////////////////////////////////////////////////////////\r\n// Konstruktion/"
  },
  {
    "path": "VersionHelper.h",
    "chars": 909,
    "preview": "#pragma once\r\n#include <xstring>\r\n#include <windows.h>\r\n#include <algorithm>\r\n#include <cctype>\r\nusing namespace std;\r\n\r"
  },
  {
    "path": "array.h",
    "chars": 1027,
    "preview": "#pragma once\n\n#ifndef _INC_SHLWAPI\n#define NO_SHLWAPI_STRFCNS\n#define NO_SHLWAPI_PATH\n#define NO_SHLWAPI_REG\n#define NO_"
  },
  {
    "path": "build.vc2005.bat",
    "chars": 202,
    "preview": "@echo off\n\nsetlocal\n\nset INCLUDE=..\\..\\..\\freetype2\\include;%INCLUDE%\nset LIB=..\\..;%LIB%\n\n:go\nnmake -f Makefile.vc2005 "
  },
  {
    "path": "cache.cpp",
    "chars": 3462,
    "preview": "#include \"override.h\"\n\n//CreateDIB计数,将在绘制下列次数后更新DIB区\n#define BITMAP_REDUCE_COUNTER\t256//默认1024\n\n\nHDC CBitmapCache::Creat"
  },
  {
    "path": "cache.h",
    "chars": 2925,
    "preview": "#pragma once\n\ntemplate <int BUFSIZE, bool ignoreCase>\nclass StringHashT\n{\nprivate:\n\tDWORD\tm_dwHash;\n\tTCHAR\tm_szBuffer[BU"
  },
  {
    "path": "colorinvert.h",
    "chars": 1039,
    "preview": "#pragma once\r\n//formula: (x+482)^2+(y+481)^2=880^2\r\nunsigned char InvertTable[260] = { 255,255,254,253,253,252,251,251,2"
  },
  {
    "path": "common.cpp",
    "chars": 962,
    "preview": "#include \"common.h\"\r\n\r\nstd::wstring to_utf16le(const std::wstring& input) {\r\n\tstd::wstring utf16_string;\r\n\tint len = inp"
  },
  {
    "path": "common.h",
    "chars": 14125,
    "preview": "#pragma once\n\n#define _CRT_SECURE_NO_DEPRECATE 1\n#ifdef _WIN64\n#define _WIN32_WINNT _WIN32_WINNT_WIN10\n#define WINVER _W"
  },
  {
    "path": "crc32.h",
    "chars": 3571,
    "preview": "#pragma once\r\n#ifndef CRC32_H\r\n#define CRC32_H\r\n\r\nstatic unsigned int crc32_tab[] = {\r\n\t0x00000000, 0x77073096, 0xee0e61"
  },
  {
    "path": "detours.h",
    "chars": 37571,
    "preview": "/////////////////////////////////////////////////////////////////////////////\n//\n//  Core Detours Functionality (detours"
  },
  {
    "path": "directwrite.cpp",
    "chars": 56477,
    "preview": "#include \"directwrite.h\"\r\n#include \"settings.h\"\r\n#include \"dynCodeHelper.h\"\r\n\r\nvoid MyDebug(const TCHAR * sz, ...)\r\n{\r\n#"
  },
  {
    "path": "directwrite.h",
    "chars": 1084,
    "preview": "#include \"common.h\"\r\n#include <VersionHelpers.h>\r\n\r\n#pragma once\r\n\r\n#ifdef EASYHOOK\r\n\r\n#include \"easyhook.h\"\r\n#define HO"
  },
  {
    "path": "dll.cpp",
    "chars": 11384,
    "preview": "#include \"dll.h\"\n\nCMemLoadDll::CMemLoadDll():m_bInitDllMain(true)\n{\n isLoadOk = FALSE;\n pImageBase = NULL;\n pDllMain = N"
  },
  {
    "path": "dll.h",
    "chars": 845,
    "preview": "#include <windows.h>\n\ntypedef   BOOL (__stdcall *ProcDllMain)(HINSTANCE, DWORD,  LPVOID );\n\nclass CMemLoadDll\n{\npublic:\n"
  },
  {
    "path": "doc/HOWTOBUILD.md",
    "chars": 3363,
    "preview": "# How to build\r\n\r\n 1. **Compiler / IDE**\r\n\r\n    Visual Studio 2019 with v142 toolkit has been tested and is working. Too"
  },
  {
    "path": "doc/glyph_to_bitmapex.diff",
    "chars": 3132,
    "preview": "--- a/src/base/ftglyph.c\n+++ b/src/base/ftglyph.c\n@@ -634,6 +634,118 @@\n   }\n \n \n+FT_EXPORT_DEF(FT_Error)\n+\tFT_Glyph_To_"
  },
  {
    "path": "dynCodeHelper.cpp",
    "chars": 3408,
    "preview": "#include \"dynCodeHelper.h\"\r\n\r\n/*\r\n* class AutoEnableDynamicCodeGen\r\n*/\r\n\r\ntypedef\r\nBOOL\r\n(WINAPI *PGET_PROCESS_MITIGATIO"
  },
  {
    "path": "dynCodeHelper.h",
    "chars": 1001,
    "preview": "#include \"common.h\"\r\n\r\nclass AutoEnableDynamicCodeGen\r\n{\r\npublic:\r\n\tAutoEnableDynamicCodeGen(bool enable = true);\r\n\t~Aut"
  },
  {
    "path": "easyhook.h",
    "chars": 12326,
    "preview": "/*\n    EasyHook - The reinvention of Windows API hooking\n \n    Copyright (C) 2009 Christoph Husse\n\n    This library is f"
  },
  {
    "path": "expfunc.cpp",
    "chars": 48756,
    "preview": "#ifndef _GDIPP_EXE\r\n#include \"settings.h\"\r\n#include \"override.h\"\r\n#include <tlhelp32.h>\r\n#include <shlwapi.h>\t//DLLVERSI"
  },
  {
    "path": "expfunc.def",
    "chars": 265,
    "preview": ";LIBRARY MacType.dll\nEXPORTS\n\tGetMsgProc @1\n\tDllGetVersion = GdippDllGetVersion @2\n;\tSafeUnload @3\n\tCreateControlCenter "
  },
  {
    "path": "ft - non-ref.cpp",
    "chars": 85193,
    "preview": "/* 2006-10-23(by 555)\n * http://hp.vector.co.jp/authors/VA028002/winfreetype.c (higambana(菅野友紀))\n * を丸写し\n */\n/* 2006-10-"
  },
  {
    "path": "ft.cpp",
    "chars": 100380,
    "preview": "/* 2006-10-23(by 555)\r\n* http://hp.vector.co.jp/authors/VA028002/winfreetype.c (higambana(菅野友紀))\r\n* を丸写し\r\n*/\r\n/* 2006-10"
  },
  {
    "path": "ft.h",
    "chars": 10834,
    "preview": "#ifndef FT_H\n#define FT_H\n\n#define FTO_MONO\t\t0x0001\n#define FTO_SIZE_ONLY\t0x0002\n\n#define CACHE_SIZE 20\n#define MAX_CACH"
  },
  {
    "path": "ft2build.h",
    "chars": 2176,
    "preview": "/***************************************************************************/\n/*                                        "
  },
  {
    "path": "ft2vert.c",
    "chars": 16497,
    "preview": "/*\n * \"ft2vert.c\"\n * \n * Converter to vertical glyph ID by handling GSUB vrt2/vert feature\n * requires FreeType-2.1.10 o"
  },
  {
    "path": "ft2vert.h",
    "chars": 461,
    "preview": "\n#ifdef __cplusplus\nextern \"C\"{\n#endif\n\n/* store GSUB feature vert/vrt2 */\nstruct ft2vert_st *ft2vert_init(FT_Face face)"
  },
  {
    "path": "fteng.cpp",
    "chars": 27608,
    "preview": "#include \"override.h\"\n#include \"ft.h\"\n#include <windows.h>\n#include <tchar.h>\n#include \"fteng.h\"\n\n#ifdef _DLL\n#pragma co"
  },
  {
    "path": "fteng.h",
    "chars": 18932,
    "preview": "#pragma once\n\n#include <ft2build.h>\n#include <freetype/freetype.h>\t/* FT_FREETYPE_H */\n#include <freetype/ftcache.h>\t/* "
  },
  {
    "path": "ftref.c",
    "chars": 1183,
    "preview": "#include \"ftref.h\"\n\n#define InterlockedIncrementInt(x) InterlockedIncrement((volatile LONG *)&(x))\n#define InterlockedDe"
  },
  {
    "path": "ftref.h",
    "chars": 600,
    "preview": "#include <freetype/ftglyph.h>\n#include <Windows.h>\n\n#ifdef __cplusplus\nextern \"C\"{\n#endif\n\ntypedef struct  \n{\n\tFT_Glyph "
  },
  {
    "path": "gdiPlusFlat2.cpp",
    "chars": 1655,
    "preview": "#include \"gdiPlusFlat2.h\"\n#include <tchar.h>\n\n\nGdipDrawString pfnGdipDrawString = NULL;\nGdipGetBrushType pfnGdipGetBrush"
  },
  {
    "path": "gdiPlusFlat2.h",
    "chars": 2121,
    "preview": "#ifndef _GDIPLUSFLAT_H\n#define _GDIPLUSFLAT_H\n\n#include <Windows.h>\n#include \"GdiPlusTypes2.h\"\n#include <GdiPlusEnums.h>"
  },
  {
    "path": "gdidll.rc",
    "chars": 3008,
    "preview": "// Microsoft Visual C++ generated resource script.\r\n//\r\n#pragma code_page(65001)\r\n\r\n#include \"resource.\"\r\n\r\n#define APST"
  },
  {
    "path": "gdipp.icproj",
    "chars": 615,
    "preview": "<?xml version=\"1.0\" encoding=\"gb2312\"?>\n<VisualStudioProject\n\tProjectType=\"Intel C++ Project\"\n\tVersion=\"11.1\"\n\tName=\"Mac"
  },
  {
    "path": "gdipp.sln",
    "chars": 6253,
    "preview": "Microsoft Visual Studio Solution File, Format Version 12.00\r\n# Visual Studio Version 17\r\nVisualStudioVersion = 17.4.3310"
  },
  {
    "path": "gdipp.vcxproj",
    "chars": 49678,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project DefaultTargets=\"Build\" ToolsVersion=\"15.0\" xmlns=\"http://schemas.micros"
  },
  {
    "path": "gdipp.vcxproj.filters",
    "chars": 5598,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuil"
  },
  {
    "path": "hash_list.cpp",
    "chars": 825,
    "preview": "#include \"hash_list.h\"\n#include <cwctype>\n#include <algorithm>\n\nvoid CHashedStringList::Add(TCHAR * String, TCHAR * Valu"
  },
  {
    "path": "hash_list.h",
    "chars": 619,
    "preview": "//#include \"stdint.h\"\n#include \"malloc.h\"\n#include \"string.h\"\n#include \"windows.h\"\n#include <map>\n#include <string>\n\ntyp"
  },
  {
    "path": "hook.cpp",
    "chars": 18256,
    "preview": "// API hook\r\n//\r\n// GetProcAddressで得たcall先(関数本体)を直接書き換え、\r\n// 自分のフック関数にjmpさせる。\r\n//\r\n// 内部で元のAPIを使う時は、コードを一度戻してからcall。\r\n//"
  },
  {
    "path": "hookCounter.cpp",
    "chars": 81,
    "preview": "#include \"hookCounter.h\"\r\n#include <atomic>\r\n\r\nstd::atomic<int> HCounter::ref(0);"
  },
  {
    "path": "hookCounter.h",
    "chars": 389,
    "preview": "#pragma once\r\n#include <atomic>\r\n#include <thread>\r\n#include <chrono>\r\n\r\nclass HCounter {\r\n\tstatic std::atomic<int> ref;"
  },
  {
    "path": "hooklist.h",
    "chars": 17385,
    "preview": "HOOK_DEFINE(int, GetObjectW,  (__in HANDLE h, __in int c, __out_bcount_opt(c) LPVOID pv), (h, c, pv))\r\nHOOK_DEFINE(int, "
  },
  {
    "path": "ivs_otft.h",
    "chars": 14883,
    "preview": "OTFT_DEF_BEGIN(0) /* E0100 */\n\tOTFT_DEF(0x5026, 2) /* jp90 */\n\tOTFT_DEF(0x50C5, 2) /* jp90 */\n\tOTFT_DEF(0x5132, 2) /* jp"
  },
  {
    "path": "json.hpp",
    "chars": 804124,
    "preview": "/*\n    __ _____ _____ _____\n __|  |   __|     |   | |  JSON for Modern C++\n|  |  |__   |  |  | | | |  version 3.10.5\n|__"
  },
  {
    "path": "macloader.vcxproj",
    "chars": 7274,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/ms"
  },
  {
    "path": "makelib.cmd",
    "chars": 162,
    "preview": "@echo off\ncl /c /MD /GA /GF /Gy /O2 /arch:SSE optimize/memcpy__amd.cpp optimize/memcpy_amd.c\nlib /machine:ix86 /out:memc"
  },
  {
    "path": "misc.cpp",
    "chars": 7565,
    "preview": "#include \"common.h\"\n#include \"settings.h\"\nCRITICAL_SECTION CCriticalSectionLock::m_cs[20];\nOWNED_CRITIAL_SECTION COwnedC"
  },
  {
    "path": "optimize/UpgradeLog.XML",
    "chars": 2884,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><?xml-stylesheet type='text/xsl' href='_UpgradeReport_Files/UpgradeReport.xslt'?><"
  },
  {
    "path": "optimize/UpgradeLog2.XML",
    "chars": 2549,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><?xml-stylesheet type='text/xsl' href='_UpgradeReport_Files/UpgradeReport.xslt'?><"
  },
  {
    "path": "optimize/_UpgradeReport_Files/UpgradeReport.css",
    "chars": 3139,
    "preview": "BODY\n{\n\tBACKGROUND-COLOR: white;\n\tFONT-FAMILY: \"Verdana\", sans-serif;\n\tFONT-SIZE: 100%;\n\tMARGIN-LEFT: 0px;\n\tMARGIN-TOP:"
  },
  {
    "path": "optimize/_UpgradeReport_Files/UpgradeReport.xslt",
    "chars": 12157,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<xsl:stylesheet version=\"1.0\" xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\" xm"
  },
  {
    "path": "optimize/mem_amd.icproj",
    "chars": 3493,
    "preview": "<?xml version=\"1.0\" encoding=\"big5\"?>\n<VisualStudioProject \n\tProjectType=\"Intel C++ Project\"\n\tVersion=\"9.1\"\n\tName=\"mem_a"
  },
  {
    "path": "optimize/mem_amd.sln",
    "chars": 855,
    "preview": "Microsoft Visual Studio Solution File, Format Version 10.00\n# Visual Studio 2008\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C"
  },
  {
    "path": "optimize/mem_amd.sln_old",
    "chars": 951,
    "preview": "Microsoft Visual Studio Solution File, Format Version 8.00\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"mem_amd\""
  },
  {
    "path": "optimize/mem_amd.vcproj",
    "chars": 3866,
    "preview": "<?xml version=\"1.0\" encoding=\"big5\"?>\n<VisualStudioProject\n\tProjectType=\"Visual C++\"\n\tVersion=\"9.00\"\n\tName=\"mem_amd\"\n\tPr"
  },
  {
    "path": "optimize/memcpy__amd.cpp",
    "chars": 26445,
    "preview": "/******************************************************************************\n\n Copyright (c) 2001 Advanced Micro Devi"
  },
  {
    "path": "optimize/memcpy_amd.c",
    "chars": 26445,
    "preview": "/******************************************************************************\n\n Copyright (c) 2001 Advanced Micro Devi"
  },
  {
    "path": "optimize/memcpy_amd.h",
    "chars": 1888,
    "preview": "/******************************************************************************\n\n Copyright (c) 2001 Advanced Micro Devi"
  },
  {
    "path": "optimize/optimize.h",
    "chars": 303,
    "preview": "#include \"memcpy_amd.h\"\n#pragma comment (lib, \"optimize/release/mem_amd.lib\")\n\n#undef ZeroMemory\n#undef memzero\n#undef m"
  },
  {
    "path": "override.cpp",
    "chars": 59032,
    "preview": "// override.cpp - キレイなTextOut\r\n// 2006/09/27\r\n\r\n#include \"override.h\"\r\n#include \"ft.h\"\r\n#include \"fteng.h\"\r\n#include \"su"
  },
  {
    "path": "override.h",
    "chars": 2865,
    "preview": "\n#pragma once\n\n#include \"common.h\"\n#include \"tlsdata.h\"\n#include \"undocAPI.h\"\n#include \"gdiPlusFlat2.h\"\n\n#include \"cache"
  },
  {
    "path": "ownedcs.cpp",
    "chars": 1669,
    "preview": "#include \"ownedcs.h\"\n#include \"windows.h\"\n\n#define InterlockedIncrementInt(x) InterlockedIncrement((volatile LONG *)&(x)"
  },
  {
    "path": "ownedcs.h",
    "chars": 502,
    "preview": "#include <windows.h>\n\ntypedef struct _OWNED_CRITIAL_SECTION \n{\n\tint nOwner,\tnRequests,\tnRecursiveCount;\n\tHANDLE hEvent;\n"
  },
  {
    "path": "resource",
    "chars": 65067,
    "preview": "//{{NO_DEPENDENCIES}}\n// Microsoft Visual C++ generated include file.\n// Used by gdidll.rc\n//\n#define SW_HIDE           "
  },
  {
    "path": "resource.h",
    "chars": 65472,
    "preview": "//{{NO_DEPENDENCIES}}\n// Microsoft Visual C++ generated include file.\n// Used by gdidll.rc\n//\n#define SW_HIDE           "
  },
  {
    "path": "run.cpp",
    "chars": 7135,
    "preview": "// dll injection\n#define _CRT_SECURE_NO_DEPRECATE 1\n#define WINVER 0x500\n#define _WIN32_WINNT 0x500\n#define _WIN32_IE 0"
  },
  {
    "path": "settings.cpp",
    "chars": 55954,
    "preview": "#include \"settings.h\"\r\n#include \"strtoken.h\"\r\n#include <math.h>\t//pow\r\n#include \"supinfo.h\"\r\n#include \"fteng.h\"\r\n#includ"
  },
  {
    "path": "settings.h",
    "chars": 31721,
    "preview": "#pragma once\n\n#include \"common.h\"\n#include \"gdiPlusFlat2.h\"\n#include \"cache.h\"\n#include \"hash_list.h\"\n#include <VersionH"
  },
  {
    "path": "stdint.h",
    "chars": 4704,
    "preview": "/*  stdint.h\n\n    Integer types - c99 7.18\n*/\n\n/*\n *      C/C++ Run Time Library - Version 13.0\n *\n *      Copyright (c)"
  },
  {
    "path": "strtoken.h",
    "chars": 2085,
    "preview": "#pragma once\n\n//例\n// 'a,b,c,d'\t\t{ \"a\", \"b\", \"c\", \"d\" }\n// 'a,,b,c,'\t\t{ \"a\", \"\", \"b\", \"c\", \"\" }\n// '\"a,b\",c'\t\t{ \"\"a,b\"\", "
  },
  {
    "path": "supinfo.h",
    "chars": 9125,
    "preview": "#pragma once\n\n#include <mmsystem.h>\t//mmioFOURCC\n#define FOURCC_GDIPP\tmmioFOURCC('G', 'D', 'I', 'P')\n\ntypedef struct {\n\t"
  },
  {
    "path": "tlsdata.h",
    "chars": 1261,
    "preview": "#pragma once\n\ntemplate <class T>\nclass CTlsData\n{\nprivate:\n\tDWORD tlsindex;\n\tCPtrArray<T>* pArray;\n\tenum { INVALID_TLS_V"
  },
  {
    "path": "undocAPI.h",
    "chars": 4526,
    "preview": "#pragma once\r\n\r\ntypedef struct _UNICODE_STRING2 {\r\n\tUSHORT Length;\r\n\tUSHORT MaximumLength;\r\n\tPWSTR  Buffer;\r\n} UNICODE_S"
  },
  {
    "path": "wow64ext.h",
    "chars": 9860,
    "preview": "/**\r\n *\r\n * WOW64Ext Library\r\n *\r\n * Copyright (c) 2014 ReWolf\r\n * http://blog.rewolf.pl/\r\n *\r\n * This program is free s"
  },
  {
    "path": "wow64layer.h",
    "chars": 5303,
    "preview": "/*\n#ifndef CONTEXT_i386\n#define CONTEXT_i386    0x00010000    // this assumes that i386 and\n#define CONTEXT_i486    0x00"
  }
]

// ... and 1 more files (download for full content)

About this extraction

This page contains the full source code of the snowie2000/mactype GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 88 files (1.8 MB), approximately 542.3k tokens, and a symbol index with 1527 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!