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:winstring.WindowsDuplicateString |
WindowsDuplicateString function (winstring.h) |
Creates a copy of the specified string. |
|
winrt\windowsduplicatestring.htm |
WinRT |
65343F8A-ACD5-4BD2-83CD-DA9F71690DF3 |
12/05/2018 |
WindowsDuplicateString, WindowsDuplicateString function [Windows Runtime], winrt.windowsduplicatestring, winstring/WindowsDuplicateString |
winstring.h |
Windows |
Windows 8 [desktop apps \| UWP apps] |
Windows Server 2012 [desktop apps \| UWP apps] |
Windows |
19H1 |
|
|
|
|
|
|
Creates a copy of the specified string.
Type: [in] HSTRING
The string to be copied.
Type: [out] HSTRING*
A copy of string.
Type: HRESULT
This function can return one of these values.
Return code | Description |
---|---|
|
The HSTRING was copied successfully. |
|
newString is NULL. |
|
Failed to allocate the new HSTRING. |
Use the WindowsDuplicateString function to copy an HSTRING. If string was created by calling the WindowsCreateString function, the reference count of the backing buffer is incremented. If string was created by calling the WindowsCreateStringReference function, the Windows Runtime copies its source string to a new buffer and starts a reference count, which means that newString is not a fast-pass string.
Each call to the WindowsDuplicateString function must be matched with a corresponding call to WindowsDeleteString.