WindowsConcatString function winrt
Concatenates two specified strings.
Throws a WindowsException on failure.
To learn more, see learn.microsoft.com/windows/win32/api/winstring/nf-winstring-windowsconcatstring.
Implementation
HSTRING WindowsConcatString(HSTRING? string1, HSTRING? string2) {
final newString = adaptiveCalloc<Pointer>();
final hr$ = HRESULT(
_WindowsConcatString(string1 ?? nullptr, string2 ?? nullptr, newString),
);
if (hr$.isError) {
free(newString);
throw WindowsException(hr$);
}
final result$ = newString.value;
free(newString);
return .new(result$);
}