Do not increment module refCount if self is loaded from within
DllEntryPoint during the attach notification.
diff --git a/loader/module.c b/loader/module.c
index 575dd3b..21a2128 100644
--- a/loader/module.c
+++ b/loader/module.c
@@ -1252,7 +1252,8 @@
/* Check for already loaded module */
if((pwm = MODULE_FindModule(libname)))
{
- pwm->refCount++;
+ if(!(pwm->flags & WINE_MODREF_MARKER))
+ pwm->refCount++;
TRACE(module, "Already loaded module '%s' at 0x%08x, count=%d, \n", libname, pwm->module, pwm->refCount);
LeaveCriticalSection(&PROCESS_Current()->crit_section);
return pwm;