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
5f3c38ed
Commit
5f3c38ed
authored
Feb 27, 2013
by
Jacek Caban
Committed by
Alexandre Julliard
Feb 27, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vbscipt: Added string constants.
parent
b58dadf0
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
50 additions
and
63 deletions
+50
-63
global.c
dlls/vbscript/global.c
+18
-62
api.vbs
dlls/vbscript/tests/api.vbs
+14
-0
vbdisp.c
dlls/vbscript/vbdisp.c
+12
-0
vbscript.h
dlls/vbscript/vbscript.h
+6
-1
No files found.
dlls/vbscript/global.c
View file @
5f3c38ed
...
...
@@ -1609,59 +1609,15 @@ static HRESULT Global_GetRef(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VA
return
E_NOTIMPL
;
}
static
HRESULT
Global_vbCr
(
vbdisp_t
*
This
,
VARIANT
*
arg
,
unsigned
args_cnt
,
VARIANT
*
res
)
{
FIXME
(
"
\n
"
);
return
E_NOTIMPL
;
}
static
HRESULT
Global_vbCrLf
(
vbdisp_t
*
This
,
VARIANT
*
arg
,
unsigned
args_cnt
,
VARIANT
*
res
)
{
FIXME
(
"
\n
"
);
return
E_NOTIMPL
;
}
static
HRESULT
Global_vbNewLine
(
vbdisp_t
*
This
,
VARIANT
*
arg
,
unsigned
args_cnt
,
VARIANT
*
res
)
{
FIXME
(
"
\n
"
);
return
E_NOTIMPL
;
}
static
HRESULT
Global_vbFormFeed
(
vbdisp_t
*
This
,
VARIANT
*
arg
,
unsigned
args_cnt
,
VARIANT
*
res
)
{
FIXME
(
"
\n
"
);
return
E_NOTIMPL
;
}
static
HRESULT
Global_vbLf
(
vbdisp_t
*
This
,
VARIANT
*
arg
,
unsigned
args_cnt
,
VARIANT
*
res
)
{
FIXME
(
"
\n
"
);
return
E_NOTIMPL
;
}
static
HRESULT
Global_vbNullChar
(
vbdisp_t
*
This
,
VARIANT
*
arg
,
unsigned
args_cnt
,
VARIANT
*
res
)
{
FIXME
(
"
\n
"
);
return
E_NOTIMPL
;
}
static
HRESULT
Global_vbNullString
(
vbdisp_t
*
This
,
VARIANT
*
arg
,
unsigned
args_cnt
,
VARIANT
*
res
)
{
FIXME
(
"
\n
"
);
return
E_NOTIMPL
;
}
static
HRESULT
Global_vbTab
(
vbdisp_t
*
This
,
VARIANT
*
arg
,
unsigned
args_cnt
,
VARIANT
*
res
)
{
FIXME
(
"
\n
"
);
return
E_NOTIMPL
;
}
static
HRESULT
Global_vbVerticalTab
(
vbdisp_t
*
This
,
VARIANT
*
arg
,
unsigned
args_cnt
,
VARIANT
*
res
)
{
FIXME
(
"
\n
"
);
return
E_NOTIMPL
;
}
static
const
string_constant_t
vbCr
=
{
1
,
{
'\r'
}};
static
const
string_constant_t
vbCrLf
=
{
2
,
{
'\r'
,
'\n'
}};
static
const
string_constant_t
vbNewLine
=
{
2
,
{
'\r'
,
'\n'
}};
static
const
string_constant_t
vbFormFeed
=
{
1
,
{
0xc
}};
static
const
string_constant_t
vbLf
=
{
1
,
{
'\n'
}};
static
const
string_constant_t
vbNullChar
=
{
1
};
static
const
string_constant_t
vbNullString
=
{
0
};
static
const
string_constant_t
vbTab
=
{
1
,
{
'\t'
}};
static
const
string_constant_t
vbVerticalTab
=
{
1
,
{
0xb
}};
static
const
builtin_prop_t
global_props
[]
=
{
{
DISPID_GLOBAL_VBUSESYSTEM
,
NULL
,
BP_GET
,
VT_I2
,
0
},
...
...
@@ -1736,15 +1692,15 @@ static const builtin_prop_t global_props[] = {
{
DISPID_GLOBAL_VBRED
,
NULL
,
BP_GET
,
VT_I4
,
0x0000ff
},
{
DISPID_GLOBAL_VBWHITE
,
NULL
,
BP_GET
,
VT_I4
,
0xffffff
},
{
DISPID_GLOBAL_VBYELLOW
,
NULL
,
BP_GET
,
VT_I4
,
0x00ffff
},
{
DISPID_GLOBAL_VBCR
,
Global_vbCr
,
BP_GET
},
{
DISPID_GLOBAL_VBCRLF
,
Global_vbCrLf
,
BP_GET
},
{
DISPID_GLOBAL_VBNEWLINE
,
Global_vbNewLine
,
BP_GET
},
{
DISPID_GLOBAL_VBFORMFEED
,
Global_vbFormFeed
,
BP_GET
},
{
DISPID_GLOBAL_VBLF
,
Global_vbLf
,
BP_GET
},
{
DISPID_GLOBAL_VBNULLCHAR
,
Global_vbNullChar
,
BP_GET
},
{
DISPID_GLOBAL_VBNULLSTRING
,
Global_vbNullString
,
BP_GET
},
{
DISPID_GLOBAL_VBTAB
,
Global_vbTab
,
BP_GET
},
{
DISPID_GLOBAL_VBVERTICALTAB
,
Global_vbVerticalTab
,
BP_GET
},
{
DISPID_GLOBAL_VBCR
,
NULL
,
BP_GET
,
VT_BSTR
,
(
UINT_PTR
)
&
vbCr
},
{
DISPID_GLOBAL_VBCRLF
,
NULL
,
BP_GET
,
VT_BSTR
,
(
UINT_PTR
)
&
vbCrLf
},
{
DISPID_GLOBAL_VBNEWLINE
,
NULL
,
BP_GET
,
VT_BSTR
,
(
UINT_PTR
)
&
vbNewLine
},
{
DISPID_GLOBAL_VBFORMFEED
,
NULL
,
BP_GET
,
VT_BSTR
,
(
UINT_PTR
)
&
vbFormFeed
},
{
DISPID_GLOBAL_VBLF
,
NULL
,
BP_GET
,
VT_BSTR
,
(
UINT_PTR
)
&
vbLf
},
{
DISPID_GLOBAL_VBNULLCHAR
,
NULL
,
BP_GET
,
VT_BSTR
,
(
UINT_PTR
)
&
vbNullChar
},
{
DISPID_GLOBAL_VBNULLSTRING
,
NULL
,
BP_GET
,
VT_BSTR
,
(
UINT_PTR
)
&
vbNullString
},
{
DISPID_GLOBAL_VBTAB
,
NULL
,
BP_GET
,
VT_BSTR
,
(
UINT_PTR
)
&
vbTab
},
{
DISPID_GLOBAL_VBVERTICALTAB
,
NULL
,
BP_GET
,
VT_BSTR
,
(
UINT_PTR
)
&
vbVerticalTab
},
{
DISPID_GLOBAL_CCUR
,
Global_CCur
,
0
,
1
},
{
DISPID_GLOBAL_CINT
,
Global_CInt
,
0
,
1
},
{
DISPID_GLOBAL_CLNG
,
Global_CLng
,
0
,
1
},
...
...
dlls/vbscript/tests/api.vbs
View file @
5f3c38ed
...
...
@@ -48,6 +48,11 @@ Sub TestConstantI4(name, val, exval)
Call
ok
(
getVT
(
val
)
=
"VT_I4*"
,
"getVT("
&
name
&
") = "
&
getVT
(
val
))
End
Sub
Sub
TestConstantBSTR
(
name
,
val
,
exval
)
Call
ok
(
val
=
exval
,
name
&
" = "
&
val
&
" expected "
&
exval
)
Call
ok
(
getVT
(
val
)
=
"VT_BSTR*"
,
"getVT("
&
name
&
") = "
&
getVT
(
val
))
End
Sub
TestConstant
"vbEmpty"
,
vbEmpty
,
0
TestConstant
"vbNull"
,
vbNull
,
1
TestConstant
"vbLong"
,
vbLong
,
3
...
...
@@ -103,6 +108,15 @@ TestConstantI4 "vbMagenta", vbMagenta, &hff00ff&
TestConstantI4
"vbRed"
,
vbRed
,
&
h0000ff&
TestConstantI4
"vbWhite"
,
vbWhite
,
&
hffffff&
TestConstantI4
"vbYellow"
,
vbYellow
,
&
h00ffff&
TestConstantBSTR
"vbCr"
,
vbCr
,
Chr
(
13
)
TestConstantBSTR
"vbCrLf"
,
vbCrLf
,
Chr
(
13
)
&
Chr
(
10
)
TestConstantBSTR
"vbNewLine"
,
vbNewLine
,
Chr
(
13
)
&
Chr
(
10
)
TestConstantBSTR
"vbFormFeed"
,
vbFormFeed
,
Chr
(
12
)
TestConstantBSTR
"vbLf"
,
vbLf
,
Chr
(
10
)
TestConstantBSTR
"vbNullChar"
,
vbNullChar
,
Chr
(
0
)
TestConstantBSTR
"vbNullString"
,
vbNullString
,
""
TestConstantBSTR
"vbTab"
,
vbTab
,
chr
(
9
)
TestConstantBSTR
"vbVerticalTab"
,
vbVerticalTab
,
chr
(
11
)
Sub
TestCStr
(
arg
,
exval
)
dim
x
...
...
dlls/vbscript/vbdisp.c
View file @
5f3c38ed
...
...
@@ -160,6 +160,18 @@ static HRESULT invoke_builtin(vbdisp_t *This, const builtin_prop_t *prop, WORD f
V_VT
(
res
)
=
VT_I4
;
V_I4
(
res
)
=
val
;
break
;
case
VT_BSTR
:
{
const
string_constant_t
*
str
=
(
const
string_constant_t
*
)
prop
->
max_args
;
BSTR
ret
;
ret
=
SysAllocStringLen
(
str
->
buf
,
str
->
len
);
if
(
!
ret
)
return
E_OUTOFMEMORY
;
V_VT
(
res
)
=
VT_BSTR
;
V_BSTR
(
res
)
=
ret
;
break
;
}
default:
assert
(
0
);
}
...
...
dlls/vbscript/vbscript.h
View file @
5f3c38ed
...
...
@@ -86,7 +86,7 @@ typedef struct {
HRESULT
(
*
proc
)(
vbdisp_t
*
,
VARIANT
*
,
unsigned
,
VARIANT
*
);
DWORD
flags
;
unsigned
min_args
;
unsigned
max_args
;
UINT_PTR
max_args
;
}
builtin_prop_t
;
typedef
struct
_class_desc_t
{
...
...
@@ -334,6 +334,11 @@ HRESULT compile_script(script_ctx_t*,const WCHAR*,const WCHAR*,vbscode_t**) DECL
HRESULT
exec_script
(
script_ctx_t
*
,
function_t
*
,
IDispatch
*
,
DISPPARAMS
*
,
VARIANT
*
)
DECLSPEC_HIDDEN
;
void
release_dynamic_vars
(
dynamic_var_t
*
)
DECLSPEC_HIDDEN
;
typedef
struct
{
UINT16
len
;
WCHAR
buf
[
7
];
}
string_constant_t
;
#define TID_LIST \
XDIID(ErrObj) \
XDIID(GlobalObj)
...
...
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