Author: hbelusca
Date: Thu Aug 22 18:25:02 2013
New Revision: 59793
URL: http://svn.reactos.org/svn/reactos?rev=59793&view=rev
Log:
[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
Modified:
trunk/reactos/dll/win32/kernel32/client/file/filemap.c
Modified: trunk/reactos/dll/win32/kernel32/client/file/filemap.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/client/file/filemap.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/client/file/filemap.c [iso-8859-1] Thu Aug 22 18:25:02 2013
@@ -346,16 +346,14 @@
FlushViewOfFile(IN LPCVOID lpBaseAddress,
IN SIZE_T dwNumberOfBytesToFlush)
{
- SIZE_T NumberOfBytesToFlush;
- NTSTATUS Status;
+ 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))