gpt4 book ai didi

com - 64 位 Windows 上的 32 位和 64 位互操作性

转载 作者:行者123 更新时间:2023-12-04 08:29:40 25 4
gpt4 key购买 nike

是否有一个很好的全面权威引用来讨论 32 位和 64 位进程之间的互操作性?基于谷歌搜索,我推断出:

  • 32 位 DLL 只能驻留在 32 位进程中,64 位 DLL 只能驻留在 64 位进程中。
  • 32 位和 64 位进程只能使用松散耦合的消息系统进行通信,例如网络通信,这意味着它们可以使用 COM/DCOM 进行通信。
  • 32 位和 64 位 COM 组件具有不同的注册表项。一个组件通常只在两个世界之一中注册,并且通常只在两个世界之一中看到。
  • 如果 32 位进程使用带有 64 位调用标志的 CoCreateInstance,或者(我猜这可能吗?)如果 64 位组件以某种方式在 32 位注册表中注册,但在引擎盖下仍作为进程外 64 位进程创建,或者如果有一个 32 位 shell COM 组件创建 64 位组件,然后将调用重定向到它?

  • 这表明:
    1. 32 位应用程序不能使用 GetObject 获取正在运行的 64 位版本的 Excel?或者可以吗? 32 位与 64 位问题对运行对象表 (ROT) 有何影响?如果只安装了 64 位版本的 Office,32 位进程能否创建 Excel 实例?我认为答案是否定的,除非 32 位进程在其 CoCreateInstance 调用中使用 64 位标志,或者 Excel 是否也以某种方式在 32 位世界中注册了自己?

    Microsoft 是否会自动执行任何操作,例如让来自 32 位进程的 CoCreateInstance 检查 64 位注册表,并在 32 位注册表中未注册任何组件时尝试创建进程外 64 位组件?我看过一些来自 64 位 Office 的发行说明,其中 Microsoft 警告说从 32 位应用程序访问 64 位 Excel 不起作用,但我知道有一个实例似乎可以正常工作。

    对此是否有很好的技术事实引用?

    最佳答案

    MSDN Library docs 中有很好的解释。对于 CLSCTX。很多规则,默认行为是:

    If neither the client nor the server specifies a preference, then:

    • If the computer that hosts the server is running Windows XP or Windows Server 2003 without Service Pack 1 (SP1) or later installed, then COM will prefer a 64-bit version of the server if available; otherwise it will activate a 32-bit version of the server.

    • If the computer that hosts the server is running Windows Server 2003 with SP1 or later installed, then COM will try to match the server architecture to the client architecture. In other words, for a 32-bit client, COM will activate a 32-bit server if available; otherwise it will activate a 64-bit version of the server. For a 64-bit client, COM will activate a 64-bit server if available; otherwise it will activate a 32-bit server.



    如果要覆盖此行为,请查看 MSDN 文章。

    关于com - 64 位 Windows 上的 32 位和 64 位互操作性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4798560/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com