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
June 2011
----- 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
809 discussions
Start a n
N
ew thread
Piotr Caban : comctl32: Fix listview horizontal scrolling.
by Alexandre Julliard
07 Jun '11
07 Jun '11
Module: wine Branch: master Commit: b2cb04b4e6b9dc4901545ecb9ecae8f885cb7b99 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b2cb04b4e6b9dc4901545ecb9…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Mon Jun 6 21:45:25 2011 +0200 comctl32: Fix listview horizontal scrolling. --- dlls/comctl32/listview.c | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c index 2f20f8e..6c7e26e 100644 --- a/dlls/comctl32/listview.c +++ b/dlls/comctl32/listview.c @@ -9608,6 +9608,7 @@ static LRESULT LISTVIEW_HScroll(LISTVIEW_INFO *infoPtr, INT nScrollCode, { INT nOldScrollPos, nNewScrollPos; SCROLLINFO scrollInfo; + BOOL is_an_icon; TRACE("(nScrollCode=%d(%s), nScrollDiff=%d)\n", nScrollCode, debugscrollcode(nScrollCode), nScrollDiff); @@ -9617,6 +9618,8 @@ static LRESULT LISTVIEW_HScroll(LISTVIEW_INFO *infoPtr, INT nScrollCode, scrollInfo.cbSize = sizeof(SCROLLINFO); scrollInfo.fMask = SIF_PAGE | SIF_POS | SIF_RANGE | SIF_TRACKPOS; + is_an_icon = ((infoPtr->uView == LV_VIEW_ICON) || (infoPtr->uView == LV_VIEW_SMALLICON)); + if (!GetScrollInfo(infoPtr->hwndSelf, SB_HORZ, &scrollInfo)) return 1; nOldScrollPos = scrollInfo.nPos; @@ -9627,11 +9630,11 @@ static LRESULT LISTVIEW_HScroll(LISTVIEW_INFO *infoPtr, INT nScrollCode, break; case SB_LINELEFT: - nScrollDiff = -1; + nScrollDiff = (is_an_icon) ? -LISTVIEW_SCROLL_ICON_LINE_SIZE : -1; break; case SB_LINERIGHT: - nScrollDiff = 1; + nScrollDiff = (is_an_icon) ? LISTVIEW_SCROLL_ICON_LINE_SIZE : 1; break; case SB_PAGELEFT:
1
0
0
0
Piotr Caban : comctl32: Improve LISTVIEW_MarqueeHighlight performance.
by Alexandre Julliard
07 Jun '11
07 Jun '11
Module: wine Branch: master Commit: a87e726d6b2a7ec4b86cb01a3267237fb366427b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a87e726d6b2a7ec4b86cb01a3…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Mon Jun 6 20:52:34 2011 +0200 comctl32: Improve LISTVIEW_MarqueeHighlight performance. --- dlls/comctl32/listview.c | 74 +++++++++++++++++++++++++++++++++------------- 1 files changed, 53 insertions(+), 21 deletions(-) diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c index 86c3f76..2f20f8e 100644 --- a/dlls/comctl32/listview.c +++ b/dlls/comctl32/listview.c @@ -1497,6 +1497,37 @@ static BOOL iterator_visibleitems(ITERATOR *i, const LISTVIEW_INFO *infoPtr, HDC return TRUE; } +/* Remove common elements from two iterators */ +/* Passed iterators have to point on the first elements */ +static BOOL iterator_remove_common_items(ITERATOR *iter1, ITERATOR *iter2) +{ + iterator_next(iter1); + iterator_next(iter2); + + while(1) { + if(iter1->nItem==-1 || iter2->nItem==-1) + break; + + if(iter1->nItem == iter2->nItem) { + int delete = iter1->nItem; + + iterator_prev(iter1); + iterator_prev(iter2); + ranges_delitem(iter1->ranges, delete); + ranges_delitem(iter2->ranges, delete); + iterator_next(iter1); + iterator_next(iter2); + } else if(iter1->nItem > iter2->nItem) + iterator_next(iter2); + else + iterator_next(iter1); + } + + iter1->nItem = iter1->range.lower = iter1->range.upper = -1; + iter2->nItem = iter2->range.lower = iter2->range.upper = -1; + return TRUE; +} + /******** Misc helper functions ************************************/ static inline LRESULT CallWindowProcT(WNDPROC proc, HWND hwnd, UINT uMsg, @@ -3733,7 +3764,7 @@ static void LISTVIEW_MarqueeHighlight(LISTVIEW_INFO *infoPtr, const POINT *coord { BOOL controlDown = FALSE; LVITEMW item; - ITERATOR i; + ITERATOR old_elems, new_elems; RECT rect; if (coords_offs->x > infoPtr->marqueeOrigin.x) @@ -3776,54 +3807,55 @@ static void LISTVIEW_MarqueeHighlight(LISTVIEW_INFO *infoPtr, const POINT *coord if ((scroll & SCROLL_DOWN) && (coords_orig->y >= infoPtr->rcList.bottom)) LISTVIEW_Scroll(infoPtr, 0, (coords_orig->y - infoPtr->rcList.bottom)); - /* Invert the items in the old marquee rectangle */ - iterator_frameditems_absolute(&i, infoPtr, &infoPtr->marqueeRect); + iterator_frameditems_absolute(&old_elems, infoPtr, &infoPtr->marqueeRect); + + CopyRect(&infoPtr->marqueeRect, &rect); - while (iterator_next(&i)) + CopyRect(&infoPtr->marqueeDrawRect, &rect); + OffsetRect(&infoPtr->marqueeDrawRect, offset->x, offset->y); + + iterator_frameditems_absolute(&new_elems, infoPtr, &infoPtr->marqueeRect); + iterator_remove_common_items(&old_elems, &new_elems); + + /* Iterate over no longer selected items */ + while (iterator_next(&old_elems)) { - if (i.nItem > -1) + if (old_elems.nItem > -1) { - if (LISTVIEW_GetItemState(infoPtr, i.nItem, LVIS_SELECTED) == LVIS_SELECTED) + if (LISTVIEW_GetItemState(infoPtr, old_elems.nItem, LVIS_SELECTED) == LVIS_SELECTED) item.state = 0; else item.state = LVIS_SELECTED; item.stateMask = LVIS_SELECTED; - LISTVIEW_SetItemState(infoPtr, i.nItem, &item); + LISTVIEW_SetItemState(infoPtr, old_elems.nItem, &item); } } + iterator_destroy(&old_elems); - iterator_destroy(&i); - - CopyRect(&infoPtr->marqueeRect, &rect); - - CopyRect(&infoPtr->marqueeDrawRect, &rect); - OffsetRect(&infoPtr->marqueeDrawRect, offset->x, offset->y); - - /* Iterate over the items within our marquee rectangle */ - iterator_frameditems_absolute(&i, infoPtr, &infoPtr->marqueeRect); + /* Iterate over newly selected items */ if (GetKeyState(VK_CONTROL) & 0x8000) controlDown = TRUE; - while (iterator_next(&i)) + while (iterator_next(&new_elems)) { - if (i.nItem > -1) + if (new_elems.nItem > -1) { /* If CTRL is pressed, invert. If not, always select the item. */ - if ((controlDown) && (LISTVIEW_GetItemState(infoPtr, i.nItem, LVIS_SELECTED))) + if ((controlDown) && (LISTVIEW_GetItemState(infoPtr, new_elems.nItem, LVIS_SELECTED))) item.state = 0; else item.state = LVIS_SELECTED; item.stateMask = LVIS_SELECTED; - LISTVIEW_SetItemState(infoPtr, i.nItem, &item); + LISTVIEW_SetItemState(infoPtr, new_elems.nItem, &item); } } + iterator_destroy(&new_elems); - iterator_destroy(&i); LISTVIEW_InvalidateRect(infoPtr, &rect); }
1
0
0
0
Alexandre Julliard : widl: Add support for generating new-style interpreted stubs for proxies.
by Alexandre Julliard
07 Jun '11
07 Jun '11
Module: wine Branch: master Commit: 609602cb38c089a27b4edd0775d153f3e2138601 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=609602cb38c089a27b4edd077…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Jun 7 13:00:51 2011 +0200 widl: Add support for generating new-style interpreted stubs for proxies. --- tools/widl/proxy.c | 59 ++++++++++++++++++++++++++++++++++++++++----------- 1 files changed, 46 insertions(+), 13 deletions(-) diff --git a/tools/widl/proxy.c b/tools/widl/proxy.c index 27c54aa..e889423 100644 --- a/tools/widl/proxy.c +++ b/tools/widl/proxy.c @@ -73,7 +73,7 @@ static void write_stubdesc(int expr_eval_routines) print_proxy( "{0}, 0, 0, %s, 0,\n", expr_eval_routines ? "ExprEvalRoutines" : "0"); print_proxy( "__MIDL_TypeFormatString.Format,\n"); print_proxy( "1, /* -error bounds_check flag */\n"); - print_proxy( "0x10001, /* Ndr library version */\n"); + print_proxy( "0x%x, /* Ndr library version */\n", stub_mode == MODE_Oif ? 0x50002 : 0x10001); print_proxy( "0,\n"); print_proxy( "0x50100a4, /* MIDL Version 5.1.164 */\n"); print_proxy( "0,\n"); @@ -100,6 +100,7 @@ static void init_proxy(const statement_list_t *stmts) print_proxy( "#endif /* __REDQ_RPCPROXY_H_VERSION__ */\n"); print_proxy( "\n"); print_proxy( "#define __midl_proxy\n"); + if (stub_mode == MODE_Oif) print_proxy( "#define USE_STUBLESS_PROXY\n"); print_proxy( "#include \"objbase.h\"\n"); print_proxy( "#include \"rpcproxy.h\"\n"); print_proxy( "#ifndef __RPCPROXY_H_VERSION__\n"); @@ -271,6 +272,7 @@ static void gen_proxy(type_t *iface, const var_t *func, int idx, indent = 0; if (is_interpreted_func( iface, func )) { + if (stub_mode == MODE_Oif && !is_callas( func->attrs )) return; write_type_decl_left(proxy, type_function_get_rettype(func->type)); print_proxy( " %s %s_%s_Proxy(\n", callconv, iface->name, get_name(func)); write_args(proxy, args, iface->name, 1, TRUE); @@ -278,8 +280,10 @@ static void gen_proxy(type_t *iface, const var_t *func, int idx, print_proxy( "{\n"); indent++; if (has_ret) print_proxy( "%s", "CLIENT_CALL_RETURN _RetVal;\n\n" ); - print_proxy( "%sNdrClientCall( &Object_StubDesc, &__MIDL_ProcFormatString.Format[%u], ", - has_ret ? "_RetVal = " : "", proc_offset ); + print_proxy( "%s%s( &Object_StubDesc, &__MIDL_ProcFormatString.Format[%u], ", + has_ret ? "_RetVal = " : "", + stub_mode == MODE_Oif ? "NdrClientCall2" : "NdrClientCall", + proc_offset ); fprintf( proxy, "(unsigned char *)&This );\n" ); if (has_ret) { @@ -575,12 +579,24 @@ static int write_proxy_methods(type_t *iface, int skip) STATEMENTS_FOR_EACH_FUNC(stmt, type_iface_get_stmts(iface)) { const var_t *func = stmt->u.var; if (!is_callas(func->attrs)) { - if (i != func->type->details.function->idx ) - error("widl internal error: method index mismatch\n"); - if (i) fprintf(proxy, ",\n"); - if (skip || (is_local(func->attrs) && !get_callas_source(iface, func))) - print_proxy( "0 /* %s_%s_Proxy */", iface->name, get_name(func)); - else print_proxy( "%s_%s_Proxy", iface->name, get_name(func)); + int missing = 0; + const char * fname = get_name(func); + if (is_local(func->attrs)) { + const statement_t * callas_source = get_callas_source(iface, func); + if(!callas_source) + missing = 1; + else + fname = get_name(callas_source->u.var); + } + if (skip || missing) print_proxy( "0, /* %s::%s */\n", iface->name, get_name(func)); + else if (is_interpreted_func( iface, func )) + { + if (!is_local( func->attrs ) && type_iface_get_inherit(iface)) + print_proxy( "(void *)-1, /* %s::%s */\n", iface->name, get_name(func)); + else + print_proxy( "%s_%s_Proxy,\n", iface->name, fname); + } + else print_proxy( "%s_%s_Proxy,\n", iface->name, get_name(func)); i++; } } @@ -611,7 +627,8 @@ static int write_stub_methods(type_t *iface, int skip) } if (i) fprintf(proxy,",\n"); if (skip || missing) print_proxy("STUB_FORWARDING_FUNCTION"); - else if (is_interpreted_func( iface, func )) print_proxy( "(PRPC_STUB_FUNCTION)NdrStubCall" ); + else if (is_interpreted_func( iface, func )) + print_proxy( "(PRPC_STUB_FUNCTION)%s", stub_mode == MODE_Oif ? "NdrStubCall2" : "NdrStubCall" ); else print_proxy( "%s_%s_Stub", iface->name, fname); i++; } @@ -646,7 +663,7 @@ static void write_proxy(type_t *iface, unsigned int *proc_offset) const statement_t *stmt; int first_func = 1; int needs_stub_thunks = 0; - int needs_inline_stubs = need_inline_stubs( iface ); + int needs_inline_stubs = need_inline_stubs( iface ) || need_delegation( iface ); STATEMENTS_FOR_EACH_FUNC(stmt, type_iface_get_stmts(iface)) { var_t *func = stmt->u.var; @@ -687,6 +704,22 @@ static void write_proxy(type_t *iface, unsigned int *proc_offset) write_procformatstring_offsets( proxy, iface ); + /* proxy info */ + if (stub_mode == MODE_Oif) + { + print_proxy( "static const MIDL_STUBLESS_PROXY_INFO %s_ProxyInfo =\n", iface->name ); + print_proxy( "{\n" ); + indent++; + print_proxy( "&Object_StubDesc,\n" ); + print_proxy( "__MIDL_ProcFormatString.Format,\n" ); + print_proxy( "&%s_FormatStringOffsetTable[-3],\n", iface->name ); + print_proxy( "0,\n" ); + print_proxy( "0,\n" ); + print_proxy( "0\n" ); + indent--; + print_proxy( "};\n\n" ); + } + /* proxy vtable */ print_proxy( "static %sCINTERFACE_PROXY_VTABLE(%d) _%sProxyVtbl =\n", need_delegation_indirect(iface) ? "" : "const ", count, iface->name); @@ -694,13 +727,13 @@ static void write_proxy(type_t *iface, unsigned int *proc_offset) indent++; print_proxy( "{\n"); indent++; + if (stub_mode == MODE_Oif) print_proxy( "&%s_ProxyInfo,\n", iface->name ); print_proxy( "&IID_%s,\n", iface->name); indent--; print_proxy( "},\n"); print_proxy( "{\n"); indent++; write_proxy_methods(iface, FALSE); - fprintf(proxy, "\n"); indent--; print_proxy( "}\n"); indent--; @@ -999,7 +1032,7 @@ static void write_proxy_routines(const statement_list_t *stmts) else fprintf(proxy, " 0,\n"); fprintf(proxy, " _%s_IID_Lookup,\n", file_id); fprintf(proxy, " %d,\n", count); - fprintf(proxy, " 1,\n"); + fprintf(proxy, " %d,\n", stub_mode == MODE_Oif ? 2 : 1); fprintf(proxy, " 0,\n"); fprintf(proxy, " 0,\n"); fprintf(proxy, " 0,\n");
1
0
0
0
Alexandre Julliard : widl: Generate thunks for callas functions using interpreted stubs.
by Alexandre Julliard
07 Jun '11
07 Jun '11
Module: wine Branch: master Commit: 01b44d1317b4cc086e53aa020e9b5815dd999c85 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=01b44d1317b4cc086e53aa020…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Jun 7 12:00:50 2011 +0200 widl: Generate thunks for callas functions using interpreted stubs. --- tools/widl/proxy.c | 68 +++++++++++++++++++++++++++++++++++++++++++++++++- tools/widl/typegen.c | 51 ++++++++++++++++++++++-------------- tools/widl/typegen.h | 1 + 3 files changed, 99 insertions(+), 21 deletions(-) diff --git a/tools/widl/proxy.c b/tools/widl/proxy.c index 616b326..27c54aa 100644 --- a/tools/widl/proxy.c +++ b/tools/widl/proxy.c @@ -513,6 +513,31 @@ static void gen_stub(type_t *iface, const var_t *func, const char *cas, print_proxy("\n"); } +static void gen_stub_thunk( type_t *iface, const var_t *func, unsigned int proc_offset ) +{ + int has_ret = !is_void( type_function_get_rettype( func->type )); + const var_t *arg, *callas = is_callas( func->attrs ); + const var_list_t *args = type_get_function_args( func->type ); + + indent = 0; + print_proxy( "void __RPC_API %s_%s_Thunk( PMIDL_STUB_MESSAGE pStubMsg )\n", + iface->name, get_name(func) ); + print_proxy( "{\n"); + indent++; + write_func_param_struct( proxy, iface, func->type, "pParamStruct" ); + print_proxy( "%s%s_%s_Stub( pParamStruct->This", + has_ret ? "pParamStruct->_RetVal = " : "", iface->name, callas->name ); + indent++; + if (args) LIST_FOR_EACH_ENTRY( arg, args, const var_t, entry ) + { + fprintf( proxy, ",\n%*spParamStruct->%s", 4 * indent, "", arg->name ); + } + fprintf( proxy, " );\n" ); + indent--; + indent--; + print_proxy( "}\n\n"); +} + int count_methods(const type_t *iface) { const statement_t *stmt; @@ -594,11 +619,33 @@ static int write_stub_methods(type_t *iface, int skip) return i; } +static void write_thunk_methods( type_t *iface ) +{ + const statement_t *stmt; + int i = 0; + + STATEMENTS_FOR_EACH_FUNC( stmt, type_iface_get_stmts(iface) ) + { + var_t *func = stmt->u.var; + const var_t *cas = is_callas(func->attrs); + + if (is_local( func->attrs )) continue; + if (i) fprintf(proxy, ",\n"); + if (cas && is_interpreted_func( iface, func )) + print_proxy( "%s_%s_Thunk", iface->name, func->name ); + else + print_proxy( "0" ); + i++; + } + fputc( '\n', proxy ); +} + static void write_proxy(type_t *iface, unsigned int *proc_offset) { int count; const statement_t *stmt; int first_func = 1; + int needs_stub_thunks = 0; int needs_inline_stubs = need_inline_stubs( iface ); STATEMENTS_FOR_EACH_FUNC(stmt, type_iface_get_stmts(iface)) { @@ -627,6 +674,11 @@ static void write_proxy(type_t *iface, unsigned int *proc_offset) func->procstring_offset = *proc_offset; gen_proxy(iface, func, idx, *proc_offset); gen_stub(iface, func, cname, *proc_offset); + if (cas && is_interpreted_func( iface, func )) + { + needs_stub_thunks = 1; + gen_stub_thunk(iface, func, *proc_offset); + } *proc_offset += get_size_procformatstring_func( iface, func ); } } @@ -654,6 +706,17 @@ static void write_proxy(type_t *iface, unsigned int *proc_offset) indent--; print_proxy( "};\n\n"); + /* stub thunk table */ + if (needs_stub_thunks) + { + print_proxy( "static const STUB_THUNK %s_StubThunkTable[] =\n", iface->name); + print_proxy( "{\n"); + indent++; + write_thunk_methods( iface ); + indent--; + print_proxy( "};\n\n"); + } + /* server info */ print_proxy( "static const MIDL_SERVER_INFO %s_ServerInfo =\n", iface->name ); print_proxy( "{\n" ); @@ -662,7 +725,10 @@ static void write_proxy(type_t *iface, unsigned int *proc_offset) print_proxy( "0,\n" ); print_proxy( "__MIDL_ProcFormatString.Format,\n" ); print_proxy( "&%s_FormatStringOffsetTable[-3],\n", iface->name ); - print_proxy( "0,\n" ); + if (needs_stub_thunks) + print_proxy( "&%s_StubThunkTable[-3],\n", iface->name ); + else + print_proxy( "0,\n" ); print_proxy( "0,\n" ); print_proxy( "0,\n" ); print_proxy( "0\n" ); diff --git a/tools/widl/typegen.c b/tools/widl/typegen.c index 87242d1..7620653 100644 --- a/tools/widl/typegen.c +++ b/tools/widl/typegen.c @@ -4632,6 +4632,36 @@ void assign_stub_out_args( FILE *file, int indent, const var_t *func, const char } +void write_func_param_struct( FILE *file, const type_t *iface, const type_t *func, const char *var_name ) +{ + const var_list_t *args = type_get_function_args( func ); + const var_t *arg; + + print_file(file, 1, "struct _PARAM_STRUCT\n" ); + print_file(file, 1, "{\n" ); + if (is_object( iface )) print_file(file, 2, "%s *This;\n", iface->name ); + + if (args) LIST_FOR_EACH_ENTRY( arg, args, const var_t, entry ) + { + print_file(file, 2, "%s", ""); + write_type_left( file, (type_t *)arg->type, TRUE ); + if (needs_space_after( arg->type )) fputc( ' ', file ); + if (is_array( arg->type ) && !type_array_is_decl_as_ptr( arg->type )) fputc( '*', file ); + /* FIXME: should check for large args being passed by pointer */ + if (is_array( arg->type ) || is_ptr( arg->type ) || type_memsize( arg->type ) == pointer_size) + fprintf( file, "%s;\n", arg->name ); + else + fprintf( file, "%s DECLSPEC_ALIGN(%u);\n", arg->name, pointer_size ); + } + if (!is_void( type_function_get_rettype( func ))) + { + print_file(file, 2, "%s", ""); + write_type_decl( file, type_function_get_rettype( func ), "_RetVal" ); + fprintf( file, ";\n" ); + } + print_file(file, 1, "} *%s = (struct _PARAM_STRUCT *)pStubMsg->StackTop;\n\n", var_name ); +} + int write_expr_eval_routines(FILE *file, const char *iface) { static const char *var_name = "pS"; @@ -4650,26 +4680,7 @@ int write_expr_eval_routines(FILE *file, const char *iface) print_file(file, 0, "{\n"); if (type_get_type( eval->cont_type ) == TYPE_FUNCTION) { - const var_list_t *args = type_get_function_args( eval->cont_type ); - const var_t *arg; - - print_file(file, 1, "struct _PARAM_STRUCT\n" ); - print_file(file, 1, "{\n" ); - if (is_object( eval->iface )) print_file(file, 2, "%s *This;\n", eval->iface->name ); - - if (args) LIST_FOR_EACH_ENTRY( arg, args, const var_t, entry ) - { - print_file(file, 2, "%s", ""); - write_type_left( file, (type_t *)arg->type, TRUE ); - if (needs_space_after( arg->type )) fputc( ' ', file ); - if (is_array( arg->type ) && !type_array_is_decl_as_ptr( arg->type )) fputc( '*', file ); - /* FIXME: should check for large args being passed by pointer */ - if (is_array( arg->type ) || is_ptr( arg->type ) || type_memsize( arg->type ) == pointer_size) - fprintf( file, "%s;\n", arg->name ); - else - fprintf( file, "%s DECLSPEC_ALIGN(%u);\n", arg->name, pointer_size ); - } - print_file(file, 1, "} *pS = (struct _PARAM_STRUCT *)pStubMsg->StackTop;\n" ); + write_func_param_struct( file, eval->iface, eval->cont_type, "pS" ); } else { diff --git a/tools/widl/typegen.h b/tools/widl/typegen.h index 5920fb1..7f3aed1 100644 --- a/tools/widl/typegen.h +++ b/tools/widl/typegen.h @@ -75,6 +75,7 @@ unsigned int get_size_procformatstring(const statement_list_t *stmts, type_pred_ unsigned int get_size_typeformatstring(const statement_list_t *stmts, type_pred_t pred); void assign_stub_out_args( FILE *file, int indent, const var_t *func, const char *local_var_prefix ); void declare_stub_args( FILE *file, int indent, const var_t *func ); +void write_func_param_struct( FILE *file, const type_t *iface, const type_t *func, const char *var_name ); int write_expr_eval_routines(FILE *file, const char *iface); void write_expr_eval_routine_list(FILE *file, const char *iface); void write_user_quad_list(FILE *file);
1
0
0
0
Łukasz Wojniłowicz : loader: Add Polish translation.
by Alexandre Julliard
06 Jun '11
06 Jun '11
Module: wine Branch: master Commit: 441f735f418f347ded3ba3f2cfa1643cc449fac9 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=441f735f418f347ded3ba3f2c…
Author: Łukasz Wojniłowicz <lukasz.wojnilowicz(a)gmail.com> Date: Sun Jun 5 18:58:34 2011 +0200 loader: Add Polish translation. --- loader/Makefile.in | 8 +- loader/wine.pl.man.in | 327 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 333 insertions(+), 2 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=441f735f418f347ded3ba…
1
0
0
0
Ričardas Barkauskas : ddraw: Separate IDirectDrawSurface4 vtable.
by Alexandre Julliard
06 Jun '11
06 Jun '11
Module: wine Branch: master Commit: bb063b994cd3ee05815994e88e339c84a1598847 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=bb063b994cd3ee05815994e88…
Author: Ričardas Barkauskas <rbarkauskas(a)codeweavers.com> Date: Mon Jun 6 14:39:04 2011 +0300 ddraw: Separate IDirectDrawSurface4 vtable. --- dlls/ddraw/ddraw.c | 6 +- dlls/ddraw/ddraw_private.h | 6 + dlls/ddraw/device.c | 2 +- dlls/ddraw/surface.c | 505 +++++++++++++++++++++++++++++++++++++++++++- 4 files changed, 511 insertions(+), 8 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=bb063b994cd3ee0581599…
1
0
0
0
Ričardas Barkauskas : ddraw: Use unsafe_impl_from_IDirectDrawSurface4.
by Alexandre Julliard
06 Jun '11
06 Jun '11
Module: wine Branch: master Commit: 4582562f5504e4edf8bccaa9255924f69ddf7f65 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=4582562f5504e4edf8bccaa92…
Author: Ričardas Barkauskas <rbarkauskas(a)codeweavers.com> Date: Mon Jun 6 14:08:23 2011 +0300 ddraw: Use unsafe_impl_from_IDirectDrawSurface4. --- dlls/ddraw/ddraw.c | 4 ++-- dlls/ddraw/ddraw_private.h | 1 + dlls/ddraw/device.c | 2 +- dlls/ddraw/surface.c | 7 +++++++ 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/dlls/ddraw/ddraw.c b/dlls/ddraw/ddraw.c index a8f5418..a265afd 100644 --- a/dlls/ddraw/ddraw.c +++ b/dlls/ddraw/ddraw.c @@ -4243,7 +4243,7 @@ static HRESULT WINAPI ddraw4_DuplicateSurface(IDirectDraw4 *iface, IDirectDrawSu IDirectDrawSurface4 **dst) { IDirectDrawImpl *This = impl_from_IDirectDraw4(iface); - IDirectDrawSurfaceImpl *src_impl = (IDirectDrawSurfaceImpl *)src; + IDirectDrawSurfaceImpl *src_impl = unsafe_impl_from_IDirectDrawSurface4(src); IDirectDrawSurface7 *dst7; IDirectDrawSurfaceImpl *dst_impl; HRESULT hr; @@ -4879,7 +4879,7 @@ static HRESULT WINAPI d3d3_CreateDevice(IDirect3D3 *iface, REFCLSID riid, IDirectDrawSurface4 *surface, IDirect3DDevice3 **device, IUnknown *outer_unknown) { IDirectDrawImpl *This = impl_from_IDirect3D3(iface); - IDirectDrawSurfaceImpl *surface_impl = (IDirectDrawSurfaceImpl *)surface; + IDirectDrawSurfaceImpl *surface_impl = unsafe_impl_from_IDirectDrawSurface4(surface); HRESULT hr; TRACE("iface %p, riid %s, surface %p, device %p, outer_unknown %p.\n", diff --git a/dlls/ddraw/ddraw_private.h b/dlls/ddraw/ddraw_private.h index 3a8ba04..ff7e2ed 100644 --- a/dlls/ddraw/ddraw_private.h +++ b/dlls/ddraw/ddraw_private.h @@ -231,6 +231,7 @@ static inline IDirectDrawSurfaceImpl *impl_from_IDirectDrawSurface7(IDirectDrawS } IDirectDrawSurfaceImpl *unsafe_impl_from_IDirectDrawSurface3(IDirectDrawSurface3 *iface) DECLSPEC_HIDDEN; +IDirectDrawSurfaceImpl *unsafe_impl_from_IDirectDrawSurface4(IDirectDrawSurface4 *iface) DECLSPEC_HIDDEN; IDirectDrawSurfaceImpl *unsafe_impl_from_IDirectDrawSurface7(IDirectDrawSurface7 *iface) DECLSPEC_HIDDEN; /* Get the number of bytes per pixel for a given surface */ diff --git a/dlls/ddraw/device.c b/dlls/ddraw/device.c index e0569e7..28477b0 100644 --- a/dlls/ddraw/device.c +++ b/dlls/ddraw/device.c @@ -1889,7 +1889,7 @@ static HRESULT WINAPI IDirect3DDeviceImpl_3_SetRenderTarget(IDirect3DDevice3 *if IDirectDrawSurface4 *NewRenderTarget, DWORD Flags) { IDirect3DDeviceImpl *This = device_from_device3(iface); - IDirectDrawSurfaceImpl *Target = (IDirectDrawSurfaceImpl *)NewRenderTarget; + IDirectDrawSurfaceImpl *Target = unsafe_impl_from_IDirectDrawSurface4(NewRenderTarget); TRACE("iface %p, target %p, flags %#x.\n", iface, NewRenderTarget, Flags); diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c index f5f5ceb..5e57518 100644 --- a/dlls/ddraw/surface.c +++ b/dlls/ddraw/surface.c @@ -3465,6 +3465,13 @@ IDirectDrawSurfaceImpl *unsafe_impl_from_IDirectDrawSurface7(IDirectDrawSurface7 return CONTAINING_RECORD(iface, IDirectDrawSurfaceImpl, IDirectDrawSurface7_iface); } +IDirectDrawSurfaceImpl *unsafe_impl_from_IDirectDrawSurface4(IDirectDrawSurface4 *iface) +{ + if (!iface) return NULL; + assert(iface->lpVtbl == (struct IDirectDrawSurface4Vtbl *)&ddraw_surface7_vtbl); + return CONTAINING_RECORD(iface, IDirectDrawSurfaceImpl, IDirectDrawSurface7_iface); +} + IDirectDrawSurfaceImpl *unsafe_impl_from_IDirectDrawSurface3(IDirectDrawSurface3 *iface) { if (!iface) return NULL;
1
0
0
0
Ričardas Barkauskas : ddraw: Change lpVtbl to IDirectDrawSurface7_iface.
by Alexandre Julliard
06 Jun '11
06 Jun '11
Module: wine Branch: master Commit: 2f02bbb41fce3ee3eb8fe89a8eac24927bd4f11c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2f02bbb41fce3ee3eb8fe89a8…
Author: Ričardas Barkauskas <rbarkauskas(a)codeweavers.com> Date: Sun Jun 5 19:55:04 2011 +0300 ddraw: Change lpVtbl to IDirectDrawSurface7_iface. --- dlls/ddraw/ddraw.c | 36 +++++++----- dlls/ddraw/ddraw_private.h | 4 +- dlls/ddraw/device.c | 66 +++++++++++---------- dlls/ddraw/surface.c | 140 ++++++++++++++++++++++---------------------- 4 files changed, 128 insertions(+), 118 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=2f02bbb41fce3ee3eb8fe…
1
0
0
0
Ričardas Barkauskas : ddraw: Avoid IDirectDrawSurfaceX to IDirectDrawSurface7 casts.
by Alexandre Julliard
06 Jun '11
06 Jun '11
Module: wine Branch: master Commit: 4074dd7615c19da2d1f2cb30c5b6a66e58309d90 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=4074dd7615c19da2d1f2cb30c…
Author: Ričardas Barkauskas <rbarkauskas(a)codeweavers.com> Date: Mon Jun 6 14:03:38 2011 +0300 ddraw: Avoid IDirectDrawSurfaceX to IDirectDrawSurface7 casts. --- dlls/ddraw/ddraw.c | 52 +++++++++++++++++++++++++++++++++++++++++++++----- dlls/ddraw/device.c | 17 +++++++++++++-- 2 files changed, 60 insertions(+), 9 deletions(-) diff --git a/dlls/ddraw/ddraw.c b/dlls/ddraw/ddraw.c index 56c22f8..0afdd4d 100644 --- a/dlls/ddraw/ddraw.c +++ b/dlls/ddraw/ddraw.c @@ -2037,10 +2037,22 @@ static HRESULT WINAPI ddraw7_GetGDISurface(IDirectDraw7 *iface, IDirectDrawSurfa static HRESULT WINAPI ddraw4_GetGDISurface(IDirectDraw4 *iface, IDirectDrawSurface4 **surface) { IDirectDrawImpl *This = impl_from_IDirectDraw4(iface); + IDirectDrawSurface7 *surface7; + IDirectDrawSurfaceImpl *surface_impl; + HRESULT hr; TRACE("iface %p, surface %p.\n", iface, surface); - return ddraw7_GetGDISurface(&This->IDirectDraw7_iface, (IDirectDrawSurface7 **)surface); + hr = ddraw7_GetGDISurface(&This->IDirectDraw7_iface, &surface7); + if (FAILED(hr)) + { + *surface = NULL; + return hr; + } + surface_impl = impl_from_IDirectDrawSurface7(surface7); + *surface = (IDirectDrawSurface4 *)surface_impl; + + return hr; } static HRESULT WINAPI ddraw3_GetGDISurface(IDirectDraw3 *iface, IDirectDrawSurface **surface) @@ -2483,10 +2495,25 @@ static HRESULT WINAPI ddraw3_GetSurfaceFromDC(IDirectDraw3 *iface, HDC dc, IDirectDrawSurface **surface) { IDirectDrawImpl *This = impl_from_IDirectDraw3(iface); + IDirectDrawSurface7 *surface7; + IDirectDrawSurfaceImpl *surface_impl; + HRESULT hr; TRACE("iface %p, dc %p, surface %p.\n", iface, dc, surface); - return ddraw7_GetSurfaceFromDC(&This->IDirectDraw7_iface, dc, (IDirectDrawSurface7 **)surface); + if (!surface) return E_INVALIDARG; + + hr = ddraw7_GetSurfaceFromDC(&This->IDirectDraw7_iface, dc, &surface7); + if (FAILED(hr)) + { + *surface = NULL; + return hr; + } + + surface_impl = impl_from_IDirectDrawSurface7(surface7); + *surface = (IDirectDrawSurface *)&surface_impl->IDirectDrawSurface3_iface; + + return hr; } /***************************************************************************** @@ -4216,11 +4243,23 @@ static HRESULT WINAPI ddraw4_DuplicateSurface(IDirectDraw4 *iface, IDirectDrawSu IDirectDrawSurface4 **dst) { IDirectDrawImpl *This = impl_from_IDirectDraw4(iface); + IDirectDrawSurfaceImpl *src_impl = (IDirectDrawSurfaceImpl *)src; + IDirectDrawSurface7 *dst7; + IDirectDrawSurfaceImpl *dst_impl; + HRESULT hr; TRACE("iface %p, src %p, dst %p.\n", iface, src, dst); + hr = ddraw7_DuplicateSurface(&This->IDirectDraw7_iface, + (IDirectDrawSurface7 *)src_impl, &dst7); + if (FAILED(hr)) + { + *dst = NULL; + return hr; + } + dst_impl = impl_from_IDirectDrawSurface7(dst7); + *dst = (IDirectDrawSurface4 *)dst_impl; - return ddraw7_DuplicateSurface(&This->IDirectDraw7_iface, (IDirectDrawSurface7 *)src, - (IDirectDrawSurface7 **)dst); + return hr; } static HRESULT WINAPI ddraw3_DuplicateSurface(IDirectDraw3 *iface, IDirectDrawSurface *src, @@ -5849,6 +5888,7 @@ static HRESULT CDECL device_parent_create_depth_stencil(struct wined3d_device_pa DWORD multisample_quality, BOOL discard, struct wined3d_surface **surface) { struct IDirectDrawImpl *ddraw = ddraw_from_device_parent(device_parent); + IDirectDrawSurface7 *ddraw7; IDirectDrawSurfaceImpl *ddraw_surface; DDSURFACEDESC2 ddsd; HRESULT hr; @@ -5877,8 +5917,7 @@ static HRESULT CDECL device_parent_create_depth_stencil(struct wined3d_device_pa } ddraw->depthstencil = TRUE; - hr = IDirectDraw7_CreateSurface(&ddraw->IDirectDraw7_iface, &ddsd, - (IDirectDrawSurface7 **)&ddraw_surface, NULL); + hr = IDirectDraw7_CreateSurface(&ddraw->IDirectDraw7_iface, &ddsd, &ddraw7, NULL); ddraw->depthstencil = FALSE; if (FAILED(hr)) { @@ -5886,6 +5925,7 @@ static HRESULT CDECL device_parent_create_depth_stencil(struct wined3d_device_pa return hr; } + ddraw_surface = impl_from_IDirectDrawSurface7(ddraw7); *surface = ddraw_surface->wined3d_surface; wined3d_surface_incref(*surface); IDirectDrawSurface7_Release((IDirectDrawSurface7 *)ddraw_surface); diff --git a/dlls/ddraw/device.c b/dlls/ddraw/device.c index 52a5e59..8f9fb81 100644 --- a/dlls/ddraw/device.c +++ b/dlls/ddraw/device.c @@ -1947,12 +1947,19 @@ static HRESULT WINAPI IDirect3DDeviceImpl_3_GetRenderTarget(IDirect3DDevice3 *if IDirectDrawSurface4 **RenderTarget) { IDirect3DDeviceImpl *This = device_from_device3(iface); + IDirectDrawSurface7 *RenderTarget7; + IDirectDrawSurfaceImpl *RenderTargetImpl; HRESULT hr; TRACE("iface %p, target %p.\n", iface, RenderTarget); - hr = IDirect3DDevice7_GetRenderTarget((IDirect3DDevice7 *)This, (IDirectDrawSurface7 **)RenderTarget); + if(!RenderTarget) + return DDERR_INVALIDPARAMS; + + hr = IDirect3DDevice7_GetRenderTarget((IDirect3DDevice7 *)This, &RenderTarget7); if(hr != D3D_OK) return hr; + RenderTargetImpl = impl_from_IDirectDrawSurface7(RenderTarget7); + *RenderTarget = (IDirectDrawSurface4 *)RenderTargetImpl; return D3D_OK; } @@ -1960,14 +1967,18 @@ static HRESULT WINAPI IDirect3DDeviceImpl_2_GetRenderTarget(IDirect3DDevice2 *if IDirectDrawSurface **RenderTarget) { IDirect3DDeviceImpl *This = device_from_device2(iface); + IDirectDrawSurface7 *RenderTarget7; IDirectDrawSurfaceImpl *RenderTargetImpl; HRESULT hr; TRACE("iface %p, target %p.\n", iface, RenderTarget); - hr = IDirect3DDevice7_GetRenderTarget((IDirect3DDevice7 *)This, (IDirectDrawSurface7 **)RenderTarget); + if(!RenderTarget) + return DDERR_INVALIDPARAMS; + + hr = IDirect3DDevice7_GetRenderTarget((IDirect3DDevice7 *)This, &RenderTarget7); if(hr != D3D_OK) return hr; - RenderTargetImpl = (IDirectDrawSurfaceImpl *)RenderTarget; + RenderTargetImpl = impl_from_IDirectDrawSurface7(RenderTarget7); *RenderTarget = (IDirectDrawSurface *)&RenderTargetImpl->IDirectDrawSurface3_iface; return D3D_OK; }
1
0
0
0
Ričardas Barkauskas : ddraw: Use impl_from_IDirectDrawSurface7() instead of casts.
by Alexandre Julliard
06 Jun '11
06 Jun '11
Module: wine Branch: master Commit: 93dfe5afc39147de53f58e99c24b9aad659d46c5 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=93dfe5afc39147de53f58e99c…
Author: Ričardas Barkauskas <rbarkauskas(a)codeweavers.com> Date: Mon Jun 6 13:57:55 2011 +0300 ddraw: Use impl_from_IDirectDrawSurface7() instead of casts. --- dlls/ddraw/ddraw.c | 22 +++++----- dlls/ddraw/ddraw_private.h | 5 ++ dlls/ddraw/device.c | 2 +- dlls/ddraw/main.c | 2 +- dlls/ddraw/surface.c | 96 ++++++++++++++++++++++---------------------- 5 files changed, 66 insertions(+), 61 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=93dfe5afc39147de53f58…
1
0
0
0
← Newer
1
...
63
64
65
66
67
68
69
...
81
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
72
73
74
75
76
77
78
79
80
81
Results per page:
10
25
50
100
200