【问题标题】:Invalid Address specified to RtlFreeHeap When use Smart Card to Sign (C++)使用智能卡签名时指定给 RtlFreeHeap 的地址无效(C++)
【发布时间】:2011-08-26 17:50:10
【问题描述】:
  • 我正在使用 C++ 和 Visual Studio 2010。

当我使用智能卡进行签名时出现:“当程序完成时。”

Windows has triggered a breakpoint in MyProgram.exe.

This may be due to a corruption of the heap, and indicates a bug in MyProgram.exe or any of the DLLs it has loaded.

The output window may have more diagnostic information

关于输出

HEAP[MyProgram.exe]: Invalid Address specified to RtlFreeHeap( 003C0000, 01BBFEA0 )
Windows has triggered a breakpoint in MyProgram.exe.

This may be due to a corruption of the heap, which indicates a bug in MyProgram.exe or any of the DLLs it has loaded.

This may also be due to the user pressing F12 while MyProgram.exe has focus.

The output window may have more diagnostic information.

MyProgram.exe 程序使用 dll “signer.dll”。

我尝试使用“无智能卡”进行签名。仅使用 Windows 证书。 OK 正常终止。
我尝试使用智能卡签名,出现一个要求输入 PIN 码的窗口。当程序结束时。错误 - 指定给 RtlFreeHeap 的地址无效。
我使用智能卡,当它要求输入 PIN 时,我标记为“NOT”。程序结束时。错误 - 指定给 RtlFreeHeap 的地址无效。

我注意到该错误仅在出现要求输入 PIN 的窗口出现时发生。

所以,我尝试使用 WinDbg,按照这篇文章:http://www.codeproject.com/KB/debug/windbg_quick_start.aspx

我在“CryptSignMessage”处设置断点出现:“When Use Smart Card”

(150c.17fc): C++ EH exception - code e06d7363 (first chance)
(150c.17fc): C++ EH exception - code e06d7363 (first chance)

不使用智能卡时不会发生这种情况。

我认为他试图获取密钥的上下文但不能并且“破坏记忆”。在“第一次机会”提示 PIN 的窗口之后。

这是问题吗? 在使用 CryptSignMessage 之前如何获取带有密钥上下文的证书?

我该如何解决?

没有智能卡我可以正常签名。 使用智能卡我可以正常签名,但程序完成后出现错误。

智能卡上的标志应该注意什么?

提前致谢

【问题讨论】:

    标签: c++ exception cryptography heap-corruption


    【解决方案1】:

    正如消息所述,这似乎是堆损坏。他们不太容易追踪。最好的办法是使用内存分析工具来帮助找到原因。

    【讨论】:

    • 感谢您的回复。我将阅读器的软件更改为较旧的软件,并且可以正常工作。我讨厌虫子。
    • 对不起,我的回答没有帮助。
    猜你喜欢
    • 1970-01-01
    • 2011-08-02
    • 2010-10-22
    • 1970-01-01
    • 2014-11-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-10-15
    相关资源
    最近更新 更多