[PATCH 1/3] msscript: Implement GetControlInfo()
Nikolay Sivov
nsivov at codeweavers.com
Sat Jun 11 05:02:38 CDT 2016
Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
---
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);
}
--
2.8.1
More information about the wine-patches
mailing list