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
0708b77b
Commit
0708b77b
authored
Jul 11, 2012
by
Jacek Caban
Committed by
Alexandre Julliard
Jul 11, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vbscript: Added UCase implementation.
parent
98c605d6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
65 additions
and
2 deletions
+65
-2
global.c
dlls/vbscript/global.c
+51
-2
api.vbs
dlls/vbscript/tests/api.vbs
+14
-0
No files found.
dlls/vbscript/global.c
View file @
0708b77b
...
...
@@ -122,6 +122,30 @@ static HRESULT to_int(VARIANT *v, int *ret)
return
S_OK
;
}
static
HRESULT
to_string
(
VARIANT
*
v
,
BSTR
*
ret
)
{
static
const
WCHAR
trueW
[]
=
{
'T'
,
'r'
,
'u'
,
'e'
,
0
};
static
const
WCHAR
falseW
[]
=
{
'F'
,
'a'
,
'l'
,
's'
,
'e'
,
0
};
switch
(
V_VT
(
v
))
{
case
VT_BOOL
:
*
ret
=
SysAllocString
(
V_BOOL
(
v
)
?
trueW
:
falseW
);
return
*
ret
?
S_OK
:
E_OUTOFMEMORY
;
default:
{
VARIANT
dst
;
HRESULT
hres
;
V_VT
(
&
dst
)
=
VT_EMPTY
;
hres
=
VariantChangeTypeEx
(
&
dst
,
v
,
MAKELCID
(
MAKELANGID
(
LANG_ENGLISH
,
SUBLANG_ENGLISH_US
),
SORT_DEFAULT
),
0
,
VT_BSTR
);
if
(
FAILED
(
hres
))
return
hres
;
*
ret
=
V_BSTR
(
&
dst
);
return
S_OK
;
}
}
}
static
IUnknown
*
create_object
(
script_ctx_t
*
ctx
,
const
WCHAR
*
progid
)
{
IInternetHostSecurityManager
*
secmgr
=
NULL
;
...
...
@@ -564,8 +588,33 @@ static HRESULT Global_LCase(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VAR
static
HRESULT
Global_UCase
(
vbdisp_t
*
This
,
VARIANT
*
arg
,
unsigned
args_cnt
,
VARIANT
*
res
)
{
FIXME
(
"
\n
"
);
return
E_NOTIMPL
;
BSTR
str
;
HRESULT
hres
;
TRACE
(
"%s
\n
"
,
debugstr_variant
(
arg
));
if
(
V_VT
(
arg
)
==
VT_NULL
)
{
if
(
res
)
V_VT
(
res
)
=
VT_NULL
;
return
S_OK
;
}
hres
=
to_string
(
arg
,
&
str
);
if
(
FAILED
(
hres
))
return
hres
;
if
(
res
)
{
WCHAR
*
ptr
;
for
(
ptr
=
str
;
*
ptr
;
ptr
++
)
*
ptr
=
toupperW
(
*
ptr
);
V_VT
(
res
)
=
VT_BSTR
;
V_BSTR
(
res
)
=
str
;
}
else
{
SysFreeString
(
str
);
}
return
S_OK
;
}
static
HRESULT
Global_LTrim
(
vbdisp_t
*
This
,
VARIANT
*
arg
,
unsigned
args_cnt
,
VARIANT
*
res
)
...
...
dlls/vbscript/tests/api.vbs
View file @
0708b77b
...
...
@@ -145,4 +145,18 @@ TestMid2 "test", 2, "est"
TestMid2
"test"
,
4
,
"t"
TestMid2
"test"
,
5
,
""
Sub
TestUCase
(
str
,
ex
)
x
=
UCase
(
str
)
Call
ok
(
x
=
ex
,
"UCase("
&
str
&
") = "
&
x
&
" expected "
&
ex
)
End
Sub
TestUCase
"test"
,
"TEST"
TestUCase
"123aBC?"
,
"123ABC?"
TestUCase
""
,
""
TestUCase
1
,
"1"
TestUCase
true
,
"TRUE"
TestUCase
0.123
,
"0.123"
TestUCase
Empty
,
""
Call
ok
(
getVT
(
UCase
(
Null
))
=
"VT_NULL"
,
"getVT(UCase(Null)) = "
&
getVT
(
UCase
(
Null
)))
Call
reportSuccess
()
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