We have to use 3rd party DLL in our development process, unfortunately we can't modify it or specify how library have to work.
Original library developers introduced state mechanic in their methods via static variables.
E.g.:
void foo()
{
static int a = 1;
if (a == 1)
{
/* some init logic */
a = 2;
}
}
Sometime we need bring the library to its original state.
Is there any way to reset static variables to their original values without any system "hacks"?
Our current solution is FreeLibrary/LoadLibrary, but we want to avoid it.