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
13d8e7b8
Commit
13d8e7b8
authored
Sep 19, 2011
by
Jacek Caban
Committed by
Alexandre Julliard
Sep 19, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vbscript: Added error object stub implementation.
parent
32a7a812
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
73 additions
and
2 deletions
+73
-2
Makefile.in
dlls/vbscript/Makefile.in
+1
-0
error.c
dlls/vbscript/error.c
+37
-0
global.c
dlls/vbscript/global.c
+1
-1
interp.c
dlls/vbscript/interp.c
+26
-1
api.vbs
dlls/vbscript/tests/api.vbs
+2
-0
vbscript.c
dlls/vbscript/vbscript.c
+2
-0
vbscript.h
dlls/vbscript/vbscript.h
+4
-0
No files found.
dlls/vbscript/Makefile.in
View file @
13d8e7b8
...
...
@@ -3,6 +3,7 @@ IMPORTS = oleaut32
C_SRCS
=
\
compile.c
\
error.c
\
global.c
\
interp.c
\
lex.c
\
...
...
dlls/vbscript/error.c
0 → 100644
View file @
13d8e7b8
/*
* Copyright 2011 Jacek Caban for CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "vbscript.h"
#include "vbscript_defs.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
vbscript
);
HRESULT
init_err
(
script_ctx_t
*
ctx
)
{
HRESULT
hres
;
ctx
->
err_desc
.
ctx
=
ctx
;
hres
=
get_typeinfo
(
ErrObj_tid
,
&
ctx
->
err_desc
.
typeinfo
);
if
(
FAILED
(
hres
))
return
hres
;
return
create_vbdisp
(
&
ctx
->
err_desc
,
&
ctx
->
err_obj
);
}
dlls/vbscript/global.c
View file @
13d8e7b8
...
...
@@ -1399,5 +1399,5 @@ HRESULT init_global(script_ctx_t *ctx)
if
(
FAILED
(
hres
))
return
hres
;
return
S_OK
;
return
init_err
(
ctx
)
;
}
dlls/vbscript/interp.c
View file @
13d8e7b8
...
...
@@ -48,6 +48,7 @@ typedef enum {
REF_NONE
,
REF_DISP
,
REF_VAR
,
REF_OBJ
,
REF_FUNC
}
ref_type_t
;
...
...
@@ -60,6 +61,7 @@ typedef struct {
}
d
;
VARIANT
*
v
;
function_t
*
f
;
IDispatch
*
obj
;
}
u
;
}
ref_t
;
...
...
@@ -92,6 +94,8 @@ static HRESULT lookup_identifier(exec_ctx_t *ctx, BSTR name, vbdisp_invoke_type_
DISPID
id
;
HRESULT
hres
;
static
const
WCHAR
errW
[]
=
{
'e'
,
'r'
,
'r'
,
0
};
if
(
invoke_type
==
VBDISP_LET
&&
(
ctx
->
func
->
type
==
FUNC_FUNCTION
||
ctx
->
func
->
type
==
FUNC_PROPGET
||
ctx
->
func
->
type
==
FUNC_DEFGET
)
&&
!
strcmpiW
(
name
,
ctx
->
func
->
name
))
{
...
...
@@ -147,6 +151,12 @@ static HRESULT lookup_identifier(exec_ctx_t *ctx, BSTR name, vbdisp_invoke_type_
}
}
if
(
!
strcmpiW
(
name
,
errW
))
{
ref
->
type
=
REF_OBJ
;
ref
->
u
.
obj
=
(
IDispatch
*
)
&
ctx
->
script
->
err_obj
->
IDispatchEx_iface
;
return
S_OK
;
}
hres
=
vbdisp_get_id
(
ctx
->
script
->
global_obj
,
name
,
invoke_type
,
TRUE
,
&
id
);
if
(
SUCCEEDED
(
hres
))
{
ref
->
type
=
REF_DISP
;
...
...
@@ -291,8 +301,8 @@ static HRESULT do_icall(exec_ctx_t *ctx, VARIANT *res)
{
BSTR
identifier
=
ctx
->
instr
->
arg1
.
bstr
;
const
unsigned
arg_cnt
=
ctx
->
instr
->
arg2
.
uint
;
ref_t
ref
=
{
0
};
DISPPARAMS
dp
;
ref_t
ref
;
HRESULT
hres
;
hres
=
lookup_identifier
(
ctx
,
identifier
,
VBDISP_CALLGET
,
&
ref
);
...
...
@@ -326,6 +336,18 @@ static HRESULT do_icall(exec_ctx_t *ctx, VARIANT *res)
if
(
FAILED
(
hres
))
return
hres
;
break
;
case
REF_OBJ
:
if
(
arg_cnt
)
{
FIXME
(
"arguments on object
\n
"
);
return
E_NOTIMPL
;
}
if
(
res
)
{
IDispatch_AddRef
(
ref
.
u
.
obj
);
V_VT
(
res
)
=
VT_DISPATCH
;
V_DISPATCH
(
res
)
=
ref
.
u
.
obj
;
}
break
;
case
REF_NONE
:
FIXME
(
"%s not found
\n
"
,
debugstr_w
(
identifier
));
return
DISP_E_UNKNOWNNAME
;
...
...
@@ -440,6 +462,9 @@ static HRESULT assign_ident(exec_ctx_t *ctx, BSTR name, VARIANT *val, BOOL own_v
case
REF_FUNC
:
FIXME
(
"functions not implemented
\n
"
);
return
E_NOTIMPL
;
case
REF_OBJ
:
FIXME
(
"REF_OBJ
\n
"
);
return
E_NOTIMPL
;
case
REF_NONE
:
FIXME
(
"%s not found
\n
"
,
debugstr_w
(
name
));
if
(
own_val
)
...
...
dlls/vbscript/tests/api.vbs
View file @
13d8e7b8
...
...
@@ -32,4 +32,6 @@ Call ok(not isObject(4), "isObject(4) is true?")
Call
ok
(
not
isObject
(
"x"
),
"isObject(
""
x
""
) is true?"
)
Call
ok
(
not
isObject
(
Null
),
"isObject(Null) is true?"
)
Call
ok
(
getVT
(
err
)
=
"VT_DISPATCH"
,
"getVT(err) = "
&
getVT
(
err
))
Call
reportSuccess
()
dlls/vbscript/vbscript.c
View file @
13d8e7b8
...
...
@@ -131,6 +131,8 @@ static void destroy_script(script_ctx_t *ctx)
IDispatch_Release
(
ctx
->
host_global
);
if
(
ctx
->
site
)
IActiveScriptSite_Release
(
ctx
->
site
);
if
(
ctx
->
err_obj
)
IDispatchEx_Release
(
&
ctx
->
err_obj
->
IDispatchEx_iface
);
if
(
ctx
->
global_obj
)
IDispatchEx_Release
(
&
ctx
->
global_obj
->
IDispatchEx_iface
);
if
(
ctx
->
script_obj
)
...
...
dlls/vbscript/vbscript.h
View file @
13d8e7b8
...
...
@@ -150,6 +150,9 @@ struct _script_ctx_t {
class_desc_t
global_desc
;
vbdisp_t
*
global_obj
;
class_desc_t
err_desc
;
vbdisp_t
*
err_obj
;
dynamic_var_t
*
global_vars
;
function_t
*
global_funcs
;
class_desc_t
*
classes
;
...
...
@@ -160,6 +163,7 @@ struct _script_ctx_t {
};
HRESULT
init_global
(
script_ctx_t
*
);
HRESULT
init_err
(
script_ctx_t
*
);
typedef
enum
{
ARG_NONE
=
0
,
...
...
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