zoukankan      html  css  js  c++  java
  • How do exes/dlls generated with the /platform:x switch interact?

    I received a question about this recently, so i figured i'd elaborate here with a little example...

     

    Let's assume we have the following three dlls:

       anycpu.dll      -- compiled "any cpu"

       x86.dll           -- compiled "x86"

       x64.dll           -- compiled "x64"

     

    And the following three exes:

       anycpu.exe     -- compiled "any cpu"

       x86.exe          -- compiled "x86"

       x64.exe          -- compiled "x64"

     

    What happens if you try to use these exes and dlls together? We have to consider two possible scenarios, running on a 32-bit machine and running on a 64-bit machine...

     

    On a 32-bit x86 machine:

    anycpu.exe -- runs as a 32-bit process, can load anycpu.dll and x86.dll, will get BadImageFormatException if it tries to load x64.dll

    x86.exe -- runs as a 32-bit process, can load anycpu.dll and x86.dll, will get BadImageFormatException if it tries to load x64.dll

    x64.exe -- will get BadImageFormatException when it tries to run

     

    On a 64-bit x64 machine:

    anycpu.exe -- runs as a 64-bit process, can load anycpu.dll and x64.dll, will get BadImageFormatException if it tries to load x86.dll

    x86.exe -- runs as a 32-bit process, can load anycpu.dll and x86.dll, will get BadImageFormatException if it tries to load x64.dll

    x64.exe -- runs as a 64-bit process, can load anycpu.dll and x64.dll, will get BadImageFormatException if it tries to load x86.dll

  • 相关阅读:
    安全工具-Arachni
    Python读取本地文档内容并发送邮件
    Linux好用的工具命令
    kali 安装google chrome浏览器(离线手动)
    安全工具-Sparta
    安全工具-Hydra
    当年的程序员,如今已是父母,七个方法让孩子爱上学习!
    一个网站SEO优化方案
    发现2017年最好的CSS框架
    怎么样加快JavaScript加载和执行效率
  • 原文地址:https://www.cnblogs.com/wd775/p/1964168.html
Copyright © 2011-2022 走看看