Skip to content

Latest commit

 

History

History
80 lines (64 loc) · 2.5 KB

nf-shlwapi-shlocalstrdupa.md

File metadata and controls

80 lines (64 loc) · 2.5 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:shlwapi.SHLocalStrDupA
SHLocalStrDupA function (shlwapi.h)
Makes a copy of a string in newly allocated memory. (SHLocalStrDupA)
SHLocalStrDupA
shlwapi/SHLocalStrDupA
shell\SHLocalStrDup.htm
shell
79da6160-b1b1-41c3-9b21-229aadf251dd
12/05/2018
SHLocalStrDup, SHLocalStrDup function [Windows Shell], SHLocalStrDupA, SHLocalStrDupW, _shell_SHLocalStrDup, shell.SHLocalStrDup, shlwapi/SHLocalStrDup, shlwapi/SHLocalStrDupA, shlwapi/SHLocalStrDupW
shlwapi.h
Windows
Windows Vista [desktop apps only]
Windows Server 2008 [desktop apps only]
SHLocalStrDupW (Unicode) and SHLocalStrDupA (ANSI)
Windows
19H1
SHLocalStrDupA
shlwapi/SHLocalStrDupA
c++
APIRef
kbSyntax
HeaderDef
Shlwapi.h
SHLocalStrDup
SHLocalStrDupA
SHLocalStrDupW

SHLocalStrDupA function

-description

Makes a copy of a string in newly allocated memory.

-parameters

-param psz

Type: PCTSTR

A pointer to a null-terminated, Unicode string to be copied.

-param ppsz [out, optional]

Type: PTSTR*

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.

-returns

Type: HRESULT

If this function succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

-remarks

Note

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.