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
5e082305
Commit
5e082305
authored
Oct 27, 2006
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Close the directory handle in FindNextFile as soon as we reach the end of the directory.
parent
4471ad44
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
1 deletion
+14
-1
file.c
dlls/kernel32/file.c
+14
-1
No files found.
dlls/kernel32/file.c
View file @
5e082305
...
...
@@ -1546,6 +1546,7 @@ HANDLE WINAPI FindFirstFileExW( LPCWSTR filename, FINDEX_INFO_LEVELS level,
LPVOID
data
,
FINDEX_SEARCH_OPS
search_op
,
LPVOID
filter
,
DWORD
flags
)
{
static
const
WCHAR
wildcardsW
[]
=
{
'*'
,
'?'
,
0
};
WCHAR
*
mask
,
*
p
;
FIND_FIRST_INFO
*
info
=
NULL
;
UNICODE_STRING
nt_name
;
...
...
@@ -1637,6 +1638,12 @@ HANDLE WINAPI FindFirstFileExW( LPCWSTR filename, FINDEX_INFO_LEVELS level,
SetLastError
(
ERROR_FILE_NOT_FOUND
);
return
INVALID_HANDLE_VALUE
;
}
if
(
!
strpbrkW
(
info
->
mask
.
Buffer
,
wildcardsW
))
{
/* we can't find two files with the same name */
CloseHandle
(
info
->
handle
);
info
->
handle
=
0
;
}
return
(
HANDLE
)
info
;
error:
...
...
@@ -1671,7 +1678,8 @@ BOOL WINAPI FindNextFileW( HANDLE handle, WIN32_FIND_DATAW *data )
RtlEnterCriticalSection
(
&
info
->
cs
);
for
(;;)
if
(
!
info
->
handle
)
SetLastError
(
ERROR_NO_MORE_FILES
);
else
for
(;;)
{
if
(
info
->
data_pos
>=
info
->
data_len
)
/* need to read some more data */
{
...
...
@@ -1682,6 +1690,11 @@ BOOL WINAPI FindNextFileW( HANDLE handle, WIN32_FIND_DATAW *data )
if
(
io
.
u
.
Status
)
{
SetLastError
(
RtlNtStatusToDosError
(
io
.
u
.
Status
)
);
if
(
io
.
u
.
Status
==
STATUS_NO_MORE_FILES
)
{
CloseHandle
(
info
->
handle
);
info
->
handle
=
0
;
}
break
;
}
info
->
data_len
=
io
.
Information
;
...
...
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