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
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 -----
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] 131/360: [WINESYNC] msi: Protect communication with the custom action server with a critical section.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=b1b2cc1e8d83431bb5acc…
commit b1b2cc1e8d83431bb5acce3f341b6748acb1da34 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sat Mar 12 23:54:31 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:27:59 2022 +0100 [WINESYNC] msi: Protect communication with the custom action server with a critical section. Avoids a potential race whereby an asynchronous custom action receives the wrong thread handle. 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 583edf7f59866cf0a58c978e692f3077e74b4938 by Zebediah Figura <z.figura12(a)gmail.com> --- dll/win32/msi/custom.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dll/win32/msi/custom.c b/dll/win32/msi/custom.c index 3d426190f00..9cf3ba1081c 100644 --- a/dll/win32/msi/custom.c +++ b/dll/win32/msi/custom.c @@ -698,6 +698,8 @@ static DWORD WINAPI custom_client_thread(void *arg) pipe = info->package->custom_server_64_pipe; } + EnterCriticalSection(&msi_custom_action_cs); + if (!WriteFile(pipe, &info->guid, sizeof(info->guid), &size, NULL) || size != sizeof(info->guid)) { @@ -710,6 +712,8 @@ static DWORD WINAPI custom_client_thread(void *arg) return GetLastError(); } + LeaveCriticalSection(&msi_custom_action_cs); + if (DuplicateHandle(process, (HANDLE)(DWORD_PTR)thread64, GetCurrentProcess(), &thread, 0, FALSE, DUPLICATE_SAME_ACCESS | DUPLICATE_CLOSE_SOURCE)) {
2 years, 6 months
1
0
0
0
[reactos] 130/360: [WINESYNC] msi: Don't start the custom action server inside of custom_client_thread().
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=eca4d999d6a25e72ddabc…
commit eca4d999d6a25e72ddabc0844c69c250d39ed884 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sat Mar 12 23:50:40 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:27:58 2022 +0100 [WINESYNC] msi: Don't start the custom action server inside of custom_client_thread(). Asynchronous custom actions don't wait for custom_client_thread() to terminate, so it's possible for two consecutive actions to both try to start the server at once, causing failures when the second action e.g. receives ERROR_PIPE_BUSY from CreateNamedPipe(). 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 3a884c2ef7a5828a5b42bf9d2532422afeac0fd8 by Zebediah Figura <z.figura12(a)gmail.com> --- dll/win32/msi/custom.c | 61 +++++++++++++++++++++++++------------------------- 1 file changed, 31 insertions(+), 30 deletions(-) diff --git a/dll/win32/msi/custom.c b/dll/win32/msi/custom.c index e7ee80c689d..3d426190f00 100644 --- a/dll/win32/msi/custom.c +++ b/dll/win32/msi/custom.c @@ -389,6 +389,7 @@ typedef struct _msi_custom_action_info { LPWSTR action; INT type; GUID guid; + DWORD arch; } msi_custom_action_info; static void release_custom_action_data( msi_custom_action_info *info ) @@ -677,45 +678,16 @@ void custom_stop_server(HANDLE process, HANDLE pipe) static DWORD WINAPI custom_client_thread(void *arg) { msi_custom_action_info *info = arg; - RPC_STATUS status; DWORD64 thread64; HANDLE process; HANDLE thread; HANDLE pipe; - DWORD arch; DWORD size; - BOOL ret; UINT rc; CoInitializeEx(NULL, COINIT_MULTITHREADED); /* needed to marshal streams */ - if (!info->package->rpc_server_started) - { - status = RpcServerUseProtseqEpW(ncalrpcW, RPC_C_PROTSEQ_MAX_REQS_DEFAULT, - endpoint_lrpcW, NULL); - if (status != RPC_S_OK) - { - ERR("RpcServerUseProtseqEp failed: %#x\n", status); - return status; - } - - status = RpcServerRegisterIfEx((RPC_IF_HANDLE)s_IWineMsiRemote_v0_0_s_ifspec, NULL, NULL, - RPC_IF_AUTOLISTEN, RPC_C_LISTEN_MAX_CALLS_DEFAULT, NULL); - if (status != RPC_S_OK) - { - ERR("RpcServerRegisterIfEx failed: %#x\n", status); - return status; - } - - info->package->rpc_server_started = 1; - } - - ret = GetBinaryTypeW(info->source, &arch); - if (!ret) - arch = (sizeof(void *) == 8 ? SCS_64BIT_BINARY : SCS_32BIT_BINARY); - - custom_start_server(info->package, arch); - if (arch == SCS_32BIT_BINARY) + if (info->arch == SCS_32BIT_BINARY) { process = info->package->custom_server_32_process; pipe = info->package->custom_server_32_pipe; @@ -756,6 +728,8 @@ static msi_custom_action_info *do_msidbCustomActionTypeDll( MSIPACKAGE *package, INT type, LPCWSTR source, LPCWSTR target, LPCWSTR action ) { msi_custom_action_info *info; + RPC_STATUS status; + BOOL ret; info = msi_alloc( sizeof *info ); if (!info) @@ -774,6 +748,33 @@ static msi_custom_action_info *do_msidbCustomActionTypeDll( list_add_tail( &msi_pending_custom_actions, &info->entry ); LeaveCriticalSection( &msi_custom_action_cs ); + if (!package->rpc_server_started) + { + status = RpcServerUseProtseqEpW(ncalrpcW, RPC_C_PROTSEQ_MAX_REQS_DEFAULT, + endpoint_lrpcW, NULL); + if (status != RPC_S_OK) + { + ERR("RpcServerUseProtseqEp failed: %#x\n", status); + return NULL; + } + + status = RpcServerRegisterIfEx(s_IWineMsiRemote_v0_0_s_ifspec, NULL, NULL, + RPC_IF_AUTOLISTEN, RPC_C_LISTEN_MAX_CALLS_DEFAULT, NULL); + if (status != RPC_S_OK) + { + ERR("RpcServerRegisterIfEx failed: %#x\n", status); + return NULL; + } + + info->package->rpc_server_started = 1; + } + + ret = GetBinaryTypeW(source, &info->arch); + if (!ret) + info->arch = (sizeof(void *) == 8 ? SCS_64BIT_BINARY : SCS_32BIT_BINARY); + + custom_start_server(package, info->arch); + info->handle = CreateThread(NULL, 0, custom_client_thread, info, 0, NULL); if (!info->handle) {
2 years, 6 months
1
0
0
0
[reactos] 129/360: [WINESYNC] msi: Avoid an ARRAY_SIZE-like macro.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=55b4e50af85d76917f741…
commit 55b4e50af85d76917f741229f1be48ade6176b75 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sat Mar 12 23:50:39 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:27:58 2022 +0100 [WINESYNC] msi: Avoid an ARRAY_SIZE-like macro. 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 b8027768b88eed2376ea484aa7adef20c82483f4 by Michael Stefaniuc <mstefani(a)winehq.org> --- dll/win32/msi/dialog.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/dll/win32/msi/dialog.c b/dll/win32/msi/dialog.c index 3f2ddc36d6f..f0222de0a66 100644 --- a/dll/win32/msi/dialog.c +++ b/dll/win32/msi/dialog.c @@ -3479,8 +3479,6 @@ static const struct control_handler msi_dialog_handler[] = { szHyperLink, msi_dialog_hyperlink } }; -#define NUM_CONTROL_TYPES (sizeof msi_dialog_handler/sizeof msi_dialog_handler[0]) - static UINT msi_dialog_create_controls( MSIRECORD *rec, LPVOID param ) { msi_dialog *dialog = param; @@ -3489,10 +3487,10 @@ static UINT msi_dialog_create_controls( MSIRECORD *rec, LPVOID param ) /* find and call the function that can create this type of control */ control_type = MSI_RecordGetString( rec, 3 ); - for( i=0; i<NUM_CONTROL_TYPES; i++ ) + for( i = 0; i < ARRAY_SIZE( msi_dialog_handler ); i++ ) if (!strcmpiW( msi_dialog_handler[i].control_type, control_type )) break; - if( i != NUM_CONTROL_TYPES ) + if( i != ARRAY_SIZE( msi_dialog_handler )) msi_dialog_handler[i].func( dialog, rec ); else ERR("no handler for element type %s\n", debugstr_w(control_type));
2 years, 6 months
1
0
0
0
[reactos] 128/360: [WINESYNC] msi: Generate unique names for 32- and 64-bit custom action server pipes.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=ac9d876fe9179c73ba345…
commit ac9d876fe9179c73ba345605b084693103e88cee Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sat Mar 12 23:50:38 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:27:58 2022 +0100 [WINESYNC] msi: Generate unique names for 32- and 64-bit custom action server pipes. Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id 6925846988fb78a2dd217d2b837e59ec53234f87 by Zebediah Figura <zfigura(a)codeweavers.com> --- base/system/msiexec/msiexec.c | 4 ++-- dll/win32/msi/custom.c | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/base/system/msiexec/msiexec.c b/base/system/msiexec/msiexec.c index 47cef7e0fa2..ead3bfb9dea 100644 --- a/base/system/msiexec/msiexec.c +++ b/base/system/msiexec/msiexec.c @@ -406,7 +406,7 @@ 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',0}; + static const WCHAR pipe_name[] = {'\\','\\','.','\\','p','i','p','e','\\','m','s','i','c','a','_','%','x','_','%','d',0}; DWORD client_pid = atoiW(arg); DWORD64 thread64; WCHAR buffer[24]; @@ -423,7 +423,7 @@ static int custom_action_server(const WCHAR *arg) return 1; } - sprintfW(buffer, pipe_name, client_pid); + sprintfW(buffer, pipe_name, client_pid, sizeof(void *) * 8); pipe = CreateFileW(buffer, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL); if (pipe == INVALID_HANDLE_VALUE) { diff --git a/dll/win32/msi/custom.c b/dll/win32/msi/custom.c index 8cb5fd42d69..e7ee80c689d 100644 --- a/dll/win32/msi/custom.c +++ b/dll/win32/msi/custom.c @@ -604,7 +604,7 @@ UINT CDECL __wine_msi_call_dll_function(const GUID *guid) static DWORD custom_start_server(MSIPACKAGE *package, DWORD arch) { - static const WCHAR pipe_name[] = {'\\','\\','.','\\','p','i','p','e','\\','m','s','i','c','a','_','%','x',0}; + static const WCHAR pipe_name[] = {'\\','\\','.','\\','p','i','p','e','\\','m','s','i','c','a','_','%','x','_','%','d',0}; static const WCHAR msiexecW[] = {'\\','m','s','i','e','x','e','c','.','e','x','e',0}; static const WCHAR argsW[] = {'%','s',' ','-','E','m','b','e','d','d','i','n','g',' ','%','d',0}; @@ -620,9 +620,11 @@ static DWORD custom_start_server(MSIPACKAGE *package, DWORD arch) (arch == SCS_64BIT_BINARY && package->custom_server_64_process)) return ERROR_SUCCESS; - sprintfW(buffer, pipe_name, GetCurrentProcessId()); + sprintfW(buffer, pipe_name, GetCurrentProcessId(), arch == SCS_32BIT_BINARY ? 32 : 64); pipe = CreateNamedPipeW(buffer, PIPE_ACCESS_DUPLEX, 0, 1, sizeof(DWORD64), sizeof(GUID), 0, NULL); + if (pipe == INVALID_HANDLE_VALUE) + ERR("Failed to create custom action client pipe: %u\n", GetLastError()); if (sizeof(void *) == 8 && arch == SCS_32BIT_BINARY) GetSystemWow64DirectoryW(path, MAX_PATH - sizeof(msiexecW)/sizeof(WCHAR));
2 years, 6 months
1
0
0
0
[reactos] 127/360: [WINESYNC] msi: Implement deferral for standard and custom actions.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=fd8b07bdfc7ad58023d95…
commit fd8b07bdfc7ad58023d95e6d99ad1ddf0174db47 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sat Mar 12 23:50:38 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:27:58 2022 +0100 [WINESYNC] msi: Implement deferral for standard and custom actions. 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 2a9e0f1fada4a414cc750f6d45595342f473e02f by Zebediah Figura <z.figura12(a)gmail.com> --- dll/win32/msi/action.c | 89 ++++++++++++++++++++++++++++++-- dll/win32/msi/assembly.c | 6 +++ dll/win32/msi/classes.c | 24 +++++++++ dll/win32/msi/custom.c | 1 + dll/win32/msi/files.c | 18 +++++++ dll/win32/msi/font.c | 6 +++ dll/win32/msi/msipriv.h | 1 + modules/rostests/winetests/msi/custom.c | 70 +------------------------ modules/rostests/winetests/msi/install.c | 1 - 9 files changed, 143 insertions(+), 73 deletions(-) diff --git a/dll/win32/msi/action.c b/dll/win32/msi/action.c index f53e6f317ee..ac925417866 100644 --- a/dll/win32/msi/action.c +++ b/dll/win32/msi/action.c @@ -105,8 +105,6 @@ static const WCHAR szIsolateComponents[] = {'I','s','o','l','a','t','e','C','o','m','p','o','n','e','n','t','s',0}; static const WCHAR szMigrateFeatureStates[] = {'M','i','g','r','a','t','e','F','e','a','t','u','r','e','S','t','a','t','e','s',0}; -static const WCHAR szMsiUnpublishAssemblies[] = - {'M','s','i','U','n','p','u','b','l','i','s','h','A','s','s','e','m','b','l','i','e','s',0}; static const WCHAR szInstallODBC[] = {'I','n','s','t','a','l','l','O','D','B','C',0}; static const WCHAR szInstallServices[] = @@ -865,6 +863,9 @@ static UINT ACTION_CreateFolders(MSIPACKAGE *package) MSIQUERY *view; UINT rc; + if (package->script == SCRIPT_NONE) + return msi_schedule_action(package, SCRIPT_INSTALL, szCreateFolders); + rc = MSI_DatabaseOpenViewW( package->db, query, &view ); if (rc != ERROR_SUCCESS) return ERROR_SUCCESS; @@ -944,6 +945,9 @@ static UINT ACTION_RemoveFolders( MSIPACKAGE *package ) MSIQUERY *view; UINT rc; + if (package->script == SCRIPT_NONE) + return msi_schedule_action(package, SCRIPT_INSTALL, szRemoveFolders); + rc = MSI_DatabaseOpenViewW( package->db, query, &view ); if (rc != ERROR_SUCCESS) return ERROR_SUCCESS; @@ -3018,6 +3022,9 @@ static UINT ACTION_WriteRegistryValues(MSIPACKAGE *package) MSIQUERY *view; UINT rc; + if (package->script == SCRIPT_NONE) + return msi_schedule_action(package, SCRIPT_INSTALL, szWriteRegistryValues); + rc = MSI_DatabaseOpenViewW(package->db, query, &view); if (rc != ERROR_SUCCESS) return ERROR_SUCCESS; @@ -3252,6 +3259,9 @@ static UINT ACTION_RemoveRegistryValues( MSIPACKAGE *package ) MSIQUERY *view; UINT rc; + if (package->script == SCRIPT_NONE) + return msi_schedule_action(package, SCRIPT_INSTALL, szRemoveRegistryValues); + rc = MSI_DatabaseOpenViewW( package->db, registry_query, &view ); if (rc == ERROR_SUCCESS) { @@ -3570,9 +3580,13 @@ static UINT ACTION_ProcessComponents(MSIPACKAGE *package) TRACE("\n"); - squash_guid( package->ProductCode, squashed_pc ); msi_set_sourcedir_props(package, FALSE); + if (package->script == SCRIPT_NONE) + return msi_schedule_action(package, SCRIPT_INSTALL, szProcessComponents); + + squash_guid( package->ProductCode, squashed_pc ); + LIST_FOR_EACH_ENTRY( comp, &package->components, MSICOMPONENT, entry ) { MSIRECORD *uirow; @@ -3846,6 +3860,9 @@ static UINT ACTION_RegisterTypeLibraries(MSIPACKAGE *package) MSIQUERY *view; UINT rc; + if (package->script == SCRIPT_NONE) + return msi_schedule_action(package, SCRIPT_INSTALL, szRegisterTypeLibraries); + rc = MSI_DatabaseOpenViewW(package->db, query, &view); if (rc != ERROR_SUCCESS) return ERROR_SUCCESS; @@ -3907,6 +3924,9 @@ static UINT ACTION_UnregisterTypeLibraries( MSIPACKAGE *package ) MSIQUERY *view; UINT rc; + if (package->script == SCRIPT_NONE) + return msi_schedule_action(package, SCRIPT_INSTALL, szUnregisterTypeLibraries); + rc = MSI_DatabaseOpenViewW( package->db, query, &view ); if (rc != ERROR_SUCCESS) return ERROR_SUCCESS; @@ -4091,6 +4111,9 @@ static UINT ACTION_CreateShortcuts(MSIPACKAGE *package) HRESULT res; UINT rc; + if (package->script == SCRIPT_NONE) + return msi_schedule_action(package, SCRIPT_INSTALL, szCreateShortcuts); + rc = MSI_DatabaseOpenViewW(package->db, query, &view); if (rc != ERROR_SUCCESS) return ERROR_SUCCESS; @@ -4144,6 +4167,9 @@ static UINT ACTION_RemoveShortcuts( MSIPACKAGE *package ) MSIQUERY *view; UINT rc; + if (package->script == SCRIPT_NONE) + return msi_schedule_action(package, SCRIPT_INSTALL, szRemoveShortcuts); + rc = MSI_DatabaseOpenViewW( package->db, query, &view ); if (rc != ERROR_SUCCESS) return ERROR_SUCCESS; @@ -4498,6 +4524,9 @@ static UINT ACTION_PublishProduct(MSIPACKAGE *package) MSIRECORD *uirow; BOOL republish = FALSE; + if (package->script == SCRIPT_NONE) + return msi_schedule_action(package, SCRIPT_INSTALL, szPublishProduct); + if (!list_empty(&package->patches)) { rc = msi_publish_patches(package); @@ -4695,6 +4724,9 @@ static UINT ACTION_WriteIniValues(MSIPACKAGE *package) MSIQUERY *view; UINT rc; + if (package->script == SCRIPT_NONE) + return msi_schedule_action(package, SCRIPT_INSTALL, szWriteIniValues); + rc = MSI_DatabaseOpenViewW(package->db, query, &view); if (rc != ERROR_SUCCESS) return ERROR_SUCCESS; @@ -4838,6 +4870,9 @@ static UINT ACTION_RemoveIniValues( MSIPACKAGE *package ) MSIQUERY *view; UINT rc; + if (package->script == SCRIPT_NONE) + return msi_schedule_action(package, SCRIPT_INSTALL, szRemoveIniValues); + rc = MSI_DatabaseOpenViewW( package->db, query, &view ); if (rc == ERROR_SUCCESS) { @@ -4930,6 +4965,9 @@ static UINT ACTION_SelfRegModules(MSIPACKAGE *package) MSIQUERY *view; UINT rc; + if (package->script == SCRIPT_NONE) + return msi_schedule_action(package, SCRIPT_INSTALL, szSelfRegModules); + rc = MSI_DatabaseOpenViewW(package->db, query, &view); if (rc != ERROR_SUCCESS) return ERROR_SUCCESS; @@ -4980,6 +5018,9 @@ static UINT ACTION_SelfUnregModules( MSIPACKAGE *package ) MSIQUERY *view; UINT rc; + if (package->script == SCRIPT_NONE) + return msi_schedule_action(package, SCRIPT_INSTALL, szSelfUnregModules); + rc = MSI_DatabaseOpenViewW( package->db, query, &view ); if (rc != ERROR_SUCCESS) return ERROR_SUCCESS; @@ -4995,6 +5036,9 @@ static UINT ACTION_PublishFeatures(MSIPACKAGE *package) UINT rc; HKEY hkey = NULL, userdata = NULL; + if (package->script == SCRIPT_NONE) + return msi_schedule_action(package, SCRIPT_INSTALL, szPublishFeatures); + if (!msi_check_publish(package)) return ERROR_SUCCESS; @@ -5135,6 +5179,9 @@ static UINT ACTION_UnpublishFeatures(MSIPACKAGE *package) { MSIFEATURE *feature; + if (package->script == SCRIPT_NONE) + return msi_schedule_action(package, SCRIPT_INSTALL, szUnpublishFeatures); + if (!msi_check_unpublish(package)) return ERROR_SUCCESS; @@ -5287,6 +5334,9 @@ static UINT ACTION_RegisterProduct(MSIPACKAGE *package) HKEY hkey, props, upgrade_key; UINT rc; + if (package->script == SCRIPT_NONE) + return msi_schedule_action(package, SCRIPT_INSTALL, szRegisterProduct); + /* FIXME: also need to publish if the product is in advertise mode */ if (!msi_get_property_int( package->db, szProductToBeRegistered, 0 ) && !msi_check_publish(package)) @@ -5605,6 +5655,9 @@ static UINT ACTION_RegisterUser(MSIPACKAGE *package) {0}, }; + if (package->script == SCRIPT_NONE) + return msi_schedule_action(package, SCRIPT_INSTALL, szRegisterUser); + if (msi_check_unpublish(package)) { MSIREG_DeleteUserDataProductKey(package->ProductCode, package->Context); @@ -5927,6 +5980,9 @@ static UINT ACTION_PublishComponents(MSIPACKAGE *package) MSIQUERY *view; UINT rc; + if (package->script == SCRIPT_NONE) + return msi_schedule_action(package, SCRIPT_INSTALL, szPublishComponents); + rc = MSI_DatabaseOpenViewW(package->db, query, &view); if (rc != ERROR_SUCCESS) return ERROR_SUCCESS; @@ -5999,6 +6055,9 @@ static UINT ACTION_UnpublishComponents( MSIPACKAGE *package ) MSIQUERY *view; UINT rc; + if (package->script == SCRIPT_NONE) + return msi_schedule_action(package, SCRIPT_INSTALL, szUnpublishComponents); + rc = MSI_DatabaseOpenViewW( package->db, query, &view ); if (rc != ERROR_SUCCESS) return ERROR_SUCCESS; @@ -6147,6 +6206,9 @@ static UINT ACTION_InstallServices( MSIPACKAGE *package ) MSIQUERY *view; UINT rc; + if (package->script == SCRIPT_NONE) + return msi_schedule_action(package, SCRIPT_INSTALL, szInstallServices); + rc = MSI_DatabaseOpenViewW(package->db, query, &view); if (rc != ERROR_SUCCESS) return ERROR_SUCCESS; @@ -6318,6 +6380,9 @@ static UINT ACTION_StartServices( MSIPACKAGE *package ) MSIQUERY *view; UINT rc; + if (package->script == SCRIPT_NONE) + return msi_schedule_action(package, SCRIPT_INSTALL, szStartServices); + rc = MSI_DatabaseOpenViewW(package->db, query, &view); if (rc != ERROR_SUCCESS) return ERROR_SUCCESS; @@ -6481,6 +6546,9 @@ static UINT ACTION_StopServices( MSIPACKAGE *package ) MSIQUERY *view; UINT rc; + if (package->script == SCRIPT_NONE) + return msi_schedule_action(package, SCRIPT_INSTALL, szStopServices); + rc = MSI_DatabaseOpenViewW(package->db, query, &view); if (rc != ERROR_SUCCESS) return ERROR_SUCCESS; @@ -6564,6 +6632,9 @@ static UINT ACTION_DeleteServices( MSIPACKAGE *package ) MSIQUERY *view; UINT rc; + if (package->script == SCRIPT_NONE) + return msi_schedule_action(package, SCRIPT_INSTALL, szDeleteServices); + rc = MSI_DatabaseOpenViewW( package->db, query, &view ); if (rc != ERROR_SUCCESS) return ERROR_SUCCESS; @@ -6834,6 +6905,9 @@ static UINT ACTION_InstallODBC( MSIPACKAGE *package ) MSIQUERY *view; UINT rc; + if (package->script == SCRIPT_NONE) + return msi_schedule_action(package, SCRIPT_INSTALL, szInstallODBC); + rc = MSI_DatabaseOpenViewW(package->db, driver_query, &view); if (rc == ERROR_SUCCESS) { @@ -7012,6 +7086,9 @@ static UINT ACTION_RemoveODBC( MSIPACKAGE *package ) MSIQUERY *view; UINT rc; + if (package->script == SCRIPT_NONE) + return msi_schedule_action(package, SCRIPT_INSTALL, szRemoveODBC); + rc = MSI_DatabaseOpenViewW( package->db, driver_query, &view ); if (rc == ERROR_SUCCESS) { @@ -7358,6 +7435,9 @@ static UINT ACTION_WriteEnvironmentStrings( MSIPACKAGE *package ) MSIQUERY *view; UINT rc; + if (package->script == SCRIPT_NONE) + return msi_schedule_action(package, SCRIPT_INSTALL, szWriteEnvironmentStrings); + rc = MSI_DatabaseOpenViewW(package->db, query, &view); if (rc != ERROR_SUCCESS) return ERROR_SUCCESS; @@ -7500,6 +7580,9 @@ static UINT ACTION_RemoveEnvironmentStrings( MSIPACKAGE *package ) MSIQUERY *view; UINT rc; + if (package->script == SCRIPT_NONE) + return msi_schedule_action(package, SCRIPT_INSTALL, szRemoveEnvironmentStrings); + rc = MSI_DatabaseOpenViewW( package->db, query, &view ); if (rc != ERROR_SUCCESS) return ERROR_SUCCESS; diff --git a/dll/win32/msi/assembly.c b/dll/win32/msi/assembly.c index bccd114b493..59fd332d253 100644 --- a/dll/win32/msi/assembly.c +++ b/dll/win32/msi/assembly.c @@ -652,6 +652,9 @@ UINT ACTION_MsiPublishAssemblies( MSIPACKAGE *package ) { MSICOMPONENT *comp; + if (package->script == SCRIPT_NONE) + return msi_schedule_action(package, SCRIPT_INSTALL, szMsiPublishAssemblies); + LIST_FOR_EACH_ENTRY(comp, &package->components, MSICOMPONENT, entry) { LONG res; @@ -717,6 +720,9 @@ UINT ACTION_MsiUnpublishAssemblies( MSIPACKAGE *package ) { MSICOMPONENT *comp; + if (package->script == SCRIPT_NONE) + return msi_schedule_action(package, SCRIPT_INSTALL, szMsiUnpublishAssemblies); + LIST_FOR_EACH_ENTRY(comp, &package->components, MSICOMPONENT, entry) { LONG res; diff --git a/dll/win32/msi/classes.c b/dll/win32/msi/classes.c index 60cc3c1a4b0..293aa1063b6 100644 --- a/dll/win32/msi/classes.c +++ b/dll/win32/msi/classes.c @@ -753,6 +753,9 @@ UINT ACTION_RegisterClassInfo(MSIPACKAGE *package) MSICLASS *cls; UINT r; + if (package->script == SCRIPT_NONE) + return msi_schedule_action(package, SCRIPT_INSTALL, szRegisterClassInfo); + r = load_classes_and_such( package ); if (r != ERROR_SUCCESS) return r; @@ -918,6 +921,9 @@ UINT ACTION_UnregisterClassInfo( MSIPACKAGE *package ) HKEY hkey, hkey2; UINT r; + if (package->script == SCRIPT_NONE) + return msi_schedule_action(package, SCRIPT_INSTALL, szUnregisterClassInfo); + r = load_classes_and_such( package ); if (r != ERROR_SUCCESS) return r; @@ -1083,6 +1089,9 @@ UINT ACTION_RegisterProgIdInfo(MSIPACKAGE *package) MSIRECORD *uirow; UINT r; + if (package->script == SCRIPT_NONE) + return msi_schedule_action(package, SCRIPT_INSTALL, szRegisterProgIdInfo); + r = load_classes_and_such( package ); if (r != ERROR_SUCCESS) return r; @@ -1143,6 +1152,9 @@ UINT ACTION_UnregisterProgIdInfo( MSIPACKAGE *package ) LONG res; UINT r; + if (package->script == SCRIPT_NONE) + return msi_schedule_action(package, SCRIPT_INSTALL, szUnregisterProgIdInfo); + r = load_classes_and_such( package ); if (r != ERROR_SUCCESS) return r; @@ -1255,6 +1267,9 @@ UINT ACTION_RegisterExtensionInfo(MSIPACKAGE *package) LONG res; UINT r; + if (package->script == SCRIPT_NONE) + return msi_schedule_action(package, SCRIPT_INSTALL, szRegisterExtensionInfo); + r = load_classes_and_such( package ); if (r != ERROR_SUCCESS) return r; @@ -1363,6 +1378,9 @@ UINT ACTION_UnregisterExtensionInfo( MSIPACKAGE *package ) LONG res; UINT r; + if (package->script == SCRIPT_NONE) + return msi_schedule_action(package, SCRIPT_INSTALL, szUnregisterExtensionInfo); + r = load_classes_and_such( package ); if (r != ERROR_SUCCESS) return r; @@ -1446,6 +1464,9 @@ UINT ACTION_RegisterMIMEInfo(MSIPACKAGE *package) MSIMIME *mt; UINT r; + if (package->script == SCRIPT_NONE) + return msi_schedule_action(package, SCRIPT_INSTALL, szRegisterMIMEInfo); + r = load_classes_and_such( package ); if (r != ERROR_SUCCESS) return r; @@ -1500,6 +1521,9 @@ UINT ACTION_UnregisterMIMEInfo( MSIPACKAGE *package ) MSIMIME *mime; UINT r; + if (package->script == SCRIPT_NONE) + return msi_schedule_action(package, SCRIPT_INSTALL, szUnregisterMIMEInfo); + r = load_classes_and_such( package ); if (r != ERROR_SUCCESS) return r; diff --git a/dll/win32/msi/custom.c b/dll/win32/msi/custom.c index 68a25d0b74f..8cb5fd42d69 100644 --- a/dll/win32/msi/custom.c +++ b/dll/win32/msi/custom.c @@ -1260,6 +1260,7 @@ static BOOL action_type_matches_script( UINT type, UINT script ) switch (script) { case SCRIPT_NONE: + return FALSE; case SCRIPT_INSTALL: return !(type & msidbCustomActionTypeCommit) && !(type & msidbCustomActionTypeRollback); case SCRIPT_COMMIT: diff --git a/dll/win32/msi/files.c b/dll/win32/msi/files.c index f6cf3e7a8cc..5a88c147e0b 100644 --- a/dll/win32/msi/files.c +++ b/dll/win32/msi/files.c @@ -359,6 +359,9 @@ UINT ACTION_InstallFiles(MSIPACKAGE *package) msi_set_sourcedir_props(package, FALSE); + if (package->script == SCRIPT_NONE) + return msi_schedule_action(package, SCRIPT_INSTALL, szInstallFiles); + schedule_install_files(package); mi = msi_alloc_zero( sizeof(MSIMEDIAINFO) ); @@ -584,6 +587,9 @@ UINT ACTION_PatchFiles( MSIPACKAGE *package ) TRACE("%p\n", package); + if (package->script == SCRIPT_NONE) + return msi_schedule_action(package, SCRIPT_INSTALL, szPatchFiles); + mi = msi_alloc_zero( sizeof(MSIMEDIAINFO) ); TRACE("extracting files\n"); @@ -1002,6 +1008,9 @@ UINT ACTION_MoveFiles( MSIPACKAGE *package ) MSIQUERY *view; UINT rc; + if (package->script == SCRIPT_NONE) + return msi_schedule_action(package, SCRIPT_INSTALL, szMoveFiles); + rc = MSI_DatabaseOpenViewW(package->db, query, &view); if (rc != ERROR_SUCCESS) return ERROR_SUCCESS; @@ -1134,6 +1143,9 @@ UINT ACTION_DuplicateFiles(MSIPACKAGE *package) MSIQUERY *view; UINT rc; + if (package->script == SCRIPT_NONE) + return msi_schedule_action(package, SCRIPT_INSTALL, szDuplicateFiles); + rc = MSI_DatabaseOpenViewW(package->db, query, &view); if (rc != ERROR_SUCCESS) return ERROR_SUCCESS; @@ -1210,6 +1222,9 @@ UINT ACTION_RemoveDuplicateFiles( MSIPACKAGE *package ) MSIQUERY *view; UINT rc; + if (package->script == SCRIPT_NONE) + return msi_schedule_action(package, SCRIPT_INSTALL, szRemoveDuplicateFiles); + rc = MSI_DatabaseOpenViewW( package->db, query, &view ); if (rc != ERROR_SUCCESS) return ERROR_SUCCESS; @@ -1350,6 +1365,9 @@ UINT ACTION_RemoveFiles( MSIPACKAGE *package ) MSIFILE *file; UINT r; + if (package->script == SCRIPT_NONE) + return msi_schedule_action(package, SCRIPT_INSTALL, szRemoveFiles); + r = MSI_DatabaseOpenViewW(package->db, query, &view); if (r == ERROR_SUCCESS) { diff --git a/dll/win32/msi/font.c b/dll/win32/msi/font.c index 5c1e59d95e4..fc050060c0c 100644 --- a/dll/win32/msi/font.c +++ b/dll/win32/msi/font.c @@ -294,6 +294,9 @@ UINT ACTION_RegisterFonts(MSIPACKAGE *package) MSIQUERY *view; UINT rc; + if (package->script == SCRIPT_NONE) + return msi_schedule_action(package, SCRIPT_INSTALL, szRegisterFonts); + rc = MSI_DatabaseOpenViewW(package->db, query, &view); if (rc != ERROR_SUCCESS) return ERROR_SUCCESS; @@ -374,6 +377,9 @@ UINT ACTION_UnregisterFonts( MSIPACKAGE *package ) MSIQUERY *view; UINT r; + if (package->script == SCRIPT_NONE) + return msi_schedule_action(package, SCRIPT_INSTALL, szUnregisterFonts); + r = MSI_DatabaseOpenViewW( package->db, query, &view ); if (r != ERROR_SUCCESS) return ERROR_SUCCESS; diff --git a/dll/win32/msi/msipriv.h b/dll/win32/msi/msipriv.h index 7a7da867e2a..d3dae5880da 100644 --- a/dll/win32/msi/msipriv.h +++ b/dll/win32/msi/msipriv.h @@ -1191,6 +1191,7 @@ static const WCHAR szWow6432NodeCLSID[] = {'W','o','w','6','4','3','2','N','o',' static const WCHAR szStreams[] = {'_','S','t','r','e','a','m','s',0}; static const WCHAR szStorages[] = {'_','S','t','o','r','a','g','e','s',0}; static const WCHAR szMsiPublishAssemblies[] = {'M','s','i','P','u','b','l','i','s','h','A','s','s','e','m','b','l','i','e','s',0}; +static const WCHAR szMsiUnpublishAssemblies[] = {'M','s','i','U','n','p','u','b','l','i','s','h','A','s','s','e','m','b','l','i','e','s',0}; static const WCHAR szCostingComplete[] = {'C','o','s','t','i','n','g','C','o','m','p','l','e','t','e',0}; static const WCHAR szTempFolder[] = {'T','e','m','p','F','o','l','d','e','r',0}; static const WCHAR szDatabase[] = {'D','A','T','A','B','A','S','E',0}; diff --git a/modules/rostests/winetests/msi/custom.c b/modules/rostests/winetests/msi/custom.c index 59a69ee22f8..3989ca8c10a 100644 --- a/modules/rostests/winetests/msi/custom.c +++ b/modules/rostests/winetests/msi/custom.c @@ -1182,52 +1182,42 @@ static BOOL pf_exists(const char *file) UINT WINAPI cf_present(MSIHANDLE hinst) { -todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED)) { ok(hinst, pf_exists("msitest\\first"), "folder absent\n"); ok(hinst, pf_exists("msitest\\second"), "folder absent\n"); ok(hinst, pf_exists("msitest\\third"), "folder absent\n"); -} return ERROR_SUCCESS; } UINT WINAPI cf_absent(MSIHANDLE hinst) { -todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED)) { ok(hinst, !pf_exists("msitest\\first"), "folder present\n"); ok(hinst, !pf_exists("msitest\\second"), "folder present\n"); ok(hinst, !pf_exists("msitest\\third"), "folder present\n"); -} return ERROR_SUCCESS; } UINT WINAPI file_present(MSIHANDLE hinst) { -todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED)) { ok(hinst, pf_exists("msitest\\first\\one.txt"), "file absent\n"); ok(hinst, pf_exists("msitest\\second\\two.txt"), "file absent\n"); -} return ERROR_SUCCESS; } UINT WINAPI file_absent(MSIHANDLE hinst) { -todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED)) { ok(hinst, !pf_exists("msitest\\first\\one.txt"), "file present\n"); ok(hinst, !pf_exists("msitest\\second\\two.txt"), "file present\n"); -} return ERROR_SUCCESS; } UINT WINAPI crs_present(MSIHANDLE hinst) { -todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED)) ok(hinst, pf_exists("msitest\\shortcut.lnk"), "shortcut absent\n"); return ERROR_SUCCESS; } UINT WINAPI crs_absent(MSIHANDLE hinst) { -todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED)) ok(hinst, !pf_exists("msitest\\shortcut.lnk"), "shortcut present\n"); return ERROR_SUCCESS; } @@ -1237,7 +1227,6 @@ UINT WINAPI sds_present(MSIHANDLE hinst) SC_HANDLE manager, service; manager = OpenSCManagerA(NULL, NULL, SC_MANAGER_ALL_ACCESS); service = OpenServiceA(manager, "TestService3", GENERIC_ALL); -todo_wine ok(hinst, !!service, "service absent: %u\n", GetLastError()); CloseServiceHandle(service); CloseServiceHandle(manager); @@ -1271,7 +1260,6 @@ UINT WINAPI sis_absent(MSIHANDLE hinst) SC_HANDLE manager, service; manager = OpenSCManagerA(NULL, NULL, SC_MANAGER_ALL_ACCESS); service = OpenServiceA(manager, "TestService", GENERIC_ALL); -todo_wine ok(hinst, !service, "service present\n"); if (service) CloseServiceHandle(service); CloseServiceHandle(manager); @@ -1288,7 +1276,6 @@ UINT WINAPI sss_started(MSIHANDLE hinst) service = OpenServiceA(manager, "Spooler", SC_MANAGER_ALL_ACCESS); ret = QueryServiceStatus(service, &status); ok(hinst, ret, "QueryServiceStatus failed: %u\n", GetLastError()); -todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED)) ok(hinst, status.dwCurrentState == SERVICE_RUNNING, "got %u\n", status.dwCurrentState); CloseServiceHandle(service); @@ -1315,10 +1302,8 @@ UINT WINAPI sss_stopped(MSIHANDLE hinst) UINT WINAPI rd_present(MSIHANDLE hinst) { -todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED)) { ok(hinst, pf_exists("msitest\\original2.txt"), "file absent\n"); ok(hinst, pf_exists("msitest\\duplicate.txt"), "file absent\n"); -} ok(hinst, !pf_exists("msitest\\original3.txt"), "file present\n"); ok(hinst, !pf_exists("msitest\\duplicate2.txt"), "file present\n"); return ERROR_SUCCESS; @@ -1326,10 +1311,8 @@ todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED)) { UINT WINAPI rd_absent(MSIHANDLE hinst) { -todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED)) { ok(hinst, !pf_exists("msitest\\original2.txt"), "file present\n"); ok(hinst, !pf_exists("msitest\\duplicate.txt"), "file present\n"); -} ok(hinst, !pf_exists("msitest\\original3.txt"), "file present\n"); ok(hinst, !pf_exists("msitest\\duplicate2.txt"), "file present\n"); return ERROR_SUCCESS; @@ -1352,10 +1335,8 @@ UINT WINAPI odbc_present(MSIHANDLE hinst) if (!strcmp(p, "ODBC test driver2")) gotdriver2 = 1; } -todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED)) { ok(hinst, gotdriver, "driver absent\n"); ok(hinst, gotdriver2, "driver 2 absent\n"); -} return ERROR_SUCCESS; } @@ -1376,10 +1357,8 @@ UINT WINAPI odbc_absent(MSIHANDLE hinst) if (!strcmp(p, "ODBC test driver2")) gotdriver2 = 1; } -todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED)) { ok(hinst, !gotdriver, "driver present\n"); ok(hinst, !gotdriver2, "driver 2 present\n"); -} return ERROR_SUCCESS; } @@ -1392,10 +1371,8 @@ UINT WINAPI mov_present(MSIHANDLE hinst) UINT WINAPI mov_absent(MSIHANDLE hinst) { -todo_wine { ok(hinst, !pf_exists("msitest\\canada"), "file present\n"); ok(hinst, !pf_exists("msitest\\dominica"), "file present\n"); -} return ERROR_SUCCESS; } @@ -1429,9 +1406,7 @@ UINT WINAPI pa_present(MSIHANDLE hinst) res = RegOpenKeyA(HKEY_CURRENT_USER, path_dotnet, &key); ok(hinst, !res, "got %d\n", res); -todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED)) { check_reg_str(hinst, key, name_dotnet, "rcHQPHq?CA@Uv-XqMI1e>Z'q,T*76M@=YEg6My?~]"); -} RegCloseKey(key); return ERROR_SUCCESS; @@ -1446,9 +1421,7 @@ UINT WINAPI pa_absent(MSIHANDLE hinst) ok(hinst, !res || res == ERROR_FILE_NOT_FOUND, "got %d\n", res); if (!res) { -todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED)) { check_reg_str(hinst, key, name_dotnet, NULL); -} RegCloseKey(key); } return ERROR_SUCCESS; @@ -1481,7 +1454,6 @@ UINT WINAPI ppc_absent(MSIHANDLE hinst) UINT r; r = RegOpenKeyExA(HKEY_LOCAL_MACHINE, ppc_key, 0, KEY_QUERY_VALUE | KEY_WOW64_64KEY, &key); -todo_wine ok(hinst, r == ERROR_FILE_NOT_FOUND, "got %u\n", r); return ERROR_SUCCESS; } @@ -1493,12 +1465,10 @@ UINT WINAPI pub_present(MSIHANDLE hinst) HKEY key; LONG res; -todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED)) { res = RegOpenKeyA(HKEY_CURRENT_USER, pub_key, &key); ok(hinst, !res, "got %u\n", res); res = RegQueryValueExA(key, "english.txt", NULL, NULL, NULL, NULL); ok(hinst, !res, "got %u\n", res); -} RegCloseKey(key); return ERROR_SUCCESS; } @@ -1509,7 +1479,6 @@ UINT WINAPI pub_absent(MSIHANDLE hinst) LONG res; res = RegOpenKeyA(HKEY_CURRENT_USER, pub_key, &key); -todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED)) ok(hinst, res == ERROR_FILE_NOT_FOUND, "got %u\n", res); return ERROR_SUCCESS; } @@ -1523,7 +1492,6 @@ UINT WINAPI pf_present(MSIHANDLE hinst) HKEY key; LONG res; -todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED)) { res = RegOpenKeyExA(HKEY_CLASSES_ROOT, pf_classkey, 0, KEY_READ | KEY_WOW64_64KEY, &key); ok(hinst, !res, "got %u\n", res); check_reg_str(hinst, key, "feature", ""); @@ -1535,7 +1503,6 @@ todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED)) { check_reg_str(hinst, key, "feature", "VGtfp^p+,?82@JU1j_KE"); check_reg_str(hinst, key, "montecristo", "VGtfp^p+,?82@JU1j_KE"); RegCloseKey(key); -} return ERROR_SUCCESS; } @@ -1546,11 +1513,9 @@ UINT WINAPI pf_absent(MSIHANDLE hinst) LONG res; res = RegOpenKeyExA(HKEY_CLASSES_ROOT, pf_classkey, 0, KEY_READ | KEY_WOW64_64KEY, &key); -todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED)) ok(hinst, res == ERROR_FILE_NOT_FOUND, "got %u\n", res); res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, pf_userkey, 0, KEY_READ | KEY_WOW64_64KEY, &key); -todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED)) ok(hinst, res == ERROR_FILE_NOT_FOUND, "got %u\n", res); return ERROR_SUCCESS; @@ -1579,7 +1544,6 @@ UINT WINAPI pp_absent(MSIHANDLE hinst) LONG res; res = RegOpenKeyExA(HKEY_CLASSES_ROOT, pp_prodkey, 0, KEY_READ | KEY_WOW64_64KEY, &key); -todo_wine ok(hinst, res == ERROR_FILE_NOT_FOUND, "got %u\n", res); return ERROR_SUCCESS; @@ -1590,7 +1554,6 @@ UINT WINAPI rci_present(MSIHANDLE hinst) HKEY key; LONG res; -todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED)) { res = RegOpenKeyExA(HKEY_CLASSES_ROOT, "CLSID\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", 0, KEY_READ | KEY_WOW64_32KEY, &key); ok(hinst, !res, "got %u\n", res); @@ -1603,7 +1566,6 @@ todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED)) { res = RegOpenKeyA(HKEY_CLASSES_ROOT, "AppID\\{CFCC3B38-E683-497D-9AB4-CB40AAFE307F}", &key); ok(hinst, !res, "got %u\n", res); RegCloseKey(key); -} return ERROR_SUCCESS; } @@ -1613,7 +1575,6 @@ UINT WINAPI rci_absent(MSIHANDLE hinst) HKEY key; LONG res; -todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED)) { res = RegOpenKeyExA(HKEY_CLASSES_ROOT, "CLSID\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", 0, KEY_READ | KEY_WOW64_32KEY, &key); ok(hinst, res == ERROR_FILE_NOT_FOUND, "got %u\n", res); @@ -1623,7 +1584,6 @@ todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED)) { res = RegOpenKeyA(HKEY_CLASSES_ROOT, "AppID\\{CFCC3B38-E683-497D-9AB4-CB40AAFE307F}", &key); ok(hinst, res == ERROR_FILE_NOT_FOUND, "got %u\n", res); -} return ERROR_SUCCESS; } @@ -1633,7 +1593,6 @@ UINT WINAPI rei_present(MSIHANDLE hinst) HKEY key; LONG res; -todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED)) { res = RegOpenKeyA(HKEY_CLASSES_ROOT, ".extension", &key); ok(hinst, !res, "got %u\n", res); RegCloseKey(key); @@ -1641,7 +1600,6 @@ todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED)) { res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Prog.Id.1\\shell\\Open\\command", &key); ok(hinst, !res, "got %u\n", res); RegCloseKey(key); -} return ERROR_SUCCESS; } @@ -1651,13 +1609,11 @@ UINT WINAPI rei_absent(MSIHANDLE hinst) HKEY key; LONG res; -todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED)) { res = RegOpenKeyA(HKEY_CLASSES_ROOT, ".extension", &key); ok(hinst, res == ERROR_FILE_NOT_FOUND, "got %u\n", res); res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Prog.Id.1\\shell\\Open\\command", &key); ok(hinst, res == ERROR_FILE_NOT_FOUND, "got %u\n", res); -} return ERROR_SUCCESS; } @@ -1672,7 +1628,6 @@ UINT WINAPI font_present(MSIHANDLE hinst) res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, font_key, 0, KEY_QUERY_VALUE | KEY_WOW64_64KEY, &key); ok(hinst, !res, "got %u\n", res); res = RegQueryValueExA(key, "msi test font", NULL, NULL, NULL, NULL); -todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED)) ok(hinst, !res, "got %u\n", res); RegCloseKey(key); @@ -1686,9 +1641,7 @@ UINT WINAPI font_absent(MSIHANDLE hinst) res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, font_key, 0, KEY_QUERY_VALUE | KEY_WOW64_64KEY, &key); ok(hinst, !res, "got %u\n", res); -todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED)) { check_reg_str(hinst, key, "msi test font", NULL); -} RegCloseKey(key); return ERROR_SUCCESS; @@ -1700,7 +1653,6 @@ UINT WINAPI rmi_present(MSIHANDLE hinst) LONG res; res = RegOpenKeyA(HKEY_CLASSES_ROOT, "MIME\\Database\\Content Type\\mime/type", &key); -todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED)) ok(hinst, !res, "got %u\n", res); return ERROR_SUCCESS; @@ -1712,7 +1664,6 @@ UINT WINAPI rmi_absent(MSIHANDLE hinst) LONG res; res = RegOpenKeyA(HKEY_CLASSES_ROOT, "MIME\\Database\\Content Type\\mime/type", &key); -todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED)) ok(hinst, res == ERROR_FILE_NOT_FOUND, "got %u\n", res); return ERROR_SUCCESS; @@ -1740,7 +1691,6 @@ UINT WINAPI rp_absent(MSIHANDLE hinst) LONG res; res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, rp_key, 0, KEY_READ | KEY_WOW64_32KEY, &key); -todo_wine ok(hinst, res == ERROR_FILE_NOT_FOUND, "got %u\n", res); return ERROR_SUCCESS; @@ -1751,7 +1701,6 @@ UINT WINAPI rpi_present(MSIHANDLE hinst) HKEY key; LONG res; -todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED)) { res = RegOpenKeyExA(HKEY_CLASSES_ROOT, "CLSID\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", 0, KEY_READ | KEY_WOW64_32KEY, &key); ok(hinst, !res, "got %u\n", res); @@ -1768,7 +1717,6 @@ todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED)) { res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Winetest.Class.2", &key); ok(hinst, !res, "got %u\n", res); RegCloseKey(key); -} return ERROR_SUCCESS; } @@ -1778,7 +1726,6 @@ UINT WINAPI rpi_absent(MSIHANDLE hinst) HKEY key; LONG res; -todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED)) { res = RegOpenKeyExA(HKEY_CLASSES_ROOT, "CLSID\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", 0, KEY_READ | KEY_WOW64_32KEY, &key); ok(hinst, res == ERROR_FILE_NOT_FOUND, "got %u\n", res); @@ -1791,7 +1738,6 @@ todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED)) { res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Winetest.Class.2", &key); ok(hinst, res == ERROR_FILE_NOT_FOUND, "got %u\n", res); -} return ERROR_SUCCESS; } @@ -1818,7 +1764,6 @@ UINT WINAPI ru_absent(MSIHANDLE hinst) LONG res; res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, ru_key, 0, KEY_READ | KEY_WOW64_64KEY, &key); -todo_wine ok(hinst, res == ERROR_FILE_NOT_FOUND, "got %u\n", res); return ERROR_SUCCESS; @@ -1833,10 +1778,8 @@ UINT WINAPI tl_present(MSIHANDLE hinst) HRESULT hr; hr = LoadRegTypeLib(&LIBID_register_test, 7, 1, 0, &tlb); -todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED)) ok(hinst, hr == S_OK, "got %#x\n", hr); - if (tlb) - ITypeLib_Release(tlb); + ITypeLib_Release(tlb); return ERROR_SUCCESS; } @@ -1847,7 +1790,6 @@ UINT WINAPI tl_absent(MSIHANDLE hinst) HRESULT hr; hr = LoadRegTypeLib(&LIBID_register_test, 7, 1, 0, &tlb); -todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED)) ok(hinst, hr == TYPE_E_LIBNOTREGISTERED, "got %#x\n", hr); return ERROR_SUCCESS; @@ -1859,7 +1801,6 @@ UINT WINAPI sr_present(MSIHANDLE hinst) LONG res; res = RegOpenKeyA(HKEY_CLASSES_ROOT, "selfreg_test", &key); -todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED)) ok(hinst, !res, "got %u\n", res); RegCloseKey(key); @@ -1872,7 +1813,6 @@ UINT WINAPI sr_absent(MSIHANDLE hinst) LONG res; res = RegOpenKeyA(HKEY_CLASSES_ROOT, "selfreg_test", &key); -todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED)) ok(hinst, res == ERROR_FILE_NOT_FOUND, "got %u\n", res); return ERROR_SUCCESS; @@ -1885,10 +1825,8 @@ UINT WINAPI env_present(MSIHANDLE hinst) res = RegOpenKeyA(HKEY_CURRENT_USER, "Environment", &key); ok(hinst, !res, "got %u\n", res); -todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED)) { check_reg_str(hinst, key, "MSITESTVAR3", "1"); check_reg_str(hinst, key, "MSITESTVAR4", "1"); -} RegCloseKey(key); return ERROR_SUCCESS; @@ -1901,10 +1839,8 @@ UINT WINAPI env_absent(MSIHANDLE hinst) res = RegOpenKeyA(HKEY_CURRENT_USER, "Environment", &key); ok(hinst, !res, "got %u\n", res); -todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED)) { check_reg_str(hinst, key, "MSITESTVAR3", NULL); check_reg_str(hinst, key, "MSITESTVAR4", NULL); -} RegCloseKey(key); return ERROR_SUCCESS; @@ -1920,7 +1856,6 @@ UINT WINAPI ini_present(MSIHANDLE hinst) strcat(path, "\\msitest\\test.ini"); len = GetPrivateProfileStringA("section1", "key1", NULL, buf, sizeof(buf), path); -todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED)) ok(hinst, len == 6, "got %u\n", len); return ERROR_SUCCESS; @@ -1936,7 +1871,6 @@ UINT WINAPI ini_absent(MSIHANDLE hinst) strcat(path, "\\msitest\\test.ini"); len = GetPrivateProfileStringA("section1", "key1", NULL, buf, sizeof(buf), path); -todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED)) ok(hinst, !len, "got %u\n", len); return ERROR_SUCCESS; @@ -1949,7 +1883,6 @@ UINT WINAPI wrv_present(MSIHANDLE hinst) res = RegOpenKeyA(HKEY_CURRENT_USER, "msitest", &key); ok(hinst, !res, "got %u\n", res); - todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED)) check_reg_str(hinst, key, "sz", "string"); RegCloseKey(key); @@ -1963,7 +1896,6 @@ UINT WINAPI wrv_absent(MSIHANDLE hinst) res = RegOpenKeyA(HKEY_CURRENT_USER, "msitest", &key); ok(hinst, !res, "got %u\n", res); - todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED)) check_reg_str(hinst, key, "sz", NULL); RegCloseKey(key); diff --git a/modules/rostests/winetests/msi/install.c b/modules/rostests/winetests/msi/install.c index 80137c1d993..e147df6a3a5 100644 --- a/modules/rostests/winetests/msi/install.c +++ b/modules/rostests/winetests/msi/install.c @@ -6086,7 +6086,6 @@ static void test_deferred_action(void) } ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); -todo_wine check_file_matches(file, "onetwo"); ok(DeleteFileA(file), "Directory not created\n");
2 years, 6 months
1
0
0
0
[reactos] 126/360: [WINESYNC] msiexec: Use the ARRAY_SIZE() macro.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=426052d1aa4e58944a544…
commit 426052d1aa4e58944a544ec81cb36b536f3674d9 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sat Mar 12 23:50:36 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:27:58 2022 +0100 [WINESYNC] msiexec: Use the ARRAY_SIZE() macro. 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 effac73e7275e40d717ccf21af84b34fe3e0844a by Michael Stefaniuc <mstefani(a)winehq.org> --- base/system/msiexec/msiexec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/base/system/msiexec/msiexec.c b/base/system/msiexec/msiexec.c index 5a471a21840..47cef7e0fa2 100644 --- a/base/system/msiexec/msiexec.c +++ b/base/system/msiexec/msiexec.c @@ -71,11 +71,11 @@ static void ShowUsage(int ExitCode) /* MsiGetFileVersion need the full path */ *filename = 0; - res = GetModuleFileNameW(hmsi, filename, sizeof(filename) / sizeof(filename[0])); + res = GetModuleFileNameW(hmsi, filename, ARRAY_SIZE(filename)); if (!res) WINE_ERR("GetModuleFileName failed: %d\n", GetLastError()); - len = sizeof(msiexec_version) / sizeof(msiexec_version[0]); + len = ARRAY_SIZE(msiexec_version); *msiexec_version = 0; res = MsiGetFileVersionW(filename, msiexec_version, &len, NULL, NULL); if (res)
2 years, 6 months
1
0
0
0
[reactos] 125/360: [WINESYNC] msi: Do not free hPackage twice or uninitialized (Coverity).
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=4c8ffed7ec28dc2a7e863…
commit 4c8ffed7ec28dc2a7e863bc217054f9fc385ecbe Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sat Mar 12 23:50:36 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:27:57 2022 +0100 [WINESYNC] msi: Do not free hPackage twice or uninitialized (Coverity). Signed-off-by: Marcus Meissner <marcus(a)jet.franken.de> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id 9f1cdb4970c569460c96a143b126d1c298116d7d by Marcus Meissner <marcus(a)jet.franken.de> --- dll/win32/msi/custom.c | 1 - 1 file changed, 1 deletion(-) diff --git a/dll/win32/msi/custom.c b/dll/win32/msi/custom.c index e7e19a2475a..68a25d0b74f 100644 --- a/dll/win32/msi/custom.c +++ b/dll/win32/msi/custom.c @@ -596,7 +596,6 @@ UINT CDECL __wine_msi_call_dll_function(const GUID *guid) FreeLibrary(hModule); - MsiCloseHandle(hPackage); midl_user_free(dll); midl_user_free(proc);
2 years, 6 months
1
0
0
0
[reactos] 124/360: [WINESYNC] msi: Use msi_get_package_code in msi_publish_product_properties.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=980ce9db3fa5566bd7925…
commit 980ce9db3fa5566bd79251a0ea228b5868e4294b Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sat Mar 12 23:50:35 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:27:57 2022 +0100 [WINESYNC] msi: Use msi_get_package_code in msi_publish_product_properties. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id ddf762a82f2c578cd3b0d4ff0c13c8a08641a666 by Hans Leidekker <hans(a)codeweavers.com> --- dll/win32/msi/action.c | 28 +++++----------------------- 1 file changed, 5 insertions(+), 23 deletions(-) diff --git a/dll/win32/msi/action.c b/dll/win32/msi/action.c index bfecf68f5cc..f53e6f317ee 100644 --- a/dll/win32/msi/action.c +++ b/dll/win32/msi/action.c @@ -4288,10 +4288,8 @@ static UINT msi_publish_product_properties(MSIPACKAGE *package, HKEY hkey) static const WCHAR szClients[] = {'C','l','i','e','n','t','s',0}; static const WCHAR szColon[] = {':',0}; - MSIHANDLE hdb, suminfo; - WCHAR *buffer, *ptr, guids[MAX_PATH], packcode[SQUASHED_GUID_SIZE]; - DWORD langid, size; - UINT r; + WCHAR *buffer, *ptr, *guids, packcode[SQUASHED_GUID_SIZE]; + DWORD langid; buffer = msi_dup_property(package->db, INSTALLPROPERTY_PRODUCTNAMEW); msi_reg_set_val_str(hkey, INSTALLPROPERTY_PRODUCTNAMEW, buffer); @@ -4325,28 +4323,12 @@ static UINT msi_publish_product_properties(MSIPACKAGE *package, HKEY hkey) msi_reg_set_val_dword(hkey, INSTALLPROPERTY_INSTANCETYPEW, 0); msi_reg_set_val_str(hkey, szClients, szColon); - hdb = alloc_msihandle(&package->db->hdr); - if (!hdb) - return ERROR_NOT_ENOUGH_MEMORY; - - r = MsiGetSummaryInformationW(hdb, NULL, 0, &suminfo); - MsiCloseHandle(hdb); - if (r != ERROR_SUCCESS) - goto done; - - size = MAX_PATH; - r = MsiSummaryInfoGetPropertyW(suminfo, PID_REVNUMBER, NULL, NULL, - NULL, guids, &size); - if (r != ERROR_SUCCESS) - goto done; - - ptr = strchrW(guids, ';'); - if (ptr) *ptr = 0; + if (!(guids = msi_get_package_code(package->db))) return ERROR_OUTOFMEMORY; + if ((ptr = strchrW(guids, ';'))) *ptr = 0; squash_guid(guids, packcode); + msi_free( guids); msi_reg_set_val_str(hkey, INSTALLPROPERTY_PACKAGECODEW, packcode); -done: - MsiCloseHandle(suminfo); return ERROR_SUCCESS; }
2 years, 6 months
1
0
0
0
[reactos] 123/360: [WINESYNC] msi: Fix condition evaluation when comparing literal and integer.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=331be6126305407bc958d…
commit 331be6126305407bc958d4a1fb48022bd81cfe3c Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sat Mar 12 23:22:10 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:27:57 2022 +0100 [WINESYNC] msi: Fix condition evaluation when comparing literal and integer. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=45445
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 7837ae20cdeabab661da7bb5dae24f5ffefe17ee by Piotr Caban <piotr(a)codeweavers.com> --- modules/rostests/winetests/msi/package.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/rostests/winetests/msi/package.c b/modules/rostests/winetests/msi/package.c index ace9b354f91..d6d90ce39fb 100644 --- a/modules/rostests/winetests/msi/package.c +++ b/modules/rostests/winetests/msi/package.c @@ -2097,6 +2097,10 @@ static void test_condition(void) ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r); r = MsiEvaluateConditionA(hpkg, "&nofeature=\"\""); ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r); + r = MsiEvaluateConditionA(hpkg, "&nofeature<>3"); + ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r); + r = MsiEvaluateConditionA(hpkg, "\"\"<>3"); + ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r); r = MsiEvaluateConditionA(hpkg, "!nofeature=\"\""); ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r); MsiEvaluateConditionA(hpkg, "$nocomponent=\"\"");
2 years, 6 months
1
0
0
0
[reactos] 122/360: [WINESYNC] msi: Reuse the custom action server process where possible.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=82decec5f10d5c4bc70a0…
commit 82decec5f10d5c4bc70a0649b217fd1bfc49e060 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sat Mar 12 23:22:09 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:27:57 2022 +0100 [WINESYNC] msi: Reuse the custom action server process where possible. We use a named pipe to communicate between the client (i.e. the process that called MsiInstallProduct() and the custom action server. The naïve approach has the client send custom action GUIDs to the server and the server send back the results of executing the action, but this fails in the case of nested custom actions, so instead we send back handles of threads for the client to wait on. 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 457431ab5bc1dd10c4957f145de85c4ba6d0ef72 by Zebediah Figura <z.figura12(a)gmail.com> --- base/system/msiexec/msiexec.c | 59 ++++++++++--- dll/win32/msi/custom.c | 133 ++++++++++++++++++++++------- dll/win32/msi/msipriv.h | 6 ++ dll/win32/msi/package.c | 4 + modules/rostests/winetests/msi/custom.c | 19 +++++ modules/rostests/winetests/msi/custom.spec | 3 + modules/rostests/winetests/msi/install.c | 14 ++- 7 files changed, 198 insertions(+), 40 deletions(-) diff --git a/base/system/msiexec/msiexec.c b/base/system/msiexec/msiexec.c index 74f6d515b95..5a471a21840 100644 --- a/base/system/msiexec/msiexec.c +++ b/base/system/msiexec/msiexec.c @@ -30,6 +30,9 @@ #include "wine/debug.h" #include "wine/unicode.h" +#include "initguid.h" +DEFINE_GUID(GUID_NULL,0,0,0,0,0,0,0,0,0,0,0); + WINE_DEFAULT_DEBUG_CHANNEL(msiexec); typedef HRESULT (WINAPI *DLLREGISTERSERVER)(void); @@ -401,24 +404,60 @@ static DWORD CALLBACK custom_action_thread(void *arg) return __wine_msi_call_dll_function(guid); } -static int DoEmbedding(LPCWSTR key) +static int custom_action_server(const WCHAR *arg) { + static const WCHAR pipe_name[] = {'\\','\\','.','\\','p','i','p','e','\\','m','s','i','c','a','_','%','x',0}; + DWORD client_pid = atoiW(arg); + DWORD64 thread64; + WCHAR buffer[24]; HANDLE thread; + HANDLE pipe; + DWORD size; GUID guid; - UINT r; + + TRACE("%s\n", debugstr_w(arg)); + + if (!client_pid) + { + ERR("Invalid parameter %s\n", debugstr_w(arg)); + return 1; + } + + sprintfW(buffer, pipe_name, client_pid); + pipe = CreateFileW(buffer, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL); + if (pipe == INVALID_HANDLE_VALUE) + { + ERR("Failed to create custom action server pipe: %u\n", GetLastError()); + return GetLastError(); + } /* We need this to unmarshal streams, and some apps expect it to be present. */ CoInitializeEx(NULL, COINIT_MULTITHREADED); - CLSIDFromString(key, &guid); - thread = CreateThread(NULL, 0, custom_action_thread, &guid, 0, NULL); - WaitForSingleObject(thread, INFINITE); - GetExitCodeThread(thread, &r); - CloseHandle(thread); + while (ReadFile(pipe, &guid, sizeof(guid), &size, NULL) && size == sizeof(guid)) + { + if (IsEqualGUID(&guid, &GUID_NULL)) + { + /* package closed; time to shut down */ + CoUninitialize(); + return 0; + } - CoUninitialize(); + thread = CreateThread(NULL, 0, custom_action_thread, &guid, 0, NULL); - return r; + /* give the thread handle to the client to wait on, since we might have + * to run a nested action and can't block during this one */ + thread64 = (DWORD_PTR)thread; + if (!WriteFile(pipe, &thread64, sizeof(thread64), &size, NULL) || size != sizeof(thread64)) + { + ERR("Failed to write to custom action server pipe: %u\n", GetLastError()); + CoUninitialize(); + return GetLastError(); + } + } + ERR("Failed to read from custom action server pipe: %u\n", GetLastError()); + CoUninitialize(); + return GetLastError(); } /* @@ -615,7 +654,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine } if (argc == 3 && msi_option_equal(argvW[1], "Embedding")) - return DoEmbedding( argvW[2] ); + return custom_action_server(argvW[2]); for(i = 1; i < argc; i++) { diff --git a/dll/win32/msi/custom.c b/dll/win32/msi/custom.c index 4202f255973..e7e19a2475a 100644 --- a/dll/win32/msi/custom.c +++ b/dll/win32/msi/custom.c @@ -603,22 +603,88 @@ UINT CDECL __wine_msi_call_dll_function(const GUID *guid) return r; } -static DWORD WINAPI custom_client_thread(void *arg) +static DWORD custom_start_server(MSIPACKAGE *package, DWORD arch) { + static const WCHAR pipe_name[] = {'\\','\\','.','\\','p','i','p','e','\\','m','s','i','c','a','_','%','x',0}; static const WCHAR msiexecW[] = {'\\','m','s','i','e','x','e','c','.','e','x','e',0}; - static const WCHAR argsW[] = {' ','-','E','m','b','e','d','d','i','n','g',' ',0}; - msi_custom_action_info *info = arg; + static const WCHAR argsW[] = {'%','s',' ','-','E','m','b','e','d','d','i','n','g',' ','%','d',0}; + + WCHAR path[MAX_PATH], cmdline[MAX_PATH + 23]; PROCESS_INFORMATION pi = {0}; STARTUPINFOW si = {0}; - WCHAR buffer[MAX_PATH], cmdline[MAX_PATH + 60]; - RPC_STATUS status; + WCHAR buffer[24]; void *cookie; + HANDLE pipe; BOOL wow64; + + if ((arch == SCS_32BIT_BINARY && package->custom_server_32_process) || + (arch == SCS_64BIT_BINARY && package->custom_server_64_process)) + return ERROR_SUCCESS; + + sprintfW(buffer, pipe_name, GetCurrentProcessId()); + pipe = CreateNamedPipeW(buffer, PIPE_ACCESS_DUPLEX, 0, 1, sizeof(DWORD64), + sizeof(GUID), 0, NULL); + + if (sizeof(void *) == 8 && arch == SCS_32BIT_BINARY) + GetSystemWow64DirectoryW(path, MAX_PATH - sizeof(msiexecW)/sizeof(WCHAR)); + else + GetSystemDirectoryW(path, MAX_PATH - sizeof(msiexecW)/sizeof(WCHAR)); + strcatW(path, msiexecW); + sprintfW(cmdline, argsW, path, GetCurrentProcessId()); + + if (IsWow64Process(GetCurrentProcess(), &wow64) && wow64 && arch == SCS_64BIT_BINARY) + { + Wow64DisableWow64FsRedirection(&cookie); + CreateProcessW(path, cmdline, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); + Wow64RevertWow64FsRedirection(cookie); + } + else + CreateProcessW(path, cmdline, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); + + CloseHandle(pi.hThread); + + if (arch == SCS_32BIT_BINARY) + { + package->custom_server_32_process = pi.hProcess; + package->custom_server_32_pipe = pipe; + } + else + { + package->custom_server_64_process = pi.hProcess; + package->custom_server_64_pipe = pipe; + } + + if (!ConnectNamedPipe(pipe, NULL)) + { + ERR("Failed to connect to custom action server: %u\n", GetLastError()); + return GetLastError(); + } + + return ERROR_SUCCESS; +} + +void custom_stop_server(HANDLE process, HANDLE pipe) +{ + DWORD size; + + WriteFile(pipe, &GUID_NULL, sizeof(GUID_NULL), &size, NULL); + WaitForSingleObject(process, INFINITE); + CloseHandle(process); + CloseHandle(pipe); +} + +static DWORD WINAPI custom_client_thread(void *arg) +{ + msi_custom_action_info *info = arg; + RPC_STATUS status; + DWORD64 thread64; + HANDLE process; + HANDLE thread; + HANDLE pipe; DWORD arch; + DWORD size; BOOL ret; - DWORD rc; - - TRACE("custom action (%x) started\n", GetCurrentThreadId() ); + UINT rc; CoInitializeEx(NULL, COINIT_MULTITHREADED); /* needed to marshal streams */ @@ -644,35 +710,44 @@ static DWORD WINAPI custom_client_thread(void *arg) } ret = GetBinaryTypeW(info->source, &arch); + if (!ret) + arch = (sizeof(void *) == 8 ? SCS_64BIT_BINARY : SCS_32BIT_BINARY); - if (sizeof(void *) == 8 && ret && arch == SCS_32BIT_BINARY) - GetSystemWow64DirectoryW(buffer, MAX_PATH - sizeof(msiexecW)/sizeof(WCHAR)); + custom_start_server(info->package, arch); + if (arch == SCS_32BIT_BINARY) + { + process = info->package->custom_server_32_process; + pipe = info->package->custom_server_32_pipe; + } else - GetSystemDirectoryW(buffer, MAX_PATH - sizeof(msiexecW)/sizeof(WCHAR)); - strcatW(buffer, msiexecW); - strcpyW(cmdline, buffer); - strcatW(cmdline, argsW); - StringFromGUID2(&info->guid, cmdline + strlenW(cmdline), 39); + { + process = info->package->custom_server_64_process; + pipe = info->package->custom_server_64_pipe; + } - if (IsWow64Process(GetCurrentProcess(), &wow64) && wow64 && arch == SCS_64BIT_BINARY) + if (!WriteFile(pipe, &info->guid, sizeof(info->guid), &size, NULL) || + size != sizeof(info->guid)) { - Wow64DisableWow64FsRedirection(&cookie); - CreateProcessW(buffer, cmdline, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); - Wow64RevertWow64FsRedirection(cookie); + ERR("Failed to write to custom action client pipe: %u\n", GetLastError()); + return GetLastError(); + } + if (!ReadFile(pipe, &thread64, sizeof(thread64), &size, NULL) || size != sizeof(thread64)) + { + ERR("Failed to read from custom action client pipe: %u\n", GetLastError()); + return GetLastError(); } - else - CreateProcessW(buffer, cmdline, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); - WaitForSingleObject(pi.hProcess, INFINITE); - GetExitCodeProcess(pi.hProcess, &rc); - CloseHandle(pi.hProcess); - CloseHandle(pi.hThread); + if (DuplicateHandle(process, (HANDLE)(DWORD_PTR)thread64, GetCurrentProcess(), + &thread, 0, FALSE, DUPLICATE_SAME_ACCESS | DUPLICATE_CLOSE_SOURCE)) + { + WaitForSingleObject(thread, INFINITE); + GetExitCodeThread(thread, &rc); + CloseHandle(thread); + } + else + rc = GetLastError(); CoUninitialize(); - - TRACE("custom action (%x) returned %i\n", GetCurrentThreadId(), rc ); - - MsiCloseAllHandles(); return rc; } diff --git a/dll/win32/msi/msipriv.h b/dll/win32/msi/msipriv.h index f701f91a866..7a7da867e2a 100644 --- a/dll/win32/msi/msipriv.h +++ b/dll/win32/msi/msipriv.h @@ -424,6 +424,11 @@ typedef struct tagMSIPACKAGE struct list RunningActions; + HANDLE custom_server_32_process; + HANDLE custom_server_64_process; + HANDLE custom_server_32_pipe; + HANDLE custom_server_64_pipe; + LPWSTR PackagePath; LPWSTR ProductCode; LPWSTR localfile; @@ -983,6 +988,7 @@ extern HINSTANCE msi_hInstance DECLSPEC_HIDDEN; extern UINT ACTION_PerformAction(MSIPACKAGE *package, const WCHAR *action) DECLSPEC_HIDDEN; extern void ACTION_FinishCustomActions( const MSIPACKAGE* package) DECLSPEC_HIDDEN; extern UINT ACTION_CustomAction(MSIPACKAGE *package, const WCHAR *action) DECLSPEC_HIDDEN; +extern void custom_stop_server(HANDLE process, HANDLE pipe) DECLSPEC_HIDDEN; /* actions in other modules */ extern UINT ACTION_AppSearch(MSIPACKAGE *package) DECLSPEC_HIDDEN; diff --git a/dll/win32/msi/package.c b/dll/win32/msi/package.c index 03927046190..577fcbbf185 100644 --- a/dll/win32/msi/package.c +++ b/dll/win32/msi/package.c @@ -346,6 +346,10 @@ static void MSI_FreePackage( MSIOBJECTHDR *arg) RpcServerUnregisterIf(s_IWineMsiRemote_v0_0_s_ifspec, NULL, FALSE); if (rpc_handle) RpcBindingFree(&rpc_handle); + if (package->custom_server_32_process) + custom_stop_server(package->custom_server_32_process, package->custom_server_32_pipe); + if (package->custom_server_64_process) + custom_stop_server(package->custom_server_64_process, package->custom_server_64_pipe); if (package->delete_on_close) DeleteFileW( package->localfile ); msi_free( package->localfile ); diff --git a/modules/rostests/winetests/msi/custom.c b/modules/rostests/winetests/msi/custom.c index 4d45c9e448f..59a69ee22f8 100644 --- a/modules/rostests/winetests/msi/custom.c +++ b/modules/rostests/winetests/msi/custom.c @@ -1150,6 +1150,25 @@ UINT WINAPI da_deferred(MSIHANDLE hinst) return ERROR_SUCCESS; } +static int global_state; + +UINT WINAPI process1(MSIHANDLE hinst) +{ + SetEnvironmentVariableA("MSI_PROCESS_TEST","1"); + global_state++; + return ERROR_SUCCESS; +} + +UINT WINAPI process2(MSIHANDLE hinst) +{ + char env[2] = {0}; + DWORD r = GetEnvironmentVariableA("MSI_PROCESS_TEST", env, sizeof(env)); + ok(hinst, r == 1, "got %d, error %u\n", r, GetLastError()); + ok(hinst, !strcmp(env, "1"), "got %s\n", env); + ok(hinst, !global_state, "got global_state %d\n", global_state); + return ERROR_SUCCESS; +} + static BOOL pf_exists(const char *file) { char path[MAX_PATH]; diff --git a/modules/rostests/winetests/msi/custom.spec b/modules/rostests/winetests/msi/custom.spec index b94f6cce703..b7cbe582506 100644 --- a/modules/rostests/winetests/msi/custom.spec +++ b/modules/rostests/winetests/msi/custom.spec @@ -3,6 +3,9 @@ @ stdcall da_immediate(long) @ stdcall da_deferred(long) @ stdcall nested(long) +@ stdcall process1(long) +@ stdcall process2(long) + @ stdcall cf_present(long) @ stdcall cf_absent(long) @ stdcall crs_present(long) diff --git a/modules/rostests/winetests/msi/install.c b/modules/rostests/winetests/msi/install.c index f21e32789f3..80137c1d993 100644 --- a/modules/rostests/winetests/msi/install.c +++ b/modules/rostests/winetests/msi/install.c @@ -670,9 +670,14 @@ static const CHAR ca1_install_exec_seq_dat[] = "Action\tCondition\tSequence\n" "FileCost\t\t200\n" "CostFinalize\t\t300\n" "InstallValidate\t\t400\n" + "InstallInitialize\t\t500\n" "embednull\t\t600\n" "maintest\tMAIN_TEST\t700\n" - "testretval\tTEST_RETVAL\t710\n"; + "testretval\tTEST_RETVAL\t710\n" + "process1\tTEST_PROCESS\t720\n" + "process2\tTEST_PROCESS\t721\n" + "process_deferred\tTEST_PROCESS\t722\n" + "InstallFinalize\t\t800\n"; static const CHAR ca1_custom_action_dat[] = "Action\tType\tSource\tTarget\n" "s72\ti2\tS64\tS0\n" @@ -681,6 +686,9 @@ static const CHAR ca1_custom_action_dat[] = "Action\tType\tSource\tTarget\n" "nested51\t51\tnested\t1\n" "nested1\t1\tcustom.dll\tnested\n" "maintest\t1\tcustom.dll\tmain_test\n" + "process1\t1\tcustom.dll\tprocess1\n" + "process2\t1\tcustom.dll\tprocess2\n" + "process_deferred\t1025\tcustom.dll\tprocess2\n" "testretval\t1\tcustom.dll\ttest_retval\n"; static const CHAR ca1_test_seq_dat[] = "Action\tCondition\tSequence\n" @@ -4134,6 +4142,10 @@ static void test_customaction1(void) r = MsiInstallProductA(msifile, "TEST_RETVAL=1"); ok(r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %u\n", r); + /* Custom actions execute in the same process, but they don't retain state */ + r = MsiInstallProductA(msifile, "TEST_PROCESS=1"); + ok(!r, "got %u\n", r); + delete_test_files(); DeleteFileA(msifile); DeleteFileA("unus");
2 years, 6 months
1
0
0
0
← Newer
1
...
25
26
27
28
29
30
31
...
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