topic proposal - Full Stack on Wine

Qian Hong fracting at gmail.com
Mon Sep 21 06:23:33 CDT 2015


Hi Aaryaman,

On Mon, Sep 21, 2015 at 5:32 PM, Aaryaman Vasishta
<jem456.vasishta at gmail.com> wrote:
> Maybe it would be easier for some if you squash both hacks in one diff patch
> and attach it here?
>
Good advice, thank you very much, I attached my hack here.



-- 
Regards,
Qian Hong

-
http://www.winehq.org
-------------- next part --------------
From a245e7306c7855e09159c8970fc2e6a9ba88dd4c Mon Sep 17 00:00:00 2001
From: Qian Hong <qhong at codeweavers.com>
Date: Wed, 9 Sep 2015 05:31:18 +0800
Subject: [PATCH] ntdll: Initialize mod_name to zero.

---
 dlls/ntdll/loader.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c
index f98e0b3..7ac44a3 100644
--- a/dlls/ntdll/loader.c
+++ b/dlls/ntdll/loader.c
@@ -1194,6 +1194,12 @@ static NTSTATUS MODULE_InitDLL( WINE_MODREF *wm, UINT reason, LPVOID lpReserved
     if (wm->ldr.TlsIndex != -1) call_tls_callbacks( wm->ldr.BaseAddress, reason );
     if (!entry || !(wm->ldr.Flags & LDR_IMAGE_IS_DLL)) return STATUS_SUCCESS;
 
+    /*
+    memset( mod_name, 0, 16); //crash
+    memset( mod_name, 0, 17); //works
+    */
+    memset( mod_name, 0, sizeof(mod_name) );
+
     if (TRACE_ON(relay))
     {
         size_t len = min( wm->ldr.BaseDllName.Length, sizeof(mod_name)-sizeof(WCHAR) );
-- 
2.1.0

diff --git a/server/thread.c b/server/thread.c
index da05953..378fd4a 100644
--- a/server/thread.c
+++ b/server/thread.c
@@ -1352,7 +1352,7 @@ DECL_HANDLER(terminate_thread)
     if ((thread = get_thread_from_handle( req->handle, THREAD_TERMINATE )))
     {
         thread->exit_code = req->exit_code;
-        if (thread != current) kill_thread( thread, 1 );
+        if (thread != current) {kill_thread( thread, 1 ); usleep(20000);}
         else
         {
             reply->self = 1;


More information about the wineconf mailing list