I want to replace a DLL for which I don't have the full source code (but the function declarations). The application loads this DLL at runtime and calls GetProcAddress with (all) the function names. (so I have to name the functions exactly the same).
I created a new DLL (in MS VC2013) and wrote the functions. But I have a problem exporting them correctly.
In the original DLL they are defined with _stdcall but their names don't start with an underscore.
If I specify the name in the .def file like this testfunc@4=testfunc everything behind the @ is removed.
How can I specify in VS2013 that I want an DLL-export like testfunc@4?
The easiest way I think is by adding
in the source code of your DLL.
I got the idea from here. They also explain how to do it with a DEF file. A matter of taste I guess. You will end up with two entries for the same function in the export table but the application should be able to get the correct proc address.