Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
4e3c4d6f
Commit
4e3c4d6f
authored
Nov 03, 2020
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Nov 04, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wscript: Use wide-char string literals.
Signed-off-by:
Michael Stefaniuc
<
mstefani@winehq.org
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
908c837b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
30 deletions
+12
-30
host.c
programs/wscript/host.c
+3
-9
main.c
programs/wscript/main.c
+9
-21
No files found.
programs/wscript/host.c
View file @
4e3c4d6f
...
...
@@ -33,8 +33,6 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
wscript
);
#define BUILDVERSION 16535
static
const
WCHAR
wshNameW
[]
=
{
'W'
,
'i'
,
'n'
,
'd'
,
'o'
,
'w'
,
's'
,
' '
,
'S'
,
'c'
,
'r'
,
'i'
,
'p'
,
't'
,
' '
,
'H'
,
'o'
,
's'
,
't'
,
0
};
static
const
WCHAR
wshVersionW
[]
=
{
'5'
,
'.'
,
'8'
};
VARIANT_BOOL
wshInteractive
=
...
...
@@ -49,10 +47,8 @@ static HRESULT to_string(VARIANT *src, BSTR *dst)
VARIANT
v
;
HRESULT
hres
;
static
const
WCHAR
nullW
[]
=
{
'n'
,
'u'
,
'l'
,
'l'
,
0
};
if
(
V_VT
(
src
)
==
VT_NULL
)
{
*
dst
=
SysAllocString
(
nullW
);
*
dst
=
SysAllocString
(
L"null"
);
return
*
dst
?
S_OK
:
E_OUTOFMEMORY
;
}
...
...
@@ -73,9 +69,7 @@ static void print_string(const WCHAR *string)
char
*
buf
;
if
(
wshInteractive
)
{
static
const
WCHAR
windows_script_hostW
[]
=
{
'W'
,
'i'
,
'n'
,
'd'
,
'o'
,
'w'
,
's'
,
' '
,
'S'
,
'c'
,
'r'
,
'i'
,
'p'
,
't'
,
' '
,
'H'
,
'o'
,
's'
,
't'
,
0
};
MessageBoxW
(
NULL
,
string
,
windows_script_hostW
,
MB_OK
);
MessageBoxW
(
NULL
,
string
,
L"Windows Script Host"
,
MB_OK
);
return
;
}
...
...
@@ -163,7 +157,7 @@ static HRESULT WINAPI Host_get_Name(IHost *iface, BSTR *out_Name)
{
WINE_TRACE
(
"(%p)
\n
"
,
out_Name
);
if
(
!
(
*
out_Name
=
SysAllocString
(
wshNameW
)))
if
(
!
(
*
out_Name
=
SysAllocString
(
L"Windows Script Host"
)))
return
E_OUTOFMEMORY
;
return
S_OK
;
}
...
...
programs/wscript/main.c
View file @
4e3c4d6f
...
...
@@ -47,9 +47,6 @@
#endif
WINE_DEFAULT_DEBUG_CHANNEL
(
wscript
);
static
const
WCHAR
wscriptW
[]
=
{
'W'
,
'S'
,
'c'
,
'r'
,
'i'
,
'p'
,
't'
,
0
};
static
const
WCHAR
wshW
[]
=
{
'W'
,
'S'
,
'H'
,
0
};
WCHAR
scriptFullName
[
MAX_PATH
];
ITypeInfo
*
host_ti
;
...
...
@@ -86,7 +83,7 @@ static HRESULT WINAPI ActiveScriptSite_GetItemInfo(IActiveScriptSite *iface,
{
WINE_TRACE
(
"(%s %x %p %p)
\n
"
,
wine_dbgstr_w
(
pstrName
),
dwReturnMask
,
ppunkItem
,
ppti
);
if
(
lstrcmpW
(
pstrName
,
wshW
)
&&
lstrcmpW
(
pstrName
,
wscriptW
))
if
(
lstrcmpW
(
pstrName
,
L"WSH"
)
&&
lstrcmpW
(
pstrName
,
L"WScript"
))
return
E_FAIL
;
if
(
dwReturnMask
&
SCRIPTINFO_ITYPEINFO
)
{
...
...
@@ -223,9 +220,7 @@ static BOOL load_typelib(void)
ITypeLib
*
typelib
;
HRESULT
hres
;
static
const
WCHAR
wscript_exeW
[]
=
{
'w'
,
's'
,
'c'
,
'r'
,
'i'
,
'p'
,
't'
,
'.'
,
'e'
,
'x'
,
'e'
,
0
};
hres
=
LoadTypeLib
(
wscript_exeW
,
&
typelib
);
hres
=
LoadTypeLib
(
L"wscript.exe"
,
&
typelib
);
if
(
FAILED
(
hres
))
return
FALSE
;
...
...
@@ -245,9 +240,6 @@ static BOOL get_engine_clsid(const WCHAR *ext, CLSID *clsid)
HKEY
hkey
;
HRESULT
hres
;
static
const
WCHAR
script_engineW
[]
=
{
'\\'
,
'S'
,
'c'
,
'r'
,
'i'
,
'p'
,
't'
,
'E'
,
'n'
,
'g'
,
'i'
,
'n'
,
'e'
,
0
};
res
=
RegOpenKeyW
(
HKEY_CLASSES_ROOT
,
ext
,
&
hkey
);
if
(
res
!=
ERROR_SUCCESS
)
return
FALSE
;
...
...
@@ -260,7 +252,7 @@ static BOOL get_engine_clsid(const WCHAR *ext, CLSID *clsid)
WINE_TRACE
(
"fileid is %s
\n
"
,
wine_dbgstr_w
(
fileid
));
lstrcatW
(
fileid
,
script_engineW
);
lstrcatW
(
fileid
,
L"
\\
ScriptEngine"
);
res
=
RegOpenKeyW
(
HKEY_CLASSES_ROOT
,
fileid
,
&
hkey
);
if
(
res
!=
ERROR_SUCCESS
)
return
FALSE
;
...
...
@@ -319,11 +311,11 @@ static BOOL init_engine(IActiveScript *script, IActiveScriptParse *parser)
if
(
FAILED
(
hres
))
return
FALSE
;
hres
=
IActiveScript_AddNamedItem
(
script
,
wscriptW
,
SCRIPTITEM_ISVISIBLE
);
hres
=
IActiveScript_AddNamedItem
(
script
,
L"WScript"
,
SCRIPTITEM_ISVISIBLE
);
if
(
FAILED
(
hres
))
return
FALSE
;
hres
=
IActiveScript_AddNamedItem
(
script
,
wshW
,
SCRIPTITEM_ISVISIBLE
);
hres
=
IActiveScript_AddNamedItem
(
script
,
L"WSH"
,
SCRIPTITEM_ISVISIBLE
);
if
(
FAILED
(
hres
))
return
FALSE
;
...
...
@@ -387,10 +379,6 @@ static void run_script(const WCHAR *filename, IActiveScript *script, IActiveScri
static
BOOL
set_host_properties
(
const
WCHAR
*
prop
)
{
static
const
WCHAR
nologoW
[]
=
{
'n'
,
'o'
,
'l'
,
'o'
,
'g'
,
'o'
,
0
};
static
const
WCHAR
iactive
[]
=
{
'i'
,
0
};
static
const
WCHAR
batch
[]
=
{
'b'
,
0
};
if
(
*
prop
==
'/'
)
{
++
prop
;
if
(
*
prop
==
'/'
)
...
...
@@ -399,12 +387,12 @@ static BOOL set_host_properties(const WCHAR *prop)
else
++
prop
;
if
(
wcsicmp
(
prop
,
iactive
)
==
0
)
if
(
wcsicmp
(
prop
,
L"i"
)
==
0
)
wshInteractive
=
VARIANT_TRUE
;
else
if
(
wcsicmp
(
prop
,
batch
)
==
0
)
else
if
(
wcsicmp
(
prop
,
L"b"
)
==
0
)
wshInteractive
=
VARIANT_FALSE
;
else
if
(
wcsicmp
(
prop
,
nologoW
)
==
0
)
WINE_FIXME
(
"ignored %s switch
\n
"
,
debugstr_w
(
nologoW
));
else
if
(
wcsicmp
(
prop
,
L"nologo"
)
==
0
)
WINE_FIXME
(
"ignored %s switch
\n
"
,
debugstr_w
(
L"nologo"
));
else
{
WINE_FIXME
(
"unsupported switch %s
\n
"
,
debugstr_w
(
prop
));
...
...
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