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
a9a2c9b5
Commit
a9a2c9b5
authored
Mar 10, 2014
by
Nikolay Sivov
Committed by
Alexandre Julliard
Mar 10, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
scrrun: Fix Next() for file collection.
parent
c633a517
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
45 deletions
+14
-45
filesystem.c
dlls/scrrun/filesystem.c
+13
-40
filesystem.c
dlls/scrrun/tests/filesystem.c
+1
-5
No files found.
dlls/scrrun/filesystem.c
View file @
a9a2c9b5
...
...
@@ -761,7 +761,7 @@ static ULONG WINAPI foldercoll_enumvariant_Release(IEnumVARIANT *iface)
return
ref
;
}
static
HANDLE
start_enumeration
(
const
WCHAR
*
path
,
WIN32_FIND_DATAW
*
data
)
static
HANDLE
start_enumeration
(
const
WCHAR
*
path
,
WIN32_FIND_DATAW
*
data
,
BOOL
file
)
{
static
const
WCHAR
allW
[]
=
{
'*'
,
0
};
WCHAR
pathW
[
MAX_PATH
];
...
...
@@ -776,10 +776,10 @@ static HANDLE start_enumeration(const WCHAR *path, WIN32_FIND_DATAW *data)
handle
=
FindFirstFileW
(
pathW
,
data
);
if
(
handle
==
INVALID_HANDLE_VALUE
)
return
0
;
/* find first dir */
/* find first dir
/file
*/
while
(
1
)
{
if
(
is_dir_data
(
data
))
if
(
file
?
is_file_data
(
data
)
:
is_dir_data
(
data
))
break
;
if
(
!
FindNextFileW
(
handle
,
data
))
...
...
@@ -807,7 +807,7 @@ static HRESULT WINAPI foldercoll_enumvariant_Next(IEnumVARIANT *iface, ULONG cel
if
(
!
handle
)
{
handle
=
start_enumeration
(
This
->
data
.
u
.
foldercoll
.
coll
->
path
,
&
data
);
handle
=
start_enumeration
(
This
->
data
.
u
.
foldercoll
.
coll
->
path
,
&
data
,
FALSE
);
if
(
!
handle
)
return
S_FALSE
;
This
->
data
.
u
.
foldercoll
.
find
=
handle
;
...
...
@@ -857,7 +857,7 @@ static HRESULT WINAPI foldercoll_enumvariant_Skip(IEnumVARIANT *iface, ULONG cel
if
(
!
handle
)
{
handle
=
start_enumeration
(
This
->
data
.
u
.
foldercoll
.
coll
->
path
,
&
data
);
handle
=
start_enumeration
(
This
->
data
.
u
.
foldercoll
.
coll
->
path
,
&
data
,
FALSE
);
if
(
!
handle
)
return
S_FALSE
;
This
->
data
.
u
.
foldercoll
.
find
=
handle
;
...
...
@@ -957,43 +957,19 @@ static HRESULT WINAPI filecoll_enumvariant_Next(IEnumVARIANT *iface, ULONG celt,
if
(
fetched
)
*
fetched
=
0
;
if
(
!
celt
)
return
S_OK
;
if
(
!
handle
)
{
static
const
WCHAR
allW
[]
=
{
'*'
,
0
};
WCHAR
pathW
[
MAX_PATH
];
BSTR
parent
=
This
->
data
.
u
.
filecoll
.
coll
->
path
;
int
len
;
strcpyW
(
pathW
,
parent
);
len
=
SysStringLen
(
parent
);
if
(
parent
[
len
-
1
]
!=
'\\'
)
strcatW
(
pathW
,
bsW
);
strcatW
(
pathW
,
allW
);
handle
=
FindFirstFileW
(
pathW
,
&
data
);
if
(
handle
==
INVALID_HANDLE_VALUE
)
return
S_FALSE
;
while
(
1
)
{
if
(
is_file_data
(
&
data
))
break
;
else
if
(
!
FindNextFileW
(
handle
,
&
data
))
{
FindClose
(
handle
);
return
S_FALSE
;
}
}
handle
=
start_enumeration
(
This
->
data
.
u
.
filecoll
.
coll
->
path
,
&
data
,
TRUE
);
if
(
!
handle
)
return
S_FALSE
;
This
->
data
.
u
.
filecoll
.
find
=
handle
;
}
else
if
(
celt
)
FindNextFileW
(
handle
,
&
data
)
;
else
if
(
!
FindNextFileW
(
handle
,
&
data
)
)
return
S_FALSE
;
do
{
if
(
count
>=
celt
)
break
;
if
(
is_file_data
(
&
data
))
{
IFile
*
file
;
...
...
@@ -1007,17 +983,14 @@ static HRESULT WINAPI filecoll_enumvariant_Next(IEnumVARIANT *iface, ULONG celt,
V_VT
(
&
var
[
count
])
=
VT_DISPATCH
;
V_DISPATCH
(
&
var
[
count
])
=
(
IDispatch
*
)
file
;
count
++
;
if
(
++
count
>=
celt
)
break
;
}
}
while
(
FindNextFileW
(
handle
,
&
data
));
if
(
count
<
celt
)
return
S_FALSE
;
if
(
fetched
)
*
fetched
=
count
;
return
S_OK
;
return
(
count
<
celt
)
?
S_FALSE
:
S_OK
;
}
static
HRESULT
WINAPI
filecoll_enumvariant_Skip
(
IEnumVARIANT
*
iface
,
ULONG
celt
)
...
...
dlls/scrrun/tests/filesystem.c
View file @
a9a2c9b5
...
...
@@ -1089,12 +1089,10 @@ todo_wine
ok
(
0
,
"unexpected file %s was found
\n
"
,
wine_dbgstr_w
(
str
));
SysFreeString
(
str
);
/* FIXME: uncomment once Wine is fixed
IFile_Release(file); */
IFile_Release
(
file
);
VariantClear
(
&
var
);
}
todo_wine
ok
(
found_a
==
1
&&
found_b
==
1
&&
found_c
==
1
,
"each file should be found 1 time instead of %d/%d/%d
\n
"
,
found_a
,
found_b
,
found_c
);
...
...
@@ -1102,9 +1100,7 @@ todo_wine
VariantInit
(
&
var
);
fetched
=
-
1
;
hr
=
IEnumVARIANT_Next
(
enumvar
,
1
,
&
var
,
&
fetched
);
todo_wine
ok
(
hr
==
S_FALSE
,
"got 0x%08x
\n
"
,
hr
);
todo_wine
ok
(
fetched
==
0
,
"got %d
\n
"
,
fetched
);
hr
=
IEnumVARIANT_Reset
(
enumvar
);
...
...
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