zoukankan      html  css  js  c++  java
  • Dynamic-Link Library Redirection

    Dynamic-Link Library Redirection 

    Applications can depend on a specific version of a shared DLL and start to fail if another application is installed with a newer or older version of the same DLL.

    There are two ways to ensure that your application uses the correct DLL:

    DLL redirection and side-by-side components.

    Developers and administrators should use DLL redirection for existing applications, because it does not require any changes to the application.

    If you are creating a new application or updating an application and want to isolate your application from potential problems, create a side-by-side component.

    To use DLL redirection, create a redirection file for your application.

    The redirection file must be named as follows:

    App_name.local

    For example, if the application name is Editor.exe, the redirection file should be named Editor.exe.local

    You must install the .local file in the application directory.

    You must also install the DLLs in the application directory.

    The contents of a redirection file are ignored, but its presence causes Windows

    to check the application directory first whenever it loads a DLL, regardless of the path specified to LoadLibrary or LoadLibraryEx.

    If the DLL is not found in the application directory, then these functions use their usual search order.

    For example, if the application c:myappmyapp.exe calls LoadLibrary using the following path:

    c:program filescommon filessystemmydll.dll

    And, if both c:myappmyapp.exe.local and c:myappmydll.dll exist, 

    LoadLibrary loads c:myappmydll.dll.

    Otherwise,LoadLibrary loads c:program filescommon filessystemmydll.dll.

    Alternatively, if a directory named c:myappmyapp.exe.local exists and contains mydll.dll, 

    LoadLibrary loads c:myappmyapp.exe.localmydll.dll.

    Known DLLs cannot be redirected.

    For a list of known DLLs, see the following registry key:

    HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlSession ManagerKnownDLLs.

    The system uses Windows File Protection to ensure that system DLLs such as these are not updated or deleted

    except by operating system updates such as service packs.

    If the application has a manifest, then any .local files are ignored.

    If you are using DLL redirection and the application does not have access to all drives and directories in the search order,

    LoadLibrary stops searching as soon as access is denied.

    (If you are not using DLL redirection, LoadLibrary skips directories that it cannot access and then continues searching.)

    It is good practice to install application DLLs in the same directory that contains the application,

    even if you are not using DLL redirection.

    This ensures that installing the application does not overwrite other copies of the DLL and cause other applications to fail.

    Also, if you follow this good practice, other applications do not overwrite your copy of the DLL and cause your application to fail.

  • 相关阅读:
    $Django 中间件 csrf
    $Django cookies与session--解决无连接无状态问题, session配置
    $Django Form组件
    $Django Paginator分页器 批量创建数据
    $Djangon admin界面 添加表 增删查改
    $Django ajax简介 ajax简单数据交互,上传文件(form-data格式数据),Json数据格式交互
    $Django 多对多-自定义第三张表 基于双下划线的跨表查询(补充)
    $Django 客户端->wsgi->中间组件->urls->views(model,template) 总结+补充(事物,choices,inclusion_tag)!
    $Django 聚合函数、分组查询、F,Q查询、orm字段以及参数
    经典的C++库【转帖】
  • 原文地址:https://www.cnblogs.com/shangdawei/p/4787179.html
Copyright © 2011-2022 走看看