combase: Implement WindowsSubstringWithSpecifiedLength.
Signed-off-by: Sebastian Lackner <sebastian@fds-team.de> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
8a870d4965
commit
7d0dccd234
|
@ -22,6 +22,6 @@
|
||||||
@ stub WindowsReplaceString
|
@ stub WindowsReplaceString
|
||||||
@ stdcall WindowsStringHasEmbeddedNull(ptr ptr) combase.WindowsStringHasEmbeddedNull
|
@ stdcall WindowsStringHasEmbeddedNull(ptr ptr) combase.WindowsStringHasEmbeddedNull
|
||||||
@ stdcall WindowsSubstring(ptr long ptr) combase.WindowsSubstring
|
@ stdcall WindowsSubstring(ptr long ptr) combase.WindowsSubstring
|
||||||
@ stub WindowsSubstringWithSpecifiedLength
|
@ stdcall WindowsSubstringWithSpecifiedLength(ptr long long ptr) combase.WindowsSubstringWithSpecifiedLength
|
||||||
@ stub WindowsTrimStringEnd
|
@ stub WindowsTrimStringEnd
|
||||||
@ stub WindowsTrimStringStart
|
@ stub WindowsTrimStringStart
|
||||||
|
|
|
@ -303,6 +303,6 @@
|
||||||
@ stub WindowsReplaceString
|
@ stub WindowsReplaceString
|
||||||
@ stdcall WindowsStringHasEmbeddedNull(ptr ptr)
|
@ stdcall WindowsStringHasEmbeddedNull(ptr ptr)
|
||||||
@ stdcall WindowsSubstring(ptr long ptr)
|
@ stdcall WindowsSubstring(ptr long ptr)
|
||||||
@ stub WindowsSubstringWithSpecifiedLength
|
@ stdcall WindowsSubstringWithSpecifiedLength(ptr long long ptr)
|
||||||
@ stub WindowsTrimStringEnd
|
@ stub WindowsTrimStringEnd
|
||||||
@ stub WindowsTrimStringStart
|
@ stub WindowsTrimStringStart
|
||||||
|
|
|
@ -307,6 +307,28 @@ HRESULT WINAPI WindowsSubstring(HSTRING str, UINT32 start, HSTRING *out)
|
||||||
return WindowsCreateString(&priv->buffer[start], len - start, out);
|
return WindowsCreateString(&priv->buffer[start], len - start, 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.@)
|
* WindowsIsStringEmpty (combase.@)
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue