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
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?
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.
So, you'll need to set the PE flag on each module that resides on a network share.
For what it's worth, I'd recommend adding IMAGE_FILE_REMOVABLE_RUN_FROM_SWAP
as well.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With