SHLocalStrDupA function (shlwapi.h)
Makes a copy of a string in newly allocated memory.
HRESULT SHLocalStrDupA( PCSTR psz, [out, optional] PSTR *ppsz );
A pointer to a null-terminated, Unicode string to be copied.
[out, optional] ppsz
The address of a pointer to an allocated string that, when this function returns successfully, receives the result. SHLocalStrDup allocates memory for this string with LocalAlloc. You should free the string with LocalFree when it is no longer needed.
If this function succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.
The shlwapi.h header defines SHLocalStrDup as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.
|Minimum supported client||Windows Vista [desktop apps only]|
|Minimum supported server||Windows Server 2008 [desktop apps only]|