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 2018
----- 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
2 participants
670 discussions
Start a n
N
ew thread
Gabriel Ivăncescu : shell32/autocomplete: Implement PageDown and PageUp for the auto-suggest listbox.
by Alexandre Julliard
27 Sep '18
27 Sep '18
Module: wine Branch: master Commit: e3d57fe551720f27c25781974af80f83eab2635b URL:
https://source.winehq.org/git/wine.git/?a=commit;h=e3d57fe551720f27c2578197…
Author: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Date: Thu Sep 27 00:35:23 2018 +0300 shell32/autocomplete: Implement PageDown and PageUp for the auto-suggest listbox. Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/shell32/autocomplete.c | 93 ++++++++++++++++++++++++++++++--------------- 1 file changed, 63 insertions(+), 30 deletions(-) diff --git a/dlls/shell32/autocomplete.c b/dlls/shell32/autocomplete.c index 621c5fd..5cf63fe 100644 --- a/dlls/shell32/autocomplete.c +++ b/dlls/shell32/autocomplete.c @@ -134,6 +134,66 @@ static size_t format_quick_complete(WCHAR *dst, const WCHAR *qc, const WCHAR *st return dst - base; } +static LRESULT change_selection(IAutoCompleteImpl *ac, HWND hwnd, UINT key) +{ + INT count = SendMessageW(ac->hwndListBox, LB_GETCOUNT, 0, 0); + INT sel = SendMessageW(ac->hwndListBox, LB_GETCURSEL, 0, 0); + if (key == VK_PRIOR || key == VK_NEXT) + { + if (sel < 0) + sel = (key == VK_PRIOR) ? count - 1 : 0; + else + { + INT base = SendMessageW(ac->hwndListBox, LB_GETTOPINDEX, 0, 0); + INT pgsz = SendMessageW(ac->hwndListBox, LB_GETLISTBOXINFO, 0, 0); + pgsz = max(pgsz - 1, 1); + if (key == VK_PRIOR) + { + if (sel == 0) + sel = -1; + else + { + if (sel == base) base -= min(base, pgsz); + sel = base; + } + } + else + { + if (sel == count - 1) + sel = -1; + else + { + base += pgsz; + if (sel >= base) base += pgsz; + sel = min(base, count - 1); + } + } + } + } + else if (key == VK_UP) + sel = ((sel - 1) < -1) ? count - 1 : sel - 1; + else + sel = ((sel + 1) >= count) ? -1 : sel + 1; + + SendMessageW(ac->hwndListBox, LB_SETCURSEL, sel, 0); + if (sel >= 0) + { + WCHAR *msg; + UINT len = SendMessageW(ac->hwndListBox, LB_GETTEXTLEN, sel, 0); + if (!(msg = heap_alloc((len + 1) * sizeof(WCHAR)))) + return 0; + len = SendMessageW(ac->hwndListBox, LB_GETTEXT, sel, (LPARAM)msg); + set_text_and_selection(ac, hwnd, msg, len, len); + heap_free(msg); + } + else + { + UINT len = strlenW(ac->txtbackup); + set_text_and_selection(ac, hwnd, ac->txtbackup, len, len); + } + return 0; +} + static void autoappend_str(IAutoCompleteImpl *ac, WCHAR *text, UINT len, WCHAR *str, HWND hwnd) { DWORD sel_start; @@ -287,6 +347,8 @@ static LRESULT ACEditSubclassProc_KeyDown(IAutoCompleteImpl *ac, HWND hwnd, UINT break; case VK_UP: case VK_DOWN: + case VK_PRIOR: + case VK_NEXT: /* Two cases here: - if the listbox is not visible and ACO_UPDOWNKEYDROPSLIST is set, display it with all the entries, without selecting any @@ -304,36 +366,7 @@ static LRESULT ACEditSubclassProc_KeyDown(IAutoCompleteImpl *ac, HWND hwnd, UINT } } else - { - INT count, sel; - count = SendMessageW(ac->hwndListBox, LB_GETCOUNT, 0, 0); - - /* Change the selection */ - sel = SendMessageW(ac->hwndListBox, LB_GETCURSEL, 0, 0); - if (wParam == VK_UP) - sel = ((sel - 1) < -1) ? count - 1 : sel - 1; - else - sel = ((sel + 1) >= count) ? -1 : sel + 1; - SendMessageW(ac->hwndListBox, LB_SETCURSEL, sel, 0); - if (sel >= 0) - { - WCHAR *msg; - UINT len; - - len = SendMessageW(ac->hwndListBox, LB_GETTEXTLEN, sel, 0); - if (!(msg = heap_alloc((len + 1) * sizeof(WCHAR)))) - return 0; - len = SendMessageW(ac->hwndListBox, LB_GETTEXT, sel, (LPARAM)msg); - set_text_and_selection(ac, hwnd, msg, len, len); - heap_free(msg); - } - else - { - UINT len = strlenW(ac->txtbackup); - set_text_and_selection(ac, hwnd, ac->txtbackup, len, len); - } - return 0; - } + return change_selection(ac, hwnd, wParam); break; case VK_DELETE: {
1
0
0
0
Gabriel Ivăncescu : shell32/autocomplete: Don' t auto-append unless the caret is at the end.
by Alexandre Julliard
27 Sep '18
27 Sep '18
Module: wine Branch: master Commit: 3f31afafc32bf2dc009bf037852e58298354e18b URL:
https://source.winehq.org/git/wine.git/?a=commit;h=3f31afafc32bf2dc009bf037…
Author: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Date: Thu Sep 27 00:35:22 2018 +0300 shell32/autocomplete: Don't auto-append unless the caret is at the end. Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/shell32/autocomplete.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dlls/shell32/autocomplete.c b/dlls/shell32/autocomplete.c index 9acd3f4..621c5fd 100644 --- a/dlls/shell32/autocomplete.c +++ b/dlls/shell32/autocomplete.c @@ -136,9 +136,15 @@ static size_t format_quick_complete(WCHAR *dst, const WCHAR *qc, const WCHAR *st static void autoappend_str(IAutoCompleteImpl *ac, WCHAR *text, UINT len, WCHAR *str, HWND hwnd) { + DWORD sel_start; WCHAR *tmp; size_t size; + /* Don't auto-append unless the caret is at the end */ + SendMessageW(hwnd, EM_GETSEL, (WPARAM)&sel_start, 0); + if (sel_start != len) + return; + /* The character capitalization can be different, so merge text and str into a new string */ size = len + strlenW(&str[len]) + 1;
1
0
0
0
Gabriel Ivăncescu : shell32/autocomplete: Use the same font for the AutoComplete listbox as the edit control.
by Alexandre Julliard
27 Sep '18
27 Sep '18
Module: wine Branch: master Commit: d8de5fe47dbbd2bd542f5b2cbdd0230a94bff286 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=d8de5fe47dbbd2bd542f5b2c…
Author: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Date: Thu Sep 27 00:35:21 2018 +0300 shell32/autocomplete: Use the same font for the AutoComplete listbox as the edit control. Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/shell32/autocomplete.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/dlls/shell32/autocomplete.c b/dlls/shell32/autocomplete.c index fe5bba2..9acd3f4 100644 --- a/dlls/shell32/autocomplete.c +++ b/dlls/shell32/autocomplete.c @@ -384,6 +384,10 @@ static LRESULT APIENTRY ACEditSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, ret = CallWindowProcW(This->wpOrigEditProc, hwnd, uMsg, wParam, lParam); autocomplete_text(This, hwnd, autoappend_flag_yes); return ret; + case WM_SETFONT: + if (This->hwndListBox) + SendMessageW(This->hwndListBox, WM_SETFONT, wParam, lParam); + break; case WM_DESTROY: { WNDPROC proc = This->wpOrigEditProc; @@ -434,9 +438,16 @@ static void create_listbox(IAutoCompleteImpl *This) 0, 0, 0, 0, GetParent(This->hwndEdit), NULL, shell32_hInstance, NULL); if (This->hwndListBox) { + HFONT edit_font; + This->wpOrigLBoxProc = (WNDPROC) SetWindowLongPtrW( This->hwndListBox, GWLP_WNDPROC, (LONG_PTR) ACLBoxSubclassProc); SetWindowLongPtrW( This->hwndListBox, GWLP_USERDATA, (LONG_PTR)This); SetParent(This->hwndListBox, HWND_DESKTOP); + + /* Use the same font as the edit control, as it gets destroyed before it anyway */ + edit_font = (HFONT)SendMessageW(This->hwndEdit, WM_GETFONT, 0, 0); + if (edit_font) + SendMessageW(This->hwndListBox, WM_SETFONT, (WPARAM)edit_font, FALSE); } else This->options &= ~ACO_AUTOSUGGEST;
1
0
0
0
Alex Henrie : riched20: Avoid using GCC's typeof extension.
by Alexandre Julliard
27 Sep '18
27 Sep '18
Module: wine Branch: master Commit: e11c3ddd598843daf874285796ce776ebdd88ca3 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=e11c3ddd598843daf8742857…
Author: Alex Henrie <alexhenrie24(a)gmail.com> Date: Wed Sep 26 11:10:30 2018 -0600 riched20: Avoid using GCC's typeof extension. Signed-off-by: Alex Henrie <alexhenrie24(a)gmail.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/riched20/txthost.c | 90 ++++++++++++++++++++++++------------------------- dlls/riched20/txtsrv.c | 6 ++-- 2 files changed, 48 insertions(+), 48 deletions(-) diff --git a/dlls/riched20/txthost.c b/dlls/riched20/txthost.c index b479bde..eaa6aae 100644 --- a/dlls/riched20/txthost.c +++ b/dlls/riched20/txthost.c @@ -501,10 +501,10 @@ DECLSPEC_HIDDEN HRESULT WINAPI ITextHostImpl_TxGetSelectionBarWidth(ITextHost *i #ifdef __i386__ /* thiscall functions are i386-specific */ -#define THISCALL(func) __thiscall_ ## func +#define THISCALL(func) (void *) __thiscall_ ## func #define DEFINE_THISCALL_WRAPPER(func,args) \ - extern typeof(func) THISCALL(func); \ - __ASM_STDCALL_FUNC(__thiscall_ ## func, args, \ + extern HRESULT __thiscall_ ## func(void); \ + __ASM_GLOBAL_FUNC(__thiscall_ ## func, \ "popl %eax\n\t" \ "pushl %ecx\n\t" \ "pushl %eax\n\t" \ @@ -559,10 +559,10 @@ DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxGetSelectionBarWidth,8) #ifdef __i386__ /* thiscall functions are i386-specific */ -#define STDCALL(func) __stdcall_ ## func +#define STDCALL(func) (void *) __stdcall_ ## func #define DEFINE_STDCALL_WRAPPER(num,func,args) \ - extern typeof(func) __stdcall_ ## func; \ - __ASM_STDCALL_FUNC(__stdcall_ ## func, args, \ + extern HRESULT __stdcall_ ## func(void); \ + __ASM_GLOBAL_FUNC(__stdcall_ ## func, \ "popl %eax\n\t" \ "popl %ecx\n\t" \ "pushl %eax\n\t" \ @@ -613,45 +613,45 @@ const ITextHostVtbl itextHostStdcallVtbl = { NULL, NULL, NULL, - __stdcall_ITextHostImpl_TxGetDC, - __stdcall_ITextHostImpl_TxReleaseDC, - __stdcall_ITextHostImpl_TxShowScrollBar, - __stdcall_ITextHostImpl_TxEnableScrollBar, - __stdcall_ITextHostImpl_TxSetScrollRange, - __stdcall_ITextHostImpl_TxSetScrollPos, - __stdcall_ITextHostImpl_TxInvalidateRect, - __stdcall_ITextHostImpl_TxViewChange, - __stdcall_ITextHostImpl_TxCreateCaret, - __stdcall_ITextHostImpl_TxShowCaret, - __stdcall_ITextHostImpl_TxSetCaretPos, - __stdcall_ITextHostImpl_TxSetTimer, - __stdcall_ITextHostImpl_TxKillTimer, - __stdcall_ITextHostImpl_TxScrollWindowEx, - __stdcall_ITextHostImpl_TxSetCapture, - __stdcall_ITextHostImpl_TxSetFocus, - __stdcall_ITextHostImpl_TxSetCursor, - __stdcall_ITextHostImpl_TxScreenToClient, - __stdcall_ITextHostImpl_TxClientToScreen, - __stdcall_ITextHostImpl_TxActivate, - __stdcall_ITextHostImpl_TxDeactivate, - __stdcall_ITextHostImpl_TxGetClientRect, - __stdcall_ITextHostImpl_TxGetViewInset, - __stdcall_ITextHostImpl_TxGetCharFormat, - __stdcall_ITextHostImpl_TxGetParaFormat, - __stdcall_ITextHostImpl_TxGetSysColor, - __stdcall_ITextHostImpl_TxGetBackStyle, - __stdcall_ITextHostImpl_TxGetMaxLength, - __stdcall_ITextHostImpl_TxGetScrollBars, - __stdcall_ITextHostImpl_TxGetPasswordChar, - __stdcall_ITextHostImpl_TxGetAcceleratorPos, - __stdcall_ITextHostImpl_TxGetExtent, - __stdcall_ITextHostImpl_OnTxCharFormatChange, - __stdcall_ITextHostImpl_OnTxParaFormatChange, - __stdcall_ITextHostImpl_TxGetPropertyBits, - __stdcall_ITextHostImpl_TxNotify, - __stdcall_ITextHostImpl_TxImmGetContext, - __stdcall_ITextHostImpl_TxImmReleaseContext, - __stdcall_ITextHostImpl_TxGetSelectionBarWidth, + STDCALL(ITextHostImpl_TxGetDC), + STDCALL(ITextHostImpl_TxReleaseDC), + STDCALL(ITextHostImpl_TxShowScrollBar), + STDCALL(ITextHostImpl_TxEnableScrollBar), + STDCALL(ITextHostImpl_TxSetScrollRange), + STDCALL(ITextHostImpl_TxSetScrollPos), + STDCALL(ITextHostImpl_TxInvalidateRect), + STDCALL(ITextHostImpl_TxViewChange), + STDCALL(ITextHostImpl_TxCreateCaret), + STDCALL(ITextHostImpl_TxShowCaret), + STDCALL(ITextHostImpl_TxSetCaretPos), + STDCALL(ITextHostImpl_TxSetTimer), + STDCALL(ITextHostImpl_TxKillTimer), + STDCALL(ITextHostImpl_TxScrollWindowEx), + STDCALL(ITextHostImpl_TxSetCapture), + STDCALL(ITextHostImpl_TxSetFocus), + STDCALL(ITextHostImpl_TxSetCursor), + STDCALL(ITextHostImpl_TxScreenToClient), + STDCALL(ITextHostImpl_TxClientToScreen), + STDCALL(ITextHostImpl_TxActivate), + STDCALL(ITextHostImpl_TxDeactivate), + STDCALL(ITextHostImpl_TxGetClientRect), + STDCALL(ITextHostImpl_TxGetViewInset), + STDCALL(ITextHostImpl_TxGetCharFormat), + STDCALL(ITextHostImpl_TxGetParaFormat), + STDCALL(ITextHostImpl_TxGetSysColor), + STDCALL(ITextHostImpl_TxGetBackStyle), + STDCALL(ITextHostImpl_TxGetMaxLength), + STDCALL(ITextHostImpl_TxGetScrollBars), + STDCALL(ITextHostImpl_TxGetPasswordChar), + STDCALL(ITextHostImpl_TxGetAcceleratorPos), + STDCALL(ITextHostImpl_TxGetExtent), + STDCALL(ITextHostImpl_OnTxCharFormatChange), + STDCALL(ITextHostImpl_OnTxParaFormatChange), + STDCALL(ITextHostImpl_TxGetPropertyBits), + STDCALL(ITextHostImpl_TxNotify), + STDCALL(ITextHostImpl_TxImmGetContext), + STDCALL(ITextHostImpl_TxImmReleaseContext), + STDCALL(ITextHostImpl_TxGetSelectionBarWidth), }; #endif /* __i386__ */ diff --git a/dlls/riched20/txtsrv.c b/dlls/riched20/txtsrv.c index ee65621..771c362 100644 --- a/dlls/riched20/txtsrv.c +++ b/dlls/riched20/txtsrv.c @@ -35,10 +35,10 @@ #ifdef __i386__ /* thiscall functions are i386-specific */ -#define THISCALL(func) __thiscall_ ## func +#define THISCALL(func) (void *) __thiscall_ ## func #define DEFINE_THISCALL_WRAPPER(func,args) \ - extern typeof(func) THISCALL(func); \ - __ASM_STDCALL_FUNC(__thiscall_ ## func, args, \ + extern HRESULT __thiscall_ ## func(void); \ + __ASM_GLOBAL_FUNC(__thiscall_ ## func, \ "popl %eax\n\t" \ "pushl %ecx\n\t" \ "pushl %eax\n\t" \
1
0
0
0
Hans Leidekker : appwiz.cpl: Read more application attributes from the registry.
by Alexandre Julliard
27 Sep '18
27 Sep '18
Module: wine Branch: master Commit: 1787bd640628a30346085177baa2f986bb3d488c URL:
https://source.winehq.org/git/wine.git/?a=commit;h=1787bd640628a30346085177…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Thu Sep 27 10:08:30 2018 +0200 appwiz.cpl: Read more application attributes from the registry. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/appwiz.cpl/appwiz.c | 100 ++++++++++++++++++++++------------------------- 1 file changed, 46 insertions(+), 54 deletions(-) diff --git a/dlls/appwiz.cpl/appwiz.c b/dlls/appwiz.cpl/appwiz.c index af893b8..ee26e58 100644 --- a/dlls/appwiz.cpl/appwiz.c +++ b/dlls/appwiz.cpl/appwiz.c @@ -67,6 +67,12 @@ typedef struct APPINFO LPWSTR publisher; LPWSTR version; + LPWSTR contact; + LPWSTR helplink; + LPWSTR helptelephone; + LPWSTR readme; + LPWSTR urlupdateinfo; + LPWSTR comments; HKEY regroot; WCHAR regkey[MAX_STRING_LEN]; @@ -84,21 +90,17 @@ static const WCHAR openW[] = {'o','p','e','n',0}; static const WCHAR BackSlashW[] = { '\\', 0 }; static const WCHAR DisplayNameW[] = {'D','i','s','p','l','a','y','N','a','m','e',0}; static const WCHAR DisplayIconW[] = {'D','i','s','p','l','a','y','I','c','o','n',0}; -static const WCHAR DisplayVersionW[] = {'D','i','s','p','l','a','y','V','e','r', - 's','i','o','n',0}; +static const WCHAR DisplayVersionW[] = {'D','i','s','p','l','a','y','V','e','r','s','i','o','n',0}; static const WCHAR PublisherW[] = {'P','u','b','l','i','s','h','e','r',0}; static const WCHAR ContactW[] = {'C','o','n','t','a','c','t',0}; static const WCHAR HelpLinkW[] = {'H','e','l','p','L','i','n','k',0}; -static const WCHAR HelpTelephoneW[] = {'H','e','l','p','T','e','l','e','p','h', - 'o','n','e',0}; +static const WCHAR HelpTelephoneW[] = {'H','e','l','p','T','e','l','e','p','h','o','n','e',0}; static const WCHAR ModifyPathW[] = {'M','o','d','i','f','y','P','a','t','h',0}; static const WCHAR NoModifyW[] = {'N','o','M','o','d','i','f','y',0}; static const WCHAR ReadmeW[] = {'R','e','a','d','m','e',0}; -static const WCHAR URLUpdateInfoW[] = {'U','R','L','U','p','d','a','t','e','I', - 'n','f','o',0}; +static const WCHAR URLUpdateInfoW[] = {'U','R','L','U','p','d','a','t','e','I','n','f','o',0}; static const WCHAR CommentsW[] = {'C','o','m','m','e','n','t','s',0}; -static const WCHAR UninstallCommandlineW[] = {'U','n','i','n','s','t','a','l','l', - 'S','t','r','i','n','g',0}; +static const WCHAR UninstallCommandlineW[] = {'U','n','i','n','s','t','a','l','l','S','t','r','i','n','g',0}; static const WCHAR WindowsInstallerW[] = {'W','i','n','d','o','w','s','I','n','s','t','a','l','l','e','r',0}; static const WCHAR SystemComponentW[] = {'S','y','s','t','e','m','C','o','m','p','o','n','e','n','t',0}; @@ -139,9 +141,27 @@ static void FreeAppInfo(APPINFO *info) HeapFree(GetProcessHeap(), 0, info->icon); HeapFree(GetProcessHeap(), 0, info->publisher); HeapFree(GetProcessHeap(), 0, info->version); + HeapFree(GetProcessHeap(), 0, info->contact); + HeapFree(GetProcessHeap(), 0, info->helplink); + HeapFree(GetProcessHeap(), 0, info->helptelephone); + HeapFree(GetProcessHeap(), 0, info->readme); + HeapFree(GetProcessHeap(), 0, info->urlupdateinfo); + HeapFree(GetProcessHeap(), 0, info->comments); HeapFree(GetProcessHeap(), 0, info); } +static WCHAR *get_reg_str(HKEY hkey, const WCHAR *value) +{ + DWORD len, type; + WCHAR *ret = NULL; + if (!RegQueryValueExW(hkey, value, NULL, &type, NULL, &len) && type == REG_SZ) + { + if (!(ret = HeapAlloc(GetProcessHeap(), 0, len))) return NULL; + RegQueryValueExW(hkey, value, 0, 0, (BYTE *)ret, &len); + } + return ret; +} + /****************************************************************************** * Name : ReadApplicationsFromRegistry * Description: Creates a linked list of uninstallable applications from the @@ -238,30 +258,14 @@ static BOOL ReadApplicationsFromRegistry(HKEY root) } } - /* publisher, version */ - if (RegQueryValueExW(hkeyApp, PublisherW, 0, 0, NULL, &displen) == - ERROR_SUCCESS) - { - info->publisher = HeapAlloc(GetProcessHeap(), 0, displen); - - if (!info->publisher) - goto err; - - RegQueryValueExW(hkeyApp, PublisherW, 0, 0, (LPBYTE)info->publisher, - &displen); - } - - if (RegQueryValueExW(hkeyApp, DisplayVersionW, 0, 0, NULL, &displen) == - ERROR_SUCCESS) - { - info->version = HeapAlloc(GetProcessHeap(), 0, displen); - - if (!info->version) - goto err; - - RegQueryValueExW(hkeyApp, DisplayVersionW, 0, 0, (LPBYTE)info->version, - &displen); - } + info->publisher = get_reg_str(hkeyApp, PublisherW); + info->version = get_reg_str(hkeyApp, DisplayVersionW); + info->contact = get_reg_str(hkeyApp, ContactW); + info->helplink = get_reg_str(hkeyApp, HelpLinkW); + info->helptelephone = get_reg_str(hkeyApp, HelpTelephoneW); + info->readme = get_reg_str(hkeyApp, ReadmeW); + info->urlupdateinfo = get_reg_str(hkeyApp, URLUpdateInfoW); + info->comments = get_reg_str(hkeyApp, CommentsW); /* Check if NoModify is set */ dwType = REG_DWORD; @@ -616,28 +620,16 @@ static INT_PTR CALLBACK SupportInfoDlgProc(HWND hWnd, UINT msg, WPARAM wParam, L RegOpenKeyExW(iter->regroot, key, 0, KEY_READ, &hkey); /* Load our "not specified" string */ - LoadStringW(hInst, IDS_NOT_SPECIFIED, notfound, - ARRAY_SIZE(notfound)); - - /* Update the data for items already read into the structure */ - SetInfoDialogText(NULL, iter->publisher, notfound, hWnd, - IDC_INFO_PUBLISHER); - SetInfoDialogText(NULL, iter->version, notfound, hWnd, - IDC_INFO_VERSION); - - /* And now update the data for those items in the registry */ - SetInfoDialogText(hkey, ContactW, notfound, hWnd, - IDC_INFO_CONTACT); - SetInfoDialogText(hkey, HelpLinkW, notfound, hWnd, - IDC_INFO_SUPPORT); - SetInfoDialogText(hkey, HelpTelephoneW, notfound, hWnd, - IDC_INFO_PHONE); - SetInfoDialogText(hkey, ReadmeW, notfound, hWnd, - IDC_INFO_README); - SetInfoDialogText(hkey, URLUpdateInfoW, notfound, hWnd, - IDC_INFO_UPDATES); - SetInfoDialogText(hkey, CommentsW, notfound, hWnd, - IDC_INFO_COMMENTS); + LoadStringW(hInst, IDS_NOT_SPECIFIED, notfound, ARRAY_SIZE(notfound)); + + SetInfoDialogText(NULL, iter->publisher, notfound, hWnd, IDC_INFO_PUBLISHER); + SetInfoDialogText(NULL, iter->version, notfound, hWnd, IDC_INFO_VERSION); + SetInfoDialogText(hkey, iter->contact, notfound, hWnd, IDC_INFO_CONTACT); + SetInfoDialogText(hkey, iter->helplink, notfound, hWnd, IDC_INFO_SUPPORT); + SetInfoDialogText(hkey, iter->helptelephone, notfound, hWnd, IDC_INFO_PHONE); + SetInfoDialogText(hkey, iter->readme, notfound, hWnd, IDC_INFO_README); + SetInfoDialogText(hkey, iter->urlupdateinfo, notfound, hWnd, IDC_INFO_UPDATES); + SetInfoDialogText(hkey, iter->comments, notfound, hWnd, IDC_INFO_COMMENTS); /* Update the main label with the app name */ if (GetWindowTextW(GetDlgItem(hWnd, IDC_INFO_LABEL), oldtitle,
1
0
0
0
Alex Henrie : msvcrt: Use isnan instead of isnanf.
by Alexandre Julliard
27 Sep '18
27 Sep '18
Module: wine Branch: master Commit: 48f108345a247ea11b8313bf7714ddb7842b3bdb URL:
https://source.winehq.org/git/wine.git/?a=commit;h=48f108345a247ea11b8313bf…
Author: Alex Henrie <alexhenrie24(a)gmail.com> Date: Tue Sep 25 21:03:02 2018 -0600 msvcrt: Use isnan instead of isnanf. This resolves several warnings when compiling with MinGW because isnanf is not in MinGW's math.h (it's not a standard C function). On the other hand, isnan is a widely available C99 macro designed for both floats and doubles. We also have an isnan implementation in libs/port/isnan.c for pre-C99 compilers. Signed-off-by: Alex Henrie <alexhenrie24(a)gmail.com> Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- configure | 1 - configure.ac | 1 - dlls/msvcrt/math.c | 30 +++++++++++------------------- include/config.h.in | 3 --- 4 files changed, 11 insertions(+), 24 deletions(-) diff --git a/configure b/configure index 657ff9a..a6e7b99 100755 --- a/configure +++ b/configure @@ -16535,7 +16535,6 @@ for ac_func in \ getpwuid \ gettimeofday \ getuid \ - isnanf \ kqueue \ lstat \ memmove \ diff --git a/configure.ac b/configure.ac index 6936a71..2cc4816 100644 --- a/configure.ac +++ b/configure.ac @@ -2163,7 +2163,6 @@ AC_CHECK_FUNCS(\ getpwuid \ gettimeofday \ getuid \ - isnanf \ kqueue \ lstat \ memmove \ diff --git a/dlls/msvcrt/math.c b/dlls/msvcrt/math.c index a1ba552..dbfaa24 100644 --- a/dlls/msvcrt/math.c +++ b/dlls/msvcrt/math.c @@ -38,14 +38,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(msvcrt); #define finitef(x) isfinite(x) #endif -#ifndef HAVE_ISNANF -#ifdef HAVE_ISNAN -#define isnanf(x) isnan(x) -#else -#define isnanf(x) 0 -#endif -#endif - /* FIXME: Does not work with -NAN and -0. */ #ifndef signbit #define signbit(x) ((x) < 0) @@ -190,7 +182,7 @@ INT CDECL MSVCRT__isnanf( float num ) /* Some implementations return -1 for true(glibc), msvcrt/crtdll return 1. * Do the same, as the result may be used in calculations */ - return isnanf(num) != 0; + return isnan(num) != 0; } /********************************************************************* @@ -199,7 +191,7 @@ INT CDECL MSVCRT__isnanf( float num ) float CDECL MSVCRT__logbf( float num ) { float ret = logbf(num); - if (isnanf(num)) math_error(_DOMAIN, "_logbf", num, 0, ret); + if (isnan(num)) math_error(_DOMAIN, "_logbf", num, 0, ret); else if (!num) math_error(_SING, "_logbf", num, 0, ret); return ret; } @@ -245,7 +237,7 @@ float CDECL MSVCRT_atanf( float x ) float CDECL MSVCRT_atan2f( float x, float y ) { float ret = atan2f(x, y); - if (isnanf(x)) math_error(_DOMAIN, "atan2f", x, y, ret); + if (isnan(x)) math_error(_DOMAIN, "atan2f", x, y, ret); return ret; } @@ -265,7 +257,7 @@ float CDECL MSVCRT_cosf( float x ) float CDECL MSVCRT_coshf( float x ) { float ret = coshf(x); - if (isnanf(x)) math_error(_DOMAIN, "coshf", x, 0, ret); + if (isnan(x)) math_error(_DOMAIN, "coshf", x, 0, ret); return ret; } @@ -275,7 +267,7 @@ float CDECL MSVCRT_coshf( float x ) float CDECL MSVCRT_expf( float x ) { float ret = expf(x); - if (isnanf(x)) math_error(_DOMAIN, "expf", x, 0, ret); + if (isnan(x)) math_error(_DOMAIN, "expf", x, 0, ret); else if (finitef(x) && !ret) math_error(_UNDERFLOW, "expf", x, 0, ret); else if (finitef(x) && !finitef(ret)) math_error(_OVERFLOW, "expf", x, 0, ret); return ret; @@ -342,7 +334,7 @@ float CDECL MSVCRT_sinf( float x ) float CDECL MSVCRT_sinhf( float x ) { float ret = sinhf(x); - if (isnanf(x)) math_error(_DOMAIN, "sinhf", x, 0, ret); + if (isnan(x)) math_error(_DOMAIN, "sinhf", x, 0, ret); return ret; } @@ -2943,9 +2935,9 @@ LDOUBLE CDECL MSVCR120_erfcl(LDOUBLE x) */ float CDECL MSVCR120_fmaxf(float x, float y) { - if(isnanf(x)) + if(isnan(x)) return y; - if(isnanf(y)) + if(isnan(y)) return x; if(x==0 && y==0) return signbit(x) ? y : x; @@ -3008,9 +3000,9 @@ int CDECL MSVCR120__fdpcomp(float x, float y) */ float CDECL MSVCR120_fminf(float x, float y) { - if(isnanf(x)) + if(isnan(x)) return y; - if(isnanf(y)) + if(isnan(y)) return x; if(x==0 && y==0) return signbit(x) ? x : y; @@ -3232,7 +3224,7 @@ float CDECL MSVCR120_remainderf(float x, float y) #ifdef HAVE_REMAINDERF /* this matches 64-bit Windows. 32-bit Windows is slightly different */ if(!finitef(x)) *MSVCRT__errno() = MSVCRT_EDOM; - if(isnanf(y) || y==0.0f) *MSVCRT__errno() = MSVCRT_EDOM; + if(isnan(y) || y==0.0f) *MSVCRT__errno() = MSVCRT_EDOM; return remainderf(x, y); #else FIXME( "not implemented\n" ); diff --git a/include/config.h.in b/include/config.h.in index b42de29..c5a3cb4 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -339,9 +339,6 @@ /* Define to 1 if you have the `isnan' function. */ #undef HAVE_ISNAN -/* Define to 1 if you have the `isnanf' function. */ -#undef HAVE_ISNANF - /* Define to 1 if you have the `j0' function. */ #undef HAVE_J0
1
0
0
0
Piotr Caban : ole32: Add more IStorage clipboard tests.
by Alexandre Julliard
27 Sep '18
27 Sep '18
Module: wine Branch: master Commit: f9beb7ff1044ce33e81c41de81f1afb5e7023229 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=f9beb7ff1044ce33e81c41de…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Wed Sep 26 14:52:43 2018 +0200 ole32: Add more IStorage clipboard tests. Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ole32/tests/clipboard.c | 90 +++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 84 insertions(+), 6 deletions(-) diff --git a/dlls/ole32/tests/clipboard.c b/dlls/ole32/tests/clipboard.c index f5ad98e..d43bbf3 100644 --- a/dlls/ole32/tests/clipboard.c +++ b/dlls/ole32/tests/clipboard.c @@ -412,16 +412,14 @@ static const IDataObjectVtbl VT_DataObjectImpl = DataObjectImpl_EnumDAdvise }; -static HRESULT DataObjectImpl_CreateText(LPCSTR text, LPDATAOBJECT *lplpdataobj) +static HRESULT DataObjectImpl_CreateFromHGlobal(HGLOBAL text, LPDATAOBJECT *dataobj) { DataObjectImpl *obj; obj = HeapAlloc(GetProcessHeap(), 0, sizeof(DataObjectImpl)); obj->IDataObject_iface.lpVtbl = &VT_DataObjectImpl; obj->ref = 1; - obj->text = GlobalAlloc(GMEM_MOVEABLE, strlen(text) + 1); - strcpy(GlobalLock(obj->text), text); - GlobalUnlock(obj->text); + obj->text = text; obj->stm = NULL; obj->stg = NULL; obj->hmfp = NULL; @@ -430,10 +428,18 @@ static HRESULT DataObjectImpl_CreateText(LPCSTR text, LPDATAOBJECT *lplpdataobj) obj->fmtetc = HeapAlloc(GetProcessHeap(), 0, obj->fmtetc_cnt*sizeof(FORMATETC)); InitFormatEtc(obj->fmtetc[0], CF_TEXT, TYMED_HGLOBAL); - *lplpdataobj = &obj->IDataObject_iface; + *dataobj = &obj->IDataObject_iface; return S_OK; } +static HRESULT DataObjectImpl_CreateText(LPCSTR text, LPDATAOBJECT *lplpdataobj) +{ + HGLOBAL h = GlobalAlloc(GMEM_MOVEABLE, strlen(text) + 1); + strcpy(GlobalLock(h), text); + GlobalUnlock(h); + return DataObjectImpl_CreateFromHGlobal(h, lplpdataobj); +} + static const char *cmpl_stm_data = "complex stream"; static const char *cmpl_text_data = "complex text"; static const WCHAR device_name[] = {'m','y','d','e','v',0}; @@ -1278,6 +1284,24 @@ static void test_consumer_refs(void) IDataObject_Release(src); } +static HGLOBAL create_storage(void) +{ + ILockBytes *ilb; + IStorage *stg; + HGLOBAL hg; + HRESULT hr; + + hr = CreateILockBytesOnHGlobal(NULL, FALSE, &ilb); + ok(hr == S_OK, "got %08x\n", hr); + hr = StgCreateDocfileOnILockBytes(ilb, STGM_CREATE|STGM_SHARE_EXCLUSIVE|STGM_READWRITE, 0, &stg); + ok(hr == S_OK, "got %08x\n", hr); + IStorage_Release(stg); + hr = GetHGlobalFromILockBytes(ilb, &hg); + ok(hr == S_OK, "got %08x\n", hr); + ILockBytes_Release(ilb); + return hg; +} + static void test_flushed_getdata(void) { HRESULT hr; @@ -1427,6 +1451,43 @@ static void test_flushed_getdata(void) IDataObject_Release(get); IDataObject_Release(src); + + hr = DataObjectImpl_CreateFromHGlobal(create_storage(), &src); + ok(hr == S_OK, "got %08x\n", hr); + + hr = OleSetClipboard(src); + ok(hr == S_OK, "got %08x\n", hr); + + hr = OleGetClipboard(&get); + ok(hr == S_OK, "got %08x\n", hr); + InitFormatEtc(fmt, CF_TEXT, TYMED_ISTORAGE); + hr = IDataObject_GetData(get, &fmt, &med); + ok(hr == S_OK, "got %08x\n", hr); + ok(med.tymed == TYMED_ISTORAGE, "got %x\n", med.tymed); + if(SUCCEEDED(hr)) ReleaseStgMedium(&med); + IDataObject_Release(get); + + hr = OleFlushClipboard(); + ok(hr == S_OK, "got %08x\n", hr); + + hr = OleGetClipboard(&get); + ok(hr == S_OK, "got %08x\n", hr); + + InitFormatEtc(fmt, CF_TEXT, TYMED_ISTORAGE); + hr = IDataObject_GetData(get, &fmt, &med); + ok(hr == S_OK, "got %08x\n", hr); + ok(med.tymed == TYMED_ISTORAGE, "got %x\n", med.tymed); + if(SUCCEEDED(hr)) ReleaseStgMedium(&med); + + InitFormatEtc(fmt, CF_TEXT, 0xffff); + hr = IDataObject_GetData(get, &fmt, &med); + ok(hr == S_OK, "got %08x\n", hr); + ok(med.tymed == TYMED_HGLOBAL, "got %x\n", med.tymed); + if(SUCCEEDED(hr)) ReleaseStgMedium(&med); + + IDataObject_Release(get); + IDataObject_Release(src); + OleUninitialize(); } @@ -1454,7 +1515,7 @@ static void test_nonole_clipboard(void) IDataObject *get; IEnumFORMATETC *enum_fmt; FORMATETC fmt; - HGLOBAL h, hblob, htext; + HGLOBAL h, hblob, htext, hstorage; HENHMETAFILE emf; STGMEDIUM med; DWORD obj_type; @@ -1485,6 +1546,7 @@ static void test_nonole_clipboard(void) htext = create_text(); hblob = GlobalAlloc(GMEM_DDESHARE|GMEM_MOVEABLE|GMEM_ZEROINIT, 10); emf = create_emf(); + hstorage = create_storage(); r = OpenClipboard(NULL); ok(r, "gle %d\n", GetLastError()); @@ -1494,6 +1556,8 @@ static void test_nonole_clipboard(void) ok(h == hblob, "got %p\n", h); h = SetClipboardData(CF_ENHMETAFILE, emf); ok(h == emf, "got %p\n", h); + h = SetClipboardData(cf_storage, hstorage); + ok(h == hstorage, "got %p\n", h); r = CloseClipboard(); ok(r, "gle %d\n", GetLastError()); @@ -1532,6 +1596,14 @@ static void test_nonole_clipboard(void) ok(fmt.tymed == TYMED_ENHMF, "tymed %x\n", fmt.tymed); hr = IEnumFORMATETC_Next(enum_fmt, 1, &fmt, NULL); + ok(hr == S_OK, "got %08x\n", hr); + ok(fmt.cfFormat == cf_storage, "cf %04x\n", fmt.cfFormat); + ok(fmt.ptd == NULL, "ptd %p\n", fmt.ptd); + ok(fmt.dwAspect == DVASPECT_CONTENT, "aspect %x\n", fmt.dwAspect); + ok(fmt.lindex == -1, "lindex %d\n", fmt.lindex); + ok(fmt.tymed == (TYMED_ISTREAM | TYMED_HGLOBAL), "tymed %x\n", fmt.tymed); + + hr = IEnumFORMATETC_Next(enum_fmt, 1, &fmt, NULL); ok(hr == S_OK, "got %08x\n", hr); /* User32 adds some synthesised formats */ ok(fmt.cfFormat == CF_LOCALE, "cf %04x\n", fmt.cfFormat); @@ -1576,6 +1648,12 @@ static void test_nonole_clipboard(void) ok(obj_type == OBJ_ENHMETAFILE, "got %d\n", obj_type); if(SUCCEEDED(hr)) ReleaseStgMedium(&med); + InitFormatEtc(fmt, cf_storage, TYMED_ISTORAGE); + hr = IDataObject_GetData(get, &fmt, &med); + ok(hr == S_OK, "got %08x\n", hr); + ok(med.tymed == TYMED_ISTORAGE, "got %x\n", med.tymed); + if(SUCCEEDED(hr)) ReleaseStgMedium(&med); + IDataObject_Release(get); r = OpenClipboard(NULL);
1
0
0
0
Piotr Caban : ole32: Improve OleClipboardData GetData implementation.
by Alexandre Julliard
27 Sep '18
27 Sep '18
Module: wine Branch: master Commit: 01c6002a490d986b6959f2f62aeef488877dd48b URL:
https://source.winehq.org/git/wine.git/?a=commit;h=01c6002a490d986b6959f2f6…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Wed Sep 26 14:52:39 2018 +0200 ole32: Improve OleClipboardData GetData implementation. Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ole32/clipboard.c | 47 +++++++++++++++++++++++++++++++++++--------- dlls/ole32/tests/clipboard.c | 14 ++++++------- 2 files changed, 45 insertions(+), 16 deletions(-) diff --git a/dlls/ole32/clipboard.c b/dlls/ole32/clipboard.c index cb005d3..7ee611f 100644 --- a/dlls/ole32/clipboard.c +++ b/dlls/ole32/clipboard.c @@ -1296,6 +1296,14 @@ static HRESULT get_stgmed_for_storage(HGLOBAL h, STGMEDIUM *med) return hr; } + hr = StgIsStorageILockBytes(lbs); + if(hr!=S_OK) + { + ILockBytes_Release(lbs); + GlobalFree(dst); + return SUCCEEDED(hr) ? E_FAIL : hr; + } + hr = StgOpenStorageOnILockBytes(lbs, NULL, STGM_SHARE_EXCLUSIVE | STGM_READWRITE, NULL, 0, &med->u.pstg); ILockBytes_Release(lbs); if(FAILED(hr)) @@ -1402,12 +1410,19 @@ static HRESULT WINAPI snapshot_GetData(IDataObject *iface, FORMATETC *fmt, if(This->data) { hr = IDataObject_GetData(This->data, fmt, med); - CloseClipboard(); - return hr; + if(SUCCEEDED(hr)) + { + CloseClipboard(); + return hr; + } + } + if(fmt->lindex != -1) + { + hr = DV_E_FORMATETC; + goto end; } - h = GetClipboardData(fmt->cfFormat); - if(!h) + if(!IsClipboardFormatAvailable(fmt->cfFormat)) { hr = DV_E_FORMATETC; goto end; @@ -1425,17 +1440,31 @@ static HRESULT WINAPI snapshot_GetData(IDataObject *iface, FORMATETC *fmt, goto end; } mask = fmt->tymed & entry->fmtetc.tymed; - if(!mask) mask = fmt->tymed & (TYMED_ISTREAM | TYMED_HGLOBAL); + if(!mask && (entry->fmtetc.tymed & (TYMED_ISTREAM | TYMED_HGLOBAL | TYMED_ISTORAGE))) + mask = fmt->tymed & (TYMED_ISTREAM | TYMED_HGLOBAL | TYMED_ISTORAGE); } else /* non-Ole format */ - mask = fmt->tymed & TYMED_HGLOBAL; + mask = fmt->tymed & get_tymed_from_nonole_cf(fmt->cfFormat); - if(mask & TYMED_ISTORAGE) - hr = get_stgmed_for_storage(h, med); - else if(mask & TYMED_HGLOBAL) + if(!mask) + { + hr = DV_E_TYMED; + goto end; + } + + h = GetClipboardData(fmt->cfFormat); + if(!h) + { + hr = DV_E_FORMATETC; + goto end; + } + + if(mask & TYMED_HGLOBAL) hr = get_stgmed_for_global(h, med); else if(mask & TYMED_ISTREAM) hr = get_stgmed_for_stream(h, med); + else if(mask & TYMED_ISTORAGE) + hr = get_stgmed_for_storage(h, med); else if(mask & TYMED_ENHMF) hr = get_stgmed_for_emf((HENHMETAFILE)h, med); else if(mask & TYMED_GDI) diff --git a/dlls/ole32/tests/clipboard.c b/dlls/ole32/tests/clipboard.c index dc3ce5a..f5ad98e 100644 --- a/dlls/ole32/tests/clipboard.c +++ b/dlls/ole32/tests/clipboard.c @@ -586,12 +586,12 @@ static void test_get_clipboard(void) InitFormatEtc(fmtetc, CF_RIFF, TYMED_HGLOBAL); hr = IDataObject_GetData(data_obj, &fmtetc, &stgmedium); - todo_wine ok(hr == DV_E_FORMATETC, "IDataObject_GetData should have failed with DV_E_FORMATETC instead of 0x%08x\n", hr); + ok(hr == DV_E_FORMATETC, "IDataObject_GetData should have failed with DV_E_FORMATETC instead of 0x%08x\n", hr); if(SUCCEEDED(hr)) ReleaseStgMedium(&stgmedium); InitFormatEtc(fmtetc, CF_TEXT, TYMED_FILE); hr = IDataObject_GetData(data_obj, &fmtetc, &stgmedium); - todo_wine ok(hr == DV_E_TYMED, "IDataObject_GetData should have failed with DV_E_TYMED instead of 0x%08x\n", hr); + ok(hr == DV_E_TYMED, "IDataObject_GetData should have failed with DV_E_TYMED instead of 0x%08x\n", hr); if(SUCCEEDED(hr)) ReleaseStgMedium(&stgmedium); ok(DataObjectImpl_GetData_calls == 6, "DataObjectImpl_GetData should have been called 6 times instead of %d times\n", DataObjectImpl_GetData_calls); @@ -878,20 +878,20 @@ static void test_complex_get_clipboard(void) InitFormatEtc(fmtetc, CF_METAFILEPICT, TYMED_HGLOBAL); hr = IDataObject_GetData(data_obj, &fmtetc, &stgmedium); - todo_wine ok(hr == DV_E_TYMED, "IDataObject_GetData failed with error 0x%08x\n", hr); + ok(hr == DV_E_TYMED, "IDataObject_GetData failed with error 0x%08x\n", hr); if(SUCCEEDED(hr)) ReleaseStgMedium(&stgmedium); InitFormatEtc(fmtetc, CF_ENHMETAFILE, TYMED_HGLOBAL); hr = IDataObject_GetData(data_obj, &fmtetc, &stgmedium); - todo_wine ok(hr == DV_E_TYMED, "IDataObject_GetData failed with error 0x%08x\n", hr); + ok(hr == DV_E_TYMED, "IDataObject_GetData failed with error 0x%08x\n", hr); if(SUCCEEDED(hr)) ReleaseStgMedium(&stgmedium); InitFormatEtc(fmtetc, CF_ENHMETAFILE, TYMED_ENHMF); hr = IDataObject_GetData(data_obj, &fmtetc, &stgmedium); - todo_wine ok(hr == S_OK, "IDataObject_GetData failed with error 0x%08x\n", hr); + ok(hr == S_OK, "IDataObject_GetData failed with error 0x%08x\n", hr); if(SUCCEEDED(hr)) ReleaseStgMedium(&stgmedium); - todo_wine ok(DataObjectImpl_GetData_calls == 5, + ok(DataObjectImpl_GetData_calls == 5, "DataObjectImpl_GetData called 5 times instead of %d times\n", DataObjectImpl_GetData_calls); IDataObject_Release(data_obj); @@ -1422,7 +1422,7 @@ static void test_flushed_getdata(void) /* CF_ENHMETAFILE format */ InitFormatEtc(fmt, CF_ENHMETAFILE, TYMED_ENHMF); hr = IDataObject_GetData(get, &fmt, &med); - todo_wine ok(hr == S_OK, "got %08x\n", hr); + ok(hr == S_OK, "got %08x\n", hr); if(SUCCEEDED(hr)) ReleaseStgMedium(&med); IDataObject_Release(get);
1
0
0
0
Piotr Caban : ole32: Change DataObjectImpl_GetData return value to show more implementation problems.
by Alexandre Julliard
27 Sep '18
27 Sep '18
Module: wine Branch: master Commit: 0196eee8a884f8293da250d1bfb418a69527ea2a URL:
https://source.winehq.org/git/wine.git/?a=commit;h=0196eee8a884f8293da250d1…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Wed Sep 26 14:52:35 2018 +0200 ole32: Change DataObjectImpl_GetData return value to show more implementation problems. Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ole32/tests/clipboard.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/dlls/ole32/tests/clipboard.c b/dlls/ole32/tests/clipboard.c index ee8bbe9..dc3ce5a 100644 --- a/dlls/ole32/tests/clipboard.c +++ b/dlls/ole32/tests/clipboard.c @@ -267,7 +267,6 @@ static HRESULT WINAPI DataObjectImpl_GetData(IDataObject* iface, FORMATETC *pfor { DataObjectImpl *This = impl_from_IDataObject(iface); UINT i; - BOOL foundFormat = FALSE; trace("getdata: %s\n", dump_fmtetc(pformatetc)); @@ -284,7 +283,6 @@ static HRESULT WINAPI DataObjectImpl_GetData(IDataObject* iface, FORMATETC *pfor { if(This->fmtetc[i].cfFormat == pformatetc->cfFormat) { - foundFormat = TRUE; if(This->fmtetc[i].tymed & pformatetc->tymed) { pmedium->pUnkForRelease = (LPUNKNOWN)iface; @@ -317,7 +315,7 @@ static HRESULT WINAPI DataObjectImpl_GetData(IDataObject* iface, FORMATETC *pfor } } - return foundFormat ? DV_E_TYMED : DV_E_FORMATETC; + return E_FAIL; } static HRESULT WINAPI DataObjectImpl_GetDataHere(IDataObject* iface, FORMATETC *pformatetc, STGMEDIUM *pmedium) @@ -588,12 +586,12 @@ static void test_get_clipboard(void) InitFormatEtc(fmtetc, CF_RIFF, TYMED_HGLOBAL); hr = IDataObject_GetData(data_obj, &fmtetc, &stgmedium); - ok(hr == DV_E_FORMATETC, "IDataObject_GetData should have failed with DV_E_FORMATETC instead of 0x%08x\n", hr); + todo_wine ok(hr == DV_E_FORMATETC, "IDataObject_GetData should have failed with DV_E_FORMATETC instead of 0x%08x\n", hr); if(SUCCEEDED(hr)) ReleaseStgMedium(&stgmedium); InitFormatEtc(fmtetc, CF_TEXT, TYMED_FILE); hr = IDataObject_GetData(data_obj, &fmtetc, &stgmedium); - ok(hr == DV_E_TYMED, "IDataObject_GetData should have failed with DV_E_TYMED instead of 0x%08x\n", hr); + todo_wine ok(hr == DV_E_TYMED, "IDataObject_GetData should have failed with DV_E_TYMED instead of 0x%08x\n", hr); if(SUCCEEDED(hr)) ReleaseStgMedium(&stgmedium); ok(DataObjectImpl_GetData_calls == 6, "DataObjectImpl_GetData should have been called 6 times instead of %d times\n", DataObjectImpl_GetData_calls); @@ -880,7 +878,7 @@ static void test_complex_get_clipboard(void) InitFormatEtc(fmtetc, CF_METAFILEPICT, TYMED_HGLOBAL); hr = IDataObject_GetData(data_obj, &fmtetc, &stgmedium); - ok(hr == DV_E_TYMED, "IDataObject_GetData failed with error 0x%08x\n", hr); + todo_wine ok(hr == DV_E_TYMED, "IDataObject_GetData failed with error 0x%08x\n", hr); if(SUCCEEDED(hr)) ReleaseStgMedium(&stgmedium); InitFormatEtc(fmtetc, CF_ENHMETAFILE, TYMED_HGLOBAL);
1
0
0
0
Piotr Caban : ole32: Add IDataObject_GetData tests on synthesized format.
by Alexandre Julliard
27 Sep '18
27 Sep '18
Module: wine Branch: master Commit: b8c7b3310667c32735e449eb8111d15244e01d58 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=b8c7b3310667c32735e449eb…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Wed Sep 26 14:52:31 2018 +0200 ole32: Add IDataObject_GetData tests on synthesized format. Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ole32/tests/clipboard.c | 82 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 81 insertions(+), 1 deletion(-) diff --git a/dlls/ole32/tests/clipboard.c b/dlls/ole32/tests/clipboard.c index 7aeaa20..ee8bbe9 100644 --- a/dlls/ole32/tests/clipboard.c +++ b/dlls/ole32/tests/clipboard.c @@ -59,6 +59,7 @@ typedef struct DataObjectImpl { HANDLE text; IStream *stm; IStorage *stg; + HMETAFILEPICT hmfp; } DataObjectImpl; typedef struct EnumFormatImpl { @@ -80,6 +81,26 @@ static UINT cf_stream, cf_storage, cf_global, cf_another, cf_onemore; static HRESULT EnumFormatImpl_Create(FORMATETC *fmtetc, UINT size, LPENUMFORMATETC *lplpformatetc); +static HMETAFILE create_mf(void) +{ + RECT rect = {0, 0, 100, 100}; + HDC hdc = CreateMetaFileA(NULL); + ExtTextOutA(hdc, 0, 0, ETO_OPAQUE, &rect, "Test String", strlen("Test String"), NULL); + return CloseMetaFile(hdc); +} + +static HMETAFILEPICT create_metafilepict(void) +{ + HGLOBAL ret = GlobalAlloc(GMEM_MOVEABLE, sizeof(METAFILEPICT)); + METAFILEPICT *mf = GlobalLock(ret); + mf->mm = MM_ANISOTROPIC; + mf->xExt = 100; + mf->yExt = 200; + mf->hMF = create_mf(); + GlobalUnlock(ret); + return ret; +} + static inline DataObjectImpl *impl_from_IDataObject(IDataObject *iface) { return CONTAINING_RECORD(iface, DataObjectImpl, IDataObject_iface); @@ -230,6 +251,12 @@ static ULONG WINAPI DataObjectImpl_Release(IDataObject* iface) HeapFree(GetProcessHeap(), 0, This->fmtetc); if(This->stm) IStream_Release(This->stm); if(This->stg) IStorage_Release(This->stg); + if(This->hmfp) { + METAFILEPICT *mfp = GlobalLock(This->hmfp); + DeleteMetaFile(mfp->hMF); + GlobalUnlock(This->hmfp); + GlobalFree(This->hmfp); + } HeapFree(GetProcessHeap(), 0, This); } @@ -280,6 +307,11 @@ static HRESULT WINAPI DataObjectImpl_GetData(IDataObject* iface, FORMATETC *pfor IStorage_AddRef(This->stg); U(*pmedium).pstg = This->stg; } + else if(pformatetc->cfFormat == CF_METAFILEPICT) + { + pmedium->tymed = TYMED_MFPICT; + U(*pmedium).hMetaFilePict = This->hmfp; + } return S_OK; } } @@ -394,6 +426,7 @@ static HRESULT DataObjectImpl_CreateText(LPCSTR text, LPDATAOBJECT *lplpdataobj) GlobalUnlock(obj->text); obj->stm = NULL; obj->stg = NULL; + obj->hmfp = NULL; obj->fmtetc_cnt = 1; obj->fmtetc = HeapAlloc(GetProcessHeap(), 0, obj->fmtetc_cnt*sizeof(FORMATETC)); @@ -426,7 +459,9 @@ static HRESULT DataObjectImpl_CreateComplex(LPDATAOBJECT *lplpdataobj) StgCreateDocfileOnILockBytes(lbs, STGM_CREATE|STGM_SHARE_EXCLUSIVE|STGM_READWRITE, 0, &obj->stg); ILockBytes_Release(lbs); - obj->fmtetc_cnt = 8; + obj->hmfp = create_metafilepict(); + + obj->fmtetc_cnt = 9; /* zeroing here since FORMATETC has a hole in it, and it's confusing to have this uninitialised. */ obj->fmtetc = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, obj->fmtetc_cnt*sizeof(FORMATETC)); InitFormatEtc(obj->fmtetc[0], CF_TEXT, TYMED_HGLOBAL); @@ -454,6 +489,7 @@ static HRESULT DataObjectImpl_CreateComplex(LPDATAOBJECT *lplpdataobj) InitFormatEtc(obj->fmtetc[6], cf_another, 0xfffff); InitFormatEtc(obj->fmtetc[7], cf_another, 0xfffff); obj->fmtetc[7].dwAspect = DVASPECT_ICON; + InitFormatEtc(obj->fmtetc[8], CF_METAFILEPICT, TYMED_MFPICT); *lplpdataobj = &obj->IDataObject_iface; return S_OK; @@ -825,6 +861,44 @@ static void test_cf_dataobject(IDataObject *data) ok(found_priv_data, "didn't find cf_ole_priv_data\n"); } +static void test_complex_get_clipboard(void) +{ + HRESULT hr; + IDataObject *data_obj; + FORMATETC fmtetc; + STGMEDIUM stgmedium; + + hr = OleGetClipboard(&data_obj); + ok(hr == S_OK, "OleGetClipboard failed with error 0x%08x\n", hr); + + DataObjectImpl_GetData_calls = 0; + + InitFormatEtc(fmtetc, CF_METAFILEPICT, TYMED_MFPICT); + hr = IDataObject_GetData(data_obj, &fmtetc, &stgmedium); + ok(hr == S_OK, "IDataObject_GetData failed with error 0x%08x\n", hr); + if(SUCCEEDED(hr)) ReleaseStgMedium(&stgmedium); + + InitFormatEtc(fmtetc, CF_METAFILEPICT, TYMED_HGLOBAL); + hr = IDataObject_GetData(data_obj, &fmtetc, &stgmedium); + ok(hr == DV_E_TYMED, "IDataObject_GetData failed with error 0x%08x\n", hr); + if(SUCCEEDED(hr)) ReleaseStgMedium(&stgmedium); + + InitFormatEtc(fmtetc, CF_ENHMETAFILE, TYMED_HGLOBAL); + hr = IDataObject_GetData(data_obj, &fmtetc, &stgmedium); + todo_wine ok(hr == DV_E_TYMED, "IDataObject_GetData failed with error 0x%08x\n", hr); + if(SUCCEEDED(hr)) ReleaseStgMedium(&stgmedium); + + InitFormatEtc(fmtetc, CF_ENHMETAFILE, TYMED_ENHMF); + hr = IDataObject_GetData(data_obj, &fmtetc, &stgmedium); + todo_wine ok(hr == S_OK, "IDataObject_GetData failed with error 0x%08x\n", hr); + if(SUCCEEDED(hr)) ReleaseStgMedium(&stgmedium); + + todo_wine ok(DataObjectImpl_GetData_calls == 5, + "DataObjectImpl_GetData called 5 times instead of %d times\n", + DataObjectImpl_GetData_calls); + IDataObject_Release(data_obj); +} + static void test_set_clipboard(void) { HRESULT hr; @@ -932,6 +1006,7 @@ static void test_set_clipboard(void) trace("setting complex\n"); hr = OleSetClipboard(data_cmpl); ok(hr == S_OK, "failed to set clipboard to complex data, hr = 0x%08x\n", hr); + test_complex_get_clipboard(); test_cf_dataobject(data_cmpl); test_enum_fmtetc(data_cmpl); @@ -1346,6 +1421,11 @@ static void test_flushed_getdata(void) HeapFree(GetProcessHeap(), 0, fmt.ptd); } + /* CF_ENHMETAFILE format */ + InitFormatEtc(fmt, CF_ENHMETAFILE, TYMED_ENHMF); + hr = IDataObject_GetData(get, &fmt, &med); + todo_wine ok(hr == S_OK, "got %08x\n", hr); + if(SUCCEEDED(hr)) ReleaseStgMedium(&med); IDataObject_Release(get); IDataObject_Release(src);
1
0
0
0
← Newer
1
2
3
4
5
6
7
8
...
67
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
Results per page:
10
25
50
100
200