winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
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
List overview
wine-commits
September 2020
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
1 participants
703 discussions
Start a n
N
ew thread
Jiajin Cui : gdiplus: Make gdi_alpha_blend fallback to StretchBlt if current Compositing Mode is SourceCopy.
by Alexandre Julliard
04 Sep '20
04 Sep '20
Module: wine Branch: master Commit: 5754bd9c0ae4c74f94b02f242056820a3f483db3 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=5754bd9c0ae4c74f94b02f24…
Author: Jiajin Cui <cuijiajin(a)uniontech.com> Date: Thu Sep 3 17:17:43 2020 +0800 gdiplus: Make gdi_alpha_blend fallback to StretchBlt if current Compositing Mode is SourceCopy. Signed-off-by: Jiajin Cui <cuijiajin(a)uniontech.com> Signed-off-by: Esme Povirk <esme(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/gdiplus/graphics.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index 5db8973c7b..868aea5642 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -331,8 +331,14 @@ static void round_points(POINT *pti, GpPointF *ptf, INT count) static void gdi_alpha_blend(GpGraphics *graphics, INT dst_x, INT dst_y, INT dst_width, INT dst_height, HDC hdc, INT src_x, INT src_y, INT src_width, INT src_height) { - if (GetDeviceCaps(graphics->hdc, TECHNOLOGY) == DT_RASPRINTER && - GetDeviceCaps(graphics->hdc, SHADEBLENDCAPS) == SB_NONE) + CompositingMode comp_mode; + INT technology = GetDeviceCaps(graphics->hdc, TECHNOLOGY); + INT shadeblendcaps = GetDeviceCaps(graphics->hdc, SHADEBLENDCAPS); + + GdipGetCompositingMode(graphics, &comp_mode); + + if ((technology == DT_RASPRINTER && shadeblendcaps == SB_NONE) + || comp_mode == CompositingModeSourceCopy) { TRACE("alpha blending not supported by device, fallback to StretchBlt\n");
1
0
0
0
Martin Storsjo : ntdll: Add ARM64 SEH unwind directives for assembly functions in PE builds.
by Alexandre Julliard
04 Sep '20
04 Sep '20
Module: wine Branch: master Commit: 36ebdfc6b647aaaac1298a03269420fab5de5880 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=36ebdfc6b647aaaac1298a03…
Author: Martin Storsjo <martin(a)martin.st> Date: Fri Sep 4 10:36:06 2020 +0300 ntdll: Add ARM64 SEH unwind directives for assembly functions in PE builds. This fixes unwinding through RtlRaiseException and call_consolidate_callback in PE builds. Adjust the call_consolidate_callback function to store the whole context on the stack, and use the seh "context" opcode for unwinding to that context instead of the parent. Adjust the dwarf escape codes for reading from the context on the stack. Signed-off-by: Martin Storsjo <martin(a)martin.st> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/signal_arm64.c | 83 +++++++++++++++++++++++++++++------------------ include/wine/asm.h | 10 +++++- 2 files changed, 61 insertions(+), 32 deletions(-) diff --git a/dlls/ntdll/signal_arm64.c b/dlls/ntdll/signal_arm64.c index 40789d318c..df656d90f2 100644 --- a/dlls/ntdll/signal_arm64.c +++ b/dlls/ntdll/signal_arm64.c @@ -940,9 +940,7 @@ PVOID WINAPI RtlVirtualUnwind( ULONG type, ULONG_PTR base, ULONG_PTR pc, * else. All CFI instructions are either DW_CFA_def_cfa_expression or * DW_CFA_expression, and the expressions have the following format: * - * DW_OP_breg29; sleb128 0x10 | Load x29 + 0x10 - * DW_OP_deref | Get *(x29 + 0x10) == context - * DW_OP_plus_uconst; uleb128 <OFFSET> | Add offset to get struct member + * DW_OP_breg31; sleb128 <OFFSET> | Load x31 + struct member offset * [DW_OP_deref] | Dereference, only for CFA */ extern void * WINAPI call_consolidate_callback( CONTEXT *context, @@ -950,40 +948,60 @@ extern void * WINAPI call_consolidate_callback( CONTEXT *context, EXCEPTION_RECORD *rec, TEB *teb ); __ASM_GLOBAL_FUNC( call_consolidate_callback, - "stp x29, x30, [sp, #-0x20]!\n\t" - __ASM_CFI(".cfi_def_cfa_offset 32\n\t") - __ASM_CFI(".cfi_offset 29, -32\n\t") - __ASM_CFI(".cfi_offset 30, -24\n\t") + "stp x29, x30, [sp, #-0x30]!\n\t" + __ASM_CFI(".cfi_def_cfa_offset 48\n\t") + __ASM_CFI(".cfi_offset 29, -48\n\t") + __ASM_CFI(".cfi_offset 30, -40\n\t") + __ASM_SEH(".seh_nop\n\t") + "stp x1, x2, [sp, #0x10]\n\t" + __ASM_SEH(".seh_nop\n\t") + "str x3, [sp, #0x20]\n\t" + __ASM_SEH(".seh_nop\n\t") "mov x29, sp\n\t" __ASM_CFI(".cfi_def_cfa_register 29\n\t") - "str x0, [sp, 0x10]\n\t" + __ASM_SEH(".seh_nop\n\t") __ASM_CFI(".cfi_remember_state\n\t") - __ASM_CFI(".cfi_escape 0x0f,0x07,0x8d,0x10,0x06,0x23,0x80,0x02,0x06\n\t") /* CFA */ - __ASM_CFI(".cfi_escape 0x10,0x13,0x06,0x8d,0x10,0x06,0x23,0xa0,0x01\n\t") /* x19 */ - __ASM_CFI(".cfi_escape 0x10,0x14,0x06,0x8d,0x10,0x06,0x23,0xa8,0x01\n\t") /* x20 */ - __ASM_CFI(".cfi_escape 0x10,0x15,0x06,0x8d,0x10,0x06,0x23,0xb0,0x01\n\t") /* x21 */ - __ASM_CFI(".cfi_escape 0x10,0x16,0x06,0x8d,0x10,0x06,0x23,0xb8,0x01\n\t") /* x22 */ - __ASM_CFI(".cfi_escape 0x10,0x17,0x06,0x8d,0x10,0x06,0x23,0xc0,0x01\n\t") /* x23 */ - __ASM_CFI(".cfi_escape 0x10,0x18,0x06,0x8d,0x10,0x06,0x23,0xc8,0x01\n\t") /* x24 */ - __ASM_CFI(".cfi_escape 0x10,0x19,0x06,0x8d,0x10,0x06,0x23,0xd0,0x01\n\t") /* x25 */ - __ASM_CFI(".cfi_escape 0x10,0x1a,0x06,0x8d,0x10,0x06,0x23,0xd8,0x01\n\t") /* x26 */ - __ASM_CFI(".cfi_escape 0x10,0x1b,0x06,0x8d,0x10,0x06,0x23,0xe0,0x01\n\t") /* x27 */ - __ASM_CFI(".cfi_escape 0x10,0x1c,0x06,0x8d,0x10,0x06,0x23,0xe8,0x01\n\t") /* x28 */ - __ASM_CFI(".cfi_escape 0x10,0x1d,0x06,0x8d,0x10,0x06,0x23,0xf0,0x01\n\t") /* x29 */ - __ASM_CFI(".cfi_escape 0x10,0x1e,0x06,0x8d,0x10,0x06,0x23,0xf8,0x01\n\t") /* x30 */ - __ASM_CFI(".cfi_escape 0x10,0x48,0x06,0x8d,0x10,0x06,0x23,0x90,0x03\n\t") /* d8 */ - __ASM_CFI(".cfi_escape 0x10,0x49,0x06,0x8d,0x10,0x06,0x23,0xa0,0x03\n\t") /* d9 */ - __ASM_CFI(".cfi_escape 0x10,0x4a,0x06,0x8d,0x10,0x06,0x23,0xb0,0x03\n\t") /* d10 */ - __ASM_CFI(".cfi_escape 0x10,0x4b,0x06,0x8d,0x10,0x06,0x23,0xc0,0x03\n\t") /* d11 */ - __ASM_CFI(".cfi_escape 0x10,0x4c,0x06,0x8d,0x10,0x06,0x23,0xd0,0x03\n\t") /* d12 */ - __ASM_CFI(".cfi_escape 0x10,0x4d,0x06,0x8d,0x10,0x06,0x23,0xe0,0x03\n\t") /* d13 */ - __ASM_CFI(".cfi_escape 0x10,0x4e,0x06,0x8d,0x10,0x06,0x23,0xf0,0x03\n\t") /* d14 */ - __ASM_CFI(".cfi_escape 0x10,0x4f,0x06,0x8d,0x10,0x06,0x23,0x80,0x04\n\t") /* d15 */ + /* Memcpy the context onto the stack */ + "sub sp, sp, #0x390\n\t" + __ASM_SEH(".seh_nop\n\t") + "mov x1, x0\n\t" + __ASM_SEH(".seh_nop\n\t") + "mov x0, sp\n\t" + __ASM_SEH(".seh_nop\n\t") + "mov x2, #0x390\n\t" + __ASM_SEH(".seh_nop\n\t") + "bl " __ASM_NAME("memcpy") "\n\t" + __ASM_CFI(".cfi_def_cfa 31, 0\n\t") + __ASM_CFI(".cfi_escape 0x0f,0x04,0x8f,0x80,0x02,0x06\n\t") /* CFA, DW_OP_breg31 + 0x100, DW_OP_deref */ + __ASM_CFI(".cfi_escape 0x10,0x13,0x03,0x8f,0xa0,0x01\n\t") /* x19, DW_OP_breg31 + 0xA0 */ + __ASM_CFI(".cfi_escape 0x10,0x14,0x03,0x8f,0xa8,0x01\n\t") /* x20 */ + __ASM_CFI(".cfi_escape 0x10,0x15,0x03,0x8f,0xb0,0x01\n\t") /* x21 */ + __ASM_CFI(".cfi_escape 0x10,0x16,0x03,0x8f,0xb8,0x01\n\t") /* x22 */ + __ASM_CFI(".cfi_escape 0x10,0x17,0x03,0x8f,0xc0,0x01\n\t") /* x23 */ + __ASM_CFI(".cfi_escape 0x10,0x18,0x03,0x8f,0xc8,0x01\n\t") /* x24 */ + __ASM_CFI(".cfi_escape 0x10,0x19,0x03,0x8f,0xd0,0x01\n\t") /* x25 */ + __ASM_CFI(".cfi_escape 0x10,0x1a,0x03,0x8f,0xd8,0x01\n\t") /* x26 */ + __ASM_CFI(".cfi_escape 0x10,0x1b,0x03,0x8f,0xe0,0x01\n\t") /* x27 */ + __ASM_CFI(".cfi_escape 0x10,0x1c,0x03,0x8f,0xe8,0x01\n\t") /* x28 */ + __ASM_CFI(".cfi_escape 0x10,0x1d,0x03,0x8f,0xf0,0x01\n\t") /* x29 */ + __ASM_CFI(".cfi_escape 0x10,0x1e,0x03,0x8f,0xf8,0x01\n\t") /* x30 */ + __ASM_CFI(".cfi_escape 0x10,0x48,0x03,0x8f,0x90,0x03\n\t") /* d8 */ + __ASM_CFI(".cfi_escape 0x10,0x49,0x03,0x8f,0x98,0x03\n\t") /* d9 */ + __ASM_CFI(".cfi_escape 0x10,0x4a,0x03,0x8f,0xa0,0x03\n\t") /* d10 */ + __ASM_CFI(".cfi_escape 0x10,0x4b,0x03,0x8f,0xa8,0x03\n\t") /* d11 */ + __ASM_CFI(".cfi_escape 0x10,0x4c,0x03,0x8f,0xb0,0x03\n\t") /* d12 */ + __ASM_CFI(".cfi_escape 0x10,0x4d,0x03,0x8f,0xb8,0x03\n\t") /* d13 */ + __ASM_CFI(".cfi_escape 0x10,0x4e,0x03,0x8f,0xc0,0x03\n\t") /* d14 */ + __ASM_CFI(".cfi_escape 0x10,0x4f,0x03,0x8f,0xc8,0x03\n\t") /* d15 */ + __ASM_SEH(".seh_context\n\t") + __ASM_SEH(".seh_endprologue\n\t") + "ldp x1, x2, [x29, #0x10]\n\t" + "ldr x18, [x29, #0x20]\n\t" "mov x0, x2\n\t" - "mov x18, x3\n\t" "blr x1\n\t" + "mov sp, x29\n\t" __ASM_CFI(".cfi_restore_state\n\t") - "ldp x29, x30, [sp], #32\n\t" + "ldp x29, x30, [sp], #48\n\t" __ASM_CFI(".cfi_restore 30\n\t") __ASM_CFI(".cfi_restore 29\n\t") __ASM_CFI(".cfi_def_cfa 31, 0\n\t") @@ -1188,6 +1206,9 @@ void WINAPI RtlUnwind( void *frame, void *target_ip, EXCEPTION_RECORD *rec, void __ASM_STDCALL_FUNC( RtlRaiseException, 4, "sub sp, sp, #0x3b0\n\t" /* 0x390 (context) + 0x20 */ "stp x29, x30, [sp]\n\t" + __ASM_SEH(".seh_stackalloc 0x3b0\n\t") + __ASM_SEH(".seh_save_fplr 0\n\t") + __ASM_SEH(".seh_endprologue\n\t") __ASM_CFI(".cfi_def_cfa x29, 944\n\t") __ASM_CFI(".cfi_offset x30, -936\n\t") __ASM_CFI(".cfi_offset x29, -944\n\t") diff --git a/include/wine/asm.h b/include/wine/asm.h index 592f638306..788e26126c 100644 --- a/include/wine/asm.h +++ b/include/wine/asm.h @@ -40,7 +40,15 @@ #endif #ifdef __SEH__ -# define __ASM_SEH(str) str +# if defined(__aarch64__) && defined(__clang_major__) && (__clang_major__ < 12 || defined(__apple_build_version__)) + /* Clang got support for aarch64 SEH assembly directives in Clang 12, + * before that, only .seh_startproc/.seh_endproc but nothing else was + * supported. Support for it doesn't exist in any Apple branded version + * of Clang yet. */ +# define __ASM_SEH(str) +# else +# define __ASM_SEH(str) str +# endif #else # define __ASM_SEH(str) #endif
1
0
0
0
Gabriel Ivăncescu : msscript.ocx: Implement UseSafeSubset properly by setting the interface safety options.
by Alexandre Julliard
04 Sep '20
04 Sep '20
Module: wine Branch: master Commit: fb746414e2323d66e17772a8c20e1fda3bf6c58b URL:
https://source.winehq.org/git/wine.git/?a=commit;h=fb746414e2323d66e17772a8…
Author: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Date: Thu Sep 3 17:50:26 2020 +0300 msscript.ocx: Implement UseSafeSubset properly by setting the interface safety options. Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msscript.ocx/msscript.c | 40 ++++++++++------ dlls/msscript.ocx/tests/msscript.c | 93 ++++++++++++++++++++++++++++++++++++-- 2 files changed, 117 insertions(+), 16 deletions(-) diff --git a/dlls/msscript.ocx/msscript.c b/dlls/msscript.ocx/msscript.c index 7ddcb8f73d..ed17be90d8 100644 --- a/dlls/msscript.ocx/msscript.c +++ b/dlls/msscript.ocx/msscript.c @@ -2426,9 +2426,30 @@ static const IScriptErrorVtbl ScriptErrorVtbl = { ScriptError_Clear }; -static HRESULT init_script_host(ScriptControl *control, const CLSID *clsid, ScriptHost **ret) +static HRESULT set_safety_opts(IActiveScript *script, VARIANT_BOOL use_safe_subset) { IObjectSafety *objsafety; + HRESULT hr; + + hr = IActiveScript_QueryInterface(script, &IID_IObjectSafety, (void**)&objsafety); + if (FAILED(hr)) { + FIXME("Could not get IObjectSafety, %#x\n", hr); + return hr; + } + + hr = IObjectSafety_SetInterfaceSafetyOptions(objsafety, &IID_IActiveScriptParse, INTERFACESAFE_FOR_UNTRUSTED_DATA, + use_safe_subset ? INTERFACESAFE_FOR_UNTRUSTED_DATA : 0); + IObjectSafety_Release(objsafety); + if (FAILED(hr)) { + FIXME("SetInterfaceSafetyOptions failed, %#x\n", hr); + return hr; + } + + return hr; +} + +static HRESULT init_script_host(ScriptControl *control, const CLSID *clsid, ScriptHost **ret) +{ ScriptHost *host; HRESULT hr; @@ -2455,18 +2476,8 @@ static HRESULT init_script_host(ScriptControl *control, const CLSID *clsid, Scri goto failed; } - hr = IActiveScript_QueryInterface(host->script, &IID_IObjectSafety, (void**)&objsafety); - if (FAILED(hr)) { - FIXME("Could not get IObjectSafety, %#x\n", hr); - goto failed; - } - - hr = IObjectSafety_SetInterfaceSafetyOptions(objsafety, &IID_IActiveScriptParse, INTERFACESAFE_FOR_UNTRUSTED_DATA, 0); - IObjectSafety_Release(objsafety); - if (FAILED(hr)) { - FIXME("SetInterfaceSafetyOptions failed, %#x\n", hr); - goto failed; - } + hr = set_safety_opts(host->script, control->use_safe_subset); + if (FAILED(hr)) goto failed; hr = IActiveScript_SetScriptSite(host->script, &host->IActiveScriptSite_iface); if (FAILED(hr)) { @@ -2850,6 +2861,9 @@ static HRESULT WINAPI ScriptControl_put_UseSafeSubset(IScriptControl *iface, VAR ScriptControl *This = impl_from_IScriptControl(iface); TRACE("(%p)->(%x)\n", This, use_safe_subset); + if (This->host && This->use_safe_subset != use_safe_subset) + set_safety_opts(This->host->script, use_safe_subset); + This->use_safe_subset = use_safe_subset; return S_OK; } diff --git a/dlls/msscript.ocx/tests/msscript.c b/dlls/msscript.ocx/tests/msscript.c index e6d139fd75..a6ec0992c8 100644 --- a/dlls/msscript.ocx/tests/msscript.c +++ b/dlls/msscript.ocx/tests/msscript.c @@ -91,6 +91,7 @@ static const WCHAR vbW[] = {'V','B','S','c','r','i','p','t',0}; DEFINE_EXPECT(CreateInstance); DEFINE_EXPECT(SetInterfaceSafetyOptions); +DEFINE_EXPECT(SetInterfaceSafetyOptions_UseSafeSubset); DEFINE_EXPECT(InitNew); DEFINE_EXPECT(Close); DEFINE_EXPECT(Bind); @@ -278,12 +279,13 @@ static HRESULT WINAPI ObjectSafety_GetInterfaceSafetyOptions(IObjectSafety *ifac static HRESULT WINAPI ObjectSafety_SetInterfaceSafetyOptions(IObjectSafety *iface, REFIID riid, DWORD mask, DWORD options) { - CHECK_EXPECT(SetInterfaceSafetyOptions); + if (options == INTERFACESAFE_FOR_UNTRUSTED_DATA) + CHECK_EXPECT(SetInterfaceSafetyOptions_UseSafeSubset); + else + CHECK_EXPECT(SetInterfaceSafetyOptions); ok(IsEqualGUID(&IID_IActiveScriptParse, riid), "unexpected riid %s\n", wine_dbgstr_guid(riid)); - ok(mask == INTERFACESAFE_FOR_UNTRUSTED_DATA, "option mask = %x\n", mask); - ok(options == 0, "options = %x\n", options); return S_OK; } @@ -2100,6 +2102,91 @@ static void test_UseSafeSubset(void) ok(use_safe_subset == VARIANT_TRUE, "got %d\n", use_safe_subset); IScriptControl_Release(sc); + + /* custom script engine */ + if (have_custom_engine) + { + hr = CoCreateInstance(&CLSID_ScriptControl, NULL, CLSCTX_INPROC_SERVER | CLSCTX_INPROC_HANDLER, + &IID_IScriptControl, (void **)&sc); + ok(hr == S_OK, "Failed to create IScriptControl interface: 0x%08x.\n", hr); + + SET_EXPECT(CreateInstance); + SET_EXPECT(SetInterfaceSafetyOptions); + SET_EXPECT(SetScriptSite); + SET_EXPECT(QI_IActiveScriptParse); + SET_EXPECT(InitNew); + + str = SysAllocString(L"testscript"); + hr = IScriptControl_put_Language(sc, str); + ok(hr == S_OK, "got 0x%08x\n", hr); + SysFreeString(str); + + CHECK_CALLED(CreateInstance); + CHECK_CALLED(SetInterfaceSafetyOptions); + CHECK_CALLED(SetScriptSite); + CHECK_CALLED(QI_IActiveScriptParse); + CHECK_CALLED(InitNew); + + hr = IScriptControl_get_UseSafeSubset(sc, &use_safe_subset); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(use_safe_subset == VARIANT_FALSE, "got %d\n", use_safe_subset); + + SET_EXPECT(SetInterfaceSafetyOptions_UseSafeSubset); + hr = IScriptControl_put_UseSafeSubset(sc, VARIANT_TRUE); + ok(hr == S_OK, "got 0x%08x\n", hr); + CHECK_CALLED(SetInterfaceSafetyOptions_UseSafeSubset); + + hr = IScriptControl_get_UseSafeSubset(sc, &use_safe_subset); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(use_safe_subset == VARIANT_TRUE, "got %d\n", use_safe_subset); + + hr = IScriptControl_put_UseSafeSubset(sc, VARIANT_TRUE); + ok(hr == S_OK, "got 0x%08x\n", hr); + + SET_EXPECT(SetInterfaceSafetyOptions); + hr = IScriptControl_put_UseSafeSubset(sc, VARIANT_FALSE); + ok(hr == S_OK, "got 0x%08x\n", hr); + CHECK_CALLED(SetInterfaceSafetyOptions); + + hr = IScriptControl_put_UseSafeSubset(sc, VARIANT_FALSE); + ok(hr == S_OK, "got 0x%08x\n", hr); + + IActiveScriptSite_Release(site); + + SET_EXPECT(Close); + IScriptControl_Release(sc); + CHECK_CALLED(Close); + + hr = CoCreateInstance(&CLSID_ScriptControl, NULL, CLSCTX_INPROC_SERVER | CLSCTX_INPROC_HANDLER, + &IID_IScriptControl, (void **)&sc); + ok(hr == S_OK, "Failed to create IScriptControl interface: 0x%08x.\n", hr); + + hr = IScriptControl_put_UseSafeSubset(sc, VARIANT_TRUE); + ok(hr == S_OK, "got 0x%08x\n", hr); + + SET_EXPECT(CreateInstance); + SET_EXPECT(SetInterfaceSafetyOptions_UseSafeSubset); + SET_EXPECT(SetScriptSite); + SET_EXPECT(QI_IActiveScriptParse); + SET_EXPECT(InitNew); + + str = SysAllocString(L"testscript"); + hr = IScriptControl_put_Language(sc, str); + ok(hr == S_OK, "got 0x%08x\n", hr); + SysFreeString(str); + + CHECK_CALLED(CreateInstance); + CHECK_CALLED(SetInterfaceSafetyOptions_UseSafeSubset); + CHECK_CALLED(SetScriptSite); + CHECK_CALLED(QI_IActiveScriptParse); + CHECK_CALLED(InitNew); + + IActiveScriptSite_Release(site); + + SET_EXPECT(Close); + IScriptControl_Release(sc); + CHECK_CALLED(Close); + } } static void test_State(void)
1
0
0
0
Gabriel Ivăncescu : msscript.ocx: Return S_OK from the IActiveScriptSiteWindow::EnableModeless stub.
by Alexandre Julliard
04 Sep '20
04 Sep '20
Module: wine Branch: master Commit: 59fe65b61992a76985c1e43363e959acdceca60f URL:
https://source.winehq.org/git/wine.git/?a=commit;h=59fe65b61992a76985c1e433…
Author: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Date: Thu Sep 3 17:50:25 2020 +0300 msscript.ocx: Return S_OK from the IActiveScriptSiteWindow::EnableModeless stub. This is needed so e.g. vbscript can display message boxes when used from the script control. Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msscript.ocx/msscript.c | 4 ++-- dlls/msscript.ocx/tests/msscript.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dlls/msscript.ocx/msscript.c b/dlls/msscript.ocx/msscript.c index a61763458b..7ddcb8f73d 100644 --- a/dlls/msscript.ocx/msscript.c +++ b/dlls/msscript.ocx/msscript.c @@ -775,9 +775,9 @@ static HRESULT WINAPI ActiveScriptSiteWindow_EnableModeless(IActiveScriptSiteWin { ScriptHost *This = impl_from_IActiveScriptSiteWindow(iface); - FIXME("(%p, %d)\n", This, enable); + FIXME("(%p, %d): stub\n", This, enable); - return E_NOTIMPL; + return S_OK; } static const IActiveScriptSiteWindowVtbl ActiveScriptSiteWindowVtbl = { diff --git a/dlls/msscript.ocx/tests/msscript.c b/dlls/msscript.ocx/tests/msscript.c index 2df85ffb40..e6d139fd75 100644 --- a/dlls/msscript.ocx/tests/msscript.c +++ b/dlls/msscript.ocx/tests/msscript.c @@ -2000,9 +2000,9 @@ static void test_SitehWnd(void) ok(window == hwnd, "got %p, expected %p\n", window, hwnd); hr = IActiveScriptSiteWindow_EnableModeless(site_window, FALSE); - todo_wine ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "got 0x%08x\n", hr); hr = IActiveScriptSiteWindow_EnableModeless(site_window, TRUE); - todo_wine ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "got 0x%08x\n", hr); site_hwnd = 0xdeadbeef; hr = IScriptControl_put_SitehWnd(sc, 0);
1
0
0
0
Gabriel Ivăncescu : msscript.ocx: Implement IActiveScriptSiteWindow::GetWindow.
by Alexandre Julliard
04 Sep '20
04 Sep '20
Module: wine Branch: master Commit: c57e2de626a59f395fa7ab786e6aaaa5f13bec4d URL:
https://source.winehq.org/git/wine.git/?a=commit;h=c57e2de626a59f395fa7ab78…
Author: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Date: Thu Sep 3 17:50:24 2020 +0300 msscript.ocx: Implement IActiveScriptSiteWindow::GetWindow. Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msscript.ocx/msscript.c | 14 ++++++++++++-- dlls/msscript.ocx/tests/msscript.c | 24 ++++++++++++------------ 2 files changed, 24 insertions(+), 14 deletions(-) diff --git a/dlls/msscript.ocx/msscript.c b/dlls/msscript.ocx/msscript.c index 845d501814..a61763458b 100644 --- a/dlls/msscript.ocx/msscript.c +++ b/dlls/msscript.ocx/msscript.c @@ -147,6 +147,7 @@ struct ScriptHost { IActiveScript *script; IActiveScriptParse *parse; ScriptError *error; + HWND site_hwnd; SCRIPTSTATE script_state; CLSID clsid; @@ -761,9 +762,13 @@ static HRESULT WINAPI ActiveScriptSiteWindow_GetWindow(IActiveScriptSiteWindow * { ScriptHost *This = impl_from_IActiveScriptSiteWindow(iface); - FIXME("(%p, %p)\n", This, hwnd); + TRACE("(%p, %p)\n", This, hwnd); - return E_NOTIMPL; + if (!hwnd) return E_POINTER; + if (This->site_hwnd == ((HWND)-1)) return E_FAIL; + + *hwnd = This->site_hwnd; + return S_OK; } static HRESULT WINAPI ActiveScriptSiteWindow_EnableModeless(IActiveScriptSiteWindow *iface, BOOL enable) @@ -2481,6 +2486,7 @@ static HRESULT init_script_host(ScriptControl *control, const CLSID *clsid, Scri goto failed; } host->script_state = SCRIPTSTATE_INITIALIZED; + host->site_hwnd = control->allow_ui ? control->site_hwnd : ((HWND)-1); host->error = control->error; IScriptError_AddRef(&host->error->IScriptError_iface); @@ -2758,6 +2764,8 @@ static HRESULT WINAPI ScriptControl_put_SitehWnd(IScriptControl *iface, LONG hwn return CTL_E_INVALIDPROPERTYVALUE; This->site_hwnd = LongToHandle(hwnd); + if (This->host) + This->host->site_hwnd = This->allow_ui ? This->site_hwnd : ((HWND)-1); return S_OK; } @@ -2820,6 +2828,8 @@ static HRESULT WINAPI ScriptControl_put_AllowUI(IScriptControl *iface, VARIANT_B TRACE("(%p)->(%x)\n", This, allow_ui); This->allow_ui = allow_ui; + if (This->host) + This->host->site_hwnd = allow_ui ? This->site_hwnd : ((HWND)-1); return S_OK; } diff --git a/dlls/msscript.ocx/tests/msscript.c b/dlls/msscript.ocx/tests/msscript.c index 8e4fa1bfcf..2df85ffb40 100644 --- a/dlls/msscript.ocx/tests/msscript.c +++ b/dlls/msscript.ocx/tests/msscript.c @@ -1994,10 +1994,10 @@ static void test_SitehWnd(void) window = NULL; hr = IActiveScriptSiteWindow_GetWindow(site_window, NULL); - todo_wine ok(hr == E_POINTER, "got 0x%08x\n", hr); + ok(hr == E_POINTER, "got 0x%08x\n", hr); hr = IActiveScriptSiteWindow_GetWindow(site_window, &window); - todo_wine ok(hr == S_OK, "got 0x%08x\n", hr); - todo_wine ok(window == hwnd, "got %p, expected %p\n", window, hwnd); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(window == hwnd, "got %p, expected %p\n", window, hwnd); hr = IActiveScriptSiteWindow_EnableModeless(site_window, FALSE); todo_wine ok(hr == S_OK, "got 0x%08x\n", hr); @@ -2013,8 +2013,8 @@ static void test_SitehWnd(void) window = (HWND)0xdeadbeef; hr = IActiveScriptSiteWindow_GetWindow(site_window, &window); - todo_wine ok(hr == S_OK, "got 0x%08x\n", hr); - todo_wine ok(!window, "got %p\n", window); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(!window, "got %p\n", window); site_hwnd = 0; hr = IScriptControl_put_SitehWnd(sc, (LONG)(LONG_PTR)hwnd); @@ -2025,8 +2025,8 @@ static void test_SitehWnd(void) window = NULL; hr = IActiveScriptSiteWindow_GetWindow(site_window, &window); - todo_wine ok(hr == S_OK, "got 0x%08x\n", hr); - todo_wine ok(window == hwnd, "got %p, expected %p\n", window, hwnd); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(window == hwnd, "got %p, expected %p\n", window, hwnd); hr = IScriptControl_put_AllowUI(sc, VARIANT_FALSE); ok(hr == S_OK, "got 0x%08x\n", hr); @@ -2037,7 +2037,7 @@ static void test_SitehWnd(void) window = NULL; hr = IActiveScriptSiteWindow_GetWindow(site_window, &window); - todo_wine ok(hr == E_FAIL, "got 0x%08x\n", hr); + ok(hr == E_FAIL, "got 0x%08x\n", hr); ok(!window, "got %p\n", window); hr = IScriptControl_put_AllowUI(sc, VARIANT_TRUE); @@ -2045,8 +2045,8 @@ static void test_SitehWnd(void) window = NULL; hr = IActiveScriptSiteWindow_GetWindow(site_window, &window); - todo_wine ok(hr == S_OK, "got 0x%08x\n", hr); - todo_wine ok(window == hwnd, "got %p, expected %p\n", window, hwnd); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(window == hwnd, "got %p, expected %p\n", window, hwnd); IActiveScriptSite_Release(site); @@ -2056,8 +2056,8 @@ static void test_SitehWnd(void) window = NULL; hr = IActiveScriptSiteWindow_GetWindow(site_window, &window); - todo_wine ok(hr == S_OK, "got 0x%08x\n", hr); - todo_wine ok(window == hwnd, "got %p, expected %p\n", window, hwnd); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(window == hwnd, "got %p, expected %p\n", window, hwnd); IActiveScriptSiteWindow_Release(site_window); }
1
0
0
0
Gabriel Ivăncescu : msscript.ocx: Implement IScriptControl::get_SitehWnd.
by Alexandre Julliard
04 Sep '20
04 Sep '20
Module: wine Branch: master Commit: a46810c67af50843b7c6e4dcc41473e4a677b795 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=a46810c67af50843b7c6e4dc…
Author: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Date: Thu Sep 3 17:50:23 2020 +0300 msscript.ocx: Implement IScriptControl::get_SitehWnd. Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msscript.ocx/msscript.c | 9 +++++++-- dlls/msscript.ocx/tests/msscript.c | 30 +++++++++++++++--------------- 2 files changed, 22 insertions(+), 17 deletions(-) diff --git a/dlls/msscript.ocx/msscript.c b/dlls/msscript.ocx/msscript.c index 1ff330c78a..845d501814 100644 --- a/dlls/msscript.ocx/msscript.c +++ b/dlls/msscript.ocx/msscript.c @@ -2764,8 +2764,13 @@ static HRESULT WINAPI ScriptControl_put_SitehWnd(IScriptControl *iface, LONG hwn static HRESULT WINAPI ScriptControl_get_SitehWnd(IScriptControl *iface, LONG *p) { ScriptControl *This = impl_from_IScriptControl(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; + + TRACE("(%p)->(%p)\n", This, p); + + if (!p) return E_POINTER; + + *p = HandleToLong(This->site_hwnd); + return S_OK; } static HRESULT WINAPI ScriptControl_get_Timeout(IScriptControl *iface, LONG *p) diff --git a/dlls/msscript.ocx/tests/msscript.c b/dlls/msscript.ocx/tests/msscript.c index 8b63e979f0..8e4fa1bfcf 100644 --- a/dlls/msscript.ocx/tests/msscript.c +++ b/dlls/msscript.ocx/tests/msscript.c @@ -1921,20 +1921,20 @@ static void test_SitehWnd(void) ok(hr == S_OK, "got 0x%08x\n", hr); hr = IScriptControl_get_SitehWnd(sc, NULL); - todo_wine ok(hr == E_POINTER, "got 0x%08x\n", hr); + ok(hr == E_POINTER, "got 0x%08x\n", hr); site_hwnd = 0xdeadbeef; hr = IScriptControl_get_SitehWnd(sc, &site_hwnd); - todo_wine ok(hr == S_OK, "got 0x%08x\n", hr); - todo_wine ok(!site_hwnd, "got %p\n", (HWND)(LONG_PTR)site_hwnd); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(!site_hwnd, "got %p\n", (HWND)(LONG_PTR)site_hwnd); hr = IScriptControl_put_SitehWnd(sc, 1); ok(hr == CTL_E_INVALIDPROPERTYVALUE, "got 0x%08x\n", hr); site_hwnd = 0xdeadbeef; hr = IScriptControl_get_SitehWnd(sc, &site_hwnd); - todo_wine ok(hr == S_OK, "got 0x%08x\n", hr); - todo_wine ok(!site_hwnd, "got %p\n", (HWND)(LONG_PTR)site_hwnd); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(!site_hwnd, "got %p\n", (HWND)(LONG_PTR)site_hwnd); hr = IScriptControl_put_SitehWnd(sc, 0); ok(hr == S_OK, "got 0x%08x\n", hr); @@ -1949,8 +1949,8 @@ static void test_SitehWnd(void) site_hwnd = 0; hr = IScriptControl_get_SitehWnd(sc, &site_hwnd); - todo_wine ok(hr == S_OK, "got 0x%08x\n", hr); - todo_wine ok((HWND)(LONG_PTR)site_hwnd == hwnd, "got %p, expected %p\n", (HWND)(LONG_PTR)site_hwnd, hwnd); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok((HWND)(LONG_PTR)site_hwnd == hwnd, "got %p, expected %p\n", (HWND)(LONG_PTR)site_hwnd, hwnd); IScriptControl_Release(sc); @@ -1989,8 +1989,8 @@ static void test_SitehWnd(void) site_hwnd = 0; hr = IScriptControl_get_SitehWnd(sc, &site_hwnd); - todo_wine ok(hr == S_OK, "got 0x%08x\n", hr); - todo_wine ok((HWND)(LONG_PTR)site_hwnd == hwnd, "got %p, expected %p\n", (HWND)(LONG_PTR)site_hwnd, hwnd); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok((HWND)(LONG_PTR)site_hwnd == hwnd, "got %p, expected %p\n", (HWND)(LONG_PTR)site_hwnd, hwnd); window = NULL; hr = IActiveScriptSiteWindow_GetWindow(site_window, NULL); @@ -2008,8 +2008,8 @@ static void test_SitehWnd(void) hr = IScriptControl_put_SitehWnd(sc, 0); ok(hr == S_OK, "got 0x%08x\n", hr); hr = IScriptControl_get_SitehWnd(sc, &site_hwnd); - todo_wine ok(hr == S_OK, "got 0x%08x\n", hr); - todo_wine ok(!site_hwnd, "got %p\n", (HWND)(LONG_PTR)site_hwnd); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(!site_hwnd, "got %p\n", (HWND)(LONG_PTR)site_hwnd); window = (HWND)0xdeadbeef; hr = IActiveScriptSiteWindow_GetWindow(site_window, &window); @@ -2020,8 +2020,8 @@ static void test_SitehWnd(void) hr = IScriptControl_put_SitehWnd(sc, (LONG)(LONG_PTR)hwnd); ok(hr == S_OK, "got 0x%08x\n", hr); hr = IScriptControl_get_SitehWnd(sc, &site_hwnd); - todo_wine ok(hr == S_OK, "got 0x%08x\n", hr); - todo_wine ok((HWND)(LONG_PTR)site_hwnd == hwnd, "got %p, expected %p\n", (HWND)(LONG_PTR)site_hwnd, hwnd); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok((HWND)(LONG_PTR)site_hwnd == hwnd, "got %p, expected %p\n", (HWND)(LONG_PTR)site_hwnd, hwnd); window = NULL; hr = IActiveScriptSiteWindow_GetWindow(site_window, &window); @@ -2032,8 +2032,8 @@ static void test_SitehWnd(void) ok(hr == S_OK, "got 0x%08x\n", hr); hr = IScriptControl_get_SitehWnd(sc, &site_hwnd); - todo_wine ok(hr == S_OK, "got 0x%08x\n", hr); - todo_wine ok((HWND)(LONG_PTR)site_hwnd == hwnd, "got %p, expected %p\n", (HWND)(LONG_PTR)site_hwnd, hwnd); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok((HWND)(LONG_PTR)site_hwnd == hwnd, "got %p, expected %p\n", (HWND)(LONG_PTR)site_hwnd, hwnd); window = NULL; hr = IActiveScriptSiteWindow_GetWindow(site_window, &window);
1
0
0
0
Gabriel Ivăncescu : msscript.ocx: Implement IScriptControl::put_SitehWnd.
by Alexandre Julliard
04 Sep '20
04 Sep '20
Module: wine Branch: master Commit: 01ea797c344afda604326808e13a48bc9ea93393 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=01ea797c344afda604326808…
Author: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Date: Thu Sep 3 17:50:22 2020 +0300 msscript.ocx: Implement IScriptControl::put_SitehWnd. Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msscript.ocx/msscript.c | 7 ++++++- dlls/msscript.ocx/tests/msscript.c | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/dlls/msscript.ocx/msscript.c b/dlls/msscript.ocx/msscript.c index ee0cf2537e..1ff330c78a 100644 --- a/dlls/msscript.ocx/msscript.c +++ b/dlls/msscript.ocx/msscript.c @@ -165,6 +165,7 @@ struct ScriptControl { IConnectionPointContainer IConnectionPointContainer_iface; LONG ref; IOleClientSite *site; + HWND site_hwnd; SIZEL extent; LONG timeout; VARIANT_BOOL allow_ui; @@ -2751,8 +2752,12 @@ static HRESULT WINAPI ScriptControl_put_SitehWnd(IScriptControl *iface, LONG hwn { ScriptControl *This = impl_from_IScriptControl(iface); - FIXME("(%p)->(%x)\n", This, hwnd); + TRACE("(%p)->(%x)\n", This, hwnd); + if (hwnd && !IsWindow(LongToHandle(hwnd))) + return CTL_E_INVALIDPROPERTYVALUE; + + This->site_hwnd = LongToHandle(hwnd); return S_OK; } diff --git a/dlls/msscript.ocx/tests/msscript.c b/dlls/msscript.ocx/tests/msscript.c index 5a29c7efc6..8b63e979f0 100644 --- a/dlls/msscript.ocx/tests/msscript.c +++ b/dlls/msscript.ocx/tests/msscript.c @@ -1929,7 +1929,7 @@ static void test_SitehWnd(void) todo_wine ok(!site_hwnd, "got %p\n", (HWND)(LONG_PTR)site_hwnd); hr = IScriptControl_put_SitehWnd(sc, 1); - todo_wine ok(hr == CTL_E_INVALIDPROPERTYVALUE, "got 0x%08x\n", hr); + ok(hr == CTL_E_INVALIDPROPERTYVALUE, "got 0x%08x\n", hr); site_hwnd = 0xdeadbeef; hr = IScriptControl_get_SitehWnd(sc, &site_hwnd);
1
0
0
0
Gabriel Ivăncescu : msscript.ocx/tests: Add tests for SitehWnd.
by Alexandre Julliard
04 Sep '20
04 Sep '20
Module: wine Branch: master Commit: 8b6afc2677c204469c0a67624e9b9ca28554bd56 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=8b6afc2677c204469c0a6762…
Author: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Date: Thu Sep 3 17:50:21 2020 +0300 msscript.ocx/tests: Add tests for SitehWnd. Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msscript.ocx/tests/msscript.c | 161 +++++++++++++++++++++++++++++++++++++ 1 file changed, 161 insertions(+) diff --git a/dlls/msscript.ocx/tests/msscript.c b/dlls/msscript.ocx/tests/msscript.c index 2e7f14d6bd..5a29c7efc6 100644 --- a/dlls/msscript.ocx/tests/msscript.c +++ b/dlls/msscript.ocx/tests/msscript.c @@ -1905,6 +1905,166 @@ static void test_AllowUI(void) IScriptControl_Release(sc); } +static void test_SitehWnd(void) +{ + IScriptControl *sc; + LONG site_hwnd; + HRESULT hr; + HWND hwnd; + BSTR str; + + hwnd = CreateWindowA("static", NULL, WS_OVERLAPPEDWINDOW, 50, 50, 100, 100, NULL, NULL, NULL, NULL); + ok(hwnd != NULL, "failed to create window, error %08x\n", GetLastError()); + + hr = CoCreateInstance(&CLSID_ScriptControl, NULL, CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER, + &IID_IScriptControl, (void**)&sc); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IScriptControl_get_SitehWnd(sc, NULL); + todo_wine ok(hr == E_POINTER, "got 0x%08x\n", hr); + + site_hwnd = 0xdeadbeef; + hr = IScriptControl_get_SitehWnd(sc, &site_hwnd); + todo_wine ok(hr == S_OK, "got 0x%08x\n", hr); + todo_wine ok(!site_hwnd, "got %p\n", (HWND)(LONG_PTR)site_hwnd); + + hr = IScriptControl_put_SitehWnd(sc, 1); + todo_wine ok(hr == CTL_E_INVALIDPROPERTYVALUE, "got 0x%08x\n", hr); + + site_hwnd = 0xdeadbeef; + hr = IScriptControl_get_SitehWnd(sc, &site_hwnd); + todo_wine ok(hr == S_OK, "got 0x%08x\n", hr); + todo_wine ok(!site_hwnd, "got %p\n", (HWND)(LONG_PTR)site_hwnd); + + hr = IScriptControl_put_SitehWnd(sc, 0); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IScriptControl_put_SitehWnd(sc, (LONG)(LONG_PTR)hwnd); + ok(hr == S_OK, "got 0x%08x\n", hr); + + str = SysAllocString(L"vbscript"); + hr = IScriptControl_put_Language(sc, str); + ok(hr == S_OK, "got 0x%08x\n", hr); + SysFreeString(str); + + site_hwnd = 0; + hr = IScriptControl_get_SitehWnd(sc, &site_hwnd); + todo_wine ok(hr == S_OK, "got 0x%08x\n", hr); + todo_wine ok((HWND)(LONG_PTR)site_hwnd == hwnd, "got %p, expected %p\n", (HWND)(LONG_PTR)site_hwnd, hwnd); + + IScriptControl_Release(sc); + + /* custom script engine */ + if (have_custom_engine) + { + IActiveScriptSiteWindow *site_window; + HWND window; + + hr = CoCreateInstance(&CLSID_ScriptControl, NULL, CLSCTX_INPROC_SERVER | CLSCTX_INPROC_HANDLER, + &IID_IScriptControl, (void **)&sc); + ok(hr == S_OK, "Failed to create IScriptControl interface: 0x%08x.\n", hr); + + hr = IScriptControl_put_SitehWnd(sc, (LONG)(LONG_PTR)hwnd); + ok(hr == S_OK, "got 0x%08x\n", hr); + + SET_EXPECT(CreateInstance); + SET_EXPECT(SetInterfaceSafetyOptions); + SET_EXPECT(SetScriptSite); + SET_EXPECT(QI_IActiveScriptParse); + SET_EXPECT(InitNew); + + str = SysAllocString(L"testscript"); + hr = IScriptControl_put_Language(sc, str); + ok(hr == S_OK, "got 0x%08x\n", hr); + SysFreeString(str); + + CHECK_CALLED(CreateInstance); + CHECK_CALLED(SetInterfaceSafetyOptions); + CHECK_CALLED(SetScriptSite); + CHECK_CALLED(QI_IActiveScriptParse); + CHECK_CALLED(InitNew); + + hr = IActiveScriptSite_QueryInterface(site, &IID_IActiveScriptSiteWindow, (void**)&site_window); + ok(hr == S_OK, "got 0x%08x\n", hr); + + site_hwnd = 0; + hr = IScriptControl_get_SitehWnd(sc, &site_hwnd); + todo_wine ok(hr == S_OK, "got 0x%08x\n", hr); + todo_wine ok((HWND)(LONG_PTR)site_hwnd == hwnd, "got %p, expected %p\n", (HWND)(LONG_PTR)site_hwnd, hwnd); + + window = NULL; + hr = IActiveScriptSiteWindow_GetWindow(site_window, NULL); + todo_wine ok(hr == E_POINTER, "got 0x%08x\n", hr); + hr = IActiveScriptSiteWindow_GetWindow(site_window, &window); + todo_wine ok(hr == S_OK, "got 0x%08x\n", hr); + todo_wine ok(window == hwnd, "got %p, expected %p\n", window, hwnd); + + hr = IActiveScriptSiteWindow_EnableModeless(site_window, FALSE); + todo_wine ok(hr == S_OK, "got 0x%08x\n", hr); + hr = IActiveScriptSiteWindow_EnableModeless(site_window, TRUE); + todo_wine ok(hr == S_OK, "got 0x%08x\n", hr); + + site_hwnd = 0xdeadbeef; + hr = IScriptControl_put_SitehWnd(sc, 0); + ok(hr == S_OK, "got 0x%08x\n", hr); + hr = IScriptControl_get_SitehWnd(sc, &site_hwnd); + todo_wine ok(hr == S_OK, "got 0x%08x\n", hr); + todo_wine ok(!site_hwnd, "got %p\n", (HWND)(LONG_PTR)site_hwnd); + + window = (HWND)0xdeadbeef; + hr = IActiveScriptSiteWindow_GetWindow(site_window, &window); + todo_wine ok(hr == S_OK, "got 0x%08x\n", hr); + todo_wine ok(!window, "got %p\n", window); + + site_hwnd = 0; + hr = IScriptControl_put_SitehWnd(sc, (LONG)(LONG_PTR)hwnd); + ok(hr == S_OK, "got 0x%08x\n", hr); + hr = IScriptControl_get_SitehWnd(sc, &site_hwnd); + todo_wine ok(hr == S_OK, "got 0x%08x\n", hr); + todo_wine ok((HWND)(LONG_PTR)site_hwnd == hwnd, "got %p, expected %p\n", (HWND)(LONG_PTR)site_hwnd, hwnd); + + window = NULL; + hr = IActiveScriptSiteWindow_GetWindow(site_window, &window); + todo_wine ok(hr == S_OK, "got 0x%08x\n", hr); + todo_wine ok(window == hwnd, "got %p, expected %p\n", window, hwnd); + + hr = IScriptControl_put_AllowUI(sc, VARIANT_FALSE); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IScriptControl_get_SitehWnd(sc, &site_hwnd); + todo_wine ok(hr == S_OK, "got 0x%08x\n", hr); + todo_wine ok((HWND)(LONG_PTR)site_hwnd == hwnd, "got %p, expected %p\n", (HWND)(LONG_PTR)site_hwnd, hwnd); + + window = NULL; + hr = IActiveScriptSiteWindow_GetWindow(site_window, &window); + todo_wine ok(hr == E_FAIL, "got 0x%08x\n", hr); + ok(!window, "got %p\n", window); + + hr = IScriptControl_put_AllowUI(sc, VARIANT_TRUE); + ok(hr == S_OK, "got 0x%08x\n", hr); + + window = NULL; + hr = IActiveScriptSiteWindow_GetWindow(site_window, &window); + todo_wine ok(hr == S_OK, "got 0x%08x\n", hr); + todo_wine ok(window == hwnd, "got %p, expected %p\n", window, hwnd); + + IActiveScriptSite_Release(site); + + SET_EXPECT(Close); + IScriptControl_Release(sc); + CHECK_CALLED(Close); + + window = NULL; + hr = IActiveScriptSiteWindow_GetWindow(site_window, &window); + todo_wine ok(hr == S_OK, "got 0x%08x\n", hr); + todo_wine ok(window == hwnd, "got %p, expected %p\n", window, hwnd); + + IActiveScriptSiteWindow_Release(site_window); + } + + DestroyWindow(hwnd); +} + static void test_UseSafeSubset(void) { IScriptControl *sc; @@ -4100,6 +4260,7 @@ START_TEST(msscript) test_Reset(); test_AddObject(); test_AllowUI(); + test_SitehWnd(); test_UseSafeSubset(); test_State(); test_IScriptControl_Eval();
1
0
0
0
Hans Leidekker : advapi32: Enumerate host credentials through mountmgr.
by Alexandre Julliard
04 Sep '20
04 Sep '20
Module: wine Branch: master Commit: 66baf153528a018933fa5ac55c7d3bbeb76217f9 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=66baf153528a018933fa5ac5…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Fri Sep 4 13:15:47 2020 +0200 advapi32: Enumerate host credentials through mountmgr. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/advapi32/Makefile.in | 1 - dlls/advapi32/cred.c | 411 +++++++++++++--------------------------------- 2 files changed, 115 insertions(+), 297 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=66baf153528a018933fa…
1
0
0
0
Jacek Caban : conhost: Update tty output in IOCTL_CONDRV_ACTIVATE.
by Alexandre Julliard
04 Sep '20
04 Sep '20
Module: wine Branch: master Commit: 3885b32bc8995bbb171ffdc7af7d402df1b0534e URL:
https://source.winehq.org/git/wine.git/?a=commit;h=3885b32bc8995bbb171ffdc7…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Fri Sep 4 13:52:01 2020 +0200 conhost: Update tty output in IOCTL_CONDRV_ACTIVATE. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- programs/conhost/conhost.c | 14 ++++++- programs/conhost/tests/tty.c | 97 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 109 insertions(+), 2 deletions(-) diff --git a/programs/conhost/conhost.c b/programs/conhost/conhost.c index 9edd5971b8..9830ff0182 100644 --- a/programs/conhost/conhost.c +++ b/programs/conhost/conhost.c @@ -451,6 +451,17 @@ static NTSTATUS write_console_input( struct console *console, const INPUT_RECORD return STATUS_SUCCESS; } +static NTSTATUS screen_buffer_activate( struct screen_buffer *screen_buffer ) +{ + RECT update_rect; + TRACE( "%p\n", screen_buffer ); + screen_buffer->console->active = screen_buffer; + SetRect( &update_rect, 0, 0, screen_buffer->width - 1, screen_buffer->height - 1); + update_output( screen_buffer, &update_rect ); + tty_sync( screen_buffer->console ); + return STATUS_SUCCESS; +} + static NTSTATUS get_output_info( struct screen_buffer *screen_buffer, size_t *out_size ) { struct condrv_output_info *info; @@ -1043,8 +1054,7 @@ static NTSTATUS screen_buffer_ioctl( struct screen_buffer *screen_buffer, unsign case IOCTL_CONDRV_ACTIVATE: if (in_size || *out_size) return STATUS_INVALID_PARAMETER; - screen_buffer->console->active = screen_buffer; - return STATUS_SUCCESS; + return screen_buffer_activate( screen_buffer ); case IOCTL_CONDRV_GET_MODE: { diff --git a/programs/conhost/tests/tty.c b/programs/conhost/tests/tty.c index c28928701f..9c0ec8493b 100644 --- a/programs/conhost/tests/tty.c +++ b/programs/conhost/tests/tty.c @@ -145,8 +145,10 @@ static BOOL expect_erase_line_(unsigned line, unsigned int cnt) enum req_type { + REQ_CREATE_SCREEN_BUFFER, REQ_FILL_CHAR, REQ_SCROLL, + REQ_SET_ACTIVE, REQ_SET_CURSOR, REQ_SET_TITLE, REQ_WRITE_CHARACTERS, @@ -160,6 +162,7 @@ struct pseudoconsole_req { WCHAR string[1]; COORD coord; + HANDLE handle; struct { COORD coord; @@ -234,6 +237,33 @@ static void child_set_cursor(const unsigned int x, unsigned int y) ok(ret, "WriteFile failed: %u\n", GetLastError()); } +static HANDLE child_create_screen_buffer(void) +{ + struct pseudoconsole_req req; + HANDLE handle; + DWORD count; + BOOL ret; + + req.type = REQ_CREATE_SCREEN_BUFFER; + ret = WriteFile(child_pipe, &req, sizeof(req), &count, NULL); + ok(ret, "WriteFile failed: %u\n", GetLastError()); + ret = ReadFile(child_pipe, &handle, sizeof(handle), &count, NULL); + ok(ret, "ReadFile failed: %u\n", GetLastError()); + return handle; +} + +static void child_set_active(HANDLE handle) +{ + struct pseudoconsole_req req; + DWORD count; + BOOL ret; + + req.type = REQ_SET_ACTIVE; + req.u.handle = handle; + ret = WriteFile(child_pipe, &req, sizeof(req), &count, NULL); + ok(ret, "WriteFile failed: %u\n", GetLastError()); +} + #define child_write_output(a,b,c,d,e,f,g,h,j,k,l,m,n) child_write_output_(__LINE__,a,b,c,d,e,f,g,h,j,k,l,m,n) static void child_write_output_(unsigned int line, CHAR_INFO *buf, unsigned int size_x, unsigned int size_y, unsigned int coord_x, unsigned int coord_y, unsigned int left, @@ -303,6 +333,7 @@ static void child_fill_character(WCHAR ch, DWORD count, int x, int y) static void test_tty_output(void) { CHAR_INFO char_info_buf[2048], char_info; + HANDLE sb, sb2; unsigned int i; /* simple write chars */ @@ -532,6 +563,52 @@ static void test_tty_output(void) expect_output_sequence("\x1b[4;3H"); /* set cursor */ expect_output_sequence("\x1b[?25h"); /* show cursor */ expect_empty_output(); + + sb = child_create_screen_buffer(); + child_set_active(sb); + expect_hide_cursor(); + expect_output_sequence("\x1b[H"); /* set cursor */ + for (i = 0; i < 40; i++) + { + expect_erase_line(30); + if (i != 39) expect_output_sequence("\r\n"); + } + expect_output_sequence("\x1b[H"); /* set cursor */ + expect_output_sequence("\x1b[?25h"); /* show cursor */ + expect_empty_output(); + + child_write_characters(L"new sb", 0, 0); + skip_hide_cursor(); + expect_output_sequence("new sb"); + ok(skip_sequence("\x1b[H") || skip_sequence("\r"), "expected set cursor\n"); + skip_sequence("\x1b[?25h"); /* show cursor */ + expect_empty_output(); + + sb2 = child_create_screen_buffer(); + child_set_active(sb2); + expect_hide_cursor(); + for (i = 0; i < 40; i++) + { + expect_erase_line(30); + if (i != 39) expect_output_sequence("\r\n"); + } + expect_output_sequence("\x1b[H"); /* set cursor */ + expect_output_sequence("\x1b[?25h"); /* show cursor */ + expect_empty_output(); + + child_set_active(sb); + expect_hide_cursor(); + expect_output_sequence("new sb"); + expect_erase_line(24); + expect_output_sequence("\r\n"); + for (i = 1; i < 40; i++) + { + expect_erase_line(30); + if (i != 39) expect_output_sequence("\r\n"); + } + expect_output_sequence("\x1b[H"); /* set cursor */ + expect_output_sequence("\x1b[?25h"); /* show cursor */ + expect_empty_output(); } static void child_process(HANDLE pipe) @@ -552,6 +629,20 @@ static void child_process(HANDLE pipe) const struct pseudoconsole_req *req = (void *)buf; switch (req->type) { + case REQ_CREATE_SCREEN_BUFFER: + { + HANDLE handle; + DWORD count; + SetLastError(0xdeadbeef); + handle = CreateConsoleScreenBuffer(GENERIC_READ | GENERIC_WRITE, + FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, + CONSOLE_TEXTMODE_BUFFER, NULL); + ok(handle != INVALID_HANDLE_VALUE, "CreateConsoleScreenBuffer failed: %u\n", GetLastError()); + ret = WriteFile(pipe, &handle, sizeof(handle), &count, NULL); + ok(ret, "WriteFile failed: %u\n", GetLastError()); + break; + } + case REQ_SCROLL: ret = ScrollConsoleScreenBufferW(output, &req->u.scroll.rect, NULL, req->u.scroll.dst, &req->u.scroll.fill); ok(ret, "ScrollConsoleScreenBuffer failed: %u\n", GetLastError()); @@ -563,6 +654,12 @@ static void child_process(HANDLE pipe) ok(count == req->u.fill.count, "count = %u, expected %u\n", count, req->u.fill.count); break; + case REQ_SET_ACTIVE: + output = req->u.handle; + ret = SetConsoleActiveScreenBuffer(output); + ok(ret, "SetConsoleActiveScreenBuffer failed: %u\n", GetLastError()); + break; + case REQ_SET_CURSOR: ret = SetConsoleCursorPosition(output, req->u.coord); ok(ret, "SetConsoleCursorPosition failed: %u\n", GetLastError());
1
0
0
0
← Newer
1
...
57
58
59
60
61
62
63
...
71
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
Results per page:
10
25
50
100
200