XThread Get/Set Last Error
This commit is contained in:
parent
ee92f75a84
commit
3cbc65ac29
|
@ -107,6 +107,16 @@ uint32_t XThread::GetCurrentThreadId() {
|
||||||
return thread->guest_object<X_KTHREAD>()->thread_id;
|
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; }
|
uint32_t XThread::last_error() { return guest_object<X_KTHREAD>()->last_error; }
|
||||||
|
|
||||||
void XThread::set_last_error(uint32_t error_code) {
|
void XThread::set_last_error(uint32_t error_code) {
|
||||||
|
|
|
@ -122,6 +122,9 @@ class XThread : public XObject {
|
||||||
static uint32_t GetCurrentThreadHandle();
|
static uint32_t GetCurrentThreadHandle();
|
||||||
static uint32_t GetCurrentThreadId();
|
static uint32_t GetCurrentThreadId();
|
||||||
|
|
||||||
|
static uint32_t GetLastError();
|
||||||
|
static void SetLastError(uint32_t error_code);
|
||||||
|
|
||||||
const CreationParams* creation_params() const { return &creation_params_; }
|
const CreationParams* creation_params() const { return &creation_params_; }
|
||||||
uint32_t tls_ptr() const { return tls_address_; }
|
uint32_t tls_ptr() const { return tls_address_; }
|
||||||
uint32_t pcr_ptr() const { return pcr_address_; }
|
uint32_t pcr_ptr() const { return pcr_address_; }
|
||||||
|
|
Loading…
Reference in New Issue