ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
March 2022
----- 2024 -----
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
20 participants
436 discussions
Start a n
N
ew thread
[reactos] 41/360: [WINESYNC] msi: Make MsiEvaluateCondition() RPC-compatible.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=03faa10759eb1562ecf13…
commit 03faa10759eb1562ecf13d47c366b0f7aa9618d3 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sat Mar 12 15:12:05 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:27:41 2022 +0100 [WINESYNC] msi: Make MsiEvaluateCondition() RPC-compatible. 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 0fc1b6f2f31952f9dab4a22805fe0f098548cb25 by Zebediah Figura <z.figura12(a)gmail.com> --- dll/win32/msi/cond.y | 21 +++------------------ dll/win32/msi/package.c | 5 ++--- dll/win32/msi/winemsi.idl | 2 +- modules/rostests/winetests/msi/custom.c | 7 +++++++ 4 files changed, 13 insertions(+), 22 deletions(-) diff --git a/dll/win32/msi/cond.y b/dll/win32/msi/cond.y index 6156750c04b..a8c97340db9 100644 --- a/dll/win32/msi/cond.y +++ b/dll/win32/msi/cond.y @@ -851,29 +851,14 @@ MSICONDITION WINAPI MsiEvaluateConditionW( MSIHANDLE hInstall, LPCWSTR szConditi if( !package ) { MSIHANDLE remote; - HRESULT hr; - BSTR condition; if (!(remote = msi_get_remote(hInstall))) return MSICONDITION_ERROR; - condition = SysAllocString( szCondition ); - if (!condition) - return ERROR_OUTOFMEMORY; + if (!szCondition) + return MSICONDITION_NONE; - hr = remote_EvaluateCondition(remote, condition); - - SysFreeString( condition ); - - if (FAILED(hr)) - { - if (HRESULT_FACILITY(hr) == FACILITY_WIN32) - return HRESULT_CODE(hr); - - return ERROR_FUNCTION_FAILED; - } - - return ERROR_SUCCESS; + return remote_EvaluateCondition(remote, szCondition); } ret = MSI_EvaluateConditionW( package, szCondition ); diff --git a/dll/win32/msi/package.c b/dll/win32/msi/package.c index 03335fb9d66..d4cbe0766da 100644 --- a/dll/win32/msi/package.c +++ b/dll/win32/msi/package.c @@ -2585,10 +2585,9 @@ UINT __cdecl remote_FormatRecord(MSIHANDLE hinst, struct wire_record *remote_rec return r; } -HRESULT __cdecl remote_EvaluateCondition(MSIHANDLE hinst, BSTR condition) +MSICONDITION __cdecl remote_EvaluateCondition(MSIHANDLE hinst, LPCWSTR condition) { - UINT r = MsiEvaluateConditionW(hinst, condition); - return HRESULT_FROM_WIN32(r); + return MsiEvaluateConditionW(hinst, condition); } HRESULT __cdecl remote_GetFeatureCost(MSIHANDLE hinst, BSTR feature, diff --git a/dll/win32/msi/winemsi.idl b/dll/win32/msi/winemsi.idl index 7d7054a7076..6bdd117160f 100644 --- a/dll/win32/msi/winemsi.idl +++ b/dll/win32/msi/winemsi.idl @@ -88,7 +88,7 @@ interface IWineMsiRemote LANGID remote_GetLanguage( [in] MSIHANDLE hinst ); UINT remote_SetInstallLevel( [in] MSIHANDLE hinst, [in] int level ); UINT remote_FormatRecord( [in] MSIHANDLE hinst, [in] struct wire_record *record, [out, string] LPWSTR *value); - HRESULT remote_EvaluateCondition( [in] MSIHANDLE hinst, [in] BSTR condition ); + MSICONDITION remote_EvaluateCondition( [in] MSIHANDLE hinst, [in, string] LPCWSTR condition ); HRESULT remote_GetFeatureCost( [in] MSIHANDLE hinst, [in] BSTR feature, [in] INT cost_tree, [in] INSTALLSTATE state, [out] INT *cost ); HRESULT remote_EnumComponentCosts( [in] MSIHANDLE hinst, [in] BSTR component, [in] DWORD index, [in] INSTALLSTATE state, [out, size_is(*buflen)] BSTR drive, [in, out] DWORD *buflen, [out] INT *cost, [out] INT *temp ); diff --git a/modules/rostests/winetests/msi/custom.c b/modules/rostests/winetests/msi/custom.c index 76a70adac40..2035a8f7295 100644 --- a/modules/rostests/winetests/msi/custom.c +++ b/modules/rostests/winetests/msi/custom.c @@ -644,6 +644,7 @@ static void test_targetpath(MSIHANDLE hinst) static void test_misc(MSIHANDLE hinst) { + MSICONDITION cond; LANGID lang; UINT r; @@ -658,6 +659,12 @@ static void test_misc(MSIHANDLE hinst) ok(hinst, !r, "got %u\n", r); check_prop(hinst, "INSTALLLEVEL", "123"); MsiSetInstallLevel(hinst, 3); + + cond = MsiEvaluateConditionA(hinst, NULL); + ok(hinst, cond == MSICONDITION_NONE, "got %u\n", cond); + MsiSetPropertyA(hinst, "condprop", "1"); + cond = MsiEvaluateConditionA(hinst, "condprop = 1"); + ok(hinst, cond == MSICONDITION_TRUE, "got %u\n", cond); } static void test_feature_states(MSIHANDLE hinst)
2 years, 7 months
1
0
0
0
[reactos] 40/360: [WINESYNC] msi: Make MsiFormatRecord() RPC-compatible.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=cde5f24cd967db9688d11…
commit cde5f24cd967db9688d11a0f559da2c4e1a128dc Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sat Mar 12 15:12:05 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:27:41 2022 +0100 [WINESYNC] msi: Make MsiFormatRecord() RPC-compatible. 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 ef7ed29348584fc0385d42b707fd6fcc03dfddc5 by Zebediah Figura <z.figura12(a)gmail.com> --- dll/win32/msi/format.c | 34 +++++------ dll/win32/msi/package.c | 25 ++++++--- dll/win32/msi/winemsi.idl | 2 +- modules/rostests/winetests/msi/custom.c | 99 +++++++++++++++++++++++++++++++++ 4 files changed, 129 insertions(+), 31 deletions(-) diff --git a/dll/win32/msi/format.c b/dll/win32/msi/format.c index f15c4ceb60c..0533cc004ce 100644 --- a/dll/win32/msi/format.c +++ b/dll/win32/msi/format.c @@ -907,43 +907,35 @@ UINT WINAPI MsiFormatRecordW( MSIHANDLE hInstall, MSIHANDLE hRecord, TRACE("%d %d %p %p\n", hInstall, hRecord, szResult, sz); + record = msihandle2msiinfo(hRecord, MSIHANDLETYPE_RECORD); + if (!record) + return ERROR_INVALID_HANDLE; + package = msihandle2msiinfo( hInstall, MSIHANDLETYPE_PACKAGE ); if (!package) { - HRESULT hr; + LPWSTR value = NULL; MSIHANDLE remote; - BSTR value = NULL; awstring wstr; if ((remote = msi_get_remote(hInstall))) { - hr = remote_FormatRecord(remote, hRecord, &value); - if (FAILED(hr)) - goto done; + r = remote_FormatRecord(remote, (struct wire_record *)&record->count, &value); + if (r) + { + midl_user_free(value); + return r; + } wstr.unicode = TRUE; wstr.str.w = szResult; - r = msi_strcpy_to_awstring( value, SysStringLen(value), &wstr, sz ); - -done: - SysFreeString( value ); - - if (FAILED(hr)) - { - if (HRESULT_FACILITY(hr) == FACILITY_WIN32) - return HRESULT_CODE(hr); - - return ERROR_FUNCTION_FAILED; - } + r = msi_strcpy_to_awstring(value, -1, &wstr, sz); + midl_user_free(value); return r; } } - record = msihandle2msiinfo( hRecord, MSIHANDLETYPE_RECORD ); - - if (!record) - return ERROR_INVALID_HANDLE; if (!sz) { msiobj_release( &record->hdr ); diff --git a/dll/win32/msi/package.c b/dll/win32/msi/package.c index ca671f690c4..03335fb9d66 100644 --- a/dll/win32/msi/package.c +++ b/dll/win32/msi/package.c @@ -2562,20 +2562,27 @@ UINT __cdecl remote_SetInstallLevel(MSIHANDLE hinst, int level) return MsiSetInstallLevel(hinst, level); } -HRESULT __cdecl remote_FormatRecord(MSIHANDLE hinst, MSIHANDLE record, - BSTR *value) +UINT __cdecl remote_FormatRecord(MSIHANDLE hinst, struct wire_record *remote_rec, LPWSTR *value) { + WCHAR empty[1]; DWORD size = 0; - UINT r = MsiFormatRecordW(hinst, record, NULL, &size); - if (r == ERROR_SUCCESS) + MSIHANDLE rec; + UINT r; + + if ((r = unmarshal_record(remote_rec, &rec))) + return r; + + r = MsiFormatRecordW(hinst, rec, empty, &size); + if (r == ERROR_MORE_DATA) { - *value = SysAllocStringLen(NULL, size); + *value = midl_user_allocate(++size * sizeof(WCHAR)); if (!*value) - return E_OUTOFMEMORY; - size++; - r = MsiFormatRecordW(hinst, record, *value, &size); + return ERROR_OUTOFMEMORY; + r = MsiFormatRecordW(hinst, rec, *value, &size); } - return HRESULT_FROM_WIN32(r); + + MsiCloseHandle(rec); + return r; } HRESULT __cdecl remote_EvaluateCondition(MSIHANDLE hinst, BSTR condition) diff --git a/dll/win32/msi/winemsi.idl b/dll/win32/msi/winemsi.idl index a8e9348ecdf..7d7054a7076 100644 --- a/dll/win32/msi/winemsi.idl +++ b/dll/win32/msi/winemsi.idl @@ -87,7 +87,7 @@ interface IWineMsiRemote UINT remote_SetComponentState( [in] MSIHANDLE hinst, [in, string] LPCWSTR component, [in] INSTALLSTATE state ); LANGID remote_GetLanguage( [in] MSIHANDLE hinst ); UINT remote_SetInstallLevel( [in] MSIHANDLE hinst, [in] int level ); - HRESULT remote_FormatRecord( [in] MSIHANDLE hinst, [in] MSIHANDLE record, [out] BSTR *value ); + UINT remote_FormatRecord( [in] MSIHANDLE hinst, [in] struct wire_record *record, [out, string] LPWSTR *value); HRESULT remote_EvaluateCondition( [in] MSIHANDLE hinst, [in] BSTR condition ); HRESULT remote_GetFeatureCost( [in] MSIHANDLE hinst, [in] BSTR feature, [in] INT cost_tree, [in] INSTALLSTATE state, [out] INT *cost ); HRESULT remote_EnumComponentCosts( [in] MSIHANDLE hinst, [in] BSTR component, [in] DWORD index, [in] INSTALLSTATE state, diff --git a/modules/rostests/winetests/msi/custom.c b/modules/rostests/winetests/msi/custom.c index 35b1543407e..76a70adac40 100644 --- a/modules/rostests/winetests/msi/custom.c +++ b/modules/rostests/winetests/msi/custom.c @@ -750,6 +750,104 @@ static void test_feature_states(MSIHANDLE hinst) ok(hinst, action == INSTALLSTATE_LOCAL, "got action %d\n", action); } +static void test_format_record(MSIHANDLE hinst) +{ + static const WCHAR xyzW[] = {'f','o','o',' ','1','2','3',0}; + static const WCHAR xyW[] = {'f','o','o',' ','1','2',0}; + WCHAR bufferW[10]; + char buffer[10]; + MSIHANDLE rec; + DWORD sz; + UINT r; + + r = MsiFormatRecordA(hinst, 0, NULL, NULL); + ok(hinst, r == ERROR_INVALID_HANDLE, "got %u\n", r); + + rec = MsiCreateRecord(1); + MsiRecordSetStringA(rec, 0, "foo [1]"); + MsiRecordSetInteger(rec, 1, 123); + + r = MsiFormatRecordA(hinst, rec, NULL, NULL); + ok(hinst, !r, "got %u\n", r); + + r = MsiFormatRecordA(hinst, rec, buffer, NULL); + ok(hinst, r == ERROR_INVALID_PARAMETER, "got %u\n", r); + + /* Returned size is in bytes, not chars, but only for custom actions. */ + + sz = 0; + r = MsiFormatRecordA(hinst, rec, NULL, &sz); + ok(hinst, !r, "got %u\n", r); + todo_wine_ok(hinst, sz == 14, "got size %u\n", sz); + + sz = 0; + strcpy(buffer,"q"); + r = MsiFormatRecordA(hinst, rec, buffer, &sz); + ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r); + ok(hinst, !strcmp(buffer, "q"), "got \"%s\"\n", buffer); + todo_wine_ok(hinst, sz == 14, "got size %u\n", sz); + + sz = 1; + strcpy(buffer,"x"); + r = MsiFormatRecordA(hinst, rec, buffer, &sz); + ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r); + ok(hinst, !buffer[0], "got \"%s\"\n", buffer); + todo_wine_ok(hinst, sz == 14, "got size %u\n", sz); + + sz = 7; + strcpy(buffer,"x"); + r = MsiFormatRecordA(hinst, rec, buffer, &sz); + ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r); + ok(hinst, !strcmp(buffer, "foo 12"), "got \"%s\"\n", buffer); + todo_wine_ok(hinst, sz == 14, "got size %u\n", sz); + + sz = 8; + strcpy(buffer,"x"); + r = MsiFormatRecordA(hinst, rec, buffer, &sz); + ok(hinst, !r, "got %u\n", r); + ok(hinst, !strcmp(buffer, "foo 123"), "got \"%s\"\n", buffer); + ok(hinst, sz == 7, "got size %u\n", sz); + + sz = 0; + bufferW[0] = 'q'; + r = MsiFormatRecordW(hinst, rec, bufferW, &sz); + ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r); + ok(hinst, bufferW[0] == 'q', "got %s\n", dbgstr_w(bufferW)); + ok(hinst, sz == 7, "got size %u\n", sz); + + sz = 1; + bufferW[0] = 'q'; + r = MsiFormatRecordW(hinst, rec, bufferW, &sz); + ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r); + ok(hinst, !bufferW[0], "got %s\n", dbgstr_w(bufferW)); + ok(hinst, sz == 7, "got size %u\n", sz); + + sz = 7; + bufferW[0] = 'q'; + r = MsiFormatRecordW(hinst, rec, bufferW, &sz); + ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r); + ok(hinst, !lstrcmpW(bufferW, xyW), "got %s\n", dbgstr_w(bufferW)); + ok(hinst, sz == 7, "got size %u\n", sz); + + sz = 8; + bufferW[0] = 'q'; + r = MsiFormatRecordW(hinst, rec, bufferW, &sz); + ok(hinst, !r, "got %u\n", r); + ok(hinst, !lstrcmpW(bufferW, xyzW), "got %s\n", dbgstr_w(bufferW)); + ok(hinst, sz == 7, "got size %u\n", sz); + + /* check that properties work */ + MsiSetPropertyA(hinst, "fmtprop", "foobar"); + MsiRecordSetStringA(rec, 0, "[fmtprop]"); + sz = sizeof(buffer); + r = MsiFormatRecordA(hinst, rec, buffer, &sz); + ok(hinst, !r, "got %u\n", r); + ok(hinst, !strcmp(buffer, "foobar"), "got \"%s\"\n", buffer); + ok(hinst, sz == 6, "got size %u\n", sz); + + MsiCloseHandle(rec); +} + /* Main test. Anything that doesn't depend on a specific install configuration * or have undesired side effects should go here. */ UINT WINAPI main_test(MSIHANDLE hinst) @@ -779,6 +877,7 @@ UINT WINAPI main_test(MSIHANDLE hinst) test_targetpath(hinst); test_misc(hinst); test_feature_states(hinst); + test_format_record(hinst); return ERROR_SUCCESS; }
2 years, 7 months
1
0
0
0
[reactos] 39/360: [WINESYNC] msi: Make MsiSetInstallLevel() RPC-compatible.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=d20dc08f6171136c90eb8…
commit d20dc08f6171136c90eb8e9aa1efb487aff1ae17 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sat Mar 12 15:12:04 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:27:41 2022 +0100 [WINESYNC] msi: Make MsiSetInstallLevel() RPC-compatible. 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 5ab576b8a09f715401a1de2bb384ccc9ffb37750 by Zebediah Figura <z.figura12(a)gmail.com> --- dll/win32/msi/install.c | 13 +------------ dll/win32/msi/package.c | 5 ++--- dll/win32/msi/winemsi.idl | 2 +- modules/rostests/winetests/msi/custom.c | 6 ++++++ 4 files changed, 10 insertions(+), 16 deletions(-) diff --git a/dll/win32/msi/install.c b/dll/win32/msi/install.c index 0ec1f241b61..b9290b4a8d0 100644 --- a/dll/win32/msi/install.c +++ b/dll/win32/msi/install.c @@ -1428,22 +1428,11 @@ UINT WINAPI MsiSetInstallLevel(MSIHANDLE hInstall, int iInstallLevel) if (!package) { MSIHANDLE remote; - HRESULT hr; if (!(remote = msi_get_remote(hInstall))) return ERROR_INVALID_HANDLE; - hr = remote_SetInstallLevel(remote, iInstallLevel); - - if (FAILED(hr)) - { - if (HRESULT_FACILITY(hr) == FACILITY_WIN32) - return HRESULT_CODE(hr); - - return ERROR_FUNCTION_FAILED; - } - - return ERROR_SUCCESS; + return remote_SetInstallLevel(remote, iInstallLevel); } r = MSI_SetInstallLevel( package, iInstallLevel ); diff --git a/dll/win32/msi/package.c b/dll/win32/msi/package.c index 98b283df502..ca671f690c4 100644 --- a/dll/win32/msi/package.c +++ b/dll/win32/msi/package.c @@ -2557,10 +2557,9 @@ LANGID __cdecl remote_GetLanguage(MSIHANDLE hinst) return MsiGetLanguage(hinst); } -HRESULT __cdecl remote_SetInstallLevel(MSIHANDLE hinst, int level) +UINT __cdecl remote_SetInstallLevel(MSIHANDLE hinst, int level) { - UINT r = MsiSetInstallLevel(hinst, level); - return HRESULT_FROM_WIN32(r); + return MsiSetInstallLevel(hinst, level); } HRESULT __cdecl remote_FormatRecord(MSIHANDLE hinst, MSIHANDLE record, diff --git a/dll/win32/msi/winemsi.idl b/dll/win32/msi/winemsi.idl index b75f32f46b1..a8e9348ecdf 100644 --- a/dll/win32/msi/winemsi.idl +++ b/dll/win32/msi/winemsi.idl @@ -86,7 +86,7 @@ interface IWineMsiRemote UINT remote_GetComponentState( [in] MSIHANDLE hinst, [in, string] LPCWSTR component, [out] INSTALLSTATE *installed, [out] INSTALLSTATE *action ); UINT remote_SetComponentState( [in] MSIHANDLE hinst, [in, string] LPCWSTR component, [in] INSTALLSTATE state ); LANGID remote_GetLanguage( [in] MSIHANDLE hinst ); - HRESULT remote_SetInstallLevel( [in] MSIHANDLE hinst, [in] int level ); + UINT remote_SetInstallLevel( [in] MSIHANDLE hinst, [in] int level ); HRESULT remote_FormatRecord( [in] MSIHANDLE hinst, [in] MSIHANDLE record, [out] BSTR *value ); HRESULT remote_EvaluateCondition( [in] MSIHANDLE hinst, [in] BSTR condition ); HRESULT remote_GetFeatureCost( [in] MSIHANDLE hinst, [in] BSTR feature, [in] INT cost_tree, [in] INSTALLSTATE state, [out] INT *cost ); diff --git a/modules/rostests/winetests/msi/custom.c b/modules/rostests/winetests/msi/custom.c index e9561d6a36c..35b1543407e 100644 --- a/modules/rostests/winetests/msi/custom.c +++ b/modules/rostests/winetests/msi/custom.c @@ -652,6 +652,12 @@ static void test_misc(MSIHANDLE hinst) lang = MsiGetLanguage(hinst); ok(hinst, lang == 1033, "got %u\n", lang); + + check_prop(hinst, "INSTALLLEVEL", "3"); + r = MsiSetInstallLevel(hinst, 123); + ok(hinst, !r, "got %u\n", r); + check_prop(hinst, "INSTALLLEVEL", "123"); + MsiSetInstallLevel(hinst, 3); } static void test_feature_states(MSIHANDLE hinst)
2 years, 7 months
1
0
0
0
[reactos] 38/360: [WINESYNC] msi: Make MsiGetLanguage() RPC-compatible.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=fdca309017cd52ae02098…
commit fdca309017cd52ae020989ae5a9c184a0f0e9408 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sat Mar 12 15:12:04 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:27:41 2022 +0100 [WINESYNC] msi: Make MsiGetLanguage() RPC-compatible. 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 5f45959adc55961a9787b54cd7814f18c056ebef by Zebediah Figura <z.figura12(a)gmail.com> --- dll/win32/msi/install.c | 9 +-------- dll/win32/msi/package.c | 5 ++--- dll/win32/msi/winemsi.idl | 2 +- modules/rostests/winetests/msi/custom.c | 8 ++++++-- 4 files changed, 10 insertions(+), 14 deletions(-) diff --git a/dll/win32/msi/install.c b/dll/win32/msi/install.c index 63ffbfeaeae..0ec1f241b61 100644 --- a/dll/win32/msi/install.c +++ b/dll/win32/msi/install.c @@ -1379,18 +1379,11 @@ LANGID WINAPI MsiGetLanguage(MSIHANDLE hInstall) if (!package) { MSIHANDLE remote; - HRESULT hr; - LANGID lang; if (!(remote = msi_get_remote(hInstall))) return ERROR_INVALID_HANDLE; - hr = remote_GetLanguage(remote, &lang); - - if (SUCCEEDED(hr)) - return lang; - - return 0; + return remote_GetLanguage(remote); } langid = msi_get_property_int( package->db, szProductLanguage, 0 ); diff --git a/dll/win32/msi/package.c b/dll/win32/msi/package.c index 26d999bcbce..98b283df502 100644 --- a/dll/win32/msi/package.c +++ b/dll/win32/msi/package.c @@ -2552,10 +2552,9 @@ UINT __cdecl remote_SetComponentState(MSIHANDLE hinst, LPCWSTR component, INSTAL return MsiSetComponentStateW(hinst, component, state); } -HRESULT __cdecl remote_GetLanguage(MSIHANDLE hinst, LANGID *language) +LANGID __cdecl remote_GetLanguage(MSIHANDLE hinst) { - *language = MsiGetLanguage(hinst); - return S_OK; + return MsiGetLanguage(hinst); } HRESULT __cdecl remote_SetInstallLevel(MSIHANDLE hinst, int level) diff --git a/dll/win32/msi/winemsi.idl b/dll/win32/msi/winemsi.idl index 132f140d870..b75f32f46b1 100644 --- a/dll/win32/msi/winemsi.idl +++ b/dll/win32/msi/winemsi.idl @@ -85,7 +85,7 @@ interface IWineMsiRemote UINT remote_SetFeatureState( [in] MSIHANDLE hinst, [in, string] LPCWSTR feature, [in] INSTALLSTATE state ); UINT remote_GetComponentState( [in] MSIHANDLE hinst, [in, string] LPCWSTR component, [out] INSTALLSTATE *installed, [out] INSTALLSTATE *action ); UINT remote_SetComponentState( [in] MSIHANDLE hinst, [in, string] LPCWSTR component, [in] INSTALLSTATE state ); - HRESULT remote_GetLanguage( [in] MSIHANDLE hinst, [out] LANGID *language ); + LANGID remote_GetLanguage( [in] MSIHANDLE hinst ); HRESULT remote_SetInstallLevel( [in] MSIHANDLE hinst, [in] int level ); HRESULT remote_FormatRecord( [in] MSIHANDLE hinst, [in] MSIHANDLE record, [out] BSTR *value ); HRESULT remote_EvaluateCondition( [in] MSIHANDLE hinst, [in] BSTR condition ); diff --git a/modules/rostests/winetests/msi/custom.c b/modules/rostests/winetests/msi/custom.c index 2f9ba5d3231..e9561d6a36c 100644 --- a/modules/rostests/winetests/msi/custom.c +++ b/modules/rostests/winetests/msi/custom.c @@ -642,12 +642,16 @@ static void test_targetpath(MSIHANDLE hinst) ok(hinst, sz == srcsz, "got size %u\n", sz); } -static void test_mode(MSIHANDLE hinst) +static void test_misc(MSIHANDLE hinst) { + LANGID lang; UINT r; r = MsiSetMode(hinst, MSIRUNMODE_REBOOTATEND, FALSE); ok(hinst, !r, "got %u\n", r); + + lang = MsiGetLanguage(hinst); + ok(hinst, lang == 1033, "got %u\n", lang); } static void test_feature_states(MSIHANDLE hinst) @@ -767,7 +771,7 @@ UINT WINAPI main_test(MSIHANDLE hinst) test_db(hinst); test_doaction(hinst); test_targetpath(hinst); - test_mode(hinst); + test_misc(hinst); test_feature_states(hinst); return ERROR_SUCCESS;
2 years, 7 months
1
0
0
0
[reactos] 37/360: [WINESYNC] msi: Make MsiSetComponentState() RPC-compatible.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=1c8fdff2931f9d957feb4…
commit 1c8fdff2931f9d957feb42444fa05a671d2b5cca Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sat Mar 12 15:12:03 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:27:40 2022 +0100 [WINESYNC] msi: Make MsiSetComponentState() RPC-compatible. 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 11702a31d2a31bfc5ac13e5d7995b2e71578f25f by Zebediah Figura <z.figura12(a)gmail.com> --- dll/win32/msi/install.c | 23 ++++------------------- dll/win32/msi/package.c | 5 ++--- dll/win32/msi/winemsi.idl | 2 +- modules/rostests/winetests/msi/custom.c | 19 +++++++++++++++++++ 4 files changed, 26 insertions(+), 23 deletions(-) diff --git a/dll/win32/msi/install.c b/dll/win32/msi/install.c index b19b6471ee2..63ffbfeaeae 100644 --- a/dll/win32/msi/install.c +++ b/dll/win32/msi/install.c @@ -1313,33 +1313,18 @@ UINT WINAPI MsiSetComponentStateW(MSIHANDLE hInstall, LPCWSTR szComponent, MSIPACKAGE* package; UINT ret; + if (!szComponent) + return ERROR_UNKNOWN_COMPONENT; + package = msihandle2msiinfo(hInstall, MSIHANDLETYPE_PACKAGE); if (!package) { MSIHANDLE remote; - HRESULT hr; - BSTR component; if (!(remote = msi_get_remote(hInstall))) return ERROR_INVALID_HANDLE; - component = SysAllocString(szComponent); - if (!component) - return ERROR_OUTOFMEMORY; - - hr = remote_SetComponentState(remote, component, iState); - - SysFreeString(component); - - if (FAILED(hr)) - { - if (HRESULT_FACILITY(hr) == FACILITY_WIN32) - return HRESULT_CODE(hr); - - return ERROR_FUNCTION_FAILED; - } - - return ERROR_SUCCESS; + return remote_SetComponentState(remote, szComponent, iState); } ret = MSI_SetComponentStateW(package, szComponent, iState); diff --git a/dll/win32/msi/package.c b/dll/win32/msi/package.c index 1155db34f8e..26d999bcbce 100644 --- a/dll/win32/msi/package.c +++ b/dll/win32/msi/package.c @@ -2547,10 +2547,9 @@ UINT __cdecl remote_GetComponentState(MSIHANDLE hinst, LPCWSTR component, return MsiGetComponentStateW(hinst, component, installed, action); } -HRESULT __cdecl remote_SetComponentState(MSIHANDLE hinst, BSTR component, INSTALLSTATE state) +UINT __cdecl remote_SetComponentState(MSIHANDLE hinst, LPCWSTR component, INSTALLSTATE state) { - UINT r = MsiSetComponentStateW(hinst, component, state); - return HRESULT_FROM_WIN32(r); + return MsiSetComponentStateW(hinst, component, state); } HRESULT __cdecl remote_GetLanguage(MSIHANDLE hinst, LANGID *language) diff --git a/dll/win32/msi/winemsi.idl b/dll/win32/msi/winemsi.idl index 59964871cb3..132f140d870 100644 --- a/dll/win32/msi/winemsi.idl +++ b/dll/win32/msi/winemsi.idl @@ -84,7 +84,7 @@ interface IWineMsiRemote UINT remote_GetFeatureState( [in] MSIHANDLE hinst, [in, string] LPCWSTR feature, [out] INSTALLSTATE *installed, [out] INSTALLSTATE *action ); UINT remote_SetFeatureState( [in] MSIHANDLE hinst, [in, string] LPCWSTR feature, [in] INSTALLSTATE state ); UINT remote_GetComponentState( [in] MSIHANDLE hinst, [in, string] LPCWSTR component, [out] INSTALLSTATE *installed, [out] INSTALLSTATE *action ); - HRESULT remote_SetComponentState( [in] MSIHANDLE hinst, [in] BSTR component, [in] INSTALLSTATE state ); + UINT remote_SetComponentState( [in] MSIHANDLE hinst, [in, string] LPCWSTR component, [in] INSTALLSTATE state ); HRESULT remote_GetLanguage( [in] MSIHANDLE hinst, [out] LANGID *language ); HRESULT remote_SetInstallLevel( [in] MSIHANDLE hinst, [in] int level ); HRESULT remote_FormatRecord( [in] MSIHANDLE hinst, [in] MSIHANDLE record, [out] BSTR *value ); diff --git a/modules/rostests/winetests/msi/custom.c b/modules/rostests/winetests/msi/custom.c index b2c9352e27d..2f9ba5d3231 100644 --- a/modules/rostests/winetests/msi/custom.c +++ b/modules/rostests/winetests/msi/custom.c @@ -719,6 +719,25 @@ static void test_feature_states(MSIHANDLE hinst) ok(hinst, !r, "got %u\n", r); ok(hinst, state == INSTALLSTATE_UNKNOWN, "got state %d\n", state); ok(hinst, action == INSTALLSTATE_LOCAL, "got action %d\n", action); + + r = MsiSetComponentStateA(hinst, NULL, INSTALLSTATE_ABSENT); + ok(hinst, r == ERROR_UNKNOWN_COMPONENT, "got %u\n", r); + + r = MsiSetComponentStateA(hinst, "One", INSTALLSTATE_SOURCE); + ok(hinst, !r, "got %u\n", r); + + r = MsiGetComponentStateA(hinst, "One", &state, &action); + ok(hinst, !r, "got %u\n", r); + ok(hinst, state == INSTALLSTATE_ABSENT, "got state %d\n", state); + ok(hinst, action == INSTALLSTATE_SOURCE, "got action %d\n", action); + + r = MsiSetComponentStateA(hinst, "One", INSTALLSTATE_LOCAL); + ok(hinst, !r, "got %u\n", r); + + r = MsiGetComponentStateA(hinst, "One", &state, &action); + ok(hinst, !r, "got %u\n", r); + ok(hinst, state == INSTALLSTATE_ABSENT, "got state %d\n", state); + ok(hinst, action == INSTALLSTATE_LOCAL, "got action %d\n", action); } /* Main test. Anything that doesn't depend on a specific install configuration
2 years, 7 months
1
0
0
0
[reactos] 36/360: [WINESYNC] msi: Make MsiGetComponentState() RPC-compatible.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=709d0f5b5796ec028432b…
commit 709d0f5b5796ec028432b7c327bbb7a52dc1424e Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sat Mar 12 15:12:02 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:27:40 2022 +0100 [WINESYNC] msi: Make MsiGetComponentState() RPC-compatible. 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 35b1b87dc90b5d0700ec0893bc3918e15a43b07d by Zebediah Figura <z.figura12(a)gmail.com> --- dll/win32/msi/install.c | 25 +++++++------------------ dll/win32/msi/package.c | 5 ++--- dll/win32/msi/winemsi.idl | 2 +- modules/rostests/winetests/msi/custom.c | 31 +++++++++++++++++++++++++++++++ 4 files changed, 41 insertions(+), 22 deletions(-) diff --git a/dll/win32/msi/install.c b/dll/win32/msi/install.c index 1ff3ad98804..b19b6471ee2 100644 --- a/dll/win32/msi/install.c +++ b/dll/win32/msi/install.c @@ -1359,33 +1359,22 @@ UINT WINAPI MsiGetComponentStateW(MSIHANDLE hInstall, LPCWSTR szComponent, TRACE("%d %s %p %p\n", hInstall, debugstr_w(szComponent), piInstalled, piAction); + if (!szComponent) + return ERROR_UNKNOWN_COMPONENT; + package = msihandle2msiinfo(hInstall, MSIHANDLETYPE_PACKAGE); if (!package) { MSIHANDLE remote; - HRESULT hr; - BSTR component; if (!(remote = msi_get_remote(hInstall))) return ERROR_INVALID_HANDLE; - component = SysAllocString(szComponent); - if (!component) - return ERROR_OUTOFMEMORY; - - hr = remote_GetComponentState(remote, component, piInstalled, piAction); - - SysFreeString(component); - - if (FAILED(hr)) - { - if (HRESULT_FACILITY(hr) == FACILITY_WIN32) - return HRESULT_CODE(hr); - - return ERROR_FUNCTION_FAILED; - } + /* FIXME: should use SEH */ + if (!piInstalled || !piAction) + return RPC_X_NULL_REF_POINTER; - return ERROR_SUCCESS; + return remote_GetComponentState(remote, szComponent, piInstalled, piAction); } ret = MSI_GetComponentStateW( package, szComponent, piInstalled, piAction); diff --git a/dll/win32/msi/package.c b/dll/win32/msi/package.c index c0ec5a3aa7a..1155db34f8e 100644 --- a/dll/win32/msi/package.c +++ b/dll/win32/msi/package.c @@ -2541,11 +2541,10 @@ UINT __cdecl remote_SetFeatureState(MSIHANDLE hinst, LPCWSTR feature, INSTALLSTA return MsiSetFeatureStateW(hinst, feature, state); } -HRESULT __cdecl remote_GetComponentState(MSIHANDLE hinst, BSTR component, +UINT __cdecl remote_GetComponentState(MSIHANDLE hinst, LPCWSTR component, INSTALLSTATE *installed, INSTALLSTATE *action) { - UINT r = MsiGetComponentStateW(hinst, component, installed, action); - return HRESULT_FROM_WIN32(r); + return MsiGetComponentStateW(hinst, component, installed, action); } HRESULT __cdecl remote_SetComponentState(MSIHANDLE hinst, BSTR component, INSTALLSTATE state) diff --git a/dll/win32/msi/winemsi.idl b/dll/win32/msi/winemsi.idl index 8bdc10dcddc..59964871cb3 100644 --- a/dll/win32/msi/winemsi.idl +++ b/dll/win32/msi/winemsi.idl @@ -83,7 +83,7 @@ interface IWineMsiRemote UINT remote_SetMode( [in] MSIHANDLE hinst, [in] MSIRUNMODE mode, [in] BOOL state ); UINT remote_GetFeatureState( [in] MSIHANDLE hinst, [in, string] LPCWSTR feature, [out] INSTALLSTATE *installed, [out] INSTALLSTATE *action ); UINT remote_SetFeatureState( [in] MSIHANDLE hinst, [in, string] LPCWSTR feature, [in] INSTALLSTATE state ); - HRESULT remote_GetComponentState( [in] MSIHANDLE hinst, [in] BSTR component, [out] INSTALLSTATE *installed, [out] INSTALLSTATE *action ); + UINT remote_GetComponentState( [in] MSIHANDLE hinst, [in, string] LPCWSTR component, [out] INSTALLSTATE *installed, [out] INSTALLSTATE *action ); HRESULT remote_SetComponentState( [in] MSIHANDLE hinst, [in] BSTR component, [in] INSTALLSTATE state ); HRESULT remote_GetLanguage( [in] MSIHANDLE hinst, [out] LANGID *language ); HRESULT remote_SetInstallLevel( [in] MSIHANDLE hinst, [in] int level ); diff --git a/modules/rostests/winetests/msi/custom.c b/modules/rostests/winetests/msi/custom.c index b30953a8553..b2c9352e27d 100644 --- a/modules/rostests/winetests/msi/custom.c +++ b/modules/rostests/winetests/msi/custom.c @@ -655,6 +655,8 @@ static void test_feature_states(MSIHANDLE hinst) INSTALLSTATE state, action; UINT r; + /* test feature states */ + r = MsiGetFeatureStateA(hinst, NULL, &state, &action); ok(hinst, r == ERROR_UNKNOWN_FEATURE, "got %u\n", r); @@ -688,6 +690,35 @@ static void test_feature_states(MSIHANDLE hinst) r = MsiGetFeatureStateA(hinst, "One", &state, &action); ok(hinst, !r, "got %u\n", r); ok(hinst, action == INSTALLSTATE_LOCAL, "got action %d\n", action); + + /* test component states */ + + r = MsiGetComponentStateA(hinst, NULL, &state, &action); + ok(hinst, r == ERROR_UNKNOWN_COMPONENT, "got %u\n", r); + + r = MsiGetComponentStateA(hinst, "fake", &state, &action); + ok(hinst, r == ERROR_UNKNOWN_COMPONENT, "got %u\n", r); + + r = MsiGetComponentStateA(hinst, "One", NULL, &action); + ok(hinst, r == RPC_X_NULL_REF_POINTER, "got %u\n", r); + + r = MsiGetComponentStateA(hinst, "One", &state, NULL); + ok(hinst, r == RPC_X_NULL_REF_POINTER, "got %u\n", r); + + r = MsiGetComponentStateA(hinst, "One", &state, &action); + ok(hinst, !r, "got %u\n", r); + ok(hinst, state == INSTALLSTATE_ABSENT, "got state %d\n", state); + ok(hinst, action == INSTALLSTATE_LOCAL, "got action %d\n", action); + + r = MsiGetComponentStateA(hinst, "dangler", &state, &action); + ok(hinst, !r, "got %u\n", r); + ok(hinst, state == INSTALLSTATE_ABSENT, "got state %d\n", state); + ok(hinst, action == INSTALLSTATE_UNKNOWN, "got action %d\n", action); + + r = MsiGetComponentStateA(hinst, "component", &state, &action); + ok(hinst, !r, "got %u\n", r); + ok(hinst, state == INSTALLSTATE_UNKNOWN, "got state %d\n", state); + ok(hinst, action == INSTALLSTATE_LOCAL, "got action %d\n", action); } /* Main test. Anything that doesn't depend on a specific install configuration
2 years, 7 months
1
0
0
0
[reactos] 35/360: [WINESYNC] msi: Make MsiSetFeatureState() RPC-compatible.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=5bbed507957d97702dfff…
commit 5bbed507957d97702dfff605bb73e03ddc20d47c Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sat Mar 12 15:12:02 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:27:40 2022 +0100 [WINESYNC] msi: Make MsiSetFeatureState() RPC-compatible. 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 863680d5edcdb9fd62910cd7266658d2e3a0e743 by Zebediah Figura <z.figura12(a)gmail.com> --- dll/win32/msi/install.c | 26 ++++---------------------- dll/win32/msi/package.c | 5 ++--- dll/win32/msi/winemsi.idl | 2 +- modules/rostests/winetests/msi/custom.c | 17 +++++++++++++++++ 4 files changed, 24 insertions(+), 26 deletions(-) diff --git a/dll/win32/msi/install.c b/dll/win32/msi/install.c index 706fdb47955..1ff3ad98804 100644 --- a/dll/win32/msi/install.c +++ b/dll/win32/msi/install.c @@ -685,9 +685,6 @@ UINT WINAPI MsiSetFeatureStateA(MSIHANDLE hInstall, LPCSTR szFeature, szwFeature = strdupAtoW(szFeature); - if (!szwFeature) - return ERROR_FUNCTION_FAILED; - rc = MsiSetFeatureStateW(hInstall,szwFeature, iState); msi_free(szwFeature); @@ -818,33 +815,18 @@ UINT WINAPI MsiSetFeatureStateW(MSIHANDLE hInstall, LPCWSTR szFeature, TRACE("%s %i\n",debugstr_w(szFeature), iState); + if (!szFeature) + return ERROR_UNKNOWN_FEATURE; + package = msihandle2msiinfo(hInstall, MSIHANDLETYPE_PACKAGE); if (!package) { MSIHANDLE remote; - HRESULT hr; - BSTR feature; if (!(remote = msi_get_remote(hInstall))) return ERROR_INVALID_HANDLE; - feature = SysAllocString(szFeature); - if (!feature) - return ERROR_OUTOFMEMORY; - - hr = remote_SetFeatureState(remote, feature, iState); - - SysFreeString(feature); - - if (FAILED(hr)) - { - if (HRESULT_FACILITY(hr) == FACILITY_WIN32) - return HRESULT_CODE(hr); - - return ERROR_FUNCTION_FAILED; - } - - return ERROR_SUCCESS; + return remote_SetFeatureState(remote, szFeature, iState); } rc = MSI_SetFeatureStateW(package,szFeature,iState); diff --git a/dll/win32/msi/package.c b/dll/win32/msi/package.c index ed7216b85ab..c0ec5a3aa7a 100644 --- a/dll/win32/msi/package.c +++ b/dll/win32/msi/package.c @@ -2536,10 +2536,9 @@ UINT __cdecl remote_GetFeatureState(MSIHANDLE hinst, LPCWSTR feature, return MsiGetFeatureStateW(hinst, feature, installed, action); } -HRESULT __cdecl remote_SetFeatureState(MSIHANDLE hinst, BSTR feature, INSTALLSTATE state) +UINT __cdecl remote_SetFeatureState(MSIHANDLE hinst, LPCWSTR feature, INSTALLSTATE state) { - UINT r = MsiSetFeatureStateW(hinst, feature, state); - return HRESULT_FROM_WIN32(r); + return MsiSetFeatureStateW(hinst, feature, state); } HRESULT __cdecl remote_GetComponentState(MSIHANDLE hinst, BSTR component, diff --git a/dll/win32/msi/winemsi.idl b/dll/win32/msi/winemsi.idl index 091ef16504c..8bdc10dcddc 100644 --- a/dll/win32/msi/winemsi.idl +++ b/dll/win32/msi/winemsi.idl @@ -82,7 +82,7 @@ interface IWineMsiRemote BOOL remote_GetMode( [in] MSIHANDLE hinst, [in] MSIRUNMODE mode ); UINT remote_SetMode( [in] MSIHANDLE hinst, [in] MSIRUNMODE mode, [in] BOOL state ); UINT remote_GetFeatureState( [in] MSIHANDLE hinst, [in, string] LPCWSTR feature, [out] INSTALLSTATE *installed, [out] INSTALLSTATE *action ); - HRESULT remote_SetFeatureState( [in] MSIHANDLE hinst, [in] BSTR feature, [in] INSTALLSTATE state ); + UINT remote_SetFeatureState( [in] MSIHANDLE hinst, [in, string] LPCWSTR feature, [in] INSTALLSTATE state ); HRESULT remote_GetComponentState( [in] MSIHANDLE hinst, [in] BSTR component, [out] INSTALLSTATE *installed, [out] INSTALLSTATE *action ); HRESULT remote_SetComponentState( [in] MSIHANDLE hinst, [in] BSTR component, [in] INSTALLSTATE state ); HRESULT remote_GetLanguage( [in] MSIHANDLE hinst, [out] LANGID *language ); diff --git a/modules/rostests/winetests/msi/custom.c b/modules/rostests/winetests/msi/custom.c index ef4e282ea7f..b30953a8553 100644 --- a/modules/rostests/winetests/msi/custom.c +++ b/modules/rostests/winetests/msi/custom.c @@ -671,6 +671,23 @@ static void test_feature_states(MSIHANDLE hinst) ok(hinst, !r, "got %u\n", r); ok(hinst, state == INSTALLSTATE_ABSENT, "got state %d\n", state); ok(hinst, action == INSTALLSTATE_LOCAL, "got action %d\n", action); + + r = MsiSetFeatureStateA(hinst, NULL, INSTALLSTATE_ABSENT); + ok(hinst, r == ERROR_UNKNOWN_FEATURE, "got %u\n", r); + + r = MsiSetFeatureStateA(hinst, "One", INSTALLSTATE_ADVERTISED); + ok(hinst, !r, "got %u\n", r); + + r = MsiGetFeatureStateA(hinst, "One", &state, &action); + ok(hinst, !r, "got %u\n", r); + ok(hinst, action == INSTALLSTATE_ADVERTISED, "got action %d\n", action); + + r = MsiSetFeatureStateA(hinst, "One", INSTALLSTATE_LOCAL); + ok(hinst, !r, "got %u\n", r); + + r = MsiGetFeatureStateA(hinst, "One", &state, &action); + ok(hinst, !r, "got %u\n", r); + ok(hinst, action == INSTALLSTATE_LOCAL, "got action %d\n", action); } /* Main test. Anything that doesn't depend on a specific install configuration
2 years, 7 months
1
0
0
0
[reactos] 34/360: [WINESYNC] msi: Make MsiGetFeatureState() RPC-compatible.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=ed5fbe399d6f2e85e24b8…
commit ed5fbe399d6f2e85e24b8a9e960d94e5fb58d69a Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sat Mar 12 15:12:01 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:27:40 2022 +0100 [WINESYNC] msi: Make MsiGetFeatureState() RPC-compatible. 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 9f428f592dc949d528c149692addf8e34f3f005b by Zebediah Figura <z.figura12(a)gmail.com> --- dll/win32/msi/install.c | 25 +++++++------------------ dll/win32/msi/package.c | 5 ++--- dll/win32/msi/winemsi.idl | 2 +- modules/rostests/winetests/msi/custom.c | 24 ++++++++++++++++++++++++ 4 files changed, 34 insertions(+), 22 deletions(-) diff --git a/dll/win32/msi/install.c b/dll/win32/msi/install.c index 17a0cd516eb..706fdb47955 100644 --- a/dll/win32/msi/install.c +++ b/dll/win32/msi/install.c @@ -964,33 +964,22 @@ UINT WINAPI MsiGetFeatureStateW(MSIHANDLE hInstall, LPCWSTR szFeature, TRACE("%d %s %p %p\n", hInstall, debugstr_w(szFeature), piInstalled, piAction); + if (!szFeature) + return ERROR_UNKNOWN_FEATURE; + package = msihandle2msiinfo(hInstall, MSIHANDLETYPE_PACKAGE); if (!package) { MSIHANDLE remote; - HRESULT hr; - BSTR feature; if (!(remote = msi_get_remote(hInstall))) return ERROR_INVALID_HANDLE; - feature = SysAllocString(szFeature); - if (!feature) - return ERROR_OUTOFMEMORY; - - hr = remote_GetFeatureState(remote, feature, piInstalled, piAction); - - SysFreeString(feature); + /* FIXME: should use SEH */ + if (!piInstalled || !piAction) + return RPC_X_NULL_REF_POINTER; - if (FAILED(hr)) - { - if (HRESULT_FACILITY(hr) == FACILITY_WIN32) - return HRESULT_CODE(hr); - - return ERROR_FUNCTION_FAILED; - } - - return ERROR_SUCCESS; + return remote_GetFeatureState(remote, szFeature, piInstalled, piAction); } ret = MSI_GetFeatureStateW(package, szFeature, piInstalled, piAction); diff --git a/dll/win32/msi/package.c b/dll/win32/msi/package.c index 25fe859dfd6..ed7216b85ab 100644 --- a/dll/win32/msi/package.c +++ b/dll/win32/msi/package.c @@ -2530,11 +2530,10 @@ UINT __cdecl remote_SetMode(MSIHANDLE hinst, MSIRUNMODE mode, BOOL state) return MsiSetMode(hinst, mode, state); } -HRESULT __cdecl remote_GetFeatureState(MSIHANDLE hinst, BSTR feature, +UINT __cdecl remote_GetFeatureState(MSIHANDLE hinst, LPCWSTR feature, INSTALLSTATE *installed, INSTALLSTATE *action) { - UINT r = MsiGetFeatureStateW(hinst, feature, installed, action); - return HRESULT_FROM_WIN32(r); + return MsiGetFeatureStateW(hinst, feature, installed, action); } HRESULT __cdecl remote_SetFeatureState(MSIHANDLE hinst, BSTR feature, INSTALLSTATE state) diff --git a/dll/win32/msi/winemsi.idl b/dll/win32/msi/winemsi.idl index c4c7e88db83..091ef16504c 100644 --- a/dll/win32/msi/winemsi.idl +++ b/dll/win32/msi/winemsi.idl @@ -81,7 +81,7 @@ interface IWineMsiRemote UINT remote_GetSourcePath( [in] MSIHANDLE hinst, [in, string] LPCWSTR folder, [out, string] LPWSTR *value ); BOOL remote_GetMode( [in] MSIHANDLE hinst, [in] MSIRUNMODE mode ); UINT remote_SetMode( [in] MSIHANDLE hinst, [in] MSIRUNMODE mode, [in] BOOL state ); - HRESULT remote_GetFeatureState( [in] MSIHANDLE hinst, [in] BSTR feature, [out] INSTALLSTATE *installed, [out] INSTALLSTATE *action ); + UINT remote_GetFeatureState( [in] MSIHANDLE hinst, [in, string] LPCWSTR feature, [out] INSTALLSTATE *installed, [out] INSTALLSTATE *action ); HRESULT remote_SetFeatureState( [in] MSIHANDLE hinst, [in] BSTR feature, [in] INSTALLSTATE state ); HRESULT remote_GetComponentState( [in] MSIHANDLE hinst, [in] BSTR component, [out] INSTALLSTATE *installed, [out] INSTALLSTATE *action ); HRESULT remote_SetComponentState( [in] MSIHANDLE hinst, [in] BSTR component, [in] INSTALLSTATE state ); diff --git a/modules/rostests/winetests/msi/custom.c b/modules/rostests/winetests/msi/custom.c index 5f2ff5db095..ef4e282ea7f 100644 --- a/modules/rostests/winetests/msi/custom.c +++ b/modules/rostests/winetests/msi/custom.c @@ -650,6 +650,29 @@ static void test_mode(MSIHANDLE hinst) ok(hinst, !r, "got %u\n", r); } +static void test_feature_states(MSIHANDLE hinst) +{ + INSTALLSTATE state, action; + UINT r; + + r = MsiGetFeatureStateA(hinst, NULL, &state, &action); + ok(hinst, r == ERROR_UNKNOWN_FEATURE, "got %u\n", r); + + r = MsiGetFeatureStateA(hinst, "fake", &state, &action); + ok(hinst, r == ERROR_UNKNOWN_FEATURE, "got %u\n", r); + + r = MsiGetFeatureStateA(hinst, "One", NULL, &action); + ok(hinst, r == RPC_X_NULL_REF_POINTER, "got %u\n", r); + + r = MsiGetFeatureStateA(hinst, "One", &state, NULL); + ok(hinst, r == RPC_X_NULL_REF_POINTER, "got %u\n", r); + + r = MsiGetFeatureStateA(hinst, "One", &state, &action); + ok(hinst, !r, "got %u\n", r); + ok(hinst, state == INSTALLSTATE_ABSENT, "got state %d\n", state); + ok(hinst, action == INSTALLSTATE_LOCAL, "got action %d\n", action); +} + /* Main test. Anything that doesn't depend on a specific install configuration * or have undesired side effects should go here. */ UINT WINAPI main_test(MSIHANDLE hinst) @@ -678,6 +701,7 @@ UINT WINAPI main_test(MSIHANDLE hinst) test_doaction(hinst); test_targetpath(hinst); test_mode(hinst); + test_feature_states(hinst); return ERROR_SUCCESS; }
2 years, 7 months
1
0
0
0
[reactos] 33/360: [WINESYNC] msi: Make MsiSetMode() RPC-compatible.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=5219367eac2c53be7df13…
commit 5219367eac2c53be7df13c7c536d346ec3c8d731 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sat Mar 12 15:12:01 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:27:40 2022 +0100 [WINESYNC] msi: Make MsiSetMode() RPC-compatible. 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 1723536058c73b71894f60ab2c030e78948abe45 by Zebediah Figura <z.figura12(a)gmail.com> --- dll/win32/msi/install.c | 13 +------------ dll/win32/msi/package.c | 5 ++--- dll/win32/msi/winemsi.idl | 2 +- modules/rostests/winetests/msi/custom.c | 9 +++++++++ 4 files changed, 13 insertions(+), 16 deletions(-) diff --git a/dll/win32/msi/install.c b/dll/win32/msi/install.c index 3ac151d36c8..17a0cd516eb 100644 --- a/dll/win32/msi/install.c +++ b/dll/win32/msi/install.c @@ -644,22 +644,11 @@ UINT WINAPI MsiSetMode(MSIHANDLE hInstall, MSIRUNMODE iRunMode, BOOL fState) if (!package) { MSIHANDLE remote; - HRESULT hr; if (!(remote = msi_get_remote(hInstall))) return FALSE; - hr = remote_SetMode(remote, iRunMode, fState); - - if (FAILED(hr)) - { - if (HRESULT_FACILITY(hr) == FACILITY_WIN32) - return HRESULT_CODE(hr); - - return ERROR_FUNCTION_FAILED; - } - - return ERROR_SUCCESS; + return remote_SetMode(remote, iRunMode, fState); } switch (iRunMode) diff --git a/dll/win32/msi/package.c b/dll/win32/msi/package.c index d77b692a771..25fe859dfd6 100644 --- a/dll/win32/msi/package.c +++ b/dll/win32/msi/package.c @@ -2525,10 +2525,9 @@ BOOL __cdecl remote_GetMode(MSIHANDLE hinst, MSIRUNMODE mode) return MsiGetMode(hinst, mode); } -HRESULT __cdecl remote_SetMode(MSIHANDLE hinst, MSIRUNMODE mode, BOOL state) +UINT __cdecl remote_SetMode(MSIHANDLE hinst, MSIRUNMODE mode, BOOL state) { - UINT r = MsiSetMode(hinst, mode, state); - return HRESULT_FROM_WIN32(r); + return MsiSetMode(hinst, mode, state); } HRESULT __cdecl remote_GetFeatureState(MSIHANDLE hinst, BSTR feature, diff --git a/dll/win32/msi/winemsi.idl b/dll/win32/msi/winemsi.idl index 7282c771a9c..c4c7e88db83 100644 --- a/dll/win32/msi/winemsi.idl +++ b/dll/win32/msi/winemsi.idl @@ -80,7 +80,7 @@ interface IWineMsiRemote UINT remote_SetTargetPath( [in] MSIHANDLE hinst, [in, string] LPCWSTR folder, [in, string] LPCWSTR value ); UINT remote_GetSourcePath( [in] MSIHANDLE hinst, [in, string] LPCWSTR folder, [out, string] LPWSTR *value ); BOOL remote_GetMode( [in] MSIHANDLE hinst, [in] MSIRUNMODE mode ); - HRESULT remote_SetMode( [in] MSIHANDLE hinst, [in] MSIRUNMODE mode, [in] BOOL state ); + UINT remote_SetMode( [in] MSIHANDLE hinst, [in] MSIRUNMODE mode, [in] BOOL state ); HRESULT remote_GetFeatureState( [in] MSIHANDLE hinst, [in] BSTR feature, [out] INSTALLSTATE *installed, [out] INSTALLSTATE *action ); HRESULT remote_SetFeatureState( [in] MSIHANDLE hinst, [in] BSTR feature, [in] INSTALLSTATE state ); HRESULT remote_GetComponentState( [in] MSIHANDLE hinst, [in] BSTR component, [out] INSTALLSTATE *installed, [out] INSTALLSTATE *action ); diff --git a/modules/rostests/winetests/msi/custom.c b/modules/rostests/winetests/msi/custom.c index d596f1ec328..5f2ff5db095 100644 --- a/modules/rostests/winetests/msi/custom.c +++ b/modules/rostests/winetests/msi/custom.c @@ -642,6 +642,14 @@ static void test_targetpath(MSIHANDLE hinst) ok(hinst, sz == srcsz, "got size %u\n", sz); } +static void test_mode(MSIHANDLE hinst) +{ + UINT r; + + r = MsiSetMode(hinst, MSIRUNMODE_REBOOTATEND, FALSE); + ok(hinst, !r, "got %u\n", r); +} + /* Main test. Anything that doesn't depend on a specific install configuration * or have undesired side effects should go here. */ UINT WINAPI main_test(MSIHANDLE hinst) @@ -669,6 +677,7 @@ UINT WINAPI main_test(MSIHANDLE hinst) test_db(hinst); test_doaction(hinst); test_targetpath(hinst); + test_mode(hinst); return ERROR_SUCCESS; }
2 years, 7 months
1
0
0
0
[reactos] 32/360: [WINESYNC] msi: Make MsiGetMode() RPC-compatible.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=83bbe8c85b233cd2ad45f…
commit 83bbe8c85b233cd2ad45fee1f49b256d79481e57 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sat Mar 12 15:12:00 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:27:39 2022 +0100 [WINESYNC] msi: Make MsiGetMode() RPC-compatible. 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 9091c3dcf2e4c7775926c0a7a3f82f2e491eb849 by Zebediah Figura <z.figura12(a)gmail.com> --- dll/win32/msi/install.c | 9 +-------- dll/win32/msi/package.c | 5 ++--- dll/win32/msi/winemsi.idl | 2 +- 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/dll/win32/msi/install.c b/dll/win32/msi/install.c index 88b3ff518e2..3ac151d36c8 100644 --- a/dll/win32/msi/install.c +++ b/dll/win32/msi/install.c @@ -561,18 +561,11 @@ BOOL WINAPI MsiGetMode(MSIHANDLE hInstall, MSIRUNMODE iRunMode) if (!package) { MSIHANDLE remote; - BOOL ret; - HRESULT hr; if (!(remote = msi_get_remote(hInstall))) return FALSE; - hr = remote_GetMode(remote, iRunMode, &ret); - - if (hr == S_OK) - return ret; - - return FALSE; + return remote_GetMode(remote, iRunMode); } switch (iRunMode) diff --git a/dll/win32/msi/package.c b/dll/win32/msi/package.c index 1e554af5eee..d77b692a771 100644 --- a/dll/win32/msi/package.c +++ b/dll/win32/msi/package.c @@ -2520,10 +2520,9 @@ UINT __cdecl remote_GetSourcePath(MSIHANDLE hinst, LPCWSTR folder, LPWSTR *value return r; } -HRESULT __cdecl remote_GetMode(MSIHANDLE hinst, MSIRUNMODE mode, BOOL *ret) +BOOL __cdecl remote_GetMode(MSIHANDLE hinst, MSIRUNMODE mode) { - *ret = MsiGetMode(hinst, mode); - return S_OK; + return MsiGetMode(hinst, mode); } HRESULT __cdecl remote_SetMode(MSIHANDLE hinst, MSIRUNMODE mode, BOOL state) diff --git a/dll/win32/msi/winemsi.idl b/dll/win32/msi/winemsi.idl index 06db52e5fc5..7282c771a9c 100644 --- a/dll/win32/msi/winemsi.idl +++ b/dll/win32/msi/winemsi.idl @@ -79,7 +79,7 @@ interface IWineMsiRemote UINT remote_GetTargetPath( [in] MSIHANDLE hinst, [in, string] LPCWSTR folder, [out, string] LPWSTR *value ); UINT remote_SetTargetPath( [in] MSIHANDLE hinst, [in, string] LPCWSTR folder, [in, string] LPCWSTR value ); UINT remote_GetSourcePath( [in] MSIHANDLE hinst, [in, string] LPCWSTR folder, [out, string] LPWSTR *value ); - HRESULT remote_GetMode( [in] MSIHANDLE hinst, [in] MSIRUNMODE mode, [out] BOOL *ret ); + BOOL remote_GetMode( [in] MSIHANDLE hinst, [in] MSIRUNMODE mode ); HRESULT remote_SetMode( [in] MSIHANDLE hinst, [in] MSIRUNMODE mode, [in] BOOL state ); HRESULT remote_GetFeatureState( [in] MSIHANDLE hinst, [in] BSTR feature, [out] INSTALLSTATE *installed, [out] INSTALLSTATE *action ); HRESULT remote_SetFeatureState( [in] MSIHANDLE hinst, [in] BSTR feature, [in] INSTALLSTATE state );
2 years, 7 months
1
0
0
0
← Newer
1
...
34
35
36
37
38
39
40
...
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