From e693a9b76740da0e19b35398e615c7340f44ffb8 Mon Sep 17 00:00:00 2001 From: Thomas Faber Date: Sat, 29 Aug 2015 14:30:29 +0000 Subject: [PATCH] [NTOS:KE] - Fix swapped parameters of KeSetIntervalProfile - Calculate the correct bucket pointer in KiParseProfileList, and actually increment the counter CORE-10066 svn path=/trunk/; revision=68859 --- reactos/ntoskrnl/include/internal/ke.h | 4 ++-- reactos/ntoskrnl/ke/profobj.c | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/reactos/ntoskrnl/include/internal/ke.h b/reactos/ntoskrnl/include/internal/ke.h index 4475c1ce1bf..6d4590a268e 100644 --- a/reactos/ntoskrnl/include/internal/ke.h +++ b/reactos/ntoskrnl/include/internal/ke.h @@ -399,8 +399,8 @@ KeQueryIntervalProfile(KPROFILE_SOURCE ProfileSource); VOID NTAPI KeSetIntervalProfile( - KPROFILE_SOURCE ProfileSource, - ULONG Interval + ULONG Interval, + KPROFILE_SOURCE ProfileSource ); VOID diff --git a/reactos/ntoskrnl/ke/profobj.c b/reactos/ntoskrnl/ke/profobj.c index d137e12836d..6be1deedb60 100644 --- a/reactos/ntoskrnl/ke/profobj.c +++ b/reactos/ntoskrnl/ke/profobj.c @@ -261,8 +261,8 @@ KeQueryIntervalProfile(IN KPROFILE_SOURCE ProfileSource) VOID NTAPI -KeSetIntervalProfile(IN KPROFILE_SOURCE ProfileSource, - IN ULONG Interval) +KeSetIntervalProfile(IN ULONG Interval, + IN KPROFILE_SOURCE ProfileSource) { HAL_PROFILE_SOURCE_INTERVAL ProfileSourceInterval; @@ -330,12 +330,12 @@ KiParseProfileList(IN PKTRAP_FRAME TrapFrame, } /* Get the Pointer to the Bucket Value representing this Program Counter */ - BucketValue = (PULONG)((((ULONG_PTR)Profile->Buffer + - (ProgramCounter - (ULONG_PTR)Profile->RangeBase)) + BucketValue = (PULONG)((ULONG_PTR)Profile->Buffer + + ((ProgramCounter - (ULONG_PTR)Profile->RangeBase) >> Profile->BucketShift) &~ 0x3); /* Increment the value */ - ++BucketValue; + (*BucketValue)++; } }