VirtualBox

vbox的更動 35183 路徑 trunk/src/VBox/Runtime/r3


忽略:
時間撮記:
2010-12-16 下午01:59:44 (14 年 以前)
作者:
vboxsync
訊息:

RTLdrLoadEx use RTERRINFO.

位置:
trunk/src/VBox/Runtime/r3
檔案:
修改 2 筆資料

圖例:

未更動
新增
刪除
  • trunk/src/VBox/Runtime/r3/posix/ldrNative-posix.cpp

    r35152 r35183  
    4141
    4242
    43 int rtldrNativeLoad(const char *pszFilename, uintptr_t *phHandle, uint32_t fFlags, char *pszError, size_t cbError)
     43int rtldrNativeLoad(const char *pszFilename, uintptr_t *phHandle, uint32_t fFlags, PRTERRINFO pErrInfo)
    4444{
    4545    /*
     
    6060        char *psz = (char *)alloca(cch + sizeof(s_szSuff));
    6161        if (!psz)
    62             return VERR_NO_MEMORY;
     62            return RTErrInfoSet(pErrInfo, VERR_NO_MEMORY, "alloca failed");
    6363        memcpy(psz, pszFilename, cch);
    6464        memcpy(psz + cch, s_szSuff, sizeof(s_szSuff));
     
    8282
    8383    const char *pszDlError = dlerror();
    84     if (pszError)
    85         RTStrCopy(pszError, cbError, pszDlError);
     84    RTErrInfoSet(pErrInfo, VERR_FILE_NOT_FOUND, pszDlError);
    8685    LogRel(("rtldrNativeLoad: dlopen('%s', RTLD_NOW | RTLD_LOCAL) failed: %s\n", pszFilename, pszDlError));
    8786    return VERR_FILE_NOT_FOUND;
  • trunk/src/VBox/Runtime/r3/win/ldrNative-win.cpp

    r35152 r35183  
    4040
    4141
    42 int rtldrNativeLoad(const char *pszFilename, uintptr_t *phHandle, uint32_t fFlags, char *pszError, size_t cbError)
     42int rtldrNativeLoad(const char *pszFilename, uintptr_t *phHandle, uint32_t fFlags, PRTERRINFO pErrInfo)
    4343{
    4444    Assert(sizeof(*phHandle) >= sizeof(HMODULE));
     
    5353        char *psz = (char *)alloca(cch + sizeof(".DLL"));
    5454        if (!psz)
    55             return VERR_NO_MEMORY;
     55            return RTErrInfoSet(pErrInfo, VERR_NO_MEMORY, "alloca failed");
    5656        memcpy(psz, pszFilename, cch);
    5757        memcpy(psz + cch, ".DLL", sizeof(".DLL"));
     
    7474    DWORD dwErr = GetLastError();
    7575    int   rc    = RTErrConvertFromWin32(dwErr);
    76     if (cbError)
    77         RTStrPrintf(pszError, cbError, "GetLastError=%u", dwErr);
    78     return rc;
     76    return RTErrInfoSetF(pErrInfo, rc, "GetLastError=%u", dwErr);
    7977}
    8078
注意: 瀏覽 TracChangeset 來幫助您使用更動檢視器

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