ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
March 2022
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
20 participants
436 discussions
Start a n
N
ew thread
[reactos] 31/360: [WINESYNC] msi: Avoid returning an uninitialized variable.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=8c04add139d9279889c4a…
commit 8c04add139d9279889c4a2bc5f9002d36c4b3bf4 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: Avoid returning an uninitialized variable. 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 859f455cb95a37e11f1187731be530fc9b48da8a by Zebediah Figura <z.figura12(a)gmail.com> --- dll/win32/msi/record.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dll/win32/msi/record.c b/dll/win32/msi/record.c index 58040468993..a7d55888a9d 100644 --- a/dll/win32/msi/record.c +++ b/dll/win32/msi/record.c @@ -1059,7 +1059,7 @@ UINT copy_remote_record(const struct wire_record *in, MSIHANDLE out) { MSIRECORD *rec; unsigned int i; - UINT r; + UINT r = ERROR_SUCCESS; if (!(rec = msihandle2msiinfo(out, MSIHANDLETYPE_RECORD))) return ERROR_INVALID_HANDLE;
2 years, 9 months
1
0
0
0
[reactos] 30/360: [WINESYNC] msi: Make MsiGetSourcePath() RPC-compatible.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=4253f35129732f579b9f9…
commit 4253f35129732f579b9f9c21f9728f472756cc05 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sat Mar 12 15:11:59 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:27:39 2022 +0100 [WINESYNC] msi: Make MsiGetSourcePath() 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 d2b0981a2ceb8371460f009e0250ad2690ca0e93 by Zebediah Figura <z.figura12(a)gmail.com> --- dll/win32/msi/install.c | 41 ++------------- dll/win32/msi/package.c | 17 +++++-- dll/win32/msi/winemsi.idl | 2 +- modules/rostests/winetests/msi/custom.c | 89 +++++++++++++++++++++++++++++++-- 4 files changed, 106 insertions(+), 43 deletions(-) diff --git a/dll/win32/msi/install.c b/dll/win32/msi/install.c index ba329eb8f80..88b3ff518e2 100644 --- a/dll/win32/msi/install.c +++ b/dll/win32/msi/install.c @@ -334,50 +334,19 @@ static UINT MSI_GetSourcePath( MSIHANDLE hInstall, LPCWSTR szFolder, package = msihandle2msiinfo( hInstall, MSIHANDLETYPE_PACKAGE ); if (!package) { - HRESULT hr; LPWSTR value = NULL; MSIHANDLE remote; - BSTR folder; - DWORD len; if (!(remote = msi_get_remote(hInstall))) return ERROR_INVALID_HANDLE; - folder = SysAllocString( szFolder ); - if (!folder) - return ERROR_OUTOFMEMORY; - - len = 0; - hr = remote_GetSourcePath(remote, folder, NULL, &len); - if (FAILED(hr)) - goto done; - - len++; - value = msi_alloc(len * sizeof(WCHAR)); - if (!value) - { - r = ERROR_OUTOFMEMORY; - goto done; - } - - hr = remote_GetSourcePath(remote, folder, value, &len); - if (FAILED(hr)) - goto done; - - r = msi_strcpy_to_awstring( value, len, szPathBuf, pcchPathBuf ); - -done: - SysFreeString( folder ); - msi_free( value ); - - if (FAILED(hr)) - { - if (HRESULT_FACILITY(hr) == FACILITY_WIN32) - return HRESULT_CODE(hr); + r = remote_GetSourcePath(remote, szFolder, &value); + if (r != ERROR_SUCCESS) + return r; - return ERROR_FUNCTION_FAILED; - } + r = msi_strcpy_to_awstring(value, -1, szPathBuf, pcchPathBuf); + midl_user_free(value); return r; } diff --git a/dll/win32/msi/package.c b/dll/win32/msi/package.c index 89ac2ce3a6f..1e554af5eee 100644 --- a/dll/win32/msi/package.c +++ b/dll/win32/msi/package.c @@ -2503,10 +2503,21 @@ UINT __cdecl remote_SetTargetPath(MSIHANDLE hinst, LPCWSTR folder, LPCWSTR value return MsiSetTargetPathW(hinst, folder, value); } -HRESULT __cdecl remote_GetSourcePath(MSIHANDLE hinst, BSTR folder, BSTR value, DWORD *size) +UINT __cdecl remote_GetSourcePath(MSIHANDLE hinst, LPCWSTR folder, LPWSTR *value) { - UINT r = MsiGetSourcePathW(hinst, folder, value, size); - return HRESULT_FROM_WIN32(r); + WCHAR empty[1]; + DWORD size = 1; + UINT r; + + r = MsiGetSourcePathW(hinst, folder, empty, &size); + if (r == ERROR_MORE_DATA) + { + *value = midl_user_allocate(++size * sizeof(WCHAR)); + if (!*value) + return ERROR_OUTOFMEMORY; + r = MsiGetSourcePathW(hinst, folder, *value, &size); + } + return r; } HRESULT __cdecl remote_GetMode(MSIHANDLE hinst, MSIRUNMODE mode, BOOL *ret) diff --git a/dll/win32/msi/winemsi.idl b/dll/win32/msi/winemsi.idl index a0e1ddbb840..06db52e5fc5 100644 --- a/dll/win32/msi/winemsi.idl +++ b/dll/win32/msi/winemsi.idl @@ -78,7 +78,7 @@ interface IWineMsiRemote UINT remote_Sequence( [in] MSIHANDLE hinst, [in, string] LPCWSTR table, [in] int sequence ); 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 ); - HRESULT remote_GetSourcePath( [in] MSIHANDLE hinst, [in] BSTR folder, [out, size_is(*size)] BSTR value, [in, out] DWORD *size ); + 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 ); 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 ); diff --git a/modules/rostests/winetests/msi/custom.c b/modules/rostests/winetests/msi/custom.c index 111032c37a4..d596f1ec328 100644 --- a/modules/rostests/winetests/msi/custom.c +++ b/modules/rostests/winetests/msi/custom.c @@ -458,9 +458,9 @@ static void test_targetpath(MSIHANDLE hinst) static const WCHAR targetdirW[] = {'T','A','R','G','E','T','D','I','R',0}; static const WCHAR xyzW[] = {'C',':','\\',0}; static const WCHAR xyW[] = {'C',':',0}; - char buffer[20]; - WCHAR bufferW[20]; - DWORD sz; + WCHAR bufferW[100]; + char buffer[100]; + DWORD sz, srcsz; UINT r; /* test invalid values */ @@ -557,6 +557,89 @@ static void test_targetpath(MSIHANDLE hinst) ok(hinst, !strcmp(buffer, "C:\\subdir\\"), "got \"%s\"\n", buffer); r = MsiSetTargetPathA(hinst, "TARGETDIR", "C:\\"); + + /* test GetSourcePath() */ + + r = MsiGetSourcePathA(hinst, NULL, NULL, NULL); + ok(hinst, r == ERROR_INVALID_PARAMETER, "got %u\n", r); + + r = MsiGetSourcePathA(hinst, "TARGETDIR", NULL, NULL ); + ok(hinst, !r, "got %u\n", r); + + r = MsiGetSourcePathA(hinst, "TARGETDIR", buffer, NULL ); + ok(hinst, r == ERROR_INVALID_PARAMETER, "got %u\n", r); + + /* Returned size is in bytes, not chars, but only for custom actions. + * Seems to be a casualty of RPC... */ + + srcsz = 0; + MsiGetSourcePathW(hinst, targetdirW, NULL, &srcsz); + + sz = 0; + r = MsiGetSourcePathA(hinst, "TARGETDIR", NULL, &sz); + ok(hinst, !r, "got %u\n", r); + todo_wine_ok(hinst, sz == srcsz * 2, "got size %u\n", sz); + + sz = 0; + strcpy(buffer,"q"); + r = MsiGetSourcePathA(hinst, "TARGETDIR", 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 == srcsz * 2, "got size %u\n", sz); + + sz = 1; + strcpy(buffer,"x"); + r = MsiGetSourcePathA(hinst, "TARGETDIR", 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 == srcsz * 2, "got size %u\n", sz); + + sz = srcsz; + strcpy(buffer,"x"); + r = MsiGetSourcePathA(hinst, "TARGETDIR", buffer, &sz); + ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r); + ok(hinst, strlen(buffer) == srcsz - 1, "wrong buffer length %d\n", strlen(buffer)); + todo_wine_ok(hinst, sz == srcsz * 2, "got size %u\n", sz); + + sz = srcsz + 1; + strcpy(buffer,"x"); + r = MsiGetSourcePathA(hinst, "TARGETDIR", buffer, &sz); + ok(hinst, !r, "got %u\n", r); + ok(hinst, strlen(buffer) == srcsz, "wrong buffer length %d\n", strlen(buffer)); + ok(hinst, sz == srcsz, "got size %u\n", sz); + + sz = 0; + r = MsiGetSourcePathW(hinst, targetdirW, NULL, &sz); + ok(hinst, !r, "got %u\n", r); + ok(hinst, sz == srcsz, "got size %u\n", sz); + + sz = 0; + bufferW[0] = 'q'; + r = MsiGetSourcePathW(hinst, targetdirW, 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 == srcsz, "got size %u\n", sz); + + sz = 1; + bufferW[0] = 'q'; + r = MsiGetSourcePathW(hinst, targetdirW, 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 == srcsz, "got size %u\n", sz); + + sz = srcsz; + bufferW[0] = 'q'; + r = MsiGetSourcePathW(hinst, targetdirW, bufferW, &sz); + ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r); + ok(hinst, lstrlenW(bufferW) == srcsz - 1, "wrong buffer length %d\n", lstrlenW(bufferW)); + ok(hinst, sz == srcsz, "got size %u\n", sz); + + sz = srcsz + 1; + bufferW[0] = 'q'; + r = MsiGetSourcePathW(hinst, targetdirW, bufferW, &sz); + ok(hinst, !r, "got %u\n", r); + ok(hinst, lstrlenW(bufferW) == srcsz, "wrong buffer length %d\n", lstrlenW(bufferW)); + ok(hinst, sz == srcsz, "got size %u\n", sz); } /* Main test. Anything that doesn't depend on a specific install configuration
2 years, 9 months
1
0
0
0
[reactos] 29/360: [WINESYNC] msi: Make MsiSetTargetPath() RPC-compatible.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=a5e210012b47ce77f04c0…
commit a5e210012b47ce77f04c0ff977a1afc8fb4d288d Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sat Mar 12 15:11:59 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:27:39 2022 +0100 [WINESYNC] msi: Make MsiSetTargetPath() 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 e5fba6d23ee82229582a0cf19a455b3c5ca43776 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 | 16 ++++++++++++++++ 4 files changed, 20 insertions(+), 29 deletions(-) diff --git a/dll/win32/msi/install.c b/dll/win32/msi/install.c index 68d8eb573aa..ba329eb8f80 100644 --- a/dll/win32/msi/install.c +++ b/dll/win32/msi/install.c @@ -535,36 +535,12 @@ UINT WINAPI MsiSetTargetPathW(MSIHANDLE hInstall, LPCWSTR szFolder, package = msihandle2msiinfo(hInstall, MSIHANDLETYPE_PACKAGE); if (!package) { - HRESULT hr; - BSTR folder, path; MSIHANDLE remote; if (!(remote = msi_get_remote(hInstall))) return ERROR_INVALID_HANDLE; - folder = SysAllocString( szFolder ); - path = SysAllocString( szFolderPath ); - if (!folder || !path) - { - SysFreeString(folder); - SysFreeString(path); - return ERROR_OUTOFMEMORY; - } - - hr = remote_SetTargetPath(remote, folder, path); - - SysFreeString(folder); - SysFreeString(path); - - if (FAILED(hr)) - { - if (HRESULT_FACILITY(hr) == FACILITY_WIN32) - return HRESULT_CODE(hr); - - return ERROR_FUNCTION_FAILED; - } - - return ERROR_SUCCESS; + return remote_SetTargetPath(remote, szFolder, szFolderPath); } ret = MSI_SetTargetPathW( package, szFolder, szFolderPath ); diff --git a/dll/win32/msi/package.c b/dll/win32/msi/package.c index f4d93e047a0..89ac2ce3a6f 100644 --- a/dll/win32/msi/package.c +++ b/dll/win32/msi/package.c @@ -2498,10 +2498,9 @@ UINT __cdecl remote_GetTargetPath(MSIHANDLE hinst, LPCWSTR folder, LPWSTR *value return r; } -HRESULT __cdecl remote_SetTargetPath(MSIHANDLE hinst, BSTR folder, BSTR value) +UINT __cdecl remote_SetTargetPath(MSIHANDLE hinst, LPCWSTR folder, LPCWSTR value) { - UINT r = MsiSetTargetPathW(hinst, folder, value); - return HRESULT_FROM_WIN32(r); + return MsiSetTargetPathW(hinst, folder, value); } HRESULT __cdecl remote_GetSourcePath(MSIHANDLE hinst, BSTR folder, BSTR value, DWORD *size) diff --git a/dll/win32/msi/winemsi.idl b/dll/win32/msi/winemsi.idl index 5e09c85b6cd..a0e1ddbb840 100644 --- a/dll/win32/msi/winemsi.idl +++ b/dll/win32/msi/winemsi.idl @@ -77,7 +77,7 @@ interface IWineMsiRemote UINT remote_DoAction( [in] MSIHANDLE hinst, [in, string] LPCWSTR action ); UINT remote_Sequence( [in] MSIHANDLE hinst, [in, string] LPCWSTR table, [in] int sequence ); UINT remote_GetTargetPath( [in] MSIHANDLE hinst, [in, string] LPCWSTR folder, [out, string] LPWSTR *value ); - HRESULT remote_SetTargetPath( [in] MSIHANDLE hinst, [in] BSTR folder, [in] BSTR value ); + UINT remote_SetTargetPath( [in] MSIHANDLE hinst, [in, string] LPCWSTR folder, [in, string] LPCWSTR value ); HRESULT remote_GetSourcePath( [in] MSIHANDLE hinst, [in] BSTR folder, [out, size_is(*size)] BSTR value, [in, out] DWORD *size ); HRESULT remote_GetMode( [in] MSIHANDLE hinst, [in] MSIRUNMODE mode, [out] BOOL *ret ); HRESULT remote_SetMode( [in] MSIHANDLE hinst, [in] MSIRUNMODE mode, [in] BOOL state ); diff --git a/modules/rostests/winetests/msi/custom.c b/modules/rostests/winetests/msi/custom.c index 5062ecd77f2..111032c37a4 100644 --- a/modules/rostests/winetests/msi/custom.c +++ b/modules/rostests/winetests/msi/custom.c @@ -541,6 +541,22 @@ static void test_targetpath(MSIHANDLE hinst) ok(hinst, !r, "got %u\n", r); ok(hinst, !lstrcmpW(bufferW, xyzW), "got %s\n", dbgstr_w(bufferW)); ok(hinst, sz == 3, "got size %u\n", sz); + + r = MsiSetTargetPathA(hinst, NULL, "C:\\subdir"); + ok(hinst, r == ERROR_INVALID_PARAMETER, "got %u\n", r); + + r = MsiSetTargetPathA(hinst, "TARGETDIR", NULL); + ok(hinst, r == ERROR_INVALID_PARAMETER, "got %u\n", r); + + r = MsiSetTargetPathA(hinst, "TARGETDIR", "C:\\subdir"); + ok(hinst, !r, "got %u\n", r); + + sz = sizeof(buffer); + r = MsiGetTargetPathA(hinst, "TARGETDIR", buffer, &sz); + ok(hinst, !r, "got %u\n", r); + ok(hinst, !strcmp(buffer, "C:\\subdir\\"), "got \"%s\"\n", buffer); + + r = MsiSetTargetPathA(hinst, "TARGETDIR", "C:\\"); } /* Main test. Anything that doesn't depend on a specific install configuration
2 years, 9 months
1
0
0
0
[reactos] 28/360: [WINESYNC] msi: Make MsiGetTargetPath() RPC-compatible.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=a529a627a963f0a253e8f…
commit a529a627a963f0a253e8f008515cbc7876ba48a9 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sat Mar 12 15:11:58 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:27:39 2022 +0100 [WINESYNC] msi: Make MsiGetTargetPath() 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 49d67080c97cbe89ea6f665f692c6d32db272a0f by Zebediah Figura <z.figura12(a)gmail.com> --- dll/win32/msi/install.c | 46 +++------------- dll/win32/msi/package.c | 17 ++++-- dll/win32/msi/winemsi.idl | 2 +- modules/rostests/winetests/msi/custom.c | 91 ++++++++++++++++++++++++++++++++ modules/rostests/winetests/msi/install.c | 11 ++++ 5 files changed, 125 insertions(+), 42 deletions(-) diff --git a/dll/win32/msi/install.c b/dll/win32/msi/install.c index 2a5ff403692..68d8eb573aa 100644 --- a/dll/win32/msi/install.c +++ b/dll/win32/msi/install.c @@ -27,7 +27,6 @@ #include "windef.h" #include "winbase.h" #include "winerror.h" -#include "wine/debug.h" #include "msi.h" #include "msidefs.h" #include "objbase.h" @@ -35,6 +34,8 @@ #include "msipriv.h" #include "winemsi.h" +#include "wine/heap.h" +#include "wine/debug.h" #include "wine/unicode.h" WINE_DEFAULT_DEBUG_CHANNEL(msi); @@ -200,50 +201,19 @@ static UINT MSI_GetTargetPath( MSIHANDLE hInstall, LPCWSTR szFolder, package = msihandle2msiinfo( hInstall, MSIHANDLETYPE_PACKAGE ); if (!package) { - MSIHANDLE remote; - HRESULT hr; LPWSTR value = NULL; - BSTR folder; - DWORD len; + MSIHANDLE remote; if (!(remote = msi_get_remote(hInstall))) return ERROR_INVALID_HANDLE; - folder = SysAllocString( szFolder ); - if (!folder) - return ERROR_OUTOFMEMORY; - - len = 0; - hr = remote_GetTargetPath(remote, folder, NULL, &len); - if (FAILED(hr)) - goto done; - - len++; - value = msi_alloc(len * sizeof(WCHAR)); - if (!value) - { - r = ERROR_OUTOFMEMORY; - goto done; - } - - hr = remote_GetTargetPath(remote, folder, value, &len); - if (FAILED(hr)) - goto done; - - r = msi_strcpy_to_awstring( value, len, szPathBuf, pcchPathBuf ); + r = remote_GetTargetPath(remote, szFolder, &value); + if (r != ERROR_SUCCESS) + return r; -done: - SysFreeString( folder ); - msi_free( 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, szPathBuf, pcchPathBuf); + midl_user_free(value); return r; } diff --git a/dll/win32/msi/package.c b/dll/win32/msi/package.c index 50bfd2133c5..f4d93e047a0 100644 --- a/dll/win32/msi/package.c +++ b/dll/win32/msi/package.c @@ -2481,10 +2481,21 @@ UINT __cdecl remote_Sequence(MSIHANDLE hinst, LPCWSTR table, int sequence) return MsiSequenceW(hinst, table, sequence); } -HRESULT __cdecl remote_GetTargetPath(MSIHANDLE hinst, BSTR folder, BSTR value, DWORD *size) +UINT __cdecl remote_GetTargetPath(MSIHANDLE hinst, LPCWSTR folder, LPWSTR *value) { - UINT r = MsiGetTargetPathW(hinst, folder, value, size); - return HRESULT_FROM_WIN32(r); + WCHAR empty[1]; + DWORD size = 0; + UINT r; + + r = MsiGetTargetPathW(hinst, folder, empty, &size); + if (r == ERROR_MORE_DATA) + { + *value = midl_user_allocate(++size * sizeof(WCHAR)); + if (!*value) + return ERROR_OUTOFMEMORY; + r = MsiGetTargetPathW(hinst, folder, *value, &size); + } + return r; } HRESULT __cdecl remote_SetTargetPath(MSIHANDLE hinst, BSTR folder, BSTR value) diff --git a/dll/win32/msi/winemsi.idl b/dll/win32/msi/winemsi.idl index d103e9aa068..5e09c85b6cd 100644 --- a/dll/win32/msi/winemsi.idl +++ b/dll/win32/msi/winemsi.idl @@ -76,7 +76,7 @@ interface IWineMsiRemote int remote_ProcessMessage( [in] MSIHANDLE hinst, [in] INSTALLMESSAGE message, [in] struct wire_record *record ); UINT remote_DoAction( [in] MSIHANDLE hinst, [in, string] LPCWSTR action ); UINT remote_Sequence( [in] MSIHANDLE hinst, [in, string] LPCWSTR table, [in] int sequence ); - HRESULT remote_GetTargetPath( [in] MSIHANDLE hinst, [in] BSTR folder, [out, size_is(*size)] BSTR value, [in, out] DWORD *size ); + UINT remote_GetTargetPath( [in] MSIHANDLE hinst, [in, string] LPCWSTR folder, [out, string] LPWSTR *value ); HRESULT remote_SetTargetPath( [in] MSIHANDLE hinst, [in] BSTR folder, [in] BSTR value ); HRESULT remote_GetSourcePath( [in] MSIHANDLE hinst, [in] BSTR folder, [out, size_is(*size)] BSTR value, [in, out] DWORD *size ); HRESULT remote_GetMode( [in] MSIHANDLE hinst, [in] MSIRUNMODE mode, [out] BOOL *ret ); diff --git a/modules/rostests/winetests/msi/custom.c b/modules/rostests/winetests/msi/custom.c index bfd1e857bfb..5062ecd77f2 100644 --- a/modules/rostests/winetests/msi/custom.c +++ b/modules/rostests/winetests/msi/custom.c @@ -453,6 +453,96 @@ UINT WINAPI nested(MSIHANDLE hinst) return ERROR_SUCCESS; } +static void test_targetpath(MSIHANDLE hinst) +{ + static const WCHAR targetdirW[] = {'T','A','R','G','E','T','D','I','R',0}; + static const WCHAR xyzW[] = {'C',':','\\',0}; + static const WCHAR xyW[] = {'C',':',0}; + char buffer[20]; + WCHAR bufferW[20]; + DWORD sz; + UINT r; + + /* test invalid values */ + r = MsiGetTargetPathA(hinst, NULL, NULL, NULL); + ok(hinst, r == ERROR_INVALID_PARAMETER, "got %u\n", r); + + r = MsiGetTargetPathA(hinst, "TARGETDIR", NULL, NULL ); + ok(hinst, !r, "got %u\n", r); + + r = MsiGetTargetPathA(hinst, "TARGETDIR", buffer, NULL ); + ok(hinst, r == ERROR_INVALID_PARAMETER, "got %u\n", r); + + /* Returned size is in bytes, not chars, but only for custom actions. + * Seems to be a casualty of RPC... */ + + sz = 0; + r = MsiGetTargetPathA(hinst, "TARGETDIR", NULL, &sz); + ok(hinst, !r, "got %u\n", r); + todo_wine_ok(hinst, sz == 6, "got size %u\n", sz); + + sz = 0; + strcpy(buffer,"q"); + r = MsiGetTargetPathA(hinst, "TARGETDIR", 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 == 6, "got size %u\n", sz); + + sz = 1; + strcpy(buffer,"x"); + r = MsiGetTargetPathA(hinst, "TARGETDIR", 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 == 6, "got size %u\n", sz); + + sz = 3; + strcpy(buffer,"x"); + r = MsiGetTargetPathA(hinst, "TARGETDIR", buffer, &sz); + ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r); + ok(hinst, !strcmp(buffer, "C:"), "got \"%s\"\n", buffer); + todo_wine_ok(hinst, sz == 6, "got size %u\n", sz); + + sz = 4; + strcpy(buffer,"x"); + r = MsiGetTargetPathA(hinst, "TARGETDIR", buffer, &sz); + ok(hinst, !r, "got %u\n", r); + ok(hinst, !strcmp(buffer, "C:\\"), "got \"%s\"\n", buffer); + ok(hinst, sz == 3, "got size %u\n", sz); + + sz = 0; + r = MsiGetTargetPathW(hinst, targetdirW, NULL, &sz); + ok(hinst, !r, "got %u\n", r); + ok(hinst, sz == 3, "got size %u\n", sz); + + sz = 0; + bufferW[0] = 'q'; + r = MsiGetTargetPathW(hinst, targetdirW, 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 == 3, "got size %u\n", sz); + + sz = 1; + bufferW[0] = 'q'; + r = MsiGetTargetPathW(hinst, targetdirW, 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 == 3, "got size %u\n", sz); + + sz = 3; + bufferW[0] = 'q'; + r = MsiGetTargetPathW(hinst, targetdirW, 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 == 3, "got size %u\n", sz); + + sz = 4; + bufferW[0] = 'q'; + r = MsiGetTargetPathW(hinst, targetdirW, bufferW, &sz); + ok(hinst, !r, "got %u\n", r); + ok(hinst, !lstrcmpW(bufferW, xyzW), "got %s\n", dbgstr_w(bufferW)); + ok(hinst, sz == 3, "got size %u\n", sz); +} + /* 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) @@ -479,6 +569,7 @@ UINT WINAPI main_test(MSIHANDLE hinst) test_props(hinst); test_db(hinst); test_doaction(hinst); + test_targetpath(hinst); return ERROR_SUCCESS; } diff --git a/modules/rostests/winetests/msi/install.c b/modules/rostests/winetests/msi/install.c index c5d9243275d..6a7383b3607 100644 --- a/modules/rostests/winetests/msi/install.c +++ b/modules/rostests/winetests/msi/install.c @@ -695,6 +695,9 @@ static const CHAR wrv_component_dat[] = "Component\tComponentId\tDirectory_\tAtt static const CHAR ca1_install_exec_seq_dat[] = "Action\tCondition\tSequence\n" "s72\tS255\tI2\n" "InstallExecuteSequence\tAction\n" + "CostInitialize\t\t100\n" + "FileCost\t\t200\n" + "CostFinalize\t\t300\n" "embednull\t\t600\n" "maintest\tMAIN_TEST\t700\n" "testretval\tTEST_RETVAL\t710\n"; @@ -1709,7 +1712,13 @@ static const msi_table sf_tables[] = static const msi_table ca1_tables[] = { + ADD_TABLE(component), + ADD_TABLE(directory), + ADD_TABLE(feature), + ADD_TABLE(feature_comp), + ADD_TABLE(file), ADD_TABLE(property), + ADD_TABLE(directory), ADD_TABLE(ca1_install_exec_seq), ADD_TABLE(ca1_custom_action), ADD_TABLE(ca1_test_seq), @@ -4120,6 +4129,7 @@ static void test_customaction1(void) MSIHANDLE hdb, record; UINT r; + create_test_files(); create_database(msifile, ca1_tables, sizeof(ca1_tables) / sizeof(msi_table)); add_custom_dll(); @@ -4158,6 +4168,7 @@ static void test_customaction1(void) r = MsiInstallProductA(msifile, "TEST_RETVAL=1"); ok(r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %u\n", r); + delete_test_files(); DeleteFileA(msifile); DeleteFileA("unus"); DeleteFileA("duo");
2 years, 9 months
1
0
0
0
[reactos] 27/360: [WINESYNC] msi: Make MsiSequence() RPC-compatible.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=10abb6f6bc32cc7a0dc6f…
commit 10abb6f6bc32cc7a0dc6f9ccbf9a2eb9db4071d6 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sat Mar 12 15:11:58 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:27:38 2022 +0100 [WINESYNC] msi: Make MsiSequence() 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 676376d1d3b87a8843e15baf6c7f7b958c2bdf83 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 | 7 +++++++ modules/rostests/winetests/msi/install.c | 7 +++++++ 5 files changed, 21 insertions(+), 23 deletions(-) diff --git a/dll/win32/msi/install.c b/dll/win32/msi/install.c index f48867483df..2a5ff403692 100644 --- a/dll/win32/msi/install.c +++ b/dll/win32/msi/install.c @@ -117,33 +117,18 @@ UINT WINAPI MsiSequenceW( MSIHANDLE hInstall, LPCWSTR szTable, INT iSequenceMode TRACE("%s, %d\n", debugstr_w(szTable), iSequenceMode); + if (!szTable) + return ERROR_INVALID_PARAMETER; + package = msihandle2msiinfo( hInstall, MSIHANDLETYPE_PACKAGE ); if (!package) { MSIHANDLE remote; - HRESULT hr; - BSTR table; if (!(remote = msi_get_remote(hInstall))) return ERROR_INVALID_HANDLE; - table = SysAllocString( szTable ); - if (!table) - return ERROR_OUTOFMEMORY; - - hr = remote_Sequence(remote, table, iSequenceMode); - - SysFreeString( table ); - - if (FAILED(hr)) - { - if (HRESULT_FACILITY(hr) == FACILITY_WIN32) - return HRESULT_CODE(hr); - - return ERROR_FUNCTION_FAILED; - } - - return ERROR_SUCCESS; + return remote_Sequence(remote, szTable, iSequenceMode); } ret = MSI_Sequence( package, szTable ); msiobj_release( &package->hdr ); diff --git a/dll/win32/msi/package.c b/dll/win32/msi/package.c index 948e70ee266..50bfd2133c5 100644 --- a/dll/win32/msi/package.c +++ b/dll/win32/msi/package.c @@ -2476,10 +2476,9 @@ UINT __cdecl remote_DoAction(MSIHANDLE hinst, LPCWSTR action) return MsiDoActionW(hinst, action); } -HRESULT __cdecl remote_Sequence(MSIHANDLE hinst, BSTR table, int sequence) +UINT __cdecl remote_Sequence(MSIHANDLE hinst, LPCWSTR table, int sequence) { - UINT r = MsiSequenceW(hinst, table, sequence); - return HRESULT_FROM_WIN32(r); + return MsiSequenceW(hinst, table, sequence); } HRESULT __cdecl remote_GetTargetPath(MSIHANDLE hinst, BSTR folder, BSTR value, DWORD *size) diff --git a/dll/win32/msi/winemsi.idl b/dll/win32/msi/winemsi.idl index 57790d12d4e..d103e9aa068 100644 --- a/dll/win32/msi/winemsi.idl +++ b/dll/win32/msi/winemsi.idl @@ -75,7 +75,7 @@ interface IWineMsiRemote UINT remote_SetProperty( [in] MSIHANDLE hinst, [in, string, unique] LPCWSTR property, [in, string, unique] LPCWSTR value ); int remote_ProcessMessage( [in] MSIHANDLE hinst, [in] INSTALLMESSAGE message, [in] struct wire_record *record ); UINT remote_DoAction( [in] MSIHANDLE hinst, [in, string] LPCWSTR action ); - HRESULT remote_Sequence( [in] MSIHANDLE hinst, [in] BSTR table, [in] int sequence ); + UINT remote_Sequence( [in] MSIHANDLE hinst, [in, string] LPCWSTR table, [in] int sequence ); HRESULT remote_GetTargetPath( [in] MSIHANDLE hinst, [in] BSTR folder, [out, size_is(*size)] BSTR value, [in, out] DWORD *size ); HRESULT remote_SetTargetPath( [in] MSIHANDLE hinst, [in] BSTR folder, [in] BSTR value ); HRESULT remote_GetSourcePath( [in] MSIHANDLE hinst, [in] BSTR folder, [out, size_is(*size)] BSTR value, [in, out] DWORD *size ); diff --git a/modules/rostests/winetests/msi/custom.c b/modules/rostests/winetests/msi/custom.c index 5bdb8d2cc55..bfd1e857bfb 100644 --- a/modules/rostests/winetests/msi/custom.c +++ b/modules/rostests/winetests/msi/custom.c @@ -437,6 +437,13 @@ static void test_doaction(MSIHANDLE hinst) r = MsiDoActionA(hinst, "nested1"); ok(hinst, !r, "got %u\n", r); check_prop(hinst, "nested", "2"); + + r = MsiSequenceA(hinst, NULL, 0); + ok(hinst, r == ERROR_INVALID_PARAMETER, "got %u\n", r); + + r = MsiSequenceA(hinst, "TestSequence", 0); + ok(hinst, !r, "got %u\n", r); + check_prop(hinst, "nested", "1"); } UINT WINAPI nested(MSIHANDLE hinst) diff --git a/modules/rostests/winetests/msi/install.c b/modules/rostests/winetests/msi/install.c index b63e5da9686..c5d9243275d 100644 --- a/modules/rostests/winetests/msi/install.c +++ b/modules/rostests/winetests/msi/install.c @@ -708,6 +708,12 @@ static const CHAR ca1_custom_action_dat[] = "Action\tType\tSource\tTarget\n" "maintest\t1\tcustom.dll\tmain_test\n" "testretval\t1\tcustom.dll\ttest_retval\n"; +static const CHAR ca1_test_seq_dat[] = "Action\tCondition\tSequence\n" + "s72\tS255\tI2\n" + "TestSequence\tAction\n" + "nested1\t\t1\n" + "nested51\t\t2\n"; + static const CHAR ca51_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n" "s72\tS38\ts72\ti2\tS255\tS72\n" "Component\tComponent\n" @@ -1706,6 +1712,7 @@ static const msi_table ca1_tables[] = ADD_TABLE(property), ADD_TABLE(ca1_install_exec_seq), ADD_TABLE(ca1_custom_action), + ADD_TABLE(ca1_test_seq), }; static const msi_table ca51_tables[] =
2 years, 9 months
1
0
0
0
[reactos] 26/360: [WINESYNC] msi: Make MsiDoAction() RPC-compatible.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=c65c209a0cdcf3db5fad0…
commit c65c209a0cdcf3db5fad03a2eb726f3c1777e2cb Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sat Mar 12 15:11:57 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:27:38 2022 +0100 [WINESYNC] msi: Make MsiDoAction() 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 c49abc8ce006441163c4a0b25d42ad1e9650d9da by Zebediah Figura <z.figura12(a)gmail.com> --- dll/win32/msi/install.c | 20 +------------------- dll/win32/msi/package.c | 5 ++--- dll/win32/msi/winemsi.idl | 2 +- modules/rostests/winetests/msi/custom.c | 21 +++++++++++++++++++++ modules/rostests/winetests/msi/custom.spec | 1 + modules/rostests/winetests/msi/install.c | 2 ++ 6 files changed, 28 insertions(+), 23 deletions(-) diff --git a/dll/win32/msi/install.c b/dll/win32/msi/install.c index 814addc402f..f48867483df 100644 --- a/dll/win32/msi/install.c +++ b/dll/win32/msi/install.c @@ -75,29 +75,11 @@ UINT WINAPI MsiDoActionW( MSIHANDLE hInstall, LPCWSTR szAction ) if (!package) { MSIHANDLE remote; - HRESULT hr; - BSTR action; if (!(remote = msi_get_remote(hInstall))) return ERROR_INVALID_HANDLE; - action = SysAllocString( szAction ); - if (!action) - return ERROR_OUTOFMEMORY; - - hr = remote_DoAction(remote, action); - - SysFreeString( action ); - - if (FAILED(hr)) - { - if (HRESULT_FACILITY(hr) == FACILITY_WIN32) - return HRESULT_CODE(hr); - - return ERROR_FUNCTION_FAILED; - } - - return ERROR_SUCCESS; + return remote_DoAction(remote, szAction); } ret = ACTION_PerformAction( package, szAction, SCRIPT_NONE ); diff --git a/dll/win32/msi/package.c b/dll/win32/msi/package.c index b4379fe81a3..948e70ee266 100644 --- a/dll/win32/msi/package.c +++ b/dll/win32/msi/package.c @@ -2471,10 +2471,9 @@ int __cdecl remote_ProcessMessage(MSIHANDLE hinst, INSTALLMESSAGE message, struc return ret; } -HRESULT __cdecl remote_DoAction(MSIHANDLE hinst, BSTR action) +UINT __cdecl remote_DoAction(MSIHANDLE hinst, LPCWSTR action) { - UINT r = MsiDoActionW(hinst, action); - return HRESULT_FROM_WIN32(r); + return MsiDoActionW(hinst, action); } HRESULT __cdecl remote_Sequence(MSIHANDLE hinst, BSTR table, int sequence) diff --git a/dll/win32/msi/winemsi.idl b/dll/win32/msi/winemsi.idl index 7613fd3e3ad..57790d12d4e 100644 --- a/dll/win32/msi/winemsi.idl +++ b/dll/win32/msi/winemsi.idl @@ -74,7 +74,7 @@ interface IWineMsiRemote UINT remote_GetProperty( [in] MSIHANDLE hinst, [in, string] LPCWSTR property, [out, string] LPWSTR *value, [out] DWORD *size ); UINT remote_SetProperty( [in] MSIHANDLE hinst, [in, string, unique] LPCWSTR property, [in, string, unique] LPCWSTR value ); int remote_ProcessMessage( [in] MSIHANDLE hinst, [in] INSTALLMESSAGE message, [in] struct wire_record *record ); - HRESULT remote_DoAction( [in] MSIHANDLE hinst, [in] BSTR action ); + UINT remote_DoAction( [in] MSIHANDLE hinst, [in, string] LPCWSTR action ); HRESULT remote_Sequence( [in] MSIHANDLE hinst, [in] BSTR table, [in] int sequence ); HRESULT remote_GetTargetPath( [in] MSIHANDLE hinst, [in] BSTR folder, [out, size_is(*size)] BSTR value, [in, out] DWORD *size ); HRESULT remote_SetTargetPath( [in] MSIHANDLE hinst, [in] BSTR folder, [in] BSTR value ); diff --git a/modules/rostests/winetests/msi/custom.c b/modules/rostests/winetests/msi/custom.c index e782311446f..5bdb8d2cc55 100644 --- a/modules/rostests/winetests/msi/custom.c +++ b/modules/rostests/winetests/msi/custom.c @@ -426,6 +426,26 @@ static void test_db(MSIHANDLE hinst) ok(hinst, !r, "got %u\n", r); } +static void test_doaction(MSIHANDLE hinst) +{ + UINT r; + + r = MsiDoActionA(hinst, "nested51"); + ok(hinst, !r, "got %u\n", r); + check_prop(hinst, "nested", "1"); + + r = MsiDoActionA(hinst, "nested1"); + ok(hinst, !r, "got %u\n", r); + check_prop(hinst, "nested", "2"); +} + +UINT WINAPI nested(MSIHANDLE hinst) +{ + MsiSetPropertyA(hinst, "nested", "2"); + + return ERROR_SUCCESS; +} + /* 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) @@ -451,6 +471,7 @@ UINT WINAPI main_test(MSIHANDLE hinst) test_props(hinst); test_db(hinst); + test_doaction(hinst); return ERROR_SUCCESS; } diff --git a/modules/rostests/winetests/msi/custom.spec b/modules/rostests/winetests/msi/custom.spec index bb400fffe9d..51bb60ec1a4 100644 --- a/modules/rostests/winetests/msi/custom.spec +++ b/modules/rostests/winetests/msi/custom.spec @@ -2,3 +2,4 @@ @ stdcall test_retval(long) @ stdcall da_immediate(long) @ stdcall da_deferred(long) +@ stdcall nested(long) diff --git a/modules/rostests/winetests/msi/install.c b/modules/rostests/winetests/msi/install.c index 41a77cdb4ed..b63e5da9686 100644 --- a/modules/rostests/winetests/msi/install.c +++ b/modules/rostests/winetests/msi/install.c @@ -703,6 +703,8 @@ static const CHAR ca1_custom_action_dat[] = "Action\tType\tSource\tTarget\n" "s72\ti2\tS64\tS0\n" "CustomAction\tAction\n" "embednull\t51\tembednullprop\ta[~]b\n" + "nested51\t51\tnested\t1\n" + "nested1\t1\tcustom.dll\tnested\n" "maintest\t1\tcustom.dll\tmain_test\n" "testretval\t1\tcustom.dll\ttest_retval\n";
2 years, 9 months
1
0
0
0
[reactos] 25/360: [WINESYNC] msi: Make MsiGetSummaryInformation() RPC-compatible.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=6f8e5d88d98d4725ea8b3…
commit 6f8e5d88d98d4725ea8b381af67f1c6dc7b64aa1 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sat Mar 12 15:11:57 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:27:38 2022 +0100 [WINESYNC] msi: Make MsiGetSummaryInformation() 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 bf5589311de8ac2c74e3bd73bef32337a2ce8df2 by Zebediah Figura <z.figura12(a)gmail.com> --- dll/win32/msi/database.c | 5 ++--- dll/win32/msi/suminfo.c | 17 +++++------------ dll/win32/msi/winemsi.idl | 2 +- modules/rostests/winetests/msi/custom.c | 11 ++++++++++- 4 files changed, 18 insertions(+), 17 deletions(-) diff --git a/dll/win32/msi/database.c b/dll/win32/msi/database.c index 26a274c9a84..1657a353ba0 100644 --- a/dll/win32/msi/database.c +++ b/dll/win32/msi/database.c @@ -2033,10 +2033,9 @@ UINT __cdecl remote_DatabaseGetPrimaryKeys(MSIHANDLE db, LPCWSTR table, struct w return r; } -HRESULT __cdecl remote_DatabaseGetSummaryInformation(MSIHANDLE db, UINT updatecount, MSIHANDLE *suminfo) +UINT __cdecl remote_DatabaseGetSummaryInformation(MSIHANDLE db, UINT updatecount, MSIHANDLE *suminfo) { - UINT r = MsiGetSummaryInformationW(db, NULL, updatecount, suminfo); - return HRESULT_FROM_WIN32(r); + return MsiGetSummaryInformationW(db, NULL, updatecount, suminfo); } UINT __cdecl remote_DatabaseOpenView(MSIHANDLE db, LPCWSTR query, MSIHANDLE *view) diff --git a/dll/win32/msi/suminfo.c b/dll/win32/msi/suminfo.c index eabd399c39b..0268f631288 100644 --- a/dll/win32/msi/suminfo.c +++ b/dll/win32/msi/suminfo.c @@ -538,23 +538,16 @@ UINT WINAPI MsiGetSummaryInformationW( MSIHANDLE hDatabase, db = msihandle2msiinfo( hDatabase, MSIHANDLETYPE_DATABASE ); if( !db ) { - MSIHANDLE remote; - HRESULT hr; + MSIHANDLE remote, remote_suminfo; if (!(remote = msi_get_remote(hDatabase))) return ERROR_INVALID_HANDLE; - hr = remote_DatabaseGetSummaryInformation(remote, uiUpdateCount, pHandle); + ret = remote_DatabaseGetSummaryInformation(remote, uiUpdateCount, &remote_suminfo); + if (!ret) + *pHandle = alloc_msi_remote_handle(remote_suminfo); - if (FAILED(hr)) - { - if (HRESULT_FACILITY(hr) == FACILITY_WIN32) - return HRESULT_CODE(hr); - - return ERROR_FUNCTION_FAILED; - } - - return ERROR_SUCCESS; + return ret; } } diff --git a/dll/win32/msi/winemsi.idl b/dll/win32/msi/winemsi.idl index 28c3ab10003..7613fd3e3ad 100644 --- a/dll/win32/msi/winemsi.idl +++ b/dll/win32/msi/winemsi.idl @@ -67,7 +67,7 @@ interface IWineMsiRemote MSICONDITION remote_DatabaseIsTablePersistent( [in] MSIHANDLE db, [in] LPCWSTR table ); UINT remote_DatabaseGetPrimaryKeys( [in] MSIHANDLE db, [in, string] LPCWSTR table, [out] struct wire_record **keys ); - HRESULT remote_DatabaseGetSummaryInformation( [in] MSIHANDLE db, [in] UINT updatecount, [out] MSIHANDLE *suminfo ); + UINT remote_DatabaseGetSummaryInformation( [in] MSIHANDLE db, [in] UINT updatecount, [out] MSIHANDLE *suminfo ); UINT remote_DatabaseOpenView( [in] MSIHANDLE db, [in, string] LPCWSTR query, [out] MSIHANDLE *view ); MSIHANDLE remote_GetActiveDatabase( [in] MSIHANDLE hinst ); diff --git a/modules/rostests/winetests/msi/custom.c b/modules/rostests/winetests/msi/custom.c index cdefefd6cdd..e782311446f 100644 --- a/modules/rostests/winetests/msi/custom.c +++ b/modules/rostests/winetests/msi/custom.c @@ -243,7 +243,7 @@ static void test_props(MSIHANDLE hinst) static void test_db(MSIHANDLE hinst) { - MSIHANDLE hdb, view, rec, rec2; + MSIHANDLE hdb, view, rec, rec2, suminfo; char buffer[10]; DWORD sz; UINT r; @@ -413,6 +413,15 @@ static void test_db(MSIHANDLE hinst) r = MsiCloseHandle(rec); ok(hinst, !r, "got %u\n", r); + r = MsiGetSummaryInformationA(hdb, NULL, 1, NULL); + ok(hinst, r == ERROR_INVALID_PARAMETER, "got %u\n", r); + + r = MsiGetSummaryInformationA(hdb, NULL, 1, &suminfo); + ok(hinst, !r, "got %u\n", r); + + r = MsiCloseHandle(suminfo); + ok(hinst, !r, "got %u\n", r); + r = MsiCloseHandle(hdb); ok(hinst, !r, "got %u\n", r); }
2 years, 9 months
1
0
0
0
[reactos] 24/360: [WINESYNC] msi: Make MsiDatabaseGetPrimaryKeys() RPC-compatible.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=9943fe3a6501b2c90e0b1…
commit 9943fe3a6501b2c90e0b14434cdb2473746f9382 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sat Mar 12 15:11:56 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:27:38 2022 +0100 [WINESYNC] msi: Make MsiDatabaseGetPrimaryKeys() 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 ed0a8dd3bfb5dbe6899cd1315c366d9fd833f060 by Zebediah Figura <z.figura12(a)gmail.com> --- dll/win32/msi/database.c | 11 ++++++++--- dll/win32/msi/msiquery.c | 15 ++++++--------- dll/win32/msi/winemsi.idl | 2 +- modules/rostests/winetests/msi/custom.c | 22 ++++++++++++++++++++++ 4 files changed, 37 insertions(+), 13 deletions(-) diff --git a/dll/win32/msi/database.c b/dll/win32/msi/database.c index 5ea4ec47261..26a274c9a84 100644 --- a/dll/win32/msi/database.c +++ b/dll/win32/msi/database.c @@ -2022,10 +2022,15 @@ MSICONDITION __cdecl remote_DatabaseIsTablePersistent(MSIHANDLE db, LPCWSTR tabl return MsiDatabaseIsTablePersistentW(db, table); } -HRESULT __cdecl remote_DatabaseGetPrimaryKeys(MSIHANDLE db, LPCWSTR table, MSIHANDLE *keys) +UINT __cdecl remote_DatabaseGetPrimaryKeys(MSIHANDLE db, LPCWSTR table, struct wire_record **rec) { - UINT r = MsiDatabaseGetPrimaryKeysW(db, table, keys); - return HRESULT_FROM_WIN32(r); + MSIHANDLE handle; + UINT r = MsiDatabaseGetPrimaryKeysW(db, table, &handle); + *rec = NULL; + if (!r) + *rec = marshal_record(handle); + MsiCloseHandle(handle); + return r; } HRESULT __cdecl remote_DatabaseGetSummaryInformation(MSIHANDLE db, UINT updatecount, MSIHANDLE *suminfo) diff --git a/dll/win32/msi/msiquery.c b/dll/win32/msi/msiquery.c index e3bcfd86cc0..42ee8c79d02 100644 --- a/dll/win32/msi/msiquery.c +++ b/dll/win32/msi/msiquery.c @@ -998,23 +998,20 @@ UINT WINAPI MsiDatabaseGetPrimaryKeysW( MSIHANDLE hdb, db = msihandle2msiinfo( hdb, MSIHANDLETYPE_DATABASE ); if( !db ) { + struct wire_record *wire_rec = NULL; MSIHANDLE remote; - HRESULT hr; if (!(remote = msi_get_remote(hdb))) return ERROR_INVALID_HANDLE; - hr = remote_DatabaseGetPrimaryKeys(remote, table, phRec); - - if (FAILED(hr)) + r = remote_DatabaseGetPrimaryKeys(remote, table, &wire_rec); + if (!r) { - if (HRESULT_FACILITY(hr) == FACILITY_WIN32) - return HRESULT_CODE(hr); - - return ERROR_FUNCTION_FAILED; + r = unmarshal_record(wire_rec, phRec); + free_remote_record(wire_rec); } - return ERROR_SUCCESS; + return r; } r = MSI_DatabaseGetPrimaryKeys( db, table, &rec ); diff --git a/dll/win32/msi/winemsi.idl b/dll/win32/msi/winemsi.idl index 3fbd6d26a1d..28c3ab10003 100644 --- a/dll/win32/msi/winemsi.idl +++ b/dll/win32/msi/winemsi.idl @@ -66,7 +66,7 @@ interface IWineMsiRemote [in] struct wire_record *record, [out] struct wire_record **refreshed ); MSICONDITION remote_DatabaseIsTablePersistent( [in] MSIHANDLE db, [in] LPCWSTR table ); - HRESULT remote_DatabaseGetPrimaryKeys( [in] MSIHANDLE db, [in] LPCWSTR table, [out] MSIHANDLE *keys ); + UINT remote_DatabaseGetPrimaryKeys( [in] MSIHANDLE db, [in, string] LPCWSTR table, [out] struct wire_record **keys ); HRESULT remote_DatabaseGetSummaryInformation( [in] MSIHANDLE db, [in] UINT updatecount, [out] MSIHANDLE *suminfo ); UINT remote_DatabaseOpenView( [in] MSIHANDLE db, [in, string] LPCWSTR query, [out] MSIHANDLE *view ); diff --git a/modules/rostests/winetests/msi/custom.c b/modules/rostests/winetests/msi/custom.c index 79d90f04233..cdefefd6cdd 100644 --- a/modules/rostests/winetests/msi/custom.c +++ b/modules/rostests/winetests/msi/custom.c @@ -391,6 +391,28 @@ static void test_db(MSIHANDLE hinst) r = MsiCloseHandle(view); ok(hinst, !r, "got %u\n", r); + /* test MsiDatabaseGetPrimaryKeys() */ + r = MsiDatabaseGetPrimaryKeysA(hdb, "Test", &rec); + ok(hinst, !r, "got %u\n", r); + + r = MsiRecordGetFieldCount(rec); + ok(hinst, r == 1, "got %d\n", r); + + sz = sizeof(buffer); + r = MsiRecordGetStringA(rec, 0, buffer, &sz); + ok(hinst, !r, "got %u\n", r); + ok(hinst, sz == strlen(buffer), "got size %u\n", sz); + ok(hinst, !strcmp(buffer, "Test"), "got '%s'\n", buffer); + + sz = sizeof(buffer); + r = MsiRecordGetStringA(rec, 1, buffer, &sz); + ok(hinst, !r, "got %u\n", r); + ok(hinst, sz == strlen(buffer), "got size %u\n", sz); + ok(hinst, !strcmp(buffer, "Name"), "got '%s'\n", buffer); + + r = MsiCloseHandle(rec); + ok(hinst, !r, "got %u\n", r); + r = MsiCloseHandle(hdb); ok(hinst, !r, "got %u\n", r); }
2 years, 9 months
1
0
0
0
[reactos] 23/360: [WINESYNC] msi/tests: Add tests for MsiDatabaseGetPrimaryKeys().
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=b2b149a09ecd408b66199…
commit b2b149a09ecd408b661991c1cdbcaceafe97ab6a Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sat Mar 12 15:11:56 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:27:38 2022 +0100 [WINESYNC] msi/tests: Add tests for MsiDatabaseGetPrimaryKeys(). 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 3a1d9bb915952fd69f16c32cbea29983d9a5a5fc by Zebediah Figura <z.figura12(a)gmail.com> --- modules/rostests/winetests/msi/db.c | 41 +++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/modules/rostests/winetests/msi/db.c b/modules/rostests/winetests/msi/db.c index 3cbb9b3e284..e2328ab784a 100644 --- a/modules/rostests/winetests/msi/db.c +++ b/modules/rostests/winetests/msi/db.c @@ -9701,6 +9701,46 @@ static void test_select_column_names(void) ok(r == ERROR_SUCCESS , "failed to close database: %u\n", r); } +static void test_primary_keys(void) +{ + MSIHANDLE hdb, keys; + UINT r; + + hdb = create_db(); + + r = MsiDatabaseGetPrimaryKeysA(hdb, "T", &keys); + ok(r == ERROR_INVALID_TABLE, "got %u\n", r); + + r = run_query(hdb, 0, "CREATE TABLE `T` (`A` SHORT, `B` SHORT, `C` SHORT PRIMARY KEY `A`)"); + ok(!r, "got %u\n", r); + + r = MsiDatabaseGetPrimaryKeysA(hdb, "T", &keys); + ok(!r, "got %u\n", r); + + r = MsiRecordGetFieldCount(keys); + ok(r == 1, "got %d\n", r); + ok(check_record(keys, 0, "T"), "expected 'T'"); + ok(check_record(keys, 1, "A"), "expected 'A'"); + + MsiCloseHandle(keys); + + r = run_query(hdb, 0, "CREATE TABLE `U` (`A` SHORT, `B` SHORT, `C` SHORT PRIMARY KEY `B`, `C`)"); + ok(!r, "got %u\n", r); + + r = MsiDatabaseGetPrimaryKeysA(hdb, "U", &keys); + ok(!r, "got %u\n", r); + + r = MsiRecordGetFieldCount(keys); + ok(r == 2, "got %d\n", r); + ok(check_record(keys, 0, "U"), "expected 'U'"); + ok(check_record(keys, 1, "B"), "expected 'B'"); + ok(check_record(keys, 2, "C"), "expected 'C'"); + + MsiCloseHandle(keys); + MsiCloseHandle(hdb); + DeleteFileA(msifile); +} + START_TEST(db) { test_msidatabase(); @@ -9756,4 +9796,5 @@ START_TEST(db) test_collation(); test_embedded_nulls(); test_select_column_names(); + test_primary_keys(); }
2 years, 9 months
1
0
0
0
[reactos] 22/360: [WINESYNC] msi: Make MsiViewModify() RPC-compatible.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=aede536c83c5cc95e00b6…
commit aede536c83c5cc95e00b63797bd2271d5ade2cf9 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sat Mar 12 15:11:55 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:27:37 2022 +0100 [WINESYNC] msi: Make MsiViewModify() 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 c79fbc241e3c9a62ab50fb0826e33e85e97ae883 by Zebediah Figura <z.figura12(a)gmail.com> --- dll/win32/msi/msipriv.h | 1 + dll/win32/msi/msiquery.c | 49 +++++++++++++++++++++++++++++---- dll/win32/msi/record.c | 31 +++++++++++++-------- dll/win32/msi/winemsi.idl | 3 ++ modules/rostests/winetests/msi/custom.c | 29 +++++++++++++++++++ 5 files changed, 95 insertions(+), 18 deletions(-) diff --git a/dll/win32/msi/msipriv.h b/dll/win32/msi/msipriv.h index 936ed4d7241..4a92bd0e943 100644 --- a/dll/win32/msi/msipriv.h +++ b/dll/win32/msi/msipriv.h @@ -833,6 +833,7 @@ extern void dump_record(MSIRECORD *) DECLSPEC_HIDDEN; extern UINT unmarshal_record(const struct wire_record *in, MSIHANDLE *out) DECLSPEC_HIDDEN; extern struct wire_record *marshal_record(MSIHANDLE handle) DECLSPEC_HIDDEN; extern void free_remote_record(struct wire_record *rec) DECLSPEC_HIDDEN; +extern UINT copy_remote_record(const struct wire_record *rec, MSIHANDLE handle) DECLSPEC_HIDDEN; /* stream internals */ extern void enum_stream_names( IStorage *stg ) DECLSPEC_HIDDEN; diff --git a/dll/win32/msi/msiquery.c b/dll/win32/msi/msiquery.c index e73701f9253..e3bcfd86cc0 100644 --- a/dll/win32/msi/msiquery.c +++ b/dll/win32/msi/msiquery.c @@ -666,17 +666,36 @@ UINT WINAPI MsiViewModify( MSIHANDLE hView, MSIMODIFY eModifyMode, TRACE("%d %x %d\n", hView, eModifyMode, hRecord); - query = msihandle2msiinfo( hView, MSIHANDLETYPE_VIEW ); - if( !query ) + rec = msihandle2msiinfo( hRecord, MSIHANDLETYPE_RECORD ); + + if (!rec) return ERROR_INVALID_HANDLE; - rec = msihandle2msiinfo( hRecord, MSIHANDLETYPE_RECORD ); + query = msihandle2msiinfo( hView, MSIHANDLETYPE_VIEW ); + if (!query) + { + struct wire_record *wire_refreshed = NULL; + MSIHANDLE remote; + + if (!(remote = msi_get_remote(hView))) + return ERROR_INVALID_HANDLE; + + r = remote_ViewModify(remote, eModifyMode, + (struct wire_record *)&rec->count, &wire_refreshed); + if (!r && (eModifyMode == MSIMODIFY_REFRESH || eModifyMode == MSIMODIFY_SEEK)) + { + r = copy_remote_record(wire_refreshed, hRecord); + free_remote_record(wire_refreshed); + } + + msiobj_release(&rec->hdr); + return r; + } + r = MSI_ViewModify( query, eModifyMode, rec ); msiobj_release( &query->hdr ); - if( rec ) - msiobj_release( &rec->hdr ); - + msiobj_release(&rec->hdr); return r; } @@ -1117,3 +1136,21 @@ UINT __cdecl remote_ViewGetColumnInfo(MSIHANDLE view, MSICOLINFO info, struct wi MsiCloseHandle(handle); return r; } + +UINT __cdecl remote_ViewModify(MSIHANDLE view, MSIMODIFY mode, + struct wire_record *remote_rec, struct wire_record **remote_refreshed) +{ + MSIHANDLE handle = 0; + UINT r; + + if ((r = unmarshal_record(remote_rec, &handle))) + return r; + + r = MsiViewModify(view, mode, handle); + *remote_refreshed = NULL; + if (!r && (mode == MSIMODIFY_REFRESH || mode == MSIMODIFY_SEEK)) + *remote_refreshed = marshal_record(handle); + + MsiCloseHandle(handle); + return r; +} diff --git a/dll/win32/msi/record.c b/dll/win32/msi/record.c index 91892d7377f..58040468993 100644 --- a/dll/win32/msi/record.c +++ b/dll/win32/msi/record.c @@ -1055,26 +1055,22 @@ void dump_record(MSIRECORD *rec) TRACE("]\n"); } -UINT unmarshal_record(const struct wire_record *in, MSIHANDLE *out) +UINT copy_remote_record(const struct wire_record *in, MSIHANDLE out) { MSIRECORD *rec; unsigned int i; UINT r; - if (!in) - { - *out = 0; - return ERROR_SUCCESS; - } - - rec = MSI_CreateRecord(in->count); - if (!rec) return ERROR_OUTOFMEMORY; + if (!(rec = msihandle2msiinfo(out, MSIHANDLETYPE_RECORD))) + return ERROR_INVALID_HANDLE; for (i = 0; i <= in->count; i++) { switch (in->fields[i].type) { case MSIFIELD_NULL: + MSI_FreeField(&rec->fields[i]); + rec->fields[i].type = MSIFIELD_NULL; break; case MSIFIELD_INT: r = MSI_RecordSetInteger(rec, i, in->fields[i].u.iVal); @@ -1097,13 +1093,24 @@ UINT unmarshal_record(const struct wire_record *in, MSIHANDLE *out) } } - *out = alloc_msihandle(&rec->hdr); - if (!*out) return ERROR_OUTOFMEMORY; - msiobj_release(&rec->hdr); return ERROR_SUCCESS; } +UINT unmarshal_record(const struct wire_record *in, MSIHANDLE *out) +{ + if (!in) + { + *out = 0; + return ERROR_SUCCESS; + } + + *out = MsiCreateRecord(in->count); + if (!*out) return ERROR_OUTOFMEMORY; + + return copy_remote_record(in, *out); +} + struct wire_record *marshal_record(MSIHANDLE handle) { struct wire_record *ret; diff --git a/dll/win32/msi/winemsi.idl b/dll/win32/msi/winemsi.idl index 628091b9b4c..3fbd6d26a1d 100644 --- a/dll/win32/msi/winemsi.idl +++ b/dll/win32/msi/winemsi.idl @@ -28,6 +28,7 @@ typedef int MSICONDITION; typedef int MSIRUNMODE; typedef int INSTALLSTATE; typedef int MSICOLINFO; +typedef int MSIMODIFY; #define MSIFIELD_NULL 0 #define MSIFIELD_INT 1 @@ -61,6 +62,8 @@ interface IWineMsiRemote UINT remote_ViewExecute( [in] MSIHANDLE view, [in, unique] struct wire_record *record ); UINT remote_ViewFetch( [in] MSIHANDLE view, [out] struct wire_record **record ); UINT remote_ViewGetColumnInfo( [in] MSIHANDLE view, [in] MSICOLINFO info, [out] struct wire_record **record ); + UINT remote_ViewModify( [in] MSIHANDLE view, [in] MSIMODIFY mode, + [in] struct wire_record *record, [out] struct wire_record **refreshed ); MSICONDITION remote_DatabaseIsTablePersistent( [in] MSIHANDLE db, [in] LPCWSTR table ); HRESULT remote_DatabaseGetPrimaryKeys( [in] MSIHANDLE db, [in] LPCWSTR table, [out] MSIHANDLE *keys ); diff --git a/modules/rostests/winetests/msi/custom.c b/modules/rostests/winetests/msi/custom.c index d6b186c635a..79d90f04233 100644 --- a/modules/rostests/winetests/msi/custom.c +++ b/modules/rostests/winetests/msi/custom.c @@ -321,6 +321,35 @@ static void test_db(MSIHANDLE hinst) ok(hinst, !r, "got %u\n", r); ok(hinst, !memcmp(buffer, "duo", 3), "wrong data\n"); + r = MsiViewModify(view, MSIMODIFY_REFRESH, 0); + ok(hinst, r == ERROR_INVALID_HANDLE, "got %u\n", r); + + r = MsiRecordSetStringA(rec2, 1, "three"); + ok(hinst, !r, "got %u\n", r); + + r = MsiRecordSetInteger(rec2, 2, 3); + ok(hinst, !r, "got %u\n", r); + + r = MsiRecordSetInteger(rec2, 3, 3); + ok(hinst, !r, "got %u\n", r); + + r = MsiViewModify(view, MSIMODIFY_REFRESH, rec2); + ok(hinst, !r, "got %d\n", r); + + sz = sizeof(buffer); + r = MsiRecordGetStringA(rec2, 1, buffer, &sz); + ok(hinst, !r, "got %u\n", r); + ok(hinst, sz == strlen(buffer), "got size %u\n", sz); + ok(hinst, !strcmp(buffer, "two"), "got '%s'\n", buffer); + + r = MsiRecordGetInteger(rec2, 2); + ok(hinst, r == 2, "got %d\n", r); + + sz = sizeof(buffer); + r = MsiRecordReadStream(rec2, 3, buffer, &sz); + ok(hinst, !r, "got %u\n", r); + ok(hinst, !memcmp(buffer, "duo", 3), "wrong data\n"); + r = MsiCloseHandle(rec2); ok(hinst, !r, "got %u\n", r);
2 years, 9 months
1
0
0
0
← Newer
1
...
35
36
37
38
39
40
41
...
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