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
December 2009
----- 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
1233 discussions
Start a n
N
ew thread
Paul Vriens : rpcrt4/tests: Don't crash on NT4.
by Alexandre Julliard
16 Dec '09
16 Dec '09
Module: wine Branch: master Commit: 4d1fa5833eb13f47557912bb365b16974ee53144 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=4d1fa5833eb13f47557912bb3…
Author: Paul Vriens <Paul.Vriens.Wine(a)gmail.com> Date: Wed Dec 16 09:00:30 2009 +0100 rpcrt4/tests: Don't crash on NT4. --- dlls/rpcrt4/tests/server.c | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/dlls/rpcrt4/tests/server.c b/dlls/rpcrt4/tests/server.c index 353d0cd..f55bfcf 100644 --- a/dlls/rpcrt4/tests/server.c +++ b/dlls/rpcrt4/tests/server.c @@ -1346,7 +1346,7 @@ s_authinfo_test(unsigned int protseq, int secure) todo_wine ok(principal != NULL, "NULL principal\n"); } - if (protseq == RPC_PROTSEQ_LRPC && principal) + if (protseq == RPC_PROTSEQ_LRPC && principal && pGetUserNameExA) { int len; char *spn; @@ -1399,6 +1399,9 @@ set_auth_info(RPC_BINDING_HANDLE handle) RPC_STATUS status; RPC_SECURITY_QOS qos; + if (!pGetUserNameExA) + return; + qos.Version = 1; qos.Capabilities = RPC_C_QOS_CAPABILITIES_MUTUAL_AUTH; qos.IdentityTracking = RPC_C_QOS_IDENTITY_STATIC; @@ -1573,6 +1576,8 @@ START_TEST(server) domain_and_user = HeapAlloc(GetProcessHeap(), 0, size); ok(pGetUserNameExA(NameSamCompatible, domain_and_user, &size), "GetUserNameExA\n"); } + else + win_skip("GetUserNameExA is needed for some authentication tests\n"); argc = winetest_get_mainargs(&argv); progname = argv[0];
1
0
0
0
Jeremy White : winspool: Add tests for paths returned in GetPrinterDriver.
by Alexandre Julliard
16 Dec '09
16 Dec '09
Module: wine Branch: master Commit: e4897a827bc70a2c56731f02adb31b3172d88faa URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e4897a827bc70a2c56731f02a…
Author: Jeremy White <jwhite(a)codeweavers.com> Date: Tue Dec 15 20:33:45 2009 -0600 winspool: Add tests for paths returned in GetPrinterDriver. --- dlls/winspool.drv/tests/info.c | 19 +++++++++++++++++++ 1 files changed, 19 insertions(+), 0 deletions(-) diff --git a/dlls/winspool.drv/tests/info.c b/dlls/winspool.drv/tests/info.c index 1f876b3..5ab0ccd 100644 --- a/dlls/winspool.drv/tests/info.c +++ b/dlls/winspool.drv/tests/info.c @@ -2370,6 +2370,7 @@ static void test_GetPrinterDriver(void) { DRIVER_INFO_2 *di_2 = (DRIVER_INFO_2 *)buf; DWORD calculated = sizeof(*di_2); + HANDLE hf; /* MSDN is wrong: The Drivers on the win9x-CD's have cVersion=0x0400 NT351: 1, NT4.0+w2k(Kernelmode): 2, w2k and above(Usermode): 3 */ @@ -2393,6 +2394,24 @@ static void test_GetPrinterDriver(void) trace("pConfigFile %s\n", di_2->pConfigFile); calculated += strlen(di_2->pConfigFile) + 1; + hf = CreateFileA(di_2->pDriverPath, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + if(hf != INVALID_HANDLE_VALUE) + CloseHandle(hf); + todo_wine + ok(hf != INVALID_HANDLE_VALUE, "Could not open %s\n", di_2->pDriverPath); + + hf = CreateFileA(di_2->pDataFile, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + if(hf != INVALID_HANDLE_VALUE) + CloseHandle(hf); + todo_wine + ok(hf != INVALID_HANDLE_VALUE, "Could not open %s\n", di_2->pDataFile); + + hf = CreateFileA(di_2->pConfigFile, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + if(hf != INVALID_HANDLE_VALUE) + CloseHandle(hf); + todo_wine + ok(hf != INVALID_HANDLE_VALUE, "Could not open %s\n", di_2->pConfigFile); + /* XP allocates memory for both ANSI and unicode names */ ok(filled >= calculated,"calculated %d != filled %d\n", calculated, filled); }
1
0
0
0
James Hawkins : msi: Free the temp buffer if we haven' t assigned it to *appValue.
by Alexandre Julliard
16 Dec '09
16 Dec '09
Module: wine Branch: master Commit: 8ed06175a0b36ae0bd509c8e490a5e84e55d9912 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8ed06175a0b36ae0bd509c8e4…
Author: James Hawkins <truiken(a)gmail.com> Date: Tue Dec 15 18:19:31 2009 -0800 msi: Free the temp buffer if we haven't assigned it to *appValue. --- dlls/msi/appsearch.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/dlls/msi/appsearch.c b/dlls/msi/appsearch.c index 95daabb..b99b4f5 100644 --- a/dlls/msi/appsearch.c +++ b/dlls/msi/appsearch.c @@ -739,6 +739,7 @@ static UINT ACTION_RecurseSearchDirectory(MSIPACKAGE *package, LPWSTR *appValue, size_t dirLen = lstrlenW(dir), fileLen = lstrlenW(sig->File); WCHAR subpath[MAX_PATH]; WCHAR *buf; + DWORD len; static const WCHAR starDotStarW[] = { '*','.','*',0 }; @@ -753,7 +754,8 @@ static UINT ACTION_RecurseSearchDirectory(MSIPACKAGE *package, LPWSTR *appValue, * here. Add two because we might need to add a backslash if the dir name * isn't backslash-terminated. */ - buf = msi_alloc( (dirLen + max(fileLen, strlenW(starDotStarW)) + 2) * sizeof(WCHAR)); + len = dirLen + max(fileLen, strlenW(starDotStarW)) + 2; + buf = msi_alloc(len * sizeof(WCHAR)); if (!buf) return ERROR_OUTOFMEMORY; @@ -815,7 +817,7 @@ static UINT ACTION_RecurseSearchDirectory(MSIPACKAGE *package, LPWSTR *appValue, } } - if (!*appValue) + if (*appValue != buf) msi_free(buf); return rc;
1
0
0
0
James Hawkins : msi: Refactor freeing the import sql strings.
by Alexandre Julliard
16 Dec '09
16 Dec '09
Module: wine Branch: master Commit: b530f38baa571738d061b38f62db6c63465f8619 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b530f38baa571738d061b38f6…
Author: James Hawkins <truiken(a)gmail.com> Date: Tue Dec 15 18:19:25 2009 -0800 msi: Refactor freeing the import sql strings. --- dlls/msi/database.c | 21 ++++++++++----------- 1 files changed, 10 insertions(+), 11 deletions(-) diff --git a/dlls/msi/database.c b/dlls/msi/database.c index 3896454..6ce516a 100644 --- a/dlls/msi/database.c +++ b/dlls/msi/database.c @@ -493,10 +493,10 @@ done: static UINT msi_add_table_to_db(MSIDATABASE *db, LPWSTR *columns, LPWSTR *types, LPWSTR *labels, DWORD num_labels, DWORD num_columns) { - UINT r; + UINT r = ERROR_OUTOFMEMORY; DWORD size; MSIQUERY *view; - LPWSTR create_sql; + LPWSTR create_sql = NULL; LPWSTR prelude, columns_sql, postlude; prelude = msi_build_createsql_prelude(labels[0]); @@ -504,31 +504,30 @@ static UINT msi_add_table_to_db(MSIDATABASE *db, LPWSTR *columns, LPWSTR *types, postlude = msi_build_createsql_postlude(labels + 1, num_labels - 1); /* skip over table name */ if (!prelude || !columns_sql || !postlude) - return ERROR_OUTOFMEMORY; + goto done; size = lstrlenW(prelude) + lstrlenW(columns_sql) + lstrlenW(postlude) + 1; create_sql = msi_alloc(size * sizeof(WCHAR)); if (!create_sql) - return ERROR_OUTOFMEMORY; + goto done; lstrcpyW(create_sql, prelude); lstrcatW(create_sql, columns_sql); lstrcatW(create_sql, postlude); - msi_free(prelude); - msi_free(columns_sql); - msi_free(postlude); - r = MSI_DatabaseOpenViewW( db, create_sql, &view ); - msi_free(create_sql); - if (r != ERROR_SUCCESS) - return r; + goto done; r = MSI_ViewExecute(view, NULL); MSI_ViewClose(view); msiobj_release(&view->hdr); +done: + msi_free(prelude); + msi_free(columns_sql); + msi_free(postlude); + msi_free(create_sql); return r; }
1
0
0
0
James Hawkins : msi: Simplify ITERATE_WriteEnvironmentString.
by Alexandre Julliard
16 Dec '09
16 Dec '09
Module: wine Branch: master Commit: 1b7238a96983659c23eb5b35322d1427fedd6796 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1b7238a96983659c23eb5b353…
Author: James Hawkins <truiken(a)gmail.com> Date: Tue Dec 15 18:19:19 2009 -0800 msi: Simplify ITERATE_WriteEnvironmentString. Now we only allocate enough memory to exactly match the size of the constructed string. Before, we were leaving some memory uninitialized and overwriting the allocated memory in certain circum. --- dlls/msi/action.c | 68 ++++++++++++++++++++++++++++++---------------------- 1 files changed, 39 insertions(+), 29 deletions(-) diff --git a/dlls/msi/action.c b/dlls/msi/action.c index ef30dda..a5c916e 100644 --- a/dlls/msi/action.c +++ b/dlls/msi/action.c @@ -5013,7 +5013,24 @@ static UINT ITERATE_WriteEnvironmentString( MSIRECORD *rec, LPVOID param ) (res == ERROR_SUCCESS && type != REG_SZ && type != REG_EXPAND_SZ)) goto done; - if (res != ERROR_FILE_NOT_FOUND) + if ((res == ERROR_FILE_NOT_FOUND || !(flags & ENV_MOD_MASK))) + { + /* Nothing to do. */ + if (!value) + { + res = ERROR_SUCCESS; + goto done; + } + + size = (lstrlenW(value) + 1) * sizeof(WCHAR); + newval = strdupW(value); + if (!newval) + { + res = ERROR_OUTOFMEMORY; + goto done; + } + } + else { if (flags & ENV_ACT_SETABSENT) { @@ -5038,8 +5055,18 @@ static UINT ITERATE_WriteEnvironmentString( MSIRECORD *rec, LPVOID param ) goto done; } - size += (lstrlenW(value) + 1) * sizeof(WCHAR); - newval = msi_alloc(size); + size = (lstrlenW(data) + 1) * sizeof(WCHAR); + if (flags & ENV_MOD_MASK) + { + DWORD mod_size; + int multiplier = 0; + if (flags & ENV_MOD_APPEND) multiplier++; + if (flags & ENV_MOD_PREFIX) multiplier++; + mod_size = (lstrlenW(value) + 1) * multiplier; + size += mod_size * sizeof(WCHAR); + } + + newval = msi_alloc(size); ptr = newval; if (!newval) { @@ -5047,37 +5074,20 @@ static UINT ITERATE_WriteEnvironmentString( MSIRECORD *rec, LPVOID param ) goto done; } - if (!(flags & ENV_MOD_MASK)) - lstrcpyW(newval, value); - else + if (flags & ENV_MOD_PREFIX) { - if (flags & ENV_MOD_PREFIX) - { - lstrcpyW(newval, value); - lstrcatW(newval, szSemiColon); - ptr = newval + lstrlenW(value) + 1; - } + lstrcpyW(newval, value); + lstrcatW(newval, szSemiColon); + ptr = newval + lstrlenW(value) + 1; + } - lstrcpyW(ptr, data); + lstrcpyW(ptr, data); - if (flags & ENV_MOD_APPEND) - { - lstrcatW(newval, szSemiColon); - lstrcatW(newval, value); - } - } - } - else if (value) - { - size = (lstrlenW(value) + 1) * sizeof(WCHAR); - newval = msi_alloc(size); - if (!newval) + if (flags & ENV_MOD_APPEND) { - res = ERROR_OUTOFMEMORY; - goto done; + lstrcatW(newval, szSemiColon); + lstrcatW(newval, value); } - - lstrcpyW(newval, value); } if (newval)
1
0
0
0
James Hawkins : msi: Free the columns view if check_column_exists fails.
by Alexandre Julliard
16 Dec '09
16 Dec '09
Module: wine Branch: master Commit: be1b1605f9421c363ea98fc0f8c6f9c9cece91e9 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=be1b1605f9421c363ea98fc0f…
Author: James Hawkins <truiken(a)gmail.com> Date: Tue Dec 15 18:19:03 2009 -0800 msi: Free the columns view if check_column_exists fails. --- dlls/msi/alter.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/dlls/msi/alter.c b/dlls/msi/alter.c index a62b13e..93d322b 100644 --- a/dlls/msi/alter.c +++ b/dlls/msi/alter.c @@ -125,7 +125,10 @@ static UINT alter_add_column(MSIALTERVIEW *av) return r; if (check_column_exists(av->db, av->colinfo->table, av->colinfo->column)) + { + columns->ops->delete(columns); return ERROR_BAD_QUERY_SYNTAX; + } r = MSI_OpenQuery(av->db, &view, query, av->colinfo->table, av->colinfo->column); if (r == ERROR_SUCCESS)
1
0
0
0
James Hawkins : msi: Fix a leaking record handle.
by Alexandre Julliard
16 Dec '09
16 Dec '09
Module: wine Branch: master Commit: 1a4a112d768c4b586c504e44a3777e9d65978a8b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1a4a112d768c4b586c504e44a…
Author: James Hawkins <truiken(a)gmail.com> Date: Tue Dec 15 18:18:47 2009 -0800 msi: Fix a leaking record handle. --- dlls/msi/tests/db.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/dlls/msi/tests/db.c b/dlls/msi/tests/db.c index c909f90..d3e9ad1 100644 --- a/dlls/msi/tests/db.c +++ b/dlls/msi/tests/db.c @@ -922,6 +922,8 @@ static void test_viewmodify(void) r = MsiViewModify(hview, MSIMODIFY_INSERT_TEMPORARY, hrec ); ok(r == ERROR_SUCCESS, "MsiViewModify failed\n"); + r = MsiCloseHandle(hrec); + ok(r == ERROR_SUCCESS, "MsiCloseHandle failed\n"); r = MsiViewClose(hview); ok(r == ERROR_SUCCESS, "MsiViewClose failed\n"); r = MsiCloseHandle(hview);
1
0
0
0
James Hawkins : msi: Free the join view if we fail to create the table view .
by Alexandre Julliard
16 Dec '09
16 Dec '09
Module: wine Branch: master Commit: b93c2c354471df6eab642b350cfe15b21f3d82b6 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b93c2c354471df6eab642b350…
Author: James Hawkins <truiken(a)gmail.com> Date: Tue Dec 15 18:18:40 2009 -0800 msi: Free the join view if we fail to create the table view. --- dlls/msi/join.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/dlls/msi/join.c b/dlls/msi/join.c index ef5cede..134c569 100644 --- a/dlls/msi/join.c +++ b/dlls/msi/join.c @@ -353,11 +353,13 @@ UINT JOIN_CreateView( MSIDATABASE *db, MSIVIEW **view, LPWSTR tables ) if( r != ERROR_SUCCESS ) { WARN("can't create table: %s\n", debugstr_w(tables)); + msi_free(table); r = ERROR_BAD_QUERY_SYNTAX; goto end; } - r = table->view->ops->get_dimensions( table->view, NULL, &table->columns ); + r = table->view->ops->get_dimensions( table->view, NULL, + &table->columns ); if( r != ERROR_SUCCESS ) { ERR("can't get table dimensions\n");
1
0
0
0
James Hawkins : msi: Keep track of the current view in the sql parser.
by Alexandre Julliard
16 Dec '09
16 Dec '09
Module: wine Branch: master Commit: 1692e1fe673fd40c649d14e7aa18de250d639b9b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1692e1fe673fd40c649d14e7a…
Author: James Hawkins <truiken(a)gmail.com> Date: Tue Dec 15 18:18:31 2009 -0800 msi: Keep track of the current view in the sql parser. This allows us to free said view in the case of a syntax error. This also allows us to get rid of a few places where we tried to clean up the view ourselves in the parsing code. --- dlls/msi/sql.y | 83 +++++++++++++++++++++++++++++++++++--------------------- 1 files changed, 52 insertions(+), 31 deletions(-) diff --git a/dlls/msi/sql.y b/dlls/msi/sql.y index e2484df..548a878 100644 --- a/dlls/msi/sql.y +++ b/dlls/msi/sql.y @@ -47,7 +47,10 @@ typedef struct tag_SQL_input LPCWSTR command; DWORD n, len; UINT r; - MSIVIEW **view; /* view structure for the resulting query */ + MSIVIEW **view; /* View structure for the resulting query. This value + * tracks the view currently being created so we can free + * this view on syntax error. + */ struct list *mem; } SQL_input; @@ -68,6 +71,10 @@ static struct expr * EXPR_ival( void *info, int val ); static struct expr * EXPR_sval( void *info, const struct sql_str *str ); static struct expr * EXPR_wildcard( void *info ); +#define PARSER_BUBBLE_UP_VIEW( sql, result, current_view ) \ + *sql->view = current_view; \ + result = current_view + %} %pure-parser @@ -149,7 +156,8 @@ oneinsert: INSERT_CreateView( sql->db, &insert, $3, $5, $9, FALSE ); if( !insert ) YYABORT; - $$ = insert; + + PARSER_BUBBLE_UP_VIEW( sql, $$, insert ); } | TK_INSERT TK_INTO table TK_LP selcollist TK_RP TK_VALUES TK_LP constlist TK_RP TK_TEMPORARY { @@ -159,7 +167,8 @@ oneinsert: INSERT_CreateView( sql->db, &insert, $3, $5, $9, TRUE ); if( !insert ) YYABORT; - $$ = insert; + + PARSER_BUBBLE_UP_VIEW( sql, $$, insert ); } ; @@ -178,7 +187,8 @@ onecreate: sql->r = r; YYABORT; } - $$ = create; + + PARSER_BUBBLE_UP_VIEW( sql, $$, create ); } | TK_CREATE TK_TABLE table TK_LP table_def TK_RP TK_HOLD { @@ -190,7 +200,8 @@ onecreate: CREATE_CreateView( sql->db, &create, $3, $5, TRUE ); if( !create ) YYABORT; - $$ = create; + + PARSER_BUBBLE_UP_VIEW( sql, $$, create ); } ; @@ -203,7 +214,8 @@ oneupdate: UPDATE_CreateView( sql->db, &update, $2, $4, $6 ); if( !update ) YYABORT; - $$ = update; + + PARSER_BUBBLE_UP_VIEW( sql, $$, update ); } | TK_UPDATE table TK_SET update_assign_list { @@ -213,7 +225,8 @@ oneupdate: UPDATE_CreateView( sql->db, &update, $2, $4, NULL ); if( !update ) YYABORT; - $$ = update; + + PARSER_BUBBLE_UP_VIEW( sql, $$, update ); } ; @@ -226,7 +239,8 @@ onedelete: DELETE_CreateView( sql->db, &delete, $2 ); if( !delete ) YYABORT; - $$ = delete; + + PARSER_BUBBLE_UP_VIEW( sql, $$, delete ); } ; @@ -239,7 +253,8 @@ onealter: ALTER_CreateView( sql->db, &alter, $3, NULL, $4 ); if( !alter ) YYABORT; - $$ = alter; + + PARSER_BUBBLE_UP_VIEW( sql, $$, alter ); } | TK_ALTER TK_TABLE table TK_ADD column_and_type { @@ -249,7 +264,8 @@ onealter: ALTER_CreateView( sql->db, &alter, $3, $5, 0 ); if (!alter) YYABORT; - $$ = alter; + + PARSER_BUBBLE_UP_VIEW( sql, $$, alter ); } | TK_ALTER TK_TABLE table TK_ADD column_and_type TK_HOLD { @@ -259,7 +275,8 @@ onealter: ALTER_CreateView( sql->db, &alter, $3, $5, 1 ); if (!alter) YYABORT; - $$ = alter; + + PARSER_BUBBLE_UP_VIEW( sql, $$, alter ); } ; @@ -278,12 +295,14 @@ onedrop: TK_DROP TK_TABLE table { SQL_input* sql = (SQL_input*) info; + MSIVIEW* drop = NULL; UINT r; - $$ = NULL; - r = DROP_CreateView( sql->db, &$$, $3 ); + r = DROP_CreateView( sql->db, &drop, $3 ); if( r != ERROR_SUCCESS || !$$ ) YYABORT; + + PARSER_BUBBLE_UP_VIEW( sql, $$, drop ); } ; @@ -414,15 +433,14 @@ unorderedsel: | TK_SELECT TK_DISTINCT selectfrom { SQL_input* sql = (SQL_input*) info; + MSIVIEW* distinct = NULL; UINT r; - $$ = NULL; - r = DISTINCT_CreateView( sql->db, &$$, $3 ); + r = DISTINCT_CreateView( sql->db, &distinct, $3 ); if (r != ERROR_SUCCESS) - { - $3->ops->delete($3); YYABORT; - } + + PARSER_BUBBLE_UP_VIEW( sql, $$, distinct ); } ; @@ -430,17 +448,16 @@ selectfrom: selcollist from { SQL_input* sql = (SQL_input*) info; + MSIVIEW* select = NULL; UINT r; - $$ = NULL; if( $1 ) { - r = SELECT_CreateView( sql->db, &$$, $2, $1 ); + r = SELECT_CreateView( sql->db, &select, $2, $1 ); if (r != ERROR_SUCCESS) - { - $2->ops->delete($2); YYABORT; - } + + PARSER_BUBBLE_UP_VIEW( sql, $$, select ); } else $$ = $2; @@ -464,15 +481,14 @@ from: | fromtable TK_WHERE expr { SQL_input* sql = (SQL_input*) info; + MSIVIEW* where = NULL; UINT r; - $$ = NULL; - r = WHERE_CreateView( sql->db, &$$, $1, $3 ); + r = WHERE_CreateView( sql->db, &where, $1, $3 ); if( r != ERROR_SUCCESS ) - { - $1->ops->delete( $1 ); YYABORT; - } + + PARSER_BUBBLE_UP_VIEW( sql, $$, where ); } ; @@ -480,21 +496,26 @@ fromtable: TK_FROM table { SQL_input* sql = (SQL_input*) info; + MSIVIEW* table = NULL; UINT r; - $$ = NULL; - r = TABLE_CreateView( sql->db, $2, &$$ ); + r = TABLE_CreateView( sql->db, $2, &table ); if( r != ERROR_SUCCESS || !$$ ) YYABORT; + + PARSER_BUBBLE_UP_VIEW( sql, $$, table ); } | TK_FROM tablelist { SQL_input* sql = (SQL_input*) info; + MSIVIEW* join = NULL; UINT r; - r = JOIN_CreateView( sql->db, &$$, $2 ); + r = JOIN_CreateView( sql->db, &join, $2 ); if( r != ERROR_SUCCESS ) YYABORT; + + PARSER_BUBBLE_UP_VIEW( sql, $$, join ); } ;
1
0
0
0
Vincent Povirk : ole32: Add a cache for block chain streams in StorageImpl.
by Alexandre Julliard
16 Dec '09
16 Dec '09
Module: wine Branch: master Commit: 393c5af205c5b25a50e0b2d06a5889162286abf2 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=393c5af205c5b25a50e0b2d06…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Tue Dec 15 14:44:49 2009 -0600 ole32: Add a cache for block chain streams in StorageImpl. --- dlls/ole32/storage32.c | 88 +++++++++++++++++++++++++++++++++++++++-------- dlls/ole32/storage32.h | 7 ++++ 2 files changed, 80 insertions(+), 15 deletions(-) diff --git a/dlls/ole32/storage32.c b/dlls/ole32/storage32.c index 90d2434..2a7e9f0 100644 --- a/dlls/ole32/storage32.c +++ b/dlls/ole32/storage32.c @@ -2268,6 +2268,63 @@ static HRESULT StorageImpl_BaseReadDirEntry(StorageBaseImpl *base, return StorageImpl_ReadDirEntry(This, index, data); } +static BlockChainStream **StorageImpl_GetFreeBlockChainCacheEntry(StorageImpl* This) +{ + int i; + + for (i=0; i<BLOCKCHAIN_CACHE_SIZE; i++) + { + if (!This->blockChainCache[i]) + { + return &This->blockChainCache[i]; + } + } + + i = This->blockChainToEvict; + + BlockChainStream_Destroy(This->blockChainCache[i]); + This->blockChainCache[i] = NULL; + + This->blockChainToEvict++; + if (This->blockChainToEvict == BLOCKCHAIN_CACHE_SIZE) + This->blockChainToEvict = 0; + + return &This->blockChainCache[i]; +} + +static BlockChainStream **StorageImpl_GetCachedBlockChainStream(StorageImpl *This, + DirRef index) +{ + int i, free_index=-1; + + for (i=0; i<BLOCKCHAIN_CACHE_SIZE; i++) + { + if (!This->blockChainCache[i]) + { + if (free_index == -1) free_index = i; + } + else if (This->blockChainCache[i]->ownerDirEntry == index) + { + return &This->blockChainCache[i]; + } + } + + if (free_index == -1) + { + free_index = This->blockChainToEvict; + + BlockChainStream_Destroy(This->blockChainCache[free_index]); + This->blockChainCache[free_index] = NULL; + + This->blockChainToEvict++; + if (This->blockChainToEvict == BLOCKCHAIN_CACHE_SIZE) + This->blockChainToEvict = 0; + } + + This->blockChainCache[free_index] = BlockChainStream_Construct(This, NULL, index); + return &This->blockChainCache[free_index]; +} + static HRESULT StorageImpl_StreamReadAt(StorageBaseImpl *base, DirRef index, ULARGE_INTEGER offset, ULONG size, void *buffer, ULONG *bytesRead) { @@ -2309,15 +2366,13 @@ static HRESULT StorageImpl_StreamReadAt(StorageBaseImpl *base, DirRef index, } else { - BlockChainStream *stream; + BlockChainStream *stream = NULL; - stream = BlockChainStream_Construct(This, NULL, index); + stream = *StorageImpl_GetCachedBlockChainStream(This, index); if (!stream) return E_OUTOFMEMORY; hr = BlockChainStream_ReadAt(stream, offset, bytesToRead, buffer, bytesRead); - BlockChainStream_Destroy(stream); - return hr; } } @@ -2329,7 +2384,7 @@ static HRESULT StorageImpl_StreamSetSize(StorageBaseImpl *base, DirRef index, DirEntry data; HRESULT hr; SmallBlockChainStream *smallblock=NULL; - BlockChainStream *bigblock=NULL; + BlockChainStream **pbigblock=NULL, *bigblock=NULL; hr = StorageImpl_ReadDirEntry(This, index, &data); if (FAILED(hr)) return hr; @@ -2351,7 +2406,8 @@ static HRESULT StorageImpl_StreamSetSize(StorageBaseImpl *base, DirRef index, } else { - bigblock = BlockChainStream_Construct(This, NULL, index); + pbigblock = StorageImpl_GetCachedBlockChainStream(This, index); + bigblock = *pbigblock; if (!bigblock) return E_OUTOFMEMORY; } } @@ -2362,7 +2418,8 @@ static HRESULT StorageImpl_StreamSetSize(StorageBaseImpl *base, DirRef index, } else { - bigblock = BlockChainStream_Construct(This, NULL, index); + pbigblock = StorageImpl_GetCachedBlockChainStream(This, index); + bigblock = *pbigblock; if (!bigblock) return E_OUTOFMEMORY; } @@ -2375,15 +2432,15 @@ static HRESULT StorageImpl_StreamSetSize(StorageBaseImpl *base, DirRef index, SmallBlockChainStream_Destroy(smallblock); return E_FAIL; } + + pbigblock = StorageImpl_GetFreeBlockChainCacheEntry(This); + *pbigblock = bigblock; } else if (bigblock && newsize.QuadPart < LIMIT_TO_USE_SMALL_BLOCK) { - smallblock = Storage32Impl_BigBlocksToSmallBlocks(This, &bigblock); + smallblock = Storage32Impl_BigBlocksToSmallBlocks(This, pbigblock); if (!smallblock) - { - BlockChainStream_Destroy(bigblock); return E_FAIL; - } } /* Set the size of the block chain. */ @@ -2395,7 +2452,6 @@ static HRESULT StorageImpl_StreamSetSize(StorageBaseImpl *base, DirRef index, else { BlockChainStream_SetSize(bigblock, newsize); - BlockChainStream_Destroy(bigblock); } /* Set the size in the directory entry. */ @@ -2450,13 +2506,11 @@ static HRESULT StorageImpl_StreamWriteAt(StorageBaseImpl *base, DirRef index, { BlockChainStream *stream; - stream = BlockChainStream_Construct(This, NULL, index); + stream = *StorageImpl_GetCachedBlockChainStream(This, index); if (!stream) return E_OUTOFMEMORY; hr = BlockChainStream_WriteAt(stream, offset, size, buffer, bytesWritten); - BlockChainStream_Destroy(stream); - return hr; } } @@ -2741,6 +2795,7 @@ static void StorageImpl_Invalidate(StorageBaseImpl* iface) static void StorageImpl_Destroy(StorageBaseImpl* iface) { StorageImpl *This = (StorageImpl*) iface; + int i; TRACE("(%p)\n", This); StorageImpl_Invalidate(iface); @@ -2751,6 +2806,9 @@ static void StorageImpl_Destroy(StorageBaseImpl* iface) BlockChainStream_Destroy(This->rootBlockChain); BlockChainStream_Destroy(This->smallBlockDepotChain); + for (i=0; i<BLOCKCHAIN_CACHE_SIZE; i++) + BlockChainStream_Destroy(This->blockChainCache[i]); + if (This->bigBlockFile) BIGBLOCKFILE_Destructor(This->bigBlockFile); HeapFree(GetProcessHeap(), 0, This); diff --git a/dlls/ole32/storage32.h b/dlls/ole32/storage32.h index 07a4b33..03328b2 100644 --- a/dlls/ole32/storage32.h +++ b/dlls/ole32/storage32.h @@ -325,6 +325,9 @@ static inline HRESULT StorageBaseImpl_StreamSetSize(StorageBaseImpl *This, void StorageBaseImpl_AddStream(StorageBaseImpl * stg, StgStreamImpl * strm); void StorageBaseImpl_RemoveStream(StorageBaseImpl * stg, StgStreamImpl * strm); +/* Number of BlockChainStream objects to cache in a StorageImpl */ +#define BLOCKCHAIN_CACHE_SIZE 4 + /**************************************************************************** * Storage32Impl definitions. * @@ -367,6 +370,10 @@ struct StorageImpl BlockChainStream* smallBlockDepotChain; BlockChainStream* smallBlockRootChain; + /* Cache of block chain streams objects for directory entries */ + BlockChainStream* blockChainCache[BLOCKCHAIN_CACHE_SIZE]; + UINT blockChainToEvict; + /* * Pointer to the big block file abstraction */
1
0
0
0
← Newer
1
...
48
49
50
51
52
53
54
...
124
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
Results per page:
10
25
50
100
200