Skip to content

Commit

Permalink
Fix thread affinity
Browse files Browse the repository at this point in the history
Signed-off-by: Alan Jowett <[email protected]>
  • Loading branch information
Alan-Jowett committed Dec 17, 2024
1 parent 43b9bd2 commit 25a2d9c
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/ke.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,12 @@ KeSetSystemGroupAffinityThread(_In_ const PGROUP_AFFINITY Affinity, _Out_opt_ PG
void
KeRevertToUserGroupAffinityThread(PGROUP_AFFINITY PreviousAffinity)
{
(void)usersim_set_current_thread_affinity(PreviousAffinity, nullptr);
bool result = usersim_set_current_thread_affinity(PreviousAffinity, nullptr);
#if defined(NDEBUG)
UNREFERENCED_PARAMETER(result);
#else
assert(result);
#endif
}

PKTHREAD
Expand Down Expand Up @@ -654,10 +659,10 @@ class _usersim_emulated_dpc

l.unlock();
_usersim_dispatch_locks[i].lock();
//_usersim_current_irql = DISPATCH_LEVEL;
_usersim_current_irql = DISPATCH_LEVEL;
work_item->work_item_routine(work_item, context, parameter_1, parameter_2);
_usersim_dispatch_locks[i].unlock();
//_usersim_current_irql = PASSIVE_LEVEL;
_usersim_current_irql = PASSIVE_LEVEL;
l.lock();
}
}
Expand Down

0 comments on commit 25a2d9c

Please sign in to comment.