ReactOS.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
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
List overview
Download
Ros-diffs
March 2022
----- 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
ros-diffs@reactos.org
20 participants
436 discussions
Start a n
N
ew thread
[reactos] 201/360: [WINESYNC] msi: Initialize assembly caches before disabling redirection.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=f474f080a1275bb86752e…
commit f474f080a1275bb86752e73ace16f61f5649726e Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sun Mar 13 00:16:44 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:28:13 2022 +0100 [WINESYNC] msi: Initialize assembly caches before disabling redirection. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=46638
Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id a70ece68b7fa98e55e62eaed1006ceea961666ce by Hans Leidekker <hans(a)codeweavers.com> --- dll/win32/msi/action.c | 13 ++++++------- dll/win32/msi/assembly.c | 5 +++++ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/dll/win32/msi/action.c b/dll/win32/msi/action.c index ad2f40cd78f..4901fe75936 100644 --- a/dll/win32/msi/action.c +++ b/dll/win32/msi/action.c @@ -1002,13 +1002,6 @@ UINT msi_load_all_components( MSIPACKAGE *package ) if (r != ERROR_SUCCESS) return r; - if (!msi_init_assembly_caches( package )) - { - ERR("can't initialize assembly caches\n"); - msiobj_release( &view->hdr ); - return ERROR_FUNCTION_FAILED; - } - r = MSI_IterateRecords(view, NULL, load_component, package); msiobj_release(&view->hdr); return r; @@ -8112,6 +8105,12 @@ UINT ACTION_PerformAction(MSIPACKAGE *package, const WCHAR *action) TRACE("Performing action (%s)\n", debugstr_w(action)); + if (!msi_init_assembly_caches( package )) + { + ERR("can't initialize assembly caches\n"); + return ERROR_FUNCTION_FAILED; + } + package->action_progress_increment = 0; rc = ACTION_HandleStandardAction(package, action); diff --git a/dll/win32/msi/assembly.c b/dll/win32/msi/assembly.c index f46ff02eeb6..cb406111c9b 100644 --- a/dll/win32/msi/assembly.c +++ b/dll/win32/msi/assembly.c @@ -41,6 +41,7 @@ static HRESULT (WINAPI *pCreateAssemblyNameObject)( IAssemblyName **, LPCWSTR, D static HRESULT (WINAPI *pCreateAssemblyEnum)( IAssemblyEnum **, IUnknown *, IAssemblyName *, DWORD, LPVOID ); static HMODULE hfusion10, hfusion11, hfusion20, hfusion40, hmscoree, hsxs; +static BOOL assembly_caches_initialized; static BOOL init_function_pointers( void ) { @@ -91,12 +92,16 @@ static BOOL init_function_pointers( void ) BOOL msi_init_assembly_caches( MSIPACKAGE *package ) { + if (assembly_caches_initialized) return TRUE; if (!init_function_pointers()) return FALSE; + if (pCreateAssemblyCacheSxs( &package->cache_sxs, 0 ) != S_OK) return FALSE; if (pCreateAssemblyCacheNet10) pCreateAssemblyCacheNet10( &package->cache_net[CLR_VERSION_V10], 0 ); if (pCreateAssemblyCacheNet11) pCreateAssemblyCacheNet11( &package->cache_net[CLR_VERSION_V11], 0 ); if (pCreateAssemblyCacheNet20) pCreateAssemblyCacheNet20( &package->cache_net[CLR_VERSION_V20], 0 ); if (pCreateAssemblyCacheNet40) pCreateAssemblyCacheNet40( &package->cache_net[CLR_VERSION_V40], 0 ); + + assembly_caches_initialized = TRUE; return TRUE; }
2 years, 9 months
1
0
0
0
[reactos] 200/360: [WINESYNC] msi: Remove duplicate condition in msi_dialog_destroy().
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=0e4c16b13bc6920311f3a…
commit 0e4c16b13bc6920311f3a2bf477d5335b5eef8ef Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sun Mar 13 00:16:43 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:28:13 2022 +0100 [WINESYNC] msi: Remove duplicate condition in msi_dialog_destroy(). Signed-off-by: Andrey Gusev <andrey.goosev(a)gmail.com> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id 57dd594865b002205edb4e053102241bed72bd1a by Andrey Gusev <andrey.goosev(a)gmail.com> --- dll/win32/msi/dialog.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dll/win32/msi/dialog.c b/dll/win32/msi/dialog.c index c09d3d1c695..864f488d9c1 100644 --- a/dll/win32/msi/dialog.c +++ b/dll/win32/msi/dialog.c @@ -4132,10 +4132,10 @@ void msi_dialog_destroy( msi_dialog *dialog ) } if( dialog->hwnd ) + { ShowWindow( dialog->hwnd, SW_HIDE ); - - if( dialog->hwnd ) DestroyWindow( dialog->hwnd ); + } /* unsubscribe events */ event_cleanup_subscriptions( dialog->package, dialog->name );
2 years, 9 months
1
0
0
0
[reactos] 199/360: [WINESYNC] msi/tests: Add more tests for MSIMODIFY_INSERT.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=5da3f84d5a6a7a1713df1…
commit 5da3f84d5a6a7a1713df13390f0d62c38bff9a80 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sun Mar 13 00:16:41 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:28:13 2022 +0100 [WINESYNC] msi/tests: Add more tests for MSIMODIFY_INSERT. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id 4179189ec6638ec74cf54eea68798218798affc1 by Zebediah Figura <z.figura12(a)gmail.com> --- modules/rostests/winetests/msi/db.c | 165 ++++++++++++++++++++++++++++++++++++ 1 file changed, 165 insertions(+) diff --git a/modules/rostests/winetests/msi/db.c b/modules/rostests/winetests/msi/db.c index 2ff9fe2a5ef..0382e5454f6 100644 --- a/modules/rostests/winetests/msi/db.c +++ b/modules/rostests/winetests/msi/db.c @@ -8867,6 +8867,170 @@ todo_wine DeleteFileA(msifile); } +static void test_viewmodify_insert(void) +{ + MSIHANDLE view, rec, db = create_db(); + UINT r; + + r = run_query(db, 0, "CREATE TABLE `T` (`A` SHORT, `B` SHORT PRIMARY KEY `A`)"); + ok(!r, "got %u\n", r); + + r = MsiDatabaseOpenViewA(db, "SELECT * FROM `T`", &view); + ok(!r, "got %u\n", r); + r = MsiViewExecute(view, 0); + ok(!r, "got %u\n", r); + + rec = MsiCreateRecord(2); + MsiRecordSetInteger(rec, 1, 1); + MsiRecordSetInteger(rec, 2, 2); + r = MsiViewModify(view, MSIMODIFY_INSERT, rec); + ok(!r, "got %u\n", r); + + MsiCloseHandle(rec); + MsiCloseHandle(view); + + r = MsiDatabaseOpenViewA(db, "SELECT * FROM `T`", &view); + ok(!r, "got %u\n", r); + r = MsiViewExecute(view, 0); + ok(!r, "got %u\n", r); + + r = MsiViewFetch(view, &rec); + ok(!r, "got %u\n", r); + check_record(rec, 2, "1", "2"); + MsiCloseHandle(rec); + + r = MsiViewFetch(view, &rec); + ok(r == ERROR_NO_MORE_ITEMS, "got %u\n", r); + MsiCloseHandle(view); + + r = MsiDatabaseOpenViewA(db, "SELECT * FROM `T`", &view); + ok(!r, "got %u\n", r); + r = MsiViewExecute(view, 0); + ok(!r, "got %u\n", r); + + rec = MsiCreateRecord(2); + MsiRecordSetInteger(rec, 1, 1); + MsiRecordSetInteger(rec, 2, 2); + r = MsiViewModify(view, MSIMODIFY_INSERT, rec); + ok(r == ERROR_FUNCTION_FAILED, "got %u\n", r); + + MsiRecordSetInteger(rec, 2, 3); + r = MsiViewModify(view, MSIMODIFY_INSERT, rec); + ok(r == ERROR_FUNCTION_FAILED, "got %u\n", r); + + MsiRecordSetInteger(rec, 1, 3); + r = MsiViewModify(view, MSIMODIFY_INSERT, rec); + ok(!r, "got %u\n", r); + + MsiCloseHandle(rec); + MsiCloseHandle(view); + + r = MsiDatabaseOpenViewA(db, "SELECT * FROM `T`", &view); + ok(!r, "got %u\n", r); + r = MsiViewExecute(view, 0); + ok(!r, "got %u\n", r); + + r = MsiViewFetch(view, &rec); + ok(!r, "got %u\n", r); + check_record(rec, 2, "1", "2"); + MsiCloseHandle(rec); + + r = MsiViewFetch(view, &rec); + ok(!r, "got %u\n", r); + check_record(rec, 2, "3", "3"); + MsiCloseHandle(rec); + + r = MsiViewFetch(view, &rec); + ok(r == ERROR_NO_MORE_ITEMS, "got %u\n", r); + MsiCloseHandle(view); + + r = run_query(db, 0, "CREATE TABLE `U` (`A` SHORT, `B` SHORT, `C` SHORT, `D` SHORT PRIMARY KEY `A`, `B`)"); + ok(!r, "got %u\n", r); + + r = MsiDatabaseOpenViewA(db, "SELECT * FROM `U`", &view); + ok(!r, "got %u\n", r); + r = MsiViewExecute(view, 0); + ok(!r, "got %u\n", r); + + rec = MsiCreateRecord(4); + MsiRecordSetInteger(rec, 1, 1); + MsiRecordSetInteger(rec, 2, 2); + MsiRecordSetInteger(rec, 3, 3); + MsiRecordSetInteger(rec, 4, 4); + r = MsiViewModify(view, MSIMODIFY_INSERT, rec); + ok(!r, "got %u\n", r); + + MsiRecordSetInteger(rec, 2, 4); + r = MsiViewModify(view, MSIMODIFY_INSERT, rec); + ok(!r, "got %u\n", r); + + MsiCloseHandle(rec); + MsiCloseHandle(view); + + r = MsiDatabaseOpenViewA(db, "SELECT * FROM `U`", &view); + ok(!r, "got %u\n", r); + r = MsiViewExecute(view, 0); + ok(!r, "got %u\n", r); + + r = MsiViewFetch(view, &rec); + ok(!r, "got %u\n", r); + check_record(rec, 4, "1", "2", "3", "4"); + MsiCloseHandle(rec); + + r = MsiViewFetch(view, &rec); + ok(!r, "got %u\n", r); + check_record(rec, 4, "1", "4", "3", "4"); + MsiCloseHandle(rec); + + r = MsiViewFetch(view, &rec); + ok(r == ERROR_NO_MORE_ITEMS, "got %u\n", r); + MsiCloseHandle(view); + + r = MsiDatabaseOpenViewA(db, "SELECT `A`,`C` FROM `U`", &view); + ok(!r, "got %u\n", r); + r = MsiViewExecute(view, 0); + ok(!r, "got %u\n", r); + + rec = MsiCreateRecord(2); + MsiRecordSetInteger(rec, 1, 1); + MsiRecordSetInteger(rec, 2, 2); + r = MsiViewModify(view, MSIMODIFY_INSERT, rec); + ok(!r, "got %u\n", r); + + r = MsiViewModify(view, MSIMODIFY_INSERT, rec); + ok(r == ERROR_FUNCTION_FAILED, "got %u\n", r); + + MsiCloseHandle(rec); + MsiCloseHandle(view); + + r = MsiDatabaseOpenViewA(db, "SELECT * FROM `U` ORDER BY `B`", &view); + ok(!r, "got %u\n", r); + r = MsiViewExecute(view, 0); + ok(!r, "got %u\n", r); + + r = MsiViewFetch(view, &rec); + ok(!r, "got %u\n", r); + check_record(rec, 4, "1", "", "2", ""); + MsiCloseHandle(rec); + + r = MsiViewFetch(view, &rec); + ok(!r, "got %u\n", r); + check_record(rec, 4, "1", "2", "3", "4"); + MsiCloseHandle(rec); + + r = MsiViewFetch(view, &rec); + ok(!r, "got %u\n", r); + check_record(rec, 4, "1", "4", "3", "4"); + MsiCloseHandle(rec); + + r = MsiViewFetch(view, &rec); + ok(r == ERROR_NO_MORE_ITEMS, "got %u\n", r); + MsiCloseHandle(view); + + MsiCloseHandle(db); + DeleteFileA(msifile); +} + START_TEST(db) { test_msidatabase(); @@ -8924,4 +9088,5 @@ START_TEST(db) test_select_column_names(); test_primary_keys(); test_viewmodify_merge(); + test_viewmodify_insert(); }
2 years, 9 months
1
0
0
0
[reactos] 198/360: [WINESYNC] msi/tests: Add more tests for MSIMODIFY_MERGE.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=693fc866461dd716e9d44…
commit 693fc866461dd716e9d44e397369c8975541bd9b Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sun Mar 13 00:16:41 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:28:12 2022 +0100 [WINESYNC] msi/tests: Add more tests for MSIMODIFY_MERGE. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id 535983743c6e7bccb515a823f2e9bf721740aada by Zebediah Figura <z.figura12(a)gmail.com> --- modules/rostests/winetests/msi/db.c | 198 ++++++++++++++++++++++++++++++++++++ 1 file changed, 198 insertions(+) diff --git a/modules/rostests/winetests/msi/db.c b/modules/rostests/winetests/msi/db.c index f219b9a9a3f..2ff9fe2a5ef 100644 --- a/modules/rostests/winetests/msi/db.c +++ b/modules/rostests/winetests/msi/db.c @@ -8670,6 +8670,203 @@ static void test_primary_keys(void) DeleteFileA(msifile); } +static void test_viewmodify_merge(void) +{ + MSIHANDLE view, rec, db = create_db(); + UINT r; + + r = run_query(db, 0, "CREATE TABLE `T` (`A` SHORT, `B` SHORT PRIMARY KEY `A`)"); + ok(!r, "got %u\n", r); + r = run_query(db, 0, "INSERT INTO `T` (`A`, `B`) VALUES (1, 2)"); + ok(!r, "got %u\n", r); + + r = MsiDatabaseOpenViewA(db, "SELECT * FROM `T`", &view); + ok(!r, "got %u\n", r); + r = MsiViewExecute(view, 0); + ok(!r, "got %u\n", r); + + rec = MsiCreateRecord(2); + MsiRecordSetInteger(rec, 1, 1); + MsiRecordSetInteger(rec, 2, 2); + r = MsiViewModify(view, MSIMODIFY_MERGE, rec); + ok(!r, "got %u\n", r); + + MsiCloseHandle(rec); + MsiCloseHandle(view); + + r = MsiDatabaseOpenViewA(db, "SELECT * FROM `T`", &view); + ok(!r, "got %u\n", r); + r = MsiViewExecute(view, 0); + ok(!r, "got %u\n", r); + + r = MsiViewFetch(view, &rec); + ok(!r, "got %u\n", r); + check_record(rec, 2, "1", "2"); + MsiCloseHandle(rec); + + r = MsiViewFetch(view, &rec); + ok(r == ERROR_NO_MORE_ITEMS, "got %u\n", r); + MsiCloseHandle(view); + + r = MsiDatabaseOpenViewA(db, "SELECT * FROM `T`", &view); + ok(!r, "got %u\n", r); + r = MsiViewExecute(view, 0); + ok(!r, "got %u\n", r); + + rec = MsiCreateRecord(2); + MsiRecordSetInteger(rec, 1, 1); + MsiRecordSetInteger(rec, 2, 3); + r = MsiViewModify(view, MSIMODIFY_MERGE, rec); +todo_wine + ok(r == ERROR_FUNCTION_FAILED, "got %u\n", r); + + MsiRecordSetInteger(rec, 1, 2); + r = MsiViewModify(view, MSIMODIFY_MERGE, rec); + ok(!r, "got %u\n", r); + + MsiCloseHandle(rec); + MsiCloseHandle(view); + + r = MsiDatabaseOpenViewA(db, "SELECT * FROM `T`", &view); + ok(!r, "got %u\n", r); + r = MsiViewExecute(view, 0); + ok(!r, "got %u\n", r); + + r = MsiViewFetch(view, &rec); + ok(!r, "got %u\n", r); + check_record(rec, 2, "1", "2"); + MsiCloseHandle(rec); + + r = MsiViewFetch(view, &rec); + ok(!r, "got %u\n", r); + check_record(rec, 2, "2", "3"); + MsiCloseHandle(rec); + + r = MsiViewFetch(view, &rec); + ok(r == ERROR_NO_MORE_ITEMS, "got %u\n", r); + MsiCloseHandle(view); + + r = run_query(db, 0, "CREATE TABLE `U` (`A` SHORT, `B` SHORT, `C` SHORT, `D` SHORT PRIMARY KEY `A`, `B`)"); + ok(!r, "got %u\n", r); + r = run_query(db, 0, "INSERT INTO `U` (`A`, `B`, `C`, `D`) VALUES (1, 2, 3, 4)"); + ok(!r, "got %u\n", r); + + r = MsiDatabaseOpenViewA(db, "SELECT * FROM `U`", &view); + ok(!r, "got %u\n", r); + r = MsiViewExecute(view, 0); + ok(!r, "got %u\n", r); + + rec = MsiCreateRecord(4); + MsiRecordSetInteger(rec, 1, 1); + MsiRecordSetInteger(rec, 2, 2); + MsiRecordSetInteger(rec, 3, 3); + MsiRecordSetInteger(rec, 4, 4); + r = MsiViewModify(view, MSIMODIFY_MERGE, rec); + ok(!r, "got %u\n", r); + + MsiRecordSetInteger(rec, 3, 4); + r = MsiViewModify(view, MSIMODIFY_MERGE, rec); +todo_wine + ok(r == ERROR_FUNCTION_FAILED, "got %u\n", r); + + MsiRecordSetInteger(rec, 2, 4); + r = MsiViewModify(view, MSIMODIFY_MERGE, rec); + ok(!r, "got %u\n", r); + + MsiCloseHandle(rec); + MsiCloseHandle(view); + + r = MsiDatabaseOpenViewA(db, "SELECT * FROM `U`", &view); + ok(!r, "got %u\n", r); + r = MsiViewExecute(view, 0); + ok(!r, "got %u\n", r); + + r = MsiViewFetch(view, &rec); + ok(!r, "got %u\n", r); + check_record(rec, 4, "1", "2", "3", "4"); + MsiCloseHandle(rec); + + r = MsiViewFetch(view, &rec); + ok(!r, "got %u\n", r); + check_record(rec, 4, "1", "4", "4", "4"); + MsiCloseHandle(rec); + + r = MsiViewFetch(view, &rec); + ok(r == ERROR_NO_MORE_ITEMS, "got %u\n", r); + MsiCloseHandle(view); + + r = MsiDatabaseOpenViewA(db, "SELECT `A`,`C` FROM `U`", &view); + ok(!r, "got %u\n", r); + r = MsiViewExecute(view, 0); + ok(!r, "got %u\n", r); + + rec = MsiCreateRecord(2); + MsiRecordSetInteger(rec, 1, 1); + MsiRecordSetInteger(rec, 2, 2); + r = MsiViewModify(view, MSIMODIFY_MERGE, rec); + ok(!r, "got %u\n", r); + + r = MsiViewModify(view, MSIMODIFY_MERGE, rec); + ok(!r, "got %u\n", r); + + MsiRecordSetInteger(rec, 2, 3); + r = MsiViewModify(view, MSIMODIFY_MERGE, rec); +todo_wine + ok(r == ERROR_FUNCTION_FAILED, "got %u\n", r); + + MsiCloseHandle(rec); + MsiCloseHandle(view); + + r = MsiDatabaseOpenViewA(db, "SELECT * FROM `U` ORDER BY `B`", &view); + ok(!r, "got %u\n", r); + r = MsiViewExecute(view, 0); + ok(!r, "got %u\n", r); + + r = MsiViewFetch(view, &rec); + ok(!r, "got %u\n", r); + check_record(rec, 4, "1", "", "2", ""); + MsiCloseHandle(rec); + + r = MsiViewFetch(view, &rec); + ok(!r, "got %u\n", r); + check_record(rec, 4, "1", "2", "3", "4"); + MsiCloseHandle(rec); + + r = MsiViewFetch(view, &rec); + ok(!r, "got %u\n", r); + check_record(rec, 4, "1", "4", "4", "4"); + MsiCloseHandle(rec); + + r = MsiViewFetch(view, &rec); + ok(r == ERROR_NO_MORE_ITEMS, "got %u\n", r); + MsiCloseHandle(view); + + r = MsiDatabaseOpenViewA(db, "SELECT `A`,`B`,`C` FROM `U`", &view); + ok(!r, "got %u\n", r); + r = MsiViewExecute(view, 0); + ok(!r, "got %u\n", r); + + rec = MsiCreateRecord(3); + MsiRecordSetInteger(rec, 1, 1); + MsiRecordSetInteger(rec, 2, 2); + MsiRecordSetInteger(rec, 3, 3); + r = MsiViewModify(view, MSIMODIFY_MERGE, rec); +todo_wine + ok(r == ERROR_FUNCTION_FAILED, "got %u\n", r); + + MsiRecordSetInteger(rec, 1, 1); + MsiRecordSetInteger(rec, 2, MSI_NULL_INTEGER); + MsiRecordSetInteger(rec, 3, 2); + r = MsiViewModify(view, MSIMODIFY_MERGE, rec); + ok(!r, "got %u\n", r); + + MsiCloseHandle(rec); + MsiCloseHandle(view); + + MsiCloseHandle(db); + DeleteFileA(msifile); +} + START_TEST(db) { test_msidatabase(); @@ -8726,4 +8923,5 @@ START_TEST(db) test_embedded_nulls(); test_select_column_names(); test_primary_keys(); + test_viewmodify_merge(); }
2 years, 9 months
1
0
0
0
[reactos] 197/360: [WINESYNC] msi/tests: Add more tests for MSIMODIFY_REFRESH.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=a38f680cef3a2765997da…
commit a38f680cef3a2765997da24c02ad8dee22f31e48 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sun Mar 13 00:16:41 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:28:12 2022 +0100 [WINESYNC] msi/tests: Add more tests for MSIMODIFY_REFRESH. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id d2e51963a6218e1ecb3d8127004b9c8c128dd746 by Zebediah Figura <z.figura12(a)gmail.com> --- modules/rostests/winetests/msi/db.c | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/modules/rostests/winetests/msi/db.c b/modules/rostests/winetests/msi/db.c index e59846ffad7..f219b9a9a3f 100644 --- a/modules/rostests/winetests/msi/db.c +++ b/modules/rostests/winetests/msi/db.c @@ -6750,6 +6750,17 @@ static void test_viewmodify_refresh(void) r = MsiViewFetch(hview, &hrec); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + check_record(hrec, 2, "hi", "1"); + + MsiRecordSetInteger(hrec, 2, 5); + r = MsiViewModify(hview, MSIMODIFY_REFRESH, hrec); + ok(!r, "got %u\n", r); + check_record(hrec, 2, "hi", "1"); + + MsiRecordSetStringA(hrec, 1, "foo"); + r = MsiViewModify(hview, MSIMODIFY_REFRESH, hrec); + ok(!r, "got %u\n", r); + check_record(hrec, 2, "hi", "1"); query = "UPDATE `Table` SET `B` = 2 WHERE `A` = 'hi'"; r = run_query(hdb, 0, query); @@ -6758,6 +6769,14 @@ static void test_viewmodify_refresh(void) r = MsiViewModify(hview, MSIMODIFY_REFRESH, hrec); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); check_record(hrec, 2, "hi", "2"); + + r = run_query(hdb, 0, "UPDATE `Table` SET `B` = NULL WHERE `A` = 'hi'"); + ok(!r, "got %u\n", r); + + r = MsiViewModify(hview, MSIMODIFY_REFRESH, hrec); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + check_record(hrec, 2, "hi", ""); + MsiCloseHandle(hrec); MsiViewClose(hview); @@ -6791,6 +6810,24 @@ static void test_viewmodify_refresh(void) MsiViewClose(hview); MsiCloseHandle(hview); + + r = MsiDatabaseOpenViewA(hdb, "SELECT `B` FROM `Table` WHERE `A` = 'hello'", &hview); + ok(!r, "got %u\n", r); + r = MsiViewExecute(hview, 0); + ok(!r, "got %u\n", r); + + r = MsiViewFetch(hview, &hrec); + ok(!r, "got %u\n", r); + check_record(hrec, 1, "2"); + + MsiRecordSetInteger(hrec, 1, 8); + r = MsiViewModify(hview, MSIMODIFY_REFRESH, hrec); + ok(!r, "got %u\n", r); + check_record(hrec, 1, "2"); + + MsiCloseHandle(hrec); + MsiCloseHandle(hview); + MsiCloseHandle(hdb); DeleteFileA(msifile); }
2 years, 9 months
1
0
0
0
[reactos] 196/360: [WINESYNC] msi/tests: Add more tests for MSIMODIFY_ASSIGN.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=d2c4626d98ce456d874f1…
commit d2c4626d98ce456d874f17e9c34dcd5d7b9106f3 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sun Mar 13 00:16:41 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:28:12 2022 +0100 [WINESYNC] msi/tests: Add more tests for MSIMODIFY_ASSIGN. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id 0628a7c8bf43388a3c2d14ec5d57566921ef436c by Zebediah Figura <z.figura12(a)gmail.com> --- modules/rostests/winetests/msi/db.c | 172 +++++++++++++++++++++++++++++++++--- 1 file changed, 160 insertions(+), 12 deletions(-) diff --git a/modules/rostests/winetests/msi/db.c b/modules/rostests/winetests/msi/db.c index bcde840bd83..e59846ffad7 100644 --- a/modules/rostests/winetests/msi/db.c +++ b/modules/rostests/winetests/msi/db.c @@ -5176,12 +5176,7 @@ static void test_viewmodify_assign(void) ok(r == ERROR_SUCCESS, "MsiViewExecute failed\n"); r = MsiViewFetch(hview, &hrec); ok(r == ERROR_SUCCESS, "MsiViewFetch failed\n"); - - r = MsiRecordGetInteger(hrec, 1); - ok(r == 1, "Expected 1, got %d\n", r); - r = MsiRecordGetInteger(hrec, 2); - ok(r == 2, "Expected 2, got %d\n", r); - + check_record(hrec, 2, "1", "2"); r = MsiCloseHandle(hrec); ok(r == ERROR_SUCCESS, "failed to close record\n"); @@ -5226,12 +5221,7 @@ static void test_viewmodify_assign(void) ok(r == ERROR_SUCCESS, "MsiViewExecute failed\n"); r = MsiViewFetch(hview, &hrec); ok(r == ERROR_SUCCESS, "MsiViewFetch failed\n"); - - r = MsiRecordGetInteger(hrec, 1); - ok(r == 1, "Expected 1, got %d\n", r); - r = MsiRecordGetInteger(hrec, 2); - ok(r == 4, "Expected 4, got %d\n", r); - + check_record(hrec, 2, "1", "4"); r = MsiCloseHandle(hrec); ok(r == ERROR_SUCCESS, "failed to close record\n"); @@ -5243,6 +5233,164 @@ static void test_viewmodify_assign(void) r = MsiCloseHandle(hview); ok(r == ERROR_SUCCESS, "MsiCloseHandle failed\n"); + r = run_query(hdb, 0, "CREATE TABLE `table2` (`A` INT, `B` INT, `C` INT, `D` INT PRIMARY KEY `A`,`B`)"); + ok(!r, "got %u\n", r); + + r = MsiDatabaseOpenViewA(hdb, "SELECT * FROM `table2`", &hview); + ok(!r, "got %u\n", r); + r = MsiViewExecute(hview, 0); + ok(!r, "got %u\n", r); + + hrec = MsiCreateRecord(4); + MsiRecordSetInteger(hrec, 1, 1); + MsiRecordSetInteger(hrec, 2, 2); + MsiRecordSetInteger(hrec, 3, 3); + MsiRecordSetInteger(hrec, 4, 4); + r = MsiViewModify(hview, MSIMODIFY_ASSIGN, hrec); + ok(!r, "got %u\n", r); + MsiCloseHandle(hrec); + + MsiCloseHandle(hview); + + r = MsiDatabaseOpenViewA(hdb, "SELECT * FROM `table2`", &hview); + ok(!r, "got %u\n", r); + r = MsiViewExecute(hview, 0); + ok(!r, "got %u\n", r); + + r = MsiViewFetch(hview, &hrec); + ok(!r, "got %u\n", r); + check_record(hrec, 4, "1", "2", "3", "4"); + MsiCloseHandle(hrec); + + r = MsiViewFetch(hview, &hrec); + ok(r == ERROR_NO_MORE_ITEMS, "got %u\n", r); + MsiCloseHandle(hview); + + r = MsiDatabaseOpenViewA(hdb, "SELECT * FROM `table2`", &hview); + ok(!r, "got %u\n", r); + r = MsiViewExecute(hview, 0); + ok(!r, "got %u\n", r); + + hrec = MsiCreateRecord(4); + MsiRecordSetInteger(hrec, 1, 1); + MsiRecordSetInteger(hrec, 2, 4); + MsiRecordSetInteger(hrec, 3, 3); + MsiRecordSetInteger(hrec, 4, 3); + r = MsiViewModify(hview, MSIMODIFY_ASSIGN, hrec); + ok(!r, "got %u\n", r); + MsiCloseHandle(hrec); + + MsiCloseHandle(hview); + + r = MsiDatabaseOpenViewA(hdb, "SELECT * FROM `table2`", &hview); + ok(!r, "got %u\n", r); + r = MsiViewExecute(hview, 0); + ok(!r, "got %u\n", r); + + r = MsiViewFetch(hview, &hrec); + ok(!r, "got %u\n", r); + check_record(hrec, 4, "1", "2", "3", "4"); + MsiCloseHandle(hrec); + + r = MsiViewFetch(hview, &hrec); + ok(!r, "got %u\n", r); + check_record(hrec, 4, "1", "4", "3", "3"); + MsiCloseHandle(hrec); + + r = MsiViewFetch(hview, &hrec); + ok(r == ERROR_NO_MORE_ITEMS, "got %u\n", r); + MsiCloseHandle(hview); + + r = MsiDatabaseOpenViewA(hdb, "SELECT `B`, `C` FROM `table2`", &hview); + ok(!r, "got %u\n", r); + r = MsiViewExecute(hview, 0); + ok(!r, "got %u\n", r); + + hrec = MsiCreateRecord(2); + MsiRecordSetInteger(hrec, 1, 2); + MsiRecordSetInteger(hrec, 2, 4); + r = MsiViewModify(hview, MSIMODIFY_ASSIGN, hrec); + ok(!r, "got %u\n", r); + MsiRecordSetInteger(hrec, 1, 3); + r = MsiViewModify(hview, MSIMODIFY_ASSIGN, hrec); + ok(!r, "got %u\n", r); + MsiCloseHandle(hrec); + + MsiCloseHandle(hview); + + r = MsiDatabaseOpenViewA(hdb, "SELECT * FROM `table2` ORDER BY `A`", &hview); + ok(!r, "got %u\n", r); + r = MsiViewExecute(hview, 0); + ok(!r, "got %u\n", r); + + r = MsiViewFetch(hview, &hrec); + ok(!r, "got %u\n", r); + check_record(hrec, 4, "", "2", "4", ""); + MsiCloseHandle(hrec); + + r = MsiViewFetch(hview, &hrec); + ok(!r, "got %u\n", r); + check_record(hrec, 4, "", "3", "4", ""); + MsiCloseHandle(hrec); + + r = MsiViewFetch(hview, &hrec); + ok(!r, "got %u\n", r); + check_record(hrec, 4, "1", "2", "3", "4"); + MsiCloseHandle(hrec); + + r = MsiViewFetch(hview, &hrec); + ok(!r, "got %u\n", r); + check_record(hrec, 4, "1", "4", "3", "3"); + MsiCloseHandle(hrec); + + r = MsiViewFetch(hview, &hrec); + ok(r == ERROR_NO_MORE_ITEMS, "got %u\n", r); + MsiCloseHandle(hview); + + r = MsiDatabaseOpenViewA(hdb, "SELECT `A`, `B`, `C` FROM `table2`", &hview); + ok(!r, "got %u\n", r); + r = MsiViewExecute(hview, 0); + ok(!r, "got %u\n", r); + + hrec = MsiCreateRecord(3); + MsiRecordSetInteger(hrec, 1, 1); + MsiRecordSetInteger(hrec, 2, 2); + MsiRecordSetInteger(hrec, 3, 5); + r = MsiViewModify(hview, MSIMODIFY_ASSIGN, hrec); + ok(!r, "got %u\n", r); + MsiCloseHandle(hrec); + + MsiCloseHandle(hview); + + r = MsiDatabaseOpenViewA(hdb, "SELECT * FROM `table2` ORDER BY `A`", &hview); + ok(!r, "got %u\n", r); + r = MsiViewExecute(hview, 0); + ok(!r, "got %u\n", r); + + r = MsiViewFetch(hview, &hrec); + ok(!r, "got %u\n", r); + check_record(hrec, 4, "", "2", "4", ""); + MsiCloseHandle(hrec); + + r = MsiViewFetch(hview, &hrec); + ok(!r, "got %u\n", r); + check_record(hrec, 4, "", "3", "4", ""); + MsiCloseHandle(hrec); + + r = MsiViewFetch(hview, &hrec); + ok(!r, "got %u\n", r); + check_record(hrec, 4, "1", "2", "5", ""); + MsiCloseHandle(hrec); + + r = MsiViewFetch(hview, &hrec); + ok(!r, "got %u\n", r); + check_record(hrec, 4, "1", "4", "3", "3"); + MsiCloseHandle(hrec); + + r = MsiViewFetch(hview, &hrec); + ok(r == ERROR_NO_MORE_ITEMS, "got %u\n", r); + MsiCloseHandle(hview); + /* close database */ r = MsiCloseHandle( hdb ); ok(r == ERROR_SUCCESS, "MsiOpenDatabase close failed\n");
2 years, 9 months
1
0
0
0
[reactos] 195/360: [WINESYNC] msi: Translate records as appropriate in SELECT_modify().
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=f954f7ec69126bbd3d63b…
commit f954f7ec69126bbd3d63b0ad815d2d841575f3c2 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sun Mar 13 00:16:40 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:28:12 2022 +0100 [WINESYNC] msi: Translate records as appropriate in SELECT_modify(). Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id e742319627e311cfc364901ed82517dba9990456 by Zebediah Figura <z.figura12(a)gmail.com> --- dll/win32/msi/select.c | 61 ++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 49 insertions(+), 12 deletions(-) diff --git a/dll/win32/msi/select.c b/dll/win32/msi/select.c index b38f339bd7a..3c643f37239 100644 --- a/dll/win32/msi/select.c +++ b/dll/win32/msi/select.c @@ -48,6 +48,30 @@ typedef struct tagMSISELECTVIEW UINT cols[1]; } MSISELECTVIEW; +static UINT translate_record( MSISELECTVIEW *sv, MSIRECORD *in, MSIRECORD **out ) +{ + UINT r, col_count, i; + MSIRECORD *object; + + if ((r = sv->table->ops->get_dimensions( sv->table, NULL, &col_count ))) + return r; + + if (!(object = MSI_CreateRecord( col_count ))) + return ERROR_OUTOFMEMORY; + + for (i = 0; i < sv->num_cols; i++) + { + if ((r = MSI_RecordCopyField( in, i + 1, object, sv->cols[i] ))) + { + msiobj_release( &object->hdr ); + return r; + } + } + + *out = object; + return ERROR_SUCCESS; +} + static UINT SELECT_fetch_int( struct tagMSIVIEW *view, UINT row, UINT col, UINT *val ) { MSISELECTVIEW *sv = (MSISELECTVIEW*)view; @@ -135,7 +159,7 @@ static UINT SELECT_set_row( struct tagMSIVIEW *view, UINT row, MSIRECORD *rec, U static UINT SELECT_insert_row( struct tagMSIVIEW *view, MSIRECORD *record, UINT row, BOOL temporary ) { MSISELECTVIEW *sv = (MSISELECTVIEW*)view; - UINT i, table_cols, r; + UINT table_cols, r; MSIRECORD *outrec; TRACE("%p %p\n", sv, record ); @@ -148,20 +172,12 @@ static UINT SELECT_insert_row( struct tagMSIVIEW *view, MSIRECORD *record, UINT if (r != ERROR_SUCCESS) return r; - outrec = MSI_CreateRecord( table_cols + 1 ); - - for (i=0; i<sv->num_cols; i++) - { - r = MSI_RecordCopyField( record, i+1, outrec, sv->cols[i] ); - if (r != ERROR_SUCCESS) - goto fail; - } + if ((r = translate_record( sv, record, &outrec ))) + return r; r = sv->table->ops->insert_row( sv->table, outrec, row, temporary ); -fail: msiobj_release( &outrec->hdr ); - return r; } @@ -280,20 +296,41 @@ static UINT SELECT_modify( struct tagMSIVIEW *view, MSIMODIFY mode, MSIRECORD *rec, UINT row ) { MSISELECTVIEW *sv = (MSISELECTVIEW*)view; + MSIRECORD *table_rec; + UINT r; TRACE("view %p, mode %d, rec %p, row %u.\n", view, mode, rec, row); if( !sv->table ) return ERROR_FUNCTION_FAILED; + /* Tests demonstrate that UPDATE only affects the columns selected and that + * others are left unchanged; however, ASSIGN overwrites unselected columns + * to NULL. Similarly, MERGE matches all unselected columns as NULL rather + * than just ignoring them. */ + switch (mode) { case MSIMODIFY_REFRESH: return msi_view_refresh_row(sv->db, view, row, rec); case MSIMODIFY_UPDATE: return msi_select_update(view, rec, row); - default: + case MSIMODIFY_INSERT: + case MSIMODIFY_ASSIGN: + case MSIMODIFY_MERGE: + case MSIMODIFY_INSERT_TEMPORARY: + case MSIMODIFY_VALIDATE_NEW: + if ((r = translate_record( sv, rec, &table_rec ))) + return r; + + r = sv->table->ops->modify( sv->table, mode, table_rec, row ); + msiobj_release( &table_rec->hdr ); + return r; + case MSIMODIFY_DELETE: return sv->table->ops->modify( sv->table, mode, rec, row ); + default: + FIXME("unhandled mode %d\n", mode); + return ERROR_FUNCTION_FAILED; } }
2 years, 9 months
1
0
0
0
[reactos] 194/360: [WINESYNC] msi/tests: Add some more tests for MsiViewModify() applied to joins.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=3b4aa9822bbc9b3befa48…
commit 3b4aa9822bbc9b3befa48cd46ec7d9b51311c1bf Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sun Mar 13 00:16:40 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:28:12 2022 +0100 [WINESYNC] msi/tests: Add some more tests for MsiViewModify() applied to joins. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id b9faa8d170349ce48e7f572461e7c41422317e43 by Zebediah Figura <z.figura12(a)gmail.com> --- modules/rostests/winetests/msi/db.c | 55 ++++++++++++++++++++++++++++++------- 1 file changed, 45 insertions(+), 10 deletions(-) diff --git a/modules/rostests/winetests/msi/db.c b/modules/rostests/winetests/msi/db.c index e8ae8d21d3c..bcde840bd83 100644 --- a/modules/rostests/winetests/msi/db.c +++ b/modules/rostests/winetests/msi/db.c @@ -3620,28 +3620,63 @@ static void test_join(void) ok( r == ERROR_SUCCESS, "failed to fetch view: %d\n", r ); check_record(hrec, 2, "alveolar", "procerus"); - r = MsiRecordSetStringA( hrec, 1, "epicranius" ); + r = MsiRecordSetStringA( hrec, 1, "fascia" ); + ok( r == ERROR_SUCCESS, "failed to set string: %d\n", r ); + r = MsiRecordSetStringA( hrec, 2, "pterygoid" ); ok( r == ERROR_SUCCESS, "failed to set string: %d\n", r ); - r = MsiViewModify(hview, MSIMODIFY_UPDATE, hrec); - ok( r == ERROR_SUCCESS, "failed to update row: %d\n", r ); - - /* try another valid operation for joins */ r = MsiViewModify(hview, MSIMODIFY_REFRESH, hrec); ok( r == ERROR_SUCCESS, "failed to refresh row: %d\n", r ); - check_record(hrec, 2, "epicranius", "procerus"); + check_record(hrec, 2, "alveolar", "procerus"); - /* try an invalid operation for joins */ - r = MsiViewModify(hview, MSIMODIFY_DELETE, hrec); - ok( r == ERROR_FUNCTION_FAILED, "unexpected result: %d\n", r ); + r = MsiRecordSetStringA( hrec, 1, "epicranius" ); + ok( r == ERROR_SUCCESS, "failed to set string: %d\n", r ); + r = MsiViewModify(hview, MSIMODIFY_UPDATE, hrec); + ok( r == ERROR_SUCCESS, "failed to update row: %d\n", r ); + + /* primary key cannot be updated */ r = MsiRecordSetStringA( hrec, 2, "epicranius" ); ok( r == ERROR_SUCCESS, "failed to set string: %d\n", r ); - /* primary key cannot be updated */ r = MsiViewModify(hview, MSIMODIFY_UPDATE, hrec); ok( r == ERROR_FUNCTION_FAILED, "failed to update row: %d\n", r ); + /* all other operations are invalid for joins */ + r = MsiViewModify(hview, MSIMODIFY_SEEK, hrec); + ok( r == ERROR_FUNCTION_FAILED, "unexpected result: %d\n", r ); + + r = MsiViewModify(hview, MSIMODIFY_ASSIGN, hrec); + ok( r == ERROR_FUNCTION_FAILED, "unexpected result: %d\n", r ); + + r = MsiViewModify(hview, MSIMODIFY_REPLACE, hrec); + ok( r == ERROR_FUNCTION_FAILED, "unexpected result: %d\n", r ); + + r = MsiViewModify(hview, MSIMODIFY_MERGE, hrec); + ok( r == ERROR_FUNCTION_FAILED, "unexpected result: %d\n", r ); + + r = MsiViewModify(hview, MSIMODIFY_DELETE, hrec); + ok( r == ERROR_FUNCTION_FAILED, "unexpected result: %d\n", r ); + + r = MsiViewModify(hview, MSIMODIFY_VALIDATE, hrec); + ok( r == ERROR_FUNCTION_FAILED, "unexpected result: %d\n", r ); + + r = MsiViewModify(hview, MSIMODIFY_VALIDATE_DELETE, hrec); + ok( r == ERROR_FUNCTION_FAILED, "unexpected result: %d\n", r ); + + MsiRecordSetStringA(hrec, 2, "epicranius"); + r = MsiViewModify(hview, MSIMODIFY_INSERT, hrec); + ok( r == ERROR_FUNCTION_FAILED, "unexpected result: %d\n", r ); + + r = MsiViewModify(hview, MSIMODIFY_INSERT_TEMPORARY, hrec); + ok( r == ERROR_FUNCTION_FAILED, "unexpected result: %d\n", r ); + + r = MsiViewModify(hview, MSIMODIFY_VALIDATE_NEW, hrec); + ok( r == ERROR_FUNCTION_FAILED, "unexpected result: %d\n", r ); + + r = MsiViewModify(hview, MSIMODIFY_VALIDATE_FIELD, hrec); + ok( r == ERROR_FUNCTION_FAILED, "unexpected result: %d\n", r ); + MsiCloseHandle(hrec); MsiViewClose(hview); MsiCloseHandle(hview);
2 years, 9 months
1
0
0
0
[reactos] 193/360: [WINESYNC] msi: Don't check the primary keys when handling MSIMODIFY_DELETE.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=5f1570f47d86a76014fad…
commit 5f1570f47d86a76014fad532646bf35e9c031bcb Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sun Mar 13 00:16:39 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:28:11 2022 +0100 [WINESYNC] msi: Don't check the primary keys when handling MSIMODIFY_DELETE. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id 96b6d6b58725f17f3faabeeffe82d2b8bd5f0445 by Zebediah Figura <z.figura12(a)gmail.com> --- dll/win32/msi/table.c | 14 +------------- modules/rostests/winetests/msi/db.c | 1 + 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/dll/win32/msi/table.c b/dll/win32/msi/table.c index a2b83e27de2..57114baa749 100644 --- a/dll/win32/msi/table.c +++ b/dll/win32/msi/table.c @@ -1835,18 +1835,6 @@ static UINT msi_table_assign(struct tagMSIVIEW *view, MSIRECORD *rec) return TABLE_insert_row( view, rec, -1, FALSE ); } -static UINT modify_delete_row( struct tagMSIVIEW *view, MSIRECORD *rec ) -{ - MSITABLEVIEW *tv = (MSITABLEVIEW *)view; - UINT row, r; - - r = msi_table_find_row(tv, rec, &row, NULL); - if (r != ERROR_SUCCESS) - return r; - - return TABLE_delete_row(view, row); -} - static UINT msi_refresh_record( struct tagMSIVIEW *view, MSIRECORD *rec, UINT row ) { MSIRECORD *curr; @@ -1878,7 +1866,7 @@ static UINT TABLE_modify( struct tagMSIVIEW *view, MSIMODIFY eModifyMode, switch (eModifyMode) { case MSIMODIFY_DELETE: - r = modify_delete_row( view, rec ); + r = TABLE_delete_row( view, row ); break; case MSIMODIFY_VALIDATE_NEW: r = table_validate_new( tv, rec, &column ); diff --git a/modules/rostests/winetests/msi/db.c b/modules/rostests/winetests/msi/db.c index cbdfd3ce7de..e8ae8d21d3c 100644 --- a/modules/rostests/winetests/msi/db.c +++ b/modules/rostests/winetests/msi/db.c @@ -5498,6 +5498,7 @@ static void test_viewmodify_delete(void) ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); /* delete 2 */ + MsiRecordSetInteger(hrec, 1, 4); r = MsiViewModify(hview, MSIMODIFY_DELETE, hrec); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
2 years, 9 months
1
0
0
0
[reactos] 192/360: [WINESYNC] msi: Implement MSIMODIFY_REFRESH using msi_view_refresh_row().
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=17ae3a2dd9390df7bd128…
commit 17ae3a2dd9390df7bd1284e02a43528d32f7e27b Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sun Mar 13 00:16:39 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:28:11 2022 +0100 [WINESYNC] msi: Implement MSIMODIFY_REFRESH using msi_view_refresh_row(). Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id 05976464556385e7a7ef5d04b2a56c4830ff33cf by Zebediah Figura <z.figura12(a)gmail.com> --- dll/win32/msi/query.h | 2 ++ dll/win32/msi/select.c | 15 ++++++++++----- modules/rostests/winetests/msi/db.c | 4 +++- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/dll/win32/msi/query.h b/dll/win32/msi/query.h index d79c14fd42e..c0144d30544 100644 --- a/dll/win32/msi/query.h +++ b/dll/win32/msi/query.h @@ -153,4 +153,6 @@ UINT msi_create_table( MSIDATABASE *db, LPCWSTR name, column_info *col_info, UINT msi_select_update( MSIVIEW *view, MSIRECORD *rec, UINT row ) DECLSPEC_HIDDEN; +UINT msi_view_refresh_row( MSIDATABASE *db, MSIVIEW *view, UINT row, MSIRECORD *rec ) DECLSPEC_HIDDEN; + #endif /* __WINE_MSI_QUERY_H */ diff --git a/dll/win32/msi/select.c b/dll/win32/msi/select.c index ef16e5d09f7..b38f339bd7a 100644 --- a/dll/win32/msi/select.c +++ b/dll/win32/msi/select.c @@ -276,20 +276,25 @@ UINT msi_select_update(MSIVIEW *view, MSIRECORD *rec, UINT row) return ERROR_SUCCESS; } -static UINT SELECT_modify( struct tagMSIVIEW *view, MSIMODIFY eModifyMode, +static UINT SELECT_modify( struct tagMSIVIEW *view, MSIMODIFY mode, MSIRECORD *rec, UINT row ) { MSISELECTVIEW *sv = (MSISELECTVIEW*)view; - TRACE("%p %d %p %d\n", sv, eModifyMode, rec, row ); + TRACE("view %p, mode %d, rec %p, row %u.\n", view, mode, rec, row); if( !sv->table ) return ERROR_FUNCTION_FAILED; - if (eModifyMode == MSIMODIFY_UPDATE) + switch (mode) + { + case MSIMODIFY_REFRESH: + return msi_view_refresh_row(sv->db, view, row, rec); + case MSIMODIFY_UPDATE: return msi_select_update(view, rec, row); - - return sv->table->ops->modify( sv->table, eModifyMode, rec, row ); + default: + return sv->table->ops->modify( sv->table, mode, rec, row ); + } } static UINT SELECT_delete( struct tagMSIVIEW *view ) diff --git a/modules/rostests/winetests/msi/db.c b/modules/rostests/winetests/msi/db.c index 09ba4b8293d..cbdfd3ce7de 100644 --- a/modules/rostests/winetests/msi/db.c +++ b/modules/rostests/winetests/msi/db.c @@ -3618,6 +3618,7 @@ static void test_join(void) r = MsiViewFetch(hview, &hrec); ok( r == ERROR_SUCCESS, "failed to fetch view: %d\n", r ); + check_record(hrec, 2, "alveolar", "procerus"); r = MsiRecordSetStringA( hrec, 1, "epicranius" ); ok( r == ERROR_SUCCESS, "failed to set string: %d\n", r ); @@ -3627,7 +3628,8 @@ static void test_join(void) /* try another valid operation for joins */ r = MsiViewModify(hview, MSIMODIFY_REFRESH, hrec); - todo_wine ok( r == ERROR_SUCCESS, "failed to refresh row: %d\n", r ); + ok( r == ERROR_SUCCESS, "failed to refresh row: %d\n", r ); + check_record(hrec, 2, "epicranius", "procerus"); /* try an invalid operation for joins */ r = MsiViewModify(hview, MSIMODIFY_DELETE, hrec);
2 years, 9 months
1
0
0
0
← Newer
1
...
18
19
20
21
22
23
24
...
44
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
Results per page:
10
25
50
100
200