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
fdf8d717
Commit
fdf8d717
authored
Jul 31, 2019
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jul 31, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Support FileBasicInfo case in SetFileInformationByHandle().
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
e14249a3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
2 deletions
+25
-2
file.c
dlls/kernel32/file.c
+3
-1
file.c
dlls/kernel32/tests/file.c
+22
-1
No files found.
dlls/kernel32/file.c
View file @
fdf8d717
...
...
@@ -1095,7 +1095,6 @@ BOOL WINAPI SetFileInformationByHandle( HANDLE file, FILE_INFO_BY_HANDLE_CLASS c
switch
(
class
)
{
case
FileBasicInfo
:
case
FileNameInfo
:
case
FileRenameInfo
:
case
FileAllocationInfo
:
...
...
@@ -1114,6 +1113,9 @@ BOOL WINAPI SetFileInformationByHandle( HANDLE file, FILE_INFO_BY_HANDLE_CLASS c
SetLastError
(
ERROR_CALL_NOT_IMPLEMENTED
);
return
FALSE
;
case
FileBasicInfo
:
status
=
NtSetInformationFile
(
file
,
&
io
,
info
,
size
,
FileBasicInformation
);
break
;
case
FileDispositionInfo
:
status
=
NtSetInformationFile
(
file
,
&
io
,
info
,
size
,
FileDispositionInformation
);
break
;
...
...
dlls/kernel32/tests/file.c
View file @
fdf8d717
...
...
@@ -4973,8 +4973,10 @@ static void test_SetFileInformationByHandle(void)
FILE_COMPRESSION_INFO
compressinfo
;
FILE_DISPOSITION_INFO
dispinfo
;
DECLSPEC_ALIGN
(
8
)
FILE_IO_PRIORITY_HINT_INFO
hintinfo
;
FILE_BASIC_INFO
basicinfo
=
{
{{
0
}}
};
char
tempFileName
[
MAX_PATH
];
char
tempPath
[
MAX_PATH
];
LARGE_INTEGER
atime
;
HANDLE
file
;
BOOL
ret
;
...
...
@@ -4991,7 +4993,7 @@ static void test_SetFileInformationByHandle(void)
ret
=
GetTempFileNameA
(
tempPath
,
"abc"
,
0
,
tempFileName
);
ok
(
ret
,
"GetTempFileNameA failed, got error %u.
\n
"
,
GetLastError
());
file
=
CreateFileA
(
tempFileName
,
GENERIC_READ
,
FILE_SHARE_READ
|
FILE_SHARE_WRITE
|
FILE_SHARE_DELETE
,
file
=
CreateFileA
(
tempFileName
,
GENERIC_READ
|
FILE_WRITE_ATTRIBUTES
,
FILE_SHARE_READ
|
FILE_SHARE_WRITE
|
FILE_SHARE_DELETE
,
NULL
,
OPEN_EXISTING
,
FILE_FLAG_DELETE_ON_CLOSE
,
NULL
);
ok
(
file
!=
INVALID_HANDLE_VALUE
,
"failed to open the temp file, error %u.
\n
"
,
GetLastError
());
...
...
@@ -5044,6 +5046,25 @@ static void test_SetFileInformationByHandle(void)
todo_wine
ok
(
!
ret
&&
GetLastError
()
==
ERROR_BAD_LENGTH
,
"got %d, error %d
\n
"
,
ret
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
ret
=
pSetFileInformationByHandle
(
file
,
FileBasicInfo
,
&
basicinfo
,
0
);
todo_wine
ok
(
!
ret
&&
GetLastError
()
==
ERROR_BAD_LENGTH
,
"got %d, error %d
\n
"
,
ret
,
GetLastError
());
memset
(
&
basicinfo
,
0
,
sizeof
(
basicinfo
));
ret
=
pGetFileInformationByHandleEx
(
file
,
FileBasicInfo
,
&
basicinfo
,
sizeof
(
basicinfo
));
ok
(
ret
,
"Failed to get basic info, error %d.
\n
"
,
GetLastError
());
atime
=
basicinfo
.
LastAccessTime
;
basicinfo
.
LastAccessTime
.
QuadPart
++
;
ret
=
pSetFileInformationByHandle
(
file
,
FileBasicInfo
,
&
basicinfo
,
sizeof
(
basicinfo
));
ok
(
ret
,
"Failed to set basic info, error %d.
\n
"
,
GetLastError
());
memset
(
&
basicinfo
,
0
,
sizeof
(
basicinfo
));
ret
=
pGetFileInformationByHandleEx
(
file
,
FileBasicInfo
,
&
basicinfo
,
sizeof
(
basicinfo
));
ok
(
ret
,
"Failed to get basic info, error %d.
\n
"
,
GetLastError
());
ok
(
atime
.
QuadPart
+
1
==
basicinfo
.
LastAccessTime
.
QuadPart
,
"Unexpected access time.
\n
"
);
dispinfo
.
DeleteFile
=
TRUE
;
ret
=
pSetFileInformationByHandle
(
file
,
FileDispositionInfo
,
&
dispinfo
,
sizeof
(
dispinfo
));
ok
(
ret
,
"setting FileDispositionInfo failed, error %d
\n
"
,
GetLastError
());
...
...
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