XThread Get/Set Last Error

This commit is contained in:
Dr. Chat 2015-09-25 18:22:13 -05:00
parent ee92f75a84
commit 3cbc65ac29
2 changed files with 13 additions and 0 deletions

View File

@ -107,6 +107,16 @@ uint32_t XThread::GetCurrentThreadId() {
return thread->guest_object<X_KTHREAD>()->thread_id;
}
uint32_t XThread::GetLastError() {
XThread* thread = XThread::GetCurrentThread();
return thread->last_error();
}
void XThread::SetLastError(uint32_t error_code) {
XThread* thread = XThread::GetCurrentThread();
thread->set_last_error(error_code);
}
uint32_t XThread::last_error() { return guest_object<X_KTHREAD>()->last_error; }
void XThread::set_last_error(uint32_t error_code) {

View File

@ -122,6 +122,9 @@ class XThread : public XObject {
static uint32_t GetCurrentThreadHandle();
static uint32_t GetCurrentThreadId();
static uint32_t GetLastError();
static void SetLastError(uint32_t error_code);
const CreationParams* creation_params() const { return &creation_params_; }
uint32_t tls_ptr() const { return tls_address_; }
uint32_t pcr_ptr() const { return pcr_address_; }