Re-do some Windows-specific DLL stuff as not to break Linux compilation.