_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> |
如需相容性詳細資訊,請參閱相容性。