-
-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- New constructors for `KUnicodeString` - Better logging & overall logging structure - Fixed a weird bug causing an endless loop when generic callback interceptor is called - Only log kernel stuff at passive & apc (because of Rtl* functions dependencies) - Add a `critical` level of logging
- Loading branch information
Showing
26 changed files
with
2,744 additions
and
2,553 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,134 +1,108 @@ | ||
#pragma once | ||
|
||
#include <wil/resource.h> | ||
|
||
#include "Error.hpp" | ||
#include "States.hpp" | ||
|
||
#define xerr(fmt, ...) \ | ||
{ \ | ||
warn("[%s] " fmt, Name().c_str(), __VA_ARGS__); \ | ||
} | ||
|
||
#define xwarn(fmt, ...) \ | ||
{ \ | ||
warn("[%s] " fmt, Name().c_str(), __VA_ARGS__); \ | ||
} | ||
|
||
#define xok(fmt, ...) \ | ||
{ \ | ||
ok("[%s] " fmt, Name().c_str(), __VA_ARGS__); \ | ||
} | ||
|
||
#define xinfo(fmt, ...) \ | ||
{ \ | ||
info("[%s] " fmt, Name().c_str(), __VA_ARGS__); \ | ||
} | ||
|
||
#define xdbg(fmt, ...) \ | ||
{ \ | ||
dbg("[%s] " fmt, Name().c_str(), __VA_ARGS__); \ | ||
} | ||
|
||
|
||
namespace CFB::Broker | ||
{ | ||
class ManagerBase | ||
{ | ||
public: | ||
/// | ||
/// @brief Construct a new Manager Base object | ||
/// | ||
/// | ||
ManagerBase(); | ||
|
||
/// | ||
/// @brief Destroy the Manager Base object | ||
/// | ||
/// | ||
~ManagerBase(); | ||
|
||
/// | ||
/// @brief Synchronizes on the Global state semaphore to execute code only when in a specific state | ||
/// | ||
/// @param NewState | ||
/// @return true | ||
/// @return false | ||
/// | ||
bool | ||
WaitForState(CFB::Broker::State WantedState); | ||
|
||
/// | ||
/// @brief Simple wrapper of `Globals.NotifyNewState` | ||
/// | ||
/// @param NewState | ||
/// @return true | ||
/// @return false | ||
/// | ||
bool | ||
SetState(CFB::Broker::State NewState); | ||
|
||
/// | ||
/// @brief | ||
/// | ||
/// @return true | ||
/// @return false | ||
/// | ||
bool | ||
NotifyStateChange(); | ||
|
||
/// | ||
/// @brief | ||
/// | ||
/// @return true | ||
/// @return false | ||
/// | ||
bool | ||
NotifyTermination(); | ||
|
||
/// | ||
/// @brief | ||
/// | ||
/// | ||
virtual Result<bool> | ||
Setup() = 0; | ||
|
||
|
||
/// | ||
/// @brief | ||
/// | ||
/// | ||
virtual void | ||
Run() = 0; | ||
|
||
/// | ||
/// @brief | ||
/// | ||
/// @return std::string const& | ||
/// | ||
virtual std::string const | ||
Name() = 0; | ||
|
||
|
||
protected: | ||
/// | ||
/// @brief | ||
/// | ||
/// | ||
wil::unique_handle m_hChangedStateEvent; | ||
|
||
/// | ||
/// @brief | ||
/// | ||
/// | ||
wil::unique_handle m_hTerminationEvent; | ||
|
||
/// | ||
/// @brief | ||
/// | ||
/// | ||
bool m_bIsShuttingDown; | ||
}; | ||
|
||
|
||
} // namespace CFB::Broker | ||
#pragma once | ||
|
||
#include <wil/resource.h> | ||
|
||
#include "Error.hpp" | ||
#include "States.hpp" | ||
|
||
namespace CFB::Broker | ||
{ | ||
class ManagerBase | ||
{ | ||
public: | ||
/// | ||
/// @brief Construct a new Manager Base object | ||
/// | ||
/// | ||
ManagerBase(); | ||
|
||
/// | ||
/// @brief Destroy the Manager Base object | ||
/// | ||
/// | ||
~ManagerBase(); | ||
|
||
/// | ||
/// @brief Synchronizes on the Global state semaphore to execute code only when in a specific state | ||
/// | ||
/// @param NewState | ||
/// @return true | ||
/// @return false | ||
/// | ||
bool | ||
WaitForState(CFB::Broker::State WantedState); | ||
|
||
/// | ||
/// @brief Simple wrapper of `Globals.NotifyNewState` | ||
/// | ||
/// @param NewState | ||
/// @return true | ||
/// @return false | ||
/// | ||
bool | ||
SetState(CFB::Broker::State NewState); | ||
|
||
/// | ||
/// @brief | ||
/// | ||
/// @return true | ||
/// @return false | ||
/// | ||
bool | ||
NotifyStateChange(); | ||
|
||
/// | ||
/// @brief | ||
/// | ||
/// @return true | ||
/// @return false | ||
/// | ||
bool | ||
NotifyTermination(); | ||
|
||
/// | ||
/// @brief | ||
/// | ||
/// | ||
virtual Result<bool> | ||
Setup() = 0; | ||
|
||
|
||
/// | ||
/// @brief | ||
/// | ||
/// | ||
virtual void | ||
Run() = 0; | ||
|
||
/// | ||
/// @brief | ||
/// | ||
/// @return std::string const& | ||
/// | ||
virtual std::string const | ||
Name() = 0; | ||
|
||
|
||
protected: | ||
/// | ||
/// @brief | ||
/// | ||
/// | ||
wil::unique_handle m_hChangedStateEvent; | ||
|
||
/// | ||
/// @brief | ||
/// | ||
/// | ||
wil::unique_handle m_hTerminationEvent; | ||
|
||
/// | ||
/// @brief | ||
/// | ||
/// | ||
bool m_bIsShuttingDown; | ||
}; | ||
|
||
|
||
} // namespace CFB::Broker |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.