Removed multiple patchsets (accepted upstream).

This commit is contained in:
Sebastian Lackner 2015-02-26 16:44:38 +01:00
parent f133ccbf40
commit 98c6f8974b
14 changed files with 7 additions and 1334 deletions

View File

@ -96,7 +96,7 @@ Included bug fixes and improvements
* FEAR 1 installer expects basic_string_wchar_dtor to return NULL ([Wine Bug #37358](https://bugs.winehq.org/show_bug.cgi?id=37358))
* Fix NULL dereference in ICSeqCompressFrameStart ([Wine Bug #27595](https://bugs.winehq.org/show_bug.cgi?id=27595))
* Fix access violation when calling GetStringTypeW with NULL src. ([Wine Bug #37759](https://bugs.winehq.org/show_bug.cgi?id=37759))
* Fix arguments for OSMesaMakeCurrent when using 16 bit formats
* ~~Fix arguments for OSMesaMakeCurrent when using 16 bit formats~~
* Fix black screen on startup introduced by pixelformat changes. ([Wine Bug #35950](https://bugs.winehq.org/show_bug.cgi?id=35950))
* Fix check for end_frame in RtlUnwindEx on x86_64. ([Wine Bug #34254](https://bugs.winehq.org/show_bug.cgi?id=34254))
* Fix comparison of punctuation characters in lstrcmp ([Wine Bug #10767](https://bugs.winehq.org/show_bug.cgi?id=10767))
@ -155,7 +155,7 @@ Included bug fixes and improvements
* Improvement for heap allocation performance
* Jedi Knight: Dark Forces II crashes with winmm set to native ([Wine Bug #37983](https://bugs.winehq.org/show_bug.cgi?id=37983))
* Lego Stunt Rally requires DXTn software de/encoding support ([Wine Bug #25486](https://bugs.winehq.org/show_bug.cgi?id=25486))
* Limit cross thread access to ImmSet* functions ([Wine Bug #35361](https://bugs.winehq.org/show_bug.cgi?id=35361))
* ~~Limit cross thread access to ImmSet* functions~~ ([Wine Bug #35361](https://bugs.winehq.org/show_bug.cgi?id=35361))
* Lockfree algorithm for filedescriptor cache (improves file access speed)
* MSVCRT crashes when NULL is passed as string to atof or strtod ([Wine Bug #32550](https://bugs.winehq.org/show_bug.cgi?id=32550))
* Make it possible to change media center / tablet pc status ([Wine Bug #18732](https://bugs.winehq.org/show_bug.cgi?id=18732))

4
debian/changelog vendored
View File

@ -13,6 +13,10 @@ wine-staging (1.7.38) UNRELEASED; urgency=low
* Removed patch to properly call DriverUnload when unloading device drivers (accepted upstream).
* Removed patch to allow Accept-Encoding for HTTP/1.0 in wininet (accepted upstream).
* Removed patch to declare pDirectInputCreateEx in a MSVC compatible way (accepted upstream).
* Removed patch to limit cross thread access to ImmSet* functions (accepted upstream).
* Removed patch to fix arguments for OSMesaMakeCurrent when using 16 bit formats (accepted upstream).
* Removed patch to fix memory leak in ApplicationAssociationRegistration_QueryCurrentDefault (accepted upstream).
* Removed patch to complete and properly pack DNS_HEADER structure (accepted upstream).
-- Sebastian Lackner <sebastian@fds-team.de> Mon, 23 Feb 2015 18:24:51 +0100
wine-staging (1.7.37) unstable; urgency=low

View File

@ -1,38 +0,0 @@
From 8593f7d027c48153b038895e8bc0b8fca88fd666 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Tue, 3 Feb 2015 11:07:38 +0100
Subject: gdi32: Fix arguments for OSMesaMakeCurrent when using 16 bit formats.
---
dlls/gdi32/dibdrv/opengl.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/dlls/gdi32/dibdrv/opengl.c b/dlls/gdi32/dibdrv/opengl.c
index 28a03f4..a25da208 100644
--- a/dlls/gdi32/dibdrv/opengl.c
+++ b/dlls/gdi32/dibdrv/opengl.c
@@ -251,6 +251,7 @@ static BOOL dibdrv_wglMakeCurrent( HDC hdc, struct wgl_context *context )
HBITMAP bitmap;
BITMAPOBJ *bmp;
dib_info dib;
+ GLenum type;
BOOL ret = FALSE;
if (!context)
@@ -281,7 +282,12 @@ static BOOL dibdrv_wglMakeCurrent( HDC hdc, struct wgl_context *context )
TRACE( "context %p bits %p size %ux%u\n", context, bits, width, height );
- ret = pOSMesaMakeCurrent( context->context, bits, GL_UNSIGNED_BYTE, width, height );
+ if (pixel_formats[context->format - 1].mesa == OSMESA_RGB_565)
+ type = GL_UNSIGNED_SHORT_5_6_5;
+ else
+ type = GL_UNSIGNED_BYTE;
+
+ ret = pOSMesaMakeCurrent( context->context, bits, type, width, height );
if (ret)
{
pOSMesaPixelStore( OSMESA_ROW_LENGTH, abs( dib.stride ) * 8 / dib.bit_count );
--
2.2.2

View File

@ -1 +0,0 @@
Fixes: Fix arguments for OSMesaMakeCurrent when using 16 bit formats

View File

@ -1,332 +0,0 @@
From 6da899c91d3b1080fa4398f74f9fd58c6dce8484 Mon Sep 17 00:00:00 2001
From: Aric Stewart <aric@codeweavers.com>
Date: Mon, 8 Sep 2014 21:05:31 -0500
Subject: imm32: Move thread data from TLSEntry to an internal list.
Changes by Sebastian Lackner <sebastian@fds-team.de>:
* Remove ugly logic in IMM_FreeThreadData (id not used at all, avoid unnecessary variables)
* IMM_GetInitializedThreadData shouldn't hold the CS while destroying the context in case of a race-condition
* ImmGetDefaultIMEWnd shouldn't hold the CS while creating a window
---
dlls/imm32/imm.c | 163 ++++++++++++++++++++++++++++++++++++++++++-------------
1 file changed, 124 insertions(+), 39 deletions(-)
diff --git a/dlls/imm32/imm.c b/dlls/imm32/imm.c
index f09b132..cf38bf6 100644
--- a/dlls/imm32/imm.c
+++ b/dlls/imm32/imm.c
@@ -89,12 +89,14 @@ typedef struct _tagTRANSMSG {
} TRANSMSG, *LPTRANSMSG;
typedef struct _tagIMMThreadData {
+ struct list entry;
+ DWORD threadID;
HIMC defaultContext;
HWND hwndDefault;
} IMMThreadData;
-static DWORD tlsIndex = 0;
static struct list ImmHklList = LIST_INIT(ImmHklList);
+static struct list ImmThreadDataList = LIST_INIT(ImmThreadDataList);
static const WCHAR szwWineIMCProperty[] = {'W','i','n','e','I','m','m','H','I','M','C','P','r','o','p','e','r','t','y',0};
@@ -104,6 +106,15 @@ static const WCHAR szImeRegFmt[] = {'S','y','s','t','e','m','\\','C','u','r','r'
static const WCHAR szwIME[] = {'I','M','E',0};
+static CRITICAL_SECTION threaddata_cs;
+static CRITICAL_SECTION_DEBUG critsect_debug =
+{
+ 0, 0, &threaddata_cs,
+ { &critsect_debug.ProcessLocksList, &critsect_debug.ProcessLocksList },
+ 0, 0, { (DWORD_PTR)(__FILE__ ": threaddata_cs") }
+};
+static CRITICAL_SECTION threaddata_cs = { &critsect_debug, -1, 0, 0, 0, 0 };
+
#define is_himc_ime_unicode(p) (p->immKbd->imeInfo.fdwProperty & IME_PROP_UNICODE)
#define is_kbd_ime_unicode(p) (p->imeInfo.fdwProperty & IME_PROP_UNICODE)
@@ -211,29 +222,50 @@ static DWORD convert_candidatelist_AtoW(
return ret;
}
-static IMMThreadData* IMM_GetThreadData(void)
+static IMMThreadData* IMM_GetThreadData(DWORD tid)
{
- IMMThreadData* data = TlsGetValue(tlsIndex);
- if (!data)
+ IMMThreadData *data;
+
+ if (!tid) tid = GetCurrentThreadId();
+
+ EnterCriticalSection(&threaddata_cs);
+ LIST_FOR_EACH_ENTRY(data, &ImmThreadDataList, IMMThreadData, entry)
{
- data = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
- sizeof(IMMThreadData));
- TlsSetValue(tlsIndex,data);
- TRACE("Thread Data Created\n");
+ if (data->threadID == tid)
+ return data;
}
+
+ data = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
+ sizeof(IMMThreadData));
+ data->threadID = tid;
+ list_add_head(&ImmThreadDataList, &data->entry);
+ TRACE("Thread Data Created (%x)\n", tid);
+
return data;
}
static void IMM_FreeThreadData(void)
{
- IMMThreadData* data = TlsGetValue(tlsIndex);
- if (data)
+ IMMThreadData *data;
+ DWORD tid = GetCurrentThreadId();
+
+ EnterCriticalSection(&threaddata_cs);
+ LIST_FOR_EACH_ENTRY(data, &ImmThreadDataList, IMMThreadData, entry)
{
- IMM_DestroyContext(data->defaultContext);
- DestroyWindow(data->hwndDefault);
- HeapFree(GetProcessHeap(),0,data);
- TRACE("Thread Data Destroyed\n");
+ if (data->threadID == tid)
+ {
+ list_remove(&data->entry);
+ LeaveCriticalSection(&threaddata_cs);
+
+ IMM_DestroyContext(data->defaultContext);
+ DestroyWindow(data->hwndDefault);
+ HeapFree(GetProcessHeap(),0,data);
+ TRACE("Thread Data Destroyed\n");
+
+ return;
+ }
}
+ LeaveCriticalSection(&threaddata_cs);
}
static HMODULE load_graphics_driver(void)
@@ -368,14 +400,8 @@ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpReserved)
switch (fdwReason)
{
case DLL_PROCESS_ATTACH:
- tlsIndex = TlsAlloc();
- if (tlsIndex == TLS_OUT_OF_INDEXES)
- return FALSE;
if (!User32InitializeImmEntryTable(IMM_INIT_MAGIC))
- {
- TlsFree(tlsIndex);
return FALSE;
- }
break;
case DLL_THREAD_ATTACH:
break;
@@ -386,7 +412,6 @@ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpReserved)
if (lpReserved) break;
IMM_FreeThreadData();
IMM_FreeAllImmHkl();
- TlsFree(tlsIndex);
break;
}
return TRUE;
@@ -442,6 +467,34 @@ static InputContextData* get_imc_data(HIMC hIMC)
return data;
}
+static IMMThreadData* IMM_GetInitializedThreadData(void)
+{
+ IMMThreadData* thread_data;
+ HIMC defaultContext;
+
+ for (;;)
+ {
+ thread_data = IMM_GetThreadData(0);
+ if (thread_data->defaultContext)
+ return thread_data;
+ LeaveCriticalSection(&threaddata_cs);
+
+ /* don't hold the CS while creating the context */
+ defaultContext = ImmCreateContext();
+
+ thread_data = IMM_GetThreadData(0);
+ if (!thread_data->defaultContext)
+ {
+ thread_data->defaultContext = defaultContext;
+ return thread_data;
+ }
+
+ /* someone beat us */
+ LeaveCriticalSection(&threaddata_cs);
+ IMM_DestroyContext(defaultContext);
+ }
+}
+
/***********************************************************************
* ImmAssociateContext (IMM32.@)
*/
@@ -449,31 +502,30 @@ HIMC WINAPI ImmAssociateContext(HWND hWnd, HIMC hIMC)
{
HIMC old = NULL;
InputContextData *data = get_imc_data(hIMC);
+ IMMThreadData* thread_data = NULL;
TRACE("(%p, %p):\n", hWnd, hIMC);
if(hIMC && !data)
return NULL;
- if (!IMM_GetThreadData()->defaultContext)
- IMM_GetThreadData()->defaultContext = ImmCreateContext();
-
/*
* If already associated just return
*/
if (hIMC && data->IMC.hWnd == hWnd)
return hIMC;
+ thread_data = IMM_GetInitializedThreadData();
if (hWnd)
{
old = RemovePropW(hWnd,szwWineIMCProperty);
if (old == NULL)
- old = IMM_GetThreadData()->defaultContext;
+ old = thread_data->defaultContext;
else if (old == (HIMC)-1)
old = NULL;
- if (hIMC != IMM_GetThreadData()->defaultContext)
+ if (hIMC != thread_data->defaultContext)
{
if (hIMC == NULL) /* Meaning disable imm for that window*/
SetPropW(hWnd,szwWineIMCProperty,(HANDLE)-1);
@@ -488,6 +540,7 @@ HIMC WINAPI ImmAssociateContext(HWND hWnd, HIMC hIMC)
old_data->IMC.hWnd = NULL;
}
}
+ LeaveCriticalSection(&threaddata_cs);
if (!hIMC)
return old;
@@ -529,12 +582,17 @@ static BOOL CALLBACK _ImmAssociateContextExEnumProc(HWND hwnd, LPARAM lParam)
*/
BOOL WINAPI ImmAssociateContextEx(HWND hWnd, HIMC hIMC, DWORD dwFlags)
{
+ IMMThreadData* thread_data = NULL;
+ HIMC defaultContext = NULL;
+
TRACE("(%p, %p, 0x%x):\n", hWnd, hIMC, dwFlags);
- if (!IMM_GetThreadData()->defaultContext)
- IMM_GetThreadData()->defaultContext = ImmCreateContext();
+ thread_data = IMM_GetInitializedThreadData();
+ defaultContext = thread_data->defaultContext;
+ LeaveCriticalSection(&threaddata_cs);
- if (!hWnd) return FALSE;
+ if (!hWnd)
+ return FALSE;
switch (dwFlags)
{
@@ -542,7 +600,7 @@ BOOL WINAPI ImmAssociateContextEx(HWND hWnd, HIMC hIMC, DWORD dwFlags)
ImmAssociateContext(hWnd,hIMC);
return TRUE;
case IACE_DEFAULT:
- ImmAssociateContext(hWnd,IMM_GetThreadData()->defaultContext);
+ ImmAssociateContext(hWnd,defaultContext);
return TRUE;
case IACE_IGNORENOCONTEXT:
if (GetPropW(hWnd,szwWineIMCProperty))
@@ -717,7 +775,11 @@ static BOOL IMM_DestroyContext(HIMC hIMC)
*/
BOOL WINAPI ImmDestroyContext(HIMC hIMC)
{
- if (hIMC != IMM_GetThreadData()->defaultContext)
+ IMMThreadData* thread_data = IMM_GetThreadData(0);
+ HIMC defaultContext = thread_data->defaultContext;
+ LeaveCriticalSection(&threaddata_cs);
+
+ if (hIMC != defaultContext)
return IMM_DestroyContext(hIMC);
else
return FALSE;
@@ -1383,6 +1445,7 @@ BOOL WINAPI ImmGetCompositionWindow(HIMC hIMC, LPCOMPOSITIONFORM lpCompForm)
HIMC WINAPI ImmGetContext(HWND hWnd)
{
HIMC rc;
+ IMMThreadData* thread_data;
TRACE("%p\n", hWnd);
@@ -1391,20 +1454,21 @@ HIMC WINAPI ImmGetContext(HWND hWnd)
SetLastError(ERROR_INVALID_WINDOW_HANDLE);
return NULL;
}
- if (!IMM_GetThreadData()->defaultContext)
- IMM_GetThreadData()->defaultContext = ImmCreateContext();
+ thread_data = IMM_GetInitializedThreadData();
rc = GetPropW(hWnd,szwWineIMCProperty);
if (rc == (HIMC)-1)
rc = NULL;
else if (rc == NULL)
- rc = IMM_GetThreadData()->defaultContext;
+ rc = thread_data->defaultContext;
if (rc)
{
InputContextData *data = rc;
data->IMC.hWnd = hWnd;
}
+ LeaveCriticalSection(&threaddata_cs);
+
TRACE("returning %p\n", rc);
return rc;
@@ -1512,11 +1576,32 @@ BOOL WINAPI ImmGetConversionStatus(
*/
HWND WINAPI ImmGetDefaultIMEWnd(HWND hWnd)
{
- if (IMM_GetThreadData()->hwndDefault == NULL)
- IMM_GetThreadData()->hwndDefault = CreateWindowExW( WS_EX_TOOLWINDOW,
- szwIME, NULL, WS_POPUP, 0, 0, 1, 1, 0, 0, 0, 0);
- TRACE("Default is %p\n",IMM_GetThreadData()->hwndDefault);
- return IMM_GetThreadData()->hwndDefault;
+ IMMThreadData* thread_data;
+ HWND ret;
+
+ for (;;)
+ {
+ thread_data = IMM_GetThreadData(0);
+ ret = thread_data->hwndDefault;
+ LeaveCriticalSection(&threaddata_cs);
+ if (ret) return ret;
+
+ /* don't hold the CS while creating the window */
+ ret = CreateWindowExW( WS_EX_TOOLWINDOW,
+ szwIME, NULL, WS_POPUP, 0, 0, 1, 1, 0, 0, 0, 0);
+
+ thread_data = IMM_GetThreadData(0);
+ if (!thread_data->hwndDefault)
+ {
+ thread_data->hwndDefault = ret;
+ LeaveCriticalSection(&threaddata_cs);
+ return ret;
+ }
+
+ /* someone beat us */
+ LeaveCriticalSection(&threaddata_cs);
+ DestroyWindow(ret);
+ }
}
/***********************************************************************
--
2.1.3

View File

@ -1,72 +0,0 @@
From bf064c6ac3f0124810e2afadff7b0cdcbf032765 Mon Sep 17 00:00:00 2001
From: Aric Stewart <aric@codeweavers.com>
Date: Mon, 29 Sep 2014 02:28:32 +0200
Subject: imm32: Do not let ImmDestroyContext destroy any default contexts.
optimization suggested by Nikolay Sivov
---
dlls/imm32/imm.c | 20 +++++++++++++++-----
1 file changed, 15 insertions(+), 5 deletions(-)
diff --git a/dlls/imm32/imm.c b/dlls/imm32/imm.c
index b617f5a..ec03c62 100644
--- a/dlls/imm32/imm.c
+++ b/dlls/imm32/imm.c
@@ -74,6 +74,7 @@ typedef struct tagInputContextData
ImmHkl *immKbd;
UINT lastVK;
+ BOOL threadDefault;
DWORD magic;
} InputContextData;
@@ -128,6 +129,7 @@ static LRESULT WINAPI DefIME_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam,
#define is_kbd_ime_unicode(p) (p->imeInfo.fdwProperty & IME_PROP_UNICODE)
static BOOL IMM_DestroyContext(HIMC hIMC);
+static InputContextData* get_imc_data(HIMC hIMC);
static inline WCHAR *strdupAtoW( const char *str )
{
@@ -253,6 +255,16 @@ static IMMThreadData* IMM_GetThreadData(DWORD tid)
return data;
}
+static BOOL IMM_IsDefaultContext(HIMC imc)
+{
+ InputContextData *data = get_imc_data(imc);
+
+ if (!data)
+ return FALSE;
+
+ return data->threadDefault;
+}
+
static void IMM_FreeThreadData(void)
{
IMMThreadData *data;
@@ -511,6 +523,8 @@ static IMMThreadData* IMM_GetInitializedThreadData(void)
/* don't hold the CS while creating the context */
defaultContext = ImmCreateContext();
+ if (defaultContext)
+ ((InputContextData*)defaultContext)->threadDefault = TRUE;
thread_data = IMM_GetThreadData(0);
if (!thread_data->defaultContext)
@@ -805,11 +819,7 @@ static BOOL IMM_DestroyContext(HIMC hIMC)
*/
BOOL WINAPI ImmDestroyContext(HIMC hIMC)
{
- IMMThreadData* thread_data = IMM_GetThreadData(0);
- HIMC defaultContext = thread_data->defaultContext;
- LeaveCriticalSection(&threaddata_cs);
-
- if (hIMC != defaultContext)
+ if (!IMM_IsDefaultContext(hIMC))
return IMM_DestroyContext(hIMC);
else
return FALSE;
--
2.1.1

View File

@ -1,210 +0,0 @@
From e900bc5a15f15278dc22dbc447ab5f7d18e0ce14 Mon Sep 17 00:00:00 2001
From: Aric Stewart <aric@codeweavers.com>
Date: Mon, 29 Sep 2014 02:42:05 +0200
Subject: imm32: Use thread data from target HWND.
---
dlls/imm32/imm.c | 61 +++++++++++++++++++++++++++++++++++++++++-------
dlls/imm32/tests/imm32.c | 21 +++++++++++------
2 files changed, 66 insertions(+), 16 deletions(-)
diff --git a/dlls/imm32/imm.c b/dlls/imm32/imm.c
index ec03c62..f7fca3f 100644
--- a/dlls/imm32/imm.c
+++ b/dlls/imm32/imm.c
@@ -255,6 +255,21 @@ static IMMThreadData* IMM_GetThreadData(DWORD tid)
return data;
}
+static IMMThreadData* IMM_GetThreadDataForWindow(HWND hwnd)
+{
+ DWORD process;
+ DWORD thread = 0;
+
+ if (hwnd)
+ {
+ thread = GetWindowThreadProcessId(hwnd, &process);
+ if (process != GetCurrentProcessId())
+ return NULL;
+ }
+
+ return IMM_GetThreadData(thread);
+}
+
static BOOL IMM_IsDefaultContext(HIMC imc)
{
InputContextData *data = get_imc_data(imc);
@@ -509,14 +524,16 @@ static InputContextData* get_imc_data(HIMC hIMC)
return data;
}
-static IMMThreadData* IMM_GetInitializedThreadData(void)
+static IMMThreadData* IMM_GetInitializedThreadData(HWND hWnd)
{
IMMThreadData* thread_data;
HIMC defaultContext;
for (;;)
{
- thread_data = IMM_GetThreadData(0);
+ thread_data = IMM_GetThreadDataForWindow(hWnd);
+ if (!thread_data)
+ return NULL;
if (thread_data->defaultContext)
return thread_data;
LeaveCriticalSection(&threaddata_cs);
@@ -526,7 +543,12 @@ static IMMThreadData* IMM_GetInitializedThreadData(void)
if (defaultContext)
((InputContextData*)defaultContext)->threadDefault = TRUE;
- thread_data = IMM_GetThreadData(0);
+ thread_data = IMM_GetThreadDataForWindow(hWnd);
+ if (!thread_data)
+ {
+ IMM_DestroyContext(defaultContext);
+ return NULL;
+ }
if (!thread_data->defaultContext)
{
thread_data->defaultContext = defaultContext;
@@ -559,7 +581,10 @@ HIMC WINAPI ImmAssociateContext(HWND hWnd, HIMC hIMC)
if (hIMC && data->IMC.hWnd == hWnd)
return hIMC;
- thread_data = IMM_GetInitializedThreadData();
+ thread_data = IMM_GetInitializedThreadData(hWnd);
+ if (!thread_data)
+ return NULL;
+
if (hWnd)
{
old = RemovePropW(hWnd,szwWineIMCProperty);
@@ -631,7 +656,10 @@ BOOL WINAPI ImmAssociateContextEx(HWND hWnd, HIMC hIMC, DWORD dwFlags)
TRACE("(%p, %p, 0x%x):\n", hWnd, hIMC, dwFlags);
- thread_data = IMM_GetInitializedThreadData();
+ thread_data = IMM_GetInitializedThreadData(hWnd);
+ if (!thread_data)
+ return FALSE;
+
defaultContext = thread_data->defaultContext;
LeaveCriticalSection(&threaddata_cs);
@@ -1495,7 +1523,10 @@ HIMC WINAPI ImmGetContext(HWND hWnd)
return NULL;
}
- thread_data = IMM_GetInitializedThreadData();
+ thread_data = IMM_GetInitializedThreadData(hWnd);
+ if (!thread_data)
+ return NULL;
+
rc = GetPropW(hWnd,szwWineIMCProperty);
if (rc == (HIMC)-1)
rc = NULL;
@@ -1618,19 +1649,31 @@ HWND WINAPI ImmGetDefaultIMEWnd(HWND hWnd)
{
IMMThreadData* thread_data;
HWND ret;
+ DWORD tid;
for (;;)
{
- thread_data = IMM_GetThreadData(0);
+ thread_data = IMM_GetThreadDataForWindow(hWnd);
+ if (!thread_data)
+ return NULL;
ret = thread_data->hwndDefault;
+ tid = thread_data->threadID;
LeaveCriticalSection(&threaddata_cs);
- if (ret) return ret;
+
+ /* don't create windows for other threads */
+ if (ret || tid != GetCurrentThreadId())
+ return ret;
/* don't hold the CS while creating the window */
ret = CreateWindowExW( WS_EX_TOOLWINDOW,
szwIME, NULL, WS_POPUP, 0, 0, 1, 1, 0, 0, 0, 0);
- thread_data = IMM_GetThreadData(0);
+ thread_data = IMM_GetThreadDataForWindow(hWnd);
+ if (!thread_data)
+ {
+ DestroyWindow(ret);
+ return NULL;
+ }
if (!thread_data->hwndDefault)
{
thread_data->hwndDefault = ret;
diff --git a/dlls/imm32/tests/imm32.c b/dlls/imm32/tests/imm32.c
index 4c0a888..2471634 100644
--- a/dlls/imm32/tests/imm32.c
+++ b/dlls/imm32/tests/imm32.c
@@ -425,15 +425,17 @@ static DWORD WINAPI ImmGetContextThreadFunc( LPVOID lpParam)
HWND hwnd2;
COMPOSITIONFORM cf;
POINT pt;
+ MSG msg;
+
igc_threadinfo *info= (igc_threadinfo*)lpParam;
info->hwnd = CreateWindowExA(WS_EX_CLIENTEDGE, wndcls, "Wine imm32.dll test",
WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT,
240, 120, NULL, NULL, GetModuleHandleW(NULL), NULL);
h1 = ImmGetContext(hwnd);
- todo_wine ok(info->himc == h1, "hwnd context changed in new thread\n");
+ ok(info->himc == h1, "hwnd context changed in new thread\n");
h2 = ImmGetContext(info->hwnd);
- todo_wine ok(h2 != h1, "new hwnd in new thread should have different context\n");
+ ok(h2 != h1, "new hwnd in new thread should have different context\n");
info->himc = h2;
ImmReleaseContext(hwnd,h1);
@@ -452,7 +454,12 @@ static DWORD WINAPI ImmGetContextThreadFunc( LPVOID lpParam)
ImmSetStatusWindowPos(h1, &pt);
SetEvent(info->event);
- Sleep(INFINITE);
+
+ while(GetMessageW(&msg, 0, 0, 0))
+ {
+ TranslateMessage(&msg);
+ DispatchMessageW(&msg);
+ }
return 1;
}
@@ -477,8 +484,8 @@ static void test_ImmThreads(void)
otherHimc = ImmGetContext(threadinfo.hwnd);
- todo_wine ok(himc != otherHimc, "Windows from other threads should have different himc\n");
- todo_wine ok(otherHimc == threadinfo.himc, "Context from other thread should not change in main thread\n");
+ ok(himc != otherHimc, "Windows from other threads should have different himc\n");
+ ok(otherHimc == threadinfo.himc, "Context from other thread should not change in main thread\n");
if (0) /* FIXME: Causes wine to hang */
{
@@ -566,7 +573,7 @@ static void test_ImmThreads(void)
ok (rc == 1, "ImmGetCandidateWindow should succeed\n");
rc = ImmGetCandidateWindow(otherHimc, 0, &cdf);
- todo_wine ok (rc == 0, "ImmGetCandidateWindow should fail\n");
+ ok (rc == 0, "ImmGetCandidateWindow should fail\n");
rc = ImmSetCandidateWindow(otherHimc, &cdf);
todo_wine ok (rc == 0, "ImmSetCandidateWindow should fail\n");
@@ -577,7 +584,7 @@ static void test_ImmThreads(void)
TerminateThread(hThread, 1);
himc = ImmGetContext(GetDesktopWindow());
- todo_wine ok(himc == NULL, "Should not be able to get himc from other process window\n");
+ ok(himc == NULL, "Should not be able to get himc from other process window\n");
}
static void test_ImmIsUIMessage(void)
--
2.1.1

View File

@ -1,227 +0,0 @@
From f5b7d0ea864e0ab6fb28f8ff492730a4d748b356 Mon Sep 17 00:00:00 2001
From: Aric Stewart <aric@codeweavers.com>
Date: Mon, 29 Sep 2014 02:48:08 +0200
Subject: imm32: Restrict crossthread Association and destruction.
---
dlls/imm32/imm.c | 26 ++++++++++++++++++++-
dlls/imm32/tests/imm32.c | 59 +++++++++++++++++++++++++++++++++++++++++++++---
2 files changed, 81 insertions(+), 4 deletions(-)
diff --git a/dlls/imm32/imm.c b/dlls/imm32/imm.c
index f7fca3f..efbd623 100644
--- a/dlls/imm32/imm.c
+++ b/dlls/imm32/imm.c
@@ -71,6 +71,7 @@ typedef struct tagInputContextData
{
DWORD dwLock;
INPUTCONTEXT IMC;
+ DWORD threadID;
ImmHkl *immKbd;
UINT lastVK;
@@ -561,6 +562,25 @@ static IMMThreadData* IMM_GetInitializedThreadData(HWND hWnd)
}
}
+static BOOL IMM_IsCrossThreadAccess(HWND hWnd, HIMC hIMC)
+{
+ DWORD tid = GetCurrentThreadId();
+ InputContextData *data;
+
+ if (hWnd)
+ {
+ DWORD process;
+ DWORD thread;
+
+ thread = GetWindowThreadProcessId(hWnd, &process);
+ if (thread != tid || process != GetCurrentProcessId())
+ return TRUE;
+ }
+
+ data = get_imc_data(hIMC);
+ return (data && data->threadID != tid);
+}
+
/***********************************************************************
* ImmAssociateContext (IMM32.@)
*/
@@ -581,6 +601,9 @@ HIMC WINAPI ImmAssociateContext(HWND hWnd, HIMC hIMC)
if (hIMC && data->IMC.hWnd == hWnd)
return hIMC;
+ if (hIMC && IMM_IsCrossThreadAccess(hWnd, hIMC))
+ return NULL;
+
thread_data = IMM_GetInitializedThreadData(hWnd);
if (!thread_data)
return NULL;
@@ -808,6 +831,7 @@ HIMC WINAPI ImmCreateContext(void)
IMM_DestroyContext(new_context);
return 0;
}
+ new_context->threadID = GetCurrentThreadId();
SendMessageW(GetFocus(), WM_IME_SELECT, TRUE, (LPARAM)GetKeyboardLayout(0));
new_context->immKbd->uSelected++;
@@ -847,7 +871,7 @@ static BOOL IMM_DestroyContext(HIMC hIMC)
*/
BOOL WINAPI ImmDestroyContext(HIMC hIMC)
{
- if (!IMM_IsDefaultContext(hIMC))
+ if (!IMM_IsDefaultContext(hIMC) && !IMM_IsCrossThreadAccess(NULL, hIMC))
return IMM_DestroyContext(hIMC);
else
return FALSE;
diff --git a/dlls/imm32/tests/imm32.c b/dlls/imm32/tests/imm32.c
index 2471634..a64f9da 100644
--- a/dlls/imm32/tests/imm32.c
+++ b/dlls/imm32/tests/imm32.c
@@ -416,6 +416,7 @@ typedef struct _igc_threadinfo {
HWND hwnd;
HANDLE event;
HIMC himc;
+ HIMC u_himc;
} igc_threadinfo;
@@ -424,6 +425,7 @@ static DWORD WINAPI ImmGetContextThreadFunc( LPVOID lpParam)
HIMC h1,h2;
HWND hwnd2;
COMPOSITIONFORM cf;
+ CANDIDATEFORM cdf;
POINT pt;
MSG msg;
@@ -452,6 +454,13 @@ static DWORD WINAPI ImmGetContextThreadFunc( LPVOID lpParam)
/* priming for later tests */
ImmSetCompositionWindow(h1, &cf);
ImmSetStatusWindowPos(h1, &pt);
+ info->u_himc = ImmCreateContext();
+ ImmSetOpenStatus(info->u_himc, TRUE);
+ cdf.dwIndex = 0;
+ cdf.dwStyle = CFS_CANDIDATEPOS;
+ cdf.ptCurrentPos.x = 0;
+ cdf.ptCurrentPos.y = 0;
+ ImmSetCandidateWindow(info->u_himc, &cdf);
SetEvent(info->event);
@@ -487,15 +496,23 @@ static void test_ImmThreads(void)
ok(himc != otherHimc, "Windows from other threads should have different himc\n");
ok(otherHimc == threadinfo.himc, "Context from other thread should not change in main thread\n");
- if (0) /* FIXME: Causes wine to hang */
- {
h1 = ImmAssociateContext(hwnd,otherHimc);
ok(h1 == NULL, "Should fail to be able to Associate a default context from a different thread\n");
h1 = ImmGetContext(hwnd);
ok(h1 == himc, "Context for window should remain unchanged\n");
ImmReleaseContext(hwnd,h1);
- }
+ h1 = ImmAssociateContext(hwnd, threadinfo.u_himc);
+ ok (h1 == NULL, "Should fail to associate a context from a different thread\n");
+ h1 = ImmGetContext(hwnd);
+ ok(h1 == himc, "Context for window should remain unchanged\n");
+ ImmReleaseContext(hwnd,h1);
+
+ h1 = ImmAssociateContext(threadinfo.hwnd, threadinfo.u_himc);
+ ok (h1 == NULL, "Should fail to associate a context from a different thread into a window from that thread.\n");
+ h1 = ImmGetContext(threadinfo.hwnd);
+ ok(h1 == threadinfo.himc, "Context for window should remain unchanged\n");
+ ImmReleaseContext(threadinfo.hwnd,h1);
/* OpenStatus */
rc = ImmSetOpenStatus(himc, TRUE);
@@ -509,8 +526,12 @@ static void test_ImmThreads(void)
rc = ImmSetOpenStatus(otherHimc, TRUE);
todo_wine ok(rc == 0, "ImmSetOpenStatus should fail\n");
+ rc = ImmSetOpenStatus(threadinfo.u_himc, TRUE);
+ todo_wine ok(rc == 0, "ImmSetOpenStatus should fail\n");
rc = ImmGetOpenStatus(otherHimc);
todo_wine ok(rc == 0, "ImmGetOpenStatus failed\n");
+ rc = ImmGetOpenStatus(threadinfo.u_himc);
+ ok (rc == 1 || broken(rc == 0), "ImmGetOpenStatus should return 1\n");
rc = ImmSetOpenStatus(otherHimc, FALSE);
todo_wine ok(rc == 0, "ImmSetOpenStatus should fail\n");
rc = ImmGetOpenStatus(otherHimc);
@@ -524,8 +545,12 @@ static void test_ImmThreads(void)
rc = ImmGetCompositionFontA(otherHimc, &lf);
ok(rc != 0 || broken(rc == 0), "ImmGetCompositionFont failed\n");
+ rc = ImmGetCompositionFontA(threadinfo.u_himc, &lf);
+ ok(rc != 0 || broken(rc == 0), "ImmGetCompositionFont user himc failed\n");
rc = ImmSetCompositionFontA(otherHimc, &lf);
todo_wine ok(rc == 0, "ImmSetCompositionFont should fail\n");
+ rc = ImmSetCompositionFontA(threadinfo.u_himc, &lf);
+ todo_wine ok(rc == 0, "ImmSetCompositionFont should fail\n");
/* CompositionWindow */
rc = ImmSetCompositionWindow(himc, &cf);
@@ -535,8 +560,12 @@ static void test_ImmThreads(void)
rc = ImmSetCompositionWindow(otherHimc, &cf);
todo_wine ok(rc == 0, "ImmSetCompositionWindow should fail\n");
+ rc = ImmSetCompositionWindow(threadinfo.u_himc, &cf);
+ todo_wine ok(rc == 0, "ImmSetCompositionWindow should fail\n");
rc = ImmGetCompositionWindow(otherHimc, &cf);
ok(rc != 0 || broken(rc == 0), "ImmGetCompositionWindow failed\n");
+ rc = ImmGetCompositionWindow(threadinfo.u_himc, &cf);
+ ok(rc != 0 || broken(rc == 0), "ImmGetCompositionWindow failed\n");
/* ConversionStatus */
rc = ImmGetConversionStatus(himc, &status, &sentence);
@@ -546,8 +575,12 @@ static void test_ImmThreads(void)
rc = ImmGetConversionStatus(otherHimc, &status, &sentence);
ok(rc != 0 || broken(rc == 0), "ImmGetConversionStatus failed\n");
+ rc = ImmGetConversionStatus(threadinfo.u_himc, &status, &sentence);
+ ok(rc != 0 || broken(rc == 0), "ImmGetConversionStatus failed\n");
rc = ImmSetConversionStatus(otherHimc, status, sentence);
todo_wine ok(rc == 0, "ImmSetConversionStatus should fail\n");
+ rc = ImmSetConversionStatus(threadinfo.u_himc, status, sentence);
+ todo_wine ok(rc == 0, "ImmSetConversionStatus should fail\n");
/* StatusWindowPos */
rc = ImmSetStatusWindowPos(himc, &pt);
@@ -557,8 +590,24 @@ static void test_ImmThreads(void)
rc = ImmSetStatusWindowPos(otherHimc, &pt);
todo_wine ok(rc == 0, "ImmSetStatusWindowPos should fail\n");
+ rc = ImmSetStatusWindowPos(threadinfo.u_himc, &pt);
+ todo_wine ok(rc == 0, "ImmSetStatusWindowPos should fail\n");
rc = ImmGetStatusWindowPos(otherHimc, &pt);
ok(rc != 0 || broken(rc == 0), "ImmGetStatusWindowPos failed\n");
+ rc = ImmGetStatusWindowPos(threadinfo.u_himc, &pt);
+ ok(rc != 0 || broken(rc == 0), "ImmGetStatusWindowPos failed\n");
+
+ h1 = ImmAssociateContext(threadinfo.hwnd, NULL);
+ ok (h1 == otherHimc, "ImmAssociateContext cross thread with NULL should work\n");
+ h1 = ImmGetContext(threadinfo.hwnd);
+ ok (h1 == NULL, "CrossThread window context should be NULL\n");
+ h1 = ImmAssociateContext(threadinfo.hwnd, h1);
+ ok (h1 == NULL, "Resetting cross thread context should fail\n");
+ h1 = ImmGetContext(threadinfo.hwnd);
+ ok (h1 == NULL, "CrossThread window context should still be NULL\n");
+
+ rc = ImmDestroyContext(threadinfo.u_himc);
+ ok (rc == 0, "ImmDestroyContext Cross Thread should fail\n");
/* Candidate Window */
rc = ImmGetCandidateWindow(himc, 0, &cdf);
@@ -576,6 +625,10 @@ static void test_ImmThreads(void)
ok (rc == 0, "ImmGetCandidateWindow should fail\n");
rc = ImmSetCandidateWindow(otherHimc, &cdf);
todo_wine ok (rc == 0, "ImmSetCandidateWindow should fail\n");
+ rc = ImmGetCandidateWindow(threadinfo.u_himc, 0, &cdf);
+ ok (rc == 1 || broken( rc == 0), "ImmGetCandidateWindow should succeed\n");
+ rc = ImmSetCandidateWindow(threadinfo.u_himc, &cdf);
+ todo_wine ok (rc == 0, "ImmSetCandidateWindow should fail\n");
ImmReleaseContext(threadinfo.hwnd,otherHimc);
ImmReleaseContext(hwnd,himc);
--
2.1.1

View File

@ -1,173 +0,0 @@
From e76b9bfb0d47f7df14256e62a57585660adcf8c0 Mon Sep 17 00:00:00 2001
From: Aric Stewart <aric@codeweavers.com>
Date: Mon, 8 Sep 2014 21:06:13 -0500
Subject: imm32: Limit cross thread access to ImmSet* functions.
---
dlls/imm32/imm.c | 21 +++++++++++++++++++++
dlls/imm32/tests/imm32.c | 28 ++++++++++++++--------------
2 files changed, 35 insertions(+), 14 deletions(-)
diff --git a/dlls/imm32/imm.c b/dlls/imm32/imm.c
index efbd623..222c86e 100644
--- a/dlls/imm32/imm.c
+++ b/dlls/imm32/imm.c
@@ -2311,6 +2311,9 @@ BOOL WINAPI ImmSetCandidateWindow(
if (!data || !lpCandidate)
return FALSE;
+ if (IMM_IsCrossThreadAccess(NULL, hIMC))
+ return FALSE;
+
TRACE("\t%x, %x, (%i,%i), (%i,%i - %i,%i)\n",
lpCandidate->dwIndex, lpCandidate->dwStyle,
lpCandidate->ptCurrentPos.x, lpCandidate->ptCurrentPos.y,
@@ -2341,6 +2344,9 @@ BOOL WINAPI ImmSetCompositionFontA(HIMC hIMC, LPLOGFONTA lplf)
return FALSE;
}
+ if (IMM_IsCrossThreadAccess(NULL, hIMC))
+ return FALSE;
+
memcpy(&data->IMC.lfFont.W,lplf,sizeof(LOGFONTA));
MultiByteToWideChar(CP_ACP, 0, lplf->lfFaceName, -1, data->IMC.lfFont.W.lfFaceName,
LF_FACESIZE);
@@ -2364,6 +2370,9 @@ BOOL WINAPI ImmSetCompositionFontW(HIMC hIMC, LPLOGFONTW lplf)
return FALSE;
}
+ if (IMM_IsCrossThreadAccess(NULL, hIMC))
+ return FALSE;
+
data->IMC.lfFont.W = *lplf;
ImmNotifyIME(hIMC, NI_CONTEXTUPDATED, 0, IMC_SETCOMPOSITIONFONT);
ImmInternalSendIMENotify(data, IMN_SETCOMPOSITIONFONT, 0);
@@ -2505,6 +2514,9 @@ BOOL WINAPI ImmSetCompositionWindow(
return FALSE;
}
+ if (IMM_IsCrossThreadAccess(NULL, hIMC))
+ return FALSE;
+
data->IMC.cfCompForm = *lpCompForm;
if (IsWindowVisible(data->immKbd->UIWnd))
@@ -2539,6 +2551,9 @@ BOOL WINAPI ImmSetConversionStatus(
return FALSE;
}
+ if (IMM_IsCrossThreadAccess(NULL, hIMC))
+ return FALSE;
+
if ( fdwConversion != data->IMC.fdwConversion )
{
oldConversion = data->IMC.fdwConversion;
@@ -2572,6 +2587,9 @@ BOOL WINAPI ImmSetOpenStatus(HIMC hIMC, BOOL fOpen)
return FALSE;
}
+ if (IMM_IsCrossThreadAccess(NULL, hIMC))
+ return FALSE;
+
if (data->immKbd->UIWnd == NULL)
{
/* create the ime window */
@@ -2608,6 +2626,9 @@ BOOL WINAPI ImmSetStatusWindowPos(HIMC hIMC, LPPOINT lpptPos)
return FALSE;
}
+ if (IMM_IsCrossThreadAccess(NULL, hIMC))
+ return FALSE;
+
TRACE("\t(%i,%i)\n", lpptPos->x, lpptPos->y);
data->IMC.ptStatusWndPos = *lpptPos;
diff --git a/dlls/imm32/tests/imm32.c b/dlls/imm32/tests/imm32.c
index a64f9da..d7eec44 100644
--- a/dlls/imm32/tests/imm32.c
+++ b/dlls/imm32/tests/imm32.c
@@ -525,15 +525,15 @@ static void test_ImmThreads(void)
ok(rc == 0, "ImmGetOpenStatus failed\n");
rc = ImmSetOpenStatus(otherHimc, TRUE);
- todo_wine ok(rc == 0, "ImmSetOpenStatus should fail\n");
+ ok(rc == 0, "ImmSetOpenStatus should fail\n");
rc = ImmSetOpenStatus(threadinfo.u_himc, TRUE);
- todo_wine ok(rc == 0, "ImmSetOpenStatus should fail\n");
+ ok(rc == 0, "ImmSetOpenStatus should fail\n");
rc = ImmGetOpenStatus(otherHimc);
- todo_wine ok(rc == 0, "ImmGetOpenStatus failed\n");
+ ok(rc == 0, "ImmGetOpenStatus failed\n");
rc = ImmGetOpenStatus(threadinfo.u_himc);
ok (rc == 1 || broken(rc == 0), "ImmGetOpenStatus should return 1\n");
rc = ImmSetOpenStatus(otherHimc, FALSE);
- todo_wine ok(rc == 0, "ImmSetOpenStatus should fail\n");
+ ok(rc == 0, "ImmSetOpenStatus should fail\n");
rc = ImmGetOpenStatus(otherHimc);
ok(rc == 0, "ImmGetOpenStatus failed\n");
@@ -548,9 +548,9 @@ static void test_ImmThreads(void)
rc = ImmGetCompositionFontA(threadinfo.u_himc, &lf);
ok(rc != 0 || broken(rc == 0), "ImmGetCompositionFont user himc failed\n");
rc = ImmSetCompositionFontA(otherHimc, &lf);
- todo_wine ok(rc == 0, "ImmSetCompositionFont should fail\n");
+ ok(rc == 0, "ImmSetCompositionFont should fail\n");
rc = ImmSetCompositionFontA(threadinfo.u_himc, &lf);
- todo_wine ok(rc == 0, "ImmSetCompositionFont should fail\n");
+ ok(rc == 0, "ImmSetCompositionFont should fail\n");
/* CompositionWindow */
rc = ImmSetCompositionWindow(himc, &cf);
@@ -559,9 +559,9 @@ static void test_ImmThreads(void)
ok(rc != 0, "ImmGetCompositionWindow failed\n");
rc = ImmSetCompositionWindow(otherHimc, &cf);
- todo_wine ok(rc == 0, "ImmSetCompositionWindow should fail\n");
+ ok(rc == 0, "ImmSetCompositionWindow should fail\n");
rc = ImmSetCompositionWindow(threadinfo.u_himc, &cf);
- todo_wine ok(rc == 0, "ImmSetCompositionWindow should fail\n");
+ ok(rc == 0, "ImmSetCompositionWindow should fail\n");
rc = ImmGetCompositionWindow(otherHimc, &cf);
ok(rc != 0 || broken(rc == 0), "ImmGetCompositionWindow failed\n");
rc = ImmGetCompositionWindow(threadinfo.u_himc, &cf);
@@ -578,9 +578,9 @@ static void test_ImmThreads(void)
rc = ImmGetConversionStatus(threadinfo.u_himc, &status, &sentence);
ok(rc != 0 || broken(rc == 0), "ImmGetConversionStatus failed\n");
rc = ImmSetConversionStatus(otherHimc, status, sentence);
- todo_wine ok(rc == 0, "ImmSetConversionStatus should fail\n");
+ ok(rc == 0, "ImmSetConversionStatus should fail\n");
rc = ImmSetConversionStatus(threadinfo.u_himc, status, sentence);
- todo_wine ok(rc == 0, "ImmSetConversionStatus should fail\n");
+ ok(rc == 0, "ImmSetConversionStatus should fail\n");
/* StatusWindowPos */
rc = ImmSetStatusWindowPos(himc, &pt);
@@ -589,9 +589,9 @@ static void test_ImmThreads(void)
ok(rc != 0, "ImmGetStatusWindowPos failed\n");
rc = ImmSetStatusWindowPos(otherHimc, &pt);
- todo_wine ok(rc == 0, "ImmSetStatusWindowPos should fail\n");
+ ok(rc == 0, "ImmSetStatusWindowPos should fail\n");
rc = ImmSetStatusWindowPos(threadinfo.u_himc, &pt);
- todo_wine ok(rc == 0, "ImmSetStatusWindowPos should fail\n");
+ ok(rc == 0, "ImmSetStatusWindowPos should fail\n");
rc = ImmGetStatusWindowPos(otherHimc, &pt);
ok(rc != 0 || broken(rc == 0), "ImmGetStatusWindowPos failed\n");
rc = ImmGetStatusWindowPos(threadinfo.u_himc, &pt);
@@ -624,11 +624,11 @@ static void test_ImmThreads(void)
rc = ImmGetCandidateWindow(otherHimc, 0, &cdf);
ok (rc == 0, "ImmGetCandidateWindow should fail\n");
rc = ImmSetCandidateWindow(otherHimc, &cdf);
- todo_wine ok (rc == 0, "ImmSetCandidateWindow should fail\n");
+ ok (rc == 0, "ImmSetCandidateWindow should fail\n");
rc = ImmGetCandidateWindow(threadinfo.u_himc, 0, &cdf);
ok (rc == 1 || broken( rc == 0), "ImmGetCandidateWindow should succeed\n");
rc = ImmSetCandidateWindow(threadinfo.u_himc, &cdf);
- todo_wine ok (rc == 0, "ImmSetCandidateWindow should fail\n");
+ ok (rc == 0, "ImmSetCandidateWindow should fail\n");
ImmReleaseContext(threadinfo.hwnd,otherHimc);
ImmReleaseContext(hwnd,himc);
--
2.1.1

View File

@ -1 +0,0 @@
Fixes: [35361] Limit cross thread access to ImmSet* functions

View File

@ -1,51 +0,0 @@
From de201e9e2b3e42200249f2693ef338e319f00e2c Mon Sep 17 00:00:00 2001
From: Amine Khaldi <amine.khaldi@reactos.org>
Date: Mon, 23 Feb 2015 21:43:14 +0100
Subject: include/windns.h: Complete and properly pack DNS_HEADER structure.
---
include/windns.h | 20 ++++++++++++--------
1 file changed, 12 insertions(+), 8 deletions(-)
diff --git a/include/windns.h b/include/windns.h
index b8a3e09..fc2a49c 100644
--- a/include/windns.h
+++ b/include/windns.h
@@ -176,22 +176,26 @@ typedef struct _IP4_ARRAY
IP4_ADDRESS AddrArray[1];
} IP4_ARRAY, *PIP4_ARRAY;
+#include <pshpack1.h>
typedef struct _DNS_HEADER
{
WORD Xid;
- BYTE RecursionDesired;
- BYTE Truncation;
- BYTE Authoritative;
- BYTE Opcode;
- BYTE IsResponse;
- BYTE ResponseCode;
- BYTE Reserved;
- BYTE RecursionAvailable;
+ BYTE RecursionDesired:1;
+ BYTE Truncation:1;
+ BYTE Authoritative:1;
+ BYTE Opcode:4;
+ BYTE IsResponse:1;
+ BYTE ResponseCode:4;
+ BYTE CheckingDisabled:1;
+ BYTE AuthenticatedData:1;
+ BYTE Reserved:1;
+ BYTE RecursionAvailable:1;
WORD QuestionCount;
WORD AnswerCount;
WORD NameServerCount;
WORD AdditionalCount;
} DNS_HEADER, *PDNS_HEADER;
+#include <poppack.h>
typedef struct _DNS_MESSAGE_BUFFER
{
--
2.3.0

View File

@ -91,12 +91,9 @@ patch_enable_all ()
enable_fonts_Missing_Fonts="$1"
enable_gdi32_MaxPixelFormats="$1"
enable_gdi32_MultiMonitor="$1"
enable_gdi32_OSMesaMakeCurrent="$1"
enable_gdiplus_GdipCreateRegionRgnData="$1"
enable_imagehlp_BindImageEx="$1"
enable_imm32_Cross_Thread_Access="$1"
enable_include_Winetest="$1"
enable_include_windns="$1"
enable_iphlpapi_TCP_Table="$1"
enable_kernel32_Console_Handles="$1"
enable_kernel32_GetFinalPathNameByHandle="$1"
@ -165,7 +162,6 @@ patch_enable_all ()
enable_server_Unexpected_Wakeup="$1"
enable_setupapi_SetupPromptForDisk="$1"
enable_shdocvw_ParseURLFromOutsideSource_Tests="$1"
enable_shell32_ApplicationAssociationRegistration="$1"
enable_shell32_Default_Folder_ACLs="$1"
enable_shell32_Default_Path="$1"
enable_shell32_Icons="$1"
@ -308,24 +304,15 @@ patch_enable ()
gdi32-MultiMonitor)
enable_gdi32_MultiMonitor="$2"
;;
gdi32-OSMesaMakeCurrent)
enable_gdi32_OSMesaMakeCurrent="$2"
;;
gdiplus-GdipCreateRegionRgnData)
enable_gdiplus_GdipCreateRegionRgnData="$2"
;;
imagehlp-BindImageEx)
enable_imagehlp_BindImageEx="$2"
;;
imm32-Cross_Thread_Access)
enable_imm32_Cross_Thread_Access="$2"
;;
include-Winetest)
enable_include_Winetest="$2"
;;
include-windns)
enable_include_windns="$2"
;;
iphlpapi-TCP_Table)
enable_iphlpapi_TCP_Table="$2"
;;
@ -530,9 +517,6 @@ patch_enable ()
shdocvw-ParseURLFromOutsideSource_Tests)
enable_shdocvw_ParseURLFromOutsideSource_Tests="$2"
;;
shell32-ApplicationAssociationRegistration)
enable_shell32_ApplicationAssociationRegistration="$2"
;;
shell32-Default_Folder_ACLs)
enable_shell32_Default_Folder_ACLs="$2"
;;
@ -2084,18 +2068,6 @@ if test "$enable_gdi32_MultiMonitor" -eq 1; then
) >> "$patchlist"
fi
# Patchset gdi32-OSMesaMakeCurrent
# |
# | Modified files:
# | * dlls/gdi32/dibdrv/opengl.c
# |
if test "$enable_gdi32_OSMesaMakeCurrent" -eq 1; then
patch_apply gdi32-OSMesaMakeCurrent/0001-gdi32-Fix-arguments-for-OSMesaMakeCurrent-when-using.patch
(
echo '+ { "Michael Müller", "gdi32: Fix arguments for OSMesaMakeCurrent when using 16 bit formats.", 1 },';
) >> "$patchlist"
fi
# Patchset gdiplus-GdipCreateRegionRgnData
# |
# | This patchset fixes the following Wine bugs:
@ -2126,29 +2098,6 @@ if test "$enable_imagehlp_BindImageEx" -eq 1; then
) >> "$patchlist"
fi
# Patchset imm32-Cross_Thread_Access
# |
# | This patchset fixes the following Wine bugs:
# | * [#35361] Limit cross thread access to ImmSet* functions
# |
# | Modified files:
# | * dlls/imm32/imm.c, dlls/imm32/tests/imm32.c
# |
if test "$enable_imm32_Cross_Thread_Access" -eq 1; then
patch_apply imm32-Cross_Thread_Access/0001-imm32-Move-thread-data-from-TLSEntry-to-an-internal-.patch
patch_apply imm32-Cross_Thread_Access/0002-imm32-Do-not-let-ImmDestroyContext-destroy-any-defau.patch
patch_apply imm32-Cross_Thread_Access/0003-imm32-Use-thread-data-from-target-HWND.patch
patch_apply imm32-Cross_Thread_Access/0004-imm32-Restrict-crossthread-Association-and-destructi.patch
patch_apply imm32-Cross_Thread_Access/0005-imm32-Limit-cross-thread-access-to-ImmSet-functions.patch
(
echo '+ { "Aric Stewart", "imm32: Move thread data from TLSEntry to an internal list.", 1 },';
echo '+ { "Aric Stewart", "imm32: Do not let ImmDestroyContext destroy any default contexts.", 1 },';
echo '+ { "Aric Stewart", "imm32: Use thread data from target HWND.", 1 },';
echo '+ { "Aric Stewart", "imm32: Restrict crossthread Association and destruction.", 1 },';
echo '+ { "Aric Stewart", "imm32: Limit cross thread access to ImmSet* functions.", 1 },';
) >> "$patchlist"
fi
# Patchset include-Winetest
# |
# | Modified files:
@ -2161,18 +2110,6 @@ if test "$enable_include_Winetest" -eq 1; then
) >> "$patchlist"
fi
# Patchset include-windns
# |
# | Modified files:
# | * include/windns.h
# |
if test "$enable_include_windns" -eq 1; then
patch_apply include-windns/0001-include-windns.h-Complete-and-properly-pack-DNS_HEAD.patch
(
echo '+ { "Amine Khaldi", "include/windns.h: Complete and properly pack DNS_HEADER structure.", 1 },';
) >> "$patchlist"
fi
# Patchset iphlpapi-TCP_Table
# |
# | This patchset fixes the following Wine bugs:
@ -3366,18 +3303,6 @@ if test "$enable_shdocvw_ParseURLFromOutsideSource_Tests" -eq 1; then
) >> "$patchlist"
fi
# Patchset shell32-ApplicationAssociationRegistration
# |
# | Modified files:
# | * dlls/shell32/assoc.c, dlls/shell32/tests/assoc.c
# |
if test "$enable_shell32_ApplicationAssociationRegistration" -eq 1; then
patch_apply shell32-ApplicationAssociationRegistration/0001-shell32-Various-style-fixes-and-memory-leak-fix-in-I.patch
(
echo '+ { "Sebastian Lackner", "shell32: Various style fixes and memory leak fix in IApplicationAssociationRegistration.", 1 },';
) >> "$patchlist"
fi
# Patchset shell32-Default_Folder_ACLs
# |
# | Modified files:

View File

@ -1,151 +0,0 @@
From 1fc8601b891e8dee2ff65d84f5459ede605e2a57 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Wed, 18 Feb 2015 20:02:38 +0100
Subject: shell32: Various style fixes and memory leak fix in
IApplicationAssociationRegistration.
---
dlls/shell32/assoc.c | 46 ++++++++++++++++++++++++++++------------------
dlls/shell32/tests/assoc.c | 7 +++----
2 files changed, 31 insertions(+), 22 deletions(-)
diff --git a/dlls/shell32/assoc.c b/dlls/shell32/assoc.c
index 528666e..e79eeae 100644
--- a/dlls/shell32/assoc.c
+++ b/dlls/shell32/assoc.c
@@ -892,30 +892,33 @@ static HRESULT WINAPI ApplicationAssociationRegistration_QueryCurrentDefault(IAp
TRACE("(%p)->(%s, %d, %d, %p)\n", This, debugstr_w(query), type, level, association);
- if(!association)
+ if (!query || !association)
return E_INVALIDARG;
*association = NULL;
- if((type == AT_URLPROTOCOL || type == AT_FILEEXTENSION) && !lstrlenW(query))
- return E_INVALIDARG;
- else if(type == AT_FILEEXTENSION && query[0] != '.')
- return E_INVALIDARG;
-
- if(type == AT_FILEEXTENSION)
+ if (type == AT_FILEEXTENSION)
{
+ if (query[0] != '.')
+ return E_INVALIDARG;
+
ret = RegOpenKeyExW(HKEY_CLASSES_ROOT, query, 0, KEY_READ, &hkey);
- if(ret == ERROR_SUCCESS)
+ if (ret == ERROR_SUCCESS)
{
ret = RegGetValueW(hkey, NULL, NULL, RRF_RT_REG_SZ, &keytype, NULL, &size);
- if(ret == ERROR_SUCCESS)
+ if (ret == ERROR_SUCCESS)
{
*association = CoTaskMemAlloc(size);
- if(*association)
+ if (*association)
{
ret = RegGetValueW(hkey, NULL, NULL, RRF_RT_REG_SZ, &keytype, *association, &size);
- if(ret == ERROR_SUCCESS)
+ if (ret == ERROR_SUCCESS)
hr = S_OK;
+ else
+ {
+ CoTaskMemFree(*association);
+ *association = NULL;
+ }
}
else
hr = E_OUTOFMEMORY;
@@ -924,12 +927,15 @@ static HRESULT WINAPI ApplicationAssociationRegistration_QueryCurrentDefault(IAp
}
else
{
+ if (type == AT_URLPROTOCOL && !query[0])
+ return E_INVALIDARG;
+
ret = RegOpenKeyExW(HKEY_CURRENT_USER, assocations, 0, KEY_READ, &hkey);
- if(ret == ERROR_SUCCESS)
+ if (ret == ERROR_SUCCESS)
{
- if(type == AT_URLPROTOCOL)
+ if (type == AT_URLPROTOCOL)
lstrcpyW(path, urlassoc);
- else if(type == AT_MIMETYPE)
+ else if (type == AT_MIMETYPE)
lstrcpyW(path, mimeassoc);
else
{
@@ -944,14 +950,19 @@ static HRESULT WINAPI ApplicationAssociationRegistration_QueryCurrentDefault(IAp
lstrcatW(path, choice);
ret = RegGetValueW(hkey, path, propid, RRF_RT_REG_SZ, &keytype, NULL, &size);
- if(ret == ERROR_SUCCESS)
+ if (ret == ERROR_SUCCESS)
{
*association = CoTaskMemAlloc(size);
- if(*association)
+ if (*association)
{
ret = RegGetValueW(hkey, path, propid, RRF_RT_REG_SZ, &keytype, *association, &size);
- if(ret == ERROR_SUCCESS)
+ if (ret == ERROR_SUCCESS)
hr = S_OK;
+ else
+ {
+ CoTaskMemFree(*association);
+ *association = NULL;
+ }
}
else
hr = E_OUTOFMEMORY;
@@ -960,7 +971,6 @@ static HRESULT WINAPI ApplicationAssociationRegistration_QueryCurrentDefault(IAp
}
RegCloseKey(hkey);
-
return hr;
}
diff --git a/dlls/shell32/tests/assoc.c b/dlls/shell32/tests/assoc.c
index 8aa2535..0092081 100644
--- a/dlls/shell32/tests/assoc.c
+++ b/dlls/shell32/tests/assoc.c
@@ -192,7 +192,7 @@ static void test_IApplicationAssociationRegistration_QueryCurrentDefault(IApplic
ok(hr == E_INVALIDARG, "got 0x%x\n", hr);
hr = IApplicationAssociationRegistration_QueryCurrentDefault(appreg, spacetxtW, AT_FILEEXTENSION, AL_EFFECTIVE, &assocprog);
- ok(hr == E_INVALIDARG || hr == HRESULT_FROM_WIN32(ERROR_NO_ASSOCIATION) /*Win8*/, "got 0x%x\n", hr);
+ ok(hr == E_INVALIDARG || hr == HRESULT_FROM_WIN32(ERROR_NO_ASSOCIATION) /* Win8 */, "got 0x%x\n", hr);
hr = IApplicationAssociationRegistration_QueryCurrentDefault(appreg, httpW, AT_URLPROTOCOL, AL_EFFECTIVE, NULL);
ok(hr == E_INVALIDARG, "got 0x%x\n", hr);
@@ -212,14 +212,13 @@ static void test_IApplicationAssociationRegistration_QueryCurrentDefault(IApplic
hr = IApplicationAssociationRegistration_QueryCurrentDefault(appreg, httpW, AT_URLPROTOCOL, AL_EFFECTIVE, &assocprog);
todo_wine ok(hr == S_OK, "got 0x%x\n", hr);
trace("%s\n", wine_dbgstr_w(assocprog));
-
CoTaskMemFree(assocprog);
}
START_TEST(assoc)
{
IQueryAssociations *qa;
- IApplicationAssociationRegistration *appreg = NULL;
+ IApplicationAssociationRegistration *appreg;
HRESULT hr;
CoInitialize(NULL);
@@ -239,7 +238,7 @@ START_TEST(assoc)
/* this works since Vista */
hr = CoCreateInstance(&CLSID_ApplicationAssociationRegistration, NULL, CLSCTX_INPROC_SERVER,
- &IID_IApplicationAssociationRegistration, (LPVOID*)&appreg);
+ &IID_IApplicationAssociationRegistration, (LPVOID *)&appreg);
if (hr == S_OK)
{
test_IApplicationAssociationRegistration_QueryInterface(appreg);
--
2.3.0

View File

@ -9534,7 +9534,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c
--- a/dlls/wined3d/directx.c
+++ b/dlls/wined3d/directx.c
@@ -5340,9 +5340,15 @@
@@ -5338,9 +5338,15 @@
DebugBreak();
}