Jacek Caban : mshtml: Don' t pass fdexNameEnsure flag to script engines in find_global_prop.

Alexandre Julliard julliard at winehq.org
Mon Dec 7 10:26:15 CST 2009


Module: wine
Branch: master
Commit: f3d805862a60ca296f0579ff3f8f4957fdcf370c
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=f3d805862a60ca296f0579ff3f8f4957fdcf370c

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Sun Dec  6 22:10:07 2009 +0100

mshtml: Don't pass fdexNameEnsure flag to script engines in find_global_prop.

---

 dlls/mshtml/script.c       |    2 +-
 dlls/mshtml/tests/script.c |   19 +++++++++++++++++++
 2 files changed, 20 insertions(+), 1 deletions(-)

diff --git a/dlls/mshtml/script.c b/dlls/mshtml/script.c
index 7df0dd6..efd2605 100644
--- a/dlls/mshtml/script.c
+++ b/dlls/mshtml/script.c
@@ -895,7 +895,7 @@ BOOL find_global_prop(HTMLWindow *window, BSTR name, DWORD flags, ScriptHost **r
 
         hres = IDispatch_QueryInterface(disp, &IID_IDispatchEx, (void**)&dispex);
         if(SUCCEEDED(hres)) {
-            hres = IDispatchEx_GetDispID(dispex, name, flags, ret_id);
+            hres = IDispatchEx_GetDispID(dispex, name, flags & (~fdexNameEnsure), ret_id);
             IDispatchEx_Release(dispex);
         }else {
             FIXME("No IDispatchEx\n");
diff --git a/dlls/mshtml/tests/script.c b/dlls/mshtml/tests/script.c
index 22ed48e..d8dce6a 100644
--- a/dlls/mshtml/tests/script.c
+++ b/dlls/mshtml/tests/script.c
@@ -115,6 +115,7 @@ DEFINE_EXPECT(funcDisp);
 DEFINE_EXPECT(script_divid_d);
 DEFINE_EXPECT(script_testprop_d);
 DEFINE_EXPECT(script_testprop_i);
+DEFINE_EXPECT(script_testprop2_d);
 DEFINE_EXPECT(AXQueryInterface_IActiveScript);
 DEFINE_EXPECT(AXQueryInterface_IObjectSafety);
 DEFINE_EXPECT(AXGetInterfaceSafetyOptions);
@@ -124,6 +125,7 @@ DEFINE_EXPECT(AXSetInterfaceSafetyOptions);
 #define TESTACTIVEX_CLSID "{178fc163-f585-4e24-9c13-4bb7faf80646}"
 
 #define DISPID_SCRIPT_TESTPROP   0x100000
+#define DISPID_SCRIPT_TESTPROP2  0x100001
 
 static const GUID CLSID_TestScript =
     {0x178fc163,0xf585,0x4e24,{0x9c,0x13,0x4b,0xb7,0xfa,0xf8,0x07,0x46}};
@@ -394,6 +396,13 @@ static HRESULT WINAPI scriptDisp_GetDispID(IDispatchEx *iface, BSTR bstrName, DW
         return S_OK;
     }
 
+    if(!strcmp_wa(bstrName, "testProp2")) {
+        CHECK_EXPECT(script_testprop2_d);
+        ok(grfdex == fdexNameCaseSensitive, "grfdex = %x\n", grfdex);
+        *pid = DISPID_SCRIPT_TESTPROP2;
+        return S_OK;
+    }
+
     if(!strcmp_wa(bstrName, "divid")) {
         CHECK_EXPECT(script_divid_d);
         ok(grfdex == fdexNameCaseSensitive, "grfdex = %x\n", grfdex);
@@ -1212,6 +1221,16 @@ static HRESULT WINAPI ActiveScriptParse_ParseScriptText(IActiveScriptParse *ifac
     CHECK_CALLED(GetScriptDispatch);
     CHECK_CALLED(script_testprop_i);
 
+    SET_EXPECT(GetScriptDispatch);
+    SET_EXPECT(script_testprop2_d);
+    tmp = a2bstr("testProp2");
+    hres = IDispatchEx_GetDispID(window_dispex, tmp, fdexNameCaseSensitive|fdexNameEnsure, &id);
+    ok(hres == S_OK, "GetDispID failed: %08x\n", hres);
+    ok(id != DISPID_SCRIPT_TESTPROP2, "id == DISPID_SCRIPT_TESTPROP2\n");
+    CHECK_CALLED(GetScriptDispatch);
+    CHECK_CALLED(script_testprop2_d);
+    SysFreeString(tmp);
+
     test_global_id();
 
     test_security();




More information about the wine-cvs mailing list