- Timestamp:
- Feb 23, 2009 1:34:39 PM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 43220
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/ldr.h
r17010 r17019 50 50 RTDECL(const char *) RTLdrGetSuff(void); 51 51 52 RTDECL(bool) RTLdrIsLoadable(const char *pszName); 52 /** 53 * Checks if a library is loadable or not. 54 * 55 * This may attempt load and unload the library. 56 * 57 * @returns true/false accordingly. 58 * @param pszFilename Image filename. 59 */ 60 RTDECL(bool) RTLdrIsLoadable(const char *pszFilename); 53 61 54 62 /** -
trunk/src/VBox/Runtime/common/ldr/ldr.cpp
r17010 r17019 61 61 62 62 63 /*******************************************************************************64 * Internal Functions *65 *******************************************************************************/66 63 67 RTDECL(bool) RTLdrIsLoadable(const char *pszName) 64 /** 65 * Checks if a library is loadable or not. 66 * 67 * This may attempt load and unload the library. 68 * 69 * @returns true/false accordingly. 70 * @param pszFilename Image filename. 71 */ 72 RTDECL(bool) RTLdrIsLoadable(const char *pszFilename) 68 73 { 69 /*70 * Quick validation.71 */72 if (!pszName)73 return false;74 75 bool fLoadable = false;76 RTLDRMOD hLib;77 74 /* 78 75 * Try to load the library. 79 76 */ 80 int rc = RTLdrLoad(pszName, &hLib); 77 RTLDRMOD hLib; 78 int rc = RTLdrLoad(pszFilename, &hLib); 81 79 if (RT_SUCCESS(rc)) 82 80 { 83 fLoadable = true;84 81 RTLdrClose(hLib); 82 return true; 85 83 } 86 return f Loadable;84 return false; 87 85 } 86 88 87 89 88 /**
Note:
See TracChangeset
for help on using the changeset viewer.