_fullpath_dbg, _wfullpath_dbg

_fullpath 的版本, _wfullpath 使用 偵錯版本的 malloc 來配置記憶體。

語法

char *_fullpath_dbg(
   char *absPath,
   const char *relPath,
   size_t maxLength,
   int blockType,
   const char *filename,
   int linenumber
);
wchar_t *_wfullpath_dbg(
   wchar_t *absPath,
   const wchar_t *relPath,
   size_t maxLength,
   int blockType,
   const char *filename,
   int linenumber
);

參數

absPath
包含絕對路徑名稱或完整路徑名稱之緩衝區的指標,或為 NULL

relPath
相對路徑名稱。

maxLength
絕對路徑名稱緩衝區的最大長度 (absPath)。 此長度針對 _fullpath_dbg 使用位元組,但針對 wchar_t 使用寬字元 (_wfullpath_dbg)。

blockType
要求的記憶體區塊類型:_CLIENT_BLOCK_NORMAL_BLOCK

filename
要求配置作業之原始程式檔的名稱的指標,或為 NULL

linenumber
原始程式檔中的行號,其中要求配置作業,或為 NULL

傳回值

每個函式會傳回包含絕對路徑名稱之緩衝區的指標 (absPath)。 如果發生錯誤(例如,如果傳入 relPath 的值包含無效或找不到的磁碟機號,或建立的絕對路徑名稱長度 absPath 大於 maxLength ),則函式會傳 NULL 回 。

備註

和 函 _fullpath_dbg 式與 和 _wfullpath 函式相同 _fullpath ,但定義時 _DEBUG ,這些函式會使用 的偵錯版本 malloc_malloc_dbg ,在 傳遞為第一個參數時 NULL 配置 _wfullpath_dbg 記憶體。 如需 偵錯功能 _malloc_dbg 的詳細資訊,請參閱 _malloc_dbg

在大部分情況下,您不需要明確呼叫這些函式。 但您可以定義 _CRTDBG_MAP_ALLOC 旗標。 定義 _CRTDBG_MAP_ALLOC 時,呼叫 _fullpath_wfullpath 會分別重新對應至 _fullpath_dbg_wfullpath_dbg,且 blockType 會設為 _NORMAL_BLOCK。 因此,除非您想要將堆積區塊標示為 _CLIENT_BLOCK ,否則您不需要明確地呼叫這些函式。 如需詳細資訊,請參閱偵錯堆積上的區塊類型

泛型文字常式對應

Tchar.h 常式 _UNICODE_MBCS 未定義 _MBCS 定義 _UNICODE 定義
_tfullpath_dbg _fullpath_dbg _fullpath_dbg _wfullpath_dbg

需求

函式 必要的標頭
_fullpath_dbg <crtdbg.h>
_wfullpath_dbg <crtdbg.h>

如需相容性詳細資訊,請參閱相容性

另請參閱

檔案處理
_fullpath, _wfullpath
堆積配置函式的偵錯版本