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] 141/360: [WINESYNC] msi/tests: Add some tests for remote MSI summary info APIs.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=a8bfcb28ab3345d49cbe0…
commit a8bfcb28ab3345d49cbe0a46025be3930f14a5fc Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sat Mar 12 23:57:39 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:28:01 2022 +0100 [WINESYNC] msi/tests: Add some tests for remote MSI summary info APIs. Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id 4acd7b6c45faa960aee3d753d2979315ad4d2b46 by Dmitry Timoshkov <dmitry(a)baikal.ru> --- modules/rostests/winetests/msi/custom.c | 52 ++++++++++++++++++++++++++++++++- 1 file changed, 51 insertions(+), 1 deletion(-) diff --git a/modules/rostests/winetests/msi/custom.c b/modules/rostests/winetests/msi/custom.c index 6332d68768a..1cf24536d04 100644 --- a/modules/rostests/winetests/msi/custom.c +++ b/modules/rostests/winetests/msi/custom.c @@ -30,6 +30,7 @@ #include <msxml.h> #include <msi.h> #include <msiquery.h> +#include <msidefs.h> static int todo_level, todo_do_loop; @@ -279,7 +280,9 @@ static void test_db(MSIHANDLE hinst) MSIHANDLE hdb, view, rec, rec2, suminfo; char buffer[10]; DWORD sz; - UINT r; + UINT r, count, type; + INT int_value; + FILETIME ft; hdb = MsiGetActiveDatabase(hinst); ok(hinst, hdb, "MsiGetActiveDatabase failed\n"); @@ -452,6 +455,53 @@ static void test_db(MSIHANDLE hinst) r = MsiGetSummaryInformationA(hdb, NULL, 1, &suminfo); ok(hinst, !r, "got %u\n", r); + r = MsiSummaryInfoGetPropertyCount(suminfo, NULL); +todo_wine + ok(hinst, r == RPC_X_NULL_REF_POINTER, "got %u\n", r); + + count = 0xdeadbeef; + r = MsiSummaryInfoGetPropertyCount(suminfo, &count); +todo_wine + ok(hinst, !r, "got %u\n", r); +todo_wine + ok(hinst, count == 5, "got %u\n", count); + + r = MsiSummaryInfoGetPropertyA(suminfo, 0, NULL, NULL, NULL, NULL, NULL); +todo_wine + ok(hinst, r == RPC_X_NULL_REF_POINTER, "got %u\n", r); + + type = 0xdeadbeef; + int_value = 0xdeadbeef; + strcpy(buffer, "deadbeef"); + sz = sizeof(buffer); + r = MsiSummaryInfoGetPropertyA(suminfo, PID_AUTHOR, &type, &int_value, &ft, buffer, &sz); +todo_wine + ok(hinst, !r, "got %u\n", r); +todo_wine + ok(hinst, type == 0, "got %u\n", type); +todo_wine + ok(hinst, int_value == 0, "got %u\n", int_value); + ok(hinst, sz == sizeof(buffer), "got %u\n", sz); + ok(hinst, !lstrcmpA(buffer, "deadbeef"), "got %s\n", buffer); + + type = 0xdeadbeef; + int_value = 0xdeadbeef; + strcpy(buffer, "deadbeef"); + sz = sizeof(buffer); + r = MsiSummaryInfoGetPropertyA(suminfo, PID_CODEPAGE, &type, &int_value, &ft, buffer, &sz); +todo_wine + ok(hinst, !r, "got %u\n", r); +todo_wine + ok(hinst, type == 0, "got %u\n", type); +todo_wine + ok(hinst, int_value == 0, "got %u\n", int_value); + ok(hinst, sz == sizeof(buffer), "got %u\n", sz); + ok(hinst, !lstrcmpA(buffer, "deadbeef"), "got %s\n", buffer); + + r = MsiSummaryInfoSetPropertyA(suminfo, PID_CODEPAGE, VT_I2, 1252, &ft, ""); +todo_wine + ok(hinst, r == ERROR_FUNCTION_FAILED, "got %u\n", r); + r = MsiCloseHandle(suminfo); ok(hinst, !r, "got %u\n", r);
2 years, 6 months
1
0
0
0
[reactos] 140/360: [WINESYNC] msi: Add exception handling around all custom action RPC calls.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=2a9ae858851c9af3153c9…
commit 2a9ae858851c9af3153c92abf15ed501221359ba Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sat Mar 12 23:54:40 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:28:00 2022 +0100 [WINESYNC] msi: Add exception handling around all custom action RPC calls. 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 baea371c3d4153bc4a718c07f46971d4d39aa9f3 by Zebediah Figura <z.figura12(a)gmail.com> --- dll/win32/msi/cond.y | 13 +++- dll/win32/msi/custom.c | 5 ++ dll/win32/msi/format.c | 21 ++++- dll/win32/msi/install.c | 195 +++++++++++++++++++++++++++++++++++++++++------ dll/win32/msi/msi.c | 12 ++- dll/win32/msi/msipriv.h | 1 + dll/win32/msi/msiquery.c | 92 +++++++++++++++++++--- dll/win32/msi/package.c | 57 ++++++++++++-- dll/win32/msi/suminfo.c | 12 ++- 9 files changed, 363 insertions(+), 45 deletions(-) diff --git a/dll/win32/msi/cond.y b/dll/win32/msi/cond.y index 780ca381f93..fccb61489be 100644 --- a/dll/win32/msi/cond.y +++ b/dll/win32/msi/cond.y @@ -39,6 +39,7 @@ #include "msipriv.h" #include "winemsi_s.h" #include "wine/debug.h" +#include "wine/exception.h" #include "wine/unicode.h" #include "wine/list.h" @@ -858,7 +859,17 @@ MSICONDITION WINAPI MsiEvaluateConditionW( MSIHANDLE hInstall, LPCWSTR szConditi if (!szCondition) return MSICONDITION_NONE; - return remote_EvaluateCondition(remote, szCondition); + __TRY + { + ret = remote_EvaluateCondition(remote, szCondition); + } + __EXCEPT(rpc_filter) + { + ret = GetExceptionCode(); + } + __ENDTRY + + return ret; } ret = MSI_EvaluateConditionW( package, szCondition ); diff --git a/dll/win32/msi/custom.c b/dll/win32/msi/custom.c index 78e846d9590..56801363238 100644 --- a/dll/win32/msi/custom.c +++ b/dll/win32/msi/custom.c @@ -77,6 +77,11 @@ void __RPC_USER MIDL_user_free(void __RPC_FAR * ptr) heap_free(ptr); } +LONG WINAPI rpc_filter(EXCEPTION_POINTERS *eptr) +{ + return I_RpcExceptionFilter(eptr->ExceptionRecord->ExceptionCode); +} + UINT msi_schedule_action( MSIPACKAGE *package, UINT script, const WCHAR *action ) { UINT count; diff --git a/dll/win32/msi/format.c b/dll/win32/msi/format.c index 06addd84741..deda22595f0 100644 --- a/dll/win32/msi/format.c +++ b/dll/win32/msi/format.c @@ -35,6 +35,7 @@ #include "msipriv.h" #include "winemsi_s.h" +#include "wine/exception.h" #include "wine/unicode.h" WINE_DEFAULT_DEBUG_CHANNEL(msi); @@ -919,7 +920,15 @@ UINT WINAPI MsiFormatRecordW( MSIHANDLE hInstall, MSIHANDLE hRecord, if ((remote = msi_get_remote(hInstall))) { - r = remote_FormatRecord(remote, (struct wire_record *)&record->count, &value); + __TRY + { + r = remote_FormatRecord(remote, (struct wire_record *)&record->count, &value); + } + __EXCEPT(rpc_filter) + { + r = GetExceptionCode(); + } + __ENDTRY if (!r) r = msi_strncpyW(value, -1, szResult, sz); @@ -968,7 +977,15 @@ UINT WINAPI MsiFormatRecordA(MSIHANDLE hinst, MSIHANDLE hrec, char *buf, DWORD * if ((remote = msi_get_remote(hinst))) { - r = remote_FormatRecord(remote, (struct wire_record *)&rec->count, &value); + __TRY + { + r = remote_FormatRecord(remote, (struct wire_record *)&rec->count, &value); + } + __EXCEPT(rpc_filter) + { + r = GetExceptionCode(); + } + __ENDTRY if (!r) r = msi_strncpyWtoA(value, -1, buf, sz, TRUE); diff --git a/dll/win32/msi/install.c b/dll/win32/msi/install.c index 5a149d74599..0afb6b29928 100644 --- a/dll/win32/msi/install.c +++ b/dll/win32/msi/install.c @@ -36,6 +36,7 @@ #include "winemsi_s.h" #include "wine/heap.h" #include "wine/debug.h" +#include "wine/exception.h" #include "wine/unicode.h" WINE_DEFAULT_DEBUG_CHANNEL(msi); @@ -80,7 +81,17 @@ UINT WINAPI MsiDoActionW( MSIHANDLE hInstall, LPCWSTR szAction ) if (!(remote = msi_get_remote(hInstall))) return ERROR_INVALID_HANDLE; - return remote_DoAction(remote, szAction); + __TRY + { + ret = remote_DoAction(remote, szAction); + } + __EXCEPT(rpc_filter) + { + ret = GetExceptionCode(); + } + __ENDTRY + + return ret; } ret = ACTION_PerformAction(package, szAction); @@ -129,7 +140,17 @@ UINT WINAPI MsiSequenceW( MSIHANDLE hInstall, LPCWSTR szTable, INT iSequenceMode if (!(remote = msi_get_remote(hInstall))) return ERROR_INVALID_HANDLE; - return remote_Sequence(remote, szTable, iSequenceMode); + __TRY + { + ret = remote_Sequence(remote, szTable, iSequenceMode); + } + __EXCEPT(rpc_filter) + { + ret = GetExceptionCode(); + } + __ENDTRY + + return ret; } ret = MSI_Sequence( package, szTable ); msiobj_release( &package->hdr ); @@ -257,7 +278,16 @@ UINT WINAPI MsiGetTargetPathA(MSIHANDLE hinst, const char *folder, char *buf, DW return ERROR_INVALID_HANDLE; } - r = remote_GetTargetPath(remote, folderW, &path); + __TRY + { + r = remote_GetTargetPath(remote, folderW, &path); + } + __EXCEPT(rpc_filter) + { + r = GetExceptionCode(); + } + __ENDTRY + if (!r) r = msi_strncpyWtoA(path, -1, buf, sz, TRUE); @@ -300,7 +330,16 @@ UINT WINAPI MsiGetTargetPathW(MSIHANDLE hinst, const WCHAR *folder, WCHAR *buf, if (!(remote = msi_get_remote(hinst))) return ERROR_INVALID_HANDLE; - r = remote_GetTargetPath(remote, folder, &path); + __TRY + { + r = remote_GetTargetPath(remote, folder, &path); + } + __EXCEPT(rpc_filter) + { + r = GetExceptionCode(); + } + __ENDTRY + if (!r) r = msi_strncpyW(path, -1, buf, sz); @@ -396,7 +435,16 @@ UINT WINAPI MsiGetSourcePathA(MSIHANDLE hinst, const char *folder, char *buf, DW return ERROR_INVALID_HANDLE; } - r = remote_GetSourcePath(remote, folderW, &path); + __TRY + { + r = remote_GetSourcePath(remote, folderW, &path); + } + __EXCEPT(rpc_filter) + { + r = GetExceptionCode(); + } + __ENDTRY + if (!r) r = msi_strncpyWtoA(path, -1, buf, sz, TRUE); @@ -439,7 +487,16 @@ UINT WINAPI MsiGetSourcePathW(MSIHANDLE hinst, const WCHAR *folder, WCHAR *buf, if (!(remote = msi_get_remote(hinst))) return ERROR_INVALID_HANDLE; - r = remote_GetSourcePath(remote, folder, &path); + __TRY + { + r = remote_GetSourcePath(remote, folder, &path); + } + __EXCEPT(rpc_filter) + { + r = GetExceptionCode(); + } + __ENDTRY + if (!r) r = msi_strncpyW(path, -1, buf, sz); @@ -560,7 +617,17 @@ UINT WINAPI MsiSetTargetPathW(MSIHANDLE hInstall, LPCWSTR szFolder, if (!(remote = msi_get_remote(hInstall))) return ERROR_INVALID_HANDLE; - return remote_SetTargetPath(remote, szFolder, szFolderPath); + __TRY + { + ret = remote_SetTargetPath(remote, szFolder, szFolderPath); + } + __EXCEPT(rpc_filter) + { + ret = GetExceptionCode(); + } + __ENDTRY + + return ret; } ret = MSI_SetTargetPathW( package, szFolder, szFolderPath ); @@ -616,7 +683,17 @@ BOOL WINAPI MsiGetMode(MSIHANDLE hInstall, MSIRUNMODE iRunMode) if (!(remote = msi_get_remote(hInstall))) return FALSE; - return remote_GetMode(remote, iRunMode); + __TRY + { + r = remote_GetMode(remote, iRunMode); + } + __EXCEPT(rpc_filter) + { + r = FALSE; + } + __ENDTRY + + return r; } switch (iRunMode) @@ -699,7 +776,17 @@ UINT WINAPI MsiSetMode(MSIHANDLE hInstall, MSIRUNMODE iRunMode, BOOL fState) if (!(remote = msi_get_remote(hInstall))) return FALSE; - return remote_SetMode(remote, iRunMode, fState); + __TRY + { + r = remote_SetMode(remote, iRunMode, fState); + } + __EXCEPT(rpc_filter) + { + r = GetExceptionCode(); + } + __ENDTRY + + return r; } switch (iRunMode) @@ -877,7 +964,17 @@ UINT WINAPI MsiSetFeatureStateW(MSIHANDLE hInstall, LPCWSTR szFeature, if (!(remote = msi_get_remote(hInstall))) return ERROR_INVALID_HANDLE; - return remote_SetFeatureState(remote, szFeature, iState); + __TRY + { + rc = remote_SetFeatureState(remote, szFeature, iState); + } + __EXCEPT(rpc_filter) + { + rc = GetExceptionCode(); + } + __ENDTRY + + return rc; } rc = MSI_SetFeatureStateW(package,szFeature,iState); @@ -1008,11 +1105,17 @@ UINT WINAPI MsiGetFeatureStateW(MSIHANDLE hInstall, LPCWSTR szFeature, if (!(remote = msi_get_remote(hInstall))) return ERROR_INVALID_HANDLE; - /* FIXME: should use SEH */ - if (!piInstalled || !piAction) - return RPC_X_NULL_REF_POINTER; + __TRY + { + ret = remote_GetFeatureState(remote, szFeature, piInstalled, piAction); + } + __EXCEPT(rpc_filter) + { + ret = GetExceptionCode(); + } + __ENDTRY - return remote_GetFeatureState(remote, szFeature, piInstalled, piAction); + return ret; } ret = MSI_GetFeatureStateW(package, szFeature, piInstalled, piAction); @@ -1123,11 +1226,17 @@ UINT WINAPI MsiGetFeatureCostW(MSIHANDLE hInstall, LPCWSTR szFeature, if (!(remote = msi_get_remote(hInstall))) return ERROR_INVALID_HANDLE; - /* FIXME: should use SEH */ - if (!piCost) - return RPC_X_NULL_REF_POINTER; + __TRY + { + ret = remote_GetFeatureCost(remote, szFeature, iCostTree, iState, piCost); + } + __EXCEPT(rpc_filter) + { + ret = GetExceptionCode(); + } + __ENDTRY - return remote_GetFeatureCost(remote, szFeature, iCostTree, iState, piCost); + return ret; } if (!piCost) @@ -1370,7 +1479,17 @@ UINT WINAPI MsiSetComponentStateW(MSIHANDLE hInstall, LPCWSTR szComponent, if (!(remote = msi_get_remote(hInstall))) return ERROR_INVALID_HANDLE; - return remote_SetComponentState(remote, szComponent, iState); + __TRY + { + ret = remote_SetComponentState(remote, szComponent, iState); + } + __EXCEPT(rpc_filter) + { + ret = GetExceptionCode(); + } + __ENDTRY + + return ret; } ret = MSI_SetComponentStateW(package, szComponent, iState); @@ -1401,11 +1520,17 @@ UINT WINAPI MsiGetComponentStateW(MSIHANDLE hInstall, LPCWSTR szComponent, if (!(remote = msi_get_remote(hInstall))) return ERROR_INVALID_HANDLE; - /* FIXME: should use SEH */ - if (!piInstalled || !piAction) - return RPC_X_NULL_REF_POINTER; + __TRY + { + ret = remote_GetComponentState(remote, szComponent, piInstalled, piAction); + } + __EXCEPT(rpc_filter) + { + ret = GetExceptionCode(); + } + __ENDTRY - return remote_GetComponentState(remote, szComponent, piInstalled, piAction); + return ret; } ret = MSI_GetComponentStateW( package, szComponent, piInstalled, piAction); @@ -1429,7 +1554,17 @@ LANGID WINAPI MsiGetLanguage(MSIHANDLE hInstall) if (!(remote = msi_get_remote(hInstall))) return ERROR_INVALID_HANDLE; - return remote_GetLanguage(remote); + __TRY + { + langid = remote_GetLanguage(remote); + } + __EXCEPT(rpc_filter) + { + langid = 0; + } + __ENDTRY + + return langid; } langid = msi_get_property_int( package->db, szProductLanguage, 0 ); @@ -1478,7 +1613,17 @@ UINT WINAPI MsiSetInstallLevel(MSIHANDLE hInstall, int iInstallLevel) if (!(remote = msi_get_remote(hInstall))) return ERROR_INVALID_HANDLE; - return remote_SetInstallLevel(remote, iInstallLevel); + __TRY + { + r = remote_SetInstallLevel(remote, iInstallLevel); + } + __EXCEPT(rpc_filter) + { + r = GetExceptionCode(); + } + __ENDTRY + + return r; } r = MSI_SetInstallLevel( package, iInstallLevel ); diff --git a/dll/win32/msi/msi.c b/dll/win32/msi/msi.c index db29625b255..7f3e394eeb2 100644 --- a/dll/win32/msi/msi.c +++ b/dll/win32/msi/msi.c @@ -47,6 +47,7 @@ #include "msxml2.h" #include "wine/debug.h" +#include "wine/exception.h" #include "wine/unicode.h" WINE_DEFAULT_DEBUG_CHANNEL(msi); @@ -2026,7 +2027,16 @@ UINT WINAPI MsiEnumComponentCostsW( MSIHANDLE handle, LPCWSTR component, DWORD i if (!(remote = msi_get_remote(handle))) return ERROR_INVALID_HANDLE; - r = remote_EnumComponentCosts(remote, component, index, state, buffer, cost, temp); + __TRY + { + r = remote_EnumComponentCosts(remote, component, index, state, buffer, cost, temp); + } + __EXCEPT(rpc_filter) + { + r = GetExceptionCode(); + } + __ENDTRY + if (r == ERROR_SUCCESS) { lstrcpynW(drive, buffer, *buflen); diff --git a/dll/win32/msi/msipriv.h b/dll/win32/msi/msipriv.h index d3dae5880da..b5f66339133 100644 --- a/dll/win32/msi/msipriv.h +++ b/dll/win32/msi/msipriv.h @@ -741,6 +741,7 @@ UINT msi_strcpy_to_awstring(const WCHAR *, int, awstring *, DWORD *) DECLSPEC_HI /* msi server interface */ extern MSIHANDLE msi_get_remote(MSIHANDLE handle) DECLSPEC_HIDDEN; +extern LONG WINAPI rpc_filter(EXCEPTION_POINTERS *eptr) DECLSPEC_HIDDEN; /* handle functions */ extern void *msihandle2msiinfo(MSIHANDLE handle, UINT type) DECLSPEC_HIDDEN; diff --git a/dll/win32/msi/msiquery.c b/dll/win32/msi/msiquery.c index 83ec59c45dc..5c686a37be0 100644 --- a/dll/win32/msi/msiquery.c +++ b/dll/win32/msi/msiquery.c @@ -26,6 +26,7 @@ #include "winbase.h" #include "winerror.h" #include "wine/debug.h" +#include "wine/exception.h" #include "wine/unicode.h" #include "msi.h" #include "msiquery.h" @@ -258,7 +259,16 @@ UINT WINAPI MsiDatabaseOpenViewW(MSIHANDLE hdb, if (!(remote = msi_get_remote(hdb))) return ERROR_INVALID_HANDLE; - ret = remote_DatabaseOpenView(remote, szQuery, &remote_view); + __TRY + { + ret = remote_DatabaseOpenView(remote, szQuery, &remote_view); + } + __EXCEPT(rpc_filter) + { + ret = GetExceptionCode(); + } + __ENDTRY + if (!ret) *phView = alloc_msi_remote_handle(remote_view); return ret; @@ -397,7 +407,16 @@ UINT WINAPI MsiViewFetch(MSIHANDLE hView, MSIHANDLE *record) if (!(remote = msi_get_remote(hView))) return ERROR_INVALID_HANDLE; - ret = remote_ViewFetch(remote, &wire_rec); + __TRY + { + ret = remote_ViewFetch(remote, &wire_rec); + } + __EXCEPT(rpc_filter) + { + ret = GetExceptionCode(); + } + __ENDTRY + if (!ret) { ret = unmarshal_record(wire_rec, record); @@ -447,7 +466,17 @@ UINT WINAPI MsiViewClose(MSIHANDLE hView) if (!(remote = msi_get_remote(hView))) return ERROR_INVALID_HANDLE; - return remote_ViewClose(remote); + __TRY + { + ret = remote_ViewClose(remote); + } + __EXCEPT(rpc_filter) + { + ret = GetExceptionCode(); + } + __ENDTRY + + return ret; } ret = MSI_ViewClose( query ); @@ -494,7 +523,15 @@ UINT WINAPI MsiViewExecute(MSIHANDLE hView, MSIHANDLE hRec) if (!(remote = msi_get_remote(hView))) return ERROR_INVALID_HANDLE; - ret = remote_ViewExecute(remote, rec ? (struct wire_record *)&rec->count : NULL); + __TRY + { + ret = remote_ViewExecute(remote, rec ? (struct wire_record *)&rec->count : NULL); + } + __EXCEPT(rpc_filter) + { + ret = GetExceptionCode(); + } + __ENDTRY if (rec) msiobj_release(&rec->hdr); @@ -611,7 +648,16 @@ UINT WINAPI MsiViewGetColumnInfo(MSIHANDLE hView, MSICOLINFO info, MSIHANDLE *hR if (!(remote = msi_get_remote(hView))) return ERROR_INVALID_HANDLE; - r = remote_ViewGetColumnInfo(remote, info, &wire_rec); + __TRY + { + r = remote_ViewGetColumnInfo(remote, info, &wire_rec); + } + __EXCEPT(rpc_filter) + { + r = GetExceptionCode(); + } + __ENDTRY + if (!r) { r = unmarshal_record(wire_rec, hRec); @@ -680,8 +726,17 @@ UINT WINAPI MsiViewModify( MSIHANDLE hView, MSIMODIFY eModifyMode, if (!(remote = msi_get_remote(hView))) return ERROR_INVALID_HANDLE; - r = remote_ViewModify(remote, eModifyMode, - (struct wire_record *)&rec->count, &wire_refreshed); + __TRY + { + r = remote_ViewModify(remote, eModifyMode, + (struct wire_record *)&rec->count, &wire_refreshed); + } + __EXCEPT(rpc_filter) + { + r = GetExceptionCode(); + } + __ENDTRY + if (!r && (eModifyMode == MSIMODIFY_REFRESH || eModifyMode == MSIMODIFY_SEEK)) { r = copy_remote_record(wire_refreshed, hRecord); @@ -1004,7 +1059,16 @@ UINT WINAPI MsiDatabaseGetPrimaryKeysW( MSIHANDLE hdb, if (!(remote = msi_get_remote(hdb))) return ERROR_INVALID_HANDLE; - r = remote_DatabaseGetPrimaryKeys(remote, table, &wire_rec); + __TRY + { + r = remote_DatabaseGetPrimaryKeys(remote, table, &wire_rec); + } + __EXCEPT(rpc_filter) + { + r = GetExceptionCode(); + } + __ENDTRY + if (!r) { r = unmarshal_record(wire_rec, phRec); @@ -1083,7 +1147,17 @@ MSICONDITION WINAPI MsiDatabaseIsTablePersistentW( if (!(remote = msi_get_remote(hDatabase))) return MSICONDITION_ERROR; - return remote_DatabaseIsTablePersistent(remote, szTableName); + __TRY + { + r = remote_DatabaseIsTablePersistent(remote, szTableName); + } + __EXCEPT(rpc_filter) + { + r = MSICONDITION_ERROR; + } + __ENDTRY + + return r; } r = MSI_DatabaseIsTablePersistent( db, szTableName ); diff --git a/dll/win32/msi/package.c b/dll/win32/msi/package.c index fa0831bc2de..e59bf93ebe0 100644 --- a/dll/win32/msi/package.c +++ b/dll/win32/msi/package.c @@ -44,6 +44,7 @@ #include "wine/heap.h" #include "wine/debug.h" +#include "wine/exception.h" #include "wine/unicode.h" #include "msipriv.h" @@ -1746,8 +1747,16 @@ MSIHANDLE WINAPI MsiGetActiveDatabase(MSIHANDLE hInstall) } else if ((remote = msi_get_remote(hInstall))) { - handle = remote_GetActiveDatabase(remote); - handle = alloc_msi_remote_handle(handle); + __TRY + { + handle = remote_GetActiveDatabase(hInstall); + handle = alloc_msi_remote_handle(handle); + } + __EXCEPT(rpc_filter) + { + handle = 0; + } + __ENDTRY } return handle; @@ -2107,7 +2116,15 @@ INT WINAPI MsiProcessMessage( MSIHANDLE hInstall, INSTALLMESSAGE eMessageType, if (!(remote = msi_get_remote(hInstall))) return ERROR_INVALID_HANDLE; - ret = remote_ProcessMessage(remote, eMessageType, (struct wire_record *)&record->count); + __TRY + { + ret = remote_ProcessMessage(remote, eMessageType, (struct wire_record *)&record->count); + } + __EXCEPT(rpc_filter) + { + ret = GetExceptionCode(); + } + __ENDTRY msiobj_release(&record->hdr); return ret; @@ -2237,7 +2254,17 @@ UINT WINAPI MsiSetPropertyW( MSIHANDLE hInstall, LPCWSTR szName, LPCWSTR szValue if (!(remote = msi_get_remote(hInstall))) return ERROR_INVALID_HANDLE; - return remote_SetProperty(remote, szName, szValue); + __TRY + { + ret = remote_SetProperty(remote, szName, szValue); + } + __EXCEPT(rpc_filter) + { + ret = GetExceptionCode(); + } + __ENDTRY + + return ret; } ret = msi_set_property( package->db, szName, szValue, -1 ); @@ -2414,7 +2441,16 @@ UINT WINAPI MsiGetPropertyA(MSIHANDLE hinst, const char *name, char *buf, DWORD return ERROR_INVALID_HANDLE; } - r = remote_GetProperty(remote, nameW, &value, &len); + __TRY + { + r = remote_GetProperty(remote, nameW, &value, &len); + } + __EXCEPT(rpc_filter) + { + r = GetExceptionCode(); + } + __ENDTRY + heap_free(nameW); if (!r) @@ -2470,7 +2506,16 @@ UINT WINAPI MsiGetPropertyW(MSIHANDLE hinst, const WCHAR *name, WCHAR *buf, DWOR if (!(remote = msi_get_remote(hinst))) return ERROR_INVALID_HANDLE; - r = remote_GetProperty(remote, name, &value, &len); + __TRY + { + r = remote_GetProperty(remote, name, &value, &len); + } + __EXCEPT(rpc_filter) + { + r = GetExceptionCode(); + } + __ENDTRY + if (!r) { /* String might contain embedded nulls. diff --git a/dll/win32/msi/suminfo.c b/dll/win32/msi/suminfo.c index f9bdf38edf3..3295a6a5e7d 100644 --- a/dll/win32/msi/suminfo.c +++ b/dll/win32/msi/suminfo.c @@ -30,6 +30,7 @@ #include "winnls.h" #include "shlwapi.h" #include "wine/debug.h" +#include "wine/exception.h" #include "wine/unicode.h" #include "msi.h" #include "msiquery.h" @@ -543,7 +544,16 @@ UINT WINAPI MsiGetSummaryInformationW( MSIHANDLE hDatabase, if (!(remote = msi_get_remote(hDatabase))) return ERROR_INVALID_HANDLE; - ret = remote_DatabaseGetSummaryInformation(remote, uiUpdateCount, &remote_suminfo); + __TRY + { + ret = remote_DatabaseGetSummaryInformation(remote, uiUpdateCount, &remote_suminfo); + } + __EXCEPT(rpc_filter) + { + ret = GetExceptionCode(); + } + __ENDTRY + if (!ret) *pHandle = alloc_msi_remote_handle(remote_suminfo);
2 years, 6 months
1
0
0
0
[reactos] 139/360: [WINESYNC] msi: Skip publishing a local assembly with no corresponding file.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=9af3c0ad3e75b7fce337b…
commit 9af3c0ad3e75b7fce337b3ef839700b66403b333 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sat Mar 12 23:54:38 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:28:00 2022 +0100 [WINESYNC] msi: Skip publishing a local assembly with no corresponding file. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=45735
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 12195e450fea6885eb2d3be05a8ed92dd93752c9 by Zebediah Figura <z.figura12(a)gmail.com> --- dll/win32/msi/assembly.c | 10 ++++++++++ modules/rostests/winetests/msi/action.c | 29 +++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) diff --git a/dll/win32/msi/assembly.c b/dll/win32/msi/assembly.c index e3bd9651507..7857e8b687f 100644 --- a/dll/win32/msi/assembly.c +++ b/dll/win32/msi/assembly.c @@ -687,6 +687,11 @@ UINT ACTION_MsiPublishAssemblies( MSIPACKAGE *package ) if (assembly->application) { MSIFILE *file = msi_get_loaded_file( package, assembly->application ); + if (!file) + { + WARN("no matching file %s for local assembly\n", debugstr_w(assembly->application)); + continue; + } if ((res = open_local_assembly_key( package->Context, win32, file->TargetPath, &hkey ))) { WARN("failed to open local assembly key %d\n", res); @@ -744,6 +749,11 @@ UINT ACTION_MsiUnpublishAssemblies( MSIPACKAGE *package ) if (assembly->application) { MSIFILE *file = msi_get_loaded_file( package, assembly->application ); + if (!file) + { + WARN("no matching file %s for local assembly\n", debugstr_w(assembly->application)); + continue; + } if ((res = delete_local_assembly_key( package->Context, win32, file->TargetPath ))) WARN("failed to delete local assembly key %d\n", res); } diff --git a/modules/rostests/winetests/msi/action.c b/modules/rostests/winetests/msi/action.c index 642a488cf10..59a369d31fe 100644 --- a/modules/rostests/winetests/msi/action.c +++ b/modules/rostests/winetests/msi/action.c @@ -1785,6 +1785,7 @@ static const char pa_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n" "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n" "File\tFile\n" + "fake_local.txt\tfake_local\tfake_local.txt\t1000\t\t\t8192\t1\n" "win32.txt\twin32\twin32.txt\t1000\t\t\t8192\t1\n" "manifest.txt\twin32\tmanifest.txt\t1000\t\t\t8192\t1\n" "win32_local.txt\twin32_local\twin32_local.txt\t1000\t\t\t8192\t1\n" @@ -1804,6 +1805,7 @@ static const char pa_feature_comp_dat[] = "Feature_\tComponent_\n" "s38\ts72\n" "FeatureComponents\tFeature_\tComponent_\n" + "assembly\tfake_local\n" "assembly\twin32\n" "assembly\twin32_local\n" "assembly\tdotnet\n" @@ -1813,6 +1815,7 @@ static const char pa_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n" "s72\tS38\ts72\ti2\tS255\tS72\n" "Component\tComponent\n" + "fake_local\t{F515549D-7E61-425D-AAC1-9BEF2E066D06}\tMSITESTDIR\t0\t\tfake_local.txt\n" "win32\t{F515549E-7E61-425D-AAC1-9BEF2E066D06}\tMSITESTDIR\t0\t\twin32.txt\n" "win32_local\t{D34D3FBA-6789-4E57-AD1A-1281297DC201}\tMSITESTDIR\t0\t\twin32_local.txt\n" "dotnet\t{8943164F-2B31-4C09-A894-493A8CBDE0A4}\tMSITESTDIR\t0\t\tdotnet.txt\n" @@ -1822,6 +1825,7 @@ static const char pa_msi_assembly_dat[] = "Component_\tFeature_\tFile_Manifest\tFile_Application\tAttributes\n" "s72\ts38\tS72\tS72\tI2\n" "MsiAssembly\tComponent_\n" + "fake_local\tassembly\t\tnonexistent.txt\t0\n" "win32\tassembly\tmanifest.txt\t\t1\n" "win32_local\tassembly\tmanifest_local.txt\tapplication_win32.txt\t1\n" "dotnet\tassembly\t\t\t0\n" @@ -1831,6 +1835,11 @@ static const char pa_msi_assembly_name_dat[] = "Component_\tName\tValue\n" "s72\ts255\ts255\n" "MsiAssemblyName\tComponent_\tName\n" + "fake_local\tName\tWine.Fake.Application.Assembly\n" + "fake_local\tprocessorArchitecture\tx86\n" + "fake_local\tpublicKeyToken\tabcdef0123456789\n" + "fake_local\ttype\twin32\n" + "fake_local\tversion\t1.0.0.0\n" "win32\tName\tWine.Win32.Assembly\n" "win32\tprocessorArchitecture\tx86\n" "win32\tpublicKeyToken\tabcdef0123456789\n" @@ -6134,6 +6143,10 @@ static void test_publish_assemblies(void) "Installer\\Assemblies\\C:|Program Files|msitest|application_dotnet.txt"; static const char classes_path_dotnet_local_wow64[] = "Installer\\Assemblies\\C:|Program Files (x86)|msitest|application_dotnet.txt"; + static const char classes_path_fake_local[] = + "Installer\\Assemblies\\C:|Program Files|msitest|nonexistent.txt"; + static const char classes_path_fake_local_wow64[] = + "Installer\\Assemblies\\C:|Program Files (x86)|msitest|nonexistent.txt"; static const char classes_path_win32[] = "Installer\\Win32Assemblies\\Global"; static const char classes_path_win32_local[] = @@ -6146,6 +6159,10 @@ static void test_publish_assemblies(void) "Software\\Microsoft\\Installer\\Assemblies\\C:|Program Files|msitest|application_dotnet.txt"; static const char path_dotnet_local_wow64[] = "Software\\Microsoft\\Installer\\Assemblies\\C:|Program Files (x86)|msitest|application_dotnet.txt"; + static const char path_fake_local[] = + "Software\\Microsoft\\Installer\\Assemblies\\C:|Program Files|msitest|nonexistent.txt"; + static const char path_fake_local_wow64[] = + "Software\\Microsoft\\Installer\\Assemblies\\C:|Program Files (x86)|msitest|nonexistent.txt"; static const char path_win32[] = "Software\\Microsoft\\Installer\\Win32Assemblies\\Global"; static const char path_win32_local[] = @@ -6185,6 +6202,7 @@ static void test_publish_assemblies(void) create_file_data("msitest\\manifest_local.txt", manifest_local, 0); create_file("msitest\\application_win32.txt", 1000); create_file("msitest\\application_dotnet.txt", 1000); + create_file("msitest\\fake_local.txt", 1000); create_database(msifile, pa_tables, ARRAY_SIZE(pa_tables)); MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL); @@ -6219,6 +6237,11 @@ static void test_publish_assemblies(void) CHECK_REG_STR(hkey, name_win32_local, "rcHQPHq?CA@Uv-XqMI1e>C)Uvlj*53A)u(QQ9=)X!"); RegCloseKey(hkey); + /* No registration is done for a local assembly with no matching file */ + path = (is_wow64 || is_64bit) ? path_fake_local_wow64 : path_fake_local; + res = RegOpenKeyA(HKEY_CURRENT_USER, path, &hkey); + ok(res == ERROR_FILE_NOT_FOUND, "got %u\n", res); + r = MsiInstallProductA(msifile, "REMOVE=ALL"); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); @@ -6278,6 +6301,11 @@ static void test_publish_assemblies(void) CHECK_REG_STR(hkey, name_win32_local, "rcHQPHq?CA@Uv-XqMI1e>C)Uvlj*53A)u(QQ9=)X!"); RegCloseKey(hkey); + /* No registration is done for a local assembly with no matching file */ + path = (is_wow64 || is_64bit) ? classes_path_fake_local_wow64 : classes_path_fake_local; + res = RegOpenKeyExA(HKEY_CLASSES_ROOT, path, 0, access, &hkey); + ok(res == ERROR_FILE_NOT_FOUND, "got %u\n", res); + r = MsiInstallProductA(msifile, "REMOVE=ALL ALLUSERS=1"); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); @@ -6314,6 +6342,7 @@ done: DeleteFileA("msitest\\manifest_local.txt"); DeleteFileA("msitest\\application_win32.txt"); DeleteFileA("msitest\\application_dotnet.txt"); + DeleteFileA("msitest\\fake_local.txt"); delete_test_files(); DeleteFileA(msifile); }
2 years, 6 months
1
0
0
0
[reactos] 138/360: [WINESYNC] msi/tests: Remove some workarounds in test_publish_assemblies().
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=3671579f96943959d048d…
commit 3671579f96943959d048daa99a365107f707f9f9 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sat Mar 12 23:54:38 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:28:00 2022 +0100 [WINESYNC] msi/tests: Remove some workarounds in test_publish_assemblies(). 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 9a96657910c2ce30f6f8492bdd562932d63ba430 by Zebediah Figura <z.figura12(a)gmail.com> --- modules/rostests/winetests/msi/action.c | 29 ++++++++--------------------- 1 file changed, 8 insertions(+), 21 deletions(-) diff --git a/modules/rostests/winetests/msi/action.c b/modules/rostests/winetests/msi/action.c index 432ae0dc8ae..642a488cf10 100644 --- a/modules/rostests/winetests/msi/action.c +++ b/modules/rostests/winetests/msi/action.c @@ -6195,11 +6195,6 @@ static void test_publish_assemblies(void) skip("Not enough rights to perform tests\n"); goto done; } - if (r == ERROR_INSTALL_FAILURE) - { - skip("No support for installing side-by-side assemblies\n"); - goto done; - } ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); res = RegOpenKeyA(HKEY_CURRENT_USER, path_dotnet, &hkey); @@ -6214,23 +6209,20 @@ static void test_publish_assemblies(void) RegCloseKey(hkey); res = RegOpenKeyA(HKEY_CURRENT_USER, path_win32, &hkey); - ok(res == ERROR_SUCCESS || res == ERROR_FILE_NOT_FOUND /* win2k without sxs support */, - "Expected ERROR_SUCCESS, got %d\n", res); - if (res == ERROR_SUCCESS) CHECK_REG_STR(hkey, name_win32, "rcHQPHq?CA@Uv-XqMI1e>}NJjwR'%D9v1p!v{WV(%"); + ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); + CHECK_REG_STR(hkey, name_win32, "rcHQPHq?CA@Uv-XqMI1e>}NJjwR'%D9v1p!v{WV(%"); RegCloseKey(hkey); path = (is_wow64 || is_64bit) ? path_win32_local_wow64 : path_win32_local; res = RegOpenKeyA(HKEY_CURRENT_USER, path, &hkey); - ok(res == ERROR_SUCCESS || res == ERROR_FILE_NOT_FOUND /* win2k without sxs support */, - "Expected ERROR_SUCCESS, got %d\n", res); - if (res == ERROR_SUCCESS) CHECK_REG_STR(hkey, name_win32_local, "rcHQPHq?CA@Uv-XqMI1e>C)Uvlj*53A)u(QQ9=)X!"); + ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); + CHECK_REG_STR(hkey, name_win32_local, "rcHQPHq?CA@Uv-XqMI1e>C)Uvlj*53A)u(QQ9=)X!"); RegCloseKey(hkey); r = MsiInstallProductA(msifile, "REMOVE=ALL"); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); res = RegOpenKeyA(HKEY_CURRENT_USER, path_dotnet, &hkey); - ok(res == ERROR_SUCCESS || res == ERROR_FILE_NOT_FOUND, "got %d\n", res); if (res == ERROR_SUCCESS) { res = RegDeleteValueA(hkey, name_dotnet); @@ -6243,7 +6235,6 @@ static void test_publish_assemblies(void) ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res); res = RegOpenKeyA(HKEY_CURRENT_USER, path_win32, &hkey); - ok(res == ERROR_SUCCESS || res == ERROR_FILE_NOT_FOUND, "got %d\n", res); if (res == ERROR_SUCCESS) { res = RegDeleteValueA(hkey, name_win32); @@ -6277,23 +6268,20 @@ static void test_publish_assemblies(void) RegCloseKey(hkey); res = RegOpenKeyExA(HKEY_CLASSES_ROOT, classes_path_win32, 0, access, &hkey); - ok(res == ERROR_SUCCESS || res == ERROR_FILE_NOT_FOUND /* win2k without sxs support */, - "Expected ERROR_SUCCESS, got %d\n", res); - if (res == ERROR_SUCCESS) CHECK_REG_STR(hkey, name_win32, "rcHQPHq?CA@Uv-XqMI1e>}NJjwR'%D9v1p!v{WV(%"); + ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); + CHECK_REG_STR(hkey, name_win32, "rcHQPHq?CA@Uv-XqMI1e>}NJjwR'%D9v1p!v{WV(%"); RegCloseKey(hkey); path = (is_wow64 || is_64bit) ? classes_path_win32_local_wow64 : classes_path_win32_local; res = RegOpenKeyExA(HKEY_CLASSES_ROOT, path, 0, access, &hkey); - ok(res == ERROR_SUCCESS || res == ERROR_FILE_NOT_FOUND /* win2k without sxs support */, - "Expected ERROR_SUCCESS, got %d\n", res); - if (res == ERROR_SUCCESS) CHECK_REG_STR(hkey, name_win32_local, "rcHQPHq?CA@Uv-XqMI1e>C)Uvlj*53A)u(QQ9=)X!"); + ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); + CHECK_REG_STR(hkey, name_win32_local, "rcHQPHq?CA@Uv-XqMI1e>C)Uvlj*53A)u(QQ9=)X!"); RegCloseKey(hkey); r = MsiInstallProductA(msifile, "REMOVE=ALL ALLUSERS=1"); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); res = RegOpenKeyA(HKEY_CLASSES_ROOT, classes_path_dotnet, &hkey); - ok(res == ERROR_SUCCESS || res == ERROR_FILE_NOT_FOUND, "got %d\n", res); if (res == ERROR_SUCCESS) { res = RegDeleteValueA(hkey, name_dotnet); @@ -6306,7 +6294,6 @@ static void test_publish_assemblies(void) ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res); res = RegOpenKeyA(HKEY_CLASSES_ROOT, classes_path_win32, &hkey); - ok(res == ERROR_SUCCESS || res == ERROR_FILE_NOT_FOUND, "got %d\n", res); if (res == ERROR_SUCCESS) { res = RegDeleteValueA(hkey, name_win32);
2 years, 6 months
1
0
0
0
[reactos] 137/360: [WINESYNC] msi: Use the ARRAY_SIZE() macro.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=9792c08fe4822bd1f95bd…
commit 9792c08fe4822bd1f95bda0f57946acc3feaa475 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sat Mar 12 23:54:36 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:28:00 2022 +0100 [WINESYNC] msi: 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 a9cb67bb7ffb5b25469ba6a732f8913ac8778c36 by Michael Stefaniuc <mstefani(a)winehq.org> --- dll/win32/msi/action.c | 12 ++++++------ dll/win32/msi/appsearch.c | 3 +-- dll/win32/msi/assembly.c | 2 +- dll/win32/msi/automation.c | 2 +- dll/win32/msi/custom.c | 8 ++++---- dll/win32/msi/database.c | 2 +- dll/win32/msi/dialog.c | 2 +- dll/win32/msi/msi.c | 4 ++-- dll/win32/msi/package.c | 2 +- dll/win32/msi/patch.c | 2 +- dll/win32/msi/registry.c | 38 +++++++++++++++++++------------------- dll/win32/msi/source.c | 2 +- dll/win32/msi/upgrade.c | 2 +- 13 files changed, 40 insertions(+), 41 deletions(-) diff --git a/dll/win32/msi/action.c b/dll/win32/msi/action.c index ac925417866..1ef6da8562b 100644 --- a/dll/win32/msi/action.c +++ b/dll/win32/msi/action.c @@ -2159,7 +2159,7 @@ static WCHAR *create_temp_dir( MSIDATABASE *db ) if (!db->tempfolder) { WCHAR tmp[MAX_PATH]; - UINT len = sizeof(tmp)/sizeof(tmp[0]); + UINT len = ARRAY_SIZE( tmp ); if (msi_get_property( db, szTempFolder, tmp, &len ) || GetFileAttributesW( tmp ) != FILE_ATTRIBUTE_DIRECTORY) @@ -5560,9 +5560,9 @@ UINT ACTION_ForceReboot(MSIPACKAGE *package) squash_guid( package->ProductCode, squashed_pc ); - GetSystemDirectoryW(sysdir, sizeof(sysdir)/sizeof(sysdir[0])); + GetSystemDirectoryW(sysdir, ARRAY_SIZE(sysdir)); RegCreateKeyW(HKEY_LOCAL_MACHINE,RunOnce,&hkey); - snprintfW( buffer, sizeof(buffer)/sizeof(buffer[0]), msiexec_fmt, sysdir, squashed_pc ); + snprintfW(buffer, ARRAY_SIZE(buffer), msiexec_fmt, sysdir, squashed_pc); msi_reg_set_val_str( hkey, squashed_pc, buffer ); RegCloseKey(hkey); @@ -6228,7 +6228,7 @@ static LPCWSTR *msi_service_args_to_vector(LPWSTR args, DWORD *numargs) static const WCHAR separator[] = {'[','~',']',0}; *numargs = 0; - sep_len = sizeof(separator) / sizeof(WCHAR) - 1; + sep_len = ARRAY_SIZE(separator) - 1; if (!args) return NULL; @@ -7704,7 +7704,7 @@ static UINT ITERATE_RemoveExistingProducts( MSIRECORD *rec, LPVOID param ) MSIPACKAGE *package = param; const WCHAR *property = MSI_RecordGetString( rec, 7 ); int attrs = MSI_RecordGetInteger( rec, 5 ); - UINT len = sizeof(fmtW)/sizeof(fmtW[0]); + UINT len = ARRAY_SIZE( fmtW ); WCHAR *product, *features, *cmd; STARTUPINFOW si; PROCESS_INFORMATION info; @@ -7719,7 +7719,7 @@ static UINT ITERATE_RemoveExistingProducts( MSIRECORD *rec, LPVOID param ) if (features) len += strlenW( features ); else - len += sizeof(szAll) / sizeof(szAll[0]); + len += ARRAY_SIZE( szAll ); if (!(cmd = msi_alloc( len * sizeof(WCHAR) ))) { diff --git a/dll/win32/msi/appsearch.c b/dll/win32/msi/appsearch.c index 693da18355c..fbed073bd4a 100644 --- a/dll/win32/msi/appsearch.c +++ b/dll/win32/msi/appsearch.c @@ -949,8 +949,7 @@ static UINT ACTION_SearchDirectory(MSIPACKAGE *package, MSISIGNATURE *sig, if (GetDriveTypeW(pathWithDrive) != DRIVE_FIXED) continue; - lstrcpynW(pathWithDrive + 3, path, - sizeof(pathWithDrive) / sizeof(pathWithDrive[0]) - 3); + lstrcpynW(pathWithDrive + 3, path, ARRAY_SIZE(pathWithDrive) - 3); if (sig->File) rc = ACTION_RecurseSearchDirectory(package, &val, sig, diff --git a/dll/win32/msi/assembly.c b/dll/win32/msi/assembly.c index 59fd332d253..e3bd9651507 100644 --- a/dll/win32/msi/assembly.c +++ b/dll/win32/msi/assembly.c @@ -344,7 +344,7 @@ static const WCHAR *clr_version[] = static const WCHAR *get_clr_version_str( enum clr_version version ) { - if (version >= sizeof(clr_version)/sizeof(clr_version[0])) return clr_version_unknown; + if (version >= ARRAY_SIZE( clr_version )) return clr_version_unknown; return clr_version[version]; } diff --git a/dll/win32/msi/automation.c b/dll/win32/msi/automation.c index 06ad2f90a4b..80254e6df45 100644 --- a/dll/win32/msi/automation.c +++ b/dll/win32/msi/automation.c @@ -130,7 +130,7 @@ void release_typelib(void) { unsigned i; - for (i = 0; i < sizeof(typeinfos)/sizeof(*typeinfos); i++) + for (i = 0; i < ARRAY_SIZE(typeinfos); i++) if (typeinfos[i]) ITypeInfo_Release(typeinfos[i]); diff --git a/dll/win32/msi/custom.c b/dll/win32/msi/custom.c index 0107cd941ed..78e846d9590 100644 --- a/dll/win32/msi/custom.c +++ b/dll/win32/msi/custom.c @@ -214,7 +214,7 @@ WCHAR *msi_create_temp_file( MSIDATABASE *db ) if (!db->tempfolder) { WCHAR tmp[MAX_PATH]; - UINT len = sizeof(tmp)/sizeof(tmp[0]); + UINT len = ARRAY_SIZE( tmp ); if (msi_get_property( db, szTempFolder, tmp, &len ) || GetFileAttributesW( tmp ) != FILE_ATTRIBUTE_DIRECTORY) @@ -620,9 +620,9 @@ static DWORD custom_start_server(MSIPACKAGE *package, DWORD arch) wow64 = FALSE; if ((sizeof(void *) == 8 || wow64) && arch == SCS_32BIT_BINARY) - GetSystemWow64DirectoryW(path, MAX_PATH - sizeof(msiexecW)/sizeof(WCHAR)); + GetSystemWow64DirectoryW(path, MAX_PATH - ARRAY_SIZE(msiexecW)); else - GetSystemDirectoryW(path, MAX_PATH - sizeof(msiexecW)/sizeof(WCHAR)); + GetSystemDirectoryW(path, MAX_PATH - ARRAY_SIZE(msiexecW)); strcatW(path, msiexecW); sprintfW(cmdline, argsW, path, GetCurrentProcessId()); @@ -958,7 +958,7 @@ static UINT HANDLE_CustomType23( MSIPACKAGE *package, const WCHAR *source, const static const WCHAR msiexecW[] = {'m','s','i','e','x','e','c',0}; static const WCHAR paramsW[] = {'/','q','b',' ','/','i',' '}; WCHAR *dir, *arg, *p; - UINT len_src, len_dir, len_tgt, len = sizeof(paramsW)/sizeof(paramsW[0]); + UINT len_src, len_dir, len_tgt, len = ARRAY_SIZE( paramsW ); HANDLE handle; if (!(dir = msi_dup_property( package->db, szOriginalDatabase ))) return ERROR_OUTOFMEMORY; diff --git a/dll/win32/msi/database.c b/dll/win32/msi/database.c index 303667d52b8..91e5e96832b 100644 --- a/dll/win32/msi/database.c +++ b/dll/win32/msi/database.c @@ -458,7 +458,7 @@ static LPWSTR msi_build_createsql_prelude(LPWSTR table) static const WCHAR create_fmt[] = {'C','R','E','A','T','E',' ','T','A','B','L','E',' ','`','%','s','`',' ','(',' ',0}; - size = sizeof(create_fmt)/sizeof(create_fmt[0]) + lstrlenW(table) - 2; + size = ARRAY_SIZE(create_fmt) + lstrlenW(table) - 2; prelude = msi_alloc(size * sizeof(WCHAR)); if (!prelude) return NULL; diff --git a/dll/win32/msi/dialog.c b/dll/win32/msi/dialog.c index f0222de0a66..860b80e4073 100644 --- a/dll/win32/msi/dialog.c +++ b/dll/win32/msi/dialog.c @@ -3384,7 +3384,7 @@ static UINT msi_dialog_hyperlink_handler( msi_dialog *dialog, msi_control *contr { static const WCHAR hrefW[] = {'h','r','e','f'}; static const WCHAR openW[] = {'o','p','e','n',0}; - int len, len_href = sizeof(hrefW) / sizeof(hrefW[0]); + int len, len_href = ARRAY_SIZE( hrefW ); const WCHAR *p, *q; WCHAR quote = 0; LITEM item; diff --git a/dll/win32/msi/msi.c b/dll/win32/msi/msi.c index 1043452388c..db29625b255 100644 --- a/dll/win32/msi/msi.c +++ b/dll/win32/msi/msi.c @@ -1028,7 +1028,7 @@ UINT WINAPI MsiGetProductCodeW(LPCWSTR szComponent, LPWSTR szBuffer) UINT rc, index; HKEY compkey, prodkey; WCHAR squashed_comp[SQUASHED_GUID_SIZE], squashed_prod[SQUASHED_GUID_SIZE]; - DWORD sz = sizeof(squashed_prod)/sizeof(squashed_prod[0]); + DWORD sz = ARRAY_SIZE(squashed_prod); TRACE("%s %p\n", debugstr_w(szComponent), szBuffer); @@ -3482,7 +3482,7 @@ static UINT MSI_ProvideQualifiedComponentEx(LPCWSTR szComponent, return ERROR_FILE_NOT_FOUND; } msi_free( components ); - StringFromGUID2( &guid, comp, sizeof(comp)/sizeof(comp[0]) ); + StringFromGUID2( &guid, comp, ARRAY_SIZE( comp )); } state = MSI_GetComponentPath( szProduct, comp, szAllSid, MSIINSTALLCONTEXT_ALL, lpPathBuf, pcchPathBuf ); diff --git a/dll/win32/msi/package.c b/dll/win32/msi/package.c index 577fcbbf185..fa0831bc2de 100644 --- a/dll/win32/msi/package.c +++ b/dll/win32/msi/package.c @@ -559,7 +559,7 @@ static LPWSTR get_fusion_filename(MSIPACKAGE *package) if (!RegCreateKeyExW(netsetup, v4client, 0, NULL, 0, KEY_QUERY_VALUE, NULL, &hkey, NULL)) { - size = sizeof(path)/sizeof(path[0]); + size = ARRAY_SIZE(path); if (!RegQueryValueExW(hkey, installpath, NULL, &type, (BYTE *)path, &size)) { len = strlenW(path) + strlenW(fusion) + 2; diff --git a/dll/win32/msi/patch.c b/dll/win32/msi/patch.c index f6ed3c1f1a4..bd9b7b87df4 100644 --- a/dll/win32/msi/patch.c +++ b/dll/win32/msi/patch.c @@ -1037,7 +1037,7 @@ UINT msi_apply_registered_patch( MSIPACKAGE *package, LPCWSTR patch_code ) TRACE("%p, %s\n", package, debugstr_w(patch_code)); - len = sizeof(patch_file) / sizeof(WCHAR); + len = ARRAY_SIZE( patch_file ); r = MsiGetPatchInfoExW( patch_code, package->ProductCode, NULL, package->Context, INSTALLPROPERTY_LOCALPACKAGEW, patch_file, &len ); if (r != ERROR_SUCCESS) diff --git a/dll/win32/msi/registry.c b/dll/win32/msi/registry.c index cbc8d8d6f0a..efc72725ce7 100644 --- a/dll/win32/msi/registry.c +++ b/dll/win32/msi/registry.c @@ -1297,12 +1297,12 @@ static UINT fetch_machine_component( DWORD ctx, DWORD index, DWORD *idx, WCHAR g if (RegOpenKeyExW( HKEY_LOCAL_MACHINE, componentsW, 0, access, &key_components )) return ERROR_NO_MORE_ITEMS; - len_component = sizeof(component)/sizeof(component[0]); + len_component = ARRAY_SIZE( component ); while (!RegEnumKeyExW( key_components, i, component, &len_component, NULL, NULL, NULL, NULL )) { if (*idx == index) goto found; (*idx)++; - len_component = sizeof(component)/sizeof(component[0]); + len_component = ARRAY_SIZE( component ); i++; } RegCloseKey( key_components ); @@ -1349,14 +1349,14 @@ static UINT fetch_user_component( const WCHAR *usersid, DWORD ctx, DWORD index, if (RegOpenKeyExW( HKEY_LOCAL_MACHINE, userdataW, 0, access, &key_users )) return ERROR_NO_MORE_ITEMS; - len_user = sizeof(user)/sizeof(user[0]); + len_user = ARRAY_SIZE( user ); while (!RegEnumKeyExW( key_users, i, user, &len_user, NULL, NULL, NULL, NULL )) { if ((strcmpW( usersid, szAllSid ) && strcmpW( usersid, user )) || !strcmpW( szLocalSid, user )) { i++; - len_user = sizeof(user)/sizeof(user[0]); + len_user = ARRAY_SIZE( user ); continue; } strcpyW( path, user ); @@ -1364,19 +1364,19 @@ static UINT fetch_user_component( const WCHAR *usersid, DWORD ctx, DWORD index, if (RegOpenKeyExW( key_users, path, 0, access, &key_components )) { i++; - len_user = sizeof(user)/sizeof(user[0]); + len_user = ARRAY_SIZE( user ); continue; } - len_component = sizeof(component)/sizeof(component[0]); + len_component = ARRAY_SIZE( component ); while (!RegEnumKeyExW( key_components, j, component, &len_component, NULL, NULL, NULL, NULL )) { if (*idx == index) goto found; (*idx)++; - len_component = sizeof(component)/sizeof(component[0]); + len_component = ARRAY_SIZE( component ); j++; } RegCloseKey( key_components ); - len_user = sizeof(user)/sizeof(user[0]); + len_user = ARRAY_SIZE( user ); i++; } RegCloseKey( key_users ); @@ -1709,7 +1709,7 @@ UINT WINAPI MsiEnumRelatedProductsW(LPCWSTR szUpgradeCode, DWORD dwReserved, UINT r; HKEY hkey; WCHAR szKeyName[SQUASHED_GUID_SIZE]; - DWORD dwSize = sizeof(szKeyName)/sizeof(szKeyName[0]); + DWORD dwSize = ARRAY_SIZE(szKeyName); TRACE("%s %u %u %p\n", debugstr_w(szUpgradeCode), dwReserved, iProductIndex, lpProductBuf); @@ -2324,18 +2324,18 @@ static UINT fetch_machine_product( const WCHAR *match, DWORD index, DWORD *idx, if (RegOpenKeyExW( HKEY_LOCAL_MACHINE, productsW, 0, access, &key )) return ERROR_NO_MORE_ITEMS; - len = sizeof(product)/sizeof(product[0]); + len = ARRAY_SIZE( product ); while (!RegEnumKeyExW( key, i, product, &len, NULL, NULL, NULL, NULL )) { if (match && strcmpW( match, product )) { i++; - len = sizeof(product)/sizeof(product[0]); + len = ARRAY_SIZE( product ); continue; } if (*idx == index) goto found; (*idx)++; - len = sizeof(product)/sizeof(product[0]); + len = ARRAY_SIZE( product ); i++; } RegCloseKey( key ); @@ -2396,13 +2396,13 @@ static UINT fetch_user_product( const WCHAR *match, const WCHAR *usersid, DWORD } else return ERROR_INVALID_PARAMETER; - len_user = sizeof(user)/sizeof(user[0]); + len_user = ARRAY_SIZE( user ); while (!RegEnumKeyExW( key_users, i, user, &len_user, NULL, NULL, NULL, NULL )) { if (strcmpW( usersid, user ) && strcmpW( usersid, szAllSid )) { i++; - len_user = sizeof(user)/sizeof(user[0]); + len_user = ARRAY_SIZE( user ); continue; } strcpyW( path, user ); @@ -2410,25 +2410,25 @@ static UINT fetch_user_product( const WCHAR *match, const WCHAR *usersid, DWORD if (RegOpenKeyExW( key_users, path, 0, access, &key_products )) { i++; - len_user = sizeof(user)/sizeof(user[0]); + len_user = ARRAY_SIZE( user ); continue; } - len_product = sizeof(product)/sizeof(product[0]); + len_product = ARRAY_SIZE( product ); while (!RegEnumKeyExW( key_products, j, product, &len_product, NULL, NULL, NULL, NULL )) { if (match && strcmpW( match, product )) { j++; - len_product = sizeof(product)/sizeof(product[0]); + len_product = ARRAY_SIZE( product ); continue; } if (*idx == index) goto found; (*idx)++; - len_product = sizeof(product)/sizeof(product[0]); + len_product = ARRAY_SIZE( product ); j++; } RegCloseKey( key_products ); - len_user = sizeof(user)/sizeof(user[0]); + len_user = ARRAY_SIZE( user ); i++; } RegCloseKey( key_users ); diff --git a/dll/win32/msi/source.c b/dll/win32/msi/source.c index 960324b11db..3640b0dfbd2 100644 --- a/dll/win32/msi/source.c +++ b/dll/win32/msi/source.c @@ -1010,7 +1010,7 @@ static UINT fill_source_list(struct list *sourcelist, HKEY sourcekey, DWORD *cou while (r == ERROR_SUCCESS) { - size = sizeof(name) / sizeof(name[0]); + size = ARRAY_SIZE(name); r = RegEnumValueW(sourcekey, index, name, &size, NULL, NULL, NULL, &val_size); if (r != ERROR_SUCCESS) return r; diff --git a/dll/win32/msi/upgrade.c b/dll/win32/msi/upgrade.c index ac58d909e05..bbc7df6eec5 100644 --- a/dll/win32/msi/upgrade.c +++ b/dll/win32/msi/upgrade.c @@ -103,7 +103,7 @@ static UINT ITERATE_FindRelatedProducts(MSIRECORD *rec, LPVOID param) { MSIPACKAGE *package = param; WCHAR product[SQUASHED_GUID_SIZE]; - DWORD index = 0, attributes = 0, sz = sizeof(product)/sizeof(product[0]); + DWORD index = 0, attributes = 0, sz = ARRAY_SIZE(product); LPCWSTR upgrade_code; HKEY hkey = 0; UINT rc = ERROR_SUCCESS;
2 years, 6 months
1
0
0
0
[reactos] 136/360: [WINESYNC] msi: Don't assume that WoW64 redirection is enabled in custom_start_server().
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=49439bc1b41fe2e16f2eb…
commit 49439bc1b41fe2e16f2eb9e04f5e195d85f1f9a2 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sat Mar 12 23:54:33 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:28:00 2022 +0100 [WINESYNC] msi: Don't assume that WoW64 redirection is enabled in custom_start_server(). As of 3a884c2ef the server is started on the main thread, so this is no longer a valid assumption. In particular, we disable WoW64 redirection while running standard actions, including the top-level INSTALL action. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=45663
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 51ad009bacd297c0607bc6de4d5dae18afe6ea98 by Zebediah Figura <z.figura12(a)gmail.com> --- dll/win32/msi/custom.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dll/win32/msi/custom.c b/dll/win32/msi/custom.c index bdc9b39cd5c..0107cd941ed 100644 --- a/dll/win32/msi/custom.c +++ b/dll/win32/msi/custom.c @@ -616,14 +616,17 @@ static DWORD custom_start_server(MSIPACKAGE *package, DWORD arch) if (pipe == INVALID_HANDLE_VALUE) ERR("Failed to create custom action client pipe: %u\n", GetLastError()); - if (sizeof(void *) == 8 && arch == SCS_32BIT_BINARY) + if (!IsWow64Process(GetCurrentProcess(), &wow64)) + wow64 = FALSE; + + if ((sizeof(void *) == 8 || wow64) && 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) + if (wow64 && arch == SCS_64BIT_BINARY) { Wow64DisableWow64FsRedirection(&cookie); CreateProcessW(path, cmdline, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi);
2 years, 6 months
1
0
0
0
[reactos] 135/360: [WINESYNC] msi: Unlock msi_custom_action_c on the error paths.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=d79a5e413ed4908749f0c…
commit d79a5e413ed4908749f0c4c8662e82c1702cd5b8 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sat Mar 12 23:54:33 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:27:59 2022 +0100 [WINESYNC] msi: Unlock msi_custom_action_c on the error paths. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=45483
Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> 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 c2add8a030b63d79f94d516d2dbee9fb09b9c09c by Michael Stefaniuc <mstefani(a)winehq.org> --- dll/win32/msi/custom.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dll/win32/msi/custom.c b/dll/win32/msi/custom.c index 9d44008be73..bdc9b39cd5c 100644 --- a/dll/win32/msi/custom.c +++ b/dll/win32/msi/custom.c @@ -693,11 +693,13 @@ static DWORD WINAPI custom_client_thread(void *arg) size != sizeof(info->guid)) { ERR("Failed to write to custom action client pipe: %u\n", GetLastError()); + LeaveCriticalSection(&msi_custom_action_cs); 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()); + LeaveCriticalSection(&msi_custom_action_cs); return GetLastError(); }
2 years, 6 months
1
0
0
0
[reactos] 134/360: [WINESYNC] msi/tests: Add a test for asynchronous custom actions.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=dc4f732a065a17aa90123…
commit dc4f732a065a17aa901232e0f37c092ac508036f Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sat Mar 12 23:54:33 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:27:59 2022 +0100 [WINESYNC] msi/tests: Add a test for asynchronous 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 6387476d99f4f762628cb0d72b2d43c23f76f563 by Zebediah Figura <z.figura12(a)gmail.com> --- modules/rostests/winetests/msi/custom.c | 21 +++++++++++++++++++++ modules/rostests/winetests/msi/custom.spec | 2 ++ modules/rostests/winetests/msi/install.c | 10 +++++++++- 3 files changed, 32 insertions(+), 1 deletion(-) diff --git a/modules/rostests/winetests/msi/custom.c b/modules/rostests/winetests/msi/custom.c index 3989ca8c10a..6332d68768a 100644 --- a/modules/rostests/winetests/msi/custom.c +++ b/modules/rostests/winetests/msi/custom.c @@ -1169,6 +1169,27 @@ UINT WINAPI process2(MSIHANDLE hinst) return ERROR_SUCCESS; } +UINT WINAPI async1(MSIHANDLE hinst) +{ + HANDLE event = CreateEventA(NULL, TRUE, FALSE, "wine_msi_async_test"); + HANDLE event2 = CreateEventA(NULL, TRUE, FALSE, "wine_msi_async_test2"); + DWORD r = WaitForSingleObject(event, 10000); + ok(hinst, !r, "wait timed out\n"); + SetEvent(event2); + return ERROR_SUCCESS; +} + +UINT WINAPI async2(MSIHANDLE hinst) +{ + HANDLE event = CreateEventA(NULL, TRUE, FALSE, "wine_msi_async_test"); + HANDLE event2 = CreateEventA(NULL, TRUE, FALSE, "wine_msi_async_test2"); + DWORD r; + SetEvent(event); + r = WaitForSingleObject(event2, 10000); + ok(hinst, !r, "wait timed out\n"); + 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 b7cbe582506..5d78377a799 100644 --- a/modules/rostests/winetests/msi/custom.spec +++ b/modules/rostests/winetests/msi/custom.spec @@ -5,6 +5,8 @@ @ stdcall nested(long) @ stdcall process1(long) @ stdcall process2(long) +@ stdcall async1(long) +@ stdcall async2(long) @ stdcall cf_present(long) @ stdcall cf_absent(long) diff --git a/modules/rostests/winetests/msi/install.c b/modules/rostests/winetests/msi/install.c index e147df6a3a5..4fa186246a1 100644 --- a/modules/rostests/winetests/msi/install.c +++ b/modules/rostests/winetests/msi/install.c @@ -677,6 +677,8 @@ static const CHAR ca1_install_exec_seq_dat[] = "Action\tCondition\tSequence\n" "process1\tTEST_PROCESS\t720\n" "process2\tTEST_PROCESS\t721\n" "process_deferred\tTEST_PROCESS\t722\n" + "async1\tTEST_ASYNC\t730\n" + "async2\tTEST_ASYNC\t731\n" "InstallFinalize\t\t800\n"; static const CHAR ca1_custom_action_dat[] = "Action\tType\tSource\tTarget\n" @@ -689,6 +691,8 @@ static const CHAR ca1_custom_action_dat[] = "Action\tType\tSource\tTarget\n" "process1\t1\tcustom.dll\tprocess1\n" "process2\t1\tcustom.dll\tprocess2\n" "process_deferred\t1025\tcustom.dll\tprocess2\n" + "async1\t129\tcustom.dll\tasync1\n" + "async2\t1\tcustom.dll\tasync2\n" "testretval\t1\tcustom.dll\ttest_retval\n"; static const CHAR ca1_test_seq_dat[] = "Action\tCondition\tSequence\n" @@ -4129,7 +4133,7 @@ static void test_customaction1(void) r = MsiInstallProductA(msifile, "TEST_RETVAL=0"); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); - r = MsiInstallProductA(msifile, "TEST_RETVAL=1626"); /* ERROR_FUNCTION_NOT_CALLED*/ + r = MsiInstallProductA(msifile, "TEST_RETVAL=1626"); /* ERROR_FUNCTION_NOT_CALLED */ ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); r = MsiInstallProductA(msifile, "TEST_RETVAL=1602"); @@ -4146,6 +4150,10 @@ static void test_customaction1(void) r = MsiInstallProductA(msifile, "TEST_PROCESS=1"); ok(!r, "got %u\n", r); + /* test asynchronous actions (msidbCustomActionTypeAsync) */ + r = MsiInstallProductA(msifile, "TEST_ASYNC=1"); + ok(!r, "got %u\n", r); + delete_test_files(); DeleteFileA(msifile); DeleteFileA("unus");
2 years, 6 months
1
0
0
0
[reactos] 133/360: [WINESYNC] msiexec: Don't keep the custom action GUID in the main thread's stack.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=33595a42c9b9bd4bf5c25…
commit 33595a42c9b9bd4bf5c257b158446b16ef14f0b1 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sat Mar 12 23:54:32 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:27:59 2022 +0100 [WINESYNC] msiexec: Don't keep the custom action GUID in the main thread's stack. Since it could potentially change on us during an asynchronous custom action. 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 2592690540a87498db09753a32c416cfe7f26e81 by Zebediah Figura <z.figura12(a)gmail.com> --- base/system/msiexec/msiexec.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/base/system/msiexec/msiexec.c b/base/system/msiexec/msiexec.c index ead3bfb9dea..efbcb5c7f4d 100644 --- a/base/system/msiexec/msiexec.c +++ b/base/system/msiexec/msiexec.c @@ -28,6 +28,7 @@ #include <stdio.h> #include "wine/debug.h" +#include "wine/heap.h" #include "wine/unicode.h" #include "initguid.h" @@ -400,20 +401,21 @@ extern UINT CDECL __wine_msi_call_dll_function(GUID *guid); static DWORD CALLBACK custom_action_thread(void *arg) { - GUID *guid = arg; - return __wine_msi_call_dll_function(guid); + GUID guid = *(GUID *)arg; + heap_free(arg); + return __wine_msi_call_dll_function(&guid); } 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}; DWORD client_pid = atoiW(arg); + GUID guid, *thread_guid; DWORD64 thread64; WCHAR buffer[24]; HANDLE thread; HANDLE pipe; DWORD size; - GUID guid; TRACE("%s\n", debugstr_w(arg)); @@ -443,7 +445,9 @@ static int custom_action_server(const WCHAR *arg) return 0; } - thread = CreateThread(NULL, 0, custom_action_thread, &guid, 0, NULL); + thread_guid = heap_alloc(sizeof(GUID)); + memcpy(thread_guid, &guid, sizeof(GUID)); + thread = CreateThread(NULL, 0, custom_action_thread, thread_guid, 0, NULL); /* 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 */
2 years, 6 months
1
0
0
0
[reactos] 132/360: [WINESYNC] msi: Don't refcount the msi_custom_action_info struct.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=8c067cc02c7de739c5faf…
commit 8c067cc02c7de739c5faf756e614d0844c56cad2 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sat Mar 12 23:54:32 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:27:59 2022 +0100 [WINESYNC] msi: Don't refcount the msi_custom_action_info struct. This is unnecessary, and may have always been so. The struct will either be freed after it completes synchronously, or after it has completed asynchronously in ACTION_FinishCustomActions(). 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 b7f06accb05edd70239dbd7b04b956bf10456dee by Zebediah Figura <z.figura12(a)gmail.com> --- dll/win32/msi/custom.c | 46 ++++++++++++++-------------------------------- 1 file changed, 14 insertions(+), 32 deletions(-) diff --git a/dll/win32/msi/custom.c b/dll/win32/msi/custom.c index 9cf3ba1081c..9d44008be73 100644 --- a/dll/win32/msi/custom.c +++ b/dll/win32/msi/custom.c @@ -381,7 +381,6 @@ static UINT wait_process_handle(MSIPACKAGE* package, UINT type, typedef struct _msi_custom_action_info { struct list entry; - LONG refs; MSIPACKAGE *package; LPWSTR source; LPWSTR target; @@ -392,31 +391,22 @@ typedef struct _msi_custom_action_info { DWORD arch; } msi_custom_action_info; -static void release_custom_action_data( msi_custom_action_info *info ) +static void free_custom_action_data( msi_custom_action_info *info ) { EnterCriticalSection( &msi_custom_action_cs ); - if (!--info->refs) - { - list_remove( &info->entry ); - if (info->handle) - CloseHandle( info->handle ); - msi_free( info->action ); - msi_free( info->source ); - msi_free( info->target ); - msiobj_release( &info->package->hdr ); - msi_free( info ); - } + list_remove( &info->entry ); + if (info->handle) + CloseHandle( info->handle ); + msi_free( info->action ); + msi_free( info->source ); + msi_free( info->target ); + msiobj_release( &info->package->hdr ); + msi_free( info ); LeaveCriticalSection( &msi_custom_action_cs ); } -/* must be called inside msi_custom_action_cs if info is in the pending custom actions list */ -static void addref_custom_action_data( msi_custom_action_info *info ) -{ - info->refs++; - } - static UINT wait_thread_handle( msi_custom_action_info *info ) { UINT rc = ERROR_SUCCESS; @@ -430,7 +420,7 @@ static UINT wait_thread_handle( msi_custom_action_info *info ) if (!(info->type & msidbCustomActionTypeContinue)) rc = custom_get_thread_return( info->package, info->handle ); - release_custom_action_data( info ); + free_custom_action_data( info ); } else { @@ -451,7 +441,6 @@ static msi_custom_action_info *find_action_by_guid( const GUID *guid ) { if (IsEqualGUID( &info->guid, guid )) { - addref_custom_action_data( info ); found = TRUE; break; } @@ -740,7 +729,6 @@ static msi_custom_action_info *do_msidbCustomActionTypeDll( return NULL; msiobj_addref( &package->hdr ); - info->refs = 2; /* 1 for our caller and 1 for thread we created */ info->package = package; info->type = type; info->target = strdupW( target ); @@ -782,9 +770,7 @@ static msi_custom_action_info *do_msidbCustomActionTypeDll( info->handle = CreateThread(NULL, 0, custom_client_thread, info, 0, NULL); if (!info->handle) { - /* release both references */ - release_custom_action_data( info ); - release_custom_action_data( info ); + free_custom_action_data( info ); return NULL; } @@ -1071,7 +1057,6 @@ static DWORD ACTION_CallScript( const GUID *guid ) else ERR("failed to create handle for %p\n", info->package ); - release_custom_action_data( info ); return r; } @@ -1100,7 +1085,6 @@ static msi_custom_action_info *do_msidbCustomActionTypeScript( return NULL; msiobj_addref( &package->hdr ); - info->refs = 2; /* 1 for our caller and 1 for thread we created */ info->package = package; info->type = type; info->target = strdupW( function ); @@ -1115,9 +1099,7 @@ static msi_custom_action_info *do_msidbCustomActionTypeScript( info->handle = CreateThread( NULL, 0, ScriptThread, &info->guid, 0, NULL ); if (!info->handle) { - /* release both references */ - release_custom_action_data( info ); - release_custom_action_data( info ); + free_custom_action_data( info ); return NULL; } @@ -1511,7 +1493,8 @@ void ACTION_FinishCustomActions(const MSIPACKAGE* package) EnterCriticalSection( &msi_custom_action_cs ); LIST_FOR_EACH_ENTRY_SAFE( info, cursor, &msi_pending_custom_actions, msi_custom_action_info, entry ) { - if (info->package == package) release_custom_action_data( info ); + if (info->package == package) + free_custom_action_data( info ); } LeaveCriticalSection( &msi_custom_action_cs ); } @@ -1529,6 +1512,5 @@ UINT __cdecl s_remote_GetActionInfo(const GUID *guid, int *type, LPWSTR *dll, LP *dll = strdupW(info->source); *func = strdupWtoA(info->target); - release_custom_action_data(info); return ERROR_SUCCESS; }
2 years, 6 months
1
0
0
0
← Newer
1
...
24
25
26
27
28
29
30
...
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