当前位置: 首页>>代码示例>>C++>>正文


C++ DbgHelp::IsLockedByCurrentThread方法代码示例

本文整理汇总了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;
}
开发者ID:ioannis-e,项目名称:vld,代码行数:18,代码来源:vld_hooks.cpp

示例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;
}
开发者ID:ioannis-e,项目名称:vld,代码行数:18,代码来源:vld_hooks.cpp

示例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;
}
开发者ID:ioannis-e,项目名称:vld,代码行数:20,代码来源:vld_hooks.cpp


注:本文中的DbgHelp::IsLockedByCurrentThread方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。