Skip to content
TopicTracker
来自 devblogs.microsoft.com/oldnewthing查看原文
译文语言译文语言

关于滥用 Windows 窗口类额外字节的兼容性说明

寻找一个不合法的藏匿数据之处。本文是《The Old New Thing》博客上的一篇兼容性说明,讨论了开发者滥用 Windows 窗口类额外字节(Window Class Extra Bytes)来存储数据所带来的问题。

背景速读

- 本文来自微软工程师 Raymond Chen 的博客《The Old New Thing》,专门讲解 Windows 底层兼容性细节,受众是 Windows 开发者、系统程序员和逆向工程师。 - "窗口类额外字节"(window class extra bytes)是 Windows 窗口系统的一个底层机制:程序员在注册窗口类时可以申请额外内存,系统在内部为每个窗口保留该数据,常用于存储与窗口相关的私有信息。 - 该文指出某些程序滥用这个机制来隐藏数据(比如视频游戏的 DRM 或反作弊系统),其行为违反了 Windows 的设计预期。虽然当前版本仍能工作,但未来更新可能因兼容性考虑而修复这类"潜规则"。 - 关键背景:Windows 以"向后兼容"著称(几乎从不断掉旧程序依赖的行为),但滥用未公开的内部行为一旦被微软发现并打补丁,依赖它的程序就可能崩溃。这是 Windows 开发社区长期讨论的话题。

相关报道

  • A developer found that a DLL was no longer in memory even though it hadn't been formally unloaded, tracing the issue to Windows' DLL load ordering. When a DLL is loaded at a base address that conflicts with another DLL loaded earlier, the system may relocate it and then later discard the relocated version without clear notification, confusing developers expecting explicit unload.