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
August 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
770 discussions
Start a n
N
ew thread
Alexandre Julliard : winecfg: Fix deletion of registry keys for Wow64 mode.
by Alexandre Julliard
26 Aug '11
26 Aug '11
Module: wine Branch: master Commit: fdc0d0f95f8a86b73094db15aaca2f861aab50f8 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=fdc0d0f95f8a86b73094db15a…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Fri Aug 26 14:28:11 2011 +0200 winecfg: Fix deletion of registry keys for Wow64 mode. --- programs/winecfg/winecfg.c | 12 ++++++++++-- 1 files changed, 10 insertions(+), 2 deletions(-) diff --git a/programs/winecfg/winecfg.c b/programs/winecfg/winecfg.c index 1d2ec50..8a2f534 100644 --- a/programs/winecfg/winecfg.c +++ b/programs/winecfg/winecfg.c @@ -645,7 +645,11 @@ static void process_setting(struct setting *s) { /* NULL name means remove that path/section entirely */ if (s->name) RegDeleteValueW( key, s->name ); - else RegDeleteTreeW( key, NULL ); + else + { + RegDeleteTreeW( key, NULL ); + RegDeleteKeyW( s->root, s->path ); + } RegCloseKey( key ); } if (needs_wow64) @@ -654,7 +658,11 @@ static void process_setting(struct setting *s) if (!RegOpenKeyExW( s->root, s->path, 0, MAXIMUM_ALLOWED | KEY_WOW64_32KEY, &key )) { if (s->name) RegDeleteValueW( key, s->name ); - else RegDeleteTreeW( key, NULL ); + else + { + RegDeleteTreeW( key, NULL ); + RegDeleteKeyExW( s->root, s->path, KEY_WOW64_32KEY, 0 ); + } RegCloseKey( key ); } }
1
0
0
0
Bernhard Loos : msi: Implement proper sorting in WHEREVIEW.
by Alexandre Julliard
26 Aug '11
26 Aug '11
Module: wine Branch: master Commit: f0a53a8f1bde9b8f1be096160f9664415835e29b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f0a53a8f1bde9b8f1be096160…
Author: Bernhard Loos <bernhardloos(a)googlemail.com> Date: Fri Aug 26 04:53:44 2011 +0200 msi: Implement proper sorting in WHEREVIEW. --- dlls/msi/where.c | 118 ++++++++++++++++++++++++++++++++++++++++++++++++----- 1 files changed, 106 insertions(+), 12 deletions(-) diff --git a/dlls/msi/where.c b/dlls/msi/where.c index 0742244..16b6c03 100644 --- a/dlls/msi/where.c +++ b/dlls/msi/where.c @@ -38,9 +38,9 @@ WINE_DEFAULT_DEBUG_CHANNEL(msidb); /* below is the query interface to a table */ - typedef struct tagMSIROWENTRY { + struct tagMSIWHEREVIEW *wv; /* used during sorting */ UINT values[1]; } MSIROWENTRY; @@ -53,6 +53,13 @@ typedef struct tagJOINTABLE UINT table_index; } JOINTABLE; +typedef struct tagMSIORDERINFO +{ + UINT col_count; + UINT error; + union ext_column columns[1]; +} MSIORDERINFO; + typedef struct tagMSIWHEREVIEW { MSIVIEW view; @@ -65,6 +72,7 @@ typedef struct tagMSIWHEREVIEW UINT reorder_size; /* number of entries available in reorder */ struct expr *cond; UINT rec_index; + MSIORDERINFO *order_info; } MSIWHEREVIEW; #define INITIAL_REORDER_SIZE 16 @@ -136,6 +144,7 @@ static UINT add_row(MSIWHEREVIEW *wv, UINT vals[]) wv->reorder[wv->row_count++] = new; memcpy(new->values, vals, wv->table_count * sizeof(UINT)); + new->wv = wv; return ERROR_SUCCESS; } @@ -549,6 +558,53 @@ static UINT check_condition( MSIWHEREVIEW *wv, MSIRECORD *record, JOINTABLE *tab return r; } +static int compare_entry( const void *left, const void *right ) +{ + const MSIROWENTRY *le = *(const MSIROWENTRY**)left; + const MSIROWENTRY *re = *(const MSIROWENTRY**)right; + const MSIWHEREVIEW *wv = le->wv; + MSIORDERINFO *order = wv->order_info; + UINT i, j, r, l_val, r_val; + + assert(le->wv == re->wv); + + if (order) + { + for (i = 0; i < order->col_count; i++) + { + const union ext_column *column = &order->columns[i]; + + r = column->parsed.table->view->ops->fetch_int(column->parsed.table->view, + le->values[column->parsed.table->table_index], + column->parsed.column, &l_val); + if (r != ERROR_SUCCESS) + { + order->error = r; + return 0; + } + + r = column->parsed.table->view->ops->fetch_int(column->parsed.table->view, + re->values[column->parsed.table->table_index], + column->parsed.column, &r_val); + if (r != ERROR_SUCCESS) + { + order->error = r; + return 0; + } + + if (l_val != r_val) + return l_val < r_val ? -1 : 1; + } + } + + for (j = 0; j < wv->table_count; j++) + { + if (le->values[j] != re->values[j]) + return le->values[j] < re->values[j] ? -1 : 1; + } + return 0; +} + static UINT WHERE_execute( struct tagMSIVIEW *view, MSIRECORD *record ) { MSIWHEREVIEW *wv = (MSIWHEREVIEW*)view; @@ -583,6 +639,15 @@ static UINT WHERE_execute( struct tagMSIVIEW *view, MSIRECORD *record ) while ((table = table->next)); r = check_condition(wv, record, wv->tables, rows); + + if (wv->order_info) + wv->order_info->error = ERROR_SUCCESS; + + qsort(wv->reorder, wv->row_count, sizeof(MSIROWENTRY *), compare_entry); + + if (wv->order_info) + r = wv->order_info->error; + return r; } @@ -773,6 +838,12 @@ static UINT WHERE_delete( struct tagMSIVIEW *view ) free_reorder(wv); + if (wv->order_info) + { + msi_free(wv->order_info); + wv->order_info = NULL; + } + msiobj_release( &wv->db->hdr ); msi_free( wv ); @@ -813,22 +884,49 @@ static UINT WHERE_sort(struct tagMSIVIEW *view, column_info *columns) { MSIWHEREVIEW *wv = (MSIWHEREVIEW *)view; JOINTABLE *table = wv->tables; - UINT r; + column_info *column = columns; + MSIORDERINFO *orderinfo; + UINT r, count = 0; + int i; TRACE("%p %p\n", view, columns); if (!table) return ERROR_FUNCTION_FAILED; - do + while (column) { - r = table->view->ops->sort(table->view, columns); + count++; + column = column->next; + } + + if (count == 0) + return ERROR_SUCCESS; + + orderinfo = msi_alloc(sizeof(MSIORDERINFO) + (count - 1) * sizeof(union ext_column)); + if (!orderinfo) + return ERROR_OUTOFMEMORY; + + orderinfo->col_count = count; + + column = columns; + + for (i = 0; i < count; i++) + { + orderinfo->columns[i].unparsed.column = column->column; + orderinfo->columns[i].unparsed.table = column->table; + + r = parse_column(wv, &orderinfo->columns[i], NULL); if (r != ERROR_SUCCESS) - return r; + goto error; } - while ((table = table->next)); + + wv->order_info = orderinfo; return ERROR_SUCCESS; +error: + msi_free(orderinfo); + return r; } static const MSIVIEWOPS where_ops = @@ -949,7 +1047,6 @@ UINT WHERE_CreateView( MSIDATABASE *db, MSIVIEW **view, LPWSTR tables, MSIWHEREVIEW *wv = NULL; UINT r, valid = 0; WCHAR *ptr; - JOINTABLE **lastnext; TRACE("(%s)\n", debugstr_w(tables) ); @@ -963,8 +1060,6 @@ UINT WHERE_CreateView( MSIDATABASE *db, MSIVIEW **view, LPWSTR tables, wv->db = db; wv->cond = cond; - lastnext = &wv->tables; - while (*tables) { JOINTABLE *table; @@ -998,10 +1093,9 @@ UINT WHERE_CreateView( MSIDATABASE *db, MSIVIEW **view, LPWSTR tables, wv->col_count += table->col_count; table->table_index = wv->table_count++; - table->next = NULL; - *lastnext = table; - lastnext = &table->next; + table->next = wv->tables; + wv->tables = table; if (!ptr) break;
1
0
0
0
Bernhard Loos : msi: Protected primary keys against modification.
by Alexandre Julliard
26 Aug '11
26 Aug '11
Module: wine Branch: master Commit: abd1174941b7e074d3cd14c3a121febd6eed96b7 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=abd1174941b7e074d3cd14c3a…
Author: Bernhard Loos <bernhardloos(a)googlemail.com> Date: Fri Aug 26 04:53:39 2011 +0200 msi: Protected primary keys against modification. --- dlls/msi/msipriv.h | 1 + dlls/msi/record.c | 50 ++++++++++++++++++++++++++------------------- dlls/msi/where.c | 56 +++++++++++++++++++++++++++++++++++++++++++++------ 3 files changed, 79 insertions(+), 28 deletions(-) diff --git a/dlls/msi/msipriv.h b/dlls/msi/msipriv.h index 2524752..998970b 100644 --- a/dlls/msi/msipriv.h +++ b/dlls/msi/msipriv.h @@ -809,6 +809,7 @@ extern UINT MSI_RecordSetStreamFromFileW( MSIRECORD *, UINT, LPCWSTR ) DECLSPEC_ extern UINT MSI_RecordCopyField( MSIRECORD *, UINT, MSIRECORD *, UINT ) DECLSPEC_HIDDEN; extern MSIRECORD *MSI_CloneRecord( MSIRECORD * ) DECLSPEC_HIDDEN; extern BOOL MSI_RecordsAreEqual( MSIRECORD *, MSIRECORD * ) DECLSPEC_HIDDEN; +extern BOOL MSI_RecordsAreFieldsEqual(MSIRECORD *a, MSIRECORD *b, UINT field) DECLSPEC_HIDDEN; /* stream internals */ extern void enum_stream_names( IStorage *stg ) DECLSPEC_HIDDEN; diff --git a/dlls/msi/record.c b/dlls/msi/record.c index 0e4fb8a..7acbfc7 100644 --- a/dlls/msi/record.c +++ b/dlls/msi/record.c @@ -994,6 +994,34 @@ MSIRECORD *MSI_CloneRecord(MSIRECORD *rec) return clone; } +BOOL MSI_RecordsAreFieldsEqual(MSIRECORD *a, MSIRECORD *b, UINT field) +{ + if (a->fields[field].type != b->fields[field].type) + return FALSE; + + switch (a->fields[field].type) + { + case MSIFIELD_NULL: + break; + + case MSIFIELD_INT: + if (a->fields[field].u.iVal != b->fields[field].u.iVal) + return FALSE; + break; + + case MSIFIELD_WSTR: + if (strcmpW(a->fields[field].u.szwVal, b->fields[field].u.szwVal)) + return FALSE; + break; + + case MSIFIELD_STREAM: + default: + return FALSE; + } + return TRUE; +} + + BOOL MSI_RecordsAreEqual(MSIRECORD *a, MSIRECORD *b) { UINT i; @@ -1003,28 +1031,8 @@ BOOL MSI_RecordsAreEqual(MSIRECORD *a, MSIRECORD *b) for (i = 0; i <= a->count; i++) { - if (a->fields[i].type != b->fields[i].type) + if (!MSI_RecordsAreFieldsEqual( a, b, i )) return FALSE; - - switch (a->fields[i].type) - { - case MSIFIELD_NULL: - break; - - case MSIFIELD_INT: - if (a->fields[i].u.iVal != b->fields[i].u.iVal) - return FALSE; - break; - - case MSIFIELD_WSTR: - if (strcmpW(a->fields[i].u.szwVal, b->fields[i].u.szwVal)) - return FALSE; - break; - - case MSIFIELD_STREAM: - default: - return FALSE; - } } return TRUE; diff --git a/dlls/msi/where.c b/dlls/msi/where.c index d8ac5e8..0742244 100644 --- a/dlls/msi/where.c +++ b/dlls/msi/where.c @@ -262,9 +262,10 @@ static UINT WHERE_get_row( struct tagMSIVIEW *view, UINT row, MSIRECORD **rec ) static UINT WHERE_set_row( struct tagMSIVIEW *view, UINT row, MSIRECORD *rec, UINT mask ) { MSIWHEREVIEW *wv = (MSIWHEREVIEW*)view; - UINT r, offset = 0, reduced_mask = 0; + UINT i, r, offset = 0; JOINTABLE *table = wv->tables; UINT *rows; + UINT mask_copy = mask; TRACE("%p %d %p %08x\n", wv, row, rec, mask ); @@ -275,28 +276,54 @@ static UINT WHERE_set_row( struct tagMSIVIEW *view, UINT row, MSIRECORD *rec, UI if (r != ERROR_SUCCESS) return r; - if(mask >= 1 << wv->col_count) + if (mask >= 1 << wv->col_count) return ERROR_INVALID_PARAMETER; do { + for (i = 0; i < table->col_count; i++) { + UINT type; + + if (!(mask_copy & (1 << i))) + continue; + r = table->view->ops->get_column_info(table->view, i + 1, NULL, + &type, NULL, NULL ); + if (r != ERROR_SUCCESS) + return r; + if (type & MSITYPE_KEY) + return ERROR_FUNCTION_FAILED; + } + mask_copy >>= table->col_count; + } + while (mask_copy && (table = table->next)); + + table = wv->tables; + + do + { const UINT col_count = table->col_count; UINT i; MSIRECORD *reduced; + UINT reduced_mask = (mask >> offset) & ((1 << col_count) - 1); + + if (!reduced_mask) + { + offset += col_count; + continue; + } reduced = MSI_CreateRecord(col_count); if (!reduced) return ERROR_FUNCTION_FAILED; - for (i = 0; i < col_count; i++) + for (i = 1; i <= col_count; i++) { - r = MSI_RecordCopyField(rec, i + offset + 1, reduced, i + 1); + r = MSI_RecordCopyField(rec, i + offset, reduced, i); if (r != ERROR_SUCCESS) break; } offset += col_count; - reduced_mask = mask >> (wv->col_count - offset) & ((1 << col_count) - 1); if (r == ERROR_SUCCESS) r = table->view->ops->set_row(table->view, rows[table->table_index], reduced, reduced_mask); @@ -644,13 +671,28 @@ static UINT join_find_row( MSIWHEREVIEW *wv, MSIRECORD *rec, UINT *row ) static UINT join_modify_update( struct tagMSIVIEW *view, MSIRECORD *rec ) { MSIWHEREVIEW *wv = (MSIWHEREVIEW *)view; - UINT r, row; + UINT r, row, i, mask = 0; + MSIRECORD *current; + r = join_find_row( wv, rec, &row ); if (r != ERROR_SUCCESS) return r; - return WHERE_set_row( view, row, rec, (1 << wv->col_count) - 1 ); + r = msi_view_get_row( wv->db, view, row, ¤t ); + if (r != ERROR_SUCCESS) + return r; + + assert(MSI_RecordGetFieldCount(rec) == MSI_RecordGetFieldCount(current)); + + for (i = MSI_RecordGetFieldCount(rec); i > 0; i--) + { + if (!MSI_RecordsAreFieldsEqual(rec, current, i)) + mask |= 1 << (i - 1); + } + msiobj_release(¤t->hdr); + + return WHERE_set_row( view, row, rec, mask ); } static UINT WHERE_modify( struct tagMSIVIEW *view, MSIMODIFY eModifyMode,
1
0
0
0
Bernhard Loos : msi: Make WHEREVIEW able to deal directly with multiple tables.
by Alexandre Julliard
26 Aug '11
26 Aug '11
Module: wine Branch: master Commit: a52c2bf9417a965a087a2e4f76fde78b7b3c7f74 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a52c2bf9417a965a087a2e4f7…
Author: Bernhard Loos <bernhardloos(a)googlemail.com> Date: Fri Aug 26 04:53:34 2011 +0200 msi: Make WHEREVIEW able to deal directly with multiple tables. --- dlls/msi/query.h | 22 ++- dlls/msi/sql.y | 8 +- dlls/msi/tests/db.c | 2 +- dlls/msi/update.c | 23 +-- dlls/msi/where.c | 634 ++++++++++++++++++++++++++++++++++++--------------- 5 files changed, 478 insertions(+), 211 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=a52c2bf9417a965a087a2…
1
0
0
0
Frédéric Delanoy : cmd/tests: Add variable substitution tests.
by Alexandre Julliard
26 Aug '11
26 Aug '11
Module: wine Branch: master Commit: 9b79fd5777fcd2058850aa632746089ea7a6576c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9b79fd5777fcd2058850aa632…
Author: Frédéric Delanoy <frederic.delanoy(a)gmail.com> Date: Fri Aug 26 01:19:28 2011 +0200 cmd/tests: Add variable substitution tests. --- programs/cmd/tests/test_builtins.cmd | 110 ++++++++++++++++++++++++++++++ programs/cmd/tests/test_builtins.cmd.exp | 62 +++++++++++++++++ 2 files changed, 172 insertions(+), 0 deletions(-) diff --git a/programs/cmd/tests/test_builtins.cmd b/programs/cmd/tests/test_builtins.cmd index f5df409..78eea97 100644 --- a/programs/cmd/tests/test_builtins.cmd +++ b/programs/cmd/tests/test_builtins.cmd @@ -227,6 +227,116 @@ echo '%VAR:~-2,-4%' echo %VAR:~-3,-2% set VAR= +echo ------------ Testing variable substitution -------------- +echo ...in FOR variables +for %%i in ("A B" C) do echo %%i +rem quotes removal +for %%i in ("A B" C) do echo '%%~i' +rem fully qualified path +for %%f in ("C D" E) do echo %%~ff +rem drive letter +for %%i in ("F G" H) do echo %%~di +rem path +for %%d in ("I J" K) do echo %%~pd +rem filename +for %%i in ("L M" N) do echo %%~ni +rem file extension +for %%i in ("O. P.OOL" Q.TABC hello) do echo '%%~xi' +rem path with short path names +for %%I in ("R S" T ABCDEFGHIJK.LMNOP) do echo '%%~sI' +rem file attribute +for %%i in ("U V" W) do echo '%%~ai' +echo foo> foo +for %%i in (foo) do echo '%%~ai' +del foo +rem file date/time +rem Not fully testable, until we can grep dir's output to get foo's creation time in an envvar... +for %%i in ("a b" c) do echo '%%~ti' +rem file size +rem Similar issues as above +for %%i in ("a b" c) do echo '%%~zi' +rem combined options +for %%i in ("d e" f) do echo %%~dpi +for %%i in ("g h" i) do echo %%~sdi +for %%i in ("g h" i) do echo %%~dsi +for %%i in ("j k" l.eh) do echo '%%~xsi' + +echo ...in parameters +for %%i in ("A B" C) do call :echoFun %%i +rem quotes removal +for %%i in ("A B" C) do call :echoFunQ %%i +rem fully qualified path +for %%f in ("C D" E) do call :echoFunF %%f +rem drive letter +for %%i in ("F G" H) do call :echoFunD %%i +rem path +for %%d in ("I J" K) do call :echoFunP %%d +rem filename +for %%i in ("L M" N) do call :echoFunN %%i +rem file extension +for %%i in ("O. P.OOL" Q.TABC hello) do call :echoFunX %%i +rem path with short path names +for %%I in ("R S" T ABCDEFGHIJK.LMNOP) do call :echoFunS %%I +rem NT4 aborts whole script execution when encountering ~a, ~t and ~z substitutions, preventing full testing +rem combined options +for %%i in ("d e" f) do call :echoFunDP %%i +for %%i in ("g h" i) do call :echoFunSD %%i +for %%i in ("g h" i) do call :echoFunDS %%i +for %%i in ("j k" l.eh) do call :echoFunXS %%i + +goto :endEchoFuns +:echoFun +echo %1 +goto :eof + +:echoFunQ +echo '%~1' +goto :eof + +:echoFunF +echo %~f1 +goto :eof + +:echoFunD +echo %~d1 +goto :eof + +:echoFunP +echo %~p1 +goto :eof + +:echoFunN +echo %~n1 +goto :eof + +:echoFunX +echo '%~x1' +goto :eof + +:echoFunS +rem some NT4 workaround +set VAR='%~s1' +echo %VAR% +set VAR= +goto :eof + +:echoFunDP +echo %~dp1 +goto :eof + +:echoFunSD +echo %~sd1 +goto :eof + +:echoFunDS +echo %~ds1 +goto :eof + +:echoFunXS +echo '%~xs1' +goto :eof +:endEchoFuns + echo ------------ Testing variable delayed expansion -------------- rem NT4 doesn't support this echo ...default mode (load-time expansion) diff --git a/programs/cmd/tests/test_builtins.cmd.exp b/programs/cmd/tests/test_builtins.cmd.exp index 04e04a7..85afd34 100644 --- a/programs/cmd/tests/test_builtins.cmd.exp +++ b/programs/cmd/tests/test_builtins.cmd.exp @@ -213,6 +213,68 @@ ert@or_broken@qwerty e@or_broken@qwerty ''@or_broken@'qwerty' r@or_broken@qwerty +------------ Testing variable substitution -------------- +...in FOR variables +@todo_wine@"A B" +C +'A B'@or_broken@'' +'C'@or_broken@'' +@pwd@\C D@or_broken@%~ff +@pwd@\E@or_broken@%~ff +@drive@ +@drive@ +@path@@or_broken@%~pd +@path@@or_broken@%~pd +L M +N +'.OOL' +'.TABC' +'' +@todo_wine@'@drive@@shortpath@R S'@or_broken@'' +@todo_wine@'@drive@@shortpath@T'@or_broken@'' +@todo_wine@'@drive@@shortpath@ABCDEFGHIJK.LMNOP'@or_broken@'' +@todo_wine@''@or_broken@'%~ai' +@todo_wine@''@or_broken@'%~ai' +@todo_wine@'--a------'@or_broken@'%~ai' +@todo_wine@''@or_broken@'%~ti' +@todo_wine@''@or_broken@'%~ti' +@todo_wine@''@or_broken@'%~zi' +@todo_wine@''@or_broken@'%~zi' +@drive@@path@ +@drive@@path@ +@drive@ +@drive@ +@drive@ +@drive@ +'' +'.eh' +...in parameters +@todo_wine@"A B" +C +@todo_wine@'A B'@or_broken@'' +'C'@or_broken@'' +@todo_wine@@pwd@\C D +@pwd@\E +@drive@ +@drive@ +@path@ +@path@ +@todo_wine@L M +N +@todo_wine@'.OOL' +'.TABC' +'' +@todo_wine@'@drive@@shortpath@R S'@or_broken@'' +@todo_wine@'@drive@@shortpath@T'@or_broken@'' +@todo_wine@'@drive@@shortpath@ABCDEFGHIJK.LMNOP'@or_broken@'' +@drive@@path@ +@drive@@path@ +@drive@ +@drive@ +@drive@ +@drive@ +'' +'.eh'@or_broken@'' ------------ Testing variable delayed expansion -------------- ...default mode (load-time expansion) foo
1
0
0
0
Frédéric Delanoy : cmd: Add @shortpath@ keyword, replaced by expanded path with short names.
by Alexandre Julliard
26 Aug '11
26 Aug '11
Module: wine Branch: master Commit: c85be8aecc99ceb5bba0712e5ac90f9cec7670ed URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c85be8aecc99ceb5bba0712e5…
Author: Frédéric Delanoy <frederic.delanoy(a)gmail.com> Date: Fri Aug 26 01:19:27 2011 +0200 cmd: Add @shortpath@ keyword, replaced by expanded path with short names. --- programs/cmd/tests/batch.c | 16 ++++++++++++++++ 1 files changed, 16 insertions(+), 0 deletions(-) diff --git a/programs/cmd/tests/batch.c b/programs/cmd/tests/batch.c index 7c5a204..58d75c3 100644 --- a/programs/cmd/tests/batch.c +++ b/programs/cmd/tests/batch.c @@ -28,6 +28,8 @@ static char drive[2]; static const DWORD drive_len = sizeof(drive)/sizeof(drive[0]); static char path[MAX_PATH]; static DWORD path_len; +static char shortpath[MAX_PATH]; +static DWORD shortpath_len; /* Convert to DOS line endings, and substitute escaped whitespace chars with real ones */ static const char* convert_input_data(const char *data, DWORD size, DWORD *new_size) @@ -160,6 +162,7 @@ static const char *compare_line(const char *out_line, const char *out_end, const static const char pwd_cmd[] = {'@','p','w','d','@'}; static const char drive_cmd[] = {'@','d','r','i','v','e','@'}; static const char path_cmd[] = {'@','p','a','t','h','@'}; + static const char shortpath_cmd[] = {'@','s','h','o','r','t','p','a','t','h','@'}; static const char space_cmd[] = {'@','s','p','a','c','e','@'}; static const char tab_cmd[] = {'@','t','a','b','@'}; static const char or_broken_cmd[] = {'@','o','r','_','b','r','o','k','e','n','@'}; @@ -199,6 +202,17 @@ static const char *compare_line(const char *out_line, const char *out_end, const out_ptr += path_len; continue; } + } else if(exp_ptr+sizeof(shortpath_cmd) <= exp_end + && !memcmp(exp_ptr, shortpath_cmd, sizeof(shortpath_cmd))) { + exp_ptr += sizeof(shortpath_cmd); + if(out_end-out_ptr < shortpath_len + || (CompareStringA(LOCALE_SYSTEM_DEFAULT, NORM_IGNORECASE, + out_ptr, shortpath_len, shortpath, shortpath_len) != CSTR_EQUAL)) { + err = out_ptr; + }else { + out_ptr += shortpath_len; + continue; + } }else if(exp_ptr+sizeof(space_cmd) <= exp_end && !memcmp(exp_ptr, space_cmd, sizeof(space_cmd))) { exp_ptr += sizeof(space_cmd); @@ -424,6 +438,8 @@ START_TEST(batch) memcpy(path, workdir + drive_len, (workdir_len - drive_len) * sizeof(drive[0])); path[workdir_len - drive_len] = '\\'; path_len = workdir_len - drive_len + 1; + shortpath_len = GetShortPathNameA(path, shortpath, + sizeof(shortpath)/sizeof(shortpath[0])); argc = winetest_get_mainargs(&argv); if(argc > 2)
1
0
0
0
Frédéric Delanoy : cmd: Add @path@ keyword, replaced by regular non-expanded path.
by Alexandre Julliard
26 Aug '11
26 Aug '11
Module: wine Branch: master Commit: 68e7fcda59ee3d2a2095df3ed63144a5a66b0454 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=68e7fcda59ee3d2a2095df3ed…
Author: Frédéric Delanoy <frederic.delanoy(a)gmail.com> Date: Fri Aug 26 01:19:26 2011 +0200 cmd: Add @path@ keyword, replaced by regular non-expanded path. --- programs/cmd/tests/batch.c | 17 +++++++++++++++++ 1 files changed, 17 insertions(+), 0 deletions(-) diff --git a/programs/cmd/tests/batch.c b/programs/cmd/tests/batch.c index b3b28c6..7c5a204 100644 --- a/programs/cmd/tests/batch.c +++ b/programs/cmd/tests/batch.c @@ -26,6 +26,8 @@ static char workdir[MAX_PATH]; static DWORD workdir_len; static char drive[2]; static const DWORD drive_len = sizeof(drive)/sizeof(drive[0]); +static char path[MAX_PATH]; +static DWORD path_len; /* Convert to DOS line endings, and substitute escaped whitespace chars with real ones */ static const char* convert_input_data(const char *data, DWORD size, DWORD *new_size) @@ -157,6 +159,7 @@ static const char *compare_line(const char *out_line, const char *out_end, const static const char pwd_cmd[] = {'@','p','w','d','@'}; static const char drive_cmd[] = {'@','d','r','i','v','e','@'}; + static const char path_cmd[] = {'@','p','a','t','h','@'}; static const char space_cmd[] = {'@','s','p','a','c','e','@'}; static const char tab_cmd[] = {'@','t','a','b','@'}; static const char or_broken_cmd[] = {'@','o','r','_','b','r','o','k','e','n','@'}; @@ -185,6 +188,17 @@ static const char *compare_line(const char *out_line, const char *out_end, const out_ptr += drive_len; continue; } + } else if(exp_ptr+sizeof(path_cmd) <= exp_end + && !memcmp(exp_ptr, path_cmd, sizeof(path_cmd))) { + exp_ptr += sizeof(path_cmd); + if(out_end-out_ptr < path_len + || (CompareStringA(LOCALE_SYSTEM_DEFAULT, NORM_IGNORECASE, + out_ptr, path_len, path, path_len) != CSTR_EQUAL)) { + err = out_ptr; + }else { + out_ptr += path_len; + continue; + } }else if(exp_ptr+sizeof(space_cmd) <= exp_end && !memcmp(exp_ptr, space_cmd, sizeof(space_cmd))) { exp_ptr += sizeof(space_cmd); @@ -407,6 +421,9 @@ START_TEST(batch) workdir_len = GetCurrentDirectoryA(sizeof(workdir), workdir); drive[0] = workdir[0]; drive[1] = workdir[1]; /* Should be ':' */ + memcpy(path, workdir + drive_len, (workdir_len - drive_len) * sizeof(drive[0])); + path[workdir_len - drive_len] = '\\'; + path_len = workdir_len - drive_len + 1; argc = winetest_get_mainargs(&argv); if(argc > 2)
1
0
0
0
Frédéric Delanoy : cmd: Add @drive@ keyword, replaced by drive letter.
by Alexandre Julliard
26 Aug '11
26 Aug '11
Module: wine Branch: master Commit: 64ce7c0ede9f24e314a0ed5285091bb69d5e73c3 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=64ce7c0ede9f24e314a0ed528…
Author: Frédéric Delanoy <frederic.delanoy(a)gmail.com> Date: Fri Aug 26 01:19:25 2011 +0200 cmd: Add @drive@ keyword, replaced by drive letter. --- programs/cmd/tests/batch.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/programs/cmd/tests/batch.c b/programs/cmd/tests/batch.c index 43e2073..b3b28c6 100644 --- a/programs/cmd/tests/batch.c +++ b/programs/cmd/tests/batch.c @@ -179,8 +179,7 @@ static const char *compare_line(const char *out_line, const char *out_end, const exp_ptr += sizeof(drive_cmd); if(out_end-out_ptr < drive_len || (CompareStringA(LOCALE_SYSTEM_DEFAULT, NORM_IGNORECASE, -out_ptr, drive_len, - drive, drive_len) != CSTR_EQUAL)) { + out_ptr, drive_len, drive, drive_len) != CSTR_EQUAL)) { err = out_ptr; }else { out_ptr += drive_len;
1
0
0
0
Frédéric Delanoy : cmd: Add @drive@ keyword, replaced by drive letter.
by Alexandre Julliard
26 Aug '11
26 Aug '11
Module: wine Branch: master Commit: 1e89625b11198fe2c0c956a10eebd883fae301b7 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1e89625b11198fe2c0c956a10…
Author: Frédéric Delanoy <frederic.delanoy(a)gmail.com> Date: Fri Aug 26 01:19:25 2011 +0200 cmd: Add @drive@ keyword, replaced by drive letter. --- programs/cmd/tests/batch.c | 17 +++++++++++++++++ 1 files changed, 17 insertions(+), 0 deletions(-) diff --git a/programs/cmd/tests/batch.c b/programs/cmd/tests/batch.c index cb3d972..43e2073 100644 --- a/programs/cmd/tests/batch.c +++ b/programs/cmd/tests/batch.c @@ -24,6 +24,8 @@ static char workdir[MAX_PATH]; static DWORD workdir_len; +static char drive[2]; +static const DWORD drive_len = sizeof(drive)/sizeof(drive[0]); /* Convert to DOS line endings, and substitute escaped whitespace chars with real ones */ static const char* convert_input_data(const char *data, DWORD size, DWORD *new_size) @@ -154,6 +156,7 @@ static const char *compare_line(const char *out_line, const char *out_end, const const char *err = NULL; static const char pwd_cmd[] = {'@','p','w','d','@'}; + static const char drive_cmd[] = {'@','d','r','i','v','e','@'}; static const char space_cmd[] = {'@','s','p','a','c','e','@'}; static const char tab_cmd[] = {'@','t','a','b','@'}; static const char or_broken_cmd[] = {'@','o','r','_','b','r','o','k','e','n','@'}; @@ -171,6 +174,18 @@ static const char *compare_line(const char *out_line, const char *out_end, const out_ptr += workdir_len; continue; } + } else if(exp_ptr+sizeof(drive_cmd) <= exp_end + && !memcmp(exp_ptr, drive_cmd, sizeof(drive_cmd))) { + exp_ptr += sizeof(drive_cmd); + if(out_end-out_ptr < drive_len + || (CompareStringA(LOCALE_SYSTEM_DEFAULT, NORM_IGNORECASE, +out_ptr, drive_len, + drive, drive_len) != CSTR_EQUAL)) { + err = out_ptr; + }else { + out_ptr += drive_len; + continue; + } }else if(exp_ptr+sizeof(space_cmd) <= exp_end && !memcmp(exp_ptr, space_cmd, sizeof(space_cmd))) { exp_ptr += sizeof(space_cmd); @@ -391,6 +406,8 @@ START_TEST(batch) } workdir_len = GetCurrentDirectoryA(sizeof(workdir), workdir); + drive[0] = workdir[0]; + drive[1] = workdir[1]; /* Should be ':' */ argc = winetest_get_mainargs(&argv); if(argc > 2)
1
0
0
0
Jörg Höhle : winealsa: Pulse knows handle_underrun only since 2010-07-09.
by Alexandre Julliard
26 Aug '11
26 Aug '11
Module: wine Branch: master Commit: 8129b1847a13be248098b8d8ec773f8bdf821df6 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8129b1847a13be248098b8d8e…
Author: Jörg Höhle <hoehle(a)users.sourceforge.net> Date: Tue Aug 9 21:19:51 2011 +0200 winealsa: Pulse knows handle_underrun only since 2010-07-09. --- dlls/winealsa.drv/mmdevdrv.c | 35 ++++++++++++++++------------------- 1 files changed, 16 insertions(+), 19 deletions(-) diff --git a/dlls/winealsa.drv/mmdevdrv.c b/dlls/winealsa.drv/mmdevdrv.c index 01fe4fd..ec75fec 100644 --- a/dlls/winealsa.drv/mmdevdrv.c +++ b/dlls/winealsa.drv/mmdevdrv.c @@ -497,6 +497,7 @@ HRESULT WINAPI AUDDRV_GetAudioEndpoint(const char *key, IMMDevice *dev, int err; snd_pcm_stream_t stream; snd_config_t *lconf; + static int handle_underrun = 1; TRACE("\"%s\" %p %d %p\n", key, dev, dataflow, out); @@ -520,27 +521,23 @@ HRESULT WINAPI AUDDRV_GetAudioEndpoint(const char *key, IMMDevice *dev, return E_UNEXPECTED; } - lconf = make_handle_underrun_config(key); - This->dataflow = dataflow; - if(lconf){ - if((err = snd_pcm_open_lconf(&This->pcm_handle, key, stream, - SND_PCM_NONBLOCK, lconf)) < 0){ - snd_config_delete(lconf); - HeapFree(GetProcessHeap(), 0, This); - WARN("Unable to open PCM \"%s\": %d (%s)\n", key, err, - snd_strerror(err)); - return E_FAIL; - } + if(handle_underrun && ((lconf = make_handle_underrun_config(key)))){ + err = snd_pcm_open_lconf(&This->pcm_handle, key, stream, SND_PCM_NONBLOCK, lconf); + TRACE("Opening PCM device \"%s\" with handle_underrun: %d\n", key, err); snd_config_delete(lconf); - }else{ - if((err = snd_pcm_open(&This->pcm_handle, key, stream, - SND_PCM_NONBLOCK)) < 0){ - HeapFree(GetProcessHeap(), 0, This); - WARN("Unable to open PCM \"%s\": %d (%s)\n", key, err, - snd_strerror(err)); - return E_FAIL; - } + /* Pulse <= 2010 returns EINVAL, it does not know handle_underrun. */ + if(err == -EINVAL) + handle_underrun = 0; + }else + err = -EINVAL; + if(err == -EINVAL){ + err = snd_pcm_open(&This->pcm_handle, key, stream, SND_PCM_NONBLOCK); + } + if(err < 0){ + HeapFree(GetProcessHeap(), 0, This); + WARN("Unable to open PCM \"%s\": %d (%s)\n", key, err, snd_strerror(err)); + return E_FAIL; } This->hw_params = HeapAlloc(GetProcessHeap(), 0,
1
0
0
0
← Newer
1
...
14
15
16
17
18
19
20
...
77
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
Results per page:
10
25
50
100
200