mirror of
https://github.com/momo5502/emulator.git
synced 2026-01-18 11:13:57 +00:00
Extend APC test
This commit is contained in:
@@ -434,22 +434,24 @@ namespace
|
||||
|
||||
bool test_apc()
|
||||
{
|
||||
bool executed = false;
|
||||
QueueUserAPC(
|
||||
+[](ULONG_PTR param) {
|
||||
*reinterpret_cast<bool*>(param) = true; //
|
||||
},
|
||||
GetCurrentThread(), reinterpret_cast<ULONG_PTR>(&executed));
|
||||
int executions = 0;
|
||||
|
||||
auto* apc_func = +[](ULONG_PTR param) {
|
||||
*reinterpret_cast<int*>(param) += 1; //
|
||||
};
|
||||
|
||||
QueueUserAPC(apc_func, GetCurrentThread(), reinterpret_cast<ULONG_PTR>(&executions));
|
||||
QueueUserAPC(apc_func, GetCurrentThread(), reinterpret_cast<ULONG_PTR>(&executions));
|
||||
|
||||
Sleep(1);
|
||||
|
||||
if (executed)
|
||||
if (executions != 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
SleepEx(1, TRUE);
|
||||
return executed;
|
||||
return executions == 2;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user