winehq.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
2025
February
January
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
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
April 2018
----- 2025 -----
February 2025
January 2025
----- 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
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
2 participants
542 discussions
Start a n
N
ew thread
Zebediah Figura : msi: Make MsiGetSourcePath() RPC-compatible.
by Alexandre Julliard
23 Apr '18
23 Apr '18
Module: wine Branch: master Commit: d2b0981a2ceb8371460f009e0250ad2690ca0e93 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=d2b0981a2ceb8371460f009e…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Sat Apr 21 19:33:47 2018 -0500 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> --- dlls/msi/install.c | 41 +++-------------------- dlls/msi/package.c | 17 ++++++++-- dlls/msi/tests/custom.c | 89 +++++++++++++++++++++++++++++++++++++++++++++++-- dlls/msi/winemsi.idl | 2 +- 4 files changed, 106 insertions(+), 43 deletions(-) diff --git a/dlls/msi/install.c b/dlls/msi/install.c index ba329eb..88b3ff5 100644 --- a/dlls/msi/install.c +++ b/dlls/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/dlls/msi/package.c b/dlls/msi/package.c index 220692b..1790918 100644 --- a/dlls/msi/package.c +++ b/dlls/msi/package.c @@ -2496,10 +2496,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/dlls/msi/tests/custom.c b/dlls/msi/tests/custom.c index 111032c..d596f1e 100644 --- a/dlls/msi/tests/custom.c +++ b/dlls/msi/tests/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 diff --git a/dlls/msi/winemsi.idl b/dlls/msi/winemsi.idl index a0e1ddb..06db52e 100644 --- a/dlls/msi/winemsi.idl +++ b/dlls/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 );
1
0
0
0
Zebediah Figura : msi: Make MsiSetTargetPath() RPC-compatible.
by Alexandre Julliard
23 Apr '18
23 Apr '18
Module: wine Branch: master Commit: e5fba6d23ee82229582a0cf19a455b3c5ca43776 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=e5fba6d23ee82229582a0cf1…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Sat Apr 21 19:33:46 2018 -0500 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> --- dlls/msi/install.c | 26 +------------------------- dlls/msi/package.c | 5 ++--- dlls/msi/tests/custom.c | 16 ++++++++++++++++ dlls/msi/winemsi.idl | 2 +- 4 files changed, 20 insertions(+), 29 deletions(-) diff --git a/dlls/msi/install.c b/dlls/msi/install.c index 68d8eb5..ba329eb 100644 --- a/dlls/msi/install.c +++ b/dlls/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/dlls/msi/package.c b/dlls/msi/package.c index d1a6923..220692b 100644 --- a/dlls/msi/package.c +++ b/dlls/msi/package.c @@ -2491,10 +2491,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/dlls/msi/tests/custom.c b/dlls/msi/tests/custom.c index 5062ecd..111032c 100644 --- a/dlls/msi/tests/custom.c +++ b/dlls/msi/tests/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 diff --git a/dlls/msi/winemsi.idl b/dlls/msi/winemsi.idl index 5e09c85..a0e1ddb 100644 --- a/dlls/msi/winemsi.idl +++ b/dlls/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 );
1
0
0
0
Zebediah Figura : msi: Make MsiGetTargetPath() RPC-compatible.
by Alexandre Julliard
23 Apr '18
23 Apr '18
Module: wine Branch: master Commit: 49d67080c97cbe89ea6f665f692c6d32db272a0f URL:
https://source.winehq.org/git/wine.git/?a=commit;h=49d67080c97cbe89ea6f665f…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Sat Apr 21 19:33:45 2018 -0500 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> --- dlls/msi/install.c | 46 +++++------------------- dlls/msi/package.c | 17 +++++++-- dlls/msi/tests/custom.c | 91 ++++++++++++++++++++++++++++++++++++++++++++++++ dlls/msi/tests/install.c | 11 ++++++ dlls/msi/winemsi.idl | 2 +- 5 files changed, 125 insertions(+), 42 deletions(-) diff --git a/dlls/msi/install.c b/dlls/msi/install.c index 2a5ff40..68d8eb5 100644 --- a/dlls/msi/install.c +++ b/dlls/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/dlls/msi/package.c b/dlls/msi/package.c index 161ba81..d1a6923 100644 --- a/dlls/msi/package.c +++ b/dlls/msi/package.c @@ -2474,10 +2474,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/dlls/msi/tests/custom.c b/dlls/msi/tests/custom.c index bfd1e85..5062ecd 100644 --- a/dlls/msi/tests/custom.c +++ b/dlls/msi/tests/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/dlls/msi/tests/install.c b/dlls/msi/tests/install.c index c5d9243..6a7383b 100644 --- a/dlls/msi/tests/install.c +++ b/dlls/msi/tests/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"); diff --git a/dlls/msi/winemsi.idl b/dlls/msi/winemsi.idl index d103e9a..5e09c85 100644 --- a/dlls/msi/winemsi.idl +++ b/dlls/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 );
1
0
0
0
Zebediah Figura : msi: Make MsiSequence() RPC-compatible.
by Alexandre Julliard
23 Apr '18
23 Apr '18
Module: wine Branch: master Commit: 676376d1d3b87a8843e15baf6c7f7b958c2bdf83 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=676376d1d3b87a8843e15baf…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Sat Apr 21 19:33:44 2018 -0500 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> --- dlls/msi/install.c | 23 ++++------------------- dlls/msi/package.c | 5 ++--- dlls/msi/tests/custom.c | 7 +++++++ dlls/msi/tests/install.c | 7 +++++++ dlls/msi/winemsi.idl | 2 +- 5 files changed, 21 insertions(+), 23 deletions(-) diff --git a/dlls/msi/install.c b/dlls/msi/install.c index f488674..2a5ff40 100644 --- a/dlls/msi/install.c +++ b/dlls/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/dlls/msi/package.c b/dlls/msi/package.c index 0681189..161ba81 100644 --- a/dlls/msi/package.c +++ b/dlls/msi/package.c @@ -2469,10 +2469,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/dlls/msi/tests/custom.c b/dlls/msi/tests/custom.c index 5bdb8d2..bfd1e85 100644 --- a/dlls/msi/tests/custom.c +++ b/dlls/msi/tests/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/dlls/msi/tests/install.c b/dlls/msi/tests/install.c index b63e5da..c5d9243 100644 --- a/dlls/msi/tests/install.c +++ b/dlls/msi/tests/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[] = diff --git a/dlls/msi/winemsi.idl b/dlls/msi/winemsi.idl index 57790d1..d103e9a 100644 --- a/dlls/msi/winemsi.idl +++ b/dlls/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 );
1
0
0
0
Zebediah Figura : msi: Make MsiDoAction() RPC-compatible.
by Alexandre Julliard
23 Apr '18
23 Apr '18
Module: wine Branch: master Commit: c49abc8ce006441163c4a0b25d42ad1e9650d9da URL:
https://source.winehq.org/git/wine.git/?a=commit;h=c49abc8ce006441163c4a0b2…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Sat Apr 21 19:33:43 2018 -0500 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> --- dlls/msi/install.c | 20 +------------------- dlls/msi/package.c | 5 ++--- dlls/msi/tests/custom.c | 21 +++++++++++++++++++++ dlls/msi/tests/custom.spec | 1 + dlls/msi/tests/install.c | 2 ++ dlls/msi/winemsi.idl | 2 +- 6 files changed, 28 insertions(+), 23 deletions(-) diff --git a/dlls/msi/install.c b/dlls/msi/install.c index 814addc..f488674 100644 --- a/dlls/msi/install.c +++ b/dlls/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/dlls/msi/package.c b/dlls/msi/package.c index d18736b..0681189 100644 --- a/dlls/msi/package.c +++ b/dlls/msi/package.c @@ -2464,10 +2464,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/dlls/msi/tests/custom.c b/dlls/msi/tests/custom.c index e782311..5bdb8d2 100644 --- a/dlls/msi/tests/custom.c +++ b/dlls/msi/tests/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/dlls/msi/tests/custom.spec b/dlls/msi/tests/custom.spec index bb400ff..51bb60e 100644 --- a/dlls/msi/tests/custom.spec +++ b/dlls/msi/tests/custom.spec @@ -2,3 +2,4 @@ @ stdcall test_retval(long) @ stdcall da_immediate(long) @ stdcall da_deferred(long) +@ stdcall nested(long) diff --git a/dlls/msi/tests/install.c b/dlls/msi/tests/install.c index 41a77cd..b63e5da 100644 --- a/dlls/msi/tests/install.c +++ b/dlls/msi/tests/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"; diff --git a/dlls/msi/winemsi.idl b/dlls/msi/winemsi.idl index 7613fd3..57790d1 100644 --- a/dlls/msi/winemsi.idl +++ b/dlls/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 );
1
0
0
0
Alexandre Julliard : winex11: Support multiple fallbacks for cursor names.
by Alexandre Julliard
23 Apr '18
23 Apr '18
Module: wine Branch: master Commit: 508ad84bbef725676f2aab8fbf0e532fd97eb398 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=508ad84bbef725676f2aab8f…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Apr 23 12:01:40 2018 +0200 winex11: Support multiple fallbacks for cursor names. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winex11.drv/mouse.c | 78 ++++++++++++++++++++++++++---------------------- 1 file changed, 43 insertions(+), 35 deletions(-) diff --git a/dlls/winex11.drv/mouse.c b/dlls/winex11.drv/mouse.c index c3ec916..fdca083 100644 --- a/dlls/winex11.drv/mouse.c +++ b/dlls/winex11.drv/mouse.c @@ -819,58 +819,58 @@ cleanup: struct system_cursors { WORD id; - const char *name; + const char *names[8]; }; static const struct system_cursors user32_cursors[] = { - { OCR_NORMAL, "left_ptr" }, - { OCR_IBEAM, "xterm" }, - { OCR_WAIT, "watch" }, - { OCR_CROSS, "cross" }, - { OCR_UP, "center_ptr" }, - { OCR_SIZE, "fleur" }, - { OCR_SIZEALL, "fleur" }, - { OCR_ICON, "icon" }, - { OCR_SIZENWSE, "top_left_corner" }, - { OCR_SIZENESW, "top_right_corner" }, - { OCR_SIZEWE, "left_side" }, - { OCR_SIZENS, "top_side" }, - { OCR_NO, "not-allowed" }, - { OCR_HAND, "hand2" }, - { OCR_APPSTARTING, "left_ptr_watch" }, - { OCR_HELP, "question_arrow" }, + { OCR_NORMAL, { "left_ptr" }}, + { OCR_IBEAM, { "xterm", "text" }}, + { OCR_WAIT, { "watch", "wait" }}, + { OCR_CROSS, { "cross" }}, + { OCR_UP, { "center_ptr" }}, + { OCR_SIZE, { "fleur", "size_all" }}, + { OCR_SIZEALL, { "fleur", "size_all" }}, + { OCR_ICON, { "icon" }}, + { OCR_SIZENWSE, { "top_left_corner", "nw-resize" }}, + { OCR_SIZENESW, { "top_right_corner", "ne-resize" }}, + { OCR_SIZEWE, { "left_side", "size_hor", "h_double_arrow", "ew-resize" }}, + { OCR_SIZENS, { "top_side", "size_ver", "v_double_arrow", "ns-resize" }}, + { OCR_NO, { "not-allowed", "forbidden", "no-drop" }}, + { OCR_HAND, { "hand2", "pointer", "pointing-hand" }}, + { OCR_APPSTARTING, { "left_ptr_watch" }}, + { OCR_HELP, { "question_arrow", "help" }}, { 0 } }; static const struct system_cursors comctl32_cursors[] = { - { 102, "move" }, - { 104, "copy" }, - { 105, "left_ptr" }, - { 106, "col-resize" }, - { 107, "col-resize" }, - { 108, "hand2" }, - { 135, "row-resize" }, + { 102, { "move", "dnd-move" }}, + { 104, { "copy", "dnd-copy" }}, + { 105, { "left_ptr" }}, + { 106, { "col-resize", "split_v" }}, + { 107, { "col-resize", "split_v" }}, + { 108, { "hand2", "pointer", "pointing-hand" }}, + { 135, { "row-resize", "split_h" }}, { 0 } }; static const struct system_cursors ole32_cursors[] = { - { 1, "no-drop" }, - { 2, "move" }, - { 3, "copy" }, - { 4, "alias" }, + { 1, { "no-drop", "dnd-no-drop" }}, + { 2, { "move", "dnd-move" }}, + { 3, { "copy", "dnd-copy" }}, + { 4, { "alias", "dnd-link" }}, { 0 } }; static const struct system_cursors riched20_cursors[] = { - { 105, "hand2" }, - { 107, "right_ptr" }, - { 109, "copy" }, - { 110, "move" }, - { 111, "no-drop" }, + { 105, { "hand2", "pointer", "pointing-hand" }}, + { 107, { "right_ptr" }}, + { 109, { "copy", "dnd-copy" }}, + { 110, { "move", "dnd-move" }}, + { 111, { "no-drop", "dnd-no-drop" }}, { 0 } }; @@ -1004,6 +1004,7 @@ static Cursor create_xcursor_system_cursor( const ICONINFOEXW *info ) Cursor cursor = 0; HMODULE module; HKEY key; + const char * const *names = NULL; WCHAR *p, name[MAX_PATH * 2], valueW[64]; char valueA[64]; DWORD ret; @@ -1044,7 +1045,8 @@ static Cursor create_xcursor_system_cursor( const ICONINFOEXW *info ) for (i = 0; cursors[i].id; i++) if (cursors[i].id == info->wResID) { - strcpy( valueA, cursors[i].name ); + strcpy( valueA, cursors[i].names[0] ); + names = cursors[i].names; break; } @@ -1052,7 +1054,13 @@ done: if (valueA[0]) { #ifdef SONAME_LIBXCURSOR - if (pXcursorLibraryLoadCursor) cursor = pXcursorLibraryLoadCursor( gdi_display, valueA ); + if (pXcursorLibraryLoadCursor) + { + if (!names) + cursor = pXcursorLibraryLoadCursor( gdi_display, valueA ); + else + while (*names && !cursor) cursor = pXcursorLibraryLoadCursor( gdi_display, *names++ ); + } #endif if (!cursor) {
1
0
0
0
Nikolay Sivov : uxtheme/tests: Remove some trace messages.
by Alexandre Julliard
23 Apr '18
23 Apr '18
Module: wine Branch: master Commit: 16ab42f94dae69c60db3bfa6779713a20dca1bd1 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=16ab42f94dae69c60db3bfa6…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Mon Apr 23 10:45:13 2018 +0300 uxtheme/tests: Remove some trace messages. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/uxtheme/tests/system.c | 28 ++++++---------------------- 1 file changed, 6 insertions(+), 22 deletions(-) diff --git a/dlls/uxtheme/tests/system.c b/dlls/uxtheme/tests/system.c index 6989f44..c71eaa2 100644 --- a/dlls/uxtheme/tests/system.c +++ b/dlls/uxtheme/tests/system.c @@ -77,7 +77,6 @@ static void test_GetWindowTheme(void) { HTHEME hTheme; HWND hWnd; - BOOL bDestroyed; SetLastError(0xdeadbeef); hTheme = GetWindowTheme(NULL); @@ -89,7 +88,7 @@ static void test_GetWindowTheme(void) /* Only do the bare minimum to get a valid hwnd */ hWnd = CreateWindowExA(0, "static", "", WS_POPUP, 0,0,100,100,0, 0, 0, NULL); - if (!hWnd) return; + ok(hWnd != NULL, "Failed to create a test window.\n"); SetLastError(0xdeadbeef); hTheme = GetWindowTheme(hWnd); @@ -98,17 +97,13 @@ static void test_GetWindowTheme(void) "Expected 0xdeadbeef, got 0x%08x\n", GetLastError()); - bDestroyed = DestroyWindow(hWnd); - if (!bDestroyed) - trace("Window %p couldn't be destroyed : 0x%08x\n", - hWnd, GetLastError()); + DestroyWindow(hWnd); } static void test_SetWindowTheme(void) { HRESULT hRes; HWND hWnd; - BOOL bDestroyed; hRes = SetWindowTheme(NULL, NULL, NULL); todo_wine @@ -116,15 +111,12 @@ todo_wine /* Only do the bare minimum to get a valid hwnd */ hWnd = CreateWindowExA(0, "static", "", WS_POPUP, 0,0,100,100,0, 0, 0, NULL); - if (!hWnd) return; + ok(hWnd != NULL, "Failed to create a test window.\n"); hRes = SetWindowTheme(hWnd, NULL, NULL); ok( hRes == S_OK, "Expected S_OK, got 0x%08x\n", hRes); - bDestroyed = DestroyWindow(hWnd); - if (!bDestroyed) - trace("Window %p couldn't be destroyed : 0x%08x\n", - hWnd, GetLastError()); + DestroyWindow(hWnd); } static void test_OpenThemeData(void) @@ -133,7 +125,6 @@ static void test_OpenThemeData(void) HWND hWnd; BOOL bThemeActive; HRESULT hRes; - BOOL bDestroyed; BOOL bTPDefined; WCHAR szInvalidClassList[] = {'D','E','A','D','B','E','E','F', 0 }; @@ -274,10 +265,7 @@ static void test_OpenThemeData(void) GetLastError()); } - bDestroyed = DestroyWindow(hWnd); - if (!bDestroyed) - trace("Window %p couldn't be destroyed : 0x%08x\n", - hWnd, GetLastError()); + DestroyWindow(hWnd); } static void test_OpenThemeDataEx(void) @@ -285,7 +273,6 @@ static void test_OpenThemeDataEx(void) HTHEME hTheme; HWND hWnd; BOOL bThemeActive; - BOOL bDestroyed; WCHAR szInvalidClassList[] = {'D','E','A','D','B','E','E','F', 0 }; WCHAR szButtonClassList[] = {'B','u','t','t','o','n', 0 }; @@ -419,10 +406,7 @@ static void test_OpenThemeDataEx(void) "Expected ERROR_SUCCESS, got 0x%08x\n", GetLastError()); - bDestroyed = DestroyWindow(hWnd); - if (!bDestroyed) - trace("Window %p couldn't be destroyed : 0x%08x\n", - hWnd, GetLastError()); + DestroyWindow(hWnd); } static void test_GetCurrentThemeName(void)
1
0
0
0
Alistair Leslie-Hughes : hnetcfg/tests: Add INetFwAuthorizedApplication tests.
by Alexandre Julliard
23 Apr '18
23 Apr '18
Module: wine Branch: master Commit: 9e5145a7fe2d488299e6e69c375b8df531c9cb13 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=9e5145a7fe2d488299e6e69c…
Author: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Date: Mon Apr 23 02:24:06 2018 +0000 hnetcfg/tests: Add INetFwAuthorizedApplication tests. Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/hnetcfg/tests/Makefile.in | 2 +- dlls/hnetcfg/tests/policy.c | 49 +++++++++++++++++++++++++++++++++++++++++- 2 files changed, 49 insertions(+), 2 deletions(-) diff --git a/dlls/hnetcfg/tests/Makefile.in b/dlls/hnetcfg/tests/Makefile.in index aa4062a..8315b4b 100644 --- a/dlls/hnetcfg/tests/Makefile.in +++ b/dlls/hnetcfg/tests/Makefile.in @@ -1,5 +1,5 @@ TESTDLL = hnetcfg.dll -IMPORTS = ole32 uuid +IMPORTS = ole32 uuid oleaut32 advapi32 C_SRCS = \ policy.c diff --git a/dlls/hnetcfg/tests/policy.c b/dlls/hnetcfg/tests/policy.c index 7b5bef0..4d70818 100644 --- a/dlls/hnetcfg/tests/policy.c +++ b/dlls/hnetcfg/tests/policy.c @@ -102,6 +102,53 @@ static void test_interfaces(void) INetFwMgr_Release(manager); } +static void test_NetFwAuthorizedApplication(void) +{ + INetFwAuthorizedApplication *app; + HRESULT hr; + + hr = CoCreateInstance(&CLSID_NetFwAuthorizedApplication, NULL, CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER, + &IID_INetFwAuthorizedApplication, (void**)&app); + ok(hr == S_OK, "got: %08x\n", hr); + if(hr == S_OK) + { + BSTR image = SysAllocStringLen( NULL, MAX_PATH ); + static WCHAR empty[] = {0}; + BSTR bstr; + + if (!GetModuleFileNameW( NULL, image, MAX_PATH )) + { + ok(0, "Failed to get filename\n"); + SysFreeString( image ); + return; + } + + hr = INetFwAuthorizedApplication_get_ProcessImageFileName(app, NULL); + ok(hr == E_POINTER, "got: %08x\n", hr); + + hr = INetFwAuthorizedApplication_get_ProcessImageFileName(app, &bstr); + ok(hr == S_OK || hr == HRESULT_FROM_WIN32(ERROR_NOT_ENOUGH_MEMORY), "got: %08x\n", hr); + ok(!bstr, "got: %s\n", wine_dbgstr_w(bstr)); + + hr = INetFwAuthorizedApplication_put_ProcessImageFileName(app, NULL); + ok(hr == E_INVALIDARG || hr == HRESULT_FROM_WIN32(ERROR_PATH_NOT_FOUND), "got: %08x\n", hr); + + hr = INetFwAuthorizedApplication_put_ProcessImageFileName(app, empty); + ok(hr == E_INVALIDARG || hr == HRESULT_FROM_WIN32(ERROR_PATH_NOT_FOUND), "got: %08x\n", hr); + + hr = INetFwAuthorizedApplication_put_ProcessImageFileName(app, image); + ok(hr == S_OK, "got: %08x\n", hr); + + hr = INetFwAuthorizedApplication_get_ProcessImageFileName(app, &bstr); + ok(hr == S_OK, "got: %08x\n", hr); + ok(!lstrcmpW(bstr,image), "got: %s\n", wine_dbgstr_w(bstr)); + SysFreeString( bstr ); + + SysFreeString( image ); + INetFwAuthorizedApplication_Release(app); + } +} + START_TEST(policy) { INetFwMgr *manager; @@ -121,7 +168,7 @@ START_TEST(policy) INetFwMgr_Release(manager); test_interfaces(); - + test_NetFwAuthorizedApplication(); CoUninitialize(); }
1
0
0
0
Michael Müller : hnetcfg: Improve INetFwAuthorizedApplication::get_ProcessImageFileName stub.
by Alexandre Julliard
23 Apr '18
23 Apr '18
Module: wine Branch: master Commit: 0edc760ddf17bb41ca6a6bdfaad30cdae752e22a URL:
https://source.winehq.org/git/wine.git/?a=commit;h=0edc760ddf17bb41ca6a6bdf…
Author: Michael Müller <michael(a)fds-team.de> Date: Mon Apr 23 02:24:04 2018 +0000 hnetcfg: Improve INetFwAuthorizedApplication::get_ProcessImageFileName stub. Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/hnetcfg/apps.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/dlls/hnetcfg/apps.c b/dlls/hnetcfg/apps.c index 2b8d78c..fda714e 100644 --- a/dlls/hnetcfg/apps.c +++ b/dlls/hnetcfg/apps.c @@ -38,6 +38,7 @@ typedef struct fw_app { INetFwAuthorizedApplication INetFwAuthorizedApplication_iface; LONG refs; + BSTR filename; } fw_app; static inline fw_app *impl_from_INetFwAuthorizedApplication( INetFwAuthorizedApplication *iface ) @@ -60,6 +61,7 @@ static ULONG WINAPI fw_app_Release( if (!refs) { TRACE("destroying %p\n", fw_app); + SysFreeString( fw_app->filename ); HeapFree( GetProcessHeap(), 0, fw_app ); } return refs; @@ -252,7 +254,12 @@ static HRESULT WINAPI fw_app_get_ProcessImageFileName( fw_app *This = impl_from_INetFwAuthorizedApplication( iface ); FIXME("%p, %p\n", This, imageFileName); - return E_NOTIMPL; + + if (!imageFileName) + return E_POINTER; + + *imageFileName = SysAllocString( This->filename ); + return *imageFileName || !This->filename ? S_OK : E_OUTOFMEMORY; } static HRESULT WINAPI fw_app_put_ProcessImageFileName( @@ -262,7 +269,13 @@ static HRESULT WINAPI fw_app_put_ProcessImageFileName( fw_app *This = impl_from_INetFwAuthorizedApplication( iface ); FIXME("%p, %s\n", This, debugstr_w(imageFileName)); - return S_OK; + + if (!imageFileName || !imageFileName[0]) + return E_INVALIDARG; + + SysFreeString( This->filename ); + This->filename = SysAllocString( imageFileName ); + return This->filename ? S_OK : E_OUTOFMEMORY; } static HRESULT WINAPI fw_app_get_IpVersion( @@ -385,6 +398,7 @@ HRESULT NetFwAuthorizedApplication_create( IUnknown *pUnkOuter, LPVOID *ppObj ) fa->INetFwAuthorizedApplication_iface.lpVtbl = &fw_app_vtbl; fa->refs = 1; + fa->filename = NULL; *ppObj = &fa->INetFwAuthorizedApplication_iface;
1
0
0
0
Francois Gouget : makefiles: Make it possible to only build the tests.
by Alexandre Julliard
23 Apr '18
23 Apr '18
Module: wine Branch: master Commit: f82b3e57448ee753b35aa42dbe3959a536d1aaae URL:
https://source.winehq.org/git/wine.git/?a=commit;h=f82b3e57448ee753b35aa42d…
Author: Francois Gouget <fgouget(a)codeweavers.com> Date: Wed Apr 18 03:22:27 2018 +0200 makefiles: Make it possible to only build the tests. Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- tools/makedep.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/makedep.c b/tools/makedep.c index 4fc8435..2c5b40a 100644 --- a/tools/makedep.c +++ b/tools/makedep.c @@ -3577,7 +3577,7 @@ static void output_subdirs( struct makefile *make ) } if (winetest_deps.count) { - output( "programs/winetest:" ); + output( "buildtests programs/winetest:" ); output_filenames( winetest_deps ); output( "\n" ); output( "check test:" ); @@ -3588,6 +3588,7 @@ static void output_subdirs( struct makefile *make ) strarray_add( &make->phony_targets, target ); } output( "\n" ); + strarray_add( &make->phony_targets, "buildtests" ); strarray_add( &make->phony_targets, "check" ); strarray_add( &make->phony_targets, "test" ); }
1
0
0
0
← Newer
1
...
13
14
15
16
17
18
19
...
55
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
45
46
47
48
49
50
51
52
53
54
55
Results per page:
10
25
50
100
200