Commit 3ba2d995 authored by Thomas Pointhuber's avatar Thomas Pointhuber Committed by Alexandre Julliard

combase: Implement WindowsSubstring.

parent a90ed505
......@@ -21,7 +21,7 @@
@ stdcall WindowsPromoteStringBuffer(ptr ptr) combase.WindowsPromoteStringBuffer
@ stub WindowsReplaceString
@ stdcall WindowsStringHasEmbeddedNull(ptr ptr) combase.WindowsStringHasEmbeddedNull
@ stub WindowsSubstring
@ stdcall WindowsSubstring(ptr long ptr) combase.WindowsSubstring
@ stub WindowsSubstringWithSpecifiedLength
@ stub WindowsTrimStringEnd
@ stub WindowsTrimStringStart
......@@ -302,7 +302,7 @@
@ stdcall WindowsPromoteStringBuffer(ptr ptr)
@ stub WindowsReplaceString
@ stdcall WindowsStringHasEmbeddedNull(ptr ptr)
@ stub WindowsSubstring
@ stdcall WindowsSubstring(ptr long ptr)
@ stub WindowsSubstringWithSpecifiedLength
@ stub WindowsTrimStringEnd
@ stub WindowsTrimStringStart
......@@ -255,6 +255,25 @@ HRESULT WINAPI WindowsStringHasEmbeddedNull(HSTRING str, BOOL *out)
}
/***********************************************************************
* WindowsSubstring (combase.@)
*/
HRESULT WINAPI WindowsSubstring(HSTRING str, UINT32 start, HSTRING *out)
{
struct hstring_private *priv = impl_from_HSTRING(str);
UINT32 len = WindowsGetStringLen(str);
if (out == NULL)
return E_INVALIDARG;
if (start > len)
return E_BOUNDS;
if (start == len)
{
*out = NULL;
return S_OK;
}
return WindowsCreateString(&priv->buffer[start], len - start, out);
}
/***********************************************************************
* WindowsIsStringEmpty (combase.@)
*/
BOOL WINAPI WindowsIsStringEmpty(HSTRING str)
......
......@@ -2092,6 +2092,7 @@ static inline HRESULT HRESULT_FROM_WIN32(unsigned int x)
#define S_FALSE _HRESULT_TYPEDEF_(1)
#define E_PENDING _HRESULT_TYPEDEF_(0x8000000A)
#define E_BOUNDS _HRESULT_TYPEDEF_(0x8000000B)
#define E_NOTIMPL _HRESULT_TYPEDEF_(0x80004001)
......
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