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
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 -----
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] 301/360: [WINESYNC] msiexec: Use wide-char string literals.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=cdb9abd62581e02b75bcb…
commit cdb9abd62581e02b75bcb5b05595a5a693a981d8 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sun Mar 13 19:08:57 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:28:33 2022 +0100 [WINESYNC] msiexec: Use wide-char string literals. Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id 64709fe7e9c629f476fb0dd7b62480e868b0174c by Michael Stefaniuc <mstefani(a)winehq.org> --- base/system/msiexec/msiexec.c | 37 +++++++++---------------------------- 1 file changed, 9 insertions(+), 28 deletions(-) diff --git a/base/system/msiexec/msiexec.c b/base/system/msiexec/msiexec.c index 17d4bf87cdd..12ff7e7dc4e 100644 --- a/base/system/msiexec/msiexec.c +++ b/base/system/msiexec/msiexec.c @@ -46,19 +46,6 @@ struct string_list WCHAR str[1]; }; -static const WCHAR ActionAdmin[] = { - 'A','C','T','I','O','N','=','A','D','M','I','N',0 }; -static const WCHAR RemoveAll[] = { - 'R','E','M','O','V','E','=','A','L','L',0 }; - -static const WCHAR InstallRunOnce[] = { - 'S','o','f','t','w','a','r','e','\\', - 'M','i','c','r','o','s','o','f','t','\\', - 'W','i','n','d','o','w','s','\\', - 'C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\', - 'I','n','s','t','a','l','l','e','r','\\', - 'R','u','n','O','n','c','e','E','n','t','r','i','e','s',0}; - static void ShowUsage(int ExitCode) { WCHAR msiexec_version[40]; @@ -339,8 +326,6 @@ static DWORD DoDllUnregisterServer(LPCWSTR DllName) static DWORD DoRegServer(void) { - static const WCHAR msiserverW[] = {'M','S','I','S','e','r','v','e','r',0}; - static const WCHAR msiexecW[] = {'\\','m','s','i','e','x','e','c',' ','/','V',0}; SC_HANDLE scm, service; WCHAR path[MAX_PATH+12]; DWORD len, ret = 0; @@ -351,8 +336,8 @@ static DWORD DoRegServer(void) return 1; } len = GetSystemDirectoryW(path, MAX_PATH); - lstrcpyW(path + len, msiexecW); - if ((service = CreateServiceW(scm, msiserverW, msiserverW, GENERIC_ALL, + lstrcpyW(path + len, L"\\msiexec /V"); + if ((service = CreateServiceW(scm, L"MSIServer", L"MSIServer", GENERIC_ALL, SERVICE_WIN32_SHARE_PROCESS, SERVICE_DEMAND_START, SERVICE_ERROR_NORMAL, path, NULL, NULL, NULL, NULL, NULL))) { @@ -369,7 +354,6 @@ static DWORD DoRegServer(void) static DWORD DoUnregServer(void) { - static const WCHAR msiserverW[] = {'M','S','I','S','e','r','v','e','r',0}; SC_HANDLE scm, service; DWORD ret = 0; @@ -378,7 +362,7 @@ static DWORD DoUnregServer(void) fprintf(stderr, "Failed to open service control manager\n"); return 1; } - if ((service = OpenServiceW(scm, msiserverW, DELETE))) + if ((service = OpenServiceW(scm, L"MSIServer", DELETE))) { if (!DeleteService(service)) { @@ -409,7 +393,6 @@ static DWORD CALLBACK custom_action_thread(void *arg) static int custom_action_server(const WCHAR *arg) { - static const WCHAR pipe_name[] = {'\\','\\','.','\\','p','i','p','e','\\','m','s','i','c','a','_','%','x','_','%','d',0}; GUID guid, *thread_guid; DWORD64 thread64; WCHAR buffer[24]; @@ -425,7 +408,7 @@ static int custom_action_server(const WCHAR *arg) return 1; } - swprintf(buffer, ARRAY_SIZE(buffer), pipe_name, client_pid, sizeof(void *) * 8); + swprintf(buffer, ARRAY_SIZE(buffer), L"\\\\.\\pipe\\msica_%x_%d", client_pid, (int)(sizeof(void *) * 8)); pipe = CreateFileW(buffer, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL); if (pipe == INVALID_HANDLE_VALUE) { @@ -577,7 +560,8 @@ static BOOL process_args_from_reg( const WCHAR *ident, int *pargc, WCHAR ***parg WCHAR *buf; BOOL ret = FALSE; - r = RegOpenKeyW(HKEY_LOCAL_MACHINE, InstallRunOnce, &hkey); + r = RegOpenKeyW(HKEY_LOCAL_MACHINE, + L"Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\RunOnceEntries", &hkey); if(r != ERROR_SUCCESS) return FALSE; r = RegQueryValueExW(hkey, ident, 0, &type, 0, &sz); @@ -700,7 +684,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine ShowUsage(1); WINE_TRACE("argvW[%d] = %s\n", i, wine_dbgstr_w(argvW[i])); PackageName = argvW[i]; - StringListAppend(&property_list, ActionAdmin); + StringListAppend(&property_list, L"ACTION=ADMIN"); WINE_FIXME("Administrative installs are not currently supported\n"); } else if(msi_option_prefix(argvW[i], "f")) @@ -783,7 +767,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine PackageName = argvW[i]; } WINE_TRACE("PackageName = %s\n", wine_dbgstr_w(PackageName)); - StringListAppend(&property_list, RemoveAll); + StringListAppend(&property_list, L"REMOVE=ALL"); } else if(msi_option_prefix(argvW[i], "j")) { @@ -996,11 +980,8 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine } else if(msi_option_equal(argvW[i], "passive")) { - static const WCHAR rebootpromptW[] = - {'R','E','B','O','O','T','P','R','O','M','P','T','=','"','S','"',0}; - InstallUILevel = INSTALLUILEVEL_BASIC|INSTALLUILEVEL_PROGRESSONLY|INSTALLUILEVEL_HIDECANCEL; - StringListAppend(&property_list, rebootpromptW); + StringListAppend(&property_list, L"REBOOTPROMPT=\"S\""); } else if(msi_option_equal(argvW[i], "y")) {
2 years, 7 months
1
0
0
0
[reactos] 300/360: [WINESYNC] msi: Fix a leak (Coverity).
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=dac7d6f23c0e553ceeaaf…
commit dac7d6f23c0e553ceeaaf6489bda550b7fccb0d2 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sun Mar 13 19:08:50 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:28:33 2022 +0100 [WINESYNC] msi: Fix a leak (Coverity). Signed-off-by: Sven Baars <sbaars(a)codeweavers.com> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id 462edf6e2a79208d6c88ac6aeb760733d571b7c5 by Sven Baars <sbaars(a)codeweavers.com> --- dll/win32/msi/table.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dll/win32/msi/table.c b/dll/win32/msi/table.c index 612a3695973..e9d6e8804e7 100644 --- a/dll/win32/msi/table.c +++ b/dll/win32/msi/table.c @@ -2887,6 +2887,7 @@ UINT TransformView_Create( MSIDATABASE *db, string_table *st, LPCWSTR name, MSIV colinfo[idx - 1].colname = msi_string_lookup( st, name_id, NULL ); else ERR( "column name %s is not defined in strings table\n", wine_dbgstr_w(name) ); + msiobj_release( &rec->hdr ); } MSI_ViewClose( q ); msiobj_release( &q->hdr );
2 years, 7 months
1
0
0
0
[reactos] 299/360: [WINESYNC] msi: Install feature when new component is added.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=1cdb30ec0d4d16c77c219…
commit 1cdb30ec0d4d16c77c21935836b6fe05c5ebc23b Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sun Mar 13 19:08:45 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:28:33 2022 +0100 [WINESYNC] msi: Install feature when new component is added. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=49350
Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id 877540b522c46134aa1b843519fa5694adb187ce by Piotr Caban <piotr(a)codeweavers.com> --- dll/win32/msi/action.c | 112 ++++++++++++++++++++++++++++++--- dll/win32/msi/msipriv.h | 2 + dll/win32/msi/patch.c | 5 ++ modules/rostests/winetests/msi/patch.c | 2 +- 4 files changed, 110 insertions(+), 11 deletions(-) diff --git a/dll/win32/msi/action.c b/dll/win32/msi/action.c index 762d734fcbd..ee3686840a6 100644 --- a/dll/win32/msi/action.c +++ b/dll/win32/msi/action.c @@ -1381,6 +1381,49 @@ static UINT load_all_patches(MSIPACKAGE *package) return rc; } +static UINT iterate_patched_component( MSIRECORD *row, LPVOID param ) +{ + MSIPACKAGE *package = param; + const WCHAR *name; + MSICOMPONENT *c; + + name = MSI_RecordGetString( row, 1 ); + TRACE( "found patched component: %s\n", wine_dbgstr_w(name) ); + c = msi_get_loaded_component( package, name ); + if (!c) + return ERROR_SUCCESS; + + c->updated = 1; + if (!wcscmp( MSI_RecordGetString( row, 2 ), L"INSERT" )) + c->added = 1; + return ERROR_SUCCESS; +} + +static void mark_patched_components( MSIPACKAGE *package ) +{ + static const WCHAR select[] = L"SELECT `Row`, `Column` FROM `_TransformView` WHERE `Table`='Component'"; + MSIQUERY *q; + UINT r; + + r = MSI_OpenQuery( package->db, &q, select ); + if (r != ERROR_SUCCESS) + return; + + MSI_IterateRecords( q, NULL, iterate_patched_component, package ); + msiobj_release( &q->hdr ); + + while (1) + { + r = MSI_OpenQuery( package->db, &q, L"ALTER TABLE `_TransformView` FREE" ); + if (r != ERROR_SUCCESS) + return; + r = MSI_ViewExecute( q, NULL ); + msiobj_release( &q->hdr ); + if (r != ERROR_SUCCESS) + return; + } +} + static UINT load_folder_persistence( MSIPACKAGE *package, MSIFOLDER *folder ) { static const WCHAR query[] = { @@ -1525,6 +1568,7 @@ static UINT ACTION_CostInitialize(MSIPACKAGE *package) msi_load_all_features( package ); load_all_files( package ); load_all_patches( package ); + mark_patched_components( package ); load_all_media( package ); return ERROR_SUCCESS; @@ -1809,12 +1853,6 @@ UINT MSI_SetFeatureStates(MSIPACKAGE *package) } } } - LIST_FOR_EACH_ENTRY( feature, &package->features, MSIFEATURE, entry ) - { - if (feature->Feature_Parent) continue; - disable_children( feature, level ); - follow_parent( feature ); - } } else if (!msi_get_property_int( package->db, szInstalled, 0 )) { @@ -1841,15 +1879,69 @@ UINT MSI_SetFeatureStates(MSIPACKAGE *package) } } } - /* disable child features of unselected parent or follow parent */ + } + else + { LIST_FOR_EACH_ENTRY( feature, &package->features, MSIFEATURE, entry ) { - if (feature->Feature_Parent) continue; - disable_children( feature, level ); - follow_parent( feature ); + ComponentList *cl; + MSIFEATURE *cur; + + if (!is_feature_selected( feature, level )) continue; + if (feature->ActionRequest != INSTALLSTATE_UNKNOWN) continue; + + LIST_FOR_EACH_ENTRY( cl, &feature->Components, ComponentList, entry ) + { + if (!cl->component->updated && !cl->component->added) + continue; + + cur = feature; + while (cur) + { + if (cur->ActionRequest != INSTALLSTATE_UNKNOWN) + break; + + if (cur->Installed != INSTALLSTATE_ABSENT) + { + cur->Action = cur->Installed; + cur->ActionRequest = cur->Installed; + } + else if (!cl->component->added) + { + break; + } + else if (cur->Attributes & msidbFeatureAttributesFavorSource) + { + cur->Action = INSTALLSTATE_SOURCE; + cur->ActionRequest = INSTALLSTATE_SOURCE; + } + else if (cur->Attributes & msidbFeatureAttributesFavorAdvertise) + { + cur->Action = INSTALLSTATE_ADVERTISED; + cur->ActionRequest = INSTALLSTATE_ADVERTISED; + } + else + { + cur->Action = INSTALLSTATE_LOCAL; + cur->ActionRequest = INSTALLSTATE_LOCAL; + } + + if (!cur->Feature_Parent) + break; + cur = msi_get_loaded_feature(package, cur->Feature_Parent); + } + } } } + /* disable child features of unselected parent or follow parent */ + LIST_FOR_EACH_ENTRY( feature, &package->features, MSIFEATURE, entry ) + { + if (feature->Feature_Parent) continue; + disable_children( feature, level ); + follow_parent( feature ); + } + /* now we want to set component state based based on feature state */ LIST_FOR_EACH_ENTRY( feature, &package->features, MSIFEATURE, entry ) { diff --git a/dll/win32/msi/msipriv.h b/dll/win32/msi/msipriv.h index 20cf8e8b87c..503543e82e8 100644 --- a/dll/win32/msi/msipriv.h +++ b/dll/win32/msi/msipriv.h @@ -544,6 +544,8 @@ typedef struct tagMSICOMPONENT unsigned int hasAdvertisedFeature:1; unsigned int hasLocalFeature:1; unsigned int hasSourceFeature:1; + unsigned int added:1; + unsigned int updated:1; } MSICOMPONENT; typedef struct tagComponentList diff --git a/dll/win32/msi/patch.c b/dll/win32/msi/patch.c index 1233ec306bf..67da5778415 100644 --- a/dll/win32/msi/patch.c +++ b/dll/win32/msi/patch.c @@ -274,9 +274,14 @@ static UINT apply_substorage_transform( MSIPACKAGE *package, MSIDATABASE *patch_ { ret = check_transform_applicable( package, stg ); if (ret == ERROR_SUCCESS) + { + msi_table_apply_transform( package->db, stg, MSITRANSFORM_ERROR_VIEWTRANSFORM ); msi_table_apply_transform( package->db, stg, 0 ); + } else + { TRACE("substorage transform %s wasn't applicable\n", debugstr_w(name)); + } IStorage_Release( stg ); } else diff --git a/modules/rostests/winetests/msi/patch.c b/modules/rostests/winetests/msi/patch.c index a846defef45..87f64d6c835 100644 --- a/modules/rostests/winetests/msi/patch.c +++ b/modules/rostests/winetests/msi/patch.c @@ -844,7 +844,7 @@ static void test_simple_patch( void ) size = get_pf_file_size( "msitest\\patch.txt" ); ok( size == 1002, "expected 1002, got %u\n", size ); size = get_pf_file_size( "msitest\\file.txt" ); - todo_wine ok( size == 1000, "expected 1000, got %u\n", size ); + ok( size == 1000, "expected 1000, got %u\n", size ); /* show that MsiOpenPackage applies registered patches */ r = MsiOpenPackageA( path, &hpackage );
2 years, 7 months
1
0
0
0
[reactos] 298/360: [WINESYNC] msi: Add disabled feature to show that it's not getting installed by patch.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=aa0312d7cb74ca2b4c66d…
commit aa0312d7cb74ca2b4c66d4c35d075d4b2598544c Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sun Mar 13 19:08:45 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:28:32 2022 +0100 [WINESYNC] msi: Add disabled feature to show that it's not getting installed by patch. Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id 99e7c801e4d5032110190acbb04d85eb069df867 by Piotr Caban <piotr(a)codeweavers.com> --- modules/rostests/winetests/msi/patch.c | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/modules/rostests/winetests/msi/patch.c b/modules/rostests/winetests/msi/patch.c index 6449b7e67a4..a846defef45 100644 --- a/modules/rostests/winetests/msi/patch.c +++ b/modules/rostests/winetests/msi/patch.c @@ -73,7 +73,8 @@ static const char file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n" "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n" "File\tFile\n" - "patch.txt\tpatch\tpatch.txt\t1000\t\t\t0\t1\n"; + "patch.txt\tpatch\tpatch.txt\t1000\t\t\t0\t1\n" + "disable.txt\tdisable\tdisable.txt\t1000\t\t\t0\t1\n"; static const char directory_dat[] = "Directory\tDirectory_Parent\tDefaultDir\n" @@ -87,19 +88,22 @@ static const char component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n" "s72\tS38\ts72\ti2\tS255\tS72\n" "Component\tComponent\n" - "patch\t{4B79D87E-6D28-4FD3-92D6-CD9B26AF64F1}\tMSITESTDIR\t0\t\tpatch.txt\n"; + "patch\t{4B79D87E-6D28-4FD3-92D6-CD9B26AF64F1}\tMSITESTDIR\t0\t\tpatch.txt\n" + "disable\t{BDDBA0EE-0031-4591-ADC0-33308175AC19}\tMSITESTDIR\t0\t\tdisable.txt\n"; static const char feature_dat[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n" "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n" "Feature\tFeature\n" - "patch\t\t\tpatch feature\t1\t1\tMSITESTDIR\t0\n"; + "patch\t\t\tpatch feature\t1\t1\tMSITESTDIR\t0\n" + "disable\t\t\tdisabled feature\t1\t1\tMSITESTDIR\t0\n"; static const char feature_comp_dat[] = "Feature_\tComponent_\n" "s38\ts72\n" "FeatureComponents\tFeature_\tComponent_\n" - "patch\tpatch\n"; + "patch\tpatch\n" + "disable\tdisable\n"; static const char install_exec_seq_dat[] = "Action\tCondition\tSequence\n" @@ -121,6 +125,12 @@ static const char install_exec_seq_dat[] = "UnpublishFeatures\t\t5300\n" "InstallFinalize\t\t6000\n"; +static const char condition_dat[] = + "Feature_\tLevel\tCondition\n" + "s38\ti2\tS255\n" + "Condition\tFeature_\tLevel\n" + "disable\t0\tDISABLE_FEATURE\n"; + struct msi_table { const char *filename; @@ -139,7 +149,8 @@ static const struct msi_table tables[] = ADD_TABLE( feature_comp ), ADD_TABLE( property ), ADD_TABLE( install_exec_seq ), - ADD_TABLE( media ) + ADD_TABLE( media ), + ADD_TABLE( condition ) }; static void init_function_pointers( void ) @@ -757,7 +768,7 @@ static void test_simple_patch( void ) MsiSetInternalUI( INSTALLUILEVEL_NONE, NULL ); - r = MsiInstallProductA( msifile, NULL ); + r = MsiInstallProductA( msifile, "DISABLE_FEATURE=1" ); if (r != ERROR_SUCCESS) { skip("Product installation failed with error code %u\n", r); @@ -1101,7 +1112,7 @@ static void test_system_tables( void ) MsiSetInternalUI( INSTALLUILEVEL_NONE, NULL ); - r = MsiInstallProductA( msifile, NULL ); + r = MsiInstallProductA( msifile, "DISABLE_FEATURE=1" ); if (r != ERROR_SUCCESS) { skip("Product installation failed with error code %d\n", r); @@ -1290,7 +1301,7 @@ static void test_patch_registration( void ) MsiSetInternalUI( INSTALLUILEVEL_NONE, NULL ); - r = MsiInstallProductA( msifile, NULL ); + r = MsiInstallProductA( msifile, "DISABLE_FEATURE=1" ); if (r != ERROR_SUCCESS) { skip("Product installation failed with error code %d\n", r);
2 years, 7 months
1
0
0
0
[reactos] 297/360: [WINESYNC] msi: Test adding new feature in patch.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=8bb4f0597d07c24fd0b76…
commit 8bb4f0597d07c24fd0b76ef49eb194ceab46fc87 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sun Mar 13 19:08:44 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:28:32 2022 +0100 [WINESYNC] msi: Test adding new feature in patch. Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id cc8bc83e9ecd2aba8e322a974af268e715fbd372 by Piotr Caban <piotr(a)codeweavers.com> --- modules/rostests/winetests/msi/patch.c | 126 ++++++++++++++++++++------------- 1 file changed, 77 insertions(+), 49 deletions(-) diff --git a/modules/rostests/winetests/msi/patch.c b/modules/rostests/winetests/msi/patch.c index 3834bd5fddb..6449b7e67a4 100644 --- a/modules/rostests/winetests/msi/patch.c +++ b/modules/rostests/winetests/msi/patch.c @@ -380,20 +380,20 @@ static const WCHAR p_data3[] = { /* _StringPool */ 32, 1, /* string 7 '913B8D18FBB64CACA239C74C11E3FA74' */ }; static const char p_data4[] = { /* CAB_msitest */ - 0x4d, 0x53, 0x43, 0x46, 0x00, 0x00, 0x00, 0x00, 0x98, 0x00, 0x00, + 0x4d, 0x53, 0x43, 0x46, 0x00, 0x00, 0x00, 0x00, 0x94, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x03, 0x01, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x9e, - 0x03, 0x00, 0x00, 0x46, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x12, + 0x00, 0x00, 0x03, 0x01, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0xea, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x87, - 0x3c, 0xd4, 0x80, 0x20, 0x00, 0x70, 0x61, 0x74, 0x63, 0x68, 0x2e, - 0x74, 0x78, 0x74, 0x00, 0x0b, 0x3c, 0xd6, 0xc1, 0x4a, 0x00, 0xea, - 0x03, 0x5b, 0x80, 0x80, 0x8d, 0x00, 0x10, 0xa1, 0x3e, 0x00, 0x00, - 0x00, 0x00, 0x03, 0x00, 0x40, 0x30, 0x0c, 0x43, 0xf8, 0xb4, 0x85, - 0x4d, 0x96, 0x08, 0x0a, 0x92, 0xf0, 0x52, 0xfb, 0xbb, 0x82, 0xf9, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x0e, 0x31, 0x7d, - 0x56, 0xdf, 0xf7, 0x48, 0x7c, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x41, 0x80, 0xdf, 0xf7, 0xd8, 0x72, 0xbf, 0xb9, 0x63, - 0x91, 0x0e, 0x57, 0x1f, 0xfa, 0x1a, 0x66, 0x54, 0x55 + 0x3c, 0xd4, 0xb8, 0x20, 0x00, 0x70, 0x61, 0x74, 0x63, 0x68, 0x2e, + 0x74, 0x78, 0x74, 0x00, 0xe8, 0x03, 0x00, 0x00, 0xea, 0x03, 0x00, + 0x00, 0x00, 0x00, 0xcb, 0x50, 0x17, 0x7e, 0x20, 0x00, 0x66, 0x69, + 0x6c, 0x65, 0x2e, 0x74, 0x78, 0x74, 0x00, 0xb0, 0xb2, 0xb2, 0x25, + 0x2d, 0x00, 0xd2, 0x07, 0x43, 0x4b, 0xcb, 0x2d, 0xce, 0x2c, 0x49, + 0x2d, 0x2e, 0x89, 0x29, 0x48, 0x2c, 0x49, 0xce, 0x48, 0x4d, 0xd1, + 0x2b, 0xa9, 0x28, 0x51, 0x18, 0x05, 0xa3, 0x60, 0x14, 0x0c, 0x37, + 0x90, 0x8b, 0x9c, 0xd3, 0x41, 0xf9, 0x9c, 0x61, 0x14, 0x8c, 0x82, + 0x51, 0x30, 0xdc, 0x00, 0x00 }; static const WCHAR p_data5[] = { /* MsiPatchSequence */ 0x0007, 0x0000, 0x0006, 0x8000 @@ -526,63 +526,75 @@ static const WCHAR t2_name8[] = { 0x4840, 0x3f3f, 0x4577, 0x446c, 0x3e6a, 0x44b2 static const WCHAR t2_name9[] = { 0x0005, 0x0053, 0x0075, 0x006d, 0x006d, 0x0061, 0x0072, 0x0079, 0x0049, 0x006e, 0x0066, 0x006f, 0x0072, 0x006d, 0x0061, 0x0074, 0x0069, 0x006f, 0x006e, 0 }; /* SummaryInformation */ +static const WCHAR t2_name10[] = { 0x4840, 0x420f, 0x45e4, 0x4578, 0x3b28, 0x4432, 0x44b3, + 0x4231, 0x45f1, 0x4836, 0 }; /* FeatureComponents */ +static const WCHAR t2_name11[] = { 0x4840, 0x448c, 0x44f0, 0x4472, 0x4468, 0x4837, 0 }; /* Component */ +static const WCHAR t2_name12[] = { 0x4840, 0x420f, 0x45e4, 0x4578, 0x4828, 0 }; /* Feature */ static const WCHAR t2_data0[] = { /* File */ - 0x00c0, 0x0001, 0x9000, 0x83e8 + 0x00c0, 0x0001, 0x9000, 0x83e8, 0x0801, 0x0002, 0x0003, 0x0002, + 0x03e8, 0x8000, 0x0000, 0x0000, 0x9000, 0x83e9 }; static const WCHAR t2_data1[] = { /* Media */ - 0x0601, 0x8002, 0x03e9, 0x8000, 0x0000, 0x0007, 0x0000, 0x0008 + 0x0601, 0x8002, 0x03e9, 0x8000, 0x0000, 0x000d, 0x0000, 0x000e }; static const WCHAR t2_data2[] = { /* _Columns */ - 0x0401, 0x0009, 0x0000, 0x000a, 0xad48, 0x0401, 0x0009, 0x0000, /* 0x0401 = add row (1), 4 shorts */ - 0x000b, 0xa502, 0x0401, 0x0009, 0x0000, 0x000c, 0x8104, 0x0401, - 0x0009, 0x0000, 0x000d, 0x8502, 0x0401, 0x0009, 0x0000, 0x000e, - 0x9900, 0x0401, 0x0009, 0x0000, 0x000f, 0x9d48, 0x0401, 0x0010, - 0x0000, 0x0011, 0xad26, 0x0401, 0x0010, 0x0000, 0x0012, 0x8502, - 0x0401, 0x0014, 0x0000, 0x0015, 0xad26, 0x0401, 0x0014, 0x0000, - 0x000e, 0x8900 + 0x0401, 0x000f, 0x0000, 0x0010, 0xad48, 0x0401, 0x000f, 0x0000, /* 0x0401 = add row (1), 4 shorts */ + 0x0011, 0xa502, 0x0401, 0x000f, 0x0000, 0x0012, 0x8104, 0x0401, + 0x000f, 0x0000, 0x0013, 0x8502, 0x0401, 0x000f, 0x0000, 0x0014, + 0x9900, 0x0401, 0x000f, 0x0000, 0x0015, 0x9d48, 0x0401, 0x0016, + 0x0000, 0x0017, 0xad26, 0x0401, 0x0016, 0x0000, 0x0018, 0x8502, + 0x0401, 0x001a, 0x0000, 0x001b, 0xad26, 0x0401, 0x001a, 0x0000, + 0x0014, 0x8900 }; static const WCHAR t2_data3[] = { /* _Tables */ - 0x0101, 0x0009, 0x0101, 0x0010, 0x0101, 0x0014 + 0x0101, 0x000f, 0x0101, 0x0016, 0x0101, 0x001a }; static const WCHAR t2_data4[] = { /* Property */ - 0x0201, 0x0002, 0x0003, 0x0201, 0x0004, 0x0005 + 0x0002, 0x0008, 0x0009, 0x0201, 0x000a, 0x000b }; static const WCHAR t2_data5[] = { /* PatchPackage */ - 0x0201, 0x0013, 0x8002 + 0x0201, 0x0019, 0x8002 }; static const WCHAR t2_data6[] = { /* InstallExecuteSequence */ - 0x0301, 0x0006, 0x0000, 0x87d1 + 0x0301, 0x000c, 0x0000, 0x87d1 }; static const char t2_data7[] = { /* _StringData */ - "patch.txtPATCHNEWSUMMARYSUBJECTInstallation DatabasePATCHNEWPACKAGECODE{42A14A82-12F8-4E6D-970E-1B4EE7BE28B0}" - "PatchFiles#CAB_msitestpropPatchFile_SequencePatchSizeAttributesHeaderStreamRef_PatchPackagePatchIdMedia_" + "patch.txtfile.txtfile{327d9640-674f-4b9f-8b8a-547a0f6f8518}MSITESTDIRnewnew featurePATCHNEWSUMMARYSUBJECT" + "Installation DatabasePATCHNEWPACKAGECODE{42A14A82-12F8-4E6D-970E-1B4EE7BE28B0}PatchFiles#CAB_msitestprop" + "PatchFile_SequencePatchSizeAttributesHeaderStreamRef_PatchPackagePatchIdMedia_" "{0F96CDC0-4CDF-4304-B283-7B9264889EF7}MsiPatchHeadersStreamRef" }; static const WCHAR t2_data8[] = { /* _StringPool */ /* len, refs */ 0, 0, /* string 0 '' */ 9, 1, /* string 1 'patch.txt' */ - 22, 1, /* string 2 'PATCHNEWSUMMARYSUBJECT' */ - 21, 1, /* string 3 'Installation Database' */ - 19, 1, /* string 4 'PATCHNEWPACKAGECODE' */ - 38, 1, /* string 5 '{42A14A82-12F8-4E6D-970E-1B4EE7BE28B0}' */ - 10, 1, /* string 6 'PatchFiles' */ - 12, 1, /* string 7 '#CAB_msitest' */ - 4, 1, /* string 8 'prop' */ - 5, 7, /* string 9 'Patch' */ - 5, 1, /* string 10 'File_' */ - 8, 1, /* string 11 'Sequence' */ - 9, 1, /* string 12 'PatchSize' */ - 10, 1, /* string 13 'Attributes' */ - 6, 2, /* string 14 'Header' */ - 10, 1, /* string 15 'StreamRef_' */ - 12, 3, /* string 16 'PatchPackage' */ - 7, 1, /* string 17 'PatchId' */ - 6, 1, /* string 18 'Media_' */ - 38, 1, /* string 19 '{0F96CDC0-4CDF-4304-B283-7B9264889EF7}' */ - 15, 3, /* string 20 'MsiPatchHeaders' */ - 9, 1 /* string 21 'StreamRef' */ + 8, 3, /* string 2 'file.txt' */ + 4, 3, /* string 3 'file' */ + 38, 1, /* string 4 '{327d9640-674f-4b9f-8b8a-547a0f6f8518}' */ + 10, 2, /* string 5 'MSITESTDIR' */ + 3, 2, /* string 6 'new' */ + 11, 1, /* string 7 'new feature' */ + 22, 1, /* string 8 'PATCHNEWSUMMARYSUBJECT' */ + 21, 1, /* string 9 'Installation Database' */ + 19, 1, /* string 10 'PATCHNEWPACKAGECODE' */ + 38, 1, /* string 11 '{42A14A82-12F8-4E6D-970E-1B4EE7BE28B0}' */ + 10, 1, /* string 12 'PatchFiles' */ + 12, 1, /* string 13 '#CAB_msitest' */ + 4, 1, /* string 14 'prop' */ + 5, 7, /* string 15 'Patch' */ + 5, 1, /* string 16 'File_' */ + 8, 1, /* string 17 'Sequence' */ + 9, 1, /* string 18 'PatchSize' */ + 10, 1, /* string 19 'Attributes' */ + 6, 2, /* string 20 'Header' */ + 10, 1, /* string 21 'StreamRef_' */ + 12, 3, /* string 22 'PatchPackage' */ + 7, 1, /* string 23 'PatchId' */ + 6, 1, /* string 24 'Media_' */ + 38, 1, /* string 25 '{0F96CDC0-4CDF-4304-B283-7B9264889EF7}' */ + 15, 3, /* string 26 'MsiPatchHeaders' */ + 9, 1 /* string 27 'StreamRef' */ }; static const char t2_data9[] = { /* SummaryInformation */ 0xfe, 0xff, 0x00, 0x00, 0x05, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, @@ -622,6 +634,16 @@ static const char t2_data9[] = { /* SummaryInformation */ 0x46, 0x34, 0x33, 0x7d, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2d, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x17, 0x00, 0x27, 0x09 }; +static const WCHAR t2_data10[] = { /* FeatureComponents */ + 0x0201, 0x0006, 0x0003 +}; +static const WCHAR t2_data11[] = { /* Component */ + 0x0601, 0x0003, 0x0004, 0x0005, 0x8000, 0x0000, 0x0002 +}; +static const WCHAR t2_data12[] = { /* Feature */ + 0x0801, 0x0006, 0x0000, 0x0000, 0x0007, 0x8001, 0x8001, 0x0005, + 0x8000 +}; static const struct table_data table_transform2_data[] = { { t2_name0, t2_data0, sizeof t2_data0 }, @@ -633,7 +655,10 @@ static const struct table_data table_transform2_data[] = { { t2_name6, t2_data6, sizeof t2_data6 }, { t2_name7, t2_data7, sizeof t2_data7 - 1 }, { t2_name8, t2_data8, sizeof t2_data8 }, - { t2_name9, t2_data9, sizeof t2_data9 } + { t2_name9, t2_data9, sizeof t2_data9 }, + { t2_name10, t2_data10, sizeof t2_data10 }, + { t2_name11, t2_data11, sizeof t2_data11 }, + { t2_name12, t2_data12, sizeof t2_data12 }, }; static void write_tables( IStorage *stg, const struct table_data *tables, UINT num_tables ) @@ -807,6 +832,8 @@ static void test_simple_patch( void ) size = get_pf_file_size( "msitest\\patch.txt" ); ok( size == 1002, "expected 1002, got %u\n", size ); + size = get_pf_file_size( "msitest\\file.txt" ); + todo_wine ok( size == 1000, "expected 1000, got %u\n", size ); /* show that MsiOpenPackage applies registered patches */ r = MsiOpenPackageA( path, &hpackage ); @@ -888,6 +915,7 @@ uninstall: ok( r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r ); ok( !delete_pf( "msitest\\patch.txt", TRUE ), "file not removed\n" ); + ok( !delete_pf( "msitest\\file.txt", TRUE ), "file not removed\n" ); ok( !delete_pf( "msitest", FALSE ), "directory not removed\n" ); cleanup: @@ -1210,7 +1238,7 @@ static void test_system_tables( void ) todo_wine ok( r == 100, "Got %u\n", r ); r = get_integer( hdb, 2, "SELECT * FROM `Media` WHERE `Source` IS NOT NULL"); - todo_wine ok( r == 10000, "Got %u\n", r ); + todo_wine ok( r == 10001, "Got %u\n", r ); r = get_integer( hdb, 1, "SELECT * FROM `Media` WHERE `VolumeLabel`=\'DISK1\'"); ok( r == 1, "Got %u\n", r );
2 years, 7 months
1
0
0
0
[reactos] 296/360: [WINESYNC] msi: Add support for appending data to _TransformView table.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=1c5160dca5b0f6a467338…
commit 1c5160dca5b0f6a467338d16e2c88ff28e5e5268 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sun Mar 13 19:08:44 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:28:32 2022 +0100 [WINESYNC] msi: Add support for appending data to _TransformView table. Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id 3459c90cd6a49e817213b6e6764bdfafa7d4bcc7 by Piotr Caban <piotr(a)codeweavers.com> --- dll/win32/msi/table.c | 48 ++++++++++++++++++++++++++++-------------------- 1 file changed, 28 insertions(+), 20 deletions(-) diff --git a/dll/win32/msi/table.c b/dll/win32/msi/table.c index 27f3763d34e..612a3695973 100644 --- a/dll/win32/msi/table.c +++ b/dll/win32/msi/table.c @@ -2336,7 +2336,7 @@ static UINT TransformView_fetch_stream( MSIVIEW *view, UINT row, UINT col, IStre static UINT TransformView_set_row( MSIVIEW *view, UINT row, MSIRECORD *rec, UINT mask ) { static const WCHAR query_pfx[] = - L"INSERT INTO `_TransformView` (`Table`, `Column`, `Row`, `Data`, `Current`) VALUES ('"; + L"INSERT INTO `_TransformView` (`new`, `Table`, `Column`, `Row`, `Data`, `Current`) VALUES (1, '"; MSITABLEVIEW *tv = (MSITABLEVIEW*)view; WCHAR buf[256], *query; @@ -2372,7 +2372,7 @@ static UINT TransformView_set_row( MSIVIEW *view, UINT row, MSIRECORD *rec, UINT if (tv->columns[i].type & MSITYPE_KEY) continue; - qlen = p = wcslen( query_pfx ); + qlen = p = ARRAY_SIZE( query_pfx ) - 1; qlen += wcslen( tv->name ) + 3; /* strlen("','") */ qlen += wcslen( tv->columns[i].colname ) + 3; qlen += wcslen( key ) + 3; @@ -2481,7 +2481,7 @@ static UINT TransformView_set_row( MSIVIEW *view, UINT row, MSIRECORD *rec, UINT static UINT TransformView_create_table( MSITABLEVIEW *tv, MSIRECORD *rec ) { static const WCHAR query_fmt[] = - L"INSERT INTO `_TransformView` (`Table`, `Column`) VALUES ('%s', 'CREATE')"; + L"INSERT INTO `_TransformView` (`Table`, `Column`, `new`) VALUES ('%s', 'CREATE', 1)"; WCHAR buf[256], *query = buf; const WCHAR *name; @@ -2516,7 +2516,7 @@ static UINT TransformView_create_table( MSITABLEVIEW *tv, MSIRECORD *rec ) static UINT TransformView_add_column( MSITABLEVIEW *tv, MSIRECORD *rec ) { static const WCHAR query_pfx[] = - L"INSERT INTO `_TransformView` (`Table`, `Current`, `Column`, `Data`) VALUES ('"; + L"INSERT INTO `_TransformView` (`new`, `Table`, `Current`, `Column`, `Data`) VALUES (1, '"; WCHAR buf[256], *query = buf; UINT i, p, len, r, qlen; @@ -2569,7 +2569,7 @@ static UINT TransformView_add_column( MSITABLEVIEW *tv, MSIRECORD *rec ) static UINT TransformView_insert_row( MSIVIEW *view, MSIRECORD *rec, UINT row, BOOL temporary ) { static const WCHAR query_fmt[] = - L"INSERT INTO `_TransformView` (`Table`, `Column`, `Row`) VALUES ('%s', 'INSERT', '%s')"; + L"INSERT INTO `_TransformView` (`new`, `Table`, `Column`, `Row`) VALUES (1, '%s', 'INSERT', '%s')"; MSITABLEVIEW *tv = (MSITABLEVIEW*)view; WCHAR buf[256], *query = buf; @@ -2617,7 +2617,7 @@ static UINT TransformView_insert_row( MSIVIEW *view, MSIRECORD *rec, UINT row, B static UINT TransformView_drop_table( MSITABLEVIEW *tv, UINT row ) { - static const WCHAR query_pfx[] = L"INSERT INTO `_TransformView` ( `Table`, `Column` ) VALUES ( '"; + static const WCHAR query_pfx[] = L"INSERT INTO `_TransformView` ( `new`, `Table`, `Column` ) VALUES ( 1, '"; static const WCHAR query_sfx[] = L"', 'DROP' )"; WCHAR buf[256], *query = buf; @@ -2661,7 +2661,7 @@ static UINT TransformView_drop_table( MSITABLEVIEW *tv, UINT row ) static UINT TransformView_delete_row( MSIVIEW *view, UINT row ) { - static const WCHAR query_pfx[] = L"INSERT INTO `_TransformView` ( `Table`, `Column`, `Row`) VALUES ( '"; + static const WCHAR query_pfx[] = L"INSERT INTO `_TransformView` ( `new`, `Table`, `Column`, `Row`) VALUES ( 1, '"; static const WCHAR query_column[] = L"', 'DELETE', '"; static const WCHAR query_sfx[] = L"')"; @@ -2780,7 +2780,7 @@ static const MSIVIEWOPS transform_view_ops = UINT TransformView_Create( MSIDATABASE *db, string_table *st, LPCWSTR name, MSIVIEW **view ) { static const WCHAR query_pfx[] = L"SELECT `Column`, `Data`, `Current` FROM `_TransformView` WHERE `Table`='"; - static const WCHAR query_sfx[] = L"' AND `Row` IS NULL AND `Current` IS NOT NULL"; + static const WCHAR query_sfx[] = L"' AND `Row` IS NULL AND `Current` IS NOT NULL AND `new` = 1"; WCHAR buf[256], *query = buf; UINT r, len, name_len, size, add_col; @@ -3392,7 +3392,7 @@ UINT msi_table_apply_transform( MSIDATABASE *db, IStorage *stg, int err_cond ) UINT ret = ERROR_FUNCTION_FAILED; UINT bytes_per_strref; BOOL property_update = FALSE; - BOOL free_transform_view = FALSE; + MSIVIEW *transform_view = NULL; TRACE("%p %p\n", db, stg ); @@ -3472,11 +3472,19 @@ UINT msi_table_apply_transform( MSIDATABASE *db, IStorage *stg, int err_cond ) if (r == ERROR_SUCCESS) MSI_ViewClose( query ); msiobj_release( &query->hdr ); + if (r != ERROR_BAD_QUERY_SYNTAX && r != ERROR_SUCCESS) + goto end; + + if (TABLE_CreateView(db, L"_TransformView", &transform_view) != ERROR_SUCCESS) + goto end; + if (r == ERROR_BAD_QUERY_SYNTAX) - FIXME( "support adding to _TransformView\n" ); + transform_view->ops->add_ref( transform_view ); + + r = transform_view->ops->add_column( transform_view, L"new", + MSITYPE_TEMPORARY | MSITYPE_NULLABLE | 0x402 /* INT */, FALSE ); if (r != ERROR_SUCCESS) goto end; - free_transform_view = TRUE; } /* @@ -3520,16 +3528,16 @@ end: IEnumSTATSTG_Release( stgenum ); if ( strings ) msi_destroy_stringtable( strings ); - if (ret != ERROR_SUCCESS && free_transform_view) + if (transform_view) { - MSIQUERY *query; - if (MSI_DatabaseOpenViewW( db, L"ALTER TABLE `_TransformView` FREE", - &query ) == ERROR_SUCCESS) - { - if (MSI_ViewExecute( query, NULL ) == ERROR_SUCCESS) - MSI_ViewClose( query ); - msiobj_release( &query->hdr ); - } + struct tagMSITABLE *table = ((MSITABLEVIEW*)transform_view)->table; + + if (ret != ERROR_SUCCESS) + transform_view->ops->release( transform_view ); + + if (!wcscmp(table->colinfo[table->col_count - 1].colname, L"new")) + TABLE_remove_column( transform_view, table->colinfo[table->col_count - 1].number ); + transform_view->ops->delete( transform_view ); } return ret;
2 years, 7 months
1
0
0
0
[reactos] 295/360: [WINESYNC] msi: Remove no longer needed parameter from TABLE_remove_column.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=ed0e61b53a6c3e5d87fc0…
commit ed0e61b53a6c3e5d87fc0feae58fed685696ffb9 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sun Mar 13 19:08:44 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:28:32 2022 +0100 [WINESYNC] msi: Remove no longer needed parameter from TABLE_remove_column. Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id d579b17eb425ac5e28f9263ebf302ea2282996ec by Piotr Caban <piotr(a)codeweavers.com> --- dll/win32/msi/table.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/dll/win32/msi/table.c b/dll/win32/msi/table.c index 3febcb3aa94..27f3763d34e 100644 --- a/dll/win32/msi/table.c +++ b/dll/win32/msi/table.c @@ -1949,7 +1949,7 @@ static UINT TABLE_add_ref(struct tagMSIVIEW *view) return InterlockedIncrement(&tv->table->ref_count); } -static UINT TABLE_remove_column(struct tagMSIVIEW *view, LPCWSTR table, UINT number) +static UINT TABLE_remove_column(struct tagMSIVIEW *view, UINT number) { MSITABLEVIEW *tv = (MSITABLEVIEW*)view; MSIRECORD *rec = NULL; @@ -1974,7 +1974,7 @@ static UINT TABLE_remove_column(struct tagMSIVIEW *view, LPCWSTR table, UINT num if (!rec) return ERROR_OUTOFMEMORY; - MSI_RecordSetStringW(rec, 1, table); + MSI_RecordSetStringW(rec, 1, tv->name); MSI_RecordSetInteger(rec, 2, number); r = TABLE_CreateView(tv->db, szColumns, &columns); @@ -1992,7 +1992,7 @@ static UINT TABLE_remove_column(struct tagMSIVIEW *view, LPCWSTR table, UINT num if (r != ERROR_SUCCESS) goto done; - msi_update_table_columns(tv->db, table); + msi_update_table_columns(tv->db, tv->name); done: msiobj_release(&rec->hdr); @@ -2016,8 +2016,7 @@ static UINT TABLE_release(struct tagMSIVIEW *view) { if (tv->table->colinfo[i].type & MSITYPE_TEMPORARY) { - r = TABLE_remove_column(view, tv->table->colinfo[i].tablename, - tv->table->colinfo[i].number); + r = TABLE_remove_column(view, tv->table->colinfo[i].number); if (r != ERROR_SUCCESS) break; } @@ -2145,8 +2144,7 @@ static UINT TABLE_drop(struct tagMSIVIEW *view) for (i = tv->table->col_count - 1; i >= 0; i--) { - r = TABLE_remove_column(view, tv->table->colinfo[i].tablename, - tv->table->colinfo[i].number); + r = TABLE_remove_column(view, tv->table->colinfo[i].number); if (r != ERROR_SUCCESS) return r; }
2 years, 7 months
1
0
0
0
[reactos] 294/360: [WINESYNC] msi: Fix use after free error in TransformView_set_row.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=c6c4bdb242b712cf28020…
commit c6c4bdb242b712cf280201ed167b853673f9b2cc Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sun Mar 13 19:08:44 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:28:32 2022 +0100 [WINESYNC] msi: Fix use after free error in TransformView_set_row. Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id 6a0a0d2a0b15bffa9d4a5b41e75be6765e731d69 by Piotr Caban <piotr(a)codeweavers.com> --- dll/win32/msi/table.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dll/win32/msi/table.c b/dll/win32/msi/table.c index d4912ab3ae3..3febcb3aa94 100644 --- a/dll/win32/msi/table.c +++ b/dll/win32/msi/table.c @@ -2341,7 +2341,7 @@ static UINT TransformView_set_row( MSIVIEW *view, UINT row, MSIRECORD *rec, UINT L"INSERT INTO `_TransformView` (`Table`, `Column`, `Row`, `Data`, `Current`) VALUES ('"; MSITABLEVIEW *tv = (MSITABLEVIEW*)view; - WCHAR buf[256], *query = buf; + WCHAR buf[256], *query; MSIRECORD *old_rec; MSIQUERY *q; WCHAR *key; @@ -2409,6 +2409,10 @@ static UINT TransformView_set_row( MSIVIEW *view, UINT row, MSIRECORD *rec, UINT return ERROR_OUTOFMEMORY; } } + else + { + query = buf; + } memcpy( query, query_pfx, p * sizeof(WCHAR) ); len = wcslen( tv->name );
2 years, 7 months
1
0
0
0
[reactos] 293/360: [WINESYNC] msi: Remove MSICOLUMNINFO.temporary field.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=61167e123f6651266ce58…
commit 61167e123f6651266ce58b9ae22f279afc312576 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sun Mar 13 19:08:43 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:28:31 2022 +0100 [WINESYNC] msi: Remove MSICOLUMNINFO.temporary field. Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id b61455cb81714ff4f4108b70584816adbffbc68a by Piotr Caban <piotr(a)codeweavers.com> --- dll/win32/msi/table.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/dll/win32/msi/table.c b/dll/win32/msi/table.c index 3326958d941..d4912ab3ae3 100644 --- a/dll/win32/msi/table.c +++ b/dll/win32/msi/table.c @@ -54,7 +54,6 @@ typedef struct tagMSICOLUMNINFO LPCWSTR colname; UINT type; UINT offset; - BOOL temporary; MSICOLUMNHASHENTRY **hash_table; } MSICOLUMNINFO; @@ -79,14 +78,14 @@ static const WCHAR szNumber[] = {'N','u','m','b','e','r',0}; static const WCHAR szType[] = {'T','y','p','e',0}; static const MSICOLUMNINFO _Columns_cols[4] = { - { szColumns, 1, szTable, MSITYPE_VALID | MSITYPE_STRING | MSITYPE_KEY | 64, 0, 0, NULL }, - { szColumns, 2, szNumber, MSITYPE_VALID | MSITYPE_KEY | 2, 2, 0, NULL }, - { szColumns, 3, szName, MSITYPE_VALID | MSITYPE_STRING | 64, 4, 0, NULL }, - { szColumns, 4, szType, MSITYPE_VALID | 2, 6, 0, NULL }, + { szColumns, 1, szTable, MSITYPE_VALID | MSITYPE_STRING | MSITYPE_KEY | 64, 0, NULL }, + { szColumns, 2, szNumber, MSITYPE_VALID | MSITYPE_KEY | 2, 2, NULL }, + { szColumns, 3, szName, MSITYPE_VALID | MSITYPE_STRING | 64, 4, NULL }, + { szColumns, 4, szType, MSITYPE_VALID | 2, 6, NULL }, }; static const MSICOLUMNINFO _Tables_cols[1] = { - { szTables, 1, szName, MSITYPE_VALID | MSITYPE_STRING | MSITYPE_KEY | 64, 0, 0, NULL }, + { szTables, 1, szName, MSITYPE_VALID | MSITYPE_STRING | MSITYPE_KEY | 64, 0, NULL }, }; #define MAX_STREAM_NAME 0x1f @@ -764,7 +763,6 @@ UINT msi_create_table( MSIDATABASE *db, LPCWSTR name, column_info *col_info, table->colinfo[ i ].type = col->type; table->colinfo[ i ].offset = 0; table->colinfo[ i ].hash_table = NULL; - table->colinfo[ i ].temporary = (col->type & MSITYPE_TEMPORARY) != 0; } table_calc_column_offsets( db, table->colinfo, table->col_count); @@ -1613,7 +1611,7 @@ static UINT TABLE_get_column_info( struct tagMSIVIEW *view, *type = tv->columns[n-1].type; if( temporary ) - *temporary = tv->columns[n-1].temporary; + *temporary = (tv->columns[n-1].type & MSITYPE_TEMPORARY) != 0; return ERROR_SUCCESS; } @@ -1961,7 +1959,7 @@ static UINT TABLE_remove_column(struct tagMSIVIEW *view, LPCWSTR table, UINT num if (tv->table->col_count != number) return ERROR_BAD_QUERY_SYNTAX; - if (tv->table->colinfo[number-1].temporary) + if (tv->table->colinfo[number-1].type & MSITYPE_TEMPORARY) { UINT size = tv->table->colinfo[number-1].offset; tv->table->col_count--; @@ -2052,7 +2050,7 @@ static UINT TABLE_add_column(struct tagMSIVIEW *view, LPCWSTR column, return ERROR_SUCCESS; if (!temporary && tv->table->col_count && - tv->table->colinfo[tv->table->col_count-1].temporary) + tv->table->colinfo[tv->table->col_count-1].type & MSITYPE_TEMPORARY) return ERROR_BAD_QUERY_SYNTAX; for (i = 0; i < tv->table->col_count; i++) @@ -2077,7 +2075,6 @@ static UINT TABLE_add_column(struct tagMSIVIEW *view, LPCWSTR column, colinfo[tv->table->col_count].type = type; colinfo[tv->table->col_count].offset = 0; colinfo[tv->table->col_count].hash_table = NULL; - colinfo[tv->table->col_count].temporary = temporary; tv->table->col_count++; table_calc_column_offsets( tv->db, tv->table->colinfo, tv->table->col_count);
2 years, 7 months
1
0
0
0
[reactos] 292/360: [WINESYNC] msi: Remove column_info.temporary field.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=791734c2e922bccf2a900…
commit 791734c2e922bccf2a9006c3adfbdbe467286123 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sun Mar 13 19:08:43 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:28:31 2022 +0100 [WINESYNC] msi: Remove column_info.temporary field. Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id 76a2077c83048d8eead8ea0cbfafa70406c0cd88 by Piotr Caban <piotr(a)codeweavers.com> --- dll/win32/msi/alter.c | 2 +- dll/win32/msi/create.c | 2 +- dll/win32/msi/msipriv.h | 3 +-- dll/win32/msi/sql.y | 1 - dll/win32/msi/table.c | 5 +++-- 5 files changed, 6 insertions(+), 7 deletions(-) diff --git a/dll/win32/msi/alter.c b/dll/win32/msi/alter.c index 78f1a3930c7..7d272118537 100644 --- a/dll/win32/msi/alter.c +++ b/dll/win32/msi/alter.c @@ -70,7 +70,7 @@ static UINT ALTER_execute( struct tagMSIVIEW *view, MSIRECORD *record ) if (av->colinfo) return av->table->ops->add_column(av->table, av->colinfo->column, - av->colinfo->type, av->colinfo->temporary, av->hold == 1); + av->colinfo->type, av->hold == 1); if (av->hold == 1) av->table->ops->add_ref(av->table); diff --git a/dll/win32/msi/create.c b/dll/win32/msi/create.c index 94c62ec5733..3d6c5189f2b 100644 --- a/dll/win32/msi/create.c +++ b/dll/win32/msi/create.c @@ -181,7 +181,7 @@ UINT CREATE_CreateView( MSIDATABASE *db, MSIVIEW **view, LPCWSTR table, if (!col->table) col->table = table; - if( !col->temporary ) + if( !(col->type & MSITYPE_TEMPORARY) ) temp = FALSE; else if ( col->type & MSITYPE_KEY ) tempprim = TRUE; diff --git a/dll/win32/msi/msipriv.h b/dll/win32/msi/msipriv.h index 97126e39693..20cf8e8b87c 100644 --- a/dll/win32/msi/msipriv.h +++ b/dll/win32/msi/msipriv.h @@ -222,7 +222,6 @@ typedef struct _column_info LPCWSTR table; LPCWSTR column; INT type; - BOOL temporary; struct expr *val; struct _column_info *next; } column_info; @@ -337,7 +336,7 @@ typedef struct tagMSIVIEWOPS /* * add_column - adds a column to the table */ - UINT (*add_column)( struct tagMSIVIEW *view, LPCWSTR column, INT type, BOOL temporary, BOOL hold ); + UINT (*add_column)( struct tagMSIVIEW *view, LPCWSTR column, INT type, BOOL hold ); /* * sort - orders the table by columns diff --git a/dll/win32/msi/sql.y b/dll/win32/msi/sql.y index 8ffbcd4de58..7bdace72981 100644 --- a/dll/win32/msi/sql.y +++ b/dll/win32/msi/sql.y @@ -318,7 +318,6 @@ column_and_type: { $$ = $1; $$->type = ($2 | MSITYPE_VALID); - $$->temporary = $2 & MSITYPE_TEMPORARY ? TRUE : FALSE; } ; diff --git a/dll/win32/msi/table.c b/dll/win32/msi/table.c index 5a1466592f1..3326958d941 100644 --- a/dll/win32/msi/table.c +++ b/dll/win32/msi/table.c @@ -764,7 +764,7 @@ UINT msi_create_table( MSIDATABASE *db, LPCWSTR name, column_info *col_info, table->colinfo[ i ].type = col->type; table->colinfo[ i ].offset = 0; table->colinfo[ i ].hash_table = NULL; - table->colinfo[ i ].temporary = col->temporary; + table->colinfo[ i ].temporary = (col->type & MSITYPE_TEMPORARY) != 0; } table_calc_column_offsets( db, table->colinfo, table->col_count); @@ -2041,9 +2041,10 @@ static UINT TABLE_release(struct tagMSIVIEW *view) } static UINT TABLE_add_column(struct tagMSIVIEW *view, LPCWSTR column, - INT type, BOOL temporary, BOOL hold) + INT type, BOOL hold) { UINT i, r, table_id, col_id, size, offset; + BOOL temporary = type & MSITYPE_TEMPORARY; MSITABLEVIEW *tv = (MSITABLEVIEW*)view; MSICOLUMNINFO *colinfo;
2 years, 7 months
1
0
0
0
← Newer
1
...
8
9
10
11
12
13
14
...
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