stif/TestServer/src/TestServerClient.cpp
branchRCL_3
changeset 12 d27dfa8884ad
parent 7 8a14024f954a
child 16 8f8df8006c40
--- a/stif/TestServer/src/TestServerClient.cpp	Tue Apr 27 18:14:33 2010 +0300
+++ b/stif/TestServer/src/TestServerClient.cpp	Tue May 11 17:39:09 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);