ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
March 2022
----- 2024 -----
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
20 participants
436 discussions
Start a n
N
ew thread
[reactos] 151/360: [WINESYNC] msi/tests: Drop workarounds for Windows 2000.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=a49306360d3768ff25325…
commit a49306360d3768ff25325eded953a2c0c96d7bf6 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sat Mar 12 23:57:45 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:28:02 2022 +0100 [WINESYNC] msi/tests: Drop workarounds for Windows 2000. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id 6a3e79b00225a1186a01101cd5614141748e6a53 by Hans Leidekker <hans(a)codeweavers.com> --- modules/rostests/winetests/msi/CMakeLists.txt | 2 +- modules/rostests/winetests/msi/action.c | 14 ++------ modules/rostests/winetests/msi/automation.c | 10 ++---- modules/rostests/winetests/msi/install.c | 6 +--- modules/rostests/winetests/msi/msi.c | 51 +++++++++++---------------- modules/rostests/winetests/msi/package.c | 45 ++++++----------------- modules/rostests/winetests/msi/patch.c | 7 +--- modules/rostests/winetests/msi/source.c | 25 ++----------- 8 files changed, 42 insertions(+), 118 deletions(-) diff --git a/modules/rostests/winetests/msi/CMakeLists.txt b/modules/rostests/winetests/msi/CMakeLists.txt index 8a6c44c7070..03ad557e08b 100644 --- a/modules/rostests/winetests/msi/CMakeLists.txt +++ b/modules/rostests/winetests/msi/CMakeLists.txt @@ -54,7 +54,7 @@ endif() target_link_libraries(msi_winetest uuid) set_module_type(msi_winetest win32cui) -add_importlibs(msi_winetest cabinet msi shell32 ole32 oleaut32 odbccp32 user32 advapi32 version msvcrt kernel32) +add_importlibs(msi_winetest secur32 cabinet msi shell32 ole32 oleaut32 odbccp32 user32 advapi32 version msvcrt kernel32) add_pch(msi_winetest precomp.h "${PCH_SKIP_SOURCE}") add_rostests_file(TARGET msi_winetest) add_dependencies(msi_winetest custom selfreg msi_winetest_idlheader stdole2) diff --git a/modules/rostests/winetests/msi/action.c b/modules/rostests/winetests/msi/action.c index 59a369d31fe..1e7c8bcbc1e 100644 --- a/modules/rostests/winetests/msi/action.c +++ b/modules/rostests/winetests/msi/action.c @@ -37,6 +37,7 @@ #ifdef __REACTOS__ #include <oleauto.h> #endif +#include <sddl.h> #include "wine/test.h" #include "utils.h" @@ -53,11 +54,9 @@ static INSTALLSTATE (WINAPI *pMsiGetComponentPathExA) static UINT (WINAPI *pMsiQueryFeatureStateExA) (LPCSTR, LPCSTR, MSIINSTALLCONTEXT, LPCSTR, INSTALLSTATE *); -static BOOL (WINAPI *pConvertSidToStringSidA)(PSID, LPSTR *); static LONG (WINAPI *pRegDeleteKeyExA)(HKEY, LPCSTR, REGSAM, DWORD); static BOOL (WINAPI *pIsWow64Process)(HANDLE, PBOOL); -static HMODULE hsrclient; static BOOL (WINAPI *pSRRemoveRestorePoint)(DWORD); static BOOL (WINAPI *pSRSetRestorePointA)(RESTOREPOINTINFOA *, STATEMGRSTATUS *); @@ -2359,6 +2358,7 @@ static void init_functionpointers(void) HMODULE hmsi = GetModuleHandleA("msi.dll"); HMODULE hadvapi32 = GetModuleHandleA("advapi32.dll"); HMODULE hkernel32 = GetModuleHandleA("kernel32.dll"); + HMODULE hsrclient = LoadLibraryA("srclient.dll"); #define GET_PROC(mod, func) \ p ## func = (void*)GetProcAddress(mod, #func); \ @@ -2371,11 +2371,9 @@ static void init_functionpointers(void) GET_PROC(hmsi, MsiGetComponentPathExA); GET_PROC(hmsi, MsiQueryFeatureStateExA); - GET_PROC(hadvapi32, ConvertSidToStringSidA); GET_PROC(hadvapi32, RegDeleteKeyExA) GET_PROC(hkernel32, IsWow64Process) - hsrclient = LoadLibraryA("srclient.dll"); GET_PROC(hsrclient, SRRemoveRestorePoint); GET_PROC(hsrclient, SRSetRestorePointA); @@ -2389,17 +2387,12 @@ static char *get_user_sid(void) TOKEN_USER *user; char *usersid = NULL; - if (!pConvertSidToStringSidA) - { - win_skip("ConvertSidToStringSidA is not available\n"); - return NULL; - } OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token); GetTokenInformation(token, TokenUser, NULL, size, &size); user = HeapAlloc(GetProcessHeap(), 0, size); GetTokenInformation(token, TokenUser, user, size, &size); - pConvertSidToStringSidA(user->User.Sid, &usersid); + ConvertSidToStringSidA(user->User.Sid, &usersid); HeapFree(GetProcessHeap(), 0, user); CloseHandle(token); @@ -6470,7 +6463,6 @@ START_TEST(action) if (ret) remove_restore_point(status.llSequenceNumber); } - FreeLibrary(hsrclient); SetCurrentDirectoryA(prev_path); } diff --git a/modules/rostests/winetests/msi/automation.c b/modules/rostests/winetests/msi/automation.c index 3478149f429..d7fed415cda 100644 --- a/modules/rostests/winetests/msi/automation.c +++ b/modules/rostests/winetests/msi/automation.c @@ -39,8 +39,6 @@ static BOOL is_wow64; -static BOOL (WINAPI *pCheckTokenMembership)(HANDLE,PSID,PBOOL); -static BOOL (WINAPI *pOpenProcessToken)(HANDLE, DWORD, PHANDLE); static LONG (WINAPI *pRegDeleteKeyExA)(HKEY, LPCSTR, REGSAM, DWORD); static BOOL (WINAPI *pIsWow64Process)(HANDLE, PBOOL); @@ -223,8 +221,6 @@ static void init_functionpointers(void) if(!p ## func) \ trace("GetProcAddress(%s) failed\n", #func); - GET_PROC(hadvapi32, CheckTokenMembership); - GET_PROC(hadvapi32, OpenProcessToken); GET_PROC(hadvapi32, RegDeleteKeyExA) GET_PROC(hkernel32, IsWow64Process) @@ -238,11 +234,9 @@ static BOOL is_process_limited(void) BOOL IsInGroup; HANDLE token; - if (!pCheckTokenMembership || !pOpenProcessToken) return FALSE; - if (!AllocateAndInitializeSid(&NtAuthority, 2, SECURITY_BUILTIN_DOMAIN_RID, DOMAIN_ALIAS_RID_ADMINS, 0, 0, 0, 0, 0, 0, &Group) || - !pCheckTokenMembership(NULL, Group, &IsInGroup)) + !CheckTokenMembership(NULL, Group, &IsInGroup)) { trace("Could not check if the current user is an administrator\n"); FreeSid(Group); @@ -256,7 +250,7 @@ static BOOL is_process_limited(void) return TRUE; } - if (pOpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token)) + if (OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token)) { BOOL ret; TOKEN_ELEVATION_TYPE type = TokenElevationTypeDefault; diff --git a/modules/rostests/winetests/msi/install.c b/modules/rostests/winetests/msi/install.c index 4fa186246a1..9c8652b353c 100644 --- a/modules/rostests/winetests/msi/install.c +++ b/modules/rostests/winetests/msi/install.c @@ -44,13 +44,11 @@ static UINT (WINAPI *pMsiSourceListEnumSourcesA) static INSTALLSTATE (WINAPI *pMsiGetComponentPathExA) (LPCSTR, LPCSTR, LPCSTR, MSIINSTALLCONTEXT, LPSTR, LPDWORD); -static BOOL (WINAPI *pConvertSidToStringSidA)(PSID, LPSTR*); static LONG (WINAPI *pRegDeleteKeyExA)(HKEY, LPCSTR, REGSAM, DWORD); static BOOL (WINAPI *pIsWow64Process)(HANDLE, PBOOL); static BOOL (WINAPI *pWow64DisableWow64FsRedirection)(void **); static BOOL (WINAPI *pWow64RevertWow64FsRedirection)(void *); -static HMODULE hsrclient = 0; static BOOL (WINAPI *pSRRemoveRestorePoint)(DWORD); static BOOL (WINAPI *pSRSetRestorePointA)(RESTOREPOINTINFOA*, STATEMGRSTATUS*); @@ -2146,6 +2144,7 @@ static void init_functionpointers(void) HMODULE hmsi = GetModuleHandleA("msi.dll"); HMODULE hadvapi32 = GetModuleHandleA("advapi32.dll"); HMODULE hkernel32 = GetModuleHandleA("kernel32.dll"); + HMODULE hsrclient = LoadLibraryA("srclient.dll"); #define GET_PROC(mod, func) \ p ## func = (void*)GetProcAddress(mod, #func); \ @@ -2156,13 +2155,11 @@ static void init_functionpointers(void) GET_PROC(hmsi, MsiSourceListEnumSourcesA); GET_PROC(hmsi, MsiGetComponentPathExA); - GET_PROC(hadvapi32, ConvertSidToStringSidA); GET_PROC(hadvapi32, RegDeleteKeyExA) GET_PROC(hkernel32, IsWow64Process) GET_PROC(hkernel32, Wow64DisableWow64FsRedirection); GET_PROC(hkernel32, Wow64RevertWow64FsRedirection); - hsrclient = LoadLibraryA("srclient.dll"); GET_PROC(hsrclient, SRRemoveRestorePoint); GET_PROC(hsrclient, SRSetRestorePointA); @@ -6294,7 +6291,6 @@ START_TEST(install) if (ret) remove_restore_point(status.llSequenceNumber); } - FreeLibrary(hsrclient); SetCurrentDirectoryA(prev_path); } diff --git a/modules/rostests/winetests/msi/msi.c b/modules/rostests/winetests/msi/msi.c index 099ed1a3291..ee962b52f80 100644 --- a/modules/rostests/winetests/msi/msi.c +++ b/modules/rostests/winetests/msi/msi.c @@ -38,7 +38,6 @@ static BOOL is_wow64; static const char msifile[] = "winetest.msi"; static const WCHAR msifileW[] = {'w','i','n','e','t','e','s','t','.','m','s','i',0}; -static BOOL (WINAPI *pConvertSidToStringSidA)(PSID, LPSTR*); static LONG (WINAPI *pRegDeleteKeyExA)(HKEY, LPCSTR, REGSAM, DWORD); static BOOL (WINAPI *pIsWow64Process)(HANDLE, PBOOL); @@ -104,7 +103,6 @@ static void init_functionpointers(void) GET_PROC(hmsi, MsiEnumComponentsExA) GET_PROC(hmsi, MsiSourceListGetInfoA) - GET_PROC(hadvapi32, ConvertSidToStringSidA) GET_PROC(hadvapi32, RegDeleteKeyExA) GET_PROC(hkernel32, IsWow64Process) @@ -1180,7 +1178,7 @@ static char *get_user_sid(void) user = HeapAlloc(GetProcessHeap(), 0, size); GetTokenInformation(token, TokenUser, user, size, &size); - pConvertSidToStringSidA(user->User.Sid, &usersid); + ConvertSidToStringSidA(user->User.Sid, &usersid); HeapFree(GetProcessHeap(), 0, user); CloseHandle(token); @@ -14462,33 +14460,26 @@ START_TEST(msi) test_MsiGetFileHash(); test_MsiSetInternalUI(); test_MsiSetExternalUI(); - - if (!pConvertSidToStringSidA) - win_skip("ConvertSidToStringSidA not implemented\n"); - else - { - /* These tests rely on get_user_sid that needs ConvertSidToStringSidA */ - test_MsiQueryProductState(); - test_MsiQueryFeatureState(); - test_MsiQueryComponentState(); - test_MsiGetComponentPath(); - test_MsiGetComponentPathEx(); - test_MsiProvideComponent(); - test_MsiGetProductCode(); - test_MsiEnumClients(); - test_MsiGetProductInfo(); - test_MsiGetProductInfoEx(); - test_MsiGetUserInfo(); - test_MsiOpenProduct(); - test_MsiEnumPatchesEx(); - test_MsiEnumPatches(); - test_MsiGetPatchInfoEx(); - test_MsiGetPatchInfo(); - test_MsiEnumProducts(); - test_MsiEnumProductsEx(); - test_MsiEnumComponents(); - test_MsiEnumComponentsEx(); - } + test_MsiQueryProductState(); + test_MsiQueryFeatureState(); + test_MsiQueryComponentState(); + test_MsiGetComponentPath(); + test_MsiGetComponentPathEx(); + test_MsiProvideComponent(); + test_MsiGetProductCode(); + test_MsiEnumClients(); + test_MsiGetProductInfo(); + test_MsiGetProductInfoEx(); + test_MsiGetUserInfo(); + test_MsiOpenProduct(); + test_MsiEnumPatchesEx(); + test_MsiEnumPatches(); + test_MsiGetPatchInfoEx(); + test_MsiGetPatchInfo(); + test_MsiEnumProducts(); + test_MsiEnumProductsEx(); + test_MsiEnumComponents(); + test_MsiEnumComponentsEx(); test_MsiGetFileVersion(); test_MsiGetFileSignatureInformation(); test_MsiConfigureProductEx(); diff --git a/modules/rostests/winetests/msi/package.c b/modules/rostests/winetests/msi/package.c index d6d90ce39fb..d5f156825df 100644 --- a/modules/rostests/winetests/msi/package.c +++ b/modules/rostests/winetests/msi/package.c @@ -29,6 +29,7 @@ #include <msiquery.h> #include <srrestoreptapi.h> #include <shlobj.h> +#include <sddl.h> #include "wine/test.h" @@ -39,18 +40,10 @@ static const WCHAR msifileW[] = static char CURR_DIR[MAX_PATH]; static INSTALLSTATE (WINAPI *pMsiGetComponentPathExA)(LPCSTR, LPCSTR, LPCSTR, MSIINSTALLCONTEXT, LPSTR, LPDWORD); -static HRESULT (WINAPI *pSHGetFolderPathA)(HWND, int, HANDLE, DWORD, LPSTR); -static BOOL (WINAPI *pCheckTokenMembership)(HANDLE,PSID,PBOOL); -static BOOL (WINAPI *pConvertSidToStringSidA)(PSID, LPSTR*); -static BOOL (WINAPI *pOpenProcessToken)( HANDLE, DWORD, PHANDLE ); static LONG (WINAPI *pRegDeleteKeyExA)(HKEY, LPCSTR, REGSAM, DWORD); static LONG (WINAPI *pRegDeleteKeyExW)(HKEY, LPCWSTR, REGSAM, DWORD); static BOOL (WINAPI *pIsWow64Process)(HANDLE, PBOOL); -static void (WINAPI *pGetSystemInfo)(LPSYSTEM_INFO); -static void (WINAPI *pGetNativeSystemInfo)(LPSYSTEM_INFO); -static UINT (WINAPI *pGetSystemWow64DirectoryA)(LPSTR, UINT); - static BOOL (WINAPI *pSRRemoveRestorePoint)(DWORD); static BOOL (WINAPI *pSRSetRestorePointA)(RESTOREPOINTINFOA*, STATEMGRSTATUS*); @@ -59,28 +52,20 @@ static void init_functionpointers(void) HMODULE hmsi = GetModuleHandleA("msi.dll"); HMODULE hadvapi32 = GetModuleHandleA("advapi32.dll"); HMODULE hkernel32 = GetModuleHandleA("kernel32.dll"); - HMODULE hshell32 = GetModuleHandleA("shell32.dll"); - HMODULE hsrclient; + HMODULE hsrclient = LoadLibraryA("srclient.dll"); #define GET_PROC(mod, func) \ p ## func = (void*)GetProcAddress(mod, #func); GET_PROC(hmsi, MsiGetComponentPathExA); - GET_PROC(hshell32, SHGetFolderPathA); - GET_PROC(hadvapi32, CheckTokenMembership); - GET_PROC(hadvapi32, ConvertSidToStringSidA); - GET_PROC(hadvapi32, OpenProcessToken); GET_PROC(hadvapi32, RegDeleteKeyExA) GET_PROC(hadvapi32, RegDeleteKeyExW) GET_PROC(hkernel32, IsWow64Process) - GET_PROC(hkernel32, GetNativeSystemInfo) - GET_PROC(hkernel32, GetSystemInfo) - GET_PROC(hkernel32, GetSystemWow64DirectoryA) - hsrclient = LoadLibraryA("srclient.dll"); GET_PROC(hsrclient, SRRemoveRestorePoint); GET_PROC(hsrclient, SRSetRestorePointA); + #undef GET_PROC } @@ -91,11 +76,9 @@ static BOOL is_process_limited(void) BOOL IsInGroup; HANDLE token; - if (!pCheckTokenMembership || !pOpenProcessToken) return FALSE; - if (!AllocateAndInitializeSid(&NtAuthority, 2, SECURITY_BUILTIN_DOMAIN_RID, DOMAIN_ALIAS_RID_ADMINS, 0, 0, 0, 0, 0, 0, &Group) || - !pCheckTokenMembership(NULL, Group, &IsInGroup)) + !CheckTokenMembership(NULL, Group, &IsInGroup)) { trace("Could not check if the current user is an administrator\n"); FreeSid(Group); @@ -109,7 +92,7 @@ static BOOL is_process_limited(void) SECURITY_BUILTIN_DOMAIN_RID, DOMAIN_ALIAS_RID_POWER_USERS, 0, 0, 0, 0, 0, 0, &Group) || - !pCheckTokenMembership(NULL, Group, &IsInGroup)) + !CheckTokenMembership(NULL, Group, &IsInGroup)) { trace("Could not check if the current user is a power user\n"); return FALSE; @@ -121,7 +104,7 @@ static BOOL is_process_limited(void) } } - if (pOpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token)) + if (OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token)) { BOOL ret; TOKEN_ELEVATION_TYPE type = TokenElevationTypeDefault; @@ -148,17 +131,12 @@ static char *get_user_sid(void) TOKEN_USER *user; char *usersid = NULL; - if (!pConvertSidToStringSidA) - { - win_skip("ConvertSidToStringSidA is not available\n"); - return NULL; - } OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token); GetTokenInformation(token, TokenUser, NULL, size, &size); user = HeapAlloc(GetProcessHeap(), 0, size); GetTokenInformation(token, TokenUser, user, size, &size); - pConvertSidToStringSidA(user->User.Sid, &usersid); + ConvertSidToStringSidA(user->User.Sid, &usersid); HeapFree(GetProcessHeap(), 0, user); CloseHandle(token); @@ -4705,7 +4683,7 @@ static void test_appsearch_reglocator(void) ok(!lstrcmpA(prop, "#-42"), "Expected \"#-42\", got \"%s\"\n", prop); memset(&si, 0, sizeof(si)); - if (pGetNativeSystemInfo) pGetNativeSystemInfo(&si); + GetNativeSystemInfo(&si); if (S(U(si)).wProcessorArchitecture == PROCESSOR_ARCHITECTURE_INTEL) { @@ -5721,10 +5699,7 @@ static void test_installprops(void) r = MsiGetPropertyA(hpkg, "MsiNetAssemblySupport", buf, &size); if (r == ERROR_SUCCESS) trace( "MsiNetAssemblySupport \"%s\"\n", buf ); - if (pGetNativeSystemInfo) - pGetNativeSystemInfo(&si); - else - pGetSystemInfo(&si); + GetNativeSystemInfo(&si); if (S(U(si)).wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64) { @@ -5739,7 +5714,7 @@ static void test_installprops(void) strcat(path, "\\"); check_prop(hpkg, "System64Folder", path); - pGetSystemWow64DirectoryA(path, MAX_PATH); + GetSystemWow64DirectoryA(path, MAX_PATH); strcat(path, "\\"); check_prop(hpkg, "SystemFolder", path); diff --git a/modules/rostests/winetests/msi/patch.c b/modules/rostests/winetests/msi/patch.c index b5779824430..63d38b8ff9b 100644 --- a/modules/rostests/winetests/msi/patch.c +++ b/modules/rostests/winetests/msi/patch.c @@ -36,7 +36,6 @@ static UINT (WINAPI *pMsiGetPatchInfoExA)( LPCSTR, LPCSTR, LPCSTR, MSIINSTALLCON LPCSTR, LPSTR, DWORD * ); static UINT (WINAPI *pMsiEnumPatchesExA)( LPCSTR, LPCSTR, DWORD, DWORD, DWORD, LPSTR, LPSTR, MSIINSTALLCONTEXT *, LPSTR, LPDWORD ); -static BOOL (WINAPI *pOpenProcessToken)( HANDLE, DWORD, PHANDLE ); static const char *msifile = "winetest-patch.msi"; static const char *mspfile = "winetest-patch.msp"; @@ -145,7 +144,6 @@ static const struct msi_table tables[] = static void init_function_pointers( void ) { HMODULE hmsi = GetModuleHandleA( "msi.dll" ); - HMODULE hadvapi32 = GetModuleHandleA( "advapi32.dll" ); #define GET_PROC( mod, func ) \ p ## func = (void *)GetProcAddress( mod, #func ); \ @@ -156,7 +154,6 @@ static void init_function_pointers( void ) GET_PROC( hmsi, MsiGetPatchInfoExA ); GET_PROC( hmsi, MsiEnumPatchesExA ); - GET_PROC( hadvapi32, OpenProcessToken ); #undef GET_PROC } @@ -164,9 +161,7 @@ static BOOL is_process_limited(void) { HANDLE token; - if (!pOpenProcessToken) return FALSE; - - if (pOpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token)) + if (OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token)) { BOOL ret; TOKEN_ELEVATION_TYPE type = TokenElevationTypeDefault; diff --git a/modules/rostests/winetests/msi/source.c b/modules/rostests/winetests/msi/source.c index a03cf557aaf..654df35f540 100644 --- a/modules/rostests/winetests/msi/source.c +++ b/modules/rostests/winetests/msi/source.c @@ -34,9 +34,7 @@ static BOOL is_wow64; -static BOOL (WINAPI *pConvertSidToStringSidA)(PSID, LPSTR*); static LONG (WINAPI *pRegDeleteKeyExA)(HKEY, LPCSTR, REGSAM, DWORD); -static BOOLEAN (WINAPI *pGetUserNameExA)(EXTENDED_NAME_FORMAT, LPSTR, PULONG); static BOOL (WINAPI *pIsWow64Process)(HANDLE, PBOOL); static UINT (WINAPI *pMsiSourceListAddMediaDiskA) @@ -60,7 +58,6 @@ static void init_functionpointers(void) HMODULE hmsi = GetModuleHandleA("msi.dll"); HMODULE hadvapi32 = GetModuleHandleA("advapi32.dll"); HMODULE hkernel32 = GetModuleHandleA("kernel32.dll"); - HMODULE hsecur32 = LoadLibraryA("secur32.dll"); #define GET_PROC(dll, func) \ p ## func = (void *)GetProcAddress(dll, #func); \ @@ -75,10 +72,8 @@ static void init_functionpointers(void) GET_PROC(hmsi, MsiSourceListSetInfoA) GET_PROC(hmsi, MsiSourceListAddSourceA) - GET_PROC(hadvapi32, ConvertSidToStringSidA) GET_PROC(hadvapi32, RegDeleteKeyExA) GET_PROC(hkernel32, IsWow64Process) - GET_PROC(hsecur32, GetUserNameExA) #undef GET_PROC } @@ -142,17 +137,12 @@ static char *get_user_sid(void) TOKEN_USER *user; char *usersid = NULL; - if (!pConvertSidToStringSidA) - { - win_skip("ConvertSidToStringSidA is not available\n"); - return NULL; - } OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token); GetTokenInformation(token, TokenUser, NULL, size, &size); user = HeapAlloc(GetProcessHeap(), 0, size); GetTokenInformation(token, TokenUser, user, size, &size); - pConvertSidToStringSidA(user->User.Sid, &usersid); + ConvertSidToStringSidA(user->User.Sid, &usersid); HeapFree(GetProcessHeap(), 0, user); CloseHandle(token); @@ -3241,7 +3231,7 @@ static void test_MsiSourceListAddSource(void) CHAR prod_squashed[MAX_PATH]; CHAR keypath[MAX_PATH*2]; CHAR username[MAX_PATH]; - LPSTR usersid, ptr; + LPSTR usersid; LONG res; UINT r; HKEY prodkey, userkey, net, source; @@ -3263,16 +3253,7 @@ static void test_MsiSourceListAddSource(void) /* MACHINENAME\username */ size = MAX_PATH; - if (pGetUserNameExA != NULL) - pGetUserNameExA(NameSamCompatible, username, &size); - else - { - GetComputerNameA(username, &size); - lstrcatA(username, "\\"); - ptr = username + lstrlenA(username); - size = MAX_PATH - (ptr - username); - GetUserNameA(ptr, &size); - } + GetUserNameExA(NameSamCompatible, username, &size); trace("username: %s\n", username); if (is_wow64)
2 years, 6 months
1
0
0
0
[reactos] 150/360: [WINESYNC] msi/tests: Add a test for repetitive MsiGetActiveDatabase calls.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=6ff51864fbcfd68b4620d…
commit 6ff51864fbcfd68b4620d48c93226158ea625020 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sat Mar 12 23:57:42 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:28:02 2022 +0100 [WINESYNC] msi/tests: Add a test for repetitive MsiGetActiveDatabase calls. Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id 06fd9bb3178c363bdcc89586248a2ce707f94041 by Dmitry Timoshkov <dmitry(a)baikal.ru> --- modules/rostests/winetests/msi/custom.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/modules/rostests/winetests/msi/custom.c b/modules/rostests/winetests/msi/custom.c index c9ec82fd930..cd6cb0c3787 100644 --- a/modules/rostests/winetests/msi/custom.c +++ b/modules/rostests/winetests/msi/custom.c @@ -281,7 +281,7 @@ static void test_db(MSIHANDLE hinst) VT_EMPTY, VT_EMPTY, VT_LPSTR, VT_EMPTY, VT_LPSTR, VT_EMPTY, VT_EMPTY, VT_EMPTY, VT_EMPTY, VT_I4, VT_I4, VT_EMPTY, VT_EMPTY, VT_EMPTY, VT_EMPTY }; - MSIHANDLE hdb, view, rec, rec2, suminfo; + MSIHANDLE hdb, hdb2, view, rec, rec2, suminfo; char buffer[10]; DWORD sz; UINT r, count, type, i; @@ -312,6 +312,17 @@ static void test_db(MSIHANDLE hinst) ok(hinst, sz == strlen(buffer), "got size %u\n", sz); ok(hinst, !strcmp(buffer, "Name"), "got '%s'\n", buffer); + /* Test MsiGetActiveDatabase + MsiDatabaseIsTablePersistent once again */ + hdb2 = MsiGetActiveDatabase(hinst); + ok(hinst, hdb2, "MsiGetActiveDatabase failed\n"); + ok(hinst, hdb2 != hdb, "db handles should be different\n"); + + r = MsiDatabaseIsTablePersistentA(hdb2, "Test"); + ok(hinst, r == MSICONDITION_TRUE, "got %u\n", r); + + r = MsiCloseHandle(hdb2); + ok(hinst, !r, "got %u\n", r); + r = MsiCloseHandle(rec2); ok(hinst, !r, "got %u\n", r);
2 years, 6 months
1
0
0
0
[reactos] 149/360: [WINESYNC] msi/tests: Also test full range of properties for MsiSummaryInfoSetPropertyW.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=dbebec30653cd45ee69d9…
commit dbebec30653cd45ee69d90a556b3b33321b35cdc Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sat Mar 12 23:57:42 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:28:02 2022 +0100 [WINESYNC] msi/tests: Also test full range of properties for MsiSummaryInfoSetPropertyW. Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id ff0129370869ed4ffb4acd69d7123f3d5ca294c3 by Dmitry Timoshkov <dmitry(a)baikal.ru> --- modules/rostests/winetests/msi/custom.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/modules/rostests/winetests/msi/custom.c b/modules/rostests/winetests/msi/custom.c index f06aee06755..c9ec82fd930 100644 --- a/modules/rostests/winetests/msi/custom.c +++ b/modules/rostests/winetests/msi/custom.c @@ -510,12 +510,14 @@ static void test_db(MSIHANDLE hinst) for (i = 0; i < 20; i++) { + WCHAR emptyW[1] = { 0 }; + r = MsiSummaryInfoSetPropertyA(suminfo, i, prop_type[i], 1252, &ft, ""); ok(hinst, r == ERROR_FUNCTION_FAILED, "%u: got %u\n", i, r); - } - r = MsiSummaryInfoSetPropertyW(suminfo, PID_CODEPAGE, VT_I2, 1252, &ft, NULL); - ok(hinst, r == ERROR_FUNCTION_FAILED, "got %u\n", r); + r = MsiSummaryInfoSetPropertyW(suminfo, i, prop_type[i], 1252, &ft, emptyW); + ok(hinst, r == ERROR_FUNCTION_FAILED, "%u: got %u\n", i, r); + } r = MsiCloseHandle(suminfo); ok(hinst, !r, "got %u\n", r);
2 years, 6 months
1
0
0
0
[reactos] 148/360: [WINESYNC] msi: Do not attempt to copy a non-string property in MsiSummaryInfoGetProperty.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=7c8b6fdf828dc73375e07…
commit 7c8b6fdf828dc73375e07b7d22e835075e940adc Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sat Mar 12 23:57:42 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:28:02 2022 +0100 [WINESYNC] msi: Do not attempt to copy a non-string property in MsiSummaryInfoGetProperty. This patch fixes the crashes when running the tests under Wine. Currently the crashes are hidden by a custom action exception handler. Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id b857369f87c49f812b23320099dcb91dbdb6f320 by Dmitry Timoshkov <dmitry(a)baikal.ru> --- dll/win32/msi/suminfo.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dll/win32/msi/suminfo.c b/dll/win32/msi/suminfo.c index ec676e46e00..6b3a559f60c 100644 --- a/dll/win32/msi/suminfo.c +++ b/dll/win32/msi/suminfo.c @@ -773,8 +773,10 @@ UINT WINAPI MsiSummaryInfoGetPropertyA( } __ENDTRY - if (!r) + if (!r && buf) + { r = msi_strncpyWtoA( buf, -1, szValueBuf, pcchValueBuf, TRUE ); + } midl_user_free( buf ); return r; @@ -823,7 +825,7 @@ UINT WINAPI MsiSummaryInfoGetPropertyW( } __ENDTRY - if (!r) + if (!r && buf) r = msi_strncpyW( buf, -1, szValueBuf, pcchValueBuf ); midl_user_free( buf );
2 years, 6 months
1
0
0
0
[reactos] 147/360: [WINESYNC] msi: Move parameter checks to a common helper in MsiSummaryInfoSetProperty.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=e58cc02596abbbcbe343a…
commit e58cc02596abbbcbe343a82aad2d4789be3e0182 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sat Mar 12 23:57:42 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:28:02 2022 +0100 [WINESYNC] msi: Move parameter checks to a common helper in MsiSummaryInfoSetProperty. Currently MsiSummaryInfoSetProperty tests don't have a chance to execute under Wine because the tests crash earlier, and the crashes are hidden by a custom action exception handler. This patch simplifies the next one. Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id 7929c31ea7b9f47f68cd434393f1212e448a9cf7 by Dmitry Timoshkov <dmitry(a)baikal.ru> --- dll/win32/msi/suminfo.c | 44 ++++++++++++++++++++------------------------ 1 file changed, 20 insertions(+), 24 deletions(-) diff --git a/dll/win32/msi/suminfo.c b/dll/win32/msi/suminfo.c index 41ea4e44122..ec676e46e00 100644 --- a/dll/win32/msi/suminfo.c +++ b/dll/win32/msi/suminfo.c @@ -892,26 +892,32 @@ static UINT set_prop( MSISUMMARYINFO *si, UINT uiProperty, UINT type, return ERROR_SUCCESS; } -UINT WINAPI MsiSummaryInfoSetPropertyW( MSIHANDLE handle, UINT uiProperty, UINT uiDataType, - INT iValue, FILETIME *pftValue, LPCWSTR szValue ) +static UINT msi_set_prop( MSISUMMARYINFO *si, UINT uiProperty, UINT uiDataType, + INT iValue, FILETIME *pftValue, awcstring *str ) { - awcstring str; - MSISUMMARYINFO *si; - UINT type, ret; - - TRACE("%u, %u, %u, %d, %p, %s\n", handle, uiProperty, uiDataType, iValue, pftValue, - debugstr_w(szValue) ); - - type = get_type( uiProperty ); + UINT type = get_type( uiProperty ); if( type == VT_EMPTY || type != uiDataType ) return ERROR_DATATYPE_MISMATCH; - if( uiDataType == VT_LPSTR && !szValue ) + if( uiDataType == VT_LPSTR && !str->str.a ) return ERROR_INVALID_PARAMETER; if( uiDataType == VT_FILETIME && !pftValue ) return ERROR_INVALID_PARAMETER; + return set_prop( si, uiProperty, type, iValue, pftValue, str ); +} + +UINT WINAPI MsiSummaryInfoSetPropertyW( MSIHANDLE handle, UINT uiProperty, UINT uiDataType, + INT iValue, FILETIME *pftValue, LPCWSTR szValue ) +{ + awcstring str; + MSISUMMARYINFO *si; + UINT ret; + + TRACE("%u, %u, %u, %d, %p, %s\n", handle, uiProperty, uiDataType, iValue, pftValue, + debugstr_w(szValue) ); + if (!(si = msihandle2msiinfo( handle, MSIHANDLETYPE_SUMMARYINFO ))) { MSIHANDLE remote; @@ -928,7 +934,7 @@ UINT WINAPI MsiSummaryInfoSetPropertyW( MSIHANDLE handle, UINT uiProperty, UINT str.unicode = TRUE; str.str.w = szValue; - ret = set_prop( si, uiProperty, type, iValue, pftValue, &str ); + ret = msi_set_prop( si, uiProperty, uiDataType, iValue, pftValue, &str ); msiobj_release( &si->hdr ); return ret; } @@ -938,21 +944,11 @@ UINT WINAPI MsiSummaryInfoSetPropertyA( MSIHANDLE handle, UINT uiProperty, UINT { awcstring str; MSISUMMARYINFO *si; - UINT type, ret; + UINT ret; TRACE("%u, %u, %u, %d, %p, %s\n", handle, uiProperty, uiDataType, iValue, pftValue, debugstr_a(szValue) ); - type = get_type( uiProperty ); - if( type == VT_EMPTY || type != uiDataType ) - return ERROR_DATATYPE_MISMATCH; - - if( uiDataType == VT_LPSTR && !szValue ) - return ERROR_INVALID_PARAMETER; - - if( uiDataType == VT_FILETIME && !pftValue ) - return ERROR_INVALID_PARAMETER; - if (!(si = msihandle2msiinfo( handle, MSIHANDLETYPE_SUMMARYINFO ))) { MSIHANDLE remote; @@ -969,7 +965,7 @@ UINT WINAPI MsiSummaryInfoSetPropertyA( MSIHANDLE handle, UINT uiProperty, UINT str.unicode = FALSE; str.str.a = szValue; - ret = set_prop( si, uiProperty, uiDataType, iValue, pftValue, &str ); + ret = msi_set_prop( si, uiProperty, uiDataType, iValue, pftValue, &str ); msiobj_release( &si->hdr ); return ret; }
2 years, 6 months
1
0
0
0
[reactos] 146/360: [WINESYNC] msi: Fix a typo.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=bf1ca65888dd7c823beb0…
commit bf1ca65888dd7c823beb04cc0d2ebcfd3f9b36ff Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sat Mar 12 23:57:41 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:28:02 2022 +0100 [WINESYNC] msi: Fix a typo. Should fix the regression introduced by baea371c3d4153bc4a718c07f46971d4d39aa9f3. Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id 09e4240f33425eda3ea05eb2a98adaec184b7ba4 by Dmitry Timoshkov <dmitry(a)baikal.ru> --- dll/win32/msi/package.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dll/win32/msi/package.c b/dll/win32/msi/package.c index e59bf93ebe0..2b3b3ad4e18 100644 --- a/dll/win32/msi/package.c +++ b/dll/win32/msi/package.c @@ -1749,7 +1749,7 @@ MSIHANDLE WINAPI MsiGetActiveDatabase(MSIHANDLE hInstall) { __TRY { - handle = remote_GetActiveDatabase(hInstall); + handle = remote_GetActiveDatabase(remote); handle = alloc_msi_remote_handle(handle); } __EXCEPT(rpc_filter)
2 years, 6 months
1
0
0
0
[reactos] 145/360: [WINESYNC] msi/tests: Add more tests for remote MsiSummaryInfoGetProperty.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=4ad772129d53f4019a214…
commit 4ad772129d53f4019a214d61284fbae095c075f4 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sat Mar 12 23:57:40 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:28:01 2022 +0100 [WINESYNC] msi/tests: Add more tests for remote MsiSummaryInfoGetProperty. Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id 69b7e09fa76d73c51fd290b511400060ef7c20f0 by Dmitry Timoshkov <dmitry(a)baikal.ru> --- modules/rostests/winetests/msi/custom.c | 69 ++++++++++++++++++++++----------- 1 file changed, 46 insertions(+), 23 deletions(-) diff --git a/modules/rostests/winetests/msi/custom.c b/modules/rostests/winetests/msi/custom.c index a727bbd4df0..f06aee06755 100644 --- a/modules/rostests/winetests/msi/custom.c +++ b/modules/rostests/winetests/msi/custom.c @@ -277,10 +277,14 @@ static void test_props(MSIHANDLE hinst) static void test_db(MSIHANDLE hinst) { + static const UINT prop_type[20] = { VT_EMPTY, VT_EMPTY, VT_LPSTR, VT_EMPTY, VT_EMPTY, + VT_EMPTY, VT_EMPTY, VT_LPSTR, VT_EMPTY, VT_LPSTR, + VT_EMPTY, VT_EMPTY, VT_EMPTY, VT_EMPTY, VT_I4, + VT_I4, VT_EMPTY, VT_EMPTY, VT_EMPTY, VT_EMPTY }; MSIHANDLE hdb, view, rec, rec2, suminfo; char buffer[10]; DWORD sz; - UINT r, count, type; + UINT r, count, type, i; INT int_value; FILETIME ft; @@ -466,30 +470,49 @@ static void test_db(MSIHANDLE hinst) r = MsiSummaryInfoGetPropertyA(suminfo, 0, NULL, NULL, NULL, NULL, NULL); ok(hinst, r == RPC_X_NULL_REF_POINTER, "got %u\n", r); - type = 0xdeadbeef; - int_value = 0xdeadbeef; - strcpy(buffer, "deadbeef"); - sz = sizeof(buffer); - r = MsiSummaryInfoGetPropertyA(suminfo, PID_AUTHOR, &type, &int_value, &ft, buffer, &sz); - ok(hinst, !r, "got %u\n", r); - ok(hinst, type == 0, "got %u\n", type); - ok(hinst, int_value == 0, "got %u\n", int_value); - ok(hinst, sz == sizeof(buffer), "got %u\n", sz); - ok(hinst, !lstrcmpA(buffer, "deadbeef"), "got %s\n", buffer); + for (i = 0; i < 20; i++) + { + /* for some reason query for PID_TITLE leads to install failure under Windows */ + if (i == PID_TITLE) continue; + + type = 0xdeadbeef; + int_value = 0xdeadbeef; + *buffer = 0; + sz = sizeof(buffer); + r = MsiSummaryInfoGetPropertyA(suminfo, i, &type, &int_value, &ft, buffer, &sz); + if (sz == sizeof(buffer) || i == PID_TEMPLATE) + ok(hinst, !r, "%u: got %u\n", i, r); + else + ok(hinst, r == ERROR_MORE_DATA, "%u: got %u\n", i, r); + ok(hinst, type == prop_type[i], "%u: expected %u, got %u\n", i, prop_type[i], type); + if (i == PID_PAGECOUNT) + ok(hinst, int_value == 100, "%u: got %u\n", i, int_value); + else + ok(hinst, int_value == 0, "%u: got %u\n", i, int_value); + if (i == PID_TEMPLATE) + { + ok(hinst, sz == 5, "%u: got %u\n", i, sz); + ok(hinst, !lstrcmpA(buffer, ";1033"), "%u: got %s\n", i, buffer); + } + else if (i == PID_REVNUMBER) + { + ok(hinst, sz == 76, "%u: got %u\n", i, sz); + ok(hinst, !lstrcmpA(buffer, "{004757CA"), "%u: got %s\n", i, buffer); + } + else + { + ok(hinst, sz == sizeof(buffer), "%u: got %u\n", i, sz); + ok(hinst, !*buffer, "%u: got %s\n", i, buffer); + } + } - type = 0xdeadbeef; - int_value = 0xdeadbeef; - strcpy(buffer, "deadbeef"); - sz = sizeof(buffer); - r = MsiSummaryInfoGetPropertyA(suminfo, PID_CODEPAGE, &type, &int_value, &ft, buffer, &sz); - ok(hinst, !r, "got %u\n", r); - ok(hinst, type == 0, "got %u\n", type); - ok(hinst, int_value == 0, "got %u\n", int_value); - ok(hinst, sz == sizeof(buffer), "got %u\n", sz); - ok(hinst, !lstrcmpA(buffer, "deadbeef"), "got %s\n", buffer); + GetSystemTimeAsFileTime(&ft); - r = MsiSummaryInfoSetPropertyA(suminfo, PID_CODEPAGE, VT_I2, 1252, &ft, ""); - ok(hinst, r == ERROR_FUNCTION_FAILED, "got %u\n", r); + for (i = 0; i < 20; i++) + { + r = MsiSummaryInfoSetPropertyA(suminfo, i, prop_type[i], 1252, &ft, ""); + ok(hinst, r == ERROR_FUNCTION_FAILED, "%u: got %u\n", i, r); + } r = MsiSummaryInfoSetPropertyW(suminfo, PID_CODEPAGE, VT_I2, 1252, &ft, NULL); ok(hinst, r == ERROR_FUNCTION_FAILED, "got %u\n", r);
2 years, 6 months
1
0
0
0
[reactos] 144/360: [WINESYNC] msi: Handle the remote case in MsiSummaryInfoGetProperty.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=0bde2536218b81af405ff…
commit 0bde2536218b81af405ff4e3810e9616d38a2dab Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sat Mar 12 23:57:40 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:28:01 2022 +0100 [WINESYNC] msi: Handle the remote case in MsiSummaryInfoGetProperty. This patch fixes the regression introduced by bf5589311de8ac2c74e3bd73bef32337a2ce8df2. Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id ce2ebd72750ca85e7307372de1a73831ad9e73a8 by Dmitry Timoshkov <dmitry(a)baikal.ru> --- dll/win32/msi/suminfo.c | 66 ++++++++++++++++++++++++++++++++- dll/win32/msi/winemsi.idl | 2 + modules/rostests/winetests/msi/custom.c | 7 ---- 3 files changed, 66 insertions(+), 9 deletions(-) diff --git a/dll/win32/msi/suminfo.c b/dll/win32/msi/suminfo.c index 07ee1d4197e..41ea4e44122 100644 --- a/dll/win32/msi/suminfo.c +++ b/dll/win32/msi/suminfo.c @@ -756,7 +756,29 @@ UINT WINAPI MsiSummaryInfoGetPropertyA( } if (!(si = msihandle2msiinfo( handle, MSIHANDLETYPE_SUMMARYINFO ))) - return ERROR_INVALID_HANDLE; + { + MSIHANDLE remote; + WCHAR *buf = NULL; + + if (!(remote = msi_get_remote( handle ))) + return ERROR_INVALID_HANDLE; + + __TRY + { + r = remote_SummaryInfoGetProperty( remote, uiProperty, puiDataType, piValue, pftValue, &buf ); + } + __EXCEPT(rpc_filter) + { + r = GetExceptionCode(); + } + __ENDTRY + + if (!r) + r = msi_strncpyWtoA( buf, -1, szValueBuf, pcchValueBuf, TRUE ); + + midl_user_free( buf ); + return r; + } str.unicode = FALSE; str.str.a = szValueBuf; @@ -784,7 +806,29 @@ UINT WINAPI MsiSummaryInfoGetPropertyW( } if (!(si = msihandle2msiinfo( handle, MSIHANDLETYPE_SUMMARYINFO ))) - return ERROR_INVALID_HANDLE; + { + MSIHANDLE remote; + WCHAR *buf = NULL; + + if (!(remote = msi_get_remote( handle ))) + return ERROR_INVALID_HANDLE; + + __TRY + { + r = remote_SummaryInfoGetProperty( remote, uiProperty, puiDataType, piValue, pftValue, &buf ); + } + __EXCEPT(rpc_filter) + { + r = GetExceptionCode(); + } + __ENDTRY + + if (!r) + r = msi_strncpyW( buf, -1, szValueBuf, pcchValueBuf ); + + midl_user_free( buf ); + return r; + } str.unicode = TRUE; str.str.w = szValueBuf; @@ -1284,3 +1328,21 @@ UINT __cdecl s_remote_SummaryInfoGetPropertyCount( MSIHANDLE suminfo, UINT *coun { return MsiSummaryInfoGetPropertyCount( suminfo, count ); } + +UINT __cdecl s_remote_SummaryInfoGetProperty( MSIHANDLE suminfo, UINT property, UINT *type, + INT *value, FILETIME *ft, LPWSTR *buf ) +{ + WCHAR empty[1]; + DWORD size = 0; + UINT r; + + r = MsiSummaryInfoGetPropertyW( suminfo, property, type, value, ft, empty, &size ); + if (r == ERROR_MORE_DATA) + { + size++; + *buf = midl_user_allocate( size * sizeof(WCHAR) ); + if (!*buf) return ERROR_OUTOFMEMORY; + r = MsiSummaryInfoGetPropertyW( suminfo, property, type, value, ft, *buf, &size ); + } + return r; +} diff --git a/dll/win32/msi/winemsi.idl b/dll/win32/msi/winemsi.idl index 5a14ffdb796..ebbca82a16d 100644 --- a/dll/win32/msi/winemsi.idl +++ b/dll/win32/msi/winemsi.idl @@ -75,6 +75,8 @@ interface IWineMsiRemote UINT remote_DatabaseOpenView( [in] MSIHANDLE db, [in, string] LPCWSTR query, [out] MSIHANDLE *view ); UINT remote_SummaryInfoGetPropertyCount( [in] MSIHANDLE suminfo, [out] UINT *count ); + UINT remote_SummaryInfoGetProperty( [in] MSIHANDLE suminfo, [in] UINT property, [out] UINT *type, [out] INT *value, + [out] FILETIME *ft, [out, string] LPWSTR *buf ); MSIHANDLE remote_GetActiveDatabase( [in] MSIHANDLE hinst ); UINT remote_GetProperty( [in] MSIHANDLE hinst, [in, string] LPCWSTR property, [out, string] LPWSTR *value, [out] DWORD *size ); diff --git a/modules/rostests/winetests/msi/custom.c b/modules/rostests/winetests/msi/custom.c index eb0ed625ef7..a727bbd4df0 100644 --- a/modules/rostests/winetests/msi/custom.c +++ b/modules/rostests/winetests/msi/custom.c @@ -464,7 +464,6 @@ static void test_db(MSIHANDLE hinst) ok(hinst, count == 5, "got %u\n", count); r = MsiSummaryInfoGetPropertyA(suminfo, 0, NULL, NULL, NULL, NULL, NULL); -todo_wine ok(hinst, r == RPC_X_NULL_REF_POINTER, "got %u\n", r); type = 0xdeadbeef; @@ -472,11 +471,8 @@ todo_wine strcpy(buffer, "deadbeef"); sz = sizeof(buffer); r = MsiSummaryInfoGetPropertyA(suminfo, PID_AUTHOR, &type, &int_value, &ft, buffer, &sz); -todo_wine ok(hinst, !r, "got %u\n", r); -todo_wine ok(hinst, type == 0, "got %u\n", type); -todo_wine ok(hinst, int_value == 0, "got %u\n", int_value); ok(hinst, sz == sizeof(buffer), "got %u\n", sz); ok(hinst, !lstrcmpA(buffer, "deadbeef"), "got %s\n", buffer); @@ -486,11 +482,8 @@ todo_wine strcpy(buffer, "deadbeef"); sz = sizeof(buffer); r = MsiSummaryInfoGetPropertyA(suminfo, PID_CODEPAGE, &type, &int_value, &ft, buffer, &sz); -todo_wine ok(hinst, !r, "got %u\n", r); -todo_wine ok(hinst, type == 0, "got %u\n", type); -todo_wine ok(hinst, int_value == 0, "got %u\n", int_value); ok(hinst, sz == sizeof(buffer), "got %u\n", sz); ok(hinst, !lstrcmpA(buffer, "deadbeef"), "got %s\n", buffer);
2 years, 6 months
1
0
0
0
[reactos] 143/360: [WINESYNC] msi: Handle the remote case in MsiSummaryInfoGetPropertyCount.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=28c46d90e1f8174104a67…
commit 28c46d90e1f8174104a67a8b73770ce7f578c78e Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sat Mar 12 23:57:40 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:28:01 2022 +0100 [WINESYNC] msi: Handle the remote case in MsiSummaryInfoGetPropertyCount. Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id 00b8b3c5e0e04d229cfb9f8d8294113e5b30e9b4 by Dmitry Timoshkov <dmitry(a)baikal.ru> --- dll/win32/msi/suminfo.c | 25 ++++++++++++++++++++++++- dll/win32/msi/winemsi.idl | 2 ++ modules/rostests/winetests/msi/custom.c | 3 --- 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/dll/win32/msi/suminfo.c b/dll/win32/msi/suminfo.c index b3d605400f3..07ee1d4197e 100644 --- a/dll/win32/msi/suminfo.c +++ b/dll/win32/msi/suminfo.c @@ -615,7 +615,25 @@ UINT WINAPI MsiSummaryInfoGetPropertyCount(MSIHANDLE hSummaryInfo, PUINT pCount) si = msihandle2msiinfo( hSummaryInfo, MSIHANDLETYPE_SUMMARYINFO ); if( !si ) - return ERROR_INVALID_HANDLE; + { + MSIHANDLE remote; + UINT ret; + + if (!(remote = msi_get_remote( hSummaryInfo ))) + return ERROR_INVALID_HANDLE; + + __TRY + { + ret = remote_SummaryInfoGetPropertyCount( remote, pCount ); + } + __EXCEPT(rpc_filter) + { + ret = GetExceptionCode(); + } + __ENDTRY + + return ret; + } if( pCount ) *pCount = get_property_count( si->property ); @@ -1261,3 +1279,8 @@ UINT msi_load_suminfo_properties( MSIPACKAGE *package ) msiobj_release( &si->hdr ); return r; } + +UINT __cdecl s_remote_SummaryInfoGetPropertyCount( MSIHANDLE suminfo, UINT *count ) +{ + return MsiSummaryInfoGetPropertyCount( suminfo, count ); +} diff --git a/dll/win32/msi/winemsi.idl b/dll/win32/msi/winemsi.idl index 50f62fcbfd8..5a14ffdb796 100644 --- a/dll/win32/msi/winemsi.idl +++ b/dll/win32/msi/winemsi.idl @@ -74,6 +74,8 @@ interface IWineMsiRemote 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 ); + UINT remote_SummaryInfoGetPropertyCount( [in] MSIHANDLE suminfo, [out] UINT *count ); + MSIHANDLE remote_GetActiveDatabase( [in] MSIHANDLE hinst ); 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 ); diff --git a/modules/rostests/winetests/msi/custom.c b/modules/rostests/winetests/msi/custom.c index 0ba5f10c88d..eb0ed625ef7 100644 --- a/modules/rostests/winetests/msi/custom.c +++ b/modules/rostests/winetests/msi/custom.c @@ -456,14 +456,11 @@ static void test_db(MSIHANDLE hinst) ok(hinst, !r, "got %u\n", r); r = MsiSummaryInfoGetPropertyCount(suminfo, NULL); -todo_wine ok(hinst, r == RPC_X_NULL_REF_POINTER, "got %u\n", r); count = 0xdeadbeef; r = MsiSummaryInfoGetPropertyCount(suminfo, &count); -todo_wine ok(hinst, !r, "got %u\n", r); -todo_wine ok(hinst, count == 5, "got %u\n", count); r = MsiSummaryInfoGetPropertyA(suminfo, 0, NULL, NULL, NULL, NULL, NULL);
2 years, 6 months
1
0
0
0
[reactos] 142/360: [WINESYNC] msi: Handle the remote case in MsiSummaryInfoSetProperty.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=636f46adb643cee540e1d…
commit 636f46adb643cee540e1d1bcbcb94f7d5b24d7ba Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sat Mar 12 23:57:39 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:28:01 2022 +0100 [WINESYNC] msi: Handle the remote case in MsiSummaryInfoSetProperty. Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id 190ef475fa3164d2f468d5b09c58c8150d30f129 by Dmitry Timoshkov <dmitry(a)baikal.ru> --- dll/win32/msi/suminfo.c | 20 ++++++++++++++++++++ modules/rostests/winetests/msi/custom.c | 4 +++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/dll/win32/msi/suminfo.c b/dll/win32/msi/suminfo.c index 3295a6a5e7d..b3d605400f3 100644 --- a/dll/win32/msi/suminfo.c +++ b/dll/win32/msi/suminfo.c @@ -851,7 +851,17 @@ UINT WINAPI MsiSummaryInfoSetPropertyW( MSIHANDLE handle, UINT uiProperty, UINT return ERROR_INVALID_PARAMETER; if (!(si = msihandle2msiinfo( handle, MSIHANDLETYPE_SUMMARYINFO ))) + { + MSIHANDLE remote; + + if ((remote = msi_get_remote( handle ))) + { + WARN("MsiSummaryInfoSetProperty not allowed during a custom action!\n"); + return ERROR_FUNCTION_FAILED; + } + return ERROR_INVALID_HANDLE; + } str.unicode = TRUE; str.str.w = szValue; @@ -882,7 +892,17 @@ UINT WINAPI MsiSummaryInfoSetPropertyA( MSIHANDLE handle, UINT uiProperty, UINT return ERROR_INVALID_PARAMETER; if (!(si = msihandle2msiinfo( handle, MSIHANDLETYPE_SUMMARYINFO ))) + { + MSIHANDLE remote; + + if ((remote = msi_get_remote( handle ))) + { + WARN("MsiSummaryInfoSetProperty not allowed during a custom action!\n"); + return ERROR_FUNCTION_FAILED; + } + return ERROR_INVALID_HANDLE; + } str.unicode = FALSE; str.str.a = szValue; diff --git a/modules/rostests/winetests/msi/custom.c b/modules/rostests/winetests/msi/custom.c index 1cf24536d04..0ba5f10c88d 100644 --- a/modules/rostests/winetests/msi/custom.c +++ b/modules/rostests/winetests/msi/custom.c @@ -499,7 +499,9 @@ todo_wine ok(hinst, !lstrcmpA(buffer, "deadbeef"), "got %s\n", buffer); r = MsiSummaryInfoSetPropertyA(suminfo, PID_CODEPAGE, VT_I2, 1252, &ft, ""); -todo_wine + ok(hinst, r == ERROR_FUNCTION_FAILED, "got %u\n", r); + + r = MsiSummaryInfoSetPropertyW(suminfo, PID_CODEPAGE, VT_I2, 1252, &ft, NULL); ok(hinst, r == ERROR_FUNCTION_FAILED, "got %u\n", r); r = MsiCloseHandle(suminfo);
2 years, 6 months
1
0
0
0
← Newer
1
...
23
24
25
26
27
28
29
...
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