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
b17e4376
Commit
b17e4376
authored
Jun 07, 2015
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jun 08, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Fail properly for unsupported classes in GetFileInformationByHandleEx.
parent
6db93689
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
63 additions
and
6 deletions
+63
-6
file.c
dlls/kernel32/file.c
+5
-5
file.c
dlls/kernel32/tests/file.c
+28
-1
winbase.h
include/winbase.h
+30
-0
No files found.
dlls/kernel32/file.c
View file @
b17e4376
...
...
@@ -897,14 +897,9 @@ BOOL WINAPI GetFileInformationByHandleEx( HANDLE handle, FILE_INFO_BY_HANDLE_CLA
switch
(
class
)
{
case
FileRenameInfo
:
case
FileDispositionInfo
:
case
FileAllocationInfo
:
case
FileEndOfFileInfo
:
case
FileStreamInfo
:
case
FileCompressionInfo
:
case
FileAttributeTagInfo
:
case
FileIoPriorityHintInfo
:
case
FileRemoteProtocolInfo
:
case
FileFullDirectoryInfo
:
case
FileFullDirectoryRestartInfo
:
...
...
@@ -936,6 +931,11 @@ BOOL WINAPI GetFileInformationByHandleEx( HANDLE handle, FILE_INFO_BY_HANDLE_CLA
(
class
==
FileIdBothDirectoryRestartInfo
)
);
break
;
case
FileRenameInfo
:
case
FileDispositionInfo
:
case
FileAllocationInfo
:
case
FileIoPriorityHintInfo
:
case
FileEndOfFileInfo
:
default:
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
FALSE
;
...
...
dlls/kernel32/tests/file.c
View file @
b17e4376
...
...
@@ -3830,6 +3830,12 @@ static void test_GetFileInformationByHandleEx(void)
FILE_STANDARD_INFO
*
standardInfo
;
FILE_NAME_INFO
*
nameInfo
;
LARGE_INTEGER
prevWrite
;
FILE_IO_PRIORITY_HINT_INFO
priohintinfo
;
FILE_ALLOCATION_INFO
allocinfo
;
FILE_DISPOSITION_INFO
dispinfo
;
FILE_END_OF_FILE_INFO
eofinfo
;
FILE_RENAME_INFO
renameinfo
;
struct
{
FILE_INFO_BY_HANDLE_CLASS
handleClass
;
void
*
ptr
;
...
...
@@ -3952,8 +3958,29 @@ static void test_GetFileInformationByHandleEx(void)
for
(
i
=
0
;
i
<
nameInfo
->
FileNameLength
/
2
;
i
++
)
ok
(
strPtr
[
i
]
==
nameInfo
->
FileName
[
i
],
"Incorrect filename char %d: %c vs %c
\n
"
,
i
,
strPtr
[
i
],
nameInfo
->
FileName
[
i
]);
CloseHandle
(
file
);
/* invalid classes */
SetLastError
(
0xdeadbeef
);
ret
=
pGetFileInformationByHandleEx
(
file
,
FileEndOfFileInfo
,
&
eofinfo
,
sizeof
(
eofinfo
));
ok
(
!
ret
&&
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"got %d, error %d
\n
"
,
ret
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
ret
=
pGetFileInformationByHandleEx
(
file
,
FileIoPriorityHintInfo
,
&
priohintinfo
,
sizeof
(
priohintinfo
));
ok
(
!
ret
&&
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"got %d, error %d
\n
"
,
ret
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
ret
=
pGetFileInformationByHandleEx
(
file
,
FileAllocationInfo
,
&
allocinfo
,
sizeof
(
allocinfo
));
ok
(
!
ret
&&
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"got %d, error %d
\n
"
,
ret
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
ret
=
pGetFileInformationByHandleEx
(
file
,
FileDispositionInfo
,
&
dispinfo
,
sizeof
(
dispinfo
));
ok
(
!
ret
&&
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"got %d, error %d
\n
"
,
ret
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
ret
=
pGetFileInformationByHandleEx
(
file
,
FileRenameInfo
,
&
renameinfo
,
sizeof
(
renameinfo
));
ok
(
!
ret
&&
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"got %d, error %d
\n
"
,
ret
,
GetLastError
());
CloseHandle
(
file
);
DeleteFileA
(
tempFileName
);
}
...
...
include/winbase.h
View file @
b17e4376
...
...
@@ -844,6 +844,36 @@ typedef struct _FILE_NAME_INFO {
WCHAR
FileName
[
1
];
}
FILE_NAME_INFO
,
*
PFILE_NAME_INFO
;
typedef
enum
_PRIORITY_HINT
{
IoPriorityHintVeryLow
,
IoPriorityHintLow
,
IoPriorityHintNormal
,
MaximumIoPriorityHintType
}
PRIORITY_HINT
;
typedef
struct
_FILE_IO_PRIORITY_HINT_INFO
{
PRIORITY_HINT
PriorityHint
;
}
FILE_IO_PRIORITY_HINT_INFO
;
typedef
struct
_FILE_ALLOCATION_INFO
{
LARGE_INTEGER
AllocationSize
;
}
FILE_ALLOCATION_INFO
,
*
PFILE_ALLOCATION_INFO
;
typedef
struct
_FILE_DISPOSITION_INFO
{
BOOLEAN
DeleteFile
;
}
FILE_DISPOSITION_INFO
,
*
PFILE_DISPOSITION_INFO
;
typedef
struct
_FILE_END_OF_FILE_INFO
{
LARGE_INTEGER
EndOfFile
;
}
FILE_END_OF_FILE_INFO
,
*
PFILE_END_OF_FILE_INFO
;
typedef
struct
_FILE_RENAME_INFO
{
BOOLEAN
ReplaceIfExists
;
HANDLE
RootDirectory
;
DWORD
FileNameLength
;
WCHAR
FileName
[
1
];
}
FILE_RENAME_INFO
,
*
PFILE_RENAME_INFO
;
#define PIPE_ACCESS_INBOUND 1
#define PIPE_ACCESS_OUTBOUND 2
#define PIPE_ACCESS_DUPLEX 3
...
...
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