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:\myapp\myapp.exe calls LoadLibrary using the following path:
c:\program files\common files\system\mydll.dll
And, if both c:\myapp\myapp.exe.local and c:\myapp\mydll.dll exist,
LoadLibrary loads c:\myapp\mydll.dll.
Otherwise,LoadLibrary loads c:\program files\common files\system\mydll.dll.
Alternatively, if a directory named c:\myapp\myapp.exe.local exists and contains mydll.dll,
LoadLibrary loads c:\myapp\myapp.exe.local\mydll.dll.
Known DLLs cannot be redirected.
For a list of known DLLs, see the following registry key:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\KnownDLLs.
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.
Dynamic-Link Library Redirection的更多相关文章
- Walkthrough: Creating and Using a Dynamic Link Library (C++)
Original Link: http://msdn.microsoft.com/zh-cn/library/ms235636.aspx Following content is only used ...
- Custom Action : dynamic link library
工具:VS2010, Installshield 2008 实现功能: 创建一个C++ win32 DLL的工程,MSI 工程需要调用这个DLL,并将Basic MSI工程中的两个参数,传递给DLL, ...
- How to Use the Dynamic Link Library in C++ Linux (C++调用Delphi写的.so文件)
The Dynamic Link Library (DLL) is stored separately from the target application and shared among dif ...
- DYNAMIC LINK LIBRARY - DLL
https://www.tenouk.com/ModuleBB.html MODULE BB DYNAMIC LINK LIBRARY - DLL Part 1: STORY What do we h ...
- Walkthrough: Create and use your own Dynamic Link Library (C++)
参考网站:https://docs.microsoft.com/en-us/cpp/build/walkthrough-creating-and-using-a-dynamic-link-librar ...
- [DLL] Dynamic link library (dll) 的编写和使用教程
前一阵子,项目里需要导出一个DLL,但是导出之后输出一直不怎么对,改了半天才算改对...读了一些DLL教程,感觉之后要把现在的代码导出,应该还要花不少功夫...下面教程参照我读的3个教程写成,所以内容 ...
- 动态链接库(Dynamic Link Library)
DLL INTRODUCTION A DLL is a library that contains code and data that can be used by more than one pr ...
- 动态链接库(Dynamic Link Library)学习笔记(附PE文件分析)
转载:http://www.cnblogs.com/yxin1322/archive/2008/03/08/donamiclinklibrary.html 作者:EricYou 转载请注明出处 注 ...
- How to Create DLL(Dynamic link library)
该文章属于在YouTube视频上看到的,链接如下: https://www.youtube.com/watch?v=EmDJsl7C9-k&t=3s 1.创建一个工程并建立一个控制台程序 2. ...
- Linux Dynamic Shared Library && LD Linker
目录 . 动态链接的意义 . 地址无关代码: PIC . 延迟版定(PLT Procedure Linkage Table) . 动态链接相关结构 . 动态链接的步骤和实现 . Linux动态链接器实 ...
随机推荐
- Informatica学习:3、用户创建与权限管理
环境:win7 下安装Informatica 9.6.1 服务器端与客户端作为学习之用,Linux大同小异 一.用户创建(服务器端) 1.登陆admin console (1)打开Admin Cons ...
- 让浏览器重新下载css文件,解决不刷新缓存的问题
网站页面源代码中的css文件和js文件后面带一个问号,后面跟着一连串数字或字符,问号起不到实际作用,仅能当作后缀,如果用问号加参数的方法,可以添加版本号等信息 它的作用有:1.作为版本号,让自己方便记 ...
- Linux中断(interrupt)子系统之四:驱动程序接口层 & 中断通用逻辑层【转】
转自:http://blog.csdn.net/droidphone/article/details/7497787 在本系列文章的第一篇:Linux中断(interrupt)子系统之一:中断系统基本 ...
- c# 获取百度最后的url
using System;using System.Collections.Generic;using System.Linq;using System.Net.Http;using System.T ...
- C# XML 文档注释
原文链接:http://www.shinater.com/DocsBuilder/help.html <summary>description</summary> 描述类型或类 ...
- history命令追查登录的用户和时间
Linux查看History记录加时间,这个对于系统管理员还是很有帮助的,原因不解释,你懂得!ora11g$ history | more 1 rlwrap sqlplus / as sy ...
- WCF客户端调用服务器端错误:"服务器已拒绝客户端凭据"。
WCF客户端和服务器端不在同一台机器上时,客户端调用服务器端会报如下错误:"服务器已拒绝客户端凭据". 解决办法:在服务端配置文件与客户端配置文件中加入下面红色部分
- 解决JavaFTP上传文件假死问题
之前使用ftp上传文件,代码很稳定,用了快三年,因为数据迁移,从搭建了ftp服务器,配置好ip和账号密码后,再使用之前代码发现: 在下载过程中,程序出现假死的现象,就是,既不报错,也不抛异常,还不终止 ...
- PHPStorm 配置本地服务器
本篇教程为配置 PHPStorm 本地服务器,以方便程序调试. 本地服务器工具:XAMPP for windows 7.1.1-0 / Apache 2.4.25 ( Win32 ) / PHP 7. ...
- 使用abstract关键字的使用
package abstract1.demo01; //使用abstract关键字修饰的类叫做抽象类public abstract class Father { public static void ...