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
e6d9f824
Commit
e6d9f824
authored
Jul 30, 2012
by
Alistair Leslie-Hughes
Committed by
Alexandre Julliard
Aug 13, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
scrrun: Implement IFileSystem3 FolderExists.
parent
dcc09efe
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
4 deletions
+41
-4
filesystem.c
dlls/scrrun/filesystem.c
+9
-4
filesystem.c
dlls/scrrun/tests/filesystem.c
+32
-0
No files found.
dlls/scrrun/filesystem.c
View file @
e6d9f824
...
...
@@ -223,12 +223,17 @@ static HRESULT WINAPI filesys_FileExists(IFileSystem3 *iface, BSTR path, VARIANT
return
S_OK
;
}
static
HRESULT
WINAPI
filesys_FolderExists
(
IFileSystem3
*
iface
,
BSTR
FolderSpec
,
VARIANT_BOOL
*
pfExists
)
static
HRESULT
WINAPI
filesys_FolderExists
(
IFileSystem3
*
iface
,
BSTR
path
,
VARIANT_BOOL
*
ret
)
{
FIXME
(
"%p %s %p
\n
"
,
iface
,
debugstr_w
(
FolderSpec
),
pfExists
);
DWORD
attrs
;
TRACE
(
"%p %s %p
\n
"
,
iface
,
debugstr_w
(
path
),
ret
);
return
E_NOTIMPL
;
if
(
!
ret
)
return
E_POINTER
;
attrs
=
GetFileAttributesW
(
path
);
*
ret
=
attrs
!=
INVALID_FILE_ATTRIBUTES
&&
(
attrs
&
FILE_ATTRIBUTE_DIRECTORY
)
?
VARIANT_TRUE
:
VARIANT_FALSE
;
return
S_OK
;
}
static
HRESULT
WINAPI
filesys_GetDrive
(
IFileSystem3
*
iface
,
BSTR
DriveSpec
,
...
...
dlls/scrrun/tests/filesystem.c
View file @
e6d9f824
...
...
@@ -33,6 +33,10 @@
static
void
test_interfaces
(
void
)
{
static
const
WCHAR
pathW
[]
=
{
'p'
,
'a'
,
't'
,
'h'
,
0
};
static
const
WCHAR
nonexistent_dirW
[]
=
{
'c'
,
':'
,
'\\'
,
'N'
,
'o'
,
'n'
,
'e'
,
'x'
,
'i'
,
's'
,
't'
,
'e'
,
'n'
,
't'
,
0
};
static
const
WCHAR
file_kernel32W
[]
=
{
'\\'
,
'k'
,
'e'
,
'r'
,
'n'
,
'e'
,
'l'
,
'3'
,
'2'
,
'.'
,
'd'
,
'l'
,
'l'
,
0
};
HRESULT
hr
;
IDispatch
*
disp
;
IDispatchEx
*
dispex
;
...
...
@@ -40,6 +44,8 @@ static void test_interfaces(void)
IObjectWithSite
*
site
;
VARIANT_BOOL
b
;
BSTR
path
;
WCHAR
windows_path
[
MAX_PATH
];
WCHAR
file_path
[
MAX_PATH
];
hr
=
CoCreateInstance
(
&
CLSID_FileSystemObject
,
NULL
,
CLSCTX_INPROC_SERVER
|
CLSCTX_INPROC_HANDLER
,
&
IID_IDispatch
,
(
void
**
)
&
disp
);
...
...
@@ -48,6 +54,10 @@ static void test_interfaces(void)
return
;
}
GetSystemDirectoryW
(
windows_path
,
MAX_PATH
);
lstrcpyW
(
file_path
,
windows_path
);
lstrcatW
(
file_path
,
file_kernel32W
);
hr
=
IDispatch_QueryInterface
(
disp
,
&
IID_IFileSystem3
,
(
void
**
)
&
fs3
);
ok
(
hr
==
S_OK
,
"got 0x%08x, expected 0x%08x
\n
"
,
hr
,
S_OK
);
...
...
@@ -72,6 +82,28 @@ static void test_interfaces(void)
ok
(
b
==
VARIANT_FALSE
,
"got %x
\n
"
,
b
);
SysFreeString
(
path
);
/* Folder Exists */
hr
=
IFileSystem3_FolderExists
(
fs3
,
NULL
,
NULL
);
ok
(
hr
==
E_POINTER
,
"got 0x%08x, expected 0x%08x
\n
"
,
hr
,
E_POINTER
);
path
=
SysAllocString
(
windows_path
);
hr
=
IFileSystem3_FolderExists
(
fs3
,
path
,
&
b
);
ok
(
hr
==
S_OK
,
"got 0x%08x, expected 0x%08x
\n
"
,
hr
,
S_OK
);
ok
(
b
==
VARIANT_TRUE
,
"Folder doesn't exists
\n
"
);
SysFreeString
(
path
);
path
=
SysAllocString
(
nonexistent_dirW
);
hr
=
IFileSystem3_FolderExists
(
fs3
,
path
,
&
b
);
ok
(
hr
==
S_OK
,
"got 0x%08x, expected 0x%08x
\n
"
,
hr
,
S_OK
);
ok
(
b
==
VARIANT_FALSE
,
"Folder exists
\n
"
);
SysFreeString
(
path
);
path
=
SysAllocString
(
file_path
);
hr
=
IFileSystem3_FolderExists
(
fs3
,
path
,
&
b
);
ok
(
hr
==
S_OK
,
"got 0x%08x, expected 0x%08x
\n
"
,
hr
,
S_OK
);
ok
(
b
==
VARIANT_FALSE
,
"Folder exists
\n
"
);
SysFreeString
(
path
);
IFileSystem3_Release
(
fs3
);
IDispatch_Release
(
disp
);
}
...
...
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