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
4bb10ad3
Commit
4bb10ad3
authored
Sep 16, 2011
by
Jacek Caban
Committed by
Alexandre Julliard
Sep 16, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vbscript: Added GetDispID support for properties.
parent
ae57aa14
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
2 deletions
+32
-2
lang.vbs
dlls/vbscript/tests/lang.vbs
+2
-0
run.c
dlls/vbscript/tests/run.c
+17
-1
vbdisp.c
dlls/vbscript/vbdisp.c
+13
-1
No files found.
dlls/vbscript/tests/lang.vbs
View file @
4bb10ad3
...
@@ -399,6 +399,8 @@ Class TestClass
...
@@ -399,6 +399,8 @@ Class TestClass
publicFunction
=
4
publicFunction
=
4
End
Function
End
Function
Public
publicProp2
Public
Sub
publicSub
Public
Sub
publicSub
End
Sub
End
Sub
...
...
dlls/vbscript/tests/run.c
View file @
4bb10ad3
...
@@ -160,7 +160,7 @@ static BOOL is_lang_english(void)
...
@@ -160,7 +160,7 @@ static BOOL is_lang_english(void)
static
void
test_disp
(
IDispatch
*
disp
)
static
void
test_disp
(
IDispatch
*
disp
)
{
{
DISPID
id
,
public_func_id
,
public_sub_id
;
DISPID
id
,
public_
prop_id
,
public_prop2_id
,
public_
func_id
,
public_sub_id
;
DISPID
named_args
[
5
]
=
{
DISPID_PROPERTYPUT
};
DISPID
named_args
[
5
]
=
{
DISPID_PROPERTYPUT
};
VARIANT
v
,
args
[
5
];
VARIANT
v
,
args
[
5
];
DISPPARAMS
dp
=
{
args
,
named_args
};
DISPPARAMS
dp
=
{
args
,
named_args
};
...
@@ -172,6 +172,22 @@ static void test_disp(IDispatch *disp)
...
@@ -172,6 +172,22 @@ static void test_disp(IDispatch *disp)
hres
=
IDispatch_QueryInterface
(
disp
,
&
IID_IDispatchEx
,
(
void
**
)
&
dispex
);
hres
=
IDispatch_QueryInterface
(
disp
,
&
IID_IDispatchEx
,
(
void
**
)
&
dispex
);
ok
(
hres
==
S_OK
,
"Could not get IDispatchEx iface: %08x
\n
"
,
hres
);
ok
(
hres
==
S_OK
,
"Could not get IDispatchEx iface: %08x
\n
"
,
hres
);
str
=
a2bstr
(
"publicProp"
);
hres
=
IDispatchEx_GetDispID
(
dispex
,
str
,
fdexNameCaseInsensitive
,
&
public_prop_id
);
SysFreeString
(
str
);
ok
(
hres
==
S_OK
,
"GetDispID(publicProp) failed: %08x
\n
"
,
hres
);
str
=
a2bstr
(
"PUBLICPROP"
);
hres
=
IDispatchEx_GetDispID
(
dispex
,
str
,
0
,
&
id
);
SysFreeString
(
str
);
ok
(
hres
==
S_OK
,
"GetDispID(PUBLICPROP) failed: %08x
\n
"
,
hres
);
ok
(
public_prop_id
==
id
,
"id = %d
\n
"
,
public_prop_id
);
str
=
a2bstr
(
"publicPROP2"
);
hres
=
IDispatchEx_GetDispID
(
dispex
,
str
,
fdexNameCaseInsensitive
,
&
public_prop2_id
);
SysFreeString
(
str
);
ok
(
hres
==
S_OK
,
"GetDispID(publicProp2) failed: %08x
\n
"
,
hres
);
str
=
a2bstr
(
"publicFunction"
);
str
=
a2bstr
(
"publicFunction"
);
hres
=
IDispatchEx_GetDispID
(
dispex
,
str
,
fdexNameCaseInsensitive
,
&
public_func_id
);
hres
=
IDispatchEx_GetDispID
(
dispex
,
str
,
fdexNameCaseInsensitive
,
&
public_func_id
);
SysFreeString
(
str
);
SysFreeString
(
str
);
...
...
dlls/vbscript/vbdisp.c
View file @
4bb10ad3
...
@@ -46,11 +46,23 @@ static BOOL get_func_id(vbdisp_t *This, const WCHAR *name, BOOL search_private,
...
@@ -46,11 +46,23 @@ static BOOL get_func_id(vbdisp_t *This, const WCHAR *name, BOOL search_private,
return
FALSE
;
return
FALSE
;
}
}
static
HRESULT
vbdisp_get_id
(
vbdisp_t
*
This
,
BSTR
name
,
BOOL
search_private
,
DISPID
*
id
)
HRESULT
vbdisp_get_id
(
vbdisp_t
*
This
,
BSTR
name
,
BOOL
search_private
,
DISPID
*
id
)
{
{
unsigned
i
;
if
(
get_func_id
(
This
,
name
,
search_private
,
id
))
if
(
get_func_id
(
This
,
name
,
search_private
,
id
))
return
S_OK
;
return
S_OK
;
for
(
i
=
0
;
i
<
This
->
desc
->
prop_cnt
;
i
++
)
{
if
(
!
search_private
&&
!
This
->
desc
->
props
[
i
].
is_public
)
continue
;
if
(
!
strcmpiW
(
This
->
desc
->
props
[
i
].
name
,
name
))
{
*
id
=
i
+
This
->
desc
->
func_cnt
;
return
S_OK
;
}
}
*
id
=
-
1
;
*
id
=
-
1
;
return
DISP_E_UNKNOWNNAME
;
return
DISP_E_UNKNOWNNAME
;
}
}
...
...
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