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
0de21b65
Commit
0de21b65
authored
Apr 17, 2003
by
Uwe Bonnes
Committed by
Alexandre Julliard
Apr 17, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
FindFirstFile on root directory should fail.
parent
3dddc114
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
1 deletion
+31
-1
file.c
dlls/kernel/tests/file.c
+21
-0
dos_fs.c
files/dos_fs.c
+10
-1
No files found.
dlls/kernel/tests/file.c
View file @
0de21b65
...
...
@@ -746,6 +746,26 @@ static void test_LockFile(void)
DeleteFileA
(
filename
);
}
void
test_FindFirstFileA
()
{
HANDLE
handle
;
WIN32_FIND_DATAA
search_results
;
int
err
;
handle
=
FindFirstFileA
(
"C:"
,
&
search_results
);
err
=
GetLastError
();
ok
(
handle
==
INVALID_HANDLE_VALUE
,
"FindFirstFile on Root directory should Fail"
);
if
(
handle
==
INVALID_HANDLE_VALUE
)
ok
(
err
==
ERROR_FILE_NOT_FOUND
,
"Bad Error number
\n
"
);
handle
=
FindFirstFileA
(
"C:
\\
"
,
&
search_results
);
err
=
GetLastError
();
ok
(
handle
==
INVALID_HANDLE_VALUE
,
"FindFirstFile on Root directory should Fail"
);
if
(
handle
==
INVALID_HANDLE_VALUE
)
ok
(
err
==
ERROR_FILE_NOT_FOUND
,
"Bad Error number
\n
"
);
handle
=
FindFirstFileA
(
"C:
\\
*"
,
&
search_results
);
ok
(
handle
!=
INVALID_HANDLE_VALUE
,
"FindFirstFile on C:
\\
* should succeed"
);
ok
(
FindClose
(
handle
)
==
TRUE
,
"Failed to close handle"
);
}
START_TEST
(
file
)
{
...
...
@@ -763,6 +783,7 @@ START_TEST(file)
test_CreateFileW
();
test_DeleteFileA
();
test_DeleteFileW
();
test_FindFirstFileA
();
test_LockFile
();
test_offset_in_overlapped_structure
();
}
files/dos_fs.c
View file @
0de21b65
...
...
@@ -1937,7 +1937,6 @@ HANDLE WINAPI FindFirstFileExW(
UINT
codepage
;
data
->
dwReserved0
=
data
->
dwReserved1
=
0x0
;
if
(
!
lpFileName
)
return
0
;
if
(
lpFileName
[
0
]
==
'\\'
&&
lpFileName
[
1
]
==
'\\'
)
{
ERR
(
"UNC path name
\n
"
);
...
...
@@ -1960,6 +1959,16 @@ HANDLE WINAPI FindFirstFileExW(
{
DOS_FULL_NAME
full_name
;
if
(
lpFileName
[
0
]
&&
lpFileName
[
1
]
==
':'
)
{
/* don't allow root directories */
if
(
!
lpFileName
[
2
]
||
((
lpFileName
[
2
]
==
'/'
||
lpFileName
[
2
]
==
'\\'
)
&&
!
lpFileName
[
3
]))
{
SetLastError
(
ERROR_FILE_NOT_FOUND
);
return
INVALID_HANDLE_VALUE
;
}
}
if
(
!
DOSFS_GetFullName
(
lpFileName
,
FALSE
,
&
full_name
))
break
;
if
(
!
(
handle
=
GlobalAlloc
(
GMEM_MOVEABLE
,
sizeof
(
FIND_FIRST_INFO
))))
break
;
info
=
(
FIND_FIRST_INFO
*
)
GlobalLock
(
handle
);
...
...
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