Commit 7d0dccd2 authored by Sebastian Lackner's avatar Sebastian Lackner Committed by Alexandre Julliard

combase: Implement WindowsSubstringWithSpecifiedLength.

parent 8a870d49
......@@ -22,6 +22,6 @@
@ stub WindowsReplaceString
@ stdcall WindowsStringHasEmbeddedNull(ptr ptr) combase.WindowsStringHasEmbeddedNull
@ stdcall WindowsSubstring(ptr long ptr) combase.WindowsSubstring
@ stub WindowsSubstringWithSpecifiedLength
@ stdcall WindowsSubstringWithSpecifiedLength(ptr long long ptr) combase.WindowsSubstringWithSpecifiedLength
@ stub WindowsTrimStringEnd
@ stub WindowsTrimStringStart
......@@ -303,6 +303,6 @@
@ stub WindowsReplaceString
@ stdcall WindowsStringHasEmbeddedNull(ptr ptr)
@ stdcall WindowsSubstring(ptr long ptr)
@ stub WindowsSubstringWithSpecifiedLength
@ stdcall WindowsSubstringWithSpecifiedLength(ptr long long ptr)
@ stub WindowsTrimStringEnd
@ stub WindowsTrimStringStart
......@@ -308,6 +308,28 @@ HRESULT WINAPI WindowsSubstring(HSTRING str, UINT32 start, HSTRING *out)
}
/***********************************************************************
* WindowsSubstringWithSpecifiedLength (combase.@)
*/
HRESULT WINAPI WindowsSubstringWithSpecifiedLength(HSTRING str, UINT32 start, UINT32 len, HSTRING *out)
{
struct hstring_private *priv = impl_from_HSTRING(str);
TRACE("(%p, %u, %u, %p)\n", str, start, len, out);
if (out == NULL)
return E_INVALIDARG;
if (start + len < start ||
start + len > WindowsGetStringLen(str))
return E_BOUNDS;
if (len == 0)
{
*out = NULL;
return S_OK;
}
return WindowsCreateString(&priv->buffer[start], len, out);
}
/***********************************************************************
* WindowsIsStringEmpty (combase.@)
*/
BOOL WINAPI WindowsIsStringEmpty(HSTRING str)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment