[Wine-patches] [eterhack] ntoskrnl: Make IoFreeMdl match winehq implementation. (eterbug #10621).

Dmitry Timoshkov dtimoshkov на etersoft.ru
Ср Ноя 11 08:30:44 MSK 2015


It's better to do nothing than write to random memory of a random process.
Etersoft implementation is broken anyway by the winehq merge.
---
 dlls/ntoskrnl.exe/ntoskrnl.c | 20 ++------------------
 1 file changed, 2 insertions(+), 18 deletions(-)

diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c
index 90a67bb..9c1603f 100644
--- a/dlls/ntoskrnl.exe/ntoskrnl.c
+++ b/dlls/ntoskrnl.exe/ntoskrnl.c
@@ -1376,24 +1376,8 @@ PMDL WINAPI IoAllocateMdl( PVOID va, ULONG length, BOOLEAN secondary, BOOLEAN ch
  */
 void WINAPI IoFreeMdl(PMDL mdl)
 {
-    HANDLE process;
-    SIZE_T bytes_written;
-    DWORD process_id = client_pid;
-
-    TRACE( "%p\n", mdl );
-
-    if (process_id)
-    {
-        process = OpenProcess( PROCESS_ALL_ACCESS, FALSE, process_id );
-        if (NULL != process)
-        {
-            NtWriteVirtualMemory( process, mdl->StartVa, mdl->MappedSystemVa,
-                    mdl->ByteCount, &bytes_written );
-            CloseHandle( process );
-        }
-        ExFreePool( mdl->MappedSystemVa );
-    }
-    ExFreePool( mdl );
+    TRACE("%p\n", mdl);
+    HeapFree(GetProcessHeap(), 0, mdl);
 }
 
 
-- 
2.6.3



Подробная информация о списке рассылки Wine-patches