Wine-Devel
By thread
wine-devel@list.winehq.org
By month
Messages by month
- ----- 2026 -----
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2002 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2001 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
May 2022
- 77 participants
- 2907 messages
[PATCH v2 2/3] jscript: Don't execute any functions if script state does not allow it.
by Gabriel Ivăncescu
Instead of only interpreted functions. Property retrievals or setters are
allowed though, as long as they are not accessors.
Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com>
---
Note that native GetDispID seem to fail when retrieving builtin/prototype
functions (?) if script is uninitialized, but retrieving the DISPID before and
using it after it's uninitialized still works, though (that's what the tests
do). I don't think it's worth replicating this GetDispID quirk for the moment.
dlls/jscript/dispex.c | 5 +++
dlls/jscript/function.c | 10 ++---
dlls/jscript/tests/run.c | 86 ++++++++++++++++++++++++++++++++++++----
3 files changed, 88 insertions(+), 13 deletions(-)
diff --git a/dlls/jscript/dispex.c b/dlls/jscript/dispex.c
index 468a0dd..7980047 100644
--- a/dlls/jscript/dispex.c
+++ b/dlls/jscript/dispex.c
@@ -567,6 +567,8 @@ static HRESULT invoke_prop_func(jsdisp_t *This, IDispatch *jsthis, dispex_prop_t
WARN("%s is not a constructor\n", debugstr_w(prop->name));
return E_INVALIDARG;
}
+ if(This->ctx->state == SCRIPTSTATE_UNINITIALIZED || This->ctx->state == SCRIPTSTATE_CLOSED)
+ return E_UNEXPECTED;
if(This->builtin_info->class != JSCLASS_FUNCTION && prop->u.p->invoke != JSGlobal_eval)
flags &= ~DISPATCH_JSCRIPT_INTERNAL_MASK;
@@ -1994,6 +1996,9 @@ HRESULT jsdisp_call_value(jsdisp_t *jsfunc, IDispatch *jsthis, WORD flags, unsig
return JS_E_FUNCTION_EXPECTED;
}
+ if(jsfunc->ctx->state == SCRIPTSTATE_UNINITIALIZED || jsfunc->ctx->state == SCRIPTSTATE_CLOSED)
+ return E_UNEXPECTED;
+
flags &= ~DISPATCH_JSCRIPT_INTERNAL_MASK;
hres = jsfunc->builtin_info->call(jsfunc->ctx, jsthis ? jsval_disp(jsthis) : jsval_null(), flags, argc, argv, r);
}
diff --git a/dlls/jscript/function.c b/dlls/jscript/function.c
index 638d176..a77ed29 100644
--- a/dlls/jscript/function.c
+++ b/dlls/jscript/function.c
@@ -257,6 +257,11 @@ HRESULT Function_invoke(jsdisp_t *func_this, IDispatch *jsthis, WORD flags, unsi
assert(is_class(func_this, JSCLASS_FUNCTION));
function = function_from_jsdisp(func_this);
+ if(function->dispex.ctx->state == SCRIPTSTATE_UNINITIALIZED || function->dispex.ctx->state == SCRIPTSTATE_CLOSED) {
+ WARN("Script engine state does not allow running code.\n");
+ return E_UNEXPECTED;
+ }
+
if(jsthis)
vthis = jsval_disp(jsthis);
else
@@ -722,11 +727,6 @@ static HRESULT InterpretedFunction_call(script_ctx_t *ctx, FunctionInstance *fun
TRACE("%p\n", function);
- if(ctx->state == SCRIPTSTATE_UNINITIALIZED || ctx->state == SCRIPTSTATE_CLOSED) {
- WARN("Script engine state does not allow running code.\n");
- return E_UNEXPECTED;
- }
-
if(flags & DISPATCH_CONSTRUCT) {
hres = create_object(ctx, &function->function.dispex, &new_obj);
if(FAILED(hres))
diff --git a/dlls/jscript/tests/run.c b/dlls/jscript/tests/run.c
index 94dc2e1..ae72f39 100644
--- a/dlls/jscript/tests/run.c
+++ b/dlls/jscript/tests/run.c
@@ -2914,13 +2914,20 @@ static void test_default_value(void)
V_VT(&v) = VT_EMPTY;
hres = IDispatch_Invoke(disp, DISPID_VALUE, &IID_NULL, 0, DISPATCH_PROPERTYGET, &dp, &v, NULL, NULL);
- ok(hres == S_OK || broken(hres == 0x8000ffff), "Invoke failed: %08lx\n", hres);
- if(hres == S_OK)
- {
- ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v));
- }
+ ok(hres == E_UNEXPECTED, "Invoke failed: %08lx\n", hres);
+
+ hres = parse_script_expr(L"new Date()", &v, &script);
+ ok(hres == S_OK, "parse_script_expr failed: %08lx\n", hres);
+ ok(V_VT(&v) == VT_DISPATCH, "V_VT(v) = %d\n", V_VT(&v));
+ disp = V_DISPATCH(&v);
+
+ V_VT(&v) = VT_EMPTY;
+ hres = IDispatch_Invoke(disp, DISPID_VALUE, &IID_NULL, 0, DISPATCH_PROPERTYGET, &dp, &v, NULL, NULL);
+ ok(hres == S_OK, "Invoke failed: %08lx\n", hres);
+ ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v));
VariantClear(&v);
IDispatch_Release(disp);
+ close_script(script);
hres = parse_script_expr(L"var arr = [5]; arr.toString = function() {return \"foo\";}; arr.valueOf = function() {return 42;}; arr", &v, &script);
ok(hres == S_OK, "parse_script_expr failed: %08lx\n", hres);
@@ -3149,15 +3156,15 @@ static void test_script_exprs(void)
static void test_invokeex(void)
{
- DISPID func_id, prop_id;
- DISPPARAMS dp = {NULL};
+ DISPPARAMS dp = {NULL}, dp_max = {NULL};
+ DISPID func_id, max_id, prop_id;
IActiveScript *script;
IDispatchEx *dispex;
VARIANT v, arg;
BSTR str;
HRESULT hres;
- hres = parse_script_expr(L"var o = {func: function() {return 3;}, prop: 6}; o", &v, &script);
+ hres = parse_script_expr(L"var o = {func: function() {return 3;}, max: Math.max, prop: 6}; o", &v, &script);
ok(hres == S_OK, "parse_script_expr failed: %08lx\n", hres);
ok(V_VT(&v) == VT_DISPATCH, "V_VT(v) = %d\n", V_VT(&v));
@@ -3170,16 +3177,31 @@ static void test_invokeex(void)
SysFreeString(str);
ok(hres == S_OK, "GetDispID failed: %08lx\n", hres);
+ str = SysAllocString(L"max");
+ hres = IDispatchEx_GetDispID(dispex, str, 0, &max_id);
+ SysFreeString(str);
+ ok(hres == S_OK, "GetDispID failed: %08lx\n", hres);
+
str = SysAllocString(L"prop");
hres = IDispatchEx_GetDispID(dispex, str, 0, &prop_id);
SysFreeString(str);
ok(hres == S_OK, "GetDispID failed: %08lx\n", hres);
+ dp_max.rgvarg = &arg;
+ dp_max.cArgs = 1;
+ V_VT(&arg) = VT_I4;
+ V_I4(&arg) = 42;
+
hres = IDispatchEx_InvokeEx(dispex, func_id, 0, DISPATCH_METHOD, &dp, &v, NULL, NULL);
ok(hres == S_OK, "InvokeEx failed: %08lx\n", hres);
ok(V_VT(&v) == VT_I4, "V_VT(v) = %d\n", V_VT(&v));
ok(V_I4(&v) == 3, "V_I4(v) = %ld\n", V_I4(&v));
+ hres = IDispatchEx_InvokeEx(dispex, max_id, 0, DISPATCH_METHOD, &dp_max, &v, NULL, NULL);
+ ok(hres == S_OK, "InvokeEx failed: %08lx\n", hres);
+ ok(V_VT(&v) == VT_I4, "V_VT(v) = %d\n", V_VT(&v));
+ ok(V_I4(&v) == 42, "V_I4(v) = %ld\n", V_I4(&v));
+
hres = IDispatchEx_InvokeEx(dispex, prop_id, 0, DISPATCH_PROPERTYGET, &dp, &v, NULL, NULL);
ok(hres == S_OK, "InvokeEx failed: %08lx\n", hres);
ok(V_VT(&v) == VT_I4, "V_VT(v) = %d\n", V_VT(&v));
@@ -3193,14 +3215,62 @@ static void test_invokeex(void)
SysFreeString(str);
ok(hres == S_OK, "GetDispID failed: %08lx\n", hres);
+ V_VT(&v) = VT_EMPTY;
hres = IDispatchEx_InvokeEx(dispex, func_id, 0, DISPATCH_METHOD, &dp, &v, NULL, NULL);
ok(hres == E_UNEXPECTED || broken(hres == 0x800a1393), "InvokeEx failed: %08lx\n", hres);
+ V_VT(&v) = VT_EMPTY;
+ hres = IDispatchEx_InvokeEx(dispex, max_id, 0, DISPATCH_METHOD, &dp_max, &v, NULL, NULL);
+ ok(hres == E_UNEXPECTED || broken(hres == 0x800a1393), "InvokeEx failed: %08lx\n", hres);
+
+ V_VT(&v) = VT_EMPTY;
hres = IDispatchEx_InvokeEx(dispex, prop_id, 0, DISPATCH_PROPERTYGET, &dp, &v, NULL, NULL);
ok(hres == S_OK, "InvokeEx failed: %08lx\n", hres);
ok(V_VT(&v) == VT_I4, "V_VT(v) = %d\n", V_VT(&v));
ok(V_I4(&v) == 6, "V_I4(v) = %ld\n", V_I4(&v));
+ IActiveScript_Close(script);
+
+ V_VT(&v) = VT_EMPTY;
+ hres = IDispatchEx_InvokeEx(dispex, prop_id, 0, DISPATCH_PROPERTYGET, &dp, &v, NULL, NULL);
+ ok(hres == S_OK, "InvokeEx failed: %08lx\n", hres);
+ ok(V_VT(&v) == VT_I4, "V_VT(v) = %d\n", V_VT(&v));
+ ok(V_I4(&v) == 6, "V_I4(v) = %ld\n", V_I4(&v));
+
+ IDispatchEx_Release(dispex);
+ IActiveScript_Release(script);
+
+ hres = parse_script_expr(L"Math.max", &v, &script);
+ ok(hres == S_OK, "parse_script_expr failed: %08lx\n", hres);
+ ok(V_VT(&v) == VT_DISPATCH, "V_VT(v) = %d\n", V_VT(&v));
+
+ hres = IDispatch_QueryInterface(V_DISPATCH(&v), &IID_IDispatchEx, (void**)&dispex);
+ ok(hres == S_OK, "Could not get IDispatchEx iface: %08lx\n", hres);
+ VariantClear(&v);
+
+ str = SysAllocString(L"call");
+ hres = IDispatchEx_GetDispID(dispex, str, 0, &func_id);
+ SysFreeString(str);
+ ok(hres == S_OK, "GetDispID failed: %08lx\n", hres);
+
+ str = SysAllocString(L"length");
+ hres = IDispatchEx_GetDispID(dispex, str, 0, &prop_id);
+ SysFreeString(str);
+ ok(hres == S_OK, "GetDispID failed: %08lx\n", hres);
+
+ hres = IActiveScript_SetScriptState(script, SCRIPTSTATE_UNINITIALIZED);
+ ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08lx\n", hres);
+
+ hres = IDispatchEx_InvokeEx(dispex, func_id, 0, DISPATCH_PROPERTYGET, &dp, &v, NULL, NULL);
+ ok(hres == S_OK, "InvokeEx failed: %08lx\n", hres);
+ ok(V_VT(&v) == VT_DISPATCH, "V_VT(v) = %d\n", V_VT(&v));
+ VariantClear(&v);
+
+ hres = IDispatchEx_InvokeEx(dispex, prop_id, 0, DISPATCH_PROPERTYGET, &dp, &v, NULL, NULL);
+ ok(hres == S_OK, "InvokeEx failed: %08lx\n", hres);
+ ok(V_VT(&v) == VT_I4, "V_VT(v) = %d\n", V_VT(&v));
+ ok(V_I4(&v) == 2, "V_I4(v) = %ld\n", V_I4(&v));
+
IDispatchEx_Release(dispex);
IActiveScript_Release(script);
--
2.34.1
May 31, 2022
[PATCH v2 1/3] jscript: Don't allow starting script using state from uninitialized.
by Gabriel Ivăncescu
Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com>
---
dlls/jscript/jscript.c | 2 +-
dlls/jscript/tests/jscript.c | 6 ++++++
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/dlls/jscript/jscript.c b/dlls/jscript/jscript.c
index 8cf141d..d6028e6 100644
--- a/dlls/jscript/jscript.c
+++ b/dlls/jscript/jscript.c
@@ -824,7 +824,7 @@ static HRESULT WINAPI JScript_SetScriptState(IActiveScript *iface, SCRIPTSTATE s
switch(ss) {
case SCRIPTSTATE_STARTED:
case SCRIPTSTATE_CONNECTED: /* FIXME */
- if(This->ctx->state == SCRIPTSTATE_CLOSED)
+ if(This->ctx->state == SCRIPTSTATE_UNINITIALIZED || This->ctx->state == SCRIPTSTATE_CLOSED)
return E_UNEXPECTED;
exec_queued_code(This);
diff --git a/dlls/jscript/tests/jscript.c b/dlls/jscript/tests/jscript.c
index 8c985e5..8723541 100644
--- a/dlls/jscript/tests/jscript.c
+++ b/dlls/jscript/tests/jscript.c
@@ -863,6 +863,12 @@ static void test_jscript_uninitializing(void)
hres = IActiveScript_SetScriptState(script, SCRIPTSTATE_UNINITIALIZED);
ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_UNINITIALIZED) failed: %08lx\n", hres);
+ hres = IActiveScript_SetScriptState(script, SCRIPTSTATE_STARTED);
+ ok(hres == E_UNEXPECTED, "SetScriptState(SCRIPTSTATE_STARTED) returned: %08lx\n", hres);
+
+ hres = IActiveScript_SetScriptState(script, SCRIPTSTATE_CONNECTED);
+ ok(hres == E_UNEXPECTED, "SetScriptState(SCRIPTSTATE_CONNECTED) returned: %08lx\n", hres);
+
SET_EXPECT(GetLCID);
SET_EXPECT(OnStateChange_INITIALIZED);
hres = IActiveScript_SetScriptSite(script, &ActiveScriptSite);
--
2.34.1
May 31, 2022
Re: [PATCH] winecoreaudio: Handle MIDI running status.
by Andrew Eikum
Signed-off-by: Andrew Eikum <aeikum(a)codeweavers.com>
On Fri, May 27, 2022 at 11:25:42PM +0900, Akihiro Sagawa wrote:
> Andew, thanks for the build.
> Here is the patch with Signed-off-by line.
>
> Signed-off-by: Akihiro Sagawa <sagawa.aki(a)gmail.com>
> ---
> dlls/winecoreaudio.drv/coremidi.c | 29 ++++++++++++++++++++++++++---
> 1 file changed, 26 insertions(+), 3 deletions(-)
>
> diff --git a/dlls/winecoreaudio.drv/coremidi.c b/dlls/winecoreaudio.drv/coremidi.c
> index bd5322cbc22..445b760be76 100644
> --- a/dlls/winecoreaudio.drv/coremidi.c
> +++ b/dlls/winecoreaudio.drv/coremidi.c
> @@ -103,6 +103,7 @@ struct midi_dest
>
> MIDIOUTCAPSW caps;
> MIDIOPENDESC midiDesc;
> + BYTE runningStatus;
> WORD wFlags;
> };
>
> @@ -598,6 +599,7 @@ static UINT midi_out_open(WORD dev_id, MIDIOPENDESC *midi_desc, UINT flags, stru
> return MMSYSERR_ERROR;
> }
> }
> + dest->runningStatus = 0;
> dest->wFlags = HIWORD(flags & CALLBACK_TYPEMASK);
> dest->midiDesc = *midi_desc;
>
> @@ -655,12 +657,30 @@ static UINT midi_out_data(WORD dev_id, UINT data)
> WARN("bad device ID : %d\n", dev_id);
> return MMSYSERR_BADDEVICEID;
> }
> + dest = dests + dev_id;
>
> bytes[0] = data & 0xff;
> - bytes[1] = (data >> 8) & 0xff;
> - bytes[2] = (data >> 16) & 0xff;
> + if (bytes[0] & 0x80)
> + {
> + bytes[1] = (data >> 8) & 0xff;
> + bytes[2] = (data >> 16) & 0xff;
> + if (bytes[0] < 0xF0)
> + dest->runningStatus = bytes[0];
> + else if (bytes[0] <= 0xF7)
> + dest->runningStatus = 0;
> + }
> + else if (dest->runningStatus)
> + {
> + bytes[0] = dest->runningStatus;
> + bytes[1] = data & 0xff;
> + bytes[2] = (data >> 8) & 0xff;
> + }
> + else
> + {
> + FIXME("ooch %x\n", data);
> + return MMSYSERR_NOERROR;
> + }
>
> - dest = dests + dev_id;
> if (dest->caps.wTechnology == MOD_SYNTH)
> {
> sc = MusicDeviceMIDIEvent(dest->synth, bytes[0], bytes[1], bytes[2], 0);
> @@ -726,6 +746,7 @@ static UINT midi_out_long_data(WORD dev_id, MIDIHDR *hdr, UINT hdr_size, struct
> else if (dest->caps.wTechnology == MOD_MIDIPORT)
> midi_send(midi_out_port, dest->dest, (UInt8 *)hdr->lpData, hdr->dwBufferLength);
>
> + dest->runningStatus = 0;
> hdr->dwFlags &= ~MHDR_INQUEUE;
> hdr->dwFlags |= MHDR_DONE;
>
> @@ -866,6 +887,8 @@ static UINT midi_out_reset(WORD dev_id)
> }
> else FIXME("MOD_MIDIPORT\n");
>
> + dests[dev_id].runningStatus = 0;
> +
> /* FIXME: the LongData buffers must also be returned to the app */
> return MMSYSERR_NOERROR;
> }
May 31, 2022
Re: [PATCH 0/12] MR160: secur32: Add wow64 support. - approved
by Hans Leidekker (@hans)
This merge request was approved by Hans Leidekker.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/160
May 31, 2022
Re: [PATCH v3 1/3] d2d1: Implement ID2D1Bitmap1::Map().
by Dmitry Timoshkov
Nikolay Sivov <nsivov(a)codeweavers.com> wrote:
> On 5/31/22 15:03, Dmitry Timoshkov wrote:
> > Dmitry Timoshkov <dmitry(a)baikal.ru> wrote:
> >
> >> Nikolay Sivov <nsivov(a)codeweavers.com> wrote:
> >>
> >>> On 5/29/22 12:03, Dmitry Timoshkov wrote:
> >>>> Nikolay Sivov <nsivov(a)codeweavers.com> wrote:
> >>>>
> >>>>> I started by extending tests from patch 3/3, and I'm curious now how
> >>>>> does your application create such bitmap?
> >>>>>
> >>>>> Is it just
> >>>>> ID2D1DeviceContext::CreateBitmap(D2D1_BITMAP_OPTIONS_CANNOT_DRAW |
> >>>>> D2D1_BITMAP_OPTIONS_CPU_READ), or something more complicated?
> >>>>>
> >>>>> How is this bitmap used later? Is it set to an image brush, and then
> >>>>> used for fills?
> >>>> The application first creates a bitmap with D2D1_BITMAP_OPTIONS_TARGET,
> >>>> then creates an image brush from it. Then the app creates another bitmap
> >>>> with D2D1_BITMAP_OPTIONS_CANNOT_DRAW | D2D1_BITMAP_OPTIONS_CPU_READ, copies
> >>>> contents from original bitmap with ::CopyFromBitmap() and then ::Map()s it
> >>>> with D2D1_MAP_OPTIONS_READ.
> >>>>
> >>> I see, makes sense. Please test with attached patches to see if this
> >>> path still works. Turns out there is no need to create a temporary resource.
> >> Attached patches seem to work, Unmap() helper could be inlined though.
> >> Probably I should also note, that the patch to make an image brush work
> >> for bitmaps is still required for correct painting in my application.
> > Unfortunately further testing shows that with today's winehq.git my application
> > hangs on exit. Regression test points to
> >
> > 5e25a4546c812eb174d142a41c28cf83ef2b567e is the first bad commit
> > commit 5e25a4546c812eb174d142a41c28cf83ef2b567e
> > Author: Nikolay Sivov <nsivov(a)codeweavers.com>
> > Date: Sun May 29 15:18:53 2022 +0300
> >
> > d2d1: Implement bitmap mapping.
> >
> > Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
> >
> > dlls/d2d1/bitmap.c | 72 +++++++++++++++++++++++++++++++++++++++++++++---
> > dlls/d2d1/d2d1_private.h | 1 +
> > dlls/d2d1/tests/d2d1.c | 21 +-------------
> > 3 files changed, 70 insertions(+), 24 deletions(-)
> >
> > Do you have an idea what might be the reason of the hang?
> >
> Without any additional information, I don't have any.
It looks like that the hang is caused by new code path enabled by ::Map(), and
using my original implementation on top of wine-7.9 shows exactly same behaviour.
Sorry for the false alarm.
--
Dmitry.
May 31, 2022
Re: [PATCH 5/5] win32u: Use user_callbacks for alertable NtWaitForMultipleObjects calls.
by Marvin
Hi,
While running your changed tests, I think I found new failures.
Being a bot and all I'm not very good at pattern recognition, so I might be
wrong, but could you please double-check?
Full results can be found at:
https://testbot.winehq.org/JobDetails.pl?Key=115874
Your paranoid android.
=== debian11 (64 bit WoW report) ===
user32:
msg.c:8724: Test failed: WmParentPaintNc: 0: the msg 0x000f was expected, but got msg 0x0021 instead
msg.c:8724: Test failed: WmParentPaintNc: 1: the msg 0x000f was expected, but got msg 0x0021 instead
msg.c:8724: Test failed: WmParentPaintNc: 2: the msg 0x0085 was expected, but got msg 0x0021 instead
msg.c:8724: Test failed: WmParentPaintNc: 6: the msg sequence is not complete: expected 0000 - actual 000f
May 31, 2022
Re: [PATCH v3 1/3] d2d1: Implement ID2D1Bitmap1::Map().
by Nikolay Sivov
On 5/31/22 15:03, Dmitry Timoshkov wrote:
> Dmitry Timoshkov <dmitry(a)baikal.ru> wrote:
>
>> Nikolay Sivov <nsivov(a)codeweavers.com> wrote:
>>
>>> On 5/29/22 12:03, Dmitry Timoshkov wrote:
>>>> Nikolay Sivov <nsivov(a)codeweavers.com> wrote:
>>>>
>>>>> I started by extending tests from patch 3/3, and I'm curious now how
>>>>> does your application create such bitmap?
>>>>>
>>>>> Is it just
>>>>> ID2D1DeviceContext::CreateBitmap(D2D1_BITMAP_OPTIONS_CANNOT_DRAW |
>>>>> D2D1_BITMAP_OPTIONS_CPU_READ), or something more complicated?
>>>>>
>>>>> How is this bitmap used later? Is it set to an image brush, and then
>>>>> used for fills?
>>>> The application first creates a bitmap with D2D1_BITMAP_OPTIONS_TARGET,
>>>> then creates an image brush from it. Then the app creates another bitmap
>>>> with D2D1_BITMAP_OPTIONS_CANNOT_DRAW | D2D1_BITMAP_OPTIONS_CPU_READ, copies
>>>> contents from original bitmap with ::CopyFromBitmap() and then ::Map()s it
>>>> with D2D1_MAP_OPTIONS_READ.
>>>>
>>> I see, makes sense. Please test with attached patches to see if this
>>> path still works. Turns out there is no need to create a temporary resource.
>> Attached patches seem to work, Unmap() helper could be inlined though.
>> Probably I should also note, that the patch to make an image brush work
>> for bitmaps is still required for correct painting in my application.
> Unfortunately further testing shows that with today's winehq.git my application
> hangs on exit. Regression test points to
>
> 5e25a4546c812eb174d142a41c28cf83ef2b567e is the first bad commit
> commit 5e25a4546c812eb174d142a41c28cf83ef2b567e
> Author: Nikolay Sivov <nsivov(a)codeweavers.com>
> Date: Sun May 29 15:18:53 2022 +0300
>
> d2d1: Implement bitmap mapping.
>
> Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
>
> dlls/d2d1/bitmap.c | 72 +++++++++++++++++++++++++++++++++++++++++++++---
> dlls/d2d1/d2d1_private.h | 1 +
> dlls/d2d1/tests/d2d1.c | 21 +-------------
> 3 files changed, 70 insertions(+), 24 deletions(-)
>
> Do you have an idea what might be the reason of the hang?
>
Without any additional information, I don't have any.
May 31, 2022
[PATCH 5/5] win32u: Use user_callbacks for alertable NtWaitForMultipleObjects calls.
by Jacek Caban
From: Jacek Caban <jacek(a)codeweavers.com>
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53020
Signed-off-by: Jacek Caban <jacek(a)codeweavers.com>
---
dlls/user32/user_main.c | 1 +
dlls/win32u/driver.c | 7 +++++--
dlls/win32u/ntuser_private.h | 1 +
3 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/dlls/user32/user_main.c b/dlls/user32/user_main.c
index 9cd9bd60146..e470d2ad688 100644
--- a/dlls/user32/user_main.c
+++ b/dlls/user32/user_main.c
@@ -162,6 +162,7 @@ static const struct user_callbacks user_funcs =
EndMenu,
ImmProcessKey,
ImmTranslateMessage,
+ NtWaitForMultipleObjects,
free_win_ptr,
MENU_GetSysMenu,
MENU_IsMenuActive,
diff --git a/dlls/win32u/driver.c b/dlls/win32u/driver.c
index b4cea3d42c8..1f538d100ed 100644
--- a/dlls/win32u/driver.c
+++ b/dlls/win32u/driver.c
@@ -813,8 +813,11 @@ static NTSTATUS nulldrv_MsgWaitForMultipleObjectsEx( DWORD count, const HANDLE *
{
if (!count && timeout && !timeout->QuadPart) return WAIT_TIMEOUT;
- return NtWaitForMultipleObjects( count, handles, !(flags & MWMO_WAITALL),
- !!(flags & MWMO_ALERTABLE), timeout );
+ if (!user_callbacks)
+ return NtWaitForMultipleObjects( count, handles, !(flags & MWMO_WAITALL),
+ !!(flags & MWMO_ALERTABLE), timeout );
+ return user_callbacks->pNtWaitForMultipleObjects( count, handles, !(flags & MWMO_WAITALL),
+ !!(flags & MWMO_ALERTABLE), timeout );
}
static void nulldrv_ReleaseDC( HWND hwnd, HDC hdc )
diff --git a/dlls/win32u/ntuser_private.h b/dlls/win32u/ntuser_private.h
index 931c87a6e1c..e39e3f54169 100644
--- a/dlls/win32u/ntuser_private.h
+++ b/dlls/win32u/ntuser_private.h
@@ -35,6 +35,7 @@ struct user_callbacks
BOOL (WINAPI *pEndMenu)(void);
BOOL (WINAPI *pImmProcessKey)(HWND, HKL, UINT, LPARAM, DWORD);
BOOL (WINAPI *pImmTranslateMessage)(HWND, UINT, WPARAM, LPARAM);
+ NTSTATUS (WINAPI *pNtWaitForMultipleObjects)(ULONG,const HANDLE*,BOOLEAN,BOOLEAN,const LARGE_INTEGER*);
void (CDECL *free_win_ptr)( struct tagWND *win );
HMENU (CDECL *get_sys_menu)( HWND hwnd, HMENU popup );
HWND (CDECL *is_menu_active)(void);
--
GitLab
https://gitlab.winehq.org/wine/wine/-/merge_requests/162
May 31, 2022
[PATCH 4/5] winemac: Use ClipboardWindowProc driver entry point for clipboard manager.
by Jacek Caban
From: Jacek Caban <jacek(a)codeweavers.com>
Signed-off-by: Jacek Caban <jacek(a)codeweavers.com>
---
dlls/winemac.drv/clipboard.c | 133 ++++++++---------------------------
dlls/winemac.drv/gdi.c | 2 +-
dlls/winemac.drv/macdrv.h | 3 +-
dlls/winemac.drv/window.c | 13 ----
4 files changed, 33 insertions(+), 118 deletions(-)
diff --git a/dlls/winemac.drv/clipboard.c b/dlls/winemac.drv/clipboard.c
index d431728036e..16eff401a98 100644
--- a/dlls/winemac.drv/clipboard.c
+++ b/dlls/winemac.drv/clipboard.c
@@ -1425,7 +1425,7 @@ static UINT *get_clipboard_formats(UINT *size)
for (;;)
{
if (!(ids = malloc(*size * sizeof(*ids)))) return NULL;
- if (GetUpdatedClipboardFormats(ids, *size, size)) break;
+ if (NtUserGetUpdatedClipboardFormats(ids, *size, size)) break;
free(ids);
if (GetLastError() != ERROR_INSUFFICIENT_BUFFER) return NULL;
}
@@ -1579,20 +1579,44 @@ static void update_clipboard(void)
}
+static BOOL init_clipboard(HWND hwnd)
+{
+ struct macdrv_window_features wf;
+
+ memset(&wf, 0, sizeof(wf));
+ clipboard_cocoa_window = macdrv_create_cocoa_window(&wf, CGRectMake(100, 100, 100, 100), hwnd,
+ macdrv_init_thread_data()->queue);
+ if (!clipboard_cocoa_window)
+ {
+ ERR("failed to create clipboard Cocoa window\n");
+ return FALSE;
+ }
+
+ clipboard_hwnd = hwnd;
+ clipboard_thread_id = GetCurrentThreadId();
+ NtUserAddClipboardFormatListener(clipboard_hwnd);
+ register_builtin_formats();
+ grab_win32_clipboard();
+
+ TRACE("clipboard thread %04x running\n", GetCurrentThreadId());
+ return TRUE;
+}
+
+
/**************************************************************************
- * clipboard_wndproc
+ * macdrv_ClipboardWindowProc
*
* Window procedure for the clipboard manager.
*/
-static LRESULT CALLBACK clipboard_wndproc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp)
+LRESULT macdrv_ClipboardWindowProc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp)
{
switch (msg)
{
case WM_NCCREATE:
- return TRUE;
+ return init_clipboard(hwnd);
case WM_CLIPBOARDUPDATE:
if (is_clipboard_owner) break; /* ignore our own changes */
- if ((LONG)(GetClipboardSequenceNumber() - last_get_seqno) <= 0) break;
+ if ((LONG)(NtUserGetClipboardSequenceNumber() - last_get_seqno) <= 0) break;
set_mac_pasteboard_types_from_win32_clipboard();
break;
case WM_RENDERFORMAT:
@@ -1605,95 +1629,13 @@ static LRESULT CALLBACK clipboard_wndproc(HWND hwnd, UINT msg, WPARAM wp, LPARAM
case WM_DESTROYCLIPBOARD:
TRACE("WM_DESTROYCLIPBOARD: lost ownership\n");
is_clipboard_owner = FALSE;
- KillTimer(hwnd, 1);
+ NtUserKillTimer(hwnd, 1);
break;
case WM_USER:
update_clipboard();
break;
}
- return DefWindowProcW(hwnd, msg, wp, lp);
-}
-
-
-/**************************************************************************
- * wait_clipboard_mutex
- *
- * Make sure that there's only one clipboard thread per window station.
- */
-static BOOL wait_clipboard_mutex(void)
-{
- static const WCHAR prefix[] = {'_','_','w','i','n','e','_','c','l','i','p','b','o','a','r','d','_'};
- WCHAR buffer[MAX_PATH + ARRAY_SIZE(prefix)];
- HANDLE mutex;
-
- memcpy(buffer, prefix, sizeof(prefix));
- if (!GetUserObjectInformationW(GetProcessWindowStation(), UOI_NAME,
- buffer + ARRAY_SIZE(prefix),
- sizeof(buffer) - sizeof(prefix), NULL))
- {
- ERR("failed to get winstation name\n");
- return FALSE;
- }
- mutex = CreateMutexW(NULL, TRUE, buffer);
- if (GetLastError() == ERROR_ALREADY_EXISTS)
- {
- TRACE("waiting for mutex %s\n", debugstr_w(buffer));
- WaitForSingleObject(mutex, INFINITE);
- }
- return TRUE;
-}
-
-
-/**************************************************************************
- * clipboard_thread
- *
- * Thread running inside the desktop process to manage the clipboard
- */
-static DWORD WINAPI clipboard_thread(void *arg)
-{
- WNDCLASSW class;
- struct macdrv_window_features wf;
- MSG msg;
-
- if (!wait_clipboard_mutex()) return 0;
-
- memset(&class, 0, sizeof(class));
- class.lpfnWndProc = clipboard_wndproc;
- class.lpszClassName = clipboard_classname;
-
- if (!RegisterClassW(&class) && GetLastError() != ERROR_CLASS_ALREADY_EXISTS)
- {
- ERR("could not register clipboard window class err %u\n", GetLastError());
- return 0;
- }
- if (!(clipboard_hwnd = CreateWindowW(clipboard_classname, NULL, 0, 0, 0, 0, 0,
- HWND_MESSAGE, 0, 0, NULL)))
- {
- ERR("failed to create clipboard window err %u\n", GetLastError());
- return 0;
- }
-
- memset(&wf, 0, sizeof(wf));
- clipboard_cocoa_window = macdrv_create_cocoa_window(&wf, CGRectMake(100, 100, 100, 100), clipboard_hwnd,
- macdrv_init_thread_data()->queue);
- if (!clipboard_cocoa_window)
- {
- ERR("failed to create clipboard Cocoa window\n");
- goto done;
- }
-
- clipboard_thread_id = GetCurrentThreadId();
- NtUserAddClipboardFormatListener(clipboard_hwnd);
- register_builtin_formats();
- grab_win32_clipboard();
-
- TRACE("clipboard thread %04x running\n", GetCurrentThreadId());
- while (GetMessageW(&msg, 0, 0, 0)) DispatchMessageW(&msg);
-
-done:
- macdrv_destroy_cocoa_window(clipboard_cocoa_window);
- DestroyWindow(clipboard_hwnd);
- return 0;
+ return NtUserMessageCall(hwnd, msg, wp, lp, NULL, NtUserDefWindowProc, FALSE);
}
@@ -1804,16 +1746,3 @@ void macdrv_lost_pasteboard_ownership(HWND hwnd)
if (!macdrv_is_pasteboard_owner(clipboard_cocoa_window))
grab_win32_clipboard();
}
-
-
-/**************************************************************************
- * macdrv_init_clipboard
- */
-void macdrv_init_clipboard(void)
-{
- DWORD id;
- HANDLE handle = CreateThread(NULL, 0, clipboard_thread, NULL, 0, &id);
-
- if (handle) CloseHandle(handle);
- else ERR("failed to create clipboard thread\n");
-}
diff --git a/dlls/winemac.drv/gdi.c b/dlls/winemac.drv/gdi.c
index 8d41778b472..3f83436d97a 100644
--- a/dlls/winemac.drv/gdi.c
+++ b/dlls/winemac.drv/gdi.c
@@ -266,8 +266,8 @@ static const struct user_driver_funcs macdrv_funcs =
.pBeep = macdrv_Beep,
.pChangeDisplaySettingsEx = macdrv_ChangeDisplaySettingsEx,
.pClipCursor = macdrv_ClipCursor,
+ .pClipboardWindowProc = macdrv_ClipboardWindowProc,
.pCreateDesktopWindow = macdrv_CreateDesktopWindow,
- .pCreateWindow = macdrv_CreateWindow,
.pDesktopWindowProc = macdrv_DesktopWindowProc,
.pDestroyCursorIcon = macdrv_DestroyCursorIcon,
.pDestroyWindow = macdrv_DestroyWindow,
diff --git a/dlls/winemac.drv/macdrv.h b/dlls/winemac.drv/macdrv.h
index 26028247a96..9cd0509a39c 100644
--- a/dlls/winemac.drv/macdrv.h
+++ b/dlls/winemac.drv/macdrv.h
@@ -128,13 +128,13 @@ extern LONG macdrv_ChangeDisplaySettingsEx(LPCWSTR devname, LPDEVMODEW devmode,
HWND hwnd, DWORD flags, LPVOID lpvoid) DECLSPEC_HIDDEN;
extern BOOL macdrv_EnumDisplaySettingsEx(LPCWSTR devname, DWORD mode,
LPDEVMODEW devmode, DWORD flags) DECLSPEC_HIDDEN;
+extern LRESULT macdrv_ClipboardWindowProc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp) DECLSPEC_HIDDEN;
extern void macdrv_UpdateDisplayDevices( const struct gdi_device_manager *device_manager,
BOOL force, void *param ) DECLSPEC_HIDDEN;
extern BOOL macdrv_GetDeviceGammaRamp(PHYSDEV dev, LPVOID ramp) DECLSPEC_HIDDEN;
extern BOOL macdrv_SetDeviceGammaRamp(PHYSDEV dev, LPVOID ramp) DECLSPEC_HIDDEN;
extern BOOL macdrv_ClipCursor(LPCRECT clip) DECLSPEC_HIDDEN;
extern BOOL macdrv_CreateDesktopWindow(HWND hwnd) DECLSPEC_HIDDEN;
-extern BOOL macdrv_CreateWindow(HWND hwnd) DECLSPEC_HIDDEN;
extern LRESULT macdrv_DesktopWindowProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) DECLSPEC_HIDDEN;
extern void macdrv_DestroyWindow(HWND hwnd) DECLSPEC_HIDDEN;
extern void macdrv_SetFocus(HWND hwnd) DECLSPEC_HIDDEN;
@@ -252,7 +252,6 @@ extern HKL macdrv_get_hkl_from_source(TISInputSourceRef input_source) DECLSPEC_H
extern void macdrv_displays_changed(const macdrv_event *event) DECLSPEC_HIDDEN;
extern void macdrv_UpdateClipboard(void) DECLSPEC_HIDDEN;
-extern void macdrv_init_clipboard(void) DECLSPEC_HIDDEN;
extern BOOL query_pasteboard_data(HWND hwnd, CFStringRef type) DECLSPEC_HIDDEN;
extern void macdrv_lost_pasteboard_ownership(HWND hwnd) DECLSPEC_HIDDEN;
extern const char *debugstr_format(UINT id) DECLSPEC_HIDDEN;
diff --git a/dlls/winemac.drv/window.c b/dlls/winemac.drv/window.c
index 59788244c22..2f473730b2f 100644
--- a/dlls/winemac.drv/window.c
+++ b/dlls/winemac.drv/window.c
@@ -1593,19 +1593,6 @@ LRESULT macdrv_DesktopWindowProc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp)
return NtUserMessageCall(hwnd, msg, wp, lp, 0, NtUserDefWindowProc, FALSE);
}
-/**********************************************************************
- * CreateWindow (MACDRV.@)
- */
-BOOL macdrv_CreateWindow(HWND hwnd)
-{
- if (hwnd == NtUserGetDesktopWindow())
- {
- macdrv_init_clipboard();
- }
- return TRUE;
-}
-
-
/***********************************************************************
* DestroyWindow (MACDRV.@)
*/
--
GitLab
https://gitlab.winehq.org/wine/wine/-/merge_requests/162
May 31, 2022
[PATCH 3/5] winex11: Use ClipboardWindowProc driver entry point for clipboard manager.
by Jacek Caban
From: Jacek Caban <jacek(a)codeweavers.com>
Signed-off-by: Jacek Caban <jacek(a)codeweavers.com>
---
dlls/winex11.drv/clipboard.c | 17 +++---
dlls/winex11.drv/dllmain.c | 102 ---------------------------------
dlls/winex11.drv/init.c | 1 +
dlls/winex11.drv/unixlib.h | 11 ----
dlls/winex11.drv/window.c | 1 -
dlls/winex11.drv/x11drv.h | 2 +-
dlls/winex11.drv/x11drv_main.c | 1 -
7 files changed, 9 insertions(+), 126 deletions(-)
diff --git a/dlls/winex11.drv/clipboard.c b/dlls/winex11.drv/clipboard.c
index f2be4386e65..da451fad57c 100644
--- a/dlls/winex11.drv/clipboard.c
+++ b/dlls/winex11.drv/clipboard.c
@@ -2215,7 +2215,7 @@ static void xfixes_init(void)
/**************************************************************************
- * clipboard_thread
+ * clipboard_init
*
* Thread running inside the desktop process to manage the clipboard
*/
@@ -2250,20 +2250,18 @@ static BOOL clipboard_init( HWND hwnd )
/**************************************************************************
* x11drv_clipboard_message
*/
-NTSTATUS x11drv_clipboard_message( void *arg )
+LRESULT X11DRV_ClipboardWindowProc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam )
{
- struct clipboard_message_params *params = arg;
-
- switch (params->msg)
+ switch (msg)
{
case WM_NCCREATE:
- return clipboard_init( params->hwnd );
+ return clipboard_init( hwnd );
case WM_CLIPBOARDUPDATE:
if (is_clipboard_owner) break; /* ignore our own changes */
acquire_selection( thread_init_display() );
break;
case WM_RENDERFORMAT:
- if (render_format( params->wparam )) rendered_formats++;
+ if (render_format( wparam )) rendered_formats++;
break;
case WM_TIMER:
if (!is_clipboard_owner) break;
@@ -2272,12 +2270,11 @@ NTSTATUS x11drv_clipboard_message( void *arg )
case WM_DESTROYCLIPBOARD:
TRACE( "WM_DESTROYCLIPBOARD: lost ownership\n" );
is_clipboard_owner = FALSE;
- NtUserKillTimer( params->hwnd, 1 );
+ NtUserKillTimer( hwnd, 1 );
break;
}
- return NtUserMessageCall( params->hwnd, params->msg, params->wparam, params->lparam,
- NULL, NtUserDefWindowProc, FALSE );
+ return NtUserMessageCall( hwnd, msg, wparam, lparam, NULL, NtUserDefWindowProc, FALSE );
}
diff --git a/dlls/winex11.drv/dllmain.c b/dlls/winex11.drv/dllmain.c
index b06c955c2a4..e2cbd51351d 100644
--- a/dlls/winex11.drv/dllmain.c
+++ b/dlls/winex11.drv/dllmain.c
@@ -21,112 +21,11 @@
#include "x11drv_dll.h"
#include "wine/debug.h"
-WINE_DEFAULT_DEBUG_CHANNEL(x11drv);
-
HMODULE x11drv_module = 0;
static unixlib_handle_t x11drv_handle;
NTSTATUS (CDECL *x11drv_unix_call)( enum x11drv_funcs code, void *params );
-/**************************************************************************
- * wait_clipboard_mutex
- *
- * Make sure that there's only one clipboard thread per window station.
- */
-static BOOL wait_clipboard_mutex(void)
-{
- static const WCHAR prefix[] = {'_','_','w','i','n','e','_','c','l','i','p','b','o','a','r','d','_'};
- WCHAR buffer[MAX_PATH + ARRAY_SIZE( prefix )];
- HANDLE mutex;
-
- memcpy( buffer, prefix, sizeof(prefix) );
- if (!GetUserObjectInformationW( GetProcessWindowStation(), UOI_NAME,
- buffer + ARRAY_SIZE( prefix ),
- sizeof(buffer) - sizeof(prefix), NULL ))
- {
- ERR( "failed to get winstation name\n" );
- return FALSE;
- }
- mutex = CreateMutexW( NULL, TRUE, buffer );
- if (GetLastError() == ERROR_ALREADY_EXISTS)
- {
- TRACE( "waiting for mutex %s\n", debugstr_w( buffer ));
- WaitForSingleObject( mutex, INFINITE );
- }
- return TRUE;
-}
-
-
-/**************************************************************************
- * clipboard_wndproc
- *
- * Window procedure for the clipboard manager.
- */
-static LRESULT CALLBACK clipboard_wndproc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp )
-{
- struct clipboard_message_params params;
-
- switch (msg)
- {
- case WM_NCCREATE:
- case WM_CLIPBOARDUPDATE:
- case WM_RENDERFORMAT:
- case WM_TIMER:
- case WM_DESTROYCLIPBOARD:
- params.hwnd = hwnd;
- params.msg = msg;
- params.wparam = wp;
- params.lparam = lp;
- return X11DRV_CALL( clipboard_message, ¶ms );
- }
-
- return DefWindowProcW( hwnd, msg, wp, lp );
-}
-
-
-/**************************************************************************
- * clipboard_thread
- *
- * Thread running inside the desktop process to manage the clipboard
- */
-static DWORD WINAPI clipboard_thread( void *arg )
-{
- static const WCHAR clipboard_classname[] = {'_','_','w','i','n','e','_','c','l','i','p','b','o','a','r','d','_','m','a','n','a','g','e','r',0};
- WNDCLASSW class;
- MSG msg;
-
- if (!wait_clipboard_mutex()) return 0;
-
- memset( &class, 0, sizeof(class) );
- class.lpfnWndProc = clipboard_wndproc;
- class.lpszClassName = clipboard_classname;
-
- if (!RegisterClassW( &class ) && GetLastError() != ERROR_CLASS_ALREADY_EXISTS)
- {
- ERR( "could not register clipboard window class err %u\n", GetLastError() );
- return 0;
- }
- if (!CreateWindowW( clipboard_classname, NULL, 0, 0, 0, 0, 0, HWND_MESSAGE, 0, 0, NULL ))
- {
- ERR( "failed to create clipboard window err %u\n", GetLastError() );
- return 0;
- }
-
- while (GetMessageW( &msg, 0, 0, 0 )) DispatchMessageW( &msg );
- return 0;
-}
-
-
-static NTSTATUS x11drv_clipboard_init( UINT arg )
-{
- DWORD id;
- HANDLE thread = CreateThread( NULL, 0, clipboard_thread, NULL, 0, &id );
-
- if (thread) CloseHandle( thread );
- else ERR( "failed to create clipboard thread\n" );
- return 0;
-}
-
static NTSTATUS x11drv_load_icon( UINT id )
{
@@ -137,7 +36,6 @@ static NTSTATUS x11drv_load_icon( UINT id )
typedef NTSTATUS (*callback_func)( UINT arg );
static const callback_func callback_funcs[] =
{
- x11drv_clipboard_init,
x11drv_dnd_drop_event,
x11drv_dnd_leave_event,
x11drv_ime_get_cursor_pos,
diff --git a/dlls/winex11.drv/init.c b/dlls/winex11.drv/init.c
index 3bdc05999f1..7c5a1acd7b6 100644
--- a/dlls/winex11.drv/init.c
+++ b/dlls/winex11.drv/init.c
@@ -425,6 +425,7 @@ static const struct user_driver_funcs x11drv_funcs =
.pSetWindowText = X11DRV_SetWindowText,
.pShowWindow = X11DRV_ShowWindow,
.pSysCommand = X11DRV_SysCommand,
+ .pClipboardWindowProc = X11DRV_ClipboardWindowProc,
.pUpdateClipboard = X11DRV_UpdateClipboard,
.pUpdateLayeredWindow = X11DRV_UpdateLayeredWindow,
.pWindowMessage = X11DRV_WindowMessage,
diff --git a/dlls/winex11.drv/unixlib.h b/dlls/winex11.drv/unixlib.h
index 76cfad88f4d..451c308f0cd 100644
--- a/dlls/winex11.drv/unixlib.h
+++ b/dlls/winex11.drv/unixlib.h
@@ -21,7 +21,6 @@
enum x11drv_funcs
{
- unix_clipboard_message,
unix_create_desktop,
unix_init,
unix_systray_clear,
@@ -41,15 +40,6 @@ enum x11drv_funcs
extern NTSTATUS (CDECL *x11drv_unix_call)( enum x11drv_funcs code, void *params ) DECLSPEC_HIDDEN;
#define X11DRV_CALL(func, params) x11drv_unix_call( unix_ ## func, params )
-/* x11drv_clipboard_message params */
-struct clipboard_message_params
-{
- HWND hwnd;
- UINT msg;
- WPARAM wparam;
- LPARAM lparam;
-};
-
/* x11drv_create_desktop params */
struct create_desktop_params
{
@@ -108,7 +98,6 @@ C_ASSERT( client_func_last <= NtUserDriverCallbackLast + 1 );
/* simplified interface for client callbacks requiring only a single UINT parameter */
enum client_callback
{
- client_clipboard_init,
client_dnd_drop_event,
client_dnd_leave_event,
client_ime_get_cursor_pos,
diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c
index 07fb1515e24..5d9a93688c3 100644
--- a/dlls/winex11.drv/window.c
+++ b/dlls/winex11.drv/window.c
@@ -1913,7 +1913,6 @@ BOOL X11DRV_CreateWindow( HWND hwnd )
CWOverrideRedirect | CWEventMask, &attr );
XFlush( data->display );
NtUserSetProp( hwnd, clip_window_prop, (HANDLE)data->clip_window );
- x11drv_client_call( client_clipboard_init, 0 );
X11DRV_DisplayDevices_RegisterEventHandlers();
}
return TRUE;
diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h
index 222d7328387..307932b0bf0 100644
--- a/dlls/winex11.drv/x11drv.h
+++ b/dlls/winex11.drv/x11drv.h
@@ -238,6 +238,7 @@ extern void X11DRV_SetWindowStyle( HWND hwnd, INT offset, STYLESTRUCT *style ) D
extern void X11DRV_SetWindowText( HWND hwnd, LPCWSTR text ) DECLSPEC_HIDDEN;
extern UINT X11DRV_ShowWindow( HWND hwnd, INT cmd, RECT *rect, UINT swp ) DECLSPEC_HIDDEN;
extern LRESULT X11DRV_SysCommand( HWND hwnd, WPARAM wparam, LPARAM lparam ) DECLSPEC_HIDDEN;
+extern LRESULT X11DRV_ClipboardWindowProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp ) DECLSPEC_HIDDEN;
extern void X11DRV_UpdateClipboard(void) DECLSPEC_HIDDEN;
extern BOOL X11DRV_UpdateLayeredWindow( HWND hwnd, const UPDATELAYEREDWINDOWINFO *info,
const RECT *window_rect ) DECLSPEC_HIDDEN;
@@ -833,7 +834,6 @@ static inline BOOL is_window_rect_mapped( const RECT *rect )
/* unixlib interface */
-extern NTSTATUS x11drv_clipboard_message( void *arg ) DECLSPEC_HIDDEN;
extern NTSTATUS x11drv_create_desktop( void *arg ) DECLSPEC_HIDDEN;
extern NTSTATUS x11drv_systray_clear( void *arg ) DECLSPEC_HIDDEN;
extern NTSTATUS x11drv_systray_dock( void *arg ) DECLSPEC_HIDDEN;
diff --git a/dlls/winex11.drv/x11drv_main.c b/dlls/winex11.drv/x11drv_main.c
index a118757dfbe..dc987ae70a2 100644
--- a/dlls/winex11.drv/x11drv_main.c
+++ b/dlls/winex11.drv/x11drv_main.c
@@ -1302,7 +1302,6 @@ NTSTATUS x11drv_client_call( enum client_callback func, UINT arg )
const unixlib_entry_t __wine_unix_call_funcs[] =
{
- x11drv_clipboard_message,
x11drv_create_desktop,
x11drv_init,
x11drv_systray_clear,
--
GitLab
https://gitlab.winehq.org/wine/wine/-/merge_requests/162
May 31, 2022