NtSuspendThread.

This commit is contained in:
Ben Vanik
2014-01-06 23:23:27 -08:00
parent 8033c73f41
commit 469ea9451d
4 changed files with 55 additions and 0 deletions

View File

@@ -353,6 +353,18 @@ X_STATUS XThread::Resume(uint32_t* out_suspend_count) {
}
}
X_STATUS XThread::Suspend(uint32_t* out_suspend_count) {
DWORD result = SuspendThread(thread_handle_);
if (result >= 0) {
if (out_suspend_count) {
*out_suspend_count = result;
}
return X_STATUS_SUCCESS;
} else {
return X_STATUS_UNSUCCESSFUL;
}
}
X_STATUS XThread::Delay(
uint32_t processor_mode, uint32_t alertable, uint64_t interval) {
int64_t timeout_ticks = interval;

View File

@@ -58,6 +58,7 @@ public:
void LowerIrql(uint32_t new_irql);
X_STATUS Resume(uint32_t* out_suspend_count);
X_STATUS Suspend(uint32_t* out_suspend_count);
X_STATUS Delay(
uint32_t processor_mode, uint32_t alertable, uint64_t interval);