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
1c293750
Commit
1c293750
authored
Aug 23, 2011
by
Michał Ziętek
Committed by
Alexandre Julliard
Aug 25, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wscript: Implemented Arguments2_Item.
parent
2d2a91fd
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
25 additions
and
3 deletions
+25
-3
arguments.c
programs/wscript/arguments.c
+11
-2
main.c
programs/wscript/main.c
+2
-0
run.c
programs/wscript/tests/run.c
+1
-1
run.js
programs/wscript/tests/run.js
+7
-0
wscript.h
programs/wscript/wscript.h
+4
-0
No files found.
programs/wscript/arguments.c
View file @
1c293750
...
...
@@ -31,6 +31,9 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
wscript
);
WCHAR
**
argums
;
int
numOfArgs
;
static
HRESULT
WINAPI
Arguments2_QueryInterface
(
IArguments2
*
iface
,
REFIID
riid
,
void
**
ppv
)
{
WINE_TRACE
(
"(%s %p)
\n
"
,
wine_dbgstr_guid
(
riid
),
ppv
);
...
...
@@ -95,8 +98,14 @@ static HRESULT WINAPI Arguments2_Invoke(IArguments2 *iface, DISPID dispIdMember,
static
HRESULT
WINAPI
Arguments2_Item
(
IArguments2
*
iface
,
LONG
index
,
BSTR
*
out_Value
)
{
WINE_FIXME
(
"(%d %p)
\n
"
,
index
,
out_Value
);
return
E_NOTIMPL
;
WINE_TRACE
(
"(%d %p)
\n
"
,
index
,
out_Value
);
if
(
index
<
0
||
index
>=
numOfArgs
)
return
E_INVALIDARG
;
if
(
!
(
*
out_Value
=
SysAllocString
(
argums
[
index
])))
return
E_OUTOFMEMORY
;
return
S_OK
;
}
static
HRESULT
WINAPI
Arguments2_Count
(
IArguments2
*
iface
,
LONG
*
out_Count
)
...
...
programs/wscript/main.c
View file @
1c293750
...
...
@@ -343,6 +343,8 @@ int WINAPI wWinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPWSTR cmdline, int cm
WINE_FIXME
(
"Unsupported argument %s
\n
"
,
wine_dbgstr_w
(
argv
[
i
]));
}
else
{
filename
=
argv
[
i
];
argums
=
argv
+
i
+
1
;
numOfArgs
=
argc
-
i
-
1
;
break
;
}
}
...
...
programs/wscript/tests/run.c
View file @
1c293750
...
...
@@ -336,7 +336,7 @@ static void run_test(const char *file_name)
BOOL
bres
;
script_name
=
file_name
;
sprintf
(
command
,
"wscript.exe %s"
,
file_name
);
sprintf
(
command
,
"wscript.exe %s
arg1 2 ar3
"
,
file_name
);
SET_EXPECT
(
reportSuccess
);
...
...
programs/wscript/tests/run.js
View file @
1c293750
...
...
@@ -33,5 +33,12 @@ ok(WScript.Path === winetest.wscriptPath, "WScript.Path = ", WScript.Path);
ok
(
WScript
.
ScriptName
===
winetest
.
wscriptScriptName
,
"WScript.ScriptName = "
+
WScript
.
ScriptName
);
ok
(
WScript
.
ScriptFullName
===
winetest
.
wscriptScriptFullName
,
"WScript.ScriptFullName = "
+
WScript
.
ScriptFullName
);
ok
(
typeof
(
WScript
.
Arguments
)
===
"object"
,
"typeof(WScript.Arguments) = "
+
typeof
(
WScript
.
Arguments
));
ok
(
WScript
.
Arguments
.
Item
(
0
)
===
"arg1"
,
"WScript.Arguments.Item(0) = "
+
WScript
.
Arguments
.
Item
(
0
));
ok
(
WScript
.
Arguments
.
Item
(
1
)
===
"2"
,
"WScript.Arguments.Item(1) = "
+
WScript
.
Arguments
.
Item
(
1
));
ok
(
WScript
.
Arguments
.
Item
(
2
)
===
"ar3"
,
"WScript.Arguments.Item(2) = "
+
WScript
.
Arguments
.
Item
(
2
));
try
{
WScript
.
Arguments
.
Item
(
3
);
ok
(
false
,
"expected exception"
);
}
catch
(
e
)
{}
winetest
.
reportSuccess
();
programs/wscript/wscript.h
View file @
1c293750
...
...
@@ -27,3 +27,7 @@ extern ITypeInfo *host_ti;
extern
ITypeInfo
*
arguments_ti
;
extern
WCHAR
scriptFullName
[];
extern
WCHAR
**
argums
;
extern
int
numOfArgs
;
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