stif/TestServer/src/TestServerClient.cpp
changeset 17 67c6ff54ec25
parent 13 33016869e0dd
child 32 8f8df8006c40
--- a/stif/TestServer/src/TestServerClient.cpp	Mon May 03 13:58:41 2010 +0300
+++ b/stif/TestServer/src/TestServerClient.cpp	Fri May 14 17:25:03 2010 +0300
@@ -120,6 +120,15 @@
     do
         {
         semName.Format(_L("%S%d"), &semaphoreName, x);
+        if (semName.Length() > KMaxKernelName)
+            {
+            // if the cfg file name is larger than maximum length of acceptable length of semaphore .
+            RDebug::Print(_L("Test Module name or Configuration File name is too long."));
+            
+            semName.Close();
+            return KErrBadName;
+            }
+        
         ret = startSemaphore.CreateGlobal(semName, 0);
         RDebug::Print(_L("RTestServer::Connect() Creating global semaphore [%S] with result [%d]"), &semName, ret);
         if(ret != KErrAlreadyExists)
@@ -153,7 +162,7 @@
     // Data to be passed to new process. It will contain module name and synchronization semaphore name separated with space.
     // I.e. it will be: "mymodule startupSemaphore0"
     RBuf data; 
-    ret = data.Create(KMaxName);
+    ret = data.Create(KMaxFileName);
     if(ret != KErrNone)
         {
         RDebug::Print(_L("RTestServer::Connect() Could not create buffer for data to be passed to process [%d]"), ret);