[KERNEL32]

Fix usage of the 2nd parameter of NtFlushVirtualMemory, in the FlushViewOfFile file. This fixes the creation of "self-extracted" files from executables (e.g. DeviceTree utility from OSR or some Sysinternals tools).
CORE-6572 #comment Partly fixed in revision r59793. Now the objinfo.sys file is created without corruption, but there are problems loading the driver itself...
This fixes a bug introduced in revision 775 about 14 years ago!
Many thanks to Oláf for having debugged DeviceTree and oriented me to the real problem :D

svn path=/trunk/; revision=59793
This commit is contained in:
Hermès Bélusca-Maïto 2013-08-22 18:25:02 +00:00
parent 3bb2ee8cd3
commit 3d31c7014a

View file

@ -346,16 +346,14 @@ NTAPI
FlushViewOfFile(IN LPCVOID lpBaseAddress,
IN SIZE_T dwNumberOfBytesToFlush)
{
SIZE_T NumberOfBytesToFlush;
NTSTATUS Status;
PVOID BaseAddress = (PVOID)lpBaseAddress;
SIZE_T NumberOfBytesToFlush = dwNumberOfBytesToFlush;
IO_STATUS_BLOCK IoStatusBlock;
/* Save amount of bytes to flush to a local var */
NumberOfBytesToFlush = dwNumberOfBytesToFlush;
/* Flush the view */
Status = NtFlushVirtualMemory(NtCurrentProcess(),
(LPVOID)lpBaseAddress,
&BaseAddress,
&NumberOfBytesToFlush,
&IoStatusBlock);
if (!NT_SUCCESS(Status) && (Status != STATUS_NOT_MAPPED_DATA))