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
f41c2db0
Commit
f41c2db0
authored
Oct 03, 2019
by
Jacek Caban
Committed by
Alexandre Julliard
Oct 03, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vbscript: Add err.raise function implementation.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
c65a809f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
55 additions
and
3 deletions
+55
-3
global.c
dlls/vbscript/global.c
+55
-3
No files found.
dlls/vbscript/global.c
View file @
f41c2db0
...
...
@@ -2526,8 +2526,60 @@ static HRESULT Err_Clear(vbdisp_t *This, VARIANT *args, unsigned args_cnt, VARIA
static
HRESULT
Err_Raise
(
vbdisp_t
*
This
,
VARIANT
*
args
,
unsigned
args_cnt
,
VARIANT
*
res
)
{
FIXME
(
"
\n
"
);
return
E_NOTIMPL
;
BSTR
source
=
NULL
,
description
=
NULL
,
helpfile
=
NULL
;
int
code
,
helpcontext
=
0
;
HRESULT
hres
,
error
;
TRACE
(
"%s %u...
\n
"
,
debugstr_variant
(
args
),
args_cnt
);
hres
=
to_int
(
args
,
&
code
);
if
(
FAILED
(
hres
))
return
hres
;
if
(
code
>
0
&&
code
>
0xffff
)
return
E_INVALIDARG
;
if
(
args_cnt
>=
2
)
hres
=
to_string
(
args
+
1
,
&
source
);
if
(
args_cnt
>=
3
&&
SUCCEEDED
(
hres
))
hres
=
to_string
(
args
+
2
,
&
description
);
if
(
args_cnt
>=
4
&&
SUCCEEDED
(
hres
))
hres
=
to_string
(
args
+
3
,
&
helpfile
);
if
(
args_cnt
>=
5
&&
SUCCEEDED
(
hres
))
hres
=
to_int
(
args
+
4
,
&
helpcontext
);
if
(
SUCCEEDED
(
hres
)
&&
This
->
desc
)
{
script_ctx_t
*
ctx
=
This
->
desc
->
ctx
;
error
=
(
code
&
~
0xffff
)
?
map_hres
(
code
)
:
MAKE_VBSERROR
(
code
);
if
(
source
)
{
if
(
ctx
->
ei
.
bstrSource
)
SysFreeString
(
ctx
->
ei
.
bstrSource
);
ctx
->
ei
.
bstrSource
=
source
;
}
if
(
!
ctx
->
ei
.
bstrSource
)
ctx
->
ei
.
bstrSource
=
get_vbscript_string
(
VBS_RUNTIME_ERROR
);
if
(
description
)
{
if
(
ctx
->
ei
.
bstrDescription
)
SysFreeString
(
ctx
->
ei
.
bstrDescription
);
ctx
->
ei
.
bstrDescription
=
description
;
}
if
(
!
ctx
->
ei
.
bstrDescription
)
ctx
->
ei
.
bstrDescription
=
get_vbscript_error_string
(
error
);
if
(
helpfile
)
{
if
(
ctx
->
ei
.
bstrHelpFile
)
SysFreeString
(
ctx
->
ei
.
bstrHelpFile
);
ctx
->
ei
.
bstrHelpFile
=
helpfile
;
}
if
(
args_cnt
>=
5
)
ctx
->
ei
.
dwHelpContext
=
helpcontext
;
ctx
->
ei
.
scode
=
error
;
hres
=
SCRIPT_E_RECORDED
;
}
else
{
SysFreeString
(
source
);
SysFreeString
(
description
);
SysFreeString
(
helpfile
);
}
return
hres
;
}
static
const
builtin_prop_t
err_props
[]
=
{
...
...
@@ -2537,7 +2589,7 @@ static const builtin_prop_t err_props[] = {
{
DISPID_ERR_NUMBER
,
Err_Number
,
BP_GETPUT
},
{
DISPID_ERR_SOURCE
,
Err_Source
,
BP_GETPUT
},
{
DISPID_ERR_CLEAR
,
Err_Clear
},
{
DISPID_ERR_RAISE
,
Err_Raise
,
0
,
5
},
{
DISPID_ERR_RAISE
,
Err_Raise
,
0
,
1
,
5
},
};
HRESULT
init_global
(
script_ctx_t
*
ctx
)
...
...
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