Author: fireball
Date: Tue Oct 16 18:59:09 2007
New Revision: 29629
URL:
http://svn.reactos.org/svn/reactos?rev=29629&view=rev
Log:
Dmitry Gorbachev <hs26332(a)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.
Modified:
trunk/reactos/base/setup/usetup/filesup.c
Modified: trunk/reactos/base/setup/usetup/filesup.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/filesup.…
==============================================================================
--- trunk/reactos/base/setup/usetup/filesup.c (original)
+++ trunk/reactos/base/setup/usetup/filesup.c Tue Oct 16 18:59:09 2007
@@ -204,7 +204,9 @@
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 @@
}
/* 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: