according to dllexp.exe (a dll examiner) my dll does not export any functions.<div>So there is something wrong in my declaration:</div><div><br></div><div>pragma(lib,kernel33.lib);</div><div>extern(C){</div><div>export void * functionfromkernel33.lib () ;</div>
<div>...</div><div>}</div><div><br></div><div>How can one write this correctly?</div><div><br><div class="gmail_quote">2011/4/21 maarten van damme <span dir="ltr"><<a href="mailto:maartenvd1994@gmail.com">maartenvd1994@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div><span style="border-collapse:collapse;font-family:arial, sans-serif;font-size:13px"><div class="im">There is another problem, I don't know the return types of the functions from that dll, so I gave them the type "void *". I think this is incorrect.</div>
<div>
I've tried with the little knowledge I have from d and in the link is my kernel32.d. I have compiled it succesfully in a .dll but the application using that dll states that that dll isn't valid.</div><div class="im">
<div><br></div>
<div>thank you for taking your time to answer this question :) .</div><div><br></div><div><br></div></div></span></div><a href="http://dl.dropbox.com/u/15024434/kernel32.d" target="_blank">http://dl.dropbox.com/u/15024434/kernel32.d</a><div>
<div></div><div class="h5"><br><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div></div><div><div><br><div class="gmail_quote">2011/4/21 Robert Jacques <span dir="ltr"><<a href="mailto:sandford@jhu.edu" target="_blank">sandford@jhu.edu</a>></span><br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>On Thu, 21 Apr 2011 07:49:14 -0400, maarten van damme <<a href="mailto:maartenvd1994@gmail.com" target="_blank">maartenvd1994@gmail.com</a>> wrote:<br>



<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>
Hello, I'm back (I've been ill, nothing serious)<br>
I woul really like a bit more explanation with that particular approach.<br>
Would declaring the functions I want to keep from the renamed dll in a<br>
extern(c) block and linking that to the renamed dll while also declaring<br>
them as export work?<br>
And the function I want to change I declare myself and write in d?<br>
<br>
I haven't really mastered the d language and I'm simply playing around with<br>
it, simply checking if I've understood it.<br>
<br>
2011/4/18 Robert Jacques <<a href="mailto:sandford@jhu.edu" target="_blank">sandford@jhu.edu</a>><br>
<br>
</div><div><div></div><div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Mon, 18 Apr 2011 04:11:16 -0400, maarten van damme <<br>
<a href="mailto:maartenvd1994@gmail.com" target="_blank">maartenvd1994@gmail.com</a>> wrote:<br>
<br>
 The problem with that aproach would be that the functions are in another<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
location in the export table.<br>
I've read that the locations need to stay exactly the same.<br>
Am I wrong about this?<br>
<br>
</blockquote>
<br>
I don't know for sure, but my gut would say that not knowing the exact<br>
layout of the DLL is half the point. In practice, I've used D with DLLs that<br>
have drastically added to/changed their layout (according to dumpbin)<br>
without a problem.<br>
<br>
</blockquote></div></div></blockquote>
<br>
Hmm... It should work, but I've never tried it. Def files allow you to rename DLL functions, so you could rename the single function you want to override something else, or leave it out entirely. The only thing to be careful of is call style and name mangling (i.e. System vs C, etc.)<br>



</blockquote></div><br></div>
</div></div></blockquote></div><br>
</div></div></blockquote></div><br></div>