From 3d31c7014a757581798f52e411d532a8a510af4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Thu, 22 Aug 2013 18:25:02 +0000 Subject: [PATCH] =?UTF-8?q?[KERNEL32]=20Fix=20usage=20of=20the=202nd=20par?= =?UTF-8?q?ameter=20of=20NtFlushVirtualMemory,=20in=20the=20FlushViewOfFil?= =?UTF-8?q?e=20file.=20This=20fixes=20the=20creation=20of=20"self-extracte?= =?UTF-8?q?d"=20files=20from=20executables=20(e.g.=20DeviceTree=20utility?= =?UTF-8?q?=20from=20OSR=20or=20some=20Sysinternals=20tools).=20CORE-6572?= =?UTF-8?q?=20#comment=20Partly=20fixed=20in=20revision=20r59793.=20Now=20?= =?UTF-8?q?the=20objinfo.sys=20file=20is=20created=20without=20corruption,?= =?UTF-8?q?=20but=20there=20are=20problems=20loading=20the=20driver=20itse?= =?UTF-8?q?lf...=20This=20fixes=20a=20bug=20introduced=20in=20revision=207?= =?UTF-8?q?75=20about=2014=20years=20ago!=20Many=20thanks=20to=20Ol=C3=A1f?= =?UTF-8?q?=20for=20having=20debugged=20DeviceTree=20and=20oriented=20me?= =?UTF-8?q?=20to=20the=20real=20problem=20:D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit svn path=/trunk/; revision=59793 --- reactos/dll/win32/kernel32/client/file/filemap.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/reactos/dll/win32/kernel32/client/file/filemap.c b/reactos/dll/win32/kernel32/client/file/filemap.c index 4b6f90573f8..28a85c79ccb 100644 --- a/reactos/dll/win32/kernel32/client/file/filemap.c +++ b/reactos/dll/win32/kernel32/client/file/filemap.c @@ -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))