TONT 33613 当应用程序认为系统永远都不会变的时候:第1章

请注意:本页内容发布于 1493 天前,内容可能已经过时,请注意甄别。

原文链接:https://devblogs.microsoft.com/oldnewthing/20051026-44/?p=33613

An example, all too frequent, of ways programs assume that the user interface will never change is reaching into system binaries and sucking out undocumented resources. In the shell, we have fallen into the reluctant position of carrying “dead” icons around for the benefit of programs that assumed that they would always be available. However, we often make these “orphaned” icons blank so that these programs don’t crash, but they don’t necessarily look all that wonderful either.

有些程序认为用户界面永远不会改变的、非常常见的一种表现,便是深入到系统文件中随便扒拉没有在文档中描述的资源。在 Shell 设计中,我们陷入了一种不情愿的境地,即保留某些已经『死掉』的图标,来让这类认为某些资源会一直存在的程序高兴。不过,我们通常都会将这些『遗孤』图标变成空白,使得这些程序虽然不会崩溃,但也不会让它们看上去再那么完美。

Recently, I learned of a new type of resource stealing: Stealing animations. For Windows Vista, there have been many changes to the way the system internally organizes its resources in order to support the Multilingual User Interface feature. One of the things we found was a handful of programs that reach directly into Shell32.dll in order to obtain the file copy animation. Too bad (1) the animation isn’t kept there any more, and even if we moved the animation back to its original location, (2) the animation uses a new compression scheme that older programs can’t handle.

最近,我又了解了一种窃取资源的新方法:盗用动画。在 Windows Vista 中,为了支持多语言用户界面(MUI)功能,在系统内部对资源的排序整理方式发生了很大的变化。(在此过程中,)我们发现了一件事,有不少应用程序直接跑进 SHELL32.DLL 中直接将复制文件的动画拿来用。可惜的是,(1)这个动画已经不在原先的位置了,并且就算我们将这个动画放回原来的位置,(2)这个动画所使用的新的压缩方式,这些老版本的程序也不支持。

Remember, resources in system DLLs should be treated as implementation details, unless explicitly documented otherwise.

请记住,除非在文档中明示,否则系统 DLL 中的资源应当被视为实施细节。

I’m not sure what we’re going to do about the animation resource problem. Suggestions anyone? Should we declare these programs broken and make the people who bought them go back to their vendors for upgrades? (What if there is no vendor?) Should we develop a shim and hope that those four are the only programs that need it? Should we carry the original animation in shell32.dll as junk? If I told you that one of the programs that did this won “Game of the Year” recently, would that change your answer? What if another turned out to be a top-rated anti-spyware program?

我不是很确定应该怎么解决这个盗用系统动画的问题,有人能给个建议吗?是不是应该让这些程序无法运行,让购买了这些软件的人们回去找发行商进行升级呢(要是没有发行商该怎么办)?还是应该针对这些程序打个补丁,然后寄希望于只有这些程序需要这个补丁吗?或者让旧版本的动画继续存在于 SHELL32.DLL 中作为残留呢?如果我告诉你有这个问题的软件最近还拿了『年度最佳游戏』的奖项,你会选择修改你的回答吗?要是我告诉你还有一款存在这个问题的软件,是某个名列前茅的反间谍软件呢?

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

 剩余字数 ( Characters available )

Your comment will be available after auditing.
您的评论将在通过审核后显示。

Please DO NOT add any links in your comment, otherwise it would be identified as SPAM automatically and never be audited.
请不要在评论中插入任何链接,否则将被自动归类为垃圾评论,且永远不会被提交给博主进行复审。

*