_fullpath_dbg, _wfullpath_dbg

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at _fullpath_dbg, _wfullpath_dbg.

Versions of _fullpath, _wfullpath that use the debug version of malloc to allocate memory.

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   
);  

Parameters

absPath
Pointer to a buffer containing the absolute or full path name, or NULL.

relPath
Relative path name.

maxLength
Maximum length of the absolute path name buffer (absPath). This length is in bytes for _fullpath but in wide characters (wchar_t) for _wfullpath.

blockType
Requested type of memory block: _CLIENT_BLOCK or _NORMAL_BLOCK.

filename
Pointer to the name of the source file that requested allocation operation or NULL.

linenumber
Line number in the source file where the allocation operation was requested or NULL.

Each function returns a pointer to a buffer containing the absolute path name (absPath). If there is an error (for example, if the value passed in relPath includes a drive letter that is not valid or cannot be found, or if the length of the created absolute path name (absPath) is greater than maxLength) the function returns NULL.

The _fullpath_dbg and _wfullpath_dbg functions are identical to _fullpath and _wfullpath except that, when _DEBUGis defined, these functions use the debug version of malloc, _malloc_dbg, to allocate memory if NULL is passed as the first parameter. For information on the debugging features of _malloc_dbg, see _malloc_dbg.

You do not need to call these functions explicitly in most cases. Instead, you can define the _CRTDBG_MAP_ALLOC flag. When _CRTDBG_MAP_ALLOCis defined, calls to _fullpath and _wfullpathare remapped to _fullpath_dbg and _wfullpath_dbg, respectively, with the blockType set to _NORMAL_BLOCK. Thus, you do not need to call these functions explicitly unless you want to mark the heap blocks as _CLIENT_BLOCK. For more information, see Types of blocks on the debug heap.

Generic-Text Routine Mappings

Tchar.h routine_UNICODE and _MBCS not defined_MBCS defined_UNICODE defined
_tfullpath_dbg_fullpath_dbg_fullpath_dbg_wfullpath_dbg
FunctionRequired header
_fullpath_dbg<crtdbg.h>
_wfullpath_dbg<crtdbg.h>

For more compatibility information, see Compatibility in the Introduction.

Create

File Handling
_fullpath, _wfullpath
Debug Versions of Heap Allocation Functions

Show: