Changeset 3861 in vbox for trunk/src/VBox/Main
- Timestamp:
- Jul 26, 2007 9:15:14 AM (18 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/ConsoleImpl.cpp
r3833 r3861 4656 4656 #ifdef VBOX_WITH_XPCOM 4657 4657 // VBoxC is located in the components subdirectory 4658 char szPath Program[RTPATH_MAX + sizeof("/components/VBoxC")];4659 rc = RTPath Program(szPathProgram, RTPATH_MAX);AssertRC(rc);4660 strcat(szPath Program, "/components/VBoxC");4661 rc = CFGMR3InsertString(pMod, "Path", szPath Program);RC_CHECK();4658 char szPathVBoxC[RTPATH_MAX]; 4659 rc = RTPathAppPrivateArch(szPathVBoxC, RTPATH_MAX - sizeof("/components/VBoxC")); AssertRC(rc); 4660 strcat(szPathVBoxC, "/components/VBoxC"); 4661 rc = CFGMR3InsertString(pMod, "Path", szPathVBoxC); RC_CHECK(); 4662 4662 #else 4663 4663 rc = CFGMR3InsertString(pMod, "Path", "VBoxC"); RC_CHECK(); -
trunk/src/VBox/Main/MachineImpl.cpp
r3668 r3861 2788 2788 /* get the path to the executable */ 2789 2789 char path [RTPATH_MAX]; 2790 RTPath Program(path, RTPATH_MAX);2790 RTPathAppPrivateArch (path, RTPATH_MAX); 2791 2791 size_t sz = strlen (path); 2792 2792 path [sz++] = RTPATH_DELIMITER; -
trunk/src/VBox/Main/glue/initterm.cpp
r3387 r3861 64 64 DirectoryServiceProvider() 65 65 : mCompRegLocation (NULL), mXPTIDatLocation (NULL) 66 , mComponentDirLocation (NULL), mCurrProcDirLocation (NULL) 66 67 {} 67 68 … … 69 70 70 71 HRESULT init (const char *aCompRegLocation, 71 const char *aXPTIDatLocation); 72 const char *aXPTIDatLocation, 73 const char *aComponentDirLocation, 74 const char *aCurrProcDirLocation); 72 75 73 76 NS_DECL_NSIDIRECTORYSERVICEPROVIDER … … 77 80 char *mCompRegLocation; 78 81 char *mXPTIDatLocation; 82 char *mComponentDirLocation; 83 char *mCurrProcDirLocation; 79 84 }; 80 85 … … 92 97 RTStrFree (mXPTIDatLocation); 93 98 mXPTIDatLocation = NULL; 99 } 100 if (mComponentDirLocation) 101 { 102 RTStrFree (mComponentDirLocation); 103 mComponentDirLocation = NULL; 104 } 105 if (mCurrProcDirLocation) 106 { 107 RTStrFree (mCurrProcDirLocation); 108 mCurrProcDirLocation = NULL; 94 109 } 95 110 } … … 101 116 HRESULT 102 117 DirectoryServiceProvider::init (const char *aCompRegLocation, 103 const char *aXPTIDatLocation) 118 const char *aXPTIDatLocation, 119 const char *aComponentDirLocation, 120 const char *aCurrProcDirLocation) 104 121 { 105 122 AssertReturn (aCompRegLocation, NS_ERROR_INVALID_ARG); … … 109 126 if (RT_SUCCESS (vrc)) 110 127 vrc = RTStrUtf8ToCurrentCP (&mXPTIDatLocation, aXPTIDatLocation); 128 if (RT_SUCCESS (vrc) && aComponentDirLocation) 129 vrc = RTStrUtf8ToCurrentCP (&mComponentDirLocation, aComponentDirLocation); 130 if (RT_SUCCESS (vrc) && aCurrProcDirLocation) 131 vrc = RTStrUtf8ToCurrentCP (&mCurrProcDirLocation, aCurrProcDirLocation); 111 132 112 133 return RT_SUCCESS (vrc) ? NS_OK : NS_ERROR_OUT_OF_MEMORY; … … 130 151 else if (strcmp (aProp, NS_XPCOM_XPTI_REGISTRY_FILE) == 0) 131 152 fileLocation = mXPTIDatLocation; 153 else if (mComponentDirLocation && strcmp (aProp, NS_XPCOM_COMPONENT_DIR) == 0) 154 fileLocation = mComponentDirLocation; 155 else if (mCurrProcDirLocation && strcmp (aProp, NS_XPCOM_CURRENT_PROCESS_DIR) == 0) 156 fileLocation = mCurrProcDirLocation; 132 157 else 133 158 return NS_ERROR_FAILURE; … … 185 210 /* prepare paths for registry files */ 186 211 char homeDir [RTPATH_MAX]; 212 char privateArchDir [RTPATH_MAX]; 187 213 int vrc = GetVBoxUserHomeDirectory (homeDir, sizeof (homeDir)); 188 214 if (RT_SUCCESS (vrc)) 215 vrc = RTPathAppPrivateArch (privateArchDir, sizeof (privateArchDir)); 216 if (RT_SUCCESS (vrc)) 189 217 { 190 218 char compReg [RTPATH_MAX]; 191 219 char xptiDat [RTPATH_MAX]; 220 char compDir [RTPATH_MAX]; 192 221 193 222 RTStrPrintf (compReg, sizeof (compReg), "%s%c%s", … … 195 224 RTStrPrintf (xptiDat, sizeof (xptiDat), "%s%c%s", 196 225 homeDir, RTPATH_DELIMITER, "xpti.dat"); 226 RTStrPrintf (compDir, sizeof (compDir), "%s%c/components", 227 privateArchDir, RTPATH_DELIMITER); 197 228 198 229 dsProv = new DirectoryServiceProvider(); 199 230 if (dsProv) 200 rc = dsProv->init (compReg, xptiDat );231 rc = dsProv->init (compReg, xptiDat, compDir, privateArchDir); 201 232 else 202 233 rc = NS_ERROR_OUT_OF_MEMORY;
Note:
See TracChangeset
for help on using the changeset viewer.