Delphi - 无效流格式错误运行 [英] Delphi - invalid stream format errors on run

查看:241
本文介绍了Delphi - 无效流格式错误运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Delphi 6 Prof。



我们有很多应用程序。程序有8-12 MB大小。



在此期间,我们很多时候收到有关无效流格式错误的报告。



我们使用共享的Windows(或Linux)文件夹来存储应用程序,用户通过链接从这些目录运行它们。
这意味着操作系统正在分页文件,仅加载所需的部分。



以前我们得到了C000006异常。
正如我所知,这意味着文件分页(加载)在任何网络问题(超时等)上失败。



现在我们面对无效的流格式错误和无效的属性xxxx错误。



如果我知道的很好,两个错误都是由分页问题引起的,但C06发生在代码中,流错误Exe的数据区域。
但也许我知道错误...



无论如何,问题是奇怪的。有时候我们得到它,有时候我们没有。



如何避免?这些错误阻止用户创建新的对话框,使用程序...



(在其他位置,用户使用wifi - 然后我们有相同的副作用。) / p>

也许你有任何想法如何预防,避免这个问题。



UPX(与Antiviruses)?
将该副本复制到本地?



该客户的系统管理员是我们的敌人,因为他们说:一切正常。问题的根源是不可识别的...



感谢每一个想法:dd

解决方案

假设您的分析是正确的,问题是可执行文件位于具有片状连接的网络驱动器上,则有一个解决方案。您需要在可执行文件中添加PE标志,强制Windows在运行文件之前将文件从网络复制到本地机器。



确保您的.dpr文件的使用子句包括 Windows 单位。然后添加以下行:

  {$ SetPEFlags IMAGE_FILE_REMOVABLE_RUN_FROM_SWAP或IMAGE_FILE_NET_RUN_FROM_SWAP} 
pre>

就在.dpr文件中开始之前。我们添加了 Windows 单位,以便识别两个常量。


Delphi 6 Prof.

We have many applications. The programs have 8-12 MB size.

In this period we many times got reports about "Invalid stream format" errors.

We use shared Windows (or Linux) folders to store the applications, and users running them from these directories with links. This meaning that OS is paging the files, and loading the needed parts only.

Formerly we got C000006 exceptions. As I know this meaning that the file paging (loading) failed on any network problem (timeout, etc).

Now we face with "Invalid stream format" errors, and "invalid property xxxx" errors.

If I know well, both error caused by "paging problem", but C06 happens in code, and stream error in the data area of the Exe. But maybe I know wrong...

Anyway the problem is strange. Sometimes we got it, sometimes we not.

How to avoid it? These errors prevents the users to create new dialogs, to use the programs...

(In other place the user used wifi - then we got same side effects.)

Maybe you have any idea how to prevent, avoid this problem.

UPX (vs. Antiviruses)? Copy the exe-s to local place?

The system administrators of this customer are "our enemies", because they said: "everything is ok". The source of the problem isn't identifiable...

Thanks for every idea: dd

解决方案

Assuming your analysis is correct, and the problem is that the executable is located on a network drive with a flaky connection, then there is a solution. You need to add PE flags to your executable that forces Windows to copy the file from the network to the local machine before running it.

Make sure that your .dpr file's uses clause includes the Windows unit. And then add this line:

{$SetPEFlags IMAGE_FILE_REMOVABLE_RUN_FROM_SWAP or IMAGE_FILE_NET_RUN_FROM_SWAP}

just before the begin in your .dpr file. We added the Windows unit so that the two constants would be recognised.

这篇关于Delphi - 无效流格式错误运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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