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
d6fd86e8
Commit
d6fd86e8
authored
Jul 20, 2011
by
Michał Ziętek
Committed by
Alexandre Julliard
Jul 21, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wscript: Implemented Host_get_FullName.
parent
f669cca9
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
6 deletions
+34
-6
host.c
programs/wscript/host.c
+9
-2
Makefile.in
programs/wscript/tests/Makefile.in
+1
-1
run.c
programs/wscript/tests/run.c
+23
-3
run.js
programs/wscript/tests/run.js
+1
-0
No files found.
programs/wscript/host.c
View file @
d6fd86e8
...
...
@@ -114,8 +114,15 @@ static HRESULT WINAPI Host_get_Application(IHost *iface, IDispatch **out_Dispatc
static
HRESULT
WINAPI
Host_get_FullName
(
IHost
*
iface
,
BSTR
*
out_Path
)
{
WINE_FIXME
(
"(%p)
\n
"
,
out_Path
);
return
E_NOTIMPL
;
WCHAR
fullPath
[
MAX_PATH
];
WINE_TRACE
(
"(%p)
\n
"
,
out_Path
);
if
(
GetModuleFileNameW
(
NULL
,
fullPath
,
sizeof
(
fullPath
)
/
sizeof
(
WCHAR
))
==
0
)
return
E_FAIL
;
if
(
!
(
*
out_Path
=
SysAllocString
(
fullPath
)))
return
E_OUTOFMEMORY
;
return
S_OK
;
}
static
HRESULT
WINAPI
Host_get_Path
(
IHost
*
iface
,
BSTR
*
out_Path
)
...
...
programs/wscript/tests/Makefile.in
View file @
d6fd86e8
TESTDLL
=
wscript.exe
IMPORTS
=
ole32 advapi32
IMPORTS
=
ole32
oleaut32
advapi32
C_SRCS
=
\
run.c
...
...
programs/wscript/tests/run.c
View file @
d6fd86e8
...
...
@@ -56,9 +56,10 @@
DEFINE_EXPECT
(
reportSuccess
);
#define DISPID_TESTOBJ_OK 10000
#define DISPID_TESTOBJ_TRACE 10001
#define DISPID_TESTOBJ_REPORTSUCCESS 10002
#define DISPID_TESTOBJ_OK 10000
#define DISPID_TESTOBJ_TRACE 10001
#define DISPID_TESTOBJ_REPORTSUCCESS 10002
#define DISPID_TESTOBJ_WSCRIPTFULLNAME 10003
#define TESTOBJ_CLSID "{178fc166-f585-4e24-9c13-4bb7faf80646}"
...
...
@@ -120,6 +121,8 @@ static HRESULT WINAPI Dispatch_GetIDsOfNames(IDispatch *iface, REFIID riid,
rgDispId
[
i
]
=
DISPID_TESTOBJ_TRACE
;
}
else
if
(
!
strcmp_wa
(
rgszNames
[
i
],
"reportSuccess"
))
{
rgDispId
[
i
]
=
DISPID_TESTOBJ_REPORTSUCCESS
;
}
else
if
(
!
strcmp_wa
(
rgszNames
[
i
],
"wscriptFullName"
))
{
rgDispId
[
i
]
=
DISPID_TESTOBJ_WSCRIPTFULLNAME
;
}
else
{
ok
(
0
,
"unexpected name %s
\n
"
,
wine_dbgstr_w
(
rgszNames
[
i
]));
return
DISP_E_UNKNOWNNAME
;
...
...
@@ -161,6 +164,23 @@ static HRESULT WINAPI Dispatch_Invoke(IDispatch *iface, DISPID dispIdMember, REF
if
(
pVarResult
)
V_VT
(
pVarResult
)
=
VT_EMPTY
;
break
;
case
DISPID_TESTOBJ_WSCRIPTFULLNAME
:
{
WCHAR
fullName
[
MAX_PATH
];
const
WCHAR
wscriptexe
[]
=
{
'w'
,
's'
,
'c'
,
'r'
,
'i'
,
'p'
,
't'
,
'.'
,
'e'
,
'x'
,
'e'
,
0
};
DWORD
res
;
ok
(
wFlags
==
INVOKE_PROPERTYGET
,
"wFlags = %x
\n
"
,
wFlags
);
ok
(
pdp
->
cArgs
==
0
,
"cArgs = %d
\n
"
,
pdp
->
cArgs
);
ok
(
!
pdp
->
cNamedArgs
,
"cNamedArgs = %d
\n
"
,
pdp
->
cNamedArgs
);
V_VT
(
pVarResult
)
=
VT_BSTR
;
res
=
SearchPathW
(
NULL
,
wscriptexe
,
NULL
,
sizeof
(
fullName
)
/
sizeof
(
WCHAR
),
fullName
,
NULL
);
if
(
res
==
0
)
return
E_FAIL
;
if
(
!
(
V_BSTR
(
pVarResult
)
=
SysAllocString
(
fullName
)))
return
E_OUTOFMEMORY
;
break
;
}
default:
ok
(
0
,
"unexpected dispIdMember %d
\n
"
,
dispIdMember
);
return
E_NOTIMPL
;
...
...
programs/wscript/tests/run.js
View file @
d6fd86e8
...
...
@@ -28,5 +28,6 @@ ok(WScript === WSH, "WScript !== WSH");
ok
(
WScript
.
Name
===
"Windows Script Host"
,
"WScript.Name = "
+
WScript
.
Name
);
ok
(
typeof
(
WScript
.
Version
)
===
"string"
,
"typeof(WScript.Version) = "
+
typeof
(
WScript
.
Version
));
ok
(
typeof
(
WScript
.
BuildVersion
)
===
"number"
,
"typeof(WScript.BuldVersion) = "
+
typeof
(
WScript
.
BuldVersion
));
ok
(
WScript
.
FullName
===
winetest
.
wscriptFullName
,
"WScript.FullName = "
,
WScript
.
FullName
);
winetest
.
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