Nikolay Sivov : msscript: Implement GetControlInfo().

Alexandre Julliard julliard at winehq.org
Mon Jun 13 11:11:30 CDT 2016


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

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Sat Jun 11 13:02:38 2016 +0300

msscript: Implement GetControlInfo().

Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/msscript.ocx/msscript.c       | 10 ++++++++--
 dlls/msscript.ocx/tests/msscript.c | 23 +++++++++++++++++++++++
 2 files changed, 31 insertions(+), 2 deletions(-)

diff --git a/dlls/msscript.ocx/msscript.c b/dlls/msscript.ocx/msscript.c
index b2f4e77..5a03f0c 100644
--- a/dlls/msscript.ocx/msscript.c
+++ b/dlls/msscript.ocx/msscript.c
@@ -808,9 +808,15 @@ static HRESULT WINAPI OleControl_GetControlInfo(IOleControl *iface, CONTROLINFO
 {
     ScriptControl *This = impl_from_IOleControl(iface);
 
-    FIXME("(%p)->(%p)\n", This, info);
+    TRACE("(%p)->(%p)\n", This, info);
 
-    return E_NOTIMPL;
+    if (!info)
+        return E_POINTER;
+
+    info->hAccel = NULL;
+    info->cAccel = 0;
+
+    return S_OK;
 }
 
 static HRESULT WINAPI OleControl_OnMnemonic(IOleControl *iface, MSG *msg)
diff --git a/dlls/msscript.ocx/tests/msscript.c b/dlls/msscript.ocx/tests/msscript.c
index f0245a6..12f7003 100644
--- a/dlls/msscript.ocx/tests/msscript.c
+++ b/dlls/msscript.ocx/tests/msscript.c
@@ -181,12 +181,35 @@ static void test_persiststreaminit(void)
 static void test_olecontrol(void)
 {
     IOleControl *olecontrol;
+    CONTROLINFO info;
     HRESULT hr;
 
     hr = CoCreateInstance(&CLSID_ScriptControl, NULL, CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER,
             &IID_IOleControl, (void**)&olecontrol);
     ok(hr == S_OK, "got 0x%08x\n", hr);
 
+    memset(&info, 0xab, sizeof(info));
+    info.cb = sizeof(info);
+    hr = IOleControl_GetControlInfo(olecontrol, &info);
+    ok(hr == S_OK, "got 0x%08x\n", hr);
+    ok(info.hAccel == NULL, "got %p\n", info.hAccel);
+    ok(info.cAccel == 0, "got %d\n", info.cAccel);
+    ok(info.dwFlags == 0xabababab, "got %x\n", info.dwFlags);
+
+    memset(&info, 0xab, sizeof(info));
+    info.cb = sizeof(info) - 1;
+    hr = IOleControl_GetControlInfo(olecontrol, &info);
+    ok(hr == S_OK, "got 0x%08x\n", hr);
+    ok(info.hAccel == NULL, "got %p\n", info.hAccel);
+    ok(info.cAccel == 0, "got %d\n", info.cAccel);
+    ok(info.dwFlags == 0xabababab, "got %x\n", info.dwFlags);
+
+    if (0) /* crashes on win2k3 */
+    {
+        hr = IOleControl_GetControlInfo(olecontrol, NULL);
+        ok(hr == E_POINTER, "got 0x%08x\n", hr);
+    }
+
     IOleControl_Release(olecontrol);
 }
 




More information about the wine-cvs mailing list