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
108c2731
Commit
108c2731
authored
May 17, 2014
by
Nikolay Sivov
Committed by
Alexandre Julliard
May 19, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
scrrun: Implement Count() property for file collection.
parent
2b628405
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
6 deletions
+26
-6
filesystem.c
dlls/scrrun/filesystem.c
+26
-2
filesystem.c
dlls/scrrun/tests/filesystem.c
+0
-4
No files found.
dlls/scrrun/filesystem.c
View file @
108c2731
...
...
@@ -1831,8 +1831,32 @@ static HRESULT WINAPI filecoll_get__NewEnum(IFileCollection *iface, IUnknown **p
static
HRESULT
WINAPI
filecoll_get_Count
(
IFileCollection
*
iface
,
LONG
*
count
)
{
struct
filecollection
*
This
=
impl_from_IFileCollection
(
iface
);
FIXME
(
"(%p)->(%p)
\n
"
,
This
,
count
);
return
E_NOTIMPL
;
static
const
WCHAR
allW
[]
=
{
'\\'
,
'*'
,
0
};
WIN32_FIND_DATAW
data
;
WCHAR
pathW
[
MAX_PATH
];
HANDLE
handle
;
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
count
);
if
(
!
count
)
return
E_POINTER
;
*
count
=
0
;
strcpyW
(
pathW
,
This
->
path
);
strcatW
(
pathW
,
allW
);
handle
=
FindFirstFileW
(
pathW
,
&
data
);
if
(
handle
==
INVALID_HANDLE_VALUE
)
return
HRESULT_FROM_WIN32
(
GetLastError
());
do
{
if
(
is_file_data
(
&
data
))
*
count
+=
1
;
}
while
(
FindNextFileW
(
handle
,
&
data
));
FindClose
(
handle
);
return
S_OK
;
}
static
const
IFileCollectionVtbl
filecollectionvtbl
=
{
...
...
dlls/scrrun/tests/filesystem.c
View file @
108c2731
...
...
@@ -1084,9 +1084,7 @@ static void test_FileCollection(void)
count
=
0
;
hr
=
IFileCollection_get_Count
(
files
,
&
count
);
todo_wine
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
todo_wine
ok
(
count
==
2
,
"got %d
\n
"
,
count
);
lstrcpyW
(
pathW
,
buffW
);
...
...
@@ -1097,9 +1095,7 @@ todo_wine
/* every time property is requested it scans directory */
count
=
0
;
hr
=
IFileCollection_get_Count
(
files
,
&
count
);
todo_wine
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
todo_wine
ok
(
count
==
3
,
"got %d
\n
"
,
count
);
hr
=
IFileCollection_get__NewEnum
(
files
,
NULL
);
...
...
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