Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
089d54f1
Commit
089d54f1
authored
Jan 24, 2010
by
Jacek Caban
Committed by
Alexandre Julliard
Jan 25, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Added support for pure IDispatch event handlers.
parent
8571bf6f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
56 additions
and
8 deletions
+56
-8
dispex.c
dlls/mshtml/dispex.c
+9
-8
events.c
dlls/mshtml/tests/events.c
+47
-0
No files found.
dlls/mshtml/dispex.c
View file @
089d54f1
...
...
@@ -400,18 +400,19 @@ HRESULT call_disp_func(IDispatch *disp, DISPPARAMS *dp)
VARIANT
res
;
HRESULT
hres
;
hres
=
IDispatch_QueryInterface
(
disp
,
&
IID_IDispatchEx
,
(
void
**
)
&
dispex
);
if
(
FAILED
(
hres
))
{
FIXME
(
"Could not get IDispatchEx interface: %08x
\n
"
,
hres
);
return
hres
;
}
VariantInit
(
&
res
);
memset
(
&
ei
,
0
,
sizeof
(
ei
));
hres
=
IDispatchEx_InvokeEx
(
dispex
,
0
,
GetUserDefaultLCID
(),
DISPATCH_METHOD
,
dp
,
&
res
,
&
ei
,
NULL
);
hres
=
IDispatch_QueryInterface
(
disp
,
&
IID_IDispatchEx
,
(
void
**
)
&
dispex
);
if
(
SUCCEEDED
(
hres
))
{
hres
=
IDispatchEx_InvokeEx
(
dispex
,
0
,
GetUserDefaultLCID
(),
DISPATCH_METHOD
,
dp
,
&
res
,
&
ei
,
NULL
);
IDispatchEx_Release
(
dispex
);
}
else
{
TRACE
(
"Could not get IDispatchEx interface: %08x
\n
"
,
hres
);
hres
=
IDispatch_Invoke
(
disp
,
0
,
&
IID_NULL
,
GetUserDefaultLCID
(),
DISPATCH_METHOD
,
dp
,
&
res
,
&
ei
,
NULL
);
}
IDispatchEx_Release
(
dispex
);
VariantClear
(
&
res
);
return
hres
;
}
...
...
dlls/mshtml/tests/events.c
View file @
089d54f1
...
...
@@ -63,6 +63,7 @@ DEFINE_EXPECT(div_onclick);
DEFINE_EXPECT
(
div_onclick_attached
);
DEFINE_EXPECT
(
timeout
);
DEFINE_EXPECT
(
doccp_onclick
);
DEFINE_EXPECT
(
div_onclick_disp
);
DEFINE_EXPECT
(
iframe_onreadystatechange_loading
);
DEFINE_EXPECT
(
iframe_onreadystatechange_interactive
);
DEFINE_EXPECT
(
iframe_onreadystatechange_complete
);
...
...
@@ -690,6 +691,23 @@ static HRESULT WINAPI DispatchEx_QueryInterface(IDispatchEx *iface, REFIID riid,
return
S_OK
;
}
static
HRESULT
WINAPI
Dispatch_QueryInterface
(
IDispatchEx
*
iface
,
REFIID
riid
,
void
**
ppv
)
{
*
ppv
=
NULL
;
if
(
IsEqualGUID
(
riid
,
&
IID_IUnknown
)
||
IsEqualGUID
(
riid
,
&
IID_IDispatch
))
{
*
ppv
=
iface
;
}
else
if
(
IsEqualGUID
(
riid
,
&
IID_IDispatchEx
))
{
return
E_NOINTERFACE
;
}
else
{
ok
(
0
,
"unexpected riid %s
\n
"
,
debugstr_guid
(
riid
));
return
E_NOINTERFACE
;
}
return
S_OK
;
}
static
ULONG
WINAPI
DispatchEx_AddRef
(
IDispatchEx
*
iface
)
{
return
2
;
...
...
@@ -1015,6 +1033,32 @@ static IDispatchExVtbl timeoutFuncVtbl = {
static
IDispatchEx
timeoutFunc
=
{
&
timeoutFuncVtbl
};
static
HRESULT
WINAPI
div_onclick_disp_Invoke
(
IDispatchEx
*
iface
,
DISPID
id
,
REFIID
riid
,
LCID
lcid
,
WORD
wFlags
,
DISPPARAMS
*
pdp
,
VARIANT
*
pvarRes
,
EXCEPINFO
*
pei
,
UINT
*
puArgErr
)
{
CHECK_EXPECT
(
div_onclick_disp
);
test_attached_event_args
(
id
,
wFlags
,
pdp
,
pvarRes
,
pei
);
ok
(
IsEqualGUID
(
&
IID_NULL
,
riid
),
"riid = %s
\n
"
,
debugstr_guid
(
riid
));
ok
(
!
puArgErr
,
"puArgErr = %p
\n
"
,
puArgErr
);
return
S_OK
;
}
static
IDispatchExVtbl
div_onclick_dispVtbl
=
{
Dispatch_QueryInterface
,
DispatchEx_AddRef
,
DispatchEx_Release
,
DispatchEx_GetTypeInfoCount
,
DispatchEx_GetTypeInfo
,
DispatchEx_GetIDsOfNames
,
div_onclick_disp_Invoke
,
};
static
IDispatchEx
div_onclick_disp
=
{
&
div_onclick_dispVtbl
};
static
void
pump_msgs
(
BOOL
*
b
)
{
MSG
msg
;
...
...
@@ -1163,8 +1207,10 @@ static void test_onclick(IHTMLDocument2 *doc)
CHECK_CALLED
(
document_onclick
);
cp_cookie
=
register_cp
((
IUnknown
*
)
doc
,
&
DIID_HTMLDocumentEvents
,
(
IUnknown
*
)
&
doccp_obj
);
elem_attach_event
((
IUnknown
*
)
div
,
"onclick"
,
(
IDispatch
*
)
&
div_onclick_disp
);
SET_EXPECT
(
div_onclick
);
SET_EXPECT
(
div_onclick_disp
);
SET_EXPECT
(
div_onclick_attached
);
SET_EXPECT
(
body_onclick
);
SET_EXPECT
(
document_onclick
);
...
...
@@ -1174,6 +1220,7 @@ static void test_onclick(IHTMLDocument2 *doc)
ok
(
hres
==
S_OK
,
"click failed: %08x
\n
"
,
hres
);
CHECK_CALLED
(
div_onclick
);
CHECK_CALLED
(
div_onclick_disp
);
CHECK_CALLED
(
div_onclick_attached
);
CHECK_CALLED
(
body_onclick
);
CHECK_CALLED
(
document_onclick
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment