|
HyperDbg Debugger
|
This is the implementation for custom spinlock. More...
#include "pch.h"Functions | |
| BOOLEAN | SpinlockTryLock (volatile LONG *Lock) |
| Tries to get the lock otherwise returns. | |
| VOID | SpinlockLock (volatile LONG *Lock) |
| Tries to get the lock and won't return until successfully get the lock. | |
| VOID | SpinlockInterlockedCompareExchange (LONG volatile *Destination, LONG Exchange, LONG Comperand) |
| Interlocked spinlock that tries to change the value and makes sure that it changed the target value. | |
| VOID | SpinlockLockWithCustomWait (volatile LONG *Lock, UINT32 MaximumWait) |
| Tries to get the lock and won't return until successfully get the lock. | |
| VOID | SpinlockUnlock (volatile LONG *Lock) |
| Release the lock. | |
| BOOLEAN | SpinlockCheckLock (volatile LONG *Lock) |
| Check the lock without changing the state. | |
This is the implementation for custom spinlock.
This implementation is derived from Hvpp by Petr Benes
Also, benefit of this implementation is that we can use it with STL lock guards, e.g.: std::lock_guard.
Look here for more information:
Check the lock without changing the state.
| Lock | Lock variable |
| VOID SpinlockInterlockedCompareExchange | ( | LONG volatile * | Destination, |
| LONG | Exchange, | ||
| LONG | Comperand ) |
Interlocked spinlock that tries to change the value and makes sure that it changed the target value.
| Destination | A pointer to the destination value |
| Exchange | The exchange value |
| Comperand | The value to compare to Destination |
| VOID SpinlockLock | ( | volatile LONG * | Lock | ) |
Tries to get the lock and won't return until successfully get the lock.
| Lock | Lock variable |
Tries to get the lock and won't return until successfully get the lock.
| Lock | Lock variable |
| MaximumWait | Maximum wait (pause) count |
Tries to get the lock otherwise returns.
| Lock | Lock variable |
| VOID SpinlockUnlock | ( | volatile LONG * | Lock | ) |
Release the lock.
| Lock | Lock variable |