VirtualBox

忽略:
時間撮記:
2008-8-29 下午04:52:20 (16 年 以前)
作者:
vboxsync
訊息:

IPRT: Implemented RTR3Init*WithProgramPath. Added RTPathParse. Cleaned up the RTPathProgram and RTProcGetExecutableName implementations.

檔案:
修改 1 筆資料

圖例:

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

    r8245 r11836  
    3737#include <iprt/assert.h>
    3838#include <iprt/err.h>
     39#include <iprt/string.h>
    3940#include "internal/process.h"
    4041#include "internal/thread.h"
     
    9495}
    9596
     97
     98RTR3DECL(char *) RTProcGetExecutableName(char *pszExecName, size_t cchExecName)
     99{
     100    AssertReturn(g_szrtProcExePath[0] != '\0', NULL);
     101
     102    /*
     103     * Calc the length and check if there is space before copying.
     104     */
     105    size_t cch = g_cchrtProcExePath;
     106    if (cch <= cchExecName)
     107    {
     108        memcpy(pszExecName, g_szrtProcExePath, cch);
     109        pszExecName[cch] = '\0';
     110        return pszExecName;
     111    }
     112
     113    AssertMsgFailed(("Buffer too small (%zu <= %zu)\n", cchExecName, cch));
     114    return NULL;
     115}
     116
注意: 瀏覽 TracChangeset 來幫助您使用更動檢視器

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