diff options
Diffstat (limited to 'Private/Source/ThreadLocalStorage.cxx')
| -rw-r--r-- | Private/Source/ThreadLocalStorage.cxx | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/Private/Source/ThreadLocalStorage.cxx b/Private/Source/ThreadLocalStorage.cxx index 5d231f61..bcafdd10 100644 --- a/Private/Source/ThreadLocalStorage.cxx +++ b/Private/Source/ThreadLocalStorage.cxx @@ -12,15 +12,28 @@ using namespace hCore; +/** + * Check for cookie inside TIB. + * @param ptr + * @return if the cookie is enabled. + */ Boolean hcore_tls_check(VoidPtr ptr) { if (!ptr) return false; - const char *_ptr = (const char *)ptr; - return _ptr[0] == kRTLMag0 && _ptr[1] == kRTLMag1 && _ptr[2] == kRTLMag2; + const char* _ptr = (const char*)ptr; + + kcout << "TLS: Check for cookie...\n"; + + return _ptr[0] == kCookieMag0 && _ptr[1] == kCookieMag1 && _ptr[2] == kCookieMag2; } +/** + * System call implementation in hCore + * @param ptr + * @return + */ Void hcore_tls_check_syscall_impl(ThreadInformationBlock ptr) noexcept { if (!hcore_tls_check(ptr.Cookie)) |
