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动态链接器实 ...
随机推荐
- centos7和centos6的区别【转】
最近发的文章,有人咨询我,说为啥不用centos7,而用centos6,这个跟个人习惯和生产环境元素决定的.centos7和6变化的就很大的.我收集了一些区别,给大家看看. 注意:生产环境推荐cent ...
- click模块使用
# coding:utf8 import time import click @click.command() @click.option('--id', default='123', help='a ...
- 一个无锁消息队列引发的血案(四)——月:RingQueue(上) 自旋锁
目录 (一)起因 (二)混合自旋锁 (三)q3.h 与 RingBuffer (四)RingQueue(上) 自旋锁 (五)RingQueue(中) 休眠的艺术 (六)RingQueue(中) 休眠的 ...
- Heist
CF#509 div2 A 第一次用自己的号打CF祭. 题目描述 昨晚有一家电子商店被抢劫了. 昨天在商店里的所有键盘都是从x开始按升序编号的.例如,如果x=4,并且商店中有3个键盘,那么编号就为4, ...
- github git 无法读取远程仓库或无权限
解决方法:重新设置ssh密钥 ssh-keygen -t rsa -C "http://github.com"//输入命令后按提示输入id_rsa.pub的存储地址 和密钥密码 地 ...
- 【LOJ】#2479. 「九省联考 2018」制胡窜
题解 老了,国赛之前敲一个后缀树上LCT和线段树都休闲的很 现在后缀树上线段树合并差点把我写死 主要思路就是后缀树+线段树合并+容斥,我相信熟练的OIer看到这已经会了 但就是不想写 但是由于我过于老 ...
- 【LOJ】#2108. 「JLOI2015」装备购买
题解 换成long double才过--出题人丧心病狂卡精度 只要按照费用排序从小到大排序,一个个插入线性基,插入的时候加上费用即可 代码 #include <bits/stdc++.h> ...
- vs2010 打包安装
https://jingyan.baidu.com/article/b7001fe184e4e50e7382dd4e.html 1 建立安装项目2 要安装的文件都添加到应用程序文件夹3 在应用程序文件 ...
- ubuntu ifconfig只有lo没有ens33的问题
如果ifconfig只显示了lo, ifconfig -a 却正常显示ens33.那么可以按照如下的操作: service network-manager stop rm /var/lib/Netwo ...
- php 导出excel文件
out_excel.php <?phperror_reporting(E_ALL);date_default_timezone_set('Asia/Shanghai');require_once ...