fixed WIN32 compatibility
[NeonServV5.git] / src / modules.c
index d29e7a8018515653d5e7ed38b19919be46ee6017..0d65cb8e6eb781474c0cafbe719ad1099b1b3ac9 100644 (file)
@@ -15,7 +15,9 @@
  * along with this program. If not, see <http://www.gnu.org/licenses/>. 
  */
 #include "modules.h"
+#ifndef WIN32
 #include <dlfcn.h>
+#endif
 
 /* 000-011 */ #include "main.h"
 /* 012     */ #include "BanNode.h"
@@ -263,7 +265,7 @@ void loadModules() {
         if(get_int_field(tmp)) {
             modinfo = loadModule(modulelist[i]);
             sprintf(tmp, "modules.%s.protected", modulelist[i]);
-            if(!get_int_field(tmp))
+            if(get_int_field(tmp))
                 modinfo->state |= MODINFO_STATE_PROTECTED;
         }
         i++;
@@ -333,6 +335,7 @@ struct ModuleInfo *loadModule(char *name) {
     modinfo->startfunc = startfunc;
     modinfo->loopfunc = loopfunc;
     modinfo->stopfunc = stopfunc;
+    modinfo->state = 0;
     modinfo->next = modules;
     modules = modinfo;
     return modinfo;