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 <sandf...@jhu.edu>

> On Sun, 17 Apr 2011 16:09:02 -0400, maarten van damme <
> maartenvd1...@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,@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.
>

Reply via email to