link from a dll to another function in another dll?

maarten van damme maartenvd1994 at gmail.com
Mon Apr 18 01:11:16 PDT 2011


The problem with that aproach would be that the functions are in another
location in the export table.
I've read that the locations need to stay exactly the same.
Am I wrong about this?

2011/4/18 Robert Jacques <sandford at jhu.edu>

> On Sun, 17 Apr 2011 16:09:02 -0400, maarten van damme <
> maartenvd1994 at gmail.com> wrote:
>
>  Hello everyone, this is my second post in the digitalmars.d newsgroup and
>> I
>> hope it gets as good support and suggestions as my first post :)
>>
>> I'm playing around with the d programming language and am trying out some
>> exotic things you normally would write in c++.
>> Right now I'm trying to 'intercept' all calls from a program to a dll by
>> renaming that dll and writing my own in d.
>> In c++ you would write in the header file:
>> #pragma comment(linker,
>> "/export:exportfunction=nameofotherdll.dll.destinationfunction, at location")
>>
>> How could one write this in the d programming language?
>> Asuming this has to be done with the pragma(lib,...) function but I don't
>> really know how.
>>
>> thanks in advance,
>>
>> Maarten
>>
>
> I don't know of an automated way of doing this is D. pragma(lib,...)
> exists, but it simply loads a specified static library. (i.e. to simplify
> linking/ project setup, etc). Personally, I'd just export
> extern(C)/extern(System) functions toa DLL, and link in a manually define
> the renamed DLL using a .def file and implib.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20110418/4c1cc17a/attachment.html>


More information about the Digitalmars-d mailing list