How can I make sure that these two functions get called exactly once when the DLL is loaded/unloaded by Windows regardless of how many processes have used the DLL? I also want to be able to use the code as a static library so that complicates things even further.