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
7fe0b56e
Commit
7fe0b56e
authored
Jun 10, 2015
by
Michael Müller
Committed by
Alexandre Julliard
Jun 11, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Forward SetFileInformationByHandle FileDispositionInfo class to ntdll.
parent
bdef5c55
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
1 deletion
+28
-1
file.c
dlls/kernel32/file.c
+12
-1
file.c
dlls/kernel32/tests/file.c
+16
-0
No files found.
dlls/kernel32/file.c
View file @
7fe0b56e
...
...
@@ -1046,6 +1046,9 @@ BOOL WINAPI SetEndOfFile( HANDLE hFile )
*/
BOOL
WINAPI
SetFileInformationByHandle
(
HANDLE
file
,
FILE_INFO_BY_HANDLE_CLASS
class
,
VOID
*
info
,
DWORD
size
)
{
NTSTATUS
status
;
IO_STATUS_BLOCK
io
;
TRACE
(
"%p %u %p %u
\n
"
,
file
,
class
,
info
,
size
);
switch
(
class
)
...
...
@@ -1053,7 +1056,6 @@ BOOL WINAPI SetFileInformationByHandle( HANDLE file, FILE_INFO_BY_HANDLE_CLASS c
case
FileBasicInfo
:
case
FileNameInfo
:
case
FileRenameInfo
:
case
FileDispositionInfo
:
case
FileAllocationInfo
:
case
FileEndOfFileInfo
:
case
FileStreamInfo
:
...
...
@@ -1071,6 +1073,10 @@ BOOL WINAPI SetFileInformationByHandle( HANDLE file, FILE_INFO_BY_HANDLE_CLASS c
SetLastError
(
ERROR_CALL_NOT_IMPLEMENTED
);
return
FALSE
;
case
FileDispositionInfo
:
status
=
NtSetInformationFile
(
file
,
&
io
,
info
,
size
,
FileDispositionInformation
);
break
;
case
FileStandardInfo
:
case
FileCompressionInfo
:
case
FileAttributeTagInfo
:
...
...
@@ -1080,6 +1086,11 @@ BOOL WINAPI SetFileInformationByHandle( HANDLE file, FILE_INFO_BY_HANDLE_CLASS c
return
FALSE
;
}
if
(
status
!=
STATUS_SUCCESS
)
{
SetLastError
(
RtlNtStatusToDosError
(
status
)
);
return
FALSE
;
}
return
TRUE
;
}
...
...
dlls/kernel32/tests/file.c
View file @
7fe0b56e
...
...
@@ -38,6 +38,10 @@
#include "winnls.h"
#include "fileapi.h"
#ifdef WINE_NO_UNICODE_MACROS
#undef DeleteFile
/* needed for FILE_DISPOSITION_INFO */
#endif
static
HANDLE
(
WINAPI
*
pFindFirstFileExA
)(
LPCSTR
,
FINDEX_INFO_LEVELS
,
LPVOID
,
FINDEX_SEARCH_OPS
,
LPVOID
,
DWORD
);
static
BOOL
(
WINAPI
*
pReplaceFileA
)(
LPCSTR
,
LPCSTR
,
LPCSTR
,
DWORD
,
LPVOID
,
LPVOID
);
static
BOOL
(
WINAPI
*
pReplaceFileW
)(
LPCWSTR
,
LPCWSTR
,
LPCWSTR
,
DWORD
,
LPVOID
,
LPVOID
);
...
...
@@ -4589,6 +4593,7 @@ static void test_SetFileInformationByHandle(void)
FILE_REMOTE_PROTOCOL_INFO
protinfo
=
{
0
};
FILE_STANDARD_INFO
stdinfo
=
{
};
FILE_COMPRESSION_INFO
compressinfo
;
FILE_DISPOSITION_INFO
dispinfo
;
char
tempFileName
[
MAX_PATH
];
char
tempPath
[
MAX_PATH
];
HANDLE
file
;
...
...
@@ -4632,6 +4637,17 @@ static void test_SetFileInformationByHandle(void)
ret
=
pSetFileInformationByHandle
(
file
,
FileRemoteProtocolInfo
,
&
protinfo
,
sizeof
(
protinfo
));
ok
(
!
ret
&&
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"got %d, error %d
\n
"
,
ret
,
GetLastError
());
/* test FileDispositionInfo, additional details already covered by ntdll tests */
SetLastError
(
0xdeadbeef
);
ret
=
pSetFileInformationByHandle
(
file
,
FileDispositionInfo
,
&
dispinfo
,
0
);
todo_wine
ok
(
!
ret
&&
GetLastError
()
==
ERROR_BAD_LENGTH
,
"got %d, error %d
\n
"
,
ret
,
GetLastError
());
dispinfo
.
DeleteFile
=
TRUE
;
ret
=
pSetFileInformationByHandle
(
file
,
FileDispositionInfo
,
&
dispinfo
,
sizeof
(
dispinfo
));
todo_wine
ok
(
ret
,
"setting FileDispositionInfo failed, error %d
\n
"
,
GetLastError
());
CloseHandle
(
file
);
}
...
...
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