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
50fe9b87
Commit
50fe9b87
authored
Aug 06, 2012
by
Alistair Leslie-Hughes
Committed by
Alexandre Julliard
Aug 16, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
scrrun: Correct FileExists for directories.
parent
3d845b12
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
1 deletion
+17
-1
filesystem.c
dlls/scrrun/filesystem.c
+3
-1
filesystem.c
dlls/scrrun/tests/filesystem.c
+14
-0
No files found.
dlls/scrrun/filesystem.c
View file @
50fe9b87
...
...
@@ -215,11 +215,13 @@ static HRESULT WINAPI filesys_DriveExists(IFileSystem3 *iface, BSTR DriveSpec,
static
HRESULT
WINAPI
filesys_FileExists
(
IFileSystem3
*
iface
,
BSTR
path
,
VARIANT_BOOL
*
ret
)
{
DWORD
attrs
;
TRACE
(
"%p %s %p
\n
"
,
iface
,
debugstr_w
(
path
),
ret
);
if
(
!
ret
)
return
E_POINTER
;
*
ret
=
GetFileAttributesW
(
path
)
!=
INVALID_FILE_ATTRIBUTES
?
VARIANT_TRUE
:
VARIANT_FALSE
;
attrs
=
GetFileAttributesW
(
path
);
*
ret
=
attrs
!=
INVALID_FILE_ATTRIBUTES
&&
!
(
attrs
&
FILE_ATTRIBUTE_DIRECTORY
)
?
VARIANT_TRUE
:
VARIANT_FALSE
;
return
S_OK
;
}
...
...
dlls/scrrun/tests/filesystem.c
View file @
50fe9b87
...
...
@@ -82,6 +82,20 @@ static void test_interfaces(void)
ok
(
b
==
VARIANT_FALSE
,
"got %x
\n
"
,
b
);
SysFreeString
(
path
);
path
=
SysAllocString
(
file_path
);
b
=
VARIANT_FALSE
;
hr
=
IFileSystem3_FileExists
(
fs3
,
path
,
&
b
);
ok
(
hr
==
S_OK
,
"got 0x%08x, expected 0x%08x
\n
"
,
hr
,
S_OK
);
ok
(
b
==
VARIANT_TRUE
,
"got %x
\n
"
,
b
);
SysFreeString
(
path
);
path
=
SysAllocString
(
windows_path
);
b
=
VARIANT_TRUE
;
hr
=
IFileSystem3_FileExists
(
fs3
,
path
,
&
b
);
ok
(
hr
==
S_OK
,
"got 0x%08x, expected 0x%08x
\n
"
,
hr
,
S_OK
);
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
);
...
...
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