Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
32ac703e
Commit
32ac703e
authored
Jun 18, 2008
by
Jacek Caban
Committed by
Alexandre Julliard
Jun 18, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Added fdexNameEnsure support to IDidpatchEx implementation.
parent
1741e652
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
71 additions
and
1 deletion
+71
-1
dispex.c
dlls/mshtml/dispex.c
+69
-1
mshtml_private.h
dlls/mshtml/mshtml_private.h
+2
-0
No files found.
dlls/mshtml/dispex.c
View file @
32ac703e
...
...
@@ -45,6 +45,20 @@ struct dispex_data_t {
struct
list
entry
;
};
typedef
struct
{
VARIANT
var
;
LPWSTR
name
;
}
dynamic_prop_t
;
struct
dispex_dynamic_data_t
{
DWORD
buf_size
;
DWORD
prop_cnt
;
dynamic_prop_t
*
props
;
};
#define DISPID_DYNPROP_0 0x50000000
#define DISPID_DYNPROP_MAX 0x5fffffff
static
ITypeLib
*
typelib
;
static
ITypeInfo
*
typeinfos
[
LAST_tid
];
static
struct
list
dispex_data_list
=
LIST_INIT
(
dispex_data_list
);
...
...
@@ -296,6 +310,11 @@ static inline BOOL is_custom_dispid(DISPID id)
return
MSHTML_DISPID_CUSTOM_MIN
<=
id
&&
id
<=
MSHTML_DISPID_CUSTOM_MAX
;
}
static
inline
BOOL
is_dynamic_dispid
(
DISPID
id
)
{
return
DISPID_DYNPROP_0
<=
id
&&
id
<=
DISPID_DYNPROP_MAX
;
}
#define DISPATCHEX_THIS(iface) DEFINE_THIS(DispatchEx, IDispatchEx, iface)
static
HRESULT
WINAPI
DispatchEx_QueryInterface
(
IDispatchEx
*
iface
,
REFIID
riid
,
void
**
ppv
)
...
...
@@ -386,7 +405,7 @@ static HRESULT WINAPI DispatchEx_GetDispID(IDispatchEx *iface, BSTR bstrName, DW
TRACE
(
"(%p)->(%s %x %p)
\n
"
,
This
,
debugstr_w
(
bstrName
),
grfdex
,
pid
);
if
(
grfdex
&
(
~
fdexNameCaseSensitiv
e
))
if
(
grfdex
&
~
(
fdexNameCaseSensitive
|
fdexNameEnsur
e
))
FIXME
(
"Unsupported grfdex %x
\n
"
,
grfdex
);
data
=
get_dispex_data
(
This
);
...
...
@@ -414,6 +433,17 @@ static HRESULT WINAPI DispatchEx_GetDispID(IDispatchEx *iface, BSTR bstrName, DW
min
=
n
+
1
;
}
if
(
This
->
dynamic_data
)
{
unsigned
i
;
for
(
i
=
0
;
i
<
This
->
dynamic_data
->
prop_cnt
;
i
++
)
{
if
(
!
strcmpW
(
This
->
dynamic_data
->
props
[
i
].
name
,
bstrName
))
{
*
pid
=
DISPID_DYNPROP_0
+
i
;
return
S_OK
;
}
}
}
if
(
This
->
data
->
vtbl
&&
This
->
data
->
vtbl
->
get_dispid
)
{
HRESULT
hres
;
...
...
@@ -422,6 +452,23 @@ static HRESULT WINAPI DispatchEx_GetDispID(IDispatchEx *iface, BSTR bstrName, DW
return
hres
;
}
if
(
grfdex
&
fdexNameEnsure
)
{
TRACE
(
"creating dynamic prop %s
\n
"
,
debugstr_w
(
bstrName
));
if
(
!
This
->
dynamic_data
)
{
This
->
dynamic_data
=
heap_alloc_zero
(
sizeof
(
dispex_dynamic_data_t
));
This
->
dynamic_data
->
props
=
heap_alloc
(
This
->
dynamic_data
->
buf_size
=
4
);
}
else
if
(
This
->
dynamic_data
->
buf_size
==
This
->
dynamic_data
->
prop_cnt
)
{
This
->
dynamic_data
->
props
=
heap_realloc
(
This
->
dynamic_data
->
props
,
This
->
dynamic_data
->
buf_size
<<=
1
);
}
This
->
dynamic_data
->
props
[
This
->
dynamic_data
->
prop_cnt
].
name
=
heap_strdupW
(
bstrName
);
VariantInit
(
&
This
->
dynamic_data
->
props
[
This
->
dynamic_data
->
prop_cnt
].
var
);
*
pid
=
DISPID_DYNPROP_0
+
This
->
dynamic_data
->
prop_cnt
++
;
return
S_OK
;
}
TRACE
(
"not found %s
\n
"
,
debugstr_w
(
bstrName
));
return
DISP_E_UNKNOWNNAME
;
}
...
...
@@ -447,6 +494,27 @@ static HRESULT WINAPI DispatchEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID lc
return
E_NOTIMPL
;
}
if
(
is_dynamic_dispid
(
id
))
{
DWORD
idx
=
id
-
DISPID_DYNPROP_0
;
VARIANT
*
var
;
if
(
!
This
->
dynamic_data
||
This
->
dynamic_data
->
prop_cnt
<=
idx
)
return
DISP_E_UNKNOWNNAME
;
var
=
&
This
->
dynamic_data
->
props
[
idx
].
var
;
switch
(
wFlags
)
{
case
INVOKE_PROPERTYGET
:
return
VariantCopy
(
pvarRes
,
var
);
case
INVOKE_PROPERTYPUT
:
VariantClear
(
var
);
return
VariantCopy
(
var
,
pdp
->
rgvarg
);
default:
FIXME
(
"unhandled wFlags %x
\n
"
,
wFlags
);
return
E_NOTIMPL
;
}
}
data
=
get_dispex_data
(
This
);
if
(
!
data
)
return
E_FAIL
;
...
...
dlls/mshtml/mshtml_private.h
View file @
32ac703e
...
...
@@ -97,6 +97,7 @@ typedef enum {
}
tid_t
;
typedef
struct
dispex_data_t
dispex_data_t
;
typedef
struct
dispex_dynamic_data_t
dispex_dynamic_data_t
;
#define MSHTML_DISPID_CUSTOM_MIN 0x60000000
#define MSHTML_DISPID_CUSTOM_MAX 0x6fffffff
...
...
@@ -119,6 +120,7 @@ typedef struct {
IUnknown
*
outer
;
dispex_static_data_t
*
data
;
dispex_dynamic_data_t
*
dynamic_data
;
}
DispatchEx
;
void
init_dispex
(
DispatchEx
*
,
IUnknown
*
,
dispex_static_data_t
*
);
...
...
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