EXE 文件中的 IMAGE_FILE_NET_RUN_FROM_SWAP 如何影响运行时库 [英] How does IMAGE_FILE_NET_RUN_FROM_SWAP in an EXE file affect runtime libraries

查看:15
本文介绍了EXE 文件中的 IMAGE_FILE_NET_RUN_FROM_SWAP 如何影响运行时库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序有时从网络共享启动,并且一些客户在运行应用程序时报告了外部异常 C0000006.根据我的谷歌研究,这可能"与图像被调出以及无法从网络重新加载有关.一种解决方法是告诉 Windows 将完整的图像文件加载到交换中并通过设置 IMAGE_FILE_NET_RUN_FROM_SWAP 标志从那里运行它

My application is sometimes started from an network share and some customers reported an External exception C0000006 when running the application. According to my Google research this "may" be related to the image getting paged out and the failing to reload from the network. A workaround for this is telling Windows to load the complete image file into the swap and run it from there by setting the IMAGE_FILE_NET_RUN_FROM_SWAP flag

我的应用程序还依赖于在运行时加载的各种 .bpl 和 .dll 库.只有其中一些可以由我更改,一些由其他供应商提供.如果 exe 设置了这个标志,这个库会发生什么?是否也加载到交换文件中,或者它们是否仍然在需要时被调出并重新加载?我是否也需要在库中包含此标志?

My application also depends on various .bpl and .dll libraries that are loaded at runtime. Only some of those can be changed by me, some are supplied by other vendors. What happens to this libraries if the exe has this flag set? Are the also loaded into the swap file or are they still paged out and reloaded when needed? Would I need to include this flag in the libraries too?

推荐答案

该标志仅适用于设置它的 PE 模块.因此,在 EXE 中设置标志并不意味着该 EXE 加载的模块受该标志的影响.由您的 EXE 加载的每个模块(DLL、包等)将由加载器根据该模块中指定的 PE 选项进行处理.

The flag applies only to the PE module which sets it. So, setting the flag in an EXE does not mean that modules loaded by that EXE are affected by the flag. Each module (DLL, package etc.) that is loaded by your EXE will be treated by the loader according to the PE options specified in that module.

因此,您需要在驻留在网络共享上的每个模块上设置 PE 标志.

So, you'll need to set the PE flag on each module that resides on a network share.

就其价值而言,我建议也添加 IMAGE_FILE_REMOVABLE_RUN_FROM_SWAP.

For what it's worth, I'd recommend adding IMAGE_FILE_REMOVABLE_RUN_FROM_SWAP as well.

这篇关于EXE 文件中的 IMAGE_FILE_NET_RUN_FROM_SWAP 如何影响运行时库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆