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
533323d7
Commit
533323d7
authored
Apr 06, 2015
by
Nikolay Sivov
Committed by
Alexandre Julliard
Apr 06, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
scrrun: Implement GetSpecialFolder().
parent
01c2af44
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
82 additions
and
3 deletions
+82
-3
filesystem.c
dlls/scrrun/filesystem.c
+33
-3
filesystem.c
dlls/scrrun/tests/filesystem.c
+49
-0
No files found.
dlls/scrrun/filesystem.c
View file @
533323d7
...
...
@@ -3285,11 +3285,41 @@ static HRESULT WINAPI filesys_GetFolder(IFileSystem3 *iface, BSTR FolderPath,
static
HRESULT
WINAPI
filesys_GetSpecialFolder
(
IFileSystem3
*
iface
,
SpecialFolderConst
SpecialFolder
,
IFolder
**
pp
folder
)
IFolder
**
folder
)
{
FIXME
(
"%p %d %p
\n
"
,
iface
,
SpecialFolder
,
ppfolder
);
WCHAR
pathW
[
MAX_PATH
];
DWORD
ret
;
return
E_NOTIMPL
;
TRACE
(
"%p %d %p
\n
"
,
iface
,
SpecialFolder
,
folder
);
if
(
!
folder
)
return
E_POINTER
;
*
folder
=
NULL
;
switch
(
SpecialFolder
)
{
case
WindowsFolder
:
ret
=
GetWindowsDirectoryW
(
pathW
,
sizeof
(
pathW
)
/
sizeof
(
WCHAR
));
break
;
case
SystemFolder
:
ret
=
GetSystemDirectoryW
(
pathW
,
sizeof
(
pathW
)
/
sizeof
(
WCHAR
));
break
;
case
TemporaryFolder
:
ret
=
GetTempPathW
(
sizeof
(
pathW
)
/
sizeof
(
WCHAR
),
pathW
);
/* we don't want trailing backslash */
if
(
ret
&&
pathW
[
ret
-
1
]
==
'\\'
)
pathW
[
ret
-
1
]
=
0
;
break
;
default:
FIXME
(
"unknown special folder type, %d
\n
"
,
SpecialFolder
);
return
E_INVALIDARG
;
}
if
(
!
ret
)
return
HRESULT_FROM_WIN32
(
GetLastError
());
return
create_folder
(
pathW
,
folder
);
}
static
inline
HRESULT
delete_file
(
const
WCHAR
*
file
,
DWORD
file_len
,
VARIANT_BOOL
force
)
...
...
dlls/scrrun/tests/filesystem.c
View file @
533323d7
...
...
@@ -1907,6 +1907,54 @@ static void test_GetExtensionName(void)
}
}
static
void
test_GetSpecialFolder
(
void
)
{
WCHAR
pathW
[
MAX_PATH
];
IFolder
*
folder
;
HRESULT
hr
;
DWORD
ret
;
BSTR
path
;
hr
=
IFileSystem3_GetSpecialFolder
(
fs3
,
WindowsFolder
,
NULL
);
ok
(
hr
==
E_POINTER
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IFileSystem3_GetSpecialFolder
(
fs3
,
TemporaryFolder
+
1
,
NULL
);
ok
(
hr
==
E_POINTER
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IFileSystem3_GetSpecialFolder
(
fs3
,
TemporaryFolder
+
1
,
&
folder
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IFileSystem3_GetSpecialFolder
(
fs3
,
WindowsFolder
,
&
folder
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IFolder_get_Path
(
folder
,
&
path
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
GetWindowsDirectoryW
(
pathW
,
sizeof
(
pathW
)
/
sizeof
(
WCHAR
));
ok
(
!
lstrcmpiW
(
pathW
,
path
),
"got %s, expected %s
\n
"
,
wine_dbgstr_w
(
path
),
wine_dbgstr_w
(
pathW
));
SysFreeString
(
path
);
IFolder_Release
(
folder
);
hr
=
IFileSystem3_GetSpecialFolder
(
fs3
,
SystemFolder
,
&
folder
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IFolder_get_Path
(
folder
,
&
path
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
GetSystemDirectoryW
(
pathW
,
sizeof
(
pathW
)
/
sizeof
(
WCHAR
));
ok
(
!
lstrcmpiW
(
pathW
,
path
),
"got %s, expected %s
\n
"
,
wine_dbgstr_w
(
path
),
wine_dbgstr_w
(
pathW
));
SysFreeString
(
path
);
IFolder_Release
(
folder
);
hr
=
IFileSystem3_GetSpecialFolder
(
fs3
,
TemporaryFolder
,
&
folder
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IFolder_get_Path
(
folder
,
&
path
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ret
=
GetTempPathW
(
sizeof
(
pathW
)
/
sizeof
(
WCHAR
),
pathW
);
if
(
ret
&&
pathW
[
ret
-
1
]
==
'\\'
)
pathW
[
ret
-
1
]
=
0
;
ok
(
!
lstrcmpiW
(
pathW
,
path
),
"got %s, expected %s
\n
"
,
wine_dbgstr_w
(
path
),
wine_dbgstr_w
(
pathW
));
SysFreeString
(
path
);
IFolder_Release
(
folder
);
}
START_TEST
(
filesystem
)
{
HRESULT
hr
;
...
...
@@ -1942,6 +1990,7 @@ START_TEST(filesystem)
test_GetDriveName
();
test_SerialNumber
();
test_GetExtensionName
();
test_GetSpecialFolder
();
IFileSystem3_Release
(
fs3
);
...
...
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