Changeset 7761 in vbox
- Timestamp:
- Apr 5, 2008 6:32:54 PM (17 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/ConsoleVRDPServer.cpp
r7257 r7761 1928 1928 1929 1929 #ifdef VBOX_VRDP 1930 static int loadLibrary (const char *pszName, PRTLDRMOD phLdrMod)1931 {1932 /* Load the specified library.1933 * If the full path is specified, only this path is used.1934 * If only library name is specified, then try to load it from:1935 * - RTPathAppPrivateArch1936 * - RTPathSharedLibs (legacy)1937 */1938 int rc = VERR_FILE_NOT_FOUND;1939 1940 if (RTPathHavePath (pszName))1941 {1942 /* Path specified, respect it. */1943 rc = RTLdrLoad (pszName, phLdrMod);1944 }1945 else1946 {1947 /* Try default locations. */1948 int i;1949 for (i = 0;; i++)1950 {1951 char szBase[RTPATH_MAX];1952 1953 /* Get the appropriate base path. */1954 if (i == 0)1955 {1956 rc = RTPathAppPrivateArch(szBase, sizeof (szBase));1957 }1958 else if (i == 1)1959 {1960 rc = RTPathSharedLibs(szBase, sizeof (szBase));1961 }1962 else1963 {1964 break;1965 }1966 1967 if (RT_SUCCESS(rc))1968 {1969 char szPath[RTPATH_MAX];1970 1971 /* szPath = pszBase + pszName */1972 rc = RTPathAbsEx(szBase, pszName, szPath, sizeof (szPath));1973 1974 if (RT_SUCCESS(rc))1975 {1976 rc = RTLdrLoad(szPath, phLdrMod);1977 1978 if (RT_SUCCESS(rc))1979 {1980 /* Successfully loaded a library. */1981 LogFlow(("Library loaded: [%s]\n", szPath));1982 break;1983 }1984 }1985 }1986 }1987 }1988 1989 return rc;1990 }1991 1992 1930 /* note: static function now! */ 1993 1931 bool ConsoleVRDPServer::loadVRDPLibrary (void) … … 1997 1935 if (!mVRDPLibrary) 1998 1936 { 1999 rc = loadLibrary("VBoxVRDP", &mVRDPLibrary);1937 rc = RTLdrLoadAppSharedLib ("VBoxVRDP", &mVRDPLibrary); 2000 1938 2001 1939 if (VBOX_SUCCESS(rc)) -
trunk/src/VBox/Main/hgcm/HGCM.cpp
r6985 r7761 234 234 235 235 236 static int loadLibrary (const char *pszName, PRTLDRMOD phLdrMod)237 {238 /* Load the specified library.239 * If the full path is specified, only this path is used.240 * If only library name is specified, then try to load it from:241 * - RTPathAppPrivateArch242 * - RTPathSharedLibs (legacy)243 */244 int rc = VINF_SUCCESS;245 246 if (RTPathHavePath (pszName))247 {248 /* Path specified, respect it. */249 rc = RTLdrLoad (pszName, phLdrMod);250 }251 else252 {253 /* Try default locations. */254 char szBase[RTPATH_MAX];255 256 /* Get the appropriate base path. */257 int i;258 for (i = 0; i < 2; i++)259 {260 if (i == 0)261 {262 rc = RTPathAppPrivateArch(szBase, sizeof (szBase));263 }264 else265 {266 rc = RTPathSharedLibs(szBase, sizeof (szBase));267 }268 269 if (RT_SUCCESS(rc))270 {271 char szPath[RTPATH_MAX];272 273 /* szPath = pszBase + pszName */274 rc = RTPathAbsEx (szBase, pszName, szPath, sizeof (szPath));275 276 if (RT_SUCCESS(rc))277 {278 rc = RTLdrLoad (szPath, phLdrMod);279 280 if (RT_SUCCESS(rc))281 {282 /* Successfully loaded a library. */283 break;284 }285 }286 }287 }288 }289 290 return rc;291 }292 293 236 /** Helper function to load a local service DLL. 294 237 * … … 304 247 } 305 248 306 int rc = VINF_SUCCESS; 307 308 rc = loadLibrary (m_pszSvcLibrary, &m_hLdrMod); 249 int rc = RTLdrLoadAppSharedLib (m_pszSvcLibrary, &m_hLdrMod); 309 250 310 251 if (VBOX_SUCCESS(rc))
Note:
See TracChangeset
for help on using the changeset viewer.