本文整理汇总了C++中DbgHelp::IsLockedByCurrentThread方法的典型用法代码示例。如果您正苦于以下问题:C++ DbgHelp::IsLockedByCurrentThread方法的具体用法?C++ DbgHelp::IsLockedByCurrentThread怎么用?C++ DbgHelp::IsLockedByCurrentThread使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DbgHelp
的用法示例。
在下文中一共展示了DbgHelp::IsLockedByCurrentThread方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _HeapReAlloc
// for kernel32.dll
LPVOID VisualLeakDetector::_HeapReAlloc (HANDLE heap, DWORD flags, LPVOID mem, SIZE_T size)
{
PRINT_HOOKED_FUNCTION();
// Reallocate the block.
LPVOID newmem = HeapReAlloc(heap, flags, mem, size);
if ((newmem == NULL) || !g_vld.enabled())
return newmem;
if (!g_DbgHelp.IsLockedByCurrentThread()) { // skip dbghelp.dll calls
CAPTURE_CONTEXT();
CaptureContext cc(HeapReAlloc, size, context_);
cc.Set(heap, mem, newmem, size);
}
return newmem;
}
示例2: _HeapAlloc
// HeapAlloc (kernel32.dll) call RtlAllocateHeap (ntdll.dll)
LPVOID VisualLeakDetector::_HeapAlloc (HANDLE heap, DWORD flags, SIZE_T size)
{
PRINT_HOOKED_FUNCTION2();
// Allocate the block.
LPVOID block = HeapAlloc(heap, flags, size);
if ((block == NULL) || !g_vld.enabled())
return block;
if (!g_DbgHelp.IsLockedByCurrentThread()) { // skip dbghelp.dll calls
CAPTURE_CONTEXT();
CaptureContext cc(HeapAlloc, size, context_);
cc.Set(heap, block, NULL, size);
}
return block;
}
示例3: _HeapFree
// HeapFree (kernel32.dll) call RtlFreeHeap (ntdll.dll)
BOOL VisualLeakDetector::_HeapFree (HANDLE heap, DWORD flags, LPVOID mem)
{
PRINT_HOOKED_FUNCTION2();
BOOL status;
if (!g_DbgHelp.IsLockedByCurrentThread()) // skip dbghelp.dll calls
{
// Record the current frame pointer.
CAPTURE_CONTEXT();
context_.func = reinterpret_cast<UINT_PTR>(m_HeapFree);
// Unmap the block from the specified heap.
g_vld.unmapBlock(heap, mem, context_);
}
status = m_HeapFree(heap, flags, mem);
return status;
}