LoadLibrary 失败 0x000001e7 Attempt to access invalid address

现象:LoadLibrary 偶尔会失败,返回值   NULL, @err,hr     0x000001e7 Attempt to access invalid address.

原因在于DLL,当DLL link 的时候指定了:

/FIXED   Property Pages\Linker\Advanced | Fixed Base Address : Image must be loaded at a fixed address (/FIXED)。

说明该 DLL 被加载到固定地址。而默认的编译选项是允许 DLL 被加载到任意位置的 /FIXED:NO。

当 DLL 被强制要求加载到固定地址时,该 DLL 不会有重定位表, 用 dumpbin 打开发现果然没有.reloc 段。

时间: 2024-08-08 05:36:26

LoadLibrary 失败 0x000001e7 Attempt to access invalid address的相关文章

HEAP[xxx.exe]:Invalid Address specified to RtlValidateHeap 错误的解决方法总结

一.情况 抽象出问题是这样的: class DLL_API1 A { func() { vector vec; B b; b.func(vec); return TRUE; } } 其中B是另一个导出类,定义如下 class DLL_API2 B { private: vector m_vec; public: func( vector &vec ) { vec = m_vec; } } 运行时发现,每次运行到A的return TRUE释放vector的时候,都会报错:user breakpoi

LoadLibrary失败的原因(转)

背影: 今天终于把公司的SDK 动态链接库转为Java 可调用的JNI 格式.DLL的编译环境是VS2010,使用Debug 输出时调用正常,而用Release 输出却调用失败.这可把哥搞惨了,开始以为是编译设置问题,找了N多方法均不得解.最后只得用哥惯用的调试手段,在DLL 里加打印消息一步步确认出错位置,然后得知是DLL 里调用公司的DLL 不成功.随后就找到了下面的方法,一试得解.非常谢该网友. 源:LoadLibrary失败的原因 今天使用LoadLibrary时,失败,于是翻了一下MS

UIS R170 G2安装centos启动报Attempt to access block outside partition

[关键词]:Attempt to access block outsidepartition [适用版本]:UISR170 G2 [问题描述]: 正常安装centos后启动报"Attempt to access block outsidepartition" [问题分析]: 默认UIS R170 G2的BIOS默认为UEFI模式,导致超过4个主分区. [解决方法]: 1.设置raid卡(安装raid配置手册设置) 2.进入bios,设置为legacy  BIOS mode(默认是UEF

ORA-14450 attempt to access a transactional temp table already in use

今天在对临时表新增栏位时遇到了错误:ORA-14450 attempt to access a transactional temp table already inuse 下面根据实验模拟了2种临时表使用不当报ORA-1445O的原因: 1.基于事物的临时表 SQL> createglobal temporary tabletemp_tab on commit delete rowsas select 'a' as a1 fromdual; Table created. SQL> selec

解决selemium报错 Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure

关于 Exception in thread "main" org.openqa.selenium.remote.UnreachableBrowserException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure. 代码中少了 webdriver.chrome.driver", "

bug report: Jump to the invalid address stated on the next line at 0x0: ???

gdb或者vlagrind报告: ==14569== Jump to the invalid address stated on the next line ==14569== at 0x0: ??? ==14569== Address 0x0 is not stack'd, malloc'd or (recently) free'd 错误原因:函数通过jmp,call,ret等指令跳转到0x00,错误可能出现的范围 1.函数缓冲区溢出覆盖了返回地址,然后又调用了return,例如 #inclu

LoadLIbrary 失败GetLasterror 返回127 126

使用LoadLibrary()动态加载DLL失败原因: 路径错误(程序与dll放于同一目录) DLL本身错误(依赖其他的DLL) 解决方法: 将DLL与exe放于同一目录 Loadlibrary()与LoadlibraryEx() DLL本身依赖使用depends.exeDependency Walker(depends)查看该DLL依赖哪些DLL

VS2012(2013、2015) OpenCV “HEAP:Invalid Address specified to RtlValidateHeap( 000D0000, 019FEF18 )

近期拿起一个openCV程序跑了一下,是VS2013 + OpenCV2.4.8,运行的时候如下错误: 百度,谷歌了很久,给出的办法都无法解决,于是又装了VS2012 VS2015一样的错误,但是别人又可以正常运行.在绝望之时,发现这个哥们的博文http://blog.csdn.net/sacomplex/article/details/44402149 居然解决了,实在不知为什么 解决方法 在 项目 -> 属性 -> 配置属性 -> 常规 -> 平台工具集 把 Visual St

Windows 错误代码

Error Messages for Windows http://www.gregorybraun.com/MSWINERR.ZIP Server 4.0 Error Messages   Code Error Message 0 操作成功完成. 1 函数不正确. 2 系统找不到指定的文件. 3 系统找不到指定的路径. 4 系统无法打开文件. 5 拒绝访问. 6 句柄无效. 7 存储控制块被损坏. 8 存储空间不足,无法处理此命令. 9 存储控制块地址无效. 10 环境不正确. 11 试图加载