diff options
Diffstat (limited to 'Private/Source')
| -rw-r--r-- | Private/Source/ProcessTeam.cxx | 2 | ||||
| -rw-r--r-- | Private/Source/ThreadLocalStorage.cxx | 15 |
2 files changed, 9 insertions, 8 deletions
diff --git a/Private/Source/ProcessTeam.cxx b/Private/Source/ProcessTeam.cxx index 569d417d..9e16c0cd 100644 --- a/Private/Source/ProcessTeam.cxx +++ b/Private/Source/ProcessTeam.cxx @@ -9,7 +9,7 @@ /// @brief Process Team API. /***********************************************************************************/ -#include <KernelKit/ProcessTeam.hpp> +#include <KernelKit/ProcessScheduler.hpp> namespace HCore { MutableArray<Ref<Process>>& ProcessTeam::AsArray() { return mProcessList; } diff --git a/Private/Source/ThreadLocalStorage.cxx b/Private/Source/ThreadLocalStorage.cxx index 8fd61d5e..30a241ea 100644 --- a/Private/Source/ThreadLocalStorage.cxx +++ b/Private/Source/ThreadLocalStorage.cxx @@ -25,26 +25,27 @@ using namespace HCore; * @return if the cookie is enabled. */ -Boolean tls_check_tib(VoidPtr ptr) { - if (!ptr) return false; +Boolean tls_check_tib(ThreadInformationBlock* tib) { + if (!tib) return false; - const char* _ptr = (const char*)ptr; + HCore::Encoder encoder; + const char* tibAsBytes = encoder.AsBytes(tib); kcout << "HCoreKrnl\\TLS: Checking for a valid cookie...\n"; - return _ptr[0] == kCookieMag0 && _ptr[1] == kCookieMag1 && - _ptr[2] == kCookieMag2; + return tibAsBytes[0] == kCookieMag0 && tibAsBytes[1] == kCookieMag1 && + tibAsBytes[2] == kCookieMag2; } /** - * System call implementation in HCore + * System call implementation of the TLS check. * @param ptr * @return */ EXTERN_C Void tls_check_syscall_impl(HCore::HAL::StackFramePtr stackPtr) noexcept { ThreadInformationBlock* tib = (ThreadInformationBlock*)stackPtr->Gs; - if (!tls_check_tib(tib->Cookie)) { + if (!tls_check_tib(tib)) { kcout << "HCoreKrnl\\TLS: Verification failed, Crashing...\n"; ProcessManager::Shared().Leak().GetCurrent().Leak().Crash(); } |
