MCPcopy Create free account
hub / github.com/acl-dev/acl / DetourTransactionBegin

Function DetourTransactionBegin

lib_fiber/cpp/src/detours/detours.cpp:1587–1609  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1585}
1586
1587LONG WINAPI DetourTransactionBegin()
1588{
1589 // Only one transaction is allowed at a time.
1590_Benign_race_begin_
1591 if (s_nPendingThreadId != 0) {
1592 return ERROR_INVALID_OPERATION;
1593 }
1594_Benign_race_end_
1595
1596 // Make sure only one thread can start a transaction.
1597 if (InterlockedCompareExchange(&s_nPendingThreadId, (LONG)GetCurrentThreadId(), 0) != 0) {
1598 return ERROR_INVALID_OPERATION;
1599 }
1600
1601 s_pPendingOperations = NULL;
1602 s_pPendingThreads = NULL;
1603 s_ppPendingError = NULL;
1604
1605 // Make sure the trampoline pages are writable.
1606 s_nPendingError = detour_writable_trampoline_regions();
1607
1608 return s_nPendingError;
1609}
1610
1611LONG WINAPI DetourTransactionAbort()
1612{

Callers 1

winapi_hook_onceFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…