Hi!
While trying to get Anarchy Online working with Wine, I discovered that dynamically getting symbols from the running program does not work properly in Wine.
The attached example code shows the problem; when running in Windows, I get this output
The mangled name is "?Instantiate@MyTestClass@@SAPAV1@PAVObjectArchive_c@fun@@@Z" Searching in "ntdll.dll" Searching in "kernel32.dll" Searching in "Factory.dll" Searching in "MSVCP60D.dll" Searching in "MSVCRTD.dll" Searching in "Test.dll" Found the function at 00321023 Creating a new object! The returned text is "Found the right one!"
whereas when running this in Wine, this is the output
[andrej@rivendell tst]$ PATH=$PATH:$PWD wine tst The mangled name is "?Instantiate@MyTestClass@@SAPAV1@PAVObjectArchive_c@fun@@@Z" Searching in "" Searching in "" Searching in "" Searching in "" Searching in "" Searching in "" Searching in "" Searching in "" The returned text is "<function for "MyTestClass" not found>"
If the test for a ".dll" ending is removed (as can be seen in the output, the name returned is empty, so it will always fail), this is the output
[andrej@rivendell tst]$ PATH=$PATH:$PWD wine tst The mangled name is "?Instantiate@MyTestClass@@SAPAV1@PAVObjectArchive_c@fun@@@Z" Searching in "" Searching in "" Found the function at 0x408a9023 Creating a new object! The returned text is "Found the right one!"
(If anybody needs the compiled code, and/or MSDS project files, please contact me directly.)