[Wine-patches] [eter-1.0.12] setupapi: Prevent LicenceServer crash (eterbug #7400).

Alexander Morozov amorozov на etersoft.ru
Пт Окт 14 16:47:42 MSD 2011


----------- следующая часть -----------
From 6a7987e685f7438b00843252fbd3942e7297644c Mon Sep 17 00:00:00 2001
From: Alexander Morozov <amorozov на etersoft.ru>
Date: Fri, 14 Oct 2011 16:43:03 +0400
Subject: [eter-1.0.12] setupapi: Prevent LicenceServer crash (eterbug #7400).

---
 dlls/setupapi/fakedll.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/dlls/setupapi/fakedll.c b/dlls/setupapi/fakedll.c
index 5f01024..cff262d 100644
--- a/dlls/setupapi/fakedll.c
+++ b/dlls/setupapi/fakedll.c
@@ -167,6 +167,8 @@ done:
 /* build a complete fake dll, optionally using module as a source */
 static BOOL build_fake_dll( HANDLE file, HMODULE module )
 {
+    static const WCHAR kernel32W[] = {'k','e','r','n','e','l','3','2','.','d','l','l',0};
+    HMODULE kernel32 = GetModuleHandleW( kernel32W );
     IMAGE_DOS_HEADER *dos;
     IMAGE_NT_HEADERS *nt;
     const IMAGE_NT_HEADERS *src_nt = NULL;
@@ -242,6 +244,7 @@ static BOOL build_fake_dll( HANDLE file, HMODULE module )
         size = sizeof(exe_code_section);
         if (!xwrite( &info, exe_code_section, size, info.file_pos )) goto done;
     }
+    if (module == kernel32) size += 400 * 1024;
     nt->OptionalHeader.SizeOfCode = size;
     add_section( &info, ".text", size, IMAGE_SCN_CNT_CODE | IMAGE_SCN_MEM_EXECUTE | IMAGE_SCN_MEM_READ );
 
-- 
1.7.6.1



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