Expand Minimize

SHLocalStrDup function

Makes a copy of a string in newly allocated memory.

Syntax


HRESULT SHLocalStrDup(
  PCTSTR psz,
  _Out_opt_  PTSTR *ppsz
);

Parameters

psz

Type: PCTSTR

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

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.

Return value

Type: HRESULT

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

Requirements

Minimum supported client

Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2008 [desktop apps only]

Header

Shlwapi.h

Unicode and ANSI names

SHLocalStrDupW (Unicode) and SHLocalStrDupA (ANSI)

 

 

Community Additions

ADD
Show:
© 2014 Microsoft