VirtualBox

Changeset 17010 in vbox


Ignore:
Timestamp:
Feb 23, 2009 12:25:06 PM (16 years ago)
Author:
vboxsync
Message:

iprt: RTLdrIsLoadable for checking if an dynamically library could be loaded.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/ldr.h

    r16933 r17010  
    4949 */
    5050RTDECL(const char *) RTLdrGetSuff(void);
     51
     52RTDECL(bool) RTLdrIsLoadable(const char *pszName);
    5153
    5254/**
  • trunk/src/VBox/Runtime/common/ldr/ldr.cpp

    r8245 r17010  
    6565*******************************************************************************/
    6666
     67RTDECL(bool) RTLdrIsLoadable(const char *pszName)
     68{
     69    /*
     70     * Quick validation.
     71     */
     72    if (!pszName)
     73        return false;
     74
     75    bool fLoadable = false;
     76    RTLDRMOD hLib;
     77    /*
     78     * Try to load the library.
     79     */
     80    int rc = RTLdrLoad(pszName, &hLib);
     81    if (RT_SUCCESS(rc))
     82    {
     83        fLoadable = true;
     84        RTLdrClose(hLib);
     85    }
     86    return fLoadable;
     87}
    6788
    6889/**
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette