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
b9819b0b
Commit
b9819b0b
authored
Mar 07, 2015
by
Nikolay Sivov
Committed by
Alexandre Julliard
Mar 09, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wshom.ocx: Implement CurrentDirectory() property.
parent
99afcdff
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
4 deletions
+54
-4
shell.c
dlls/wshom.ocx/shell.c
+29
-4
wshom.c
dlls/wshom.ocx/tests/wshom.c
+25
-0
No files found.
dlls/wshom.ocx/shell.c
View file @
b9819b0b
...
...
@@ -1329,14 +1329,39 @@ static HRESULT WINAPI WshShell3_Exec(IWshShell3 *iface, BSTR command, IWshExec *
static
HRESULT
WINAPI
WshShell3_get_CurrentDirectory
(
IWshShell3
*
iface
,
BSTR
*
dir
)
{
FIXME
(
"(%p): stub
\n
"
,
dir
);
return
E_NOTIMPL
;
DWORD
ret
;
TRACE
(
"(%p)
\n
"
,
dir
);
ret
=
GetCurrentDirectoryW
(
0
,
NULL
);
if
(
!
ret
)
return
HRESULT_FROM_WIN32
(
GetLastError
());
*
dir
=
SysAllocStringLen
(
NULL
,
ret
-
1
);
if
(
!*
dir
)
return
E_OUTOFMEMORY
;
ret
=
GetCurrentDirectoryW
(
ret
,
*
dir
);
if
(
!
ret
)
{
SysFreeString
(
*
dir
);
*
dir
=
NULL
;
return
HRESULT_FROM_WIN32
(
GetLastError
());
}
return
S_OK
;
}
static
HRESULT
WINAPI
WshShell3_put_CurrentDirectory
(
IWshShell3
*
iface
,
BSTR
dir
)
{
FIXME
(
"(%s): stub
\n
"
,
debugstr_w
(
dir
));
return
E_NOTIMPL
;
TRACE
(
"(%s)
\n
"
,
debugstr_w
(
dir
));
if
(
!
dir
)
return
E_INVALIDARG
;
if
(
!
SetCurrentDirectoryW
(
dir
))
return
HRESULT_FROM_WIN32
(
GetLastError
());
return
S_OK
;
}
static
const
IWshShell3Vtbl
WshShell3Vtbl
=
{
...
...
dlls/wshom.ocx/tests/wshom.c
View file @
b9819b0b
...
...
@@ -39,6 +39,8 @@ static void test_wshshell(void)
static
const
WCHAR
pathW
[]
=
{
'%'
,
'P'
,
'A'
,
'T'
,
'H'
,
'%'
,
0
};
static
const
WCHAR
sysW
[]
=
{
'S'
,
'Y'
,
'S'
,
'T'
,
'E'
,
'M'
,
0
};
static
const
WCHAR
path2W
[]
=
{
'P'
,
'A'
,
'T'
,
'H'
,
0
};
static
const
WCHAR
dummydirW
[]
=
{
'd'
,
'e'
,
'a'
,
'd'
,
'p'
,
'a'
,
'r'
,
'r'
,
'o'
,
't'
,
0
};
static
const
WCHAR
emptyW
[]
=
{
'e'
,
'm'
,
'p'
,
't'
,
'y'
,
0
};
IWshEnvironment
*
env
;
IWshShell3
*
sh3
;
IDispatchEx
*
dispex
;
...
...
@@ -209,6 +211,29 @@ static void test_wshshell(void)
SysFreeString
(
str
);
/* current directory */
if
(
0
)
/* crashes on native */
hr
=
IWshShell3_get_CurrentDirectory
(
sh3
,
NULL
);
str
=
NULL
;
hr
=
IWshShell3_get_CurrentDirectory
(
sh3
,
&
str
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
str
&&
str
[
0
]
!=
0
,
"got empty string
\n
"
);
SysFreeString
(
str
);
hr
=
IWshShell3_put_CurrentDirectory
(
sh3
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08x
\n
"
,
hr
);
str
=
SysAllocString
(
emptyW
);
hr
=
IWshShell3_put_CurrentDirectory
(
sh3
,
str
);
ok
(
hr
==
HRESULT_FROM_WIN32
(
ERROR_FILE_NOT_FOUND
),
"got 0x%08x
\n
"
,
hr
);
SysFreeString
(
str
);
str
=
SysAllocString
(
dummydirW
);
hr
=
IWshShell3_put_CurrentDirectory
(
sh3
,
str
);
ok
(
hr
==
HRESULT_FROM_WIN32
(
ERROR_FILE_NOT_FOUND
),
"got 0x%08x
\n
"
,
hr
);
SysFreeString
(
str
);
IWshCollection_Release
(
coll
);
IDispatch_Release
(
disp
);
IWshShell3_Release
(
sh3
);
...
...
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