locationrequestmgmt/locationserver/src/EPos_CPosServer.cpp
branchRCL_3
changeset 52 29dbbeac905d
parent 0 9cfd9a3ee49c
child 54 0c2046328c85
--- a/locationrequestmgmt/locationserver/src/EPos_CPosServer.cpp	Wed Jun 09 11:13:47 2010 +0300
+++ b/locationrequestmgmt/locationserver/src/EPos_CPosServer.cpp	Thu Aug 19 11:17:26 2010 +0300
@@ -134,17 +134,56 @@
  */
 void CPosServer::ConstructL() 
     {
-    TBool LocationManagementSupported = EFalse;
+#if defined __WINSCW__ && defined SYMBIAN_CELLMO_CENTRIC
+	TBool LocationManagementSupported = EFalse;
+#else
 #ifdef SYMBIAN_FEATURE_MANAGER
-	LocationManagementSupported = CFeatureDiscovery::IsFeatureSupportedL(NFeature::KLocationManagement);
+	TBool LocationManagementSupported = CFeatureDiscovery::IsFeatureSupportedL(NFeature::KLocationManagement);
 #else
 	__ASSERT_ALWAYS(EFalse, User::Invariant());	// Would happen on older versions of symbian OS if this code ever backported
-#endif      
+#endif // SYMBIAN_FEATURE_MANAGER
+#endif // __WINSCW__ && defined SYMBIAN_CELLMO_CENTRIC
+
+	
+#if defined __WINSCW__	
+	if(LocationManagementSupported && !FindRootProcess())
+		{
+        _LIT(KLbsRootFileName, "\\sys\\bin\\lbsroot.exe");
+	    _LIT(KLbsRootProcessName, "lbsroot.exe");
+	    _LIT(KLbsCommandLine, "");
+        RProcess process;
+        TInt r=process.Create(KLbsRootProcessName,KLbsCommandLine);
+        if (r!=KErrNone)
+            {
+            User::Leave(r);
+            }
+        TRequestStatus stat;
+        process.Rendezvous(stat);
+        if (stat!=KRequestPending)
+            {
+            process.Kill(0);
+            }
+        else
+            {
+            process.Resume();
+            }
+        User::WaitForRequest(stat);
+        r=(process.ExitType()==EExitPanic) ? KErrGeneral : stat.Int();
+        
+        process.Close();
+        if (r!=KErrNone)
+            {
+            User::Leave(r);
+            }
+		}
+#endif // WINSCW
+
     // make sure that root process is running 
     if(LocationManagementSupported && !FindRootProcess())
     	{
     	User::Leave(KErrNotReady);
     	}
+	
     // Backup listener
     DEBUG_TRACE("Checking for backup or restore...", __LINE__)
     iBackupListener = CPosBackupListener::NewL();