WindowsDuplicateString function
Creates a copy of the specified string.
Syntax
HRESULT WINAPI WindowsDuplicateString( _In_ HSTRING string, _Out_ HSTRING *newString );
Parameters
Return value
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. |
Remarks
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.
Requirements
|
Minimum supported client |
Windows 8 [desktop apps | Windows Store apps] |
|---|---|
|
Minimum supported server |
Windows Server 2012 [desktop apps | Windows Store apps] |
|
Minimum supported phone |
Windows Phone 8 |
|
Header |
|
See also