Now, I use a plugin intended for a specific mod dll in order to have more freedom, and I declare functions inside the mod as function pointers in order to save code and memory or simply because it is otherwise near-impossible. This is one such declaration:
(In this particular example, this is not necessary, but it is just an example anyway.)
void (*Info_SetValueForKey)( char *s, const char *key, const char *value ) = (void(*)(char*, const char*, const char*)) SETVALUEFORKEY;
This declaration of the pointer normally works completely fine, I can call the function whenever I want and it does not cause memory corruption or crashes. Just for the record, I tried it on at least five different servers, including servers with Windows Server 2008, Windows 7, Windows Server 2003 and dedicated servers like those from AoWC or MamoothGames.
However, yesterday when I tried to install it regularly on some other VPS, it caused an access violation crash when I called that function above. The location for the access violation was the SETVALUEFORKEY offset. I have matching versions for the mod and the plugin, and I know the address is correct. Here are some of the things I tried to fix the issue: (Note: This happens with every function/variable pointer declared in the same fashion.)
* Install Visual C++ 2010 runtimes.
* Use Visual C++ 2008 to compile the plugin. (I normally use 2010)
* Compilation in debug mode.
* Compilation without dependencies. (Like msvcr100.dll)
* Deleting the mod folder and using my folder that works fine on my homehost.
* Clearing GameData contents and replacing them with my homehost files.
* Using different engines. (jamp, jampDed, OpenJK)
* Running the engines in administrator mode.
* Running the engines in various compability modes.
None of those attempts to fix the issue worked, and it makes me think that something is wrong with the VPS itself, but I can't figure out what.
Any ideas? I really need help with this one.
Added (27.06.2013, 10:16)
I figured out that the VPS I have been trying to install it on is x64. It might be affecting something, but I am not sure what; because the plugin can load, meaning that the operating system can recognize the file.