DLL 总是具有相同的基地址吗? [英] Is DLL always have the same Base Address?

查看:32
本文介绍了DLL 总是具有相同的基地址吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在研究 Windows 和 DLL 的相关内容,但我对此有一些疑问.:)

I'm studying about windows and DLL stuffs and I have some question about it. :)

我制作了一个简单的程序来加载我自己的 DLL.这个 DLL 只有简单的函数,加减.

I made a simple program that loads my own DLL. This DLL has just simple functions, plus, minus.

问题是:如果我加载一些 DLL(例如,text.dll),这个 DLL 是否总是具有相同的基地址?或者当我重新启动它时它会改变吗?我可以保存 DLL 的基地址吗?

This is the question : if I load some DLL (for example, text.dll), is this DLL always have the same Base Address? or it changes when I restart it? and can I hold the DLL's Base Address?

当我测试它时,它总是具有相同的基地址,但我认为当我需要这样做时,我必须对 DLL 基地址进行一些例外处理.

When I test it, it always have same Base Address, but I think when I need to do about this, I have to make some exception about the DLL Base Address.

推荐答案

操作系统会以它喜欢的任何基地址加载您的 DLL.您可以指定一个首选"基地址,但如果它不可用,(无论出于何种原因,这可能完全不受您的控制),您的 DLL 将被操作系统重新定位到操作系统的任何地址系统认为合适.

The operating system will load your DLL in whatever base address it pleases. You can specify a "preferred" base address, but if that does not happen to be available, (for whatever reason, which may well be completely out of your control,) your DLL will be relocated by the operating system to whatever address the operating system sees fit.

这篇关于DLL 总是具有相同的基地址吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆