使用智能卡签名(C++)时为RtlFreeHeap指定的地址无效
Invalid Address specified to RtlFreeHeap When use Smart Card to Sign (C++)
- 我使用的是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"出现:"当使用智能卡时">
(150c.17fc): C++ EH exception - code e06d7363 (first chance)
(150c.17fc): C++ EH exception - code e06d7363 (first chance)
当没有使用智能卡时,不会发生这种情况。
我认为他试图了解钥匙的上下文,但做不到,而且"破坏了记忆"。在"第一次机会"后提示PIN的窗口。
这是问题所在吗?如何在使用CryptSignMessage之前获取带有密钥上下文的证书?
我该如何修复?
没有智能卡,我可以正常签名。使用智能卡,我可以正常签名,但当程序完成时,出现错误。
智能卡上的标志应该注意什么?
提前感谢
正如消息所示,这似乎是堆损坏。他们不太容易找到。你最好的办法是使用内存分析工具来帮助找到原因。
相关文章:
- Openssl 1.1.1d无效使用不完整的类型"struct dsa_st"
- 无法访问嵌套类.类的使用无效
- 如果用户输入无效,如何使用字符串变量-C++重复输入命令
- 如何解决错误:SCIP C++中的 SCIP 阶段无效 <10>
- 在没有参数列表的情况下使用模板名称"Event"无效,模板问题
- FFMPEG配置文件级别id大小无效
- 错误:从"int"到枚举c++的转换无效
- 如何修复此错误:className::className的无效使用
- 为什么将值返回函数传递给重载=运算符对运算符函数有效,而对其他运算符无效
- C++-模板嵌套类的引用初始化无效
- 错误:无效的预处理指令 #i 的意思是 #if?
- 多维数组 C++ 中数组下标的类型"int[int]"无效
- 在 C++ 中使用正则表达式错误时出现问题 括号表达式中的范围无效
- 从 'int' 到 'int*' CPP 的转换无效
- 如何接受 [ENTER] 键作为无效输入并发送错误消息
- 由于无效的 ValidateRgn() 子窗口不会收到WM_PAINT消息
- C++ PTHREADS - 无效转换无效*(*)()到无效*(*)(无效*)
- 声明为无效的变量或字段'...' Ardunio 编译器上的错误
- 数组下标的类型"float*[float]"无效
- 使用智能卡签名(C++)时为RtlFreeHeap指定的地址无效