Changeset 7257 in vbox
- Timestamp:
- Mar 4, 2008 6:26:33 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/ConsoleVRDPServer.cpp
r7256 r7257 26 26 #include <iprt/asm.h> 27 27 #include <iprt/ldr.h> 28 #include <iprt/param.h> 29 #include <iprt/path.h> 28 30 #include <iprt/alloca.h> 29 31 … … 1926 1928 1927 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 * - RTPathAppPrivateArch 1936 * - 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 else 1946 { 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 else 1963 { 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 1928 1992 /* note: static function now! */ 1929 1993 bool ConsoleVRDPServer::loadVRDPLibrary (void) … … 1933 1997 if (!mVRDPLibrary) 1934 1998 { 1935 rc = RTLdrLoad("VBoxVRDP", &mVRDPLibrary);1999 rc = loadLibrary("VBoxVRDP", &mVRDPLibrary); 1936 2000 1937 2001 if (VBOX_SUCCESS(rc))
Note:
See TracChangeset
for help on using the changeset viewer.