[PATCH v2 02/16] mshtml: Use dispex_to_string when retrieving the value of an object.

Gabriel Ivăncescu gabrielopcode at gmail.com
Tue Oct 5 09:18:35 CDT 2021


Rather than always returning "[object]" in every mode.

Signed-off-by: Gabriel Ivăncescu <gabrielopcode at gmail.com>
---

This is needed for next patch (and matches native).

 dlls/mshtml/dispex.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/dlls/mshtml/dispex.c b/dlls/mshtml/dispex.c
index 26aab5e..35044bc 100644
--- a/dlls/mshtml/dispex.c
+++ b/dlls/mshtml/dispex.c
@@ -715,15 +715,17 @@ HRESULT dispex_get_dynid(DispatchEx *This, const WCHAR *name, DISPID *id)
 static HRESULT dispex_value(DispatchEx *This, LCID lcid, WORD flags, DISPPARAMS *params,
         VARIANT *res, EXCEPINFO *ei, IServiceProvider *caller)
 {
+    HRESULT hres;
+
     if(This->info->desc->vtbl && This->info->desc->vtbl->value)
         return This->info->desc->vtbl->value(This, lcid, flags, params, res, ei, caller);
 
     switch(flags) {
     case DISPATCH_PROPERTYGET:
         V_VT(res) = VT_BSTR;
-        V_BSTR(res) = SysAllocString(L"[object]");
-        if(!V_BSTR(res))
-            return E_OUTOFMEMORY;
+        hres = dispex_to_string(This, &V_BSTR(res));
+        if(FAILED(hres))
+            return hres;
         break;
     default:
         FIXME("Unimplemented flags %x\n", flags);
@@ -1305,9 +1307,9 @@ static HRESULT function_invoke(DispatchEx *This, func_info_t *func, WORD flags,
         if(func->id == DISPID_VALUE) {
             BSTR ret;
 
-            ret = SysAllocString(L"[object]");
-            if(!ret)
-                return E_OUTOFMEMORY;
+            hres = dispex_to_string(This, &ret);
+            if(FAILED(hres))
+                return hres;
 
             V_VT(res) = VT_BSTR;
             V_BSTR(res) = ret;
-- 
2.31.1




More information about the wine-devel mailing list