Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/submodules/external/FindWDK-6aaaaf4
Browse files Browse the repository at this point in the history
  • Loading branch information
Alan-Jowett authored Nov 2, 2024
2 parents 5ab7439 + 88a336d commit 8c5904c
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 3 deletions.
9 changes: 7 additions & 2 deletions inc/usersim/ke.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,13 @@ USERSIM_API
ULONG
KeQueryMaximumProcessorCountEx(_In_ USHORT group_number);

#define KeQueryActiveProcessorCount KeQueryMaximumProcessorCount
#define KeQueryActiveProcessorCountEx KeQueryMaximumProcessorCountEx
USERSIM_API
ULONG
KeQueryActiveProcessorCount();

USERSIM_API
ULONG
KeQueryActiveProcessorCountEx(_In_ USHORT group_number);

USERSIM_API
KAFFINITY
Expand Down
16 changes: 16 additions & 0 deletions src/ke.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,18 @@ KeQueryMaximumProcessorCount() { return GetMaximumProcessorCount(ALL_PROCESSOR_G
ULONG
KeQueryMaximumProcessorCountEx(_In_ USHORT group_number) { return GetMaximumProcessorCount(group_number); }

ULONG
KeQueryActiveProcessorCount()
{
return KeQueryMaximumProcessorCount();
}

ULONG
KeQueryActiveProcessorCountEx(_In_ USHORT group_number)
{
return KeQueryMaximumProcessorCountEx(group_number);
}

KAFFINITY
KeSetSystemAffinityThreadEx(KAFFINITY affinity)
{
Expand Down Expand Up @@ -312,7 +324,11 @@ void KeSetSystemGroupAffinityThread(
{
if (!SetThreadGroupAffinity(GetCurrentThread(), Affinity, PreviousAffinity)) {
DWORD error = GetLastError();
#if defined(NDEBUG)
UNREFERENCED_PARAMETER(error);
#else
assert(error == 0);
#endif
}
}

Expand Down

0 comments on commit 8c5904c

Please sign in to comment.