Note that unless there's some tools issue, DllMain doesn't need to be
exported to function properly. A DLL's initialization routine is
marked as the entry point in the PE header, same as main() in classic
C.
It might be simpler to just get rid of the export.