Can't you use `loadLib` and when `null` is passed on Windows call `GetModuleHandleA(null)`.