I have made some functions in my DLL, like this:
procedure DoThis(A: PChar): Boolean; stdcall;
begin
f := TFileStreamCreate(A, fmCreate);
f.read()
f.free;
end;
then I exported it under 2 names:
export
DoThis,
DoThis name 'DoThat';
In most cases this "renaming" works. But in at least one case the renamed function "DoThat" does not read data from a real file but from the void. If I call DoThis on the same file- it works great. I removed all memory leaks thanks to FastMM4 (converted the code to regular console app)
So the question is:
Is this "renaming" not a legal thing to do?
If it is legal- can I debug DLL with FastMM4 without changing it into a console app?
What you describe in the question is not consistent with reality.
Is this "renaming" not a legal thing to do?
Exporting the same function under multiple names is perfectly legal. The problems you describe do not happen.
Can I debug DLL with FastMM4 without changing it into a console app?
Yes you can. Specify a host application in the Run parameters dialog and you can debug your DLL.