You do not need a 64-bit processor to do arithmetic for a 64-bit data type. All 32-bit compilers that I know about support arithmetic for 64-bit integers. If the hardware does not allow you to use your own arithmetic, then the compiler must generate code to perform arithmetic. Usually this will use helper functions in the RTL compiler.
The structure is intended for use by compilers that do not provide native support for 64-bit data types. The documentation you refer to itself makes this clear:
Note Your C compiler may support 64-bit integers natively. For example, Microsoft Visual C ++ supports the integer type __ int64 . For more information, see the documentation that came with your C compiler.
Compilers that do not support native 64-bit integers cannot process a QUADPART member as an integer.
typedef union _ULARGE_INTEGER { struct { DWORD LowPart; DWORD HighPart; }; struct { DWORD LowPart; DWORD HighPart; } u; ULONGLONG QuadPart; } ULARGE_INTEGER, *PULARGE_INTEGER;
And the definition of ULONGLONG :
#if !defined(_M_IX86) typedef unsigned __int64 ULONGLONG; #else typedef double ULONGLONG; #endif
Of course, all compilers written in the last 10 years (or more) will have built-in support for 64-bit integers. But this union was originally introduced a very long time ago, and then the landscape of the compiler would be different. When viewing Windows header files, always remember the history and legacy.
source share