Commit ab816814 authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

jscript: Make String_toLowerCase generic.

parent 973f3be0
......@@ -1342,33 +1342,46 @@ static HRESULT String_sup(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS
static HRESULT String_toLowerCase(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp,
VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp)
{
StringInstance *string;
const WCHAR* str;
DWORD length;
BSTR bstr;
BSTR val_str = NULL;
HRESULT hres;
TRACE("\n");
if(is_class(dispex, JSCLASS_STRING)) {
string = (StringInstance*)dispex;
if(!is_class(dispex, JSCLASS_STRING)) {
VARIANT this;
length = string->length;
str = string->str;
}else {
FIXME("not string this not supported\n");
return E_NOTIMPL;
V_VT(&this) = VT_DISPATCH;
V_DISPATCH(&this) = (IDispatch*)_IDispatchEx_(dispex);
hres = to_string(dispex->ctx, &this, ei, &val_str);
if(FAILED(hres))
return hres;
str = val_str;
length = SysStringLen(val_str);
}
else {
StringInstance *this = (StringInstance*)dispex;
str = this->str;
length = this->length;
}
if(retv) {
bstr = SysAllocStringLen(str, length);
if (!bstr)
return E_OUTOFMEMORY;
if(!val_str) {
val_str = SysAllocStringLen(str, length);
if(!val_str)
return E_OUTOFMEMORY;
}
strlwrW(bstr);
strlwrW(val_str);
V_VT(retv) = VT_BSTR;
V_BSTR(retv) = bstr;
V_BSTR(retv) = val_str;
}
else SysFreeString(val_str);
return S_OK;
}
......
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