Index: branches/prototype-v0/zoo-project/zoo-kernel/zoo_service_loader.c
===================================================================
--- branches/prototype-v0/zoo-project/zoo-kernel/zoo_service_loader.c	(revision 873)
+++ branches/prototype-v0/zoo-project/zoo-kernel/zoo_service_loader.c	(revision 877)
@@ -68,4 +68,5 @@
 #ifdef WIN32
 #include "caching.h"
+extern wchar_t**_wenviron;
 #endif
 
@@ -111,5 +112,7 @@
 #include <dirent.h>
 #include <signal.h>
+#ifndef WIN32
 #include <execinfo.h>
+#endif
 #include <unistd.h>
 #ifndef WIN32
@@ -365,5 +368,6 @@
               fflush (stderr);
   #endif
-	      inheritance(r,&s1);
+	      if(s1!=NULL)
+		inheritance(r,&s1);
               func (r, m, doc, n, s1);
               freeService (&s1);
@@ -1449,6 +1453,8 @@
 	    r_inputs = NULL;
 	    r_inputs = getMap (request_inputs, "version");
+#ifdef DEBUG
 	    fprintf(stderr," ** DEBUG %s %d \n",__FILE__,__LINE__);
 	    fflush(stderr);
+#endif
 	    xmlNodePtr n = printWPSHeader(doc,m,"DescribeProcess",
 					  root_nodes[vid][1],(version!=NULL?version->value:"1.0.0"),1);
@@ -1628,9 +1634,4 @@
 			hasVal = 1;
 			setMapInMaps (m, "lenv", "level", "0");
-			/*
-			  #ifdef META_DB
-			  }
-			  #endif
-			*/
 		      }
 		    else
@@ -1726,7 +1727,7 @@
 				  addNestedOutputs(&s1);
 #endif
-				  json_object* jobj=serviceToJson(s1);
+				  /*json_object* jobj=serviceToJson(s1);
 				  const char* jsonStr=json_object_to_json_string_ext(jobj,JSON_C_TO_STRING_PLAIN);
-				  fprintf(stderr,"*** %s %d %s \n",__FILE__,__LINE__,jsonStr);
+				  fprintf(stderr,"*** %s %d %s \n",__FILE__,__LINE__,jsonStr);*/
 
 				  printDescribeProcessForProcess (zooRegistry,m, doc, n, s1);
@@ -1942,8 +1943,12 @@
     dup2 (fileno (stderr), fileno (stdout));
     t = readServiceFile (m, tmps1, &s1, r_inputs->value);
-    inheritance(zooRegistry,&s1);
+    fprintf(stderr,"%d %s %d",t,__FILE__,__LINE__);
+    fflush(stderr);
+    if(t>=0){
+      inheritance(zooRegistry,&s1);
 #ifdef USE_HPC
-    addNestedOutputs(&s1);
-#endif
+      addNestedOutputs(&s1);
+#endif
+    }
     if(zooRegistry!=NULL){
       freeRegistry(&zooRegistry);
@@ -2254,12 +2259,13 @@
 #endif
   int ei = 1;
-  char **orig = 
+  
 #ifdef WIN32
-    GetEnvironmentStrings()
+  LPVOID orig = GetEnvironmentStrings();
+  LPTSTR s = (LPTSTR) orig;
 #else
-    environ
-#endif
-    ;
+  char **orig = environ;
   char *s=*orig;
+#endif
+
   _tmpMaps = createMaps("renv");
   for (; s; ei++) {
@@ -2277,5 +2283,9 @@
       free(tmpName);
     }
+#ifdef WIN32
+    s++;
+#else
     s = *(orig+ei);
+#endif
   }
   if(_tmpMaps->content!=NULL && getMap(_tmpMaps->content,"HTTP_COOKIE")!=NULL){
@@ -2285,4 +2295,5 @@
   freeMaps (&_tmpMaps);
   free (_tmpMaps);
+  
   if(postRequest!=NULL)
     setMapInMaps (m, "renv", "xrequest", postRequest->value);
@@ -2335,4 +2346,7 @@
 	return -1;
       }
+      map* testMap=getMapFromMaps(m,"main","memory");
+      if(testMap!=NULL && strcasecmp(testMap->value,"load")!=0)
+	dumpMapsValuesToFiles(&m,&request_input_real_format);
       loadServiceAndRun (&m, s1, request_inputs, &request_input_real_format,
                          &request_output_real_format, &eres);
@@ -2379,4 +2393,5 @@
       else if (pid == 0)
 	{
+	  eres = SERVICE_ACCEPTED;
 	  //
 	  // son : have to close the stdout, stdin and stderr to let the parent
@@ -2457,5 +2472,7 @@
 	  recordServiceStatus(m);
 #endif
+#ifdef USE_HPC
 	  invokeCallback(m,NULL,NULL,0,0);
+#endif
 	  if(vid==0){
 	    //
@@ -2499,5 +2516,7 @@
 	  free(flenv);
 
+#ifdef USE_HPC
 	  invokeCallback(m,request_input_real_format,NULL,1,0);
+#endif
 	  if(validateRequest(&m,s1,request_inputs, &request_input_real_format,&request_output_real_format,&hInternet)<0){
 	    freeService (&s1);
@@ -2514,5 +2533,7 @@
 #else
 	    recordResponse(m,fbkp1);
+#ifdef USE_HPC
 	    invokeCallback(m,NULL,NULL,7,0);
+#endif
 #endif
 	    unlink (fbkpid);
@@ -2539,7 +2560,12 @@
 	  if(getMapFromMaps(m,"lenv","mapError")!=NULL){
 	    setMapInMaps(m,"lenv","message",_("Issue with geographic data"));
+#ifdef USE_HPC
 	    invokeCallback(m,NULL,NULL,7,0);
+#endif
 	    eres=-1;//SERVICE_FAILED;
 	  }else{
+	    map* testMap=getMapFromMaps(m,"main","memory");
+	    if(testMap!=NULL && strcasecmp(testMap->value,"load")!=0)
+	      dumpMapsValuesToFiles(&m,&request_input_real_format);
 	    loadServiceAndRun (&m, s1, request_inputs,
 			       &request_input_real_format,
@@ -2567,5 +2593,5 @@
   rewind(stdout);
 
-  fprintf(stderr,"%s %d %d\n",__FILE__,__LINE__,eres);
+  //fprintf(stderr,"%s %d %d\n",__FILE__,__LINE__,eres);
 
   if (eres != -1)
@@ -2592,6 +2618,7 @@
     {
       if (eres == SERVICE_SUCCEEDED)
+#ifdef USE_HPC
 	invokeCallback(m,NULL,request_output_real_format,5,1);
-
+#endif
       fflush(stderr);
       fflush(stdout);
@@ -2622,5 +2649,7 @@
       recordResponse(m,fbkp1);
       if (eres == SERVICE_SUCCEEDED)
+#ifdef USE_HPC
 	invokeCallback(m,NULL,request_output_real_format,6,0);
+#endif
 #endif
       freeMaps(&bmap);
