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
July 2007
----- 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
3 participants
957 discussions
Start a n
N
ew thread
Evan Stade : winex11.drv: Draw dashed lines for extended pens.
by Alexandre Julliard
19 Jul '07
19 Jul '07
Module: wine Branch: master Commit: 9b9e08c2107b31c77692acb5c512d290e36a4259 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9b9e08c2107b31c77692acb5c…
Author: Evan Stade <estade(a)gmail.com> Date: Wed Jul 18 19:40:24 2007 -0700 winex11.drv: Draw dashed lines for extended pens. --- dlls/winex11.drv/graphics.c | 5 ++- dlls/winex11.drv/pen.c | 48 ++++++++++++++++++++++++++++-------------- dlls/winex11.drv/x11drv.h | 4 ++- 3 files changed, 38 insertions(+), 19 deletions(-) diff --git a/dlls/winex11.drv/graphics.c b/dlls/winex11.drv/graphics.c index 638356b..b2e105f 100644 --- a/dlls/winex11.drv/graphics.c +++ b/dlls/winex11.drv/graphics.c @@ -243,10 +243,11 @@ BOOL X11DRV_SetupGCForPen( X11DRV_PDEVICE *physDev ) val.join_style = JoinRound; } wine_tsx11_lock(); - if (physDev->pen.width <= 1 && physDev->pen.dash_len) + if (physDev->pen.dash_len) { XSetDashes( gdi_display, physDev->gc, 0, physDev->pen.dashes, physDev->pen.dash_len ); - val.line_style = (GetBkMode(physDev->hdc) == OPAQUE) ? LineDoubleDash : LineOnOffDash; + val.line_style = ((GetBkMode(physDev->hdc) == OPAQUE) && (!physDev->pen.ext)) + ? LineDoubleDash : LineOnOffDash; } else val.line_style = LineSolid; diff --git a/dlls/winex11.drv/pen.c b/dlls/winex11.drv/pen.c index fc6e9db..d2a0284 100644 --- a/dlls/winex11.drv/pen.c +++ b/dlls/winex11.drv/pen.c @@ -36,6 +36,11 @@ HPEN X11DRV_SelectPen( X11DRV_PDEVICE *physDev, HPEN hpen ) static char PEN_dashdot[] = { 12,8,4,8 }; static char PEN_dashdotdot[] = { 12,4,4,4,4,4 }; static char PEN_alternate[] = { 1,1 }; + static char EXTPEN_dash[] = { 3,1 }; + static char EXTPEN_dot[] = { 1,1 }; + static char EXTPEN_dashdot[] = { 3,1,1,1 }; + static char EXTPEN_dashdotdot[] = { 3,1,1,1,1,1 }; + int i; if (!GetObjectW( hpen, sizeof(logpen), &logpen )) { @@ -45,6 +50,7 @@ HPEN X11DRV_SelectPen( X11DRV_PDEVICE *physDev, HPEN hpen ) if (!size) return 0; + physDev->pen.ext = 1; elp = HeapAlloc( GetProcessHeap(), 0, size ); GetObjectW( hpen, size, elp ); @@ -56,6 +62,8 @@ HPEN X11DRV_SelectPen( X11DRV_PDEVICE *physDev, HPEN hpen ) HeapFree( GetProcessHeap(), 0, elp ); } + else + physDev->pen.ext = 0; physDev->pen.style = logpen.lopnStyle & PS_STYLE_MASK; physDev->pen.type = logpen.lopnStyle & PS_TYPE_MASK; @@ -76,33 +84,41 @@ HPEN X11DRV_SelectPen( X11DRV_PDEVICE *physDev, HPEN hpen ) switch(logpen.lopnStyle & PS_STYLE_MASK) { case PS_DASH: - physDev->pen.dashes = PEN_dash; - physDev->pen.dash_len = sizeof(PEN_dash)/sizeof(*PEN_dash); - break; + physDev->pen.dash_len = sizeof(PEN_dash)/sizeof(*PEN_dash); + memcpy(physDev->pen.dashes, physDev->pen.ext ? EXTPEN_dash : PEN_dash, + physDev->pen.dash_len); + break; case PS_DOT: - physDev->pen.dashes = PEN_dot; - physDev->pen.dash_len = sizeof(PEN_dot)/sizeof(*PEN_dot); - break; + physDev->pen.dash_len = sizeof(PEN_dot)/sizeof(*PEN_dot); + memcpy(physDev->pen.dashes, physDev->pen.ext ? EXTPEN_dot : PEN_dot, + physDev->pen.dash_len); + break; case PS_DASHDOT: - physDev->pen.dashes = PEN_dashdot; - physDev->pen.dash_len = sizeof(PEN_dashdot)/sizeof(*PEN_dashdot); - break; + physDev->pen.dash_len = sizeof(PEN_dashdot)/sizeof(*PEN_dashdot); + memcpy(physDev->pen.dashes, physDev->pen.ext ? EXTPEN_dashdot : PEN_dashdot, + physDev->pen.dash_len); + break; case PS_DASHDOTDOT: - physDev->pen.dashes = PEN_dashdotdot; - physDev->pen.dash_len = sizeof(PEN_dashdotdot)/sizeof(*PEN_dashdotdot); - break; + physDev->pen.dash_len = sizeof(PEN_dashdotdot)/sizeof(*PEN_dashdotdot); + memcpy(physDev->pen.dashes, physDev->pen.ext ? EXTPEN_dashdotdot : PEN_dashdotdot, + physDev->pen.dash_len); + break; case PS_ALTERNATE: - physDev->pen.dashes = PEN_alternate; - physDev->pen.dash_len = sizeof(PEN_alternate)/sizeof(*PEN_alternate); - break; + physDev->pen.dash_len = sizeof(PEN_alternate)/sizeof(*PEN_alternate); + memcpy(physDev->pen.dashes, PEN_alternate, physDev->pen.dash_len); + break; case PS_USERSTYLE: FIXME("PS_USERSTYLE is not supported\n"); /* fall through */ default: - physDev->pen.dashes = NULL; physDev->pen.dash_len = 0; break; } + if(physDev->pen.ext && physDev->pen.dash_len && + (logpen.lopnStyle & PS_STYLE_MASK) != PS_ALTERNATE) + for(i = 0; i < physDev->pen.dash_len; i++) + physDev->pen.dashes[i] *= (physDev->pen.width ? physDev->pen.width : 1); + return hpen; } diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index c542582..a778f64 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -62,6 +62,7 @@ typedef int Status; #include "wine/list.h" #define MAX_PIXELFORMATS 8 +#define MAX_DASHLEN 16 struct tagCURSORICONINFO; struct dce; @@ -77,9 +78,10 @@ typedef struct int linejoin; int pixel; int width; - char * dashes; + char dashes[MAX_DASHLEN]; int dash_len; int type; /* GEOMETRIC || COSMETIC */ + int ext; /* extended pen - 1, otherwise - 0 */ } X_PHYSPEN; /* X physical brush */
1
0
0
0
Dmitry Timoshkov : rpcrt4: Fix the buffer bounds check.
by Alexandre Julliard
19 Jul '07
19 Jul '07
Module: wine Branch: master Commit: 12d3905427796fd65f21673b77381442339ca00f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=12d3905427796fd65f21673b7…
Author: Dmitry Timoshkov <dmitry(a)codeweavers.com> Date: Thu Jul 19 14:56:18 2007 +0900 rpcrt4: Fix the buffer bounds check. --- dlls/rpcrt4/ndr_marshall.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/dlls/rpcrt4/ndr_marshall.c b/dlls/rpcrt4/ndr_marshall.c index 26a55b1..b1b8fa3 100644 --- a/dlls/rpcrt4/ndr_marshall.c +++ b/dlls/rpcrt4/ndr_marshall.c @@ -759,7 +759,7 @@ unsigned char *WINAPI NdrConformantStringUnmarshall( PMIDL_STUB_MESSAGE pStubMsg /* verify the buffer is safe to access */ if ((pStubMsg->Buffer + bufsize < pStubMsg->Buffer) || - (pStubMsg->Buffer + bufsize < pStubMsg->BufferEnd)) + (pStubMsg->Buffer + bufsize > pStubMsg->BufferEnd)) { ERR("bufsize 0x%x exceeded buffer end %p of buffer %p\n", bufsize, pStubMsg->BufferEnd, pStubMsg->Buffer);
1
0
0
0
James Hawkins : msi: Implement reference counting for tables, manipulated with the HOLD and FREE sql commands.
by Alexandre Julliard
19 Jul '07
19 Jul '07
Module: wine Branch: master Commit: 3b1ab76986afccaff08e9b649b42f27b60dd3e33 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3b1ab76986afccaff08e9b649…
Author: James Hawkins <truiken(a)gmail.com> Date: Wed Jul 18 18:21:00 2007 -0700 msi: Implement reference counting for tables, manipulated with the HOLD and FREE sql commands. --- dlls/msi/alter.c | 23 +++++++++++++++++++---- dlls/msi/create.c | 5 +++-- dlls/msi/delete.c | 4 +++- dlls/msi/distinct.c | 2 ++ dlls/msi/insert.c | 4 +++- dlls/msi/join.c | 4 +++- dlls/msi/msipriv.h | 10 ++++++++++ dlls/msi/order.c | 4 +++- dlls/msi/select.c | 4 +++- dlls/msi/streams.c | 4 +++- dlls/msi/table.c | 35 ++++++++++++++++++++++++++++++++++- dlls/msi/tests/db.c | 7 +------ dlls/msi/update.c | 4 +++- dlls/msi/where.c | 4 +++- 14 files changed, 93 insertions(+), 21 deletions(-) diff --git a/dlls/msi/alter.c b/dlls/msi/alter.c index b506aa1..2815f11 100644 --- a/dlls/msi/alter.c +++ b/dlls/msi/alter.c @@ -38,6 +38,8 @@ typedef struct tagMSIALTERVIEW { MSIVIEW view; MSIDATABASE *db; + MSIVIEW *table; + INT hold; } MSIALTERVIEW; static UINT ALTER_fetch_int( struct tagMSIVIEW *view, UINT row, UINT col, UINT *val ) @@ -62,7 +64,12 @@ static UINT ALTER_execute( struct tagMSIVIEW *view, MSIRECORD *record ) { MSIALTERVIEW *av = (MSIALTERVIEW*)view; - FIXME("%p %p\n", av, record); + TRACE("%p %p\n", av, record); + + if (av->hold == 1) + av->table->ops->add_ref(av->table); + else if (av->hold == -1) + av->table->ops->release(av->table); return ERROR_SUCCESS; } @@ -111,6 +118,7 @@ static UINT ALTER_delete( struct tagMSIVIEW *view ) TRACE("%p\n", av ); msi_free( av ); + av->table->ops->delete( av->table ); return ERROR_SUCCESS; } @@ -123,7 +131,6 @@ static UINT ALTER_find_matching_rows( struct tagMSIVIEW *view, UINT col, return ERROR_FUNCTION_FAILED; } - static const MSIVIEWOPS alter_ops = { ALTER_fetch_int, @@ -137,22 +144,30 @@ static const MSIVIEWOPS alter_ops = ALTER_get_column_info, ALTER_modify, ALTER_delete, - ALTER_find_matching_rows + ALTER_find_matching_rows, + NULL, + NULL, }; UINT ALTER_CreateView( MSIDATABASE *db, MSIVIEW **view, LPCWSTR name, int hold ) { MSIALTERVIEW *av; + UINT r; - TRACE("%p\n", view ); + TRACE("%p %s %d\n", view, debugstr_w(name), hold ); av = msi_alloc_zero( sizeof *av ); if( !av ) return ERROR_FUNCTION_FAILED; + r = TABLE_CreateView( db, name, &av->table ); + if (r != ERROR_SUCCESS || !av->table) + return r; + /* fill the structure */ av->view.ops = &alter_ops; av->db = db; + av->hold = hold; *view = &av->view; diff --git a/dlls/msi/create.c b/dlls/msi/create.c index 9c3fb39..65a066f 100644 --- a/dlls/msi/create.c +++ b/dlls/msi/create.c @@ -117,7 +117,6 @@ static UINT CREATE_delete( struct tagMSIVIEW *view ) return ERROR_SUCCESS; } - static const MSIVIEWOPS create_ops = { CREATE_fetch_int, @@ -130,7 +129,9 @@ static const MSIVIEWOPS create_ops = CREATE_get_dimensions, CREATE_get_column_info, CREATE_modify, - CREATE_delete + CREATE_delete, + NULL, + NULL, }; static UINT check_columns( column_info *col_info ) diff --git a/dlls/msi/delete.c b/dlls/msi/delete.c index bd33956..8d668c4 100644 --- a/dlls/msi/delete.c +++ b/dlls/msi/delete.c @@ -192,7 +192,9 @@ static const MSIVIEWOPS delete_ops = DELETE_get_column_info, DELETE_modify, DELETE_delete, - DELETE_find_matching_rows + DELETE_find_matching_rows, + NULL, + NULL, }; UINT DELETE_CreateView( MSIDATABASE *db, MSIVIEW **view, MSIVIEW *table ) diff --git a/dlls/msi/distinct.c b/dlls/msi/distinct.c index 8513823..6d737d9 100644 --- a/dlls/msi/distinct.c +++ b/dlls/msi/distinct.c @@ -282,6 +282,8 @@ static const MSIVIEWOPS distinct_ops = DISTINCT_modify, DISTINCT_delete, DISTINCT_find_matching_rows, + NULL, + NULL, }; UINT DISTINCT_CreateView( MSIDATABASE *db, MSIVIEW **view, MSIVIEW *table ) diff --git a/dlls/msi/insert.c b/dlls/msi/insert.c index 95c35f3..207f153 100644 --- a/dlls/msi/insert.c +++ b/dlls/msi/insert.c @@ -232,7 +232,9 @@ static const MSIVIEWOPS insert_ops = INSERT_get_column_info, INSERT_modify, INSERT_delete, - INSERT_find_matching_rows + INSERT_find_matching_rows, + NULL, + NULL, }; static UINT count_column_info( const column_info *ci ) diff --git a/dlls/msi/join.c b/dlls/msi/join.c index ab1935e..7ff2b91 100644 --- a/dlls/msi/join.c +++ b/dlls/msi/join.c @@ -252,7 +252,9 @@ static const MSIVIEWOPS join_ops = JOIN_get_column_info, JOIN_modify, JOIN_delete, - JOIN_find_matching_rows + JOIN_find_matching_rows, + NULL, + NULL, }; UINT JOIN_CreateView( MSIDATABASE *db, MSIVIEW **view, diff --git a/dlls/msi/msipriv.h b/dlls/msi/msipriv.h index a94866a..39719d5 100644 --- a/dlls/msi/msipriv.h +++ b/dlls/msi/msipriv.h @@ -221,6 +221,16 @@ typedef struct tagMSIVIEWOPS * first call and continued to be passed in to subsequent calls. */ UINT (*find_matching_rows)( struct tagMSIVIEW *view, UINT col, UINT val, UINT *row, MSIITERHANDLE *handle ); + + /* + * add_ref - increases the reference count of the table + */ + UINT (*add_ref)( struct tagMSIVIEW *view ); + + /* + * release - decreases the reference count of the table + */ + UINT (*release)( struct tagMSIVIEW *view ); } MSIVIEWOPS; struct tagMSIVIEW diff --git a/dlls/msi/order.c b/dlls/msi/order.c index c0ab643..feb9a31 100644 --- a/dlls/msi/order.c +++ b/dlls/msi/order.c @@ -281,7 +281,9 @@ static const MSIVIEWOPS order_ops = ORDER_get_column_info, ORDER_modify, ORDER_delete, - ORDER_find_matching_rows + ORDER_find_matching_rows, + NULL, + NULL, }; static UINT ORDER_AddColumn( MSIORDERVIEW *ov, LPCWSTR name ) diff --git a/dlls/msi/select.c b/dlls/msi/select.c index 6953e1f..fc2f7be 100644 --- a/dlls/msi/select.c +++ b/dlls/msi/select.c @@ -274,7 +274,9 @@ static const MSIVIEWOPS select_ops = SELECT_get_column_info, SELECT_modify, SELECT_delete, - SELECT_find_matching_rows + SELECT_find_matching_rows, + NULL, + NULL, }; static UINT SELECT_AddColumn( MSISELECTVIEW *sv, LPCWSTR name ) diff --git a/dlls/msi/streams.c b/dlls/msi/streams.c index fbb8b79..6828277 100644 --- a/dlls/msi/streams.c +++ b/dlls/msi/streams.c @@ -336,7 +336,9 @@ static const MSIVIEWOPS streams_ops = STREAMS_get_column_info, STREAMS_modify, STREAMS_delete, - STREAMS_find_matching_rows + STREAMS_find_matching_rows, + NULL, + NULL, }; static UINT add_streams_to_table(MSISTREAMSVIEW *sv) diff --git a/dlls/msi/table.c b/dlls/msi/table.c index 69a033c..33d6aa5 100644 --- a/dlls/msi/table.c +++ b/dlls/msi/table.c @@ -71,6 +71,7 @@ struct tagMSITABLE MSICOLUMNINFO *colinfo; UINT col_count; BOOL persistent; + INT ref_count; WCHAR name[1]; }; @@ -632,6 +633,7 @@ UINT msi_create_table( MSIDATABASE *db, LPCWSTR name, column_info *col_info, if( !table ) return ERROR_FUNCTION_FAILED; + table->ref_count = 1; table->row_count = 0; table->data = NULL; table->nonpersistent_row_count = 0; @@ -1642,6 +1644,35 @@ static UINT TABLE_find_matching_rows( struct tagMSIVIEW *view, UINT col, return ERROR_SUCCESS; } +static UINT TABLE_add_ref(struct tagMSIVIEW *view) +{ + MSITABLEVIEW *tv = (MSITABLEVIEW*)view; + + TRACE("%p %d\n", view, tv->table->ref_count); + + return InterlockedIncrement(&tv->table->ref_count); +} + +static UINT TABLE_release(struct tagMSIVIEW *view) +{ + MSITABLEVIEW *tv = (MSITABLEVIEW*)view; + INT ref = tv->table->ref_count; + + TRACE("%p %d\n", view, ref); + + ref = InterlockedDecrement(&tv->table->ref_count); + if (ref == 0) + { + if (!tv->table->row_count) + { + list_remove(&tv->table->entry); + free_table(tv->table); + TABLE_delete(view); + } + } + + return ref; +} static const MSIVIEWOPS table_ops = { @@ -1656,7 +1687,9 @@ static const MSIVIEWOPS table_ops = TABLE_get_column_info, TABLE_modify, TABLE_delete, - TABLE_find_matching_rows + TABLE_find_matching_rows, + TABLE_add_ref, + TABLE_release, }; UINT TABLE_CreateView( MSIDATABASE *db, LPCWSTR name, MSIVIEW **view ) diff --git a/dlls/msi/tests/db.c b/dlls/msi/tests/db.c index 7d06efb..4b54e8a 100644 --- a/dlls/msi/tests/db.c +++ b/dlls/msi/tests/db.c @@ -2932,7 +2932,6 @@ static void test_alter(void) r = run_query(hdb, 0, query); ok(r == ERROR_SUCCESS, "failed to free table\n"); - todo_wine { query = "ALTER TABLE `T` FREE"; r = run_query(hdb, 0, query); ok(r == ERROR_BAD_QUERY_SYNTAX, "failed to free table\n"); @@ -2940,15 +2939,11 @@ static void test_alter(void) query = "ALTER TABLE `T` HOLD"; r = run_query(hdb, 0, query); ok(r == ERROR_BAD_QUERY_SYNTAX, "failed to hold table %d\n", r); - } /* table T is removed */ query = "SELECT * FROM `T`"; r = run_query(hdb, 0, query); - todo_wine - { - ok(r == ERROR_BAD_QUERY_SYNTAX, "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r); - } + ok(r == ERROR_BAD_QUERY_SYNTAX, "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r); /* create the table again */ query = "CREATE TABLE `U` ( `A` INTEGER, `B` INTEGER PRIMARY KEY `B`)"; diff --git a/dlls/msi/update.c b/dlls/msi/update.c index bc3fb2e..037c282 100644 --- a/dlls/msi/update.c +++ b/dlls/msi/update.c @@ -184,7 +184,9 @@ static const MSIVIEWOPS update_ops = UPDATE_get_column_info, UPDATE_modify, UPDATE_delete, - UPDATE_find_matching_rows + UPDATE_find_matching_rows, + NULL, + NULL, }; UINT UPDATE_CreateView( MSIDATABASE *db, MSIVIEW **view, LPCWSTR table, diff --git a/dlls/msi/where.c b/dlls/msi/where.c index ab9c9a6..5b5d867 100644 --- a/dlls/msi/where.c +++ b/dlls/msi/where.c @@ -446,7 +446,9 @@ static const MSIVIEWOPS where_ops = WHERE_get_column_info, WHERE_modify, WHERE_delete, - WHERE_find_matching_rows + WHERE_find_matching_rows, + NULL, + NULL, }; static UINT WHERE_VerifyCondition( MSIDATABASE *db, MSIVIEW *table, struct expr *cond,
1
0
0
0
James Hawkins : msi: Add more tests for the ALTER command.
by Alexandre Julliard
19 Jul '07
19 Jul '07
Module: wine Branch: master Commit: 0169533be8d0a4f000e2cd264d04d1e71c19408a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=0169533be8d0a4f000e2cd264…
Author: James Hawkins <truiken(a)gmail.com> Date: Wed Jul 18 18:20:24 2007 -0700 msi: Add more tests for the ALTER command. --- dlls/msi/tests/db.c | 170 ++++++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 169 insertions(+), 1 deletions(-) diff --git a/dlls/msi/tests/db.c b/dlls/msi/tests/db.c index 2c76c97..7d06efb 100644 --- a/dlls/msi/tests/db.c +++ b/dlls/msi/tests/db.c @@ -2942,8 +2942,176 @@ static void test_alter(void) ok(r == ERROR_BAD_QUERY_SYNTAX, "failed to hold table %d\n", r); } - MsiCloseHandle( hdb ); + /* table T is removed */ + query = "SELECT * FROM `T`"; + r = run_query(hdb, 0, query); + todo_wine + { + ok(r == ERROR_BAD_QUERY_SYNTAX, "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r); + } + + /* create the table again */ + query = "CREATE TABLE `U` ( `A` INTEGER, `B` INTEGER PRIMARY KEY `B`)"; + r = run_query(hdb, 0, query); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + + /* up the ref count */ + query = "ALTER TABLE `U` HOLD"; + r = run_query(hdb, 0, query); + ok(r == ERROR_SUCCESS, "failed to free table\n"); + + /* add column, no data type */ + query = "ALTER TABLE `U` ADD `C`"; + r = run_query(hdb, 0, query); + ok(r == ERROR_BAD_QUERY_SYNTAX, "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r); + + query = "ALTER TABLE `U` ADD `C` INTEGER"; + r = run_query(hdb, 0, query); + todo_wine + { + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + } + + /* add column C again */ + query = "ALTER TABLE `U` ADD `C` INTEGER"; + r = run_query(hdb, 0, query); + ok(r == ERROR_BAD_QUERY_SYNTAX, "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r); + + query = "ALTER TABLE `U` ADD `D` INTEGER TEMPORARY"; + r = run_query(hdb, 0, query); + todo_wine + { + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + } + + query = "INSERT INTO `U` ( `A`, `B`, `C`, `D` ) VALUES ( 1, 2, 3, 4 )"; + r = run_query(hdb, 0, query); + todo_wine + { + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + } + + query = "ALTER TABLE `U` ADD `D` INTEGER TEMPORARY HOLD"; + r = run_query(hdb, 0, query); + ok(r == ERROR_BAD_QUERY_SYNTAX, "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r); + + query = "INSERT INTO `U` ( `A`, `B`, `C`, `D` ) VALUES ( 5, 6, 7, 8 )"; + r = run_query(hdb, 0, query); + todo_wine + { + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + } + + query = "SELECT * FROM `U` WHERE `D` = 8"; + r = run_query(hdb, 0, query); + todo_wine + { + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + } + + query = "ALTER TABLE `U` ADD `D` INTEGER TEMPORARY FREE"; + r = run_query(hdb, 0, query); + ok(r == ERROR_BAD_QUERY_SYNTAX, "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r); + + query = "ALTER COLUMN `D` FREE"; + r = run_query(hdb, 0, query); + ok(r == ERROR_BAD_QUERY_SYNTAX, "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r); + + /* drop the ref count */ + query = "ALTER TABLE `U` FREE"; + r = run_query(hdb, 0, query); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + + /* table is not empty */ + query = "SELECT * FROM `U`"; + r = run_query(hdb, 0, query); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + /* column D is removed */ + query = "SELECT * FROM `U` WHERE `D` = 8"; + r = run_query(hdb, 0, query); + ok(r == ERROR_BAD_QUERY_SYNTAX, "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r); + + query = "INSERT INTO `U` ( `A`, `B`, `C`, `D` ) VALUES ( 9, 10, 11, 12 )"; + r = run_query(hdb, 0, query); + ok(r == ERROR_BAD_QUERY_SYNTAX, "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r); + + /* add the column again */ + query = "ALTER TABLE `U` ADD `E` INTEGER TEMPORARY HOLD"; + r = run_query(hdb, 0, query); + todo_wine + { + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + } + + /* up the ref count */ + query = "ALTER TABLE `U` HOLD"; + r = run_query(hdb, 0, query); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + + query = "INSERT INTO `U` ( `A`, `B`, `C`, `E` ) VALUES ( 13, 14, 15, 16 )"; + r = run_query(hdb, 0, query); + todo_wine + { + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + } + + query = "SELECT * FROM `U` WHERE `E` = 16"; + r = run_query(hdb, 0, query); + todo_wine + { + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + } + + /* drop the ref count */ + query = "ALTER TABLE `U` FREE"; + r = run_query(hdb, 0, query); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + + query = "INSERT INTO `U` ( `A`, `B`, `C`, `E` ) VALUES ( 17, 18, 19, 20 )"; + r = run_query(hdb, 0, query); + todo_wine + { + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + } + + query = "SELECT * FROM `U` WHERE `E` = 20"; + r = run_query(hdb, 0, query); + todo_wine + { + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + } + + /* drop the ref count */ + query = "ALTER TABLE `U` FREE"; + r = run_query(hdb, 0, query); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + + /* table still exists */ + query = "SELECT * FROM `U`"; + r = run_query(hdb, 0, query); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + + /* col E is removed */ + query = "SELECT * FROM `U` WHERE `E` = 20"; + r = run_query(hdb, 0, query); + ok(r == ERROR_BAD_QUERY_SYNTAX, "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r); + + query = "INSERT INTO `U` ( `A`, `B`, `C`, `E` ) VALUES ( 20, 21, 22, 23 )"; + r = run_query(hdb, 0, query); + ok(r == ERROR_BAD_QUERY_SYNTAX, "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r); + + /* drop the ref count once more */ + query = "ALTER TABLE `U` FREE"; + r = run_query(hdb, 0, query); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + + /* table still exists */ + query = "SELECT * FROM `U`"; + r = run_query(hdb, 0, query); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + + MsiCloseHandle( hdb ); DeleteFile(msifile); }
1
0
0
0
Misha Koshelev : urlmon/tests: Add tests for HttpProtocol behavior when it is called without the BINDF_FROMURLMON flag .
by Alexandre Julliard
19 Jul '07
19 Jul '07
Module: wine Branch: master Commit: 4e205947e7361bdbbfd5ee1caad924f0e8cb8b56 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=4e205947e7361bdbbfd5ee1ca…
Author: Misha Koshelev <mk144210(a)bcm.edu> Date: Wed Jul 18 20:00:20 2007 -0500 urlmon/tests: Add tests for HttpProtocol behavior when it is called without the BINDF_FROMURLMON flag. --- dlls/urlmon/tests/protocol.c | 75 ++++++++++++++++++++++++++++++++--------- 1 files changed, 58 insertions(+), 17 deletions(-) diff --git a/dlls/urlmon/tests/protocol.c b/dlls/urlmon/tests/protocol.c index 278c093..08476d0 100644 --- a/dlls/urlmon/tests/protocol.c +++ b/dlls/urlmon/tests/protocol.c @@ -66,6 +66,7 @@ DEFINE_EXPECT(GetBindInfo); DEFINE_EXPECT(ReportProgress_MIMETYPEAVAILABLE); DEFINE_EXPECT(ReportProgress_DIRECTBIND); +DEFINE_EXPECT(ReportProgress_RAWMIMETYPE); DEFINE_EXPECT(ReportProgress_FINDINGRESOURCE); DEFINE_EXPECT(ReportProgress_CONNECTING); DEFINE_EXPECT(ReportProgress_SENDINGREQUEST); @@ -288,6 +289,14 @@ static HRESULT WINAPI ProtocolSink_ReportProgress(IInternetProtocolSink *iface, CHECK_EXPECT2(ReportProgress_DIRECTBIND); ok(szStatusText == NULL, "szStatusText != NULL\n"); break; + case BINDSTATUS_RAWMIMETYPE: + CHECK_EXPECT2(ReportProgress_RAWMIMETYPE); + ok(szStatusText != NULL, "szStatusText == NULL\n"); + if(szStatusText) + ok(lstrlenW(szStatusText) < lstrlenW(text_html) || + !memcmp(szStatusText, text_html, lstrlenW(text_html)*sizeof(WCHAR)), + "szStatusText != text/html\n"); + break; case BINDSTATUS_CACHEFILENAMEAVAILABLE: CHECK_EXPECT(ReportProgress_CACHEFILENAMEAVAILABLE); ok(szStatusText != NULL, "szStatusText == NULL\n"); @@ -363,6 +372,10 @@ static HRESULT WINAPI ProtocolSink_ReportData(IInternetProtocolSink *iface, DWOR || grfBSCF == (BSCF_LASTDATANOTIFICATION|BSCF_INTERMEDIATEDATANOTIFICATION), "grcfBSCF = %08x\n", grfBSCF); } + + if (!(grfBSCF & BSCF_LASTDATANOTIFICATION) && + !(bindf & BINDF_FROMURLMON)) + SendMessage(protocol_hwnd, WM_USER, 0, 0); } return S_OK; } @@ -1061,6 +1074,8 @@ static BOOL http_protocol_start(LPCWSTR url, BOOL is_first) state = 0; SET_EXPECT(GetBindInfo); + if (!(bindf & BINDF_FROMURLMON)) + SET_EXPECT(ReportProgress_DIRECTBIND); SET_EXPECT(GetBindString_USER_AGENT); SET_EXPECT(GetBindString_ACCEPT_MIMES); SET_EXPECT(QueryService_HttpNegotiate); @@ -1073,6 +1088,8 @@ static BOOL http_protocol_start(LPCWSTR url, BOOL is_first) return FALSE; CHECK_CALLED(GetBindInfo); + if (!(bindf & BINDF_FROMURLMON)) + CHECK_CALLED(ReportProgress_DIRECTBIND); if (!got_user_agent) { CHECK_CALLED(GetBindString_USER_AGENT); @@ -1130,13 +1147,17 @@ static void test_http_protocol_url(LPCWSTR url, BOOL is_first) DWORD cb; MSG msg; - bindf = BINDF_ASYNCHRONOUS | BINDF_ASYNCSTORAGE | BINDF_PULLDATA | BINDF_FROMURLMON; - test_priority(http_protocol); SET_EXPECT(ReportProgress_FINDINGRESOURCE); SET_EXPECT(ReportProgress_CONNECTING); SET_EXPECT(ReportProgress_SENDINGREQUEST); + if(!(bindf & BINDF_FROMURLMON)) + { + SET_EXPECT(OnResponse); + SET_EXPECT(ReportProgress_RAWMIMETYPE); + SET_EXPECT(ReportData); + } if(!http_protocol_start(url, is_first)) return; @@ -1145,15 +1166,20 @@ static void test_http_protocol_url(LPCWSTR url, BOOL is_first) ok(hres == E_PENDING, "Read failed: %08x, expected E_PENDING\n", hres); ok(!cb, "cb=%d, expected 0\n", cb); - SET_EXPECT(Switch); + if(bindf & BINDF_FROMURLMON) + SET_EXPECT(Switch); SET_EXPECT(ReportResult); expect_hrResult = S_OK; GetMessage(&msg, NULL, 0, 0); - CHECK_CALLED(Switch); + if(bindf & BINDF_FROMURLMON) + CHECK_CALLED(Switch); CHECK_CALLED(ReportResult); + hres = IInternetProtocol_Terminate(http_protocol, 0); + ok(hres == S_OK, "Terminate failed: %08x\n", hres); + IInternetProtocol_Release(http_protocol); } @@ -1167,7 +1193,9 @@ static void test_http_protocol(void) 'o','r','g','/','s','i','t','e','/','a','b','o','u','t',0}; tested_protocol = HTTP_TEST; + bindf = BINDF_ASYNCHRONOUS | BINDF_ASYNCSTORAGE | BINDF_PULLDATA; test_http_protocol_url(winehq_url, TRUE); + bindf = BINDF_ASYNCHRONOUS | BINDF_ASYNCSTORAGE | BINDF_PULLDATA | BINDF_FROMURLMON; test_http_protocol_url(winehq_url, FALSE); } @@ -1175,12 +1203,15 @@ static void test_http_protocol(void) static LRESULT WINAPI wnd_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { if(msg == WM_USER) { + BOOL first_call = FALSE; HRESULT hres; DWORD cb; BYTE buf[3600]; - SET_EXPECT(ReportData); if(!state) { + first_call = TRUE; + state = 1; + if (http_is_first) { CHECK_CALLED(ReportProgress_FINDINGRESOURCE); @@ -1192,18 +1223,30 @@ static LRESULT WINAPI wnd_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam CHECK_NOT_CALLED(ReportProgress_CONNECTING); } CHECK_CALLED(ReportProgress_SENDINGREQUEST); - - SET_EXPECT(OnResponse); - SET_EXPECT(ReportProgress_MIMETYPEAVAILABLE); + if(!(bindf & BINDF_FROMURLMON)) + { + CHECK_CALLED(OnResponse); + CHECK_CALLED(ReportProgress_RAWMIMETYPE); + CHECK_CALLED(ReportData); + } + else + { + SET_EXPECT(OnResponse); + SET_EXPECT(ReportProgress_MIMETYPEAVAILABLE); + } } + SET_EXPECT(ReportData); - hres = IInternetProtocol_Continue(http_protocol, (PROTOCOLDATA*)lParam); - ok(hres == S_OK, "Continue failed: %08x\n", hres); + if (bindf & BINDF_FROMURLMON) + { + hres = IInternetProtocol_Continue(http_protocol, (PROTOCOLDATA*)lParam); + ok(hres == S_OK, "Continue failed: %08x\n", hres); - CHECK_CALLED(ReportData); - if(!state) { - CHECK_CALLED(OnResponse); - CHECK_CALLED(ReportProgress_MIMETYPEAVAILABLE); + CHECK_CALLED(ReportData); + if(first_call) { + CHECK_CALLED(OnResponse); + CHECK_CALLED(ReportProgress_MIMETYPEAVAILABLE); + } } do hres = IInternetProtocol_Read(http_protocol, buf, sizeof(buf), &cb); @@ -1214,9 +1257,7 @@ static LRESULT WINAPI wnd_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam if(hres == S_FALSE) PostMessage(protocol_hwnd, WM_USER+1, 0, 0); - if(!state) { - state = 1; - + if(first_call) { hres = IInternetProtocol_LockRequest(http_protocol, 0); ok(hres == S_OK, "LockRequest failed: %08x\n", hres);
1
0
0
0
Misha Koshelev : urlmon: Implement HttpProtocol::Terminate.
by Alexandre Julliard
19 Jul '07
19 Jul '07
Module: wine Branch: master Commit: b6aea93891a6781b057678915f375a5cdb2e3b63 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b6aea93891a6781b057678915…
Author: Misha Koshelev <mk144210(a)bcm.edu> Date: Wed Jul 18 20:00:01 2007 -0500 urlmon: Implement HttpProtocol::Terminate. --- dlls/urlmon/http.c | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) diff --git a/dlls/urlmon/http.c b/dlls/urlmon/http.c index d2d0241..6a8e603 100644 --- a/dlls/urlmon/http.c +++ b/dlls/urlmon/http.c @@ -633,8 +633,11 @@ static HRESULT WINAPI HttpProtocol_Abort(IInternetProtocol *iface, HRESULT hrRea static HRESULT WINAPI HttpProtocol_Terminate(IInternetProtocol *iface, DWORD dwOptions) { HttpProtocol *This = PROTOCOL_THIS(iface); - FIXME("(%p)->(%08x)\n", This, dwOptions); - return E_NOTIMPL; + + TRACE("(%p)->(%08x)\n", This, dwOptions); + HTTPPROTOCOL_Close(This); + + return S_OK; } static HRESULT WINAPI HttpProtocol_Suspend(IInternetProtocol *iface)
1
0
0
0
Misha Koshelev : urlmon: Fix HttpProtocol behavior when it is called without the BINDF_FROMURLMON flag .
by Alexandre Julliard
19 Jul '07
19 Jul '07
Module: wine Branch: master Commit: 043f71b576d8abbed77078e0b9a1d4892ec4b91c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=043f71b576d8abbed77078e0b…
Author: Misha Koshelev <mk144210(a)bcm.edu> Date: Wed Jul 18 19:59:11 2007 -0500 urlmon: Fix HttpProtocol behavior when it is called without the BINDF_FROMURLMON flag. --- dlls/urlmon/http.c | 24 +++++++++++++++++------- 1 files changed, 17 insertions(+), 7 deletions(-) diff --git a/dlls/urlmon/http.c b/dlls/urlmon/http.c index 5cf48d2..d2d0241 100644 --- a/dlls/urlmon/http.c +++ b/dlls/urlmon/http.c @@ -74,7 +74,7 @@ typedef struct { const IInternetProtocolVtbl *lpInternetProtocolVtbl; const IInternetPriorityVtbl *lpInternetPriorityVtbl; - DWORD flags; + DWORD flags, grfBINDF; IInternetProtocolSink *protocol_sink; IHttpNegotiate *http_negotiate; HINTERNET internet, connect, request; @@ -192,7 +192,10 @@ static void CALLBACK HTTPPROTOCOL_InternetStatusCallback( data.pData = (LPVOID)BINDSTATUS_ENDDOWNLOADCOMPONENTS; else data.pData = (LPVOID)BINDSTATUS_DOWNLOADINGDATA; - IInternetProtocolSink_Switch(This->protocol_sink, &data); + if (This->grfBINDF & BINDF_FROMURLMON) + IInternetProtocolSink_Switch(This->protocol_sink, &data); + else + IInternetProtocol_Continue((IInternetProtocol *)This, &data); return; default: WARN("Unhandled Internet status callback %d\n", dwInternetStatus); @@ -283,7 +286,7 @@ static HRESULT WINAPI HttpProtocol_Start(IInternetProtocol *iface, LPCWSTR szUrl HttpProtocol *This = PROTOCOL_THIS(iface); URL_COMPONENTSW url; BINDINFO bindinfo; - DWORD grfBINDF = 0, len = 0; + DWORD len = 0; ULONG num = 0; IServiceProvider *service_provider = 0; IHttpNegotiate2 *http_negotiate2 = 0; @@ -301,7 +304,7 @@ static HRESULT WINAPI HttpProtocol_Start(IInternetProtocol *iface, LPCWSTR szUrl memset(&bindinfo, 0, sizeof(bindinfo)); bindinfo.cbSize = sizeof(BINDINFO); - hres = IInternetBindInfo_GetBindInfo(pOIBindInfo, &grfBINDF, &bindinfo); + hres = IInternetBindInfo_GetBindInfo(pOIBindInfo, &This->grfBINDF, &bindinfo); if (hres != S_OK) { WARN("GetBindInfo failed: %08x\n", hres); @@ -331,6 +334,9 @@ static HRESULT WINAPI HttpProtocol_Start(IInternetProtocol *iface, LPCWSTR szUrl if (!url.nPort) url.nPort = INTERNET_DEFAULT_HTTP_PORT; + if(!(This->grfBINDF & BINDF_FROMURLMON)) + IInternetProtocolSink_ReportProgress(pOIProtSink, BINDSTATUS_DIRECTBIND, NULL); + hres = IInternetBindInfo_GetBindString(pOIBindInfo, BINDSTRING_USER_AGENT, &user_agent, 1, &num); if (hres != S_OK || !num) @@ -556,13 +562,17 @@ static HRESULT WINAPI HttpProtocol_Continue(IInternetProtocol *iface, PROTOCOLDA { WARN("HttpQueryInfo failed: %d\n", GetLastError()); IInternetProtocolSink_ReportProgress(This->protocol_sink, - BINDSTATUS_MIMETYPEAVAILABLE, + (This->grfBINDF & BINDF_FROMURLMON) ? + BINDSTATUS_MIMETYPEAVAILABLE : + BINDSTATUS_RAWMIMETYPE, wszDefaultContentType); } else { IInternetProtocolSink_ReportProgress(This->protocol_sink, - BINDSTATUS_MIMETYPEAVAILABLE, + (This->grfBINDF & BINDF_FROMURLMON) ? + BINDSTATUS_MIMETYPEAVAILABLE : + BINDSTATUS_RAWMIMETYPE, content_type); } @@ -831,7 +841,7 @@ HRESULT HttpProtocol_Construct(IUnknown *pUnkOuter, LPVOID *ppobj) ret->lpInternetProtocolVtbl = &HttpProtocolVtbl; ret->lpInternetPriorityVtbl = &HttpPriorityVtbl; - ret->flags = 0; + ret->flags = ret->grfBINDF = 0; ret->protocol_sink = 0; ret->http_negotiate = 0; ret->internet = ret->connect = ret->request = 0;
1
0
0
0
Misha Koshelev : urlmon/tests: Fix http_protocol tests to succeed when called more than once.
by Alexandre Julliard
19 Jul '07
19 Jul '07
Module: wine Branch: master Commit: 08786270710f5186a8c81540f33205f184b72b38 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=08786270710f5186a8c81540f…
Author: Misha Koshelev <mk144210(a)bcm.edu> Date: Wed Jul 18 19:59:06 2007 -0500 urlmon/tests: Fix http_protocol tests to succeed when called more than once. --- dlls/urlmon/tests/protocol.c | 43 +++++++++++++++++++++++++++++++++++------ 1 files changed, 36 insertions(+), 7 deletions(-) diff --git a/dlls/urlmon/tests/protocol.c b/dlls/urlmon/tests/protocol.c index abcc1cc..278c093 100644 --- a/dlls/urlmon/tests/protocol.c +++ b/dlls/urlmon/tests/protocol.c @@ -54,6 +54,12 @@ expect_ ## func = called_ ## func = FALSE; \ }while(0) +#define CHECK_NOT_CALLED(func) \ + do { \ + ok(!called_ ## func, "unexpected " #func "\n"); \ + expect_ ## func = called_ ## func = FALSE; \ + }while(0) + #define CLEAR_CALLED(func) \ expect_ ## func = called_ ## func = FALSE @@ -89,7 +95,7 @@ static const WCHAR index_url[] = static HRESULT expect_hrResult; static LPCWSTR file_name, http_url, expect_wsz; static IInternetProtocol *http_protocol = NULL; -static BOOL first_data_notif = FALSE; +static BOOL first_data_notif = FALSE, http_is_first = FALSE; static HWND protocol_hwnd; static int state = 0; static DWORD bindf = 0; @@ -1048,9 +1054,11 @@ static void test_file_protocol(void) { static BOOL http_protocol_start(LPCWSTR url, BOOL is_first) { + static BOOL got_user_agent = FALSE; HRESULT hres; first_data_notif = TRUE; + state = 0; SET_EXPECT(GetBindInfo); SET_EXPECT(GetBindString_USER_AGENT); @@ -1065,7 +1073,16 @@ static BOOL http_protocol_start(LPCWSTR url, BOOL is_first) return FALSE; CHECK_CALLED(GetBindInfo); - CHECK_CALLED(GetBindString_USER_AGENT); + if (!got_user_agent) + { + CHECK_CALLED(GetBindString_USER_AGENT); + got_user_agent = TRUE; + } + else todo_wine + { + /* user agent only retrieved once, even with different URLs */ + CHECK_NOT_CALLED(GetBindString_USER_AGENT); + } CHECK_CALLED(GetBindString_ACCEPT_MIMES); CHECK_CALLED(QueryService_HttpNegotiate); CHECK_CALLED(BeginningTransaction); @@ -1075,7 +1092,9 @@ static BOOL http_protocol_start(LPCWSTR url, BOOL is_first) return TRUE; } -static void test_http_protocol_url(LPCWSTR url) +/* is_first refers to whether this is the first call to this function + * _for this url_ */ +static void test_http_protocol_url(LPCWSTR url, BOOL is_first) { IInternetProtocolInfo *protocol_info; IClassFactory *factory; @@ -1084,6 +1103,7 @@ static void test_http_protocol_url(LPCWSTR url) trace("Testing http protocol...\n"); http_url = url; + http_is_first = is_first; hres = CoGetClassObject(&CLSID_HttpProtocol, CLSCTX_INPROC_SERVER, NULL, &IID_IUnknown, (void**)&unk); @@ -1118,7 +1138,7 @@ static void test_http_protocol_url(LPCWSTR url) SET_EXPECT(ReportProgress_CONNECTING); SET_EXPECT(ReportProgress_SENDINGREQUEST); - if(!http_protocol_start(url, TRUE)) + if(!http_protocol_start(url, is_first)) return; hres = IInternetProtocol_Read(http_protocol, buf, 2, &cb); @@ -1147,7 +1167,8 @@ static void test_http_protocol(void) 'o','r','g','/','s','i','t','e','/','a','b','o','u','t',0}; tested_protocol = HTTP_TEST; - test_http_protocol_url(winehq_url); + test_http_protocol_url(winehq_url, TRUE); + test_http_protocol_url(winehq_url, FALSE); } @@ -1160,8 +1181,16 @@ static LRESULT WINAPI wnd_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam SET_EXPECT(ReportData); if(!state) { - CHECK_CALLED(ReportProgress_FINDINGRESOURCE); - CHECK_CALLED(ReportProgress_CONNECTING); + if (http_is_first) + { + CHECK_CALLED(ReportProgress_FINDINGRESOURCE); + CHECK_CALLED(ReportProgress_CONNECTING); + } + else todo_wine + { + CHECK_NOT_CALLED(ReportProgress_FINDINGRESOURCE); + CHECK_NOT_CALLED(ReportProgress_CONNECTING); + } CHECK_CALLED(ReportProgress_SENDINGREQUEST); SET_EXPECT(OnResponse);
1
0
0
0
Misha Koshelev : urlmon/tests: Fix http_protocol tests to succeed on Win98.
by Alexandre Julliard
19 Jul '07
19 Jul '07
Module: wine Branch: master Commit: e2726effe277aee519671c8e0f86e31d78d3b00e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e2726effe277aee519671c8e0…
Author: Misha Koshelev <mk144210(a)bcm.edu> Date: Wed Jul 18 19:58:32 2007 -0500 urlmon/tests: Fix http_protocol tests to succeed on Win98. --- dlls/urlmon/tests/protocol.c | 24 +++++++++++++----------- 1 files changed, 13 insertions(+), 11 deletions(-) diff --git a/dlls/urlmon/tests/protocol.c b/dlls/urlmon/tests/protocol.c index 366a543..abcc1cc 100644 --- a/dlls/urlmon/tests/protocol.c +++ b/dlls/urlmon/tests/protocol.c @@ -54,6 +54,9 @@ expect_ ## func = called_ ## func = FALSE; \ }while(0) +#define CLEAR_CALLED(func) \ + expect_ ## func = called_ ## func = FALSE + DEFINE_EXPECT(GetBindInfo); DEFINE_EXPECT(ReportProgress_MIMETYPEAVAILABLE); DEFINE_EXPECT(ReportProgress_DIRECTBIND); @@ -246,7 +249,7 @@ static HRESULT WINAPI ProtocolSink_Switch(IInternetProtocolSink *iface, PROTOCOL { CHECK_EXPECT2(Switch); ok(pProtocolData != NULL, "pProtocolData == NULL\n"); - SendMessageW(protocol_hwnd, WM_USER, 0, (LPARAM)pProtocolData); + SendMessage(protocol_hwnd, WM_USER, 0, (LPARAM)pProtocolData); return S_OK; } @@ -1066,7 +1069,8 @@ static BOOL http_protocol_start(LPCWSTR url, BOOL is_first) CHECK_CALLED(GetBindString_ACCEPT_MIMES); CHECK_CALLED(QueryService_HttpNegotiate); CHECK_CALLED(BeginningTransaction); - CHECK_CALLED(GetRootSecurityId); + /* GetRootSecurityId called on WinXP but not on Win98 */ + CLEAR_CALLED(GetRootSecurityId); return TRUE; } @@ -1125,7 +1129,7 @@ static void test_http_protocol_url(LPCWSTR url) SET_EXPECT(ReportResult); expect_hrResult = S_OK; - GetMessageW(&msg, NULL, 0, 0); + GetMessage(&msg, NULL, 0, 0); CHECK_CALLED(Switch); CHECK_CALLED(ReportResult); @@ -1179,7 +1183,7 @@ static LRESULT WINAPI wnd_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam ok(hres == S_FALSE || hres == E_PENDING, "Read failed: %08x\n", hres); if(hres == S_FALSE) - PostMessageW(protocol_hwnd, WM_USER+1, 0, 0); + PostMessage(protocol_hwnd, WM_USER+1, 0, 0); if(!state) { state = 1; @@ -1198,19 +1202,17 @@ static LRESULT WINAPI wnd_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam static HWND create_protocol_window(void) { - static const WCHAR wszProtocolWindow[] = - {'P','r','o','t','o','c','o','l','W','i','n','d','o','w',0}; - static WNDCLASSEXW wndclass = { - sizeof(WNDCLASSEXW), + static WNDCLASSEX wndclass = { + sizeof(WNDCLASSEX), 0, wnd_proc, 0, 0, NULL, NULL, NULL, NULL, NULL, - wszProtocolWindow, + "ProtocolWindow", NULL }; - RegisterClassExW(&wndclass); - return CreateWindowW(wszProtocolWindow, wszProtocolWindow, + RegisterClassEx(&wndclass); + return CreateWindow("ProtocolWindow", "ProtocolWindow", WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, NULL, NULL); }
1
0
0
0
Misha Koshelev : urlmon: Use InternetCloseHandle instead of CloseHandle.
by Alexandre Julliard
19 Jul '07
19 Jul '07
Module: wine Branch: master Commit: c2534d0cd6657fe0e777129360e0f1c3412bc520 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c2534d0cd6657fe0e77712936…
Author: Misha Koshelev <mk144210(a)bcm.edu> Date: Wed Jul 18 19:58:15 2007 -0500 urlmon: Use InternetCloseHandle instead of CloseHandle. --- dlls/urlmon/http.c | 16 +++++++++++++--- 1 files changed, 13 insertions(+), 3 deletions(-) diff --git a/dlls/urlmon/http.c b/dlls/urlmon/http.c index d7ec406..5cf48d2 100644 --- a/dlls/urlmon/http.c +++ b/dlls/urlmon/http.c @@ -147,10 +147,20 @@ static void HTTPPROTOCOL_Close(HttpProtocol *This) This->http_negotiate = 0; } if (This->request) + { InternetCloseHandle(This->request); - CloseHandle(This->connect); - CloseHandle(This->internet); - This->request = This->connect = This->internet = 0; + This->request = 0; + } + if (This->connect) + { + InternetCloseHandle(This->connect); + This->connect = 0; + } + if (This->internet) + { + InternetCloseHandle(This->internet); + This->internet = 0; + } This->flags = 0; }
1
0
0
0
← Newer
1
...
44
45
46
47
48
49
50
...
96
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
Results per page:
10
25
50
100
200