mirror of
https://github.com/reactos/reactos.git
synced 2025-01-11 16:51:06 +00:00
Dmitry Gorbachev <hs26332@mail.cnt.ru>
- NtSetInformationFile() could be done before asynchronously called NtWriteFile is completed. Fix this by sending the synchronous flag. - Check return status of the second NtSetInformationFile() call. See issue #2071 for more details. svn path=/trunk/; revision=29629
This commit is contained in:
parent
337bfc3217
commit
5cb248c027
1 changed files with 10 additions and 2 deletions
|
@ -204,7 +204,9 @@ SetupCopyFile(PWCHAR SourceFileName,
|
|||
FILE_ATTRIBUTE_NORMAL,
|
||||
0,
|
||||
FILE_OVERWRITE_IF,
|
||||
FILE_NO_INTERMEDIATE_BUFFERING | FILE_SEQUENTIAL_ONLY,
|
||||
FILE_NO_INTERMEDIATE_BUFFERING |
|
||||
FILE_SEQUENTIAL_ONLY |
|
||||
FILE_SYNCHRONOUS_IO_NONALERT,
|
||||
NULL,
|
||||
0);
|
||||
if(!NT_SUCCESS(Status))
|
||||
|
@ -243,11 +245,17 @@ SetupCopyFile(PWCHAR SourceFileName,
|
|||
}
|
||||
|
||||
/* shorten the file back to it's real size after completing the write */
|
||||
NtSetInformationFile(FileHandleDest,
|
||||
Status = NtSetInformationFile(FileHandleDest,
|
||||
&IoStatusBlock,
|
||||
&FileStandard.EndOfFile,
|
||||
sizeof(FILE_END_OF_FILE_INFORMATION),
|
||||
FileEndOfFileInformation);
|
||||
|
||||
if(!NT_SUCCESS(Status))
|
||||
{
|
||||
DPRINT1("NtSetInformationFile failed: %x\n", Status);
|
||||
}
|
||||
|
||||
closedest:
|
||||
NtClose(FileHandleDest);
|
||||
unmapsrcsec:
|
||||
|
|
Loading…
Reference in a new issue