You can simply directly use the Quadpart. Note that it is a 64 bit long integer. also known as long long and __int64 by the MS compiler and gcc. Since it is a plain old data type, the compilers support all arithmetics and bit-wise operations done with it.
The definition of LARGE INTEGER
typedef union _LARGE_INTEGER {
struct {
DWORD LowPart;
LONG HighPart;
};
struct {
DWORD LowPart;
LONG HighPart;
} u;
LONGLONG QuadPart; // <-- this is a 64 bit integer.
} LARGE_INTEGER, *PLARGE_INTEGER;
LARGE_INTEGER is a plain C union, and as such does not provide any constructors. You can, however use the C aggregate initializer to initialize it to zero.
LARGE_INTEGER li = {}; // initialize to zero.
Using QuadPart, you can manipulate a LARGE_INTEGER as you would any long long integer...
Incrementing:
li.QuadPart++;
adding:
__int128 i = 123456LL;
li.QuadPart += i;
etc...
li.QuadPart = 123456LL * 5;
IMPORTANT: MS uses the LARGE_INTEGER union for passing such long long values for both historical reasons and for forcing alignment of the long long. Some of the Windows API will crash if Quadpart is not aligned correctly. So simply casting an __int64* to LARGE_INTEGER* in calls to the Windows API is not good practice.
In 64-bit windows a 64 bit increment ie li.Quadpart++ is an atomic operation.