@@ -861,8 +861,8 @@ BOOLEAN PhSipGetCpuFrequencyFromDistribution(
861
861
862
862
for (i = 0 ; i < NumberOfProcessors ; i ++ )
863
863
{
864
- stateDistribution = (PSYSTEM_PROCESSOR_PERFORMANCE_STATE_DISTRIBUTION )(( PCHAR ) CurrentPerformanceDistribution + CurrentPerformanceDistribution -> Offsets [i ]);
865
- stateDifference = (PSYSTEM_PROCESSOR_PERFORMANCE_STATE_DISTRIBUTION )(( PCHAR ) differences + stateSize * i );
864
+ stateDistribution = (PSYSTEM_PROCESSOR_PERFORMANCE_STATE_DISTRIBUTION )PTR_ADD_OFFSET ( CurrentPerformanceDistribution , CurrentPerformanceDistribution -> Offsets [i ]);
865
+ stateDifference = (PSYSTEM_PROCESSOR_PERFORMANCE_STATE_DISTRIBUTION )PTR_ADD_OFFSET ( differences , stateSize * i );
866
866
867
867
if (stateDistribution -> StateCount != 2 )
868
868
{
@@ -878,17 +878,17 @@ BOOLEAN PhSipGetCpuFrequencyFromDistribution(
878
878
}
879
879
else
880
880
{
881
- hitcountOld = (PSYSTEM_PROCESSOR_PERFORMANCE_HITCOUNT_WIN8 )(( PCHAR ) stateDistribution -> States + sizeof (SYSTEM_PROCESSOR_PERFORMANCE_HITCOUNT_WIN8 ) * j );
882
- stateDifference -> States [j ].Hits . QuadPart = hitcountOld -> Hits ;
881
+ hitcountOld = (PSYSTEM_PROCESSOR_PERFORMANCE_HITCOUNT_WIN8 )PTR_ADD_OFFSET ( stateDistribution -> States , sizeof (SYSTEM_PROCESSOR_PERFORMANCE_HITCOUNT_WIN8 ) * j );
882
+ stateDifference -> States [j ].Hits = hitcountOld -> Hits ;
883
883
stateDifference -> States [j ].PercentFrequency = hitcountOld -> PercentFrequency ;
884
884
}
885
885
}
886
886
}
887
887
888
888
for (i = 0 ; i < NumberOfProcessors ; i ++ )
889
889
{
890
- stateDistribution = (PSYSTEM_PROCESSOR_PERFORMANCE_STATE_DISTRIBUTION )(( PCHAR ) PreviousPerformanceDistribution + PreviousPerformanceDistribution -> Offsets [i ]);
891
- stateDifference = (PSYSTEM_PROCESSOR_PERFORMANCE_STATE_DISTRIBUTION )(( PCHAR ) differences + stateSize * i );
890
+ stateDistribution = (PSYSTEM_PROCESSOR_PERFORMANCE_STATE_DISTRIBUTION )PTR_ADD_OFFSET ( PreviousPerformanceDistribution , PreviousPerformanceDistribution -> Offsets [i ]);
891
+ stateDifference = (PSYSTEM_PROCESSOR_PERFORMANCE_STATE_DISTRIBUTION )PTR_ADD_OFFSET ( differences , stateSize * i );
892
892
893
893
if (stateDistribution -> StateCount != 2 )
894
894
{
@@ -900,12 +900,12 @@ BOOLEAN PhSipGetCpuFrequencyFromDistribution(
900
900
{
901
901
if (WindowsVersion >= WINDOWS_8_1 )
902
902
{
903
- stateDifference -> States [j ].Hits . QuadPart -= stateDistribution -> States [j ].Hits . QuadPart ;
903
+ stateDifference -> States [j ].Hits -= stateDistribution -> States [j ].Hits ;
904
904
}
905
905
else
906
906
{
907
- hitcountOld = (PSYSTEM_PROCESSOR_PERFORMANCE_HITCOUNT_WIN8 )(( PCHAR ) stateDistribution -> States + sizeof (SYSTEM_PROCESSOR_PERFORMANCE_HITCOUNT_WIN8 ) * j );
908
- stateDifference -> States [j ].Hits . QuadPart -= hitcountOld -> Hits ;
907
+ hitcountOld = (PSYSTEM_PROCESSOR_PERFORMANCE_HITCOUNT_WIN8 )PTR_ADD_OFFSET ( stateDistribution -> States , sizeof (SYSTEM_PROCESSOR_PERFORMANCE_HITCOUNT_WIN8 ) * j );
908
+ stateDifference -> States [j ].Hits -= hitcountOld -> Hits ;
909
909
}
910
910
}
911
911
}
@@ -917,12 +917,12 @@ BOOLEAN PhSipGetCpuFrequencyFromDistribution(
917
917
918
918
for (i = 0 ; i < NumberOfProcessors ; i ++ )
919
919
{
920
- stateDifference = (PSYSTEM_PROCESSOR_PERFORMANCE_STATE_DISTRIBUTION )(( PCHAR ) differences + stateSize * i );
920
+ stateDifference = (PSYSTEM_PROCESSOR_PERFORMANCE_STATE_DISTRIBUTION )PTR_ADD_OFFSET ( differences , stateSize * i );
921
921
922
922
for (j = 0 ; j < 2 ; j ++ )
923
923
{
924
- count += ( ULONGLONG ) stateDifference -> States [j ].Hits . QuadPart ;
925
- total += ( ULONGLONG ) stateDifference -> States [j ].Hits . QuadPart * stateDifference -> States [j ].PercentFrequency ;
924
+ count += stateDifference -> States [j ].Hits ;
925
+ total += stateDifference -> States [j ].Hits * stateDifference -> States [j ].PercentFrequency ;
926
926
}
927
927
}
928
928
0 commit comments