diff --git a/phlib/include/phsup.h b/phlib/include/phsup.h index 2d31ef398..6ef601e07 100644 --- a/phlib/include/phsup.h +++ b/phlib/include/phsup.h @@ -464,6 +464,21 @@ FORCEINLINE ULONG PhCountBits( return count; } +FORCEINLINE ULONG PhCountBitsUlongPtr( + _In_ ULONG_PTR Value + ) +{ + ULONG count = 0; + + while (Value) + { + count++; + Value &= Value - 1; + } + + return count; +} + FORCEINLINE ULONG64 PhRoundNumber( _In_ ULONG64 Value, _In_ ULONG64 Granularity