Skip to content

Commit

Permalink
callbacks fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ThirteenAG committed Jul 6, 2024
1 parent e04087e commit ce0f84a
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions includes/callbacks.h
Original file line number Diff line number Diff line change
Expand Up @@ -320,15 +320,11 @@ class CallbackHandler
static inline void WINAPI GetSystemTimeAsFileTimeHook(LPFILETIME lpSystemTimeAsFileTime)
{
auto& threadParams = GetCallbackParamsList();
auto it = std::remove_if(threadParams.begin(), threadParams.end(), [](auto& p)
{
return !p.pattern.has_value() || !p.pattern.value().clear().empty();
});

if (it != threadParams.end())
for (auto& it : threadParams)
{
it->fn();
threadParams.erase(it, threadParams.end());
if (!it.pattern.has_value() || !it.pattern.value().clear().empty())
it.fn();
}

shGetSystemTimeAsFileTime.stdcall<ReturnType<decltype(GetSystemTimeAsFileTime)>>(lpSystemTimeAsFileTime);
Expand Down

0 comments on commit ce0f84a

Please sign in to comment.