Index: /trunk/zoo-project/zoo-kernel/response_print.c
===================================================================
--- /trunk/zoo-project/zoo-kernel/response_print.c	(revision 942)
+++ /trunk/zoo-project/zoo-kernel/response_print.c	(revision 943)
@@ -1001,5 +1001,5 @@
  */
 void printDescribeProcessForProcess(registry *reg, maps* m,xmlDocPtr doc,xmlNodePtr nc,service* serv){
-  xmlNsPtr ns,ns_ows,ns_xlink;
+  xmlNsPtr ns,ns_ows,ns_xlink; 
   xmlNodePtr n,nc1;
   xmlNodePtr nc2 = NULL;
Index: /trunk/zoo-project/zoo-kernel/service.c
===================================================================
--- /trunk/zoo-project/zoo-kernel/service.c	(revision 942)
+++ /trunk/zoo-project/zoo-kernel/service.c	(revision 943)
@@ -1809,2 +1809,22 @@
 // zooLogMsg(NULL, getLastErrorMessage()); 
 // zooLogMsg("log.txt", getLastErrorMessage()); 
+
+#ifdef WIN32
+#ifndef USE_MS
+char *strcasestr (char const *a, char const *b)
+  {
+    char *x = zStrdup (a);
+    char *y = zStrdup (b);
+ 
+      x = _strlwr (x);
+      y = _strlwr (y);
+    char *pos = strstr (x, y);
+    char *ret = pos == NULL ? NULL : (char *) (a + (pos - x));
+      free (x);
+      free (y);
+      return ret;
+  };
+#else
+   ;
+#endif
+#endif
Index: /trunk/zoo-project/zoo-kernel/service_internal_python.c
===================================================================
--- /trunk/zoo-project/zoo-kernel/service_internal_python.c	(revision 942)
+++ /trunk/zoo-project/zoo-kernel/service_internal_python.c	(revision 943)
@@ -236,5 +236,5 @@
 	  SetEnvironmentVariable("PYTHONHOME", home->value);
   }
-  char buffer[128];        
+  char buffer[128];
 #endif  
   if(hasToClean>0)
@@ -254,5 +254,5 @@
 #else
   init_zoo();
-#endif  
+#endif 
   mainstate = PyThreadState_Swap(NULL);
   PyEval_ReleaseLock();
@@ -285,6 +285,7 @@
     errorException (m, "Unable to parse serviceProvider please check your zcfg file.", "NoApplicableCode", NULL);
     exit(-1);
-  }  
-  pModule = PyImport_Import(pName);    
+  } 
+
+  pModule = PyImport_Import(pName);
   int res=SERVICE_FAILED;
   if (pModule != NULL) {
@@ -301,5 +302,5 @@
       PyTuple_SetItem(pArgs, 1, (PyObject *)arg2);
       PyTuple_SetItem(pArgs, 2, (PyObject *)arg3);
-      pValue = PyObject_CallObject(pFunc, pArgs);	  
+      pValue = PyObject_CallObject(pFunc, pArgs);
       if (pValue != NULL) {
 	res=PyInt_AsLong(pValue);
@@ -335,5 +336,5 @@
 #endif
   PyThreadState_Swap(mainstate);
-  Py_Finalize();  
+  Py_Finalize();
   return res;
 }
Index: /trunk/zoo-project/zoo-kernel/zoo_service_loader.c
===================================================================
--- /trunk/zoo-project/zoo-kernel/zoo_service_loader.c	(revision 942)
+++ /trunk/zoo-project/zoo-kernel/zoo_service_loader.c	(revision 943)
@@ -509,5 +509,5 @@
 #ifdef WIN32
       HINSTANCE so =
-        LoadLibraryEx (tmps1, NULL, LOAD_WITH_ALTERED_SEARCH_PATH);
+        LoadLibraryEx (tmps1, NULL, LOAD_WITH_ALTERED_SEARCH_PATH);						
 #else
       void *so = dlopen (tmps1, RTLD_LAZY);
@@ -974,5 +974,5 @@
 runRequest (map ** inputs)
 {
- 
+	
 #ifndef USE_GDB
 #ifndef WIN32
@@ -1282,5 +1282,4 @@
 
 
-
   service *s1;
   int scount = 0;
@@ -1327,7 +1326,7 @@
 #endif
   }
-
+  
   if (strncasecmp (REQUEST, "GetCapabilities", 15) == 0)
-    {
+    {	
 #ifdef DEBUG
       dumpMap (r_inputs);
@@ -1397,5 +1396,5 @@
     }
   else
-    {
+    {	  
       r_inputs = getMap (request_inputs, "JobId");
       if(reqId>nbReqIdentifier){
@@ -1533,5 +1532,5 @@
 			  s1 = createService();
 			  t = readServiceFile (m, import->value, &s1, import->name);
-                
+
 			  if (t < 0) // failure reading zcfg
 			    {
@@ -1589,8 +1588,8 @@
 			/**
 			 * No support for dot in service name stored in metadb!?
-			 #ifdef META_DB
+		//	 #ifdef META_DB
 			 service* s2=extractServiceFromDb(m,tmpMapI->value,0);
 			 if(s2==NULL){
-			 #endif
+		//	 #endif
 			*/
 			s1 = createService();
@@ -1811,5 +1810,5 @@
 	  }
 	else if (strncasecmp (REQUEST, "Execute", strlen (REQUEST)) != 0)
-	  {
+	  {	  
 	    map* version=getMapFromMaps(m,"main","rversion");
 	    int vid=getVersionId(version->value);	    
@@ -1868,5 +1867,5 @@
       }
     }
-
+	
   map *postRequest = NULL;
   postRequest = getMap (request_inputs, "xrequest");
@@ -1951,5 +1950,5 @@
 			       "InternalError", NULL);
       }
-
+  
     int saved_stdout = zDup (fileno (stdout));
     zDup2 (fileno (stderr), fileno (stdout));
@@ -2084,5 +2083,5 @@
   dumpMap (request_inputs);
 #endif
-
+  
   map *status = getMap (request_inputs, "status");
   if(vid==0){
@@ -2165,5 +2164,5 @@
   int eres = SERVICE_STARTED;
   int cpid = zGetpid ();
-
+  
   // Create a map containing a copy of the request map
   maps *_tmpMaps = createMaps("request");
@@ -2219,5 +2218,5 @@
   else
     addToMap (_tmpMaps->content, "soap", "false");
-
+  
   // Parse the session file and add it to the main maps
   char* originalCookie=NULL;
@@ -2270,23 +2269,35 @@
 #endif
   int ei = 1;
-  
+ 
+  _tmpMaps = createMaps("renv");	
+
 #ifdef WIN32
   LPVOID orig = GetEnvironmentStrings();
   LPTSTR s = (LPTSTR) orig;
+  
+  while (*s != NULL) {
+    char* env = strdup(s);
+    char* delim = strchr(env,'=');
+    if (delim != NULL) {
+      char* val = delim+1;
+      *delim = '\0';		
+      if(_tmpMaps->content == NULL) {
+        _tmpMaps->content = createMap(env,val);
+      }
+      else {
+        addToMap(_tmpMaps->content,env,val);
+      }			
+    }
+    s += strlen(s)+1;
+  } 
+  FreeEnvironmentStrings((LPCH)orig);	
 #else
   char **orig = environ;
   char *s=*orig;
-#endif
-
-  _tmpMaps = createMaps("renv");
-if(orig!=NULL)
-  for (; 
-#ifdef WIN32
-       *s;
-       s++
-#else
+  
+  if(orig!=NULL)
+    for (; 
        s;
        ei++
-#endif
        ) {
     if(strstr(s,"=")!=NULL && strlen(strstr(s,"="))>1){
@@ -2303,8 +2314,8 @@
       free(tmpName);
     }
-#ifndef WIN32
     s = *(orig+ei);
-#endif
-  }
+  }  
+#endif
+ 
   if(_tmpMaps->content!=NULL && getMap(_tmpMaps->content,"HTTP_COOKIE")!=NULL){
     addToMap(_tmpMaps->content,"HTTP_COOKIE1",&cgiCookie[0]);
@@ -2313,7 +2324,5 @@
   freeMaps (&_tmpMaps);
   free (_tmpMaps);
-#ifdef WIN32
-  FreeEnvironmentStrings((LPCH)orig);
-#endif
+
   if(postRequest!=NULL)
     setMapInMaps (m, "renv", "xrequest", postRequest->value);
@@ -2351,4 +2360,5 @@
   if (status == NULLMAP)
     {
+	  
       if(validateRequest(&m,s1,request_inputs, &request_input_real_format,&request_output_real_format,&hInternet)<0){
 	freeService (&s1);
