ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
April 2013
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
14 participants
265 discussions
Start a n
N
ew thread
[akhaldi] 58666: [MSI_WINETEST] * Sync with Wine 1.5.26.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Wed Apr 3 21:58:14 2013 New Revision: 58666 URL:
http://svn.reactos.org/svn/reactos?rev=58666&view=rev
Log: [MSI_WINETEST] * Sync with Wine 1.5.26. Modified: trunk/rostests/winetests/msi/action.c trunk/rostests/winetests/msi/automation.c trunk/rostests/winetests/msi/install.c trunk/rostests/winetests/msi/msi.c trunk/rostests/winetests/msi/package.c Modified: trunk/rostests/winetests/msi/action.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/msi/action.c?re…
============================================================================== --- trunk/rostests/winetests/msi/action.c [iso-8859-1] (original) +++ trunk/rostests/winetests/msi/action.c [iso-8859-1] Wed Apr 3 21:58:14 2013 @@ -39,6 +39,8 @@ (LPCSTR, LPCSTR, MSIINSTALLCONTEXT, DWORD, LPCSTR, LPSTR, LPDWORD); static INSTALLSTATE (WINAPI *pMsiGetComponentPathExA) (LPCSTR, LPCSTR, LPCSTR, MSIINSTALLCONTEXT, LPSTR, LPDWORD); +static UINT (WINAPI *pMsiQueryFeatureStateExA) + (LPCSTR, LPCSTR, MSIINSTALLCONTEXT, LPCSTR, INSTALLSTATE *); static BOOL (WINAPI *pConvertSidToStringSidA)(PSID, LPSTR *); static BOOL (WINAPI *pOpenProcessToken)(HANDLE, DWORD, PHANDLE); @@ -2101,6 +2103,7 @@ GET_PROC(hmsi, MsiSourceListEnumSourcesA); GET_PROC(hmsi, MsiSourceListGetInfoA); GET_PROC(hmsi, MsiGetComponentPathExA); + GET_PROC(hmsi, MsiQueryFeatureStateExA); GET_PROC(hadvapi32, ConvertSidToStringSidA); GET_PROC(hadvapi32, OpenProcessToken); @@ -3609,20 +3612,19 @@ static void test_publish(void) { + static const char subkey[] = "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall"; + static const char subkey_32node[] = "Software\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall"; UINT r; LONG res; HKEY uninstall, prodkey, uninstall_32node = NULL; INSTALLSTATE state; - CHAR prodcode[] = "{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}"; - char date[MAX_PATH], temp[MAX_PATH]; + char date[MAX_PATH], temp[MAX_PATH], prodcode[] = "{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}"; REGSAM access = KEY_ALL_ACCESS; - - static const CHAR subkey[] = "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall"; - static const CHAR subkey_32node[] = "Software\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall"; - - if (!pMsiQueryComponentStateA) - { - win_skip("MsiQueryComponentStateA is not available\n"); + DWORD error; + + if (!pMsiQueryFeatureStateExA) + { + win_skip("MsiQueryFeatureStateExA is not available\n"); return; } if (is_process_limited()) @@ -3653,13 +3655,40 @@ MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL); - state = MsiQueryProductState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}"); + state = MsiQueryProductState(prodcode); ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state); - state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "feature"); + state = MsiQueryFeatureState(prodcode, "feature"); ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state); - state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "montecristo"); + state = 0xdead; + SetLastError(0xdeadbeef); + r = pMsiQueryFeatureStateExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, "feature", &state); + error = GetLastError(); + ok(r == ERROR_UNKNOWN_PRODUCT, "got %u\n", r); + ok(state == 0xdead, "got %d\n", state); + ok(error == 0xdeadbeef, "got %u\n", error); + + state = 0xdead; + SetLastError(0xdeadbeef); + r = pMsiQueryFeatureStateExA(prodcode, NULL, MSIINSTALLCONTEXT_USERMANAGED, "feature", &state); + error = GetLastError(); + ok(r == ERROR_UNKNOWN_PRODUCT, "got %u\n", r); + ok(state == 0xdead, "got %d\n", state); + ok(error == ERROR_SUCCESS, "got %u\n", error); + + state = 0xdead; + SetLastError(0xdeadbeef); + r = pMsiQueryFeatureStateExA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED, "feature", &state); + error = GetLastError(); + ok(r == ERROR_UNKNOWN_PRODUCT, "got %u\n", r); + ok(state == 0xdead, "got %d\n", state); + ok(error == ERROR_SUCCESS, "got %u\n", error); + + state = MsiQueryFeatureState(prodcode, "feature"); + ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state); + + state = MsiQueryFeatureState(prodcode, "montecristo"); ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state); r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED, @@ -3681,13 +3710,13 @@ ok(pf_exists("msitest\\maximus"), "File not installed\n"); ok(pf_exists("msitest"), "File not installed\n"); - state = MsiQueryProductState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}"); + state = MsiQueryProductState(prodcode); ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state); - state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "feature"); + state = MsiQueryFeatureState(prodcode, "feature"); ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state); - state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "montecristo"); + state = MsiQueryFeatureState(prodcode, "montecristo"); ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state); r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED, @@ -3704,13 +3733,13 @@ ok(pf_exists("msitest\\maximus"), "File not installed\n"); ok(pf_exists("msitest"), "File not installed\n"); - state = MsiQueryProductState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}"); + state = MsiQueryProductState(prodcode); ok(state == INSTALLSTATE_DEFAULT, "Expected INSTALLSTATE_DEFAULT, got %d\n", state); - state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "feature"); + state = MsiQueryFeatureState(prodcode, "feature"); ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state); - state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "montecristo"); + state = MsiQueryFeatureState(prodcode, "montecristo"); ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state); r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED, @@ -3765,13 +3794,13 @@ ok(pf_exists("msitest\\maximus"), "File deleted\n"); ok(pf_exists("msitest"), "File deleted\n"); - state = MsiQueryProductState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}"); + state = MsiQueryProductState(prodcode); ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state); - state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "feature"); + state = MsiQueryFeatureState(prodcode, "feature"); ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state); - state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "montecristo"); + state = MsiQueryFeatureState(prodcode, "montecristo"); ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state); r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED, @@ -3788,13 +3817,37 @@ ok(pf_exists("msitest\\maximus"), "File not installed\n"); ok(pf_exists("msitest"), "File not installed\n"); - state = MsiQueryProductState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}"); + state = MsiQueryProductState(prodcode); ok(state == INSTALLSTATE_DEFAULT, "Expected INSTALLSTATE_DEFAULT, got %d\n", state); - state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "feature"); + state = MsiQueryFeatureState(prodcode, "feature"); ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state); - state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "montecristo"); + state = 0xdead; + SetLastError(0xdeadbeef); + r = pMsiQueryFeatureStateExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, "feature", &state); + error = GetLastError(); + ok(r == ERROR_UNKNOWN_PRODUCT, "got %u\n", r); + ok(state == 0xdead, "got %d\n", state); + ok(error == 0xdeadbeef, "got %u\n", error); + + state = 0xdead; + SetLastError(0xdeadbeef); + r = pMsiQueryFeatureStateExA(prodcode, NULL, MSIINSTALLCONTEXT_USERMANAGED, "feature", &state); + error = GetLastError(); + ok(r == ERROR_UNKNOWN_PRODUCT, "got %u\n", r); + ok(state == 0xdead, "got %d\n", state); + ok(error == ERROR_SUCCESS, "got %u\n", error); + + state = 0xdead; + SetLastError(0xdeadbeef); + r = pMsiQueryFeatureStateExA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED, "feature", &state); + error = GetLastError(); + ok(r == ERROR_SUCCESS, "got %u\n", r); + ok(state == INSTALLSTATE_LOCAL, "got %d\n", state); + ok(error == ERROR_SUCCESS, "got %u\n", error); + + state = MsiQueryFeatureState(prodcode, "montecristo"); ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state); r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED, @@ -3848,13 +3901,13 @@ ok(!pf_exists("msitest\\maximus"), "File not deleted\n"); ok(!pf_exists("msitest"), "Directory not deleted\n"); - state = MsiQueryProductState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}"); + state = MsiQueryProductState(prodcode); ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state); - state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "feature"); + state = MsiQueryFeatureState(prodcode, "feature"); ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state); - state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "montecristo"); + state = MsiQueryFeatureState(prodcode, "montecristo"); ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state); r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED, @@ -3871,13 +3924,13 @@ ok(pf_exists("msitest\\maximus"), "File not installed\n"); ok(pf_exists("msitest"), "File not installed\n"); - state = MsiQueryProductState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}"); + state = MsiQueryProductState(prodcode); ok(state == INSTALLSTATE_DEFAULT, "Expected INSTALLSTATE_DEFAULT, got %d\n", state); - state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "feature"); + state = MsiQueryFeatureState(prodcode, "feature"); ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state); - state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "montecristo"); + state = MsiQueryFeatureState(prodcode, "montecristo"); ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state); r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED, @@ -3931,13 +3984,13 @@ ok(pf_exists("msitest\\maximus"), "File deleted\n"); ok(pf_exists("msitest"), "Directory deleted\n"); - state = MsiQueryProductState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}"); + state = MsiQueryProductState(prodcode); ok(state == INSTALLSTATE_DEFAULT, "Expected INSTALLSTATE_DEFAULT, got %d\n", state); - state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "feature"); + state = MsiQueryFeatureState(prodcode, "feature"); ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state); - state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "montecristo"); + state = MsiQueryFeatureState(prodcode, "montecristo"); ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state); r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED, @@ -3991,13 +4044,13 @@ ok(pf_exists("msitest\\maximus"), "File not installed\n"); ok(pf_exists("msitest"), "File not installed\n"); - state = MsiQueryProductState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}"); + state = MsiQueryProductState(prodcode); ok(state == INSTALLSTATE_DEFAULT, "Expected INSTALLSTATE_DEFAULT, got %d\n", state); - state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "feature"); + state = MsiQueryFeatureState(prodcode, "feature"); ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state); - state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "montecristo"); + state = MsiQueryFeatureState(prodcode, "montecristo"); ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state); r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED, @@ -4051,13 +4104,13 @@ ok(!pf_exists("msitest\\maximus"), "File not deleted\n"); ok(!pf_exists("msitest"), "Directory not deleted\n"); - state = MsiQueryProductState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}"); + state = MsiQueryProductState(prodcode); ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state); - state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "feature"); + state = MsiQueryFeatureState(prodcode, "feature"); ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state); - state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "montecristo"); + state = MsiQueryFeatureState(prodcode, "montecristo"); ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state); r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED, @@ -4074,13 +4127,13 @@ ok(pf_exists("msitest\\maximus"), "File not installed\n"); ok(pf_exists("msitest"), "File not installed\n"); - state = MsiQueryProductState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}"); + state = MsiQueryProductState(prodcode); ok(state == INSTALLSTATE_DEFAULT, "Expected INSTALLSTATE_DEFAULT, got %d\n", state); - state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "feature"); + state = MsiQueryFeatureState(prodcode, "feature"); ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state); - state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "montecristo"); + state = MsiQueryFeatureState(prodcode, "montecristo"); ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state); r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED, @@ -4134,13 +4187,13 @@ ok(!pf_exists("msitest\\maximus"), "File not deleted\n"); ok(!pf_exists("msitest"), "Directory not deleted\n"); - state = MsiQueryProductState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}"); + state = MsiQueryProductState(prodcode); ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state); - state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "feature"); + state = MsiQueryFeatureState(prodcode, "feature"); ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state); - state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "montecristo"); + state = MsiQueryFeatureState(prodcode, "montecristo"); ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state); r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED, Modified: trunk/rostests/winetests/msi/automation.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/msi/automation.…
============================================================================== --- trunk/rostests/winetests/msi/automation.c [iso-8859-1] (original) +++ trunk/rostests/winetests/msi/automation.c [iso-8859-1] Wed Apr 3 21:58:14 2013 @@ -2006,6 +2006,7 @@ static const WCHAR szFiveHi[] = { 'F','i','v','e','\n','H','i',0 }; static const WCHAR szSix[] = { 'S','i','x',0 }; static const WCHAR szREG_[] = { '(','R','E','G','_',']',0 }; + static const WCHAR szREG_2[] = { '(','R','E','G','_','?','?',')',0 }; static const WCHAR szSeven[] = { 'S','e','v','e','n',0 }; static const WCHAR szEight[] = { 'E','i','g','h','t',0 }; static const WCHAR szBlank[] = { 0 }; @@ -2117,7 +2118,8 @@ memset(szString, 0, sizeof(szString)); hr = Installer_RegistryValueW(curr_user, szKey, szSix, szString); ok(hr == S_OK, "Installer_RegistryValueW failed, hresult 0x%08x\n", hr); - ok_w2("Registry value \"%s\" does not match expected \"%s\"\n", szString, szREG_); + ok(!lstrcmpW(szString, szREG_2) || broken(!lstrcmpW(szString, szREG_)), + "Registry value does not match\n"); VariantInit(&vararg); V_VT(&vararg) = VT_BSTR; Modified: trunk/rostests/winetests/msi/install.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/msi/install.c?r…
============================================================================== --- trunk/rostests/winetests/msi/install.c [iso-8859-1] (original) +++ trunk/rostests/winetests/msi/install.c [iso-8859-1] Wed Apr 3 21:58:14 2013 @@ -36,8 +36,6 @@ static UINT (WINAPI *pMsiQueryComponentStateA) (LPCSTR, LPCSTR, MSIINSTALLCONTEXT, LPCSTR, INSTALLSTATE*); -static UINT (WINAPI *pMsiSetExternalUIRecord) - (INSTALLUI_HANDLER_RECORD, DWORD, LPVOID, PINSTALLUI_HANDLER_RECORD); static UINT (WINAPI *pMsiSourceListEnumSourcesA) (LPCSTR, LPCSTR, MSIINSTALLCONTEXT, DWORD, DWORD, LPSTR, LPDWORD); static UINT (WINAPI *pMsiSourceListGetInfoA) @@ -866,13 +864,13 @@ "heliox\thelium\n" "lithia\tlithium"; -static const CHAR mcomp_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n" - "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n" - "File\tFile\n" - "hydrogen\thydrogen\thydrogen\t0\t\t\t8192\t1\n" - "helium\thelium\thelium\t0\t\t\t8192\t1\n" - "lithium\tlithium\tlithium\t0\t\t\t8192\t1\n" - "beryllium\tmissingcomp\tberyllium\t0\t\t\t8192\t1"; +static const CHAR mcp_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n" + "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n" + "File\tFile\n" + "hydrogen\thydrogen\thydrogen\t0\t\t\t8192\t1\n" + "helium\thelium\thelium\t0\t\t\t8192\t1\n" + "lithium\tlithium\tlithium\t0\t\t\t8192\t1\n" + "beryllium\tmissingcomp\tberyllium\t0\t\t\t8192\t1"; static const CHAR ai_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n" "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n" @@ -1766,19 +1764,7 @@ ADD_TABLE(directory), ADD_TABLE(mcp_feature), ADD_TABLE(mcp_feature_comp), - ADD_TABLE(rem_file), - ADD_TABLE(rem_install_exec_seq), - ADD_TABLE(rof_media), - ADD_TABLE(property), -}; - -static const msi_table mcomp_tables[] = -{ - ADD_TABLE(mcp_component), - ADD_TABLE(directory), - ADD_TABLE(mcp_feature), - ADD_TABLE(mcp_feature_comp), - ADD_TABLE(mcomp_file), + ADD_TABLE(mcp_file), ADD_TABLE(rem_install_exec_seq), ADD_TABLE(rof_media), ADD_TABLE(property), @@ -2108,7 +2094,6 @@ trace("GetProcAddress(%s) failed\n", #func); GET_PROC(hmsi, MsiQueryComponentStateA); - GET_PROC(hmsi, MsiSetExternalUIRecord); GET_PROC(hmsi, MsiSourceListEnumSourcesA); GET_PROC(hmsi, MsiSourceListGetInfoA); GET_PROC(hmsi, MsiGetComponentPathExA); @@ -4806,291 +4791,6 @@ DeleteFileA(msifile); } -static void test_MsiConfigureProductEx(void) -{ - UINT r; - LONG res; - DWORD type, size; - HKEY props, source; - CHAR keypath[MAX_PATH * 2], localpackage[MAX_PATH], packagename[MAX_PATH]; - REGSAM access = KEY_ALL_ACCESS; - - if (is_process_limited()) - { - skip("process is limited\n"); - return; - } - - CreateDirectoryA("msitest", NULL); - create_file("msitest\\hydrogen", 500); - create_file("msitest\\helium", 500); - create_file("msitest\\lithium", 500); - - create_database(msifile, mcp_tables, sizeof(mcp_tables) / sizeof(msi_table)); - - if (is_wow64) - access |= KEY_WOW64_64KEY; - - MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL); - - /* NULL szProduct */ - r = MsiConfigureProductExA(NULL, INSTALLLEVEL_DEFAULT, - INSTALLSTATE_DEFAULT, "PROPVAR=42"); - ok(r == ERROR_INVALID_PARAMETER, - "Expected ERROR_INVALID_PARAMETER, got %d\n", r); - - /* empty szProduct */ - r = MsiConfigureProductExA("", INSTALLLEVEL_DEFAULT, - INSTALLSTATE_DEFAULT, "PROPVAR=42"); - ok(r == ERROR_INVALID_PARAMETER, - "Expected ERROR_INVALID_PARAMETER, got %d\n", r); - - /* garbage szProduct */ - r = MsiConfigureProductExA("garbage", INSTALLLEVEL_DEFAULT, - INSTALLSTATE_DEFAULT, "PROPVAR=42"); - ok(r == ERROR_INVALID_PARAMETER, - "Expected ERROR_INVALID_PARAMETER, got %d\n", r); - - /* guid without brackets */ - r = MsiConfigureProductExA("6700E8CF-95AB-4D9C-BC2C-15840DEA7A5D", - INSTALLLEVEL_DEFAULT, INSTALLSTATE_DEFAULT, - "PROPVAR=42"); - ok(r == ERROR_INVALID_PARAMETER, - "Expected ERROR_INVALID_PARAMETER, got %d\n", r); - - /* guid with brackets */ - r = MsiConfigureProductExA("{6700E8CF-95AB-4D9C-BC2C-15840DEA7A5D}", - INSTALLLEVEL_DEFAULT, INSTALLSTATE_DEFAULT, - "PROPVAR=42"); - ok(r == ERROR_UNKNOWN_PRODUCT, - "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r); - - /* same length as guid, but random */ - r = MsiConfigureProductExA("A938G02JF-2NF3N93-VN3-2NNF-3KGKALDNF93", - INSTALLLEVEL_DEFAULT, INSTALLSTATE_DEFAULT, - "PROPVAR=42"); - ok(r == ERROR_UNKNOWN_PRODUCT, - "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r); - - /* product not installed yet */ - r = MsiConfigureProductExA("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", - INSTALLLEVEL_DEFAULT, INSTALLSTATE_DEFAULT, - "PROPVAR=42"); - ok(r == ERROR_UNKNOWN_PRODUCT, - "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r); - - /* install the product, per-user unmanaged */ - r = MsiInstallProductA(msifile, "INSTALLLEVEL=10 PROPVAR=42"); - if (r == ERROR_INSTALL_PACKAGE_REJECTED) - { - skip("Not enough rights to perform tests\n"); - goto error; - } - ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); - ok(pf_exists("msitest\\hydrogen"), "File not installed\n"); - ok(pf_exists("msitest\\helium"), "File not installed\n"); - ok(pf_exists("msitest\\lithium"), "File not installed\n"); - ok(pf_exists("msitest"), "File not installed\n"); - - /* product is installed per-user managed, remove it */ - r = MsiConfigureProductExA("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", - INSTALLLEVEL_DEFAULT, INSTALLSTATE_ABSENT, - "PROPVAR=42"); - ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); - ok(!delete_pf("msitest\\hydrogen", TRUE), "File not removed\n"); - ok(!delete_pf("msitest\\helium", TRUE), "File not removed\n"); - ok(!delete_pf("msitest\\lithium", TRUE), "File not removed\n"); - ok(!delete_pf("msitest", FALSE), "Directory not removed\n"); - - /* product has been removed */ - r = MsiConfigureProductExA("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", - INSTALLLEVEL_DEFAULT, INSTALLSTATE_DEFAULT, - "PROPVAR=42"); - ok(r == ERROR_UNKNOWN_PRODUCT, - "Expected ERROR_UNKNOWN_PRODUCT, got %u\n", r); - - /* install the product, machine */ - r = MsiInstallProductA(msifile, "ALLUSERS=1 INSTALLLEVEL=10 PROPVAR=42"); - ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); - ok(pf_exists("msitest\\hydrogen"), "File not installed\n"); - ok(pf_exists("msitest\\helium"), "File not installed\n"); - ok(pf_exists("msitest\\lithium"), "File not installed\n"); - ok(pf_exists("msitest"), "File not installed\n"); - - /* product is installed machine, remove it */ - r = MsiConfigureProductExA("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", - INSTALLLEVEL_DEFAULT, INSTALLSTATE_ABSENT, - "PROPVAR=42"); - ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); - ok(!delete_pf("msitest\\hydrogen", TRUE), "File not removed\n"); - ok(!delete_pf("msitest\\helium", TRUE), "File not removed\n"); - ok(!delete_pf("msitest\\lithium", TRUE), "File not removed\n"); - ok(!delete_pf("msitest", FALSE), "Directory not removed\n"); - - /* product has been removed */ - r = MsiConfigureProductExA("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", - INSTALLLEVEL_DEFAULT, INSTALLSTATE_DEFAULT, - "PROPVAR=42"); - ok(r == ERROR_UNKNOWN_PRODUCT, - "Expected ERROR_UNKNOWN_PRODUCT, got %u\n", r); - - /* install the product, machine */ - r = MsiInstallProductA(msifile, "ALLUSERS=1 INSTALLLEVEL=10 PROPVAR=42"); - ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); - ok(pf_exists("msitest\\hydrogen"), "File not installed\n"); - ok(pf_exists("msitest\\helium"), "File not installed\n"); - ok(pf_exists("msitest\\lithium"), "File not installed\n"); - ok(pf_exists("msitest"), "File not installed\n"); - - DeleteFileA(msifile); - - /* msifile is removed */ - r = MsiConfigureProductExA("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", - INSTALLLEVEL_DEFAULT, INSTALLSTATE_ABSENT, - "PROPVAR=42"); - ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); - ok(!delete_pf("msitest\\hydrogen", TRUE), "File not removed\n"); - ok(!delete_pf("msitest\\helium", TRUE), "File not removed\n"); - ok(!delete_pf("msitest\\lithium", TRUE), "File not removed\n"); - ok(!delete_pf("msitest", FALSE), "Directory not removed\n"); - - create_database(msifile, mcp_tables, sizeof(mcp_tables) / sizeof(msi_table)); - - /* install the product, machine */ - r = MsiInstallProductA(msifile, "ALLUSERS=1 INSTALLLEVEL=10 PROPVAR=42"); - ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); - ok(pf_exists("msitest\\hydrogen"), "File not installed\n"); - ok(pf_exists("msitest\\helium"), "File not installed\n"); - ok(pf_exists("msitest\\lithium"), "File not installed\n"); - ok(pf_exists("msitest"), "File not installed\n"); - - DeleteFileA(msifile); - - lstrcpyA(keypath, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"); - lstrcatA(keypath, "Installer\\UserData\\S-1-5-18\\Products\\"); - lstrcatA(keypath, "84A88FD7F6998CE40A22FB59F6B9C2BB\\InstallProperties"); - - res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, access, &props); - ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); - - type = REG_SZ; - size = MAX_PATH; - res = RegQueryValueExA(props, "LocalPackage", NULL, &type, - (LPBYTE)localpackage, &size); - ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); - - res = RegSetValueExA(props, "LocalPackage", 0, REG_SZ, - (const BYTE *)"C:\\idontexist.msi", 18); - ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); - - /* LocalPackage is used to find the cached msi package */ - r = MsiConfigureProductExA("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", - INSTALLLEVEL_DEFAULT, INSTALLSTATE_ABSENT, - "PROPVAR=42"); - ok(r == ERROR_INSTALL_SOURCE_ABSENT, - "Expected ERROR_INSTALL_SOURCE_ABSENT, got %d\n", r); - ok(pf_exists("msitest\\hydrogen"), "File not installed\n"); - ok(pf_exists("msitest\\helium"), "File not installed\n"); - ok(pf_exists("msitest\\lithium"), "File not installed\n"); - ok(pf_exists("msitest"), "File not installed\n"); - - RegCloseKey(props); - create_database(msifile, mcp_tables, sizeof(mcp_tables) / sizeof(msi_table)); - - /* LastUsedSource can be used as a last resort */ - r = MsiConfigureProductExA("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", - INSTALLLEVEL_DEFAULT, INSTALLSTATE_ABSENT, - "PROPVAR=42"); - ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); - ok(!delete_pf("msitest\\hydrogen", TRUE), "File not removed\n"); - ok(!delete_pf("msitest\\helium", TRUE), "File not removed\n"); - ok(!delete_pf("msitest\\lithium", TRUE), "File not removed\n"); - ok(!delete_pf("msitest", FALSE), "Directory not removed\n"); - DeleteFileA( localpackage ); - - /* install the product, machine */ - r = MsiInstallProductA(msifile, "ALLUSERS=1 INSTALLLEVEL=10 PROPVAR=42"); - ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); - ok(pf_exists("msitest\\hydrogen"), "File not installed\n"); - ok(pf_exists("msitest\\helium"), "File not installed\n"); - ok(pf_exists("msitest\\lithium"), "File not installed\n"); - ok(pf_exists("msitest"), "File not installed\n"); - - lstrcpyA(keypath, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"); - lstrcatA(keypath, "Installer\\UserData\\S-1-5-18\\Products\\"); - lstrcatA(keypath, "84A88FD7F6998CE40A22FB59F6B9C2BB\\InstallProperties"); - - res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, access, &props); - ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); - - type = REG_SZ; - size = MAX_PATH; - res = RegQueryValueExA(props, "LocalPackage", NULL, &type, - (LPBYTE)localpackage, &size); - ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); - - res = RegSetValueExA(props, "LocalPackage", 0, REG_SZ, - (const BYTE *)"C:\\idontexist.msi", 18); - ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); - - lstrcpyA(keypath, "SOFTWARE\\Classes\\Installer\\Products\\"); - lstrcatA(keypath, "84A88FD7F6998CE40A22FB59F6B9C2BB\\SourceList"); - - res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, access, &source); - ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); - - type = REG_SZ; - size = MAX_PATH; - res = RegQueryValueExA(source, "PackageName", NULL, &type, - (LPBYTE)packagename, &size); - ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); - - res = RegSetValueExA(source, "PackageName", 0, REG_SZ, - (const BYTE *)"idontexist.msi", 15); - ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); - - /* SourceList is altered */ - r = MsiConfigureProductExA("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", - INSTALLLEVEL_DEFAULT, INSTALLSTATE_ABSENT, - "PROPVAR=42"); - ok(r == ERROR_INSTALL_SOURCE_ABSENT, - "Expected ERROR_INSTALL_SOURCE_ABSENT, got %d\n", r); - ok(pf_exists("msitest\\hydrogen"), "File not installed\n"); - ok(pf_exists("msitest\\helium"), "File not installed\n"); - ok(pf_exists("msitest\\lithium"), "File not installed\n"); - ok(pf_exists("msitest"), "File not installed\n"); - - /* restore PackageName */ - res = RegSetValueExA(source, "PackageName", 0, REG_SZ, - (const BYTE *)packagename, lstrlenA(packagename) + 1); - ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); - - /* restore LocalPackage */ - res = RegSetValueExA(props, "LocalPackage", 0, REG_SZ, - (const BYTE *)localpackage, lstrlenA(localpackage) + 1); - ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); - - /* finally remove the product */ - r = MsiConfigureProductExA("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", - INSTALLLEVEL_DEFAULT, INSTALLSTATE_ABSENT, - "PROPVAR=42"); - ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); - ok(!delete_pf("msitest\\hydrogen", TRUE), "File not removed\n"); - ok(!delete_pf("msitest\\helium", TRUE), "File not removed\n"); - ok(!delete_pf("msitest\\lithium", TRUE), "File not removed\n"); - ok(!delete_pf("msitest", FALSE), "Directory not removed\n"); - - RegCloseKey(source); - RegCloseKey(props); - -error: - DeleteFileA("msitest\\hydrogen"); - DeleteFileA("msitest\\helium"); - DeleteFileA("msitest\\lithium"); - RemoveDirectoryA("msitest"); - DeleteFileA(msifile); -} - static void test_missingcomponent(void) { UINT r; @@ -5107,7 +4807,7 @@ create_file("msitest\\lithium", 500); create_file("beryllium", 500); - create_database(msifile, mcomp_tables, sizeof(mcomp_tables) / sizeof(msi_table)); + create_database(msifile, mcp_tables, sizeof(mcp_tables) / sizeof(msi_table)); MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL); @@ -5832,84 +5532,6 @@ DeleteFile(msifile); } -static INT CALLBACK handler_a(LPVOID context, UINT type, LPCSTR msg) -{ - return IDOK; -} - -static INT CALLBACK handler_w(LPVOID context, UINT type, LPCWSTR msg) -{ - return IDOK; -} - -static INT CALLBACK handler_record(LPVOID context, UINT type, MSIHANDLE record) -{ - return IDOK; -} - -static void test_MsiSetExternalUI(void) -{ - INSTALLUI_HANDLERA ret_a; - INSTALLUI_HANDLERW ret_w; - INSTALLUI_HANDLER_RECORD prev; - UINT error; - - ret_a = MsiSetExternalUIA(handler_a, INSTALLLOGMODE_ERROR, NULL); - ok(ret_a == NULL, "expected NULL, got %p\n", ret_a); - - ret_a = MsiSetExternalUIA(NULL, 0, NULL); - ok(ret_a == handler_a, "expected %p, got %p\n", handler_a, ret_a); - - /* Not present before Installer 3.1 */ - if (!pMsiSetExternalUIRecord) { - win_skip("MsiSetExternalUIRecord is not available\n"); - return; - } - - error = pMsiSetExternalUIRecord(handler_record, INSTALLLOGMODE_ERROR, NULL, &prev); - ok(!error, "MsiSetExternalUIRecord failed %u\n", error); - ok(prev == NULL, "expected NULL, got %p\n", prev); - - prev = (INSTALLUI_HANDLER_RECORD)0xdeadbeef; - error = pMsiSetExternalUIRecord(NULL, INSTALLLOGMODE_ERROR, NULL, &prev); - ok(!error, "MsiSetExternalUIRecord failed %u\n", error); - ok(prev == handler_record, "expected %p, got %p\n", handler_record, prev); - - ret_w = MsiSetExternalUIW(handler_w, INSTALLLOGMODE_ERROR, NULL); - ok(ret_w == NULL, "expected NULL, got %p\n", ret_w); - - ret_w = MsiSetExternalUIW(NULL, 0, NULL); - ok(ret_w == handler_w, "expected %p, got %p\n", handler_w, ret_w); - - ret_a = MsiSetExternalUIA(handler_a, INSTALLLOGMODE_ERROR, NULL); - ok(ret_a == NULL, "expected NULL, got %p\n", ret_a); - - ret_w = MsiSetExternalUIW(handler_w, INSTALLLOGMODE_ERROR, NULL); - ok(ret_w == NULL, "expected NULL, got %p\n", ret_w); - - prev = (INSTALLUI_HANDLER_RECORD)0xdeadbeef; - error = pMsiSetExternalUIRecord(handler_record, INSTALLLOGMODE_ERROR, NULL, &prev); - ok(!error, "MsiSetExternalUIRecord failed %u\n", error); - ok(prev == NULL, "expected NULL, got %p\n", prev); - - ret_a = MsiSetExternalUIA(NULL, 0, NULL); - ok(ret_a == NULL, "expected NULL, got %p\n", ret_a); - - ret_w = MsiSetExternalUIW(NULL, 0, NULL); - ok(ret_w == NULL, "expected NULL, got %p\n", ret_w); - - prev = (INSTALLUI_HANDLER_RECORD)0xdeadbeef; - error = pMsiSetExternalUIRecord(NULL, 0, NULL, &prev); - ok(!error, "MsiSetExternalUIRecord failed %u\n", error); - ok(prev == handler_record, "expected %p, got %p\n", handler_record, prev); - - error = pMsiSetExternalUIRecord(handler_record, INSTALLLOGMODE_ERROR, NULL, NULL); - ok(!error, "MsiSetExternalUIRecord failed %u\n", error); - - error = pMsiSetExternalUIRecord(NULL, 0, NULL, NULL); - ok(!error, "MsiSetExternalUIRecord failed %u\n", error); -} - static void test_feature_override(void) { UINT r; @@ -6295,6 +5917,14 @@ ok(delete_pf("msitest", FALSE), "directory does not exist\n"); DeleteFile(msifile); + create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 100, "Alpha,Beta,Intel;0"); + + r = MsiInstallProductA(msifile, NULL); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); + ok(delete_pf("msitest\\maximus", TRUE), "file does not exist\n"); + ok(delete_pf("msitest", FALSE), "directory does not exist\n"); + + DeleteFile(msifile); create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 100, "x64;0"); r = MsiInstallProductA(msifile, NULL); @@ -6508,171 +6138,6 @@ DeleteFileA("msitest\\upgradecode.txt"); RemoveDirectoryA("msitest"); DeleteFile(msifile); -} - -static void test_MsiGetFeatureInfo(void) -{ - UINT r; - MSIHANDLE package; - char title[32], help[32], path[MAX_PATH]; - DWORD attrs, title_len, help_len; - - if (is_process_limited()) - { - skip("process is limited\n"); - return; - } - create_database( msifile, tables, sizeof(tables) / sizeof(tables[0]) ); - - strcpy( path, CURR_DIR ); - strcat( path, "\\" ); - strcat( path, msifile ); - - r = MsiOpenPackage( path, &package ); - if (r == ERROR_INSTALL_PACKAGE_REJECTED) - { - skip("Not enough rights to perform tests\n"); - DeleteFileA( msifile ); - return; - } - ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); - - r = MsiGetFeatureInfoA( 0, NULL, NULL, NULL, NULL, NULL, NULL ); - ok(r == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %u\n", r); - - r = MsiGetFeatureInfoA( package, NULL, NULL, NULL, NULL, NULL, NULL ); - ok(r == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %u\n", r); - - r = MsiGetFeatureInfoA( package, "", NULL, NULL, NULL, NULL, NULL ); - ok(r == ERROR_UNKNOWN_FEATURE, "expected ERROR_UNKNOWN_FEATURE, got %u\n", r); - - r = MsiGetFeatureInfoA( package, "One", NULL, NULL, NULL, NULL, NULL ); - ok(r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r); - - r = MsiGetFeatureInfoA( 0, "One", NULL, NULL, NULL, NULL, NULL ); - ok(r == ERROR_INVALID_HANDLE, "expected ERROR_INVALID_HANDLE, got %u\n", r); - - title_len = help_len = 0; - r = MsiGetFeatureInfoA( package, "One", NULL, NULL, &title_len, NULL, &help_len ); - ok(r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r); - ok(title_len == 3, "expected 3, got %u\n", title_len); - ok(help_len == 15, "expected 15, got %u\n", help_len); - - title[0] = help[0] = 0; - title_len = help_len = 0; - r = MsiGetFeatureInfoA( package, "One", NULL, title, &title_len, help, &help_len ); - ok(r == ERROR_MORE_DATA, "expected ERROR_MORE_DATA, got %u\n", r); - ok(title_len == 3, "expected 3, got %u\n", title_len); - ok(help_len == 15, "expected 15, got %u\n", help_len); - - attrs = 0; - title[0] = help[0] = 0; - title_len = sizeof(title); - help_len = sizeof(help); - r = MsiGetFeatureInfoA( package, "One", &attrs, title, &title_len, help, &help_len ); - ok(r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r); - ok(attrs == INSTALLFEATUREATTRIBUTE_FAVORLOCAL, "expected INSTALLFEATUREATTRIBUTE_FAVORLOCAL, got %u\n", attrs); - ok(title_len == 3, "expected 3, got %u\n", title_len); - ok(help_len == 15, "expected 15, got %u\n", help_len); - ok(!strcmp(title, "One"), "expected \"One\", got \"%s\"\n", title); - ok(!strcmp(help, "The One Feature"), "expected \"The One Feature\", got \"%s\"\n", help); - - attrs = 0; - title[0] = help[0] = 0; - title_len = sizeof(title); - help_len = sizeof(help); - r = MsiGetFeatureInfoA( package, "feature", &attrs, title, &title_len, help, &help_len ); - ok(r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r); - ok(attrs == INSTALLFEATUREATTRIBUTE_FAVORLOCAL, "expected INSTALLFEATUREATTRIBUTE_FAVORLOCAL, got %u\n", attrs); - ok(!title_len, "expected 0, got %u\n", title_len); - ok(!help_len, "expected 0, got %u\n", help_len); - ok(!title[0], "expected \"\", got \"%s\"\n", title); - ok(!help[0], "expected \"\", got \"%s\"\n", help); - - MsiCloseHandle( package ); - DeleteFileA( msifile ); -} - -static void test_MsiSetFeatureAttributes(void) -{ - UINT r; - DWORD attrs; - char path[MAX_PATH]; - MSIHANDLE package; - - if (is_process_limited()) - { - skip("process is limited\n"); - return; - } - create_database( msifile, tables, sizeof(tables) / sizeof(tables[0]) ); - - strcpy( path, CURR_DIR ); - strcat( path, "\\" ); - strcat( path, msifile ); - - r = MsiOpenPackage( path, &package ); - if (r == ERROR_INSTALL_PACKAGE_REJECTED) - { - skip("Not enough rights to perform tests\n"); - DeleteFileA( msifile ); - return; - } - ok(r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r); - - r = MsiSetFeatureAttributesA( package, "One", INSTALLFEATUREATTRIBUTE_FAVORLOCAL ); - ok(r == ERROR_FUNCTION_FAILED, "Expected ERROR_FUNCTION_FAILED, got %u\n", r); - - r = MsiDoAction( package, "CostInitialize" ); - ok(r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r); - - r = MsiSetFeatureAttributesA( 0, "One", INSTALLFEATUREATTRIBUTE_FAVORLOCAL ); - ok(r == ERROR_INVALID_HANDLE, "expected ERROR_INVALID_HANDLE, got %u\n", r); - - r = MsiSetFeatureAttributesA( package, "", INSTALLFEATUREATTRIBUTE_FAVORLOCAL ); - ok(r == ERROR_UNKNOWN_FEATURE, "expected ERROR_UNKNOWN_FEATURE, got %u\n", r); - - r = MsiSetFeatureAttributesA( package, NULL, INSTALLFEATUREATTRIBUTE_FAVORLOCAL ); - ok(r == ERROR_UNKNOWN_FEATURE, "expected ERROR_UNKNOWN_FEATURE, got %u\n", r); - - r = MsiSetFeatureAttributesA( package, "One", 0 ); - ok(r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r); - - attrs = 0xdeadbeef; - r = MsiGetFeatureInfoA( package, "One", &attrs, NULL, NULL, NULL, NULL ); - ok(r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r); - ok(attrs == INSTALLFEATUREATTRIBUTE_FAVORLOCAL, - "expected INSTALLFEATUREATTRIBUTE_FAVORLOCAL, got 0x%08x\n", attrs); - - r = MsiSetFeatureAttributesA( package, "One", INSTALLFEATUREATTRIBUTE_FAVORLOCAL ); - ok(r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r); - - attrs = 0; - r = MsiGetFeatureInfoA( package, "One", &attrs, NULL, NULL, NULL, NULL ); - ok(r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r); - ok(attrs == INSTALLFEATUREATTRIBUTE_FAVORLOCAL, - "expected INSTALLFEATUREATTRIBUTE_FAVORLOCAL, got 0x%08x\n", attrs); - - r = MsiDoAction( package, "FileCost" ); - ok(r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r); - - r = MsiSetFeatureAttributesA( package, "One", INSTALLFEATUREATTRIBUTE_FAVORSOURCE ); - ok(r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r); - - attrs = 0; - r = MsiGetFeatureInfoA( package, "One", &attrs, NULL, NULL, NULL, NULL ); - ok(r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r); - ok(attrs == INSTALLFEATUREATTRIBUTE_FAVORSOURCE, - "expected INSTALLFEATUREATTRIBUTE_FAVORSOURCE, got 0x%08x\n", attrs); - - r = MsiDoAction( package, "CostFinalize" ); - ok(r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r); - - r = MsiSetFeatureAttributesA( package, "One", INSTALLFEATUREATTRIBUTE_FAVORLOCAL ); - ok(r == ERROR_FUNCTION_FAILED, "expected ERROR_FUNCTION_FAILED, got %u\n", r); - - MsiCloseHandle( package ); - DeleteFileA( msifile ); } static void test_mixed_package(void) @@ -6824,7 +6289,6 @@ test_customaction51(); test_installstate(); test_sourcepath(); - test_MsiConfigureProductEx(); test_missingcomponent(); test_sourcedirprop(); test_adminimage(); @@ -6836,7 +6300,6 @@ test_installed_prop(); test_file_in_use(); test_file_in_use_cab(); - test_MsiSetExternalUI(); test_allusers_prop(); test_feature_override(); test_icon_table(); @@ -6844,8 +6307,6 @@ test_package_validation(); test_command_line_parsing(); test_upgrade_code(); - test_MsiGetFeatureInfo(); - test_MsiSetFeatureAttributes(); test_mixed_package(); DeleteFileA(log_file); Modified: trunk/rostests/winetests/msi/msi.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/msi/msi.c?rev=5…
============================================================================== --- trunk/rostests/winetests/msi/msi.c [iso-8859-1] (original) +++ trunk/rostests/winetests/msi/msi.c [iso-8859-1] Wed Apr 3 21:58:14 2013 @@ -31,8 +31,14 @@ static BOOL is_wow64; static const char msifile[] = "winetest.msi"; +static char CURR_DIR[MAX_PATH]; +static char PROG_FILES_DIR[MAX_PATH]; +static char PROG_FILES_DIR_NATIVE[MAX_PATH]; +static char COMMON_FILES_DIR[MAX_PATH]; +static char WINDOWS_DIR[MAX_PATH]; static BOOL (WINAPI *pConvertSidToStringSidA)(PSID, LPSTR*); +static BOOL (WINAPI *pOpenProcessToken)( HANDLE, DWORD, PHANDLE ); static LONG (WINAPI *pRegDeleteKeyExA)(HKEY, LPCSTR, REGSAM, DWORD); static BOOL (WINAPI *pIsWow64Process)(HANDLE, PBOOL); @@ -59,6 +65,8 @@ (LPCSTR, LPCSTR, DWORD, DWORD, CHAR[39], MSIINSTALLCONTEXT *, LPSTR, LPDWORD); static UINT (WINAPI *pMsiEnumComponentsExA) (LPCSTR, DWORD, DWORD, CHAR[39], MSIINSTALLCONTEXT *, LPSTR, LPDWORD); +static UINT (WINAPI *pMsiSetExternalUIRecord) + (INSTALLUI_HANDLER_RECORD, DWORD, LPVOID, PINSTALLUI_HANDLER_RECORD); static void init_functionpointers(void) { @@ -78,16 +86,311 @@ GET_PROC(hmsi, MsiOpenPackageExW) GET_PROC(hmsi, MsiEnumPatchesExA) GET_PROC(hmsi, MsiQueryComponentStateA) + GET_PROC(hmsi, MsiSetExternalUIRecord) GET_PROC(hmsi, MsiUseFeatureExA) GET_PROC(hmsi, MsiGetPatchInfoExA) GET_PROC(hmsi, MsiEnumProductsExA) GET_PROC(hmsi, MsiEnumComponentsExA) GET_PROC(hadvapi32, ConvertSidToStringSidA) + GET_PROC(hadvapi32, OpenProcessToken); GET_PROC(hadvapi32, RegDeleteKeyExA) GET_PROC(hkernel32, IsWow64Process) #undef GET_PROC +} + +static BOOL get_system_dirs(void) +{ + HKEY hkey; + DWORD type, size; + + if (RegOpenKey(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows\\CurrentVersion", &hkey)) + return FALSE; + + size = MAX_PATH; + if (RegQueryValueExA(hkey, "ProgramFilesDir (x86)", 0, &type, (LPBYTE)PROG_FILES_DIR, &size) && + RegQueryValueExA(hkey, "ProgramFilesDir", 0, &type, (LPBYTE)PROG_FILES_DIR, &size)) + { + RegCloseKey(hkey); + return FALSE; + } + size = MAX_PATH; + if (RegQueryValueExA(hkey, "CommonFilesDir (x86)", 0, &type, (LPBYTE)COMMON_FILES_DIR, &size) && + RegQueryValueExA(hkey, "CommonFilesDir", 0, &type, (LPBYTE)COMMON_FILES_DIR, &size)) + { + RegCloseKey(hkey); + return FALSE; + } + size = MAX_PATH; + if (RegQueryValueExA(hkey, "ProgramFilesDir", 0, &type, (LPBYTE)PROG_FILES_DIR_NATIVE, &size)) + { + RegCloseKey(hkey); + return FALSE; + } + RegCloseKey(hkey); + if (!GetWindowsDirectoryA(WINDOWS_DIR, MAX_PATH)) return FALSE; + return TRUE; +} + +static BOOL file_exists(const char *file) +{ + return GetFileAttributes(file) != INVALID_FILE_ATTRIBUTES; +} + +static BOOL pf_exists(const char *file) +{ + char path[MAX_PATH]; + + lstrcpyA(path, PROG_FILES_DIR); + lstrcatA(path, "\\"); + lstrcatA(path, file); + return file_exists(path); +} + +static BOOL delete_pf(const char *rel_path, BOOL is_file) +{ + char path[MAX_PATH]; + + lstrcpyA(path, PROG_FILES_DIR); + lstrcatA(path, "\\"); + lstrcatA(path, rel_path); + + if (is_file) + return DeleteFileA(path); + else + return RemoveDirectoryA(path); +} + +static BOOL is_process_limited(void) +{ + HANDLE token; + TOKEN_ELEVATION_TYPE type = TokenElevationTypeDefault; + DWORD size; + BOOL ret; + + if (!pOpenProcessToken) return FALSE; + if (!pOpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token)) return FALSE; + ret = GetTokenInformation(token, TokenElevationType, &type, sizeof(type), &size); + CloseHandle(token); + return (ret && type == TokenElevationTypeLimited); +} + +/* msi database data */ + +static const char directory_dat[] = + "Directory\tDirectory_Parent\tDefaultDir\n" + "s72\tS72\tl255\n" + "Directory\tDirectory\n" + "MSITESTDIR\tProgramFilesFolder\tmsitest\n" + "ProgramFilesFolder\tTARGETDIR\t.\n" + "TARGETDIR\t\tSourceDir"; + +static const char component_dat[] = + "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n" + "s72\tS38\ts72\ti2\tS255\tS72\n" + "Component\tComponent\n" + "One\t{8F5BAEEF-DD92-40AC-9397-BE3CF9F97C81}\tMSITESTDIR\t2\tNOT REINSTALL\tone.txt\n"; + +static const char feature_dat[] = + "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n" + "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n" + "Feature\tFeature\n" + "One\t\tOne\tOne\t1\t3\tMSITESTDIR\t0\n" + "Two\t\t\t\t2\t1\tTARGETDIR\t0\n"; + +static const char feature_comp_dat[] = + "Feature_\tComponent_\n" + "s38\ts72\n" + "FeatureComponents\tFeature_\tComponent_\n" + "One\tOne\n"; + +static const char file_dat[] = + "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n" + "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n" + "File\tFile\n" + "one.txt\tOne\tone.txt\t1000\t\t\t0\t1\n"; + +static const char install_exec_seq_dat[] = + "Action\tCondition\tSequence\n" + "s72\tS255\tI2\n" + "InstallExecuteSequence\tAction\n" + "ValidateProductID\t\t700\n" + "CostInitialize\t\t800\n" + "FileCost\t\t900\n" + "CostFinalize\t\t1000\n" + "InstallValidate\t\t1400\n" + "InstallInitialize\t\t1500\n" + "ProcessComponents\t\t1600\n" + "UnpublishFeatures\t\t1800\n" + "RemoveFiles\t\t3500\n" + "InstallFiles\t\t4000\n" + "RegisterProduct\t\t6100\n" + "PublishFeatures\t\t6300\n" + "PublishProduct\t\t6400\n" + "InstallFinalize\t\t6600"; + +static const char media_dat[] = + "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n" + "i2\ti4\tL64\tS255\tS32\tS72\n" + "Media\tDiskId\n" + "1\t1\t\t\tDISK1\t\n"; + +static const char property_dat[] = + "Property\tValue\n" + "s72\tl0\n" + "Property\tProperty\n" + "INSTALLLEVEL\t3\n" + "Manufacturer\tWine\n" + "ProductCode\t{38847338-1BBC-4104-81AC-2FAAC7ECDDCD}\n" + "ProductName\tMSITEST\n" + "ProductVersion\t1.1.1\n" + "UpgradeCode\t{9574448F-9B86-4E07-B6F6-8D199DA12127}\n" + "MSIFASTINSTALL\t1\n"; + +static const char mcp_component_dat[] = + "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n" + "s72\tS38\ts72\ti2\tS255\tS72\n" + "Component\tComponent\n" + "hydrogen\t{C844BD1E-1907-4C00-8BC9-150BD70DF0A1}\tMSITESTDIR\t2\t\thydrogen\n" + "helium\t{5AD3C142-CEF8-490D-B569-784D80670685}\tMSITESTDIR\t2\t\thelium\n" + "lithium\t{4AF28FFC-71C7-4307-BDE4-B77C5338F56F}\tMSITESTDIR\t2\tPROPVAR=42\tlithium\n"; + +static const char mcp_feature_dat[] = + "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n" + "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n" + "Feature\tFeature\n" + "hydroxyl\t\thydroxyl\thydroxyl\t2\t1\tTARGETDIR\t0\n" + "heliox\t\theliox\theliox\t2\t5\tTARGETDIR\t0\n" + "lithia\t\tlithia\tlithia\t2\t10\tTARGETDIR\t0"; + +static const char mcp_feature_comp_dat[] = + "Feature_\tComponent_\n" + "s38\ts72\n" + "FeatureComponents\tFeature_\tComponent_\n" + "hydroxyl\thydrogen\n" + "heliox\thelium\n" + "lithia\tlithium"; + +static const CHAR mcp_file_dat[] = + "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n" + "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n" + "File\tFile\n" + "hydrogen\thydrogen\thydrogen\t0\t\t\t8192\t1\n" + "helium\thelium\thelium\t0\t\t\t8192\t1\n" + "lithium\tlithium\tlithium\t0\t\t\t8192\t1"; + +typedef struct _msi_table +{ + const CHAR *filename; + const CHAR *data; + int size; +} msi_table; + +#define ADD_TABLE(x) {#x".idt", x##_dat, sizeof(x##_dat)} + +static const msi_table tables[] = +{ + ADD_TABLE(directory), + ADD_TABLE(component), + ADD_TABLE(feature), + ADD_TABLE(feature_comp), + ADD_TABLE(file), + ADD_TABLE(install_exec_seq), + ADD_TABLE(media), + ADD_TABLE(property), +}; + +static const msi_table mcp_tables[] = +{ + ADD_TABLE(directory), + ADD_TABLE(mcp_component), + ADD_TABLE(mcp_feature), + ADD_TABLE(mcp_feature_comp), + ADD_TABLE(mcp_file), + ADD_TABLE(install_exec_seq), + ADD_TABLE(media), + ADD_TABLE(property) +}; + +static void write_file(const CHAR *filename, const char *data, int data_size) +{ + DWORD size; + + HANDLE hf = CreateFile(filename, GENERIC_WRITE, 0, NULL, + CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); + + WriteFile(hf, data, data_size, &size, NULL); + CloseHandle(hf); +} + +static void write_msi_summary_info(MSIHANDLE db, INT version, INT wordcount, const char *template) +{ + MSIHANDLE summary; + UINT r; + + r = MsiGetSummaryInformationA(db, NULL, 5, &summary); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); + + r = MsiSummaryInfoSetPropertyA(summary, PID_TEMPLATE, VT_LPSTR, 0, NULL, template); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); + + r = MsiSummaryInfoSetPropertyA(summary, PID_REVNUMBER, VT_LPSTR, 0, NULL, + "{004757CA-5092-49C2-AD20-28E1CE0DF5F2}"); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); + + r = MsiSummaryInfoSetPropertyA(summary, PID_PAGECOUNT, VT_I4, version, NULL, NULL); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); + + r = MsiSummaryInfoSetPropertyA(summary, PID_WORDCOUNT, VT_I4, wordcount, NULL, NULL); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); + + r = MsiSummaryInfoSetPropertyA(summary, PID_TITLE, VT_LPSTR, 0, NULL, "MSITEST"); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); + + /* write the summary changes back to the stream */ + r = MsiSummaryInfoPersist(summary); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); + + MsiCloseHandle(summary); +} + +#define create_database(name, tables, num_tables) \ + create_database_wordcount(name, tables, num_tables, 100, 0, ";1033"); + +#define create_database_template(name, tables, num_tables, version, template) \ + create_database_wordcount(name, tables, num_tables, version, 0, template); + +static void create_database_wordcount(const CHAR *name, const msi_table *tables, + int num_tables, INT version, INT wordcount, + const char *template) +{ + MSIHANDLE db; + UINT r; + int j; + + r = MsiOpenDatabaseA(name, MSIDBOPEN_CREATE, &db); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); + + /* import the tables into the database */ + for (j = 0; j < num_tables; j++) + { + const msi_table *table = &tables[j]; + + write_file(table->filename, table->data, (table->size - 1) * sizeof(char)); + + r = MsiDatabaseImportA(db, CURR_DIR, table->filename); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); + + DeleteFileA(table->filename); + } + + write_msi_summary_info(db, version, wordcount, template); + + r = MsiDatabaseCommit(db); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); + + MsiCloseHandle(db); } static UINT run_query(MSIHANDLE hdb, const char *query) @@ -2829,6 +3132,9 @@ DWORD verchecksz, langchecksz; /* NULL szFilePath */ + r = MsiGetFileVersionA(NULL, NULL, NULL, NULL, NULL); + ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r); + versz = MAX_PATH; langsz = MAX_PATH; lstrcpyA(version, "version"); @@ -2844,6 +3150,9 @@ ok(langsz == MAX_PATH, "Expected %d, got %d\n", MAX_PATH, langsz); /* empty szFilePath */ + r = MsiGetFileVersionA("", NULL, NULL, NULL, NULL); + ok(r == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", r); + versz = MAX_PATH; langsz = MAX_PATH; lstrcpyA(version, "version"); @@ -2941,6 +3250,9 @@ create_file("ver.txt", "ver.txt", 20); /* file exists, no version information */ + r = MsiGetFileVersionA("ver.txt", NULL, NULL, NULL, NULL); + ok(r == ERROR_FILE_INVALID, "Expected ERROR_FILE_INVALID, got %d\n", r); + versz = MAX_PATH; langsz = MAX_PATH; lstrcpyA(version, "version"); @@ -3042,6 +3354,34 @@ "Expected first character of %s, got %s\n", langcheck, lang); ok(langsz >= langchecksz, "Expected %d >= %d\n", langsz, langchecksz); + /* pcchVersionBuf big enough, pcchLangBuf not big enough */ + versz = MAX_PATH; + langsz = 0; + lstrcpyA(version, "version"); + r = MsiGetFileVersionA(path, version, &versz, NULL, &langsz); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + ok(versz == verchecksz, "Expected %d, got %d\n", verchecksz, versz); + ok(!lstrcmpA(version, vercheck), "Expected %s, got %s\n", vercheck, version); + ok(langsz >= langchecksz && langsz < MAX_PATH, "Expected %d >= %d\n", langsz, langchecksz); + + /* pcchVersionBuf not big enough, pcchLangBuf big enough */ + versz = 5; + langsz = MAX_PATH; + lstrcpyA(lang, "lang"); + r = MsiGetFileVersionA(path, NULL, &versz, lang, &langsz); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + ok(versz == verchecksz, "Expected %d, got %d\n", verchecksz, versz); + ok(langsz >= langchecksz && langsz < MAX_PATH, "Expected %d >= %d\n", langsz, langchecksz); + ok(lstrcmpA(lang, "lang"), "lang buffer not modified\n"); + + /* NULL pcchVersionBuf and pcchLangBuf */ + r = MsiGetFileVersionA(path, version, NULL, lang, NULL); + ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r); + + /* All NULL except szFilePath */ + r = MsiGetFileVersionA(path, NULL, NULL, NULL, NULL); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + HeapFree(GetProcessHeap(), 0, vercheck); HeapFree(GetProcessHeap(), 0, langcheck); } @@ -3194,6 +3534,12 @@ lstrcatA(keypath, prod_squashed); res = RegCreateKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, NULL, 0, access, NULL, &localkey, NULL); + if (res == ERROR_ACCESS_DENIED) + { + skip("Not enough rights to perform tests\n"); + LocalFree(usersid); + return; + } ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); /* local user product code exists */ @@ -7308,6 +7654,12 @@ lstrcatA(keypath, prod_squashed); res = RegCreateKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, NULL, 0, access, NULL, &userprod, NULL); + if (res == ERROR_ACCESS_DENIED) + { + skip("Not enough rights to perform tests\n"); + LocalFree(usersid); + return; + } ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); res = RegCreateKeyExA(userprod, "InstallProperties", 0, NULL, 0, access, NULL, &props, NULL); @@ -7784,6 +8136,12 @@ lstrcatA(keypath, prod_squashed); res = RegCreateKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, NULL, 0, access, NULL, &userkey, NULL); + if (res == ERROR_ACCESS_DENIED) + { + skip("Not enough rights to perform tests\n"); + LocalFree(usersid); + return; + } ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); /* user product key exists */ @@ -8406,6 +8764,11 @@ lstrcatA(keypath, prod_squashed); res = RegCreateKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, NULL, 0, access, NULL, &udprod, NULL); + if (res == ERROR_ACCESS_DENIED) + { + skip("Not enough rights to perform tests\n"); + return; + } ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); /* UserData product key exists */ @@ -8864,6 +9227,11 @@ lstrcatA(keypath, prod_squashed); res = RegCreateKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, NULL, 0, access, NULL, &udprod, NULL); + if (res == ERROR_ACCESS_DENIED) + { + skip("Not enough rights to perform tests\n"); + goto error; + } ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); /* UserData product key exists */ @@ -10254,6 +10622,12 @@ lstrcatA(keypath, prod_squashed); res = RegCreateKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, NULL, 0, access, NULL, &prodkey, NULL); + if (res == ERROR_ACCESS_DENIED) + { + skip("Not enough rights to perform tests\n"); + LocalFree(usersid); + return; + } ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); /* local product key exists */ @@ -12137,12 +12511,555 @@ LocalFree( usersid ); } +static void test_MsiConfigureProductEx(void) +{ + UINT r; + LONG res; + DWORD type, size; + HKEY props, source; + CHAR keypath[MAX_PATH * 2], localpackage[MAX_PATH], packagename[MAX_PATH]; + REGSAM access = KEY_ALL_ACCESS; + + if (is_process_limited()) + { + skip("process is limited\n"); + return; + } + + CreateDirectoryA("msitest", NULL); + create_file("msitest\\hydrogen", "hydrogen", 500); + create_file("msitest\\helium", "helium", 500); + create_file("msitest\\lithium", "lithium", 500); + + create_database(msifile, mcp_tables, sizeof(mcp_tables) / sizeof(msi_table)); + + if (is_wow64) + access |= KEY_WOW64_64KEY; + + MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL); + + /* NULL szProduct */ + r = MsiConfigureProductExA(NULL, INSTALLLEVEL_DEFAULT, + INSTALLSTATE_DEFAULT, "PROPVAR=42"); + ok(r == ERROR_INVALID_PARAMETER, + "Expected ERROR_INVALID_PARAMETER, got %d\n", r); + + /* empty szProduct */ + r = MsiConfigureProductExA("", INSTALLLEVEL_DEFAULT, + INSTALLSTATE_DEFAULT, "PROPVAR=42"); + ok(r == ERROR_INVALID_PARAMETER, + "Expected ERROR_INVALID_PARAMETER, got %d\n", r); + + /* garbage szProduct */ + r = MsiConfigureProductExA("garbage", INSTALLLEVEL_DEFAULT, + INSTALLSTATE_DEFAULT, "PROPVAR=42"); + ok(r == ERROR_INVALID_PARAMETER, + "Expected ERROR_INVALID_PARAMETER, got %d\n", r); + + /* guid without brackets */ + r = MsiConfigureProductExA("6700E8CF-95AB-4D9C-BC2C-15840DEA7A5D", + INSTALLLEVEL_DEFAULT, INSTALLSTATE_DEFAULT, + "PROPVAR=42"); + ok(r == ERROR_INVALID_PARAMETER, + "Expected ERROR_INVALID_PARAMETER, got %d\n", r); + + /* guid with brackets */ + r = MsiConfigureProductExA("{6700E8CF-95AB-4D9C-BC2C-15840DEA7A5D}", + INSTALLLEVEL_DEFAULT, INSTALLSTATE_DEFAULT, + "PROPVAR=42"); + ok(r == ERROR_UNKNOWN_PRODUCT, + "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r); + + /* same length as guid, but random */ + r = MsiConfigureProductExA("A938G02JF-2NF3N93-VN3-2NNF-3KGKALDNF93", + INSTALLLEVEL_DEFAULT, INSTALLSTATE_DEFAULT, + "PROPVAR=42"); + ok(r == ERROR_UNKNOWN_PRODUCT, + "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r); + + /* product not installed yet */ + r = MsiConfigureProductExA("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", + INSTALLLEVEL_DEFAULT, INSTALLSTATE_DEFAULT, + "PROPVAR=42"); + ok(r == ERROR_UNKNOWN_PRODUCT, + "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r); + + /* install the product, per-user unmanaged */ + r = MsiInstallProductA(msifile, "INSTALLLEVEL=10 PROPVAR=42"); + if (r == ERROR_INSTALL_PACKAGE_REJECTED) + { + skip("Not enough rights to perform tests\n"); + goto error; + } + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); + ok(pf_exists("msitest\\hydrogen"), "File not installed\n"); + ok(pf_exists("msitest\\helium"), "File not installed\n"); + ok(pf_exists("msitest\\lithium"), "File not installed\n"); + ok(pf_exists("msitest"), "File not installed\n"); + + /* product is installed per-user managed, remove it */ + r = MsiConfigureProductExA("{38847338-1BBC-4104-81AC-2FAAC7ECDDCD}", + INSTALLLEVEL_DEFAULT, INSTALLSTATE_ABSENT, + "PROPVAR=42"); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + ok(!delete_pf("msitest\\hydrogen", TRUE), "File not removed\n"); + ok(!delete_pf("msitest\\helium", TRUE), "File not removed\n"); + ok(!delete_pf("msitest\\lithium", TRUE), "File not removed\n"); + ok(!delete_pf("msitest", FALSE), "Directory not removed\n"); + + /* product has been removed */ + r = MsiConfigureProductExA("{38847338-1BBC-4104-81AC-2FAAC7ECDDCD}", + INSTALLLEVEL_DEFAULT, INSTALLSTATE_DEFAULT, + "PROPVAR=42"); + ok(r == ERROR_UNKNOWN_PRODUCT, + "Expected ERROR_UNKNOWN_PRODUCT, got %u\n", r); + + /* install the product, machine */ + r = MsiInstallProductA(msifile, "ALLUSERS=1 INSTALLLEVEL=10 PROPVAR=42"); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); + ok(pf_exists("msitest\\hydrogen"), "File not installed\n"); + ok(pf_exists("msitest\\helium"), "File not installed\n"); + ok(pf_exists("msitest\\lithium"), "File not installed\n"); + ok(pf_exists("msitest"), "File not installed\n"); + + /* product is installed machine, remove it */ + r = MsiConfigureProductExA("{38847338-1BBC-4104-81AC-2FAAC7ECDDCD}", + INSTALLLEVEL_DEFAULT, INSTALLSTATE_ABSENT, + "PROPVAR=42"); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + ok(!delete_pf("msitest\\hydrogen", TRUE), "File not removed\n"); + ok(!delete_pf("msitest\\helium", TRUE), "File not removed\n"); + ok(!delete_pf("msitest\\lithium", TRUE), "File not removed\n"); + ok(!delete_pf("msitest", FALSE), "Directory not removed\n"); + + /* product has been removed */ + r = MsiConfigureProductExA("{38847338-1BBC-4104-81AC-2FAAC7ECDDCD}", + INSTALLLEVEL_DEFAULT, INSTALLSTATE_DEFAULT, + "PROPVAR=42"); + ok(r == ERROR_UNKNOWN_PRODUCT, + "Expected ERROR_UNKNOWN_PRODUCT, got %u\n", r); + + /* install the product, machine */ + r = MsiInstallProductA(msifile, "ALLUSERS=1 INSTALLLEVEL=10 PROPVAR=42"); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); + ok(pf_exists("msitest\\hydrogen"), "File not installed\n"); + ok(pf_exists("msitest\\helium"), "File not installed\n"); + ok(pf_exists("msitest\\lithium"), "File not installed\n"); + ok(pf_exists("msitest"), "File not installed\n"); + + DeleteFileA(msifile); + + /* msifile is removed */ + r = MsiConfigureProductExA("{38847338-1BBC-4104-81AC-2FAAC7ECDDCD}", + INSTALLLEVEL_DEFAULT, INSTALLSTATE_ABSENT, + "PROPVAR=42"); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + ok(!delete_pf("msitest\\hydrogen", TRUE), "File not removed\n"); + ok(!delete_pf("msitest\\helium", TRUE), "File not removed\n"); + ok(!delete_pf("msitest\\lithium", TRUE), "File not removed\n"); + ok(!delete_pf("msitest", FALSE), "Directory not removed\n"); + + create_database(msifile, mcp_tables, sizeof(mcp_tables) / sizeof(msi_table)); + + /* install the product, machine */ + r = MsiInstallProductA(msifile, "ALLUSERS=1 INSTALLLEVEL=10 PROPVAR=42"); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); + ok(pf_exists("msitest\\hydrogen"), "File not installed\n"); + ok(pf_exists("msitest\\helium"), "File not installed\n"); + ok(pf_exists("msitest\\lithium"), "File not installed\n"); + ok(pf_exists("msitest"), "File not installed\n"); + + DeleteFileA(msifile); + + lstrcpyA(keypath, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"); + lstrcatA(keypath, "Installer\\UserData\\S-1-5-18\\Products\\"); + lstrcatA(keypath, "83374883CBB1401418CAF2AA7CCEDDDC\\InstallProperties"); + + res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, access, &props); + ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); + + type = REG_SZ; + size = MAX_PATH; + res = RegQueryValueExA(props, "LocalPackage", NULL, &type, + (LPBYTE)localpackage, &size); + ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); + + res = RegSetValueExA(props, "LocalPackage", 0, REG_SZ, + (const BYTE *)"C:\\idontexist.msi", 18); + ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); + + /* LocalPackage is used to find the cached msi package */ + r = MsiConfigureProductExA("{38847338-1BBC-4104-81AC-2FAAC7ECDDCD}", + INSTALLLEVEL_DEFAULT, INSTALLSTATE_ABSENT, + "PROPVAR=42"); + ok(r == ERROR_INSTALL_SOURCE_ABSENT, + "Expected ERROR_INSTALL_SOURCE_ABSENT, got %d\n", r); + ok(pf_exists("msitest\\hydrogen"), "File not installed\n"); + ok(pf_exists("msitest\\helium"), "File not installed\n"); + ok(pf_exists("msitest\\lithium"), "File not installed\n"); + ok(pf_exists("msitest"), "File not installed\n"); + + RegCloseKey(props); + create_database(msifile, mcp_tables, sizeof(mcp_tables) / sizeof(msi_table)); + + /* LastUsedSource can be used as a last resort */ + r = MsiConfigureProductExA("{38847338-1BBC-4104-81AC-2FAAC7ECDDCD}", + INSTALLLEVEL_DEFAULT, INSTALLSTATE_ABSENT, + "PROPVAR=42"); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + ok(!delete_pf("msitest\\hydrogen", TRUE), "File not removed\n"); + ok(!delete_pf("msitest\\helium", TRUE), "File not removed\n"); + ok(!delete_pf("msitest\\lithium", TRUE), "File not removed\n"); + ok(!delete_pf("msitest", FALSE), "Directory not removed\n"); + DeleteFileA( localpackage ); + + /* install the product, machine */ + r = MsiInstallProductA(msifile, "ALLUSERS=1 INSTALLLEVEL=10 PROPVAR=42"); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); + ok(pf_exists("msitest\\hydrogen"), "File not installed\n"); + ok(pf_exists("msitest\\helium"), "File not installed\n"); + ok(pf_exists("msitest\\lithium"), "File not installed\n"); + ok(pf_exists("msitest"), "File not installed\n"); + + lstrcpyA(keypath, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"); + lstrcatA(keypath, "Installer\\UserData\\S-1-5-18\\Products\\"); + lstrcatA(keypath, "83374883CBB1401418CAF2AA7CCEDDDC\\InstallProperties"); + + res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, access, &props); + ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); + + type = REG_SZ; + size = MAX_PATH; + res = RegQueryValueExA(props, "LocalPackage", NULL, &type, + (LPBYTE)localpackage, &size); + ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); + + res = RegSetValueExA(props, "LocalPackage", 0, REG_SZ, + (const BYTE *)"C:\\idontexist.msi", 18); + ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); + + lstrcpyA(keypath, "SOFTWARE\\Classes\\Installer\\Products\\"); + lstrcatA(keypath, "83374883CBB1401418CAF2AA7CCEDDDC\\SourceList"); + + res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, access, &source); + ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); + + type = REG_SZ; + size = MAX_PATH; + res = RegQueryValueExA(source, "PackageName", NULL, &type, + (LPBYTE)packagename, &size); + ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); + + res = RegSetValueExA(source, "PackageName", 0, REG_SZ, + (const BYTE *)"idontexist.msi", 15); + ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); + + /* SourceList is altered */ + r = MsiConfigureProductExA("{38847338-1BBC-4104-81AC-2FAAC7ECDDCD}", + INSTALLLEVEL_DEFAULT, INSTALLSTATE_ABSENT, + "PROPVAR=42"); + ok(r == ERROR_INSTALL_SOURCE_ABSENT, + "Expected ERROR_INSTALL_SOURCE_ABSENT, got %d\n", r); + ok(pf_exists("msitest\\hydrogen"), "File not installed\n"); + ok(pf_exists("msitest\\helium"), "File not installed\n"); + ok(pf_exists("msitest\\lithium"), "File not installed\n"); + ok(pf_exists("msitest"), "File not installed\n"); + + /* restore PackageName */ + res = RegSetValueExA(source, "PackageName", 0, REG_SZ, + (const BYTE *)packagename, lstrlenA(packagename) + 1); + ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); + + /* restore LocalPackage */ + res = RegSetValueExA(props, "LocalPackage", 0, REG_SZ, + (const BYTE *)localpackage, lstrlenA(localpackage) + 1); + ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); + + /* finally remove the product */ + r = MsiConfigureProductExA("{38847338-1BBC-4104-81AC-2FAAC7ECDDCD}", + INSTALLLEVEL_DEFAULT, INSTALLSTATE_ABSENT, + "PROPVAR=42"); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + ok(!delete_pf("msitest\\hydrogen", TRUE), "File not removed\n"); + ok(!delete_pf("msitest\\helium", TRUE), "File not removed\n"); + ok(!delete_pf("msitest\\lithium", TRUE), "File not removed\n"); + ok(!delete_pf("msitest", FALSE), "Directory not removed\n"); + + RegCloseKey(source); + RegCloseKey(props); + +error: + DeleteFileA("msitest\\hydrogen"); + DeleteFileA("msitest\\helium"); + DeleteFileA("msitest\\lithium"); + RemoveDirectoryA("msitest"); + DeleteFileA(msifile); +} + +static void test_MsiSetFeatureAttributes(void) +{ + UINT r; + DWORD attrs; + char path[MAX_PATH]; + MSIHANDLE package; + + if (is_process_limited()) + { + skip("process is limited\n"); + return; + } + create_database( msifile, tables, sizeof(tables) / sizeof(tables[0]) ); + + strcpy( path, CURR_DIR ); + strcat( path, "\\" ); + strcat( path, msifile ); + + r = MsiOpenPackage( path, &package ); + if (r == ERROR_INSTALL_PACKAGE_REJECTED) + { + skip("Not enough rights to perform tests\n"); + DeleteFileA( msifile ); + return; + } + ok(r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r); + + r = MsiSetFeatureAttributesA( package, "One", INSTALLFEATUREATTRIBUTE_FAVORLOCAL ); + ok(r == ERROR_FUNCTION_FAILED, "Expected ERROR_FUNCTION_FAILED, got %u\n", r); + + r = MsiDoAction( package, "CostInitialize" ); + ok(r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r); + + r = MsiSetFeatureAttributesA( 0, "One", INSTALLFEATUREATTRIBUTE_FAVORLOCAL ); + ok(r == ERROR_INVALID_HANDLE, "expected ERROR_INVALID_HANDLE, got %u\n", r); + + r = MsiSetFeatureAttributesA( package, "", INSTALLFEATUREATTRIBUTE_FAVORLOCAL ); + ok(r == ERROR_UNKNOWN_FEATURE, "expected ERROR_UNKNOWN_FEATURE, got %u\n", r); + + r = MsiSetFeatureAttributesA( package, NULL, INSTALLFEATUREATTRIBUTE_FAVORLOCAL ); + ok(r == ERROR_UNKNOWN_FEATURE, "expected ERROR_UNKNOWN_FEATURE, got %u\n", r); + + r = MsiSetFeatureAttributesA( package, "One", 0 ); + ok(r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r); + + attrs = 0xdeadbeef; + r = MsiGetFeatureInfoA( package, "One", &attrs, NULL, NULL, NULL, NULL ); + ok(r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r); + ok(attrs == INSTALLFEATUREATTRIBUTE_FAVORLOCAL, + "expected INSTALLFEATUREATTRIBUTE_FAVORLOCAL, got 0x%08x\n", attrs); + + r = MsiSetFeatureAttributesA( package, "One", INSTALLFEATUREATTRIBUTE_FAVORLOCAL ); + ok(r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r); + + attrs = 0; + r = MsiGetFeatureInfoA( package, "One", &attrs, NULL, NULL, NULL, NULL ); + ok(r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r); + ok(attrs == INSTALLFEATUREATTRIBUTE_FAVORLOCAL, + "expected INSTALLFEATUREATTRIBUTE_FAVORLOCAL, got 0x%08x\n", attrs); + + r = MsiDoAction( package, "FileCost" ); + ok(r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r); + + r = MsiSetFeatureAttributesA( package, "One", INSTALLFEATUREATTRIBUTE_FAVORSOURCE ); + ok(r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r); + + attrs = 0; + r = MsiGetFeatureInfoA( package, "One", &attrs, NULL, NULL, NULL, NULL ); + ok(r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r); + ok(attrs == INSTALLFEATUREATTRIBUTE_FAVORSOURCE, + "expected INSTALLFEATUREATTRIBUTE_FAVORSOURCE, got 0x%08x\n", attrs); + + r = MsiDoAction( package, "CostFinalize" ); + ok(r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r); + + r = MsiSetFeatureAttributesA( package, "One", INSTALLFEATUREATTRIBUTE_FAVORLOCAL ); + ok(r == ERROR_FUNCTION_FAILED, "expected ERROR_FUNCTION_FAILED, got %u\n", r); + + MsiCloseHandle( package ); + DeleteFileA( msifile ); +} + +static void test_MsiGetFeatureInfo(void) +{ + UINT r; + MSIHANDLE package; + char title[32], help[32], path[MAX_PATH]; + DWORD attrs, title_len, help_len; + + if (is_process_limited()) + { + skip("process is limited\n"); + return; + } + create_database( msifile, tables, sizeof(tables) / sizeof(tables[0]) ); + + strcpy( path, CURR_DIR ); + strcat( path, "\\" ); + strcat( path, msifile ); + + r = MsiOpenPackage( path, &package ); + if (r == ERROR_INSTALL_PACKAGE_REJECTED) + { + skip("Not enough rights to perform tests\n"); + DeleteFileA( msifile ); + return; + } + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); + + r = MsiGetFeatureInfoA( 0, NULL, NULL, NULL, NULL, NULL, NULL ); + ok(r == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %u\n", r); + + r = MsiGetFeatureInfoA( package, NULL, NULL, NULL, NULL, NULL, NULL ); + ok(r == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %u\n", r); + + r = MsiGetFeatureInfoA( package, "", NULL, NULL, NULL, NULL, NULL ); + ok(r == ERROR_UNKNOWN_FEATURE, "expected ERROR_UNKNOWN_FEATURE, got %u\n", r); + + r = MsiGetFeatureInfoA( package, "One", NULL, NULL, NULL, NULL, NULL ); + ok(r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r); + + r = MsiGetFeatureInfoA( 0, "One", NULL, NULL, NULL, NULL, NULL ); + ok(r == ERROR_INVALID_HANDLE, "expected ERROR_INVALID_HANDLE, got %u\n", r); + + title_len = help_len = 0; + r = MsiGetFeatureInfoA( package, "One", NULL, NULL, &title_len, NULL, &help_len ); + ok(r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r); + ok(title_len == 3, "expected 3, got %u\n", title_len); + ok(help_len == 3, "expected 3, got %u\n", help_len); + + title[0] = help[0] = 0; + title_len = help_len = 0; + r = MsiGetFeatureInfoA( package, "One", NULL, title, &title_len, help, &help_len ); + ok(r == ERROR_MORE_DATA, "expected ERROR_MORE_DATA, got %u\n", r); + ok(title_len == 3, "expected 3, got %u\n", title_len); + ok(help_len == 3, "expected 3, got %u\n", help_len); + + attrs = 0; + title[0] = help[0] = 0; + title_len = sizeof(title); + help_len = sizeof(help); + r = MsiGetFeatureInfoA( package, "One", &attrs, title, &title_len, help, &help_len ); + ok(r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r); + ok(attrs == INSTALLFEATUREATTRIBUTE_FAVORLOCAL, "expected INSTALLFEATUREATTRIBUTE_FAVORLOCAL, got %u\n", attrs); + ok(title_len == 3, "expected 3, got %u\n", title_len); + ok(help_len == 3, "expected 3, got %u\n", help_len); + ok(!strcmp(title, "One"), "expected \"One\", got \"%s\"\n", title); + ok(!strcmp(help, "One"), "expected \"One\", got \"%s\"\n", help); + + attrs = 0; + title[0] = help[0] = 0; + title_len = sizeof(title); + help_len = sizeof(help); + r = MsiGetFeatureInfoA( package, "Two", &attrs, title, &title_len, help, &help_len ); + ok(r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r); + ok(attrs == INSTALLFEATUREATTRIBUTE_FAVORLOCAL, "expected INSTALLFEATUREATTRIBUTE_FAVORLOCAL, got %u\n", attrs); + ok(!title_len, "expected 0, got %u\n", title_len); + ok(!help_len, "expected 0, got %u\n", help_len); + ok(!title[0], "expected \"\", got \"%s\"\n", title); + ok(!help[0], "expected \"\", got \"%s\"\n", help); + + MsiCloseHandle( package ); + DeleteFileA( msifile ); +} + +static INT CALLBACK handler_a(LPVOID context, UINT type, LPCSTR msg) +{ + return IDOK; +} + +static INT CALLBACK handler_w(LPVOID context, UINT type, LPCWSTR msg) +{ + return IDOK; +} + +static INT CALLBACK handler_record(LPVOID context, UINT type, MSIHANDLE record) +{ + return IDOK; +} + +static void test_MsiSetExternalUI(void) +{ + INSTALLUI_HANDLERA ret_a; + INSTALLUI_HANDLERW ret_w; + INSTALLUI_HANDLER_RECORD prev; + UINT error; + + ret_a = MsiSetExternalUIA(handler_a, INSTALLLOGMODE_ERROR, NULL); + ok(ret_a == NULL, "expected NULL, got %p\n", ret_a); + + ret_a = MsiSetExternalUIA(NULL, 0, NULL); + ok(ret_a == handler_a, "expected %p, got %p\n", handler_a, ret_a); + + /* Not present before Installer 3.1 */ + if (!pMsiSetExternalUIRecord) { + win_skip("MsiSetExternalUIRecord is not available\n"); + return; + } + + error = pMsiSetExternalUIRecord(handler_record, INSTALLLOGMODE_ERROR, NULL, &prev); + ok(!error, "MsiSetExternalUIRecord failed %u\n", error); + ok(prev == NULL, "expected NULL, got %p\n", prev); + + prev = (INSTALLUI_HANDLER_RECORD)0xdeadbeef; + error = pMsiSetExternalUIRecord(NULL, INSTALLLOGMODE_ERROR, NULL, &prev); + ok(!error, "MsiSetExternalUIRecord failed %u\n", error); + ok(prev == handler_record, "expected %p, got %p\n", handler_record, prev); + + ret_w = MsiSetExternalUIW(handler_w, INSTALLLOGMODE_ERROR, NULL); + ok(ret_w == NULL, "expected NULL, got %p\n", ret_w); + + ret_w = MsiSetExternalUIW(NULL, 0, NULL); + ok(ret_w == handler_w, "expected %p, got %p\n", handler_w, ret_w); + + ret_a = MsiSetExternalUIA(handler_a, INSTALLLOGMODE_ERROR, NULL); + ok(ret_a == NULL, "expected NULL, got %p\n", ret_a); + + ret_w = MsiSetExternalUIW(handler_w, INSTALLLOGMODE_ERROR, NULL); + ok(ret_w == NULL, "expected NULL, got %p\n", ret_w); + + prev = (INSTALLUI_HANDLER_RECORD)0xdeadbeef; + error = pMsiSetExternalUIRecord(handler_record, INSTALLLOGMODE_ERROR, NULL, &prev); + ok(!error, "MsiSetExternalUIRecord failed %u\n", error); + ok(prev == NULL, "expected NULL, got %p\n", prev); + + ret_a = MsiSetExternalUIA(NULL, 0, NULL); + ok(ret_a == NULL, "expected NULL, got %p\n", ret_a); + + ret_w = MsiSetExternalUIW(NULL, 0, NULL); + ok(ret_w == NULL, "expected NULL, got %p\n", ret_w); + + prev = (INSTALLUI_HANDLER_RECORD)0xdeadbeef; + error = pMsiSetExternalUIRecord(NULL, 0, NULL, &prev); + ok(!error, "MsiSetExternalUIRecord failed %u\n", error); + ok(prev == handler_record, "expected %p, got %p\n", handler_record, prev); + + error = pMsiSetExternalUIRecord(handler_record, INSTALLLOGMODE_ERROR, NULL, NULL); + ok(!error, "MsiSetExternalUIRecord failed %u\n", error); + + error = pMsiSetExternalUIRecord(NULL, 0, NULL, NULL); + ok(!error, "MsiSetExternalUIRecord failed %u\n", error); +} + START_TEST(msi) { + DWORD len; + char temp_path[MAX_PATH], prev_path[MAX_PATH]; + init_functionpointers(); if (pIsWow64Process) pIsWow64Process(GetCurrentProcess(), &is_wow64); + + GetCurrentDirectoryA(MAX_PATH, prev_path); + GetTempPath(MAX_PATH, temp_path); + SetCurrentDirectoryA(temp_path); + + lstrcpyA(CURR_DIR, temp_path); + len = lstrlenA(CURR_DIR); + + if(len && (CURR_DIR[len - 1] == '\\')) + CURR_DIR[len - 1] = 0; + + ok(get_system_dirs(), "failed to retrieve system dirs\n"); test_usefeature(); test_null(); @@ -12175,4 +13092,10 @@ } test_MsiGetFileVersion(); test_MsiGetFileSignatureInformation(); + test_MsiConfigureProductEx(); + test_MsiSetFeatureAttributes(); + test_MsiGetFeatureInfo(); + test_MsiSetExternalUI(); + + SetCurrentDirectoryA(prev_path); } Modified: trunk/rostests/winetests/msi/package.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/msi/package.c?r…
============================================================================== --- trunk/rostests/winetests/msi/package.c [iso-8859-1] (original) +++ trunk/rostests/winetests/msi/package.c [iso-8859-1] Wed Apr 3 21:58:14 2013 @@ -2250,7 +2250,7 @@ sprintf(package, "#%i", hdb); r = MsiOpenPackage(package, &hpkg); - todo_wine ok(r != ERROR_SUCCESS, "MsiOpenPackage succeeded\n"); + ok(r != ERROR_SUCCESS, "MsiOpenPackage succeeded\n"); if (r == ERROR_SUCCESS) MsiCloseHandle(hpkg);
11 years, 8 months
1
0
0
0
[akhaldi] 58665: [MSI] * Sync with Wine 1.5.26.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Wed Apr 3 21:58:03 2013 New Revision: 58665 URL:
http://svn.reactos.org/svn/reactos?rev=58665&view=rev
Log: [MSI] * Sync with Wine 1.5.26. Modified: trunk/reactos/dll/win32/msi/action.c trunk/reactos/dll/win32/msi/automation.c trunk/reactos/dll/win32/msi/custom.c trunk/reactos/dll/win32/msi/dialog.c trunk/reactos/dll/win32/msi/files.c trunk/reactos/dll/win32/msi/msi.c trunk/reactos/dll/win32/msi/msi.spec trunk/reactos/dll/win32/msi/msipriv.h trunk/reactos/dll/win32/msi/package.c trunk/reactos/dll/win32/msi/record.c trunk/reactos/dll/win32/msi/registry.c trunk/reactos/dll/win32/msi/streams.c trunk/reactos/dll/win32/msi/suminfo.c trunk/reactos/dll/win32/msi/where.c trunk/reactos/include/psdk/msi.h trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/msi/action.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msi/action.c?rev…
============================================================================== --- trunk/reactos/dll/win32/msi/action.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msi/action.c [iso-8859-1] Wed Apr 3 21:58:03 2013 @@ -688,18 +688,6 @@ return NULL; } -MSIFILEPATCH *msi_get_loaded_filepatch( MSIPACKAGE *package, const WCHAR *key ) -{ - MSIFILEPATCH *patch; - - /* FIXME: There might be more than one patch */ - LIST_FOR_EACH_ENTRY( patch, &package->filepatches, MSIFILEPATCH, entry ) - { - if (!strcmpW( key, patch->File->File )) return patch; - } - return NULL; -} - MSIFOLDER *msi_get_loaded_folder( MSIPACKAGE *package, const WCHAR *dir ) { MSIFOLDER *folder; @@ -1788,7 +1776,7 @@ ret |= process_state_property( package, level, szReinstall, INSTALLSTATE_UNKNOWN ); ret |= process_state_property( package, level, szAdvertise, INSTALLSTATE_ADVERTISED ); - if (ret) + if (ret && !package->full_reinstall) msi_set_property( package->db, szPreselected, szOne, -1 ); return ret; @@ -4856,12 +4844,12 @@ if (!msi_check_publish(package)) return ERROR_SUCCESS; - rc = MSIREG_OpenFeaturesKey(package->ProductCode, package->Context, + rc = MSIREG_OpenFeaturesKey(package->ProductCode, NULL, package->Context, &hkey, TRUE); if (rc != ERROR_SUCCESS) goto end; - rc = MSIREG_OpenUserDataFeaturesKey(package->ProductCode, package->Context, + rc = MSIREG_OpenUserDataFeaturesKey(package->ProductCode, NULL, package->Context, &userdata, TRUE); if (rc != ERROR_SUCCESS) goto end; @@ -4961,7 +4949,7 @@ TRACE("unpublishing feature %s\n", debugstr_w(feature->Feature)); - r = MSIREG_OpenFeaturesKey(package->ProductCode, package->Context, + r = MSIREG_OpenFeaturesKey(package->ProductCode, NULL, package->Context, &hkey, FALSE); if (r == ERROR_SUCCESS) { @@ -4969,7 +4957,7 @@ RegCloseKey(hkey); } - r = MSIREG_OpenUserDataFeaturesKey(package->ProductCode, package->Context, + r = MSIREG_OpenUserDataFeaturesKey(package->ProductCode, NULL, package->Context, &hkey, FALSE); if (r == ERROR_SUCCESS) { @@ -7264,12 +7252,14 @@ {'m','s','i','e','x','e','c',' ','/','i',' ','%','s',' ','R','E','M','O','V','E','=','%','s',0}; MSIPACKAGE *package = param; const WCHAR *property = MSI_RecordGetString( rec, 7 ); + int attrs = MSI_RecordGetInteger( rec, 5 ); UINT len = sizeof(fmtW)/sizeof(fmtW[0]); WCHAR *product, *features, *cmd; STARTUPINFOW si; PROCESS_INFORMATION info; BOOL ret; + if (attrs & msidbUpgradeAttributesOnlyDetect) return ERROR_SUCCESS; if (!(product = msi_dup_property( package->db, property ))) return ERROR_SUCCESS; deformat_string( package, MSI_RecordGetString( rec, 6 ), &features ); @@ -7789,10 +7779,12 @@ { TRACE("setting REINSTALL property to ALL\n"); msi_set_property( package->db, szReinstall, szAll, -1 ); + package->full_reinstall = 1; } /* properties may have been added by a transform */ msi_clone_properties( package ); + msi_set_original_database_property( package->db, szPackagePath ); msi_parse_command_line( package, szCommandLine, FALSE ); msi_adjust_privilege_properties( package ); Modified: trunk/reactos/dll/win32/msi/automation.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msi/automation.c…
============================================================================== --- trunk/reactos/dll/win32/msi/automation.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msi/automation.c [iso-8859-1] Wed Apr 3 21:58:03 2013 @@ -1207,11 +1207,7 @@ V_VT(pVarResult) = VT_DISPATCH; if ((ret = MsiViewFetch(This->msiHandle, &msiHandle)) == ERROR_SUCCESS) { - IDispatch *dispatch = NULL; - - if (SUCCEEDED(hr = create_record(msiHandle, &dispatch))) - V_DISPATCH(pVarResult) = dispatch; - else + if (FAILED(hr = create_record(msiHandle, &V_DISPATCH(pVarResult)))) ERR("Failed to create Record object, hresult 0x%08x\n", hr); } else if (ret == ERROR_NO_MORE_ITEMS) @@ -1620,7 +1616,7 @@ static void variant_from_registry_value(VARIANT *pVarResult, DWORD dwType, LPBYTE lpData, DWORD dwSize) { static const WCHAR szREG_BINARY[] = { '(','R','E','G','_','B','I','N','A','R','Y',')',0 }; - static const WCHAR szREG_[] = { '(','R','E','G','_',']',0 }; + static const WCHAR szREG_[] = { '(','R','E','G','_','?','?',')',0 }; WCHAR *szString = (WCHAR *)lpData; LPWSTR szNewString = NULL; DWORD dwNewSize = 0; @@ -1688,7 +1684,6 @@ HRESULT hr; VARIANTARG varg0; MSIHANDLE hrec; - IDispatch* dispatch; if (!(wFlags & DISPATCH_METHOD)) return DISP_E_MEMBERNOTFOUND; @@ -1704,11 +1699,7 @@ if (!hrec) return DISP_E_EXCEPTION; - hr = create_record(hrec, &dispatch); - if (SUCCEEDED(hr)) - V_DISPATCH(pVarResult) = dispatch; - - return hr; + return create_record(hrec, &V_DISPATCH(pVarResult)); } static HRESULT InstallerImpl_OpenPackage(AutomationObject* This, Modified: trunk/reactos/dll/win32/msi/custom.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msi/custom.c?rev…
============================================================================== --- trunk/reactos/dll/win32/msi/custom.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msi/custom.c [iso-8859-1] Wed Apr 3 21:58:03 2013 @@ -622,43 +622,6 @@ return rc; } -static DWORD ACTION_CAInstallPackage(const GUID *guid) -{ - msi_custom_action_info *info; - UINT r = ERROR_FUNCTION_FAILED; - INSTALLUILEVEL old_level; - - info = find_action_by_guid(guid); - if (!info) - { - ERR("failed to find action %s\n", debugstr_guid(guid)); - return r; - } - - old_level = MsiSetInternalUI(INSTALLUILEVEL_BASIC, NULL); - r = MsiInstallProductW(info->source, info->target); - MsiSetInternalUI(old_level, NULL); - - release_custom_action_data(info); - - return r; -} - -static DWORD WINAPI ConcurrentInstallThread(LPVOID arg) -{ - LPGUID guid = arg; - DWORD rc; - - TRACE("concurrent installation (%x) started\n", GetCurrentThreadId()); - - rc = ACTION_CAInstallPackage(guid); - - TRACE("concurrent installation (%x) returned %i\n", GetCurrentThreadId(), rc); - - MsiCloseAllHandles(); - return rc; -} - static msi_custom_action_info *do_msidbCustomActionTypeDll( MSIPACKAGE *package, INT type, LPCWSTR source, LPCWSTR target, LPCWSTR action ) { @@ -693,60 +656,8 @@ return info; } -static msi_custom_action_info *do_msidbCAConcurrentInstall( - MSIPACKAGE *package, INT type, LPCWSTR source, LPCWSTR target, LPCWSTR action) -{ - msi_custom_action_info *info; - - info = msi_alloc( sizeof *info ); - if (!info) - return NULL; - - msiobj_addref( &package->hdr ); - info->refs = 2; /* 1 for our caller and 1 for thread we created */ - info->package = package; - info->type = type; - info->target = strdupW( target ); - info->source = strdupW( source ); - info->action = strdupW( action ); - CoCreateGuid( &info->guid ); - - EnterCriticalSection( &msi_custom_action_cs ); - list_add_tail( &msi_pending_custom_actions, &info->entry ); - LeaveCriticalSection( &msi_custom_action_cs ); - - info->handle = CreateThread( NULL, 0, ConcurrentInstallThread, &info->guid, 0, NULL ); - if (!info->handle) - { - /* release both references */ - release_custom_action_data( info ); - release_custom_action_data( info ); - return NULL; - } - - return info; -} - -static UINT HANDLE_CustomType23(MSIPACKAGE *package, LPCWSTR source, - LPCWSTR target, const INT type, LPCWSTR action) -{ - msi_custom_action_info *info; - WCHAR package_path[MAX_PATH]; - DWORD size; - - size = MAX_PATH; - msi_get_property(package->db, szSourceDir, package_path, &size); - lstrcatW(package_path, szBackSlash); - lstrcatW(package_path, source); - - TRACE("Installing package %s concurrently\n", debugstr_w(package_path)); - - info = do_msidbCAConcurrentInstall(package, type, package_path, target, action); - return wait_thread_handle(info); -} - -static UINT HANDLE_CustomType1(MSIPACKAGE *package, LPCWSTR source, - LPCWSTR target, const INT type, LPCWSTR action) +static UINT HANDLE_CustomType1( MSIPACKAGE *package, const WCHAR *source, const WCHAR *target, + INT type, const WCHAR *action ) { msi_custom_action_info *info; MSIBINARY *binary; @@ -828,8 +739,8 @@ return info.hProcess; } -static UINT HANDLE_CustomType2(MSIPACKAGE *package, LPCWSTR source, - LPCWSTR target, const INT type, LPCWSTR action) +static UINT HANDLE_CustomType2( MSIPACKAGE *package, const WCHAR *source, const WCHAR *target, + INT type, const WCHAR *action ) { MSIBINARY *binary; HANDLE handle; @@ -846,8 +757,8 @@ return wait_process_handle( package, type, handle, action ); } -static UINT HANDLE_CustomType17(MSIPACKAGE *package, LPCWSTR source, - LPCWSTR target, const INT type, LPCWSTR action) +static UINT HANDLE_CustomType17( MSIPACKAGE *package, const WCHAR *source, const WCHAR *target, + INT type, const WCHAR *action ) { msi_custom_action_info *info; MSIFILE *file; @@ -865,8 +776,8 @@ return wait_thread_handle( info ); } -static UINT HANDLE_CustomType18(MSIPACKAGE *package, LPCWSTR source, - LPCWSTR target, const INT type, LPCWSTR action) +static UINT HANDLE_CustomType18( MSIPACKAGE *package, const WCHAR *source, const WCHAR *target, + INT type, const WCHAR *action ) { MSIFILE *file; HANDLE handle; @@ -883,8 +794,8 @@ return wait_process_handle( package, type, handle, action ); } -static UINT HANDLE_CustomType19(MSIPACKAGE *package, LPCWSTR source, - LPCWSTR target, const INT type, LPCWSTR action) +static UINT HANDLE_CustomType19( MSIPACKAGE *package, const WCHAR *source, const WCHAR *target, + INT type, const WCHAR *action ) { static const WCHAR query[] = { 'S','E','L','E','C','T',' ','`','M','e','s','s','a','g','e','`',' ', @@ -914,8 +825,52 @@ return ERROR_INSTALL_FAILURE; } -static UINT HANDLE_CustomType50(MSIPACKAGE *package, LPCWSTR source, - LPCWSTR target, const INT type, LPCWSTR action) +static UINT HANDLE_CustomType23( MSIPACKAGE *package, const WCHAR *source, const WCHAR *target, + INT type, const WCHAR *action ) +{ + static const WCHAR msiexecW[] = {'m','s','i','e','x','e','c',0}; + static const WCHAR paramsW[] = {'/','q','b',' ','/','i',' '}; + WCHAR *dir, *arg, *p; + UINT len_src, len_dir, len_tgt, len = sizeof(paramsW)/sizeof(paramsW[0]); + HANDLE handle; + + if (!(dir = msi_dup_property( package->db, szOriginalDatabase ))) return ERROR_OUTOFMEMORY; + if (!(p = strrchrW( dir, '\\' )) && !(p = strrchrW( dir, '/' ))) + { + msi_free( dir ); + return ERROR_FUNCTION_FAILED; + } + *p = 0; + len_dir = p - dir; + len_src = strlenW( source ); + len_tgt = strlenW( target ); + if (!(arg = msi_alloc( (len + len_dir + len_src + len_tgt + 5) * sizeof(WCHAR) ))) + { + msi_free( dir ); + return ERROR_OUTOFMEMORY; + } + memcpy( arg, paramsW, sizeof(paramsW) ); + arg[len++] = '"'; + memcpy( arg + len, dir, len_dir * sizeof(WCHAR) ); + len += len_dir; + arg[len++] = '\\'; + memcpy( arg + len, source, len_src * sizeof(WCHAR) ); + len += len_src; + arg[len++] = '"'; + arg[len++] = ' '; + strcpyW( arg + len, target ); + + TRACE("installing %s concurrently\n", debugstr_w(source)); + + handle = execute_command( msiexecW, arg, dir ); + msi_free( dir ); + msi_free( arg ); + if (handle == INVALID_HANDLE_VALUE) return ERROR_SUCCESS; + return wait_process_handle( package, type, handle, action ); +} + +static UINT HANDLE_CustomType50( MSIPACKAGE *package, const WCHAR *source, const WCHAR *target, + INT type, const WCHAR *action ) { WCHAR *exe, *arg; HANDLE handle; @@ -931,8 +886,8 @@ return wait_process_handle( package, type, handle, action ); } -static UINT HANDLE_CustomType34(MSIPACKAGE *package, LPCWSTR source, - LPCWSTR target, const INT type, LPCWSTR action) +static UINT HANDLE_CustomType34( MSIPACKAGE *package, const WCHAR *source, const WCHAR *target, + INT type, const WCHAR *action ) { const WCHAR *workingdir = NULL; HANDLE handle; @@ -1032,8 +987,8 @@ return info; } -static UINT HANDLE_CustomType37_38(MSIPACKAGE *package, LPCWSTR source, - LPCWSTR target, const INT type, LPCWSTR action) +static UINT HANDLE_CustomType37_38( MSIPACKAGE *package, const WCHAR *source, const WCHAR *target, + INT type, const WCHAR *action ) { msi_custom_action_info *info; @@ -1043,8 +998,8 @@ return wait_thread_handle( info ); } -static UINT HANDLE_CustomType5_6(MSIPACKAGE *package, LPCWSTR source, - LPCWSTR target, const INT type, LPCWSTR action) +static UINT HANDLE_CustomType5_6( MSIPACKAGE *package, const WCHAR *source, const WCHAR *target, + INT type, const WCHAR *action ) { static const WCHAR query[] = { 'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ', @@ -1090,8 +1045,8 @@ return r; } -static UINT HANDLE_CustomType21_22(MSIPACKAGE *package, LPCWSTR source, - LPCWSTR target, const INT type, LPCWSTR action) +static UINT HANDLE_CustomType21_22( MSIPACKAGE *package, const WCHAR *source, const WCHAR *target, + INT type, const WCHAR *action ) { msi_custom_action_info *info; MSIFILE *file; @@ -1149,8 +1104,8 @@ return r; } -static UINT HANDLE_CustomType53_54(MSIPACKAGE *package, LPCWSTR source, - LPCWSTR target, const INT type, LPCWSTR action) +static UINT HANDLE_CustomType53_54( MSIPACKAGE *package, const WCHAR *source, const WCHAR *target, + INT type, const WCHAR *action ) { msi_custom_action_info *info; WCHAR *prop; Modified: trunk/reactos/dll/win32/msi/dialog.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msi/dialog.c?rev…
============================================================================== --- trunk/reactos/dll/win32/msi/dialog.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msi/dialog.c [iso-8859-1] Wed Apr 3 21:58:03 2013 @@ -696,7 +696,7 @@ else if ( !strcmpW( attribute, szProperty ) ) { MSIFEATURE *feature = msi_seltree_get_selected_feature( ctrl ); - msi_dialog_set_property( dialog->package, ctrl->property, feature->Directory ); + if (feature) msi_dialog_set_property( dialog->package, ctrl->property, feature->Directory ); } else if ( !strcmpW( attribute, szSelectionPath ) ) { @@ -1139,7 +1139,7 @@ msi_dialog_map_events(dialog, name); - control = msi_alloc( sizeof(*control) + strlenW(name) * sizeof(WCHAR) ); + control = msi_alloc( FIELD_OFFSET(msi_control, name[strlenW( name ) + 1] )); if (!control) return ERROR_OUTOFMEMORY; @@ -1808,7 +1808,6 @@ if( i == info->num_groups ) { TRACE("Set property %s to %s\n", debugstr_w(info->prop), debugstr_w(val)); - CharUpperBuffW( val, info->num_chars ); msi_dialog_set_property( info->dialog->package, info->prop, val ); msi_dialog_evaluate_control_conditions( info->dialog ); } @@ -3739,7 +3738,7 @@ msi_dialog_register_class(); /* allocate the structure for the dialog to use */ - dialog = msi_alloc_zero( sizeof *dialog + sizeof(WCHAR)*strlenW(szDialogName) ); + dialog = msi_alloc_zero( FIELD_OFFSET( msi_dialog, name[strlenW( szDialogName ) + 1] )); if( !dialog ) return NULL; strcpyW( dialog->name, szDialogName ); Modified: trunk/reactos/dll/win32/msi/files.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msi/files.c?rev=…
============================================================================== --- trunk/reactos/dll/win32/msi/files.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msi/files.c [iso-8859-1] Wed Apr 3 21:58:03 2013 @@ -447,6 +447,17 @@ FreeLibrary(hmspatcha); } +static MSIFILEPATCH *get_next_filepatch( MSIPACKAGE *package, const WCHAR *key ) +{ + MSIFILEPATCH *patch; + + LIST_FOR_EACH_ENTRY( patch, &package->filepatches, MSIFILEPATCH, entry ) + { + if (!patch->IsApplied && !strcmpW( key, patch->File->File )) return patch; + } + return NULL; +} + static BOOL patchfiles_cb(MSIPACKAGE *package, LPCWSTR file, DWORD action, LPWSTR *path, DWORD *attrs, PVOID user) { @@ -459,12 +470,9 @@ if (temp_folder[0] == '\0') GetTempPathW(MAX_PATH, temp_folder); - p = msi_get_loaded_filepatch(package, file); - if (!p) - { - TRACE("unknown file in cabinet (%s)\n", debugstr_w(file)); + if (!(p = get_next_filepatch(package, file)) || !p->File->Component->Enabled) return FALSE; - } + GetTempFileNameW(temp_folder, NULL, 0, patch_path); *path = strdupW(patch_path); Modified: trunk/reactos/dll/win32/msi/msi.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msi/msi.c?rev=58…
============================================================================== --- trunk/reactos/dll/win32/msi/msi.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msi/msi.c [iso-8859-1] Wed Apr 3 21:58:03 2013 @@ -2922,6 +2922,123 @@ return r; } +static UINT query_feature_state( const WCHAR *product, const WCHAR *squashed, const WCHAR *usersid, + MSIINSTALLCONTEXT ctx, const WCHAR *feature, INSTALLSTATE *state ) +{ + UINT r; + HKEY hkey; + WCHAR *parent, *components, *path; + const WCHAR *p; + BOOL missing = FALSE, source = FALSE; + WCHAR comp[GUID_SIZE]; + GUID guid; + + if (ctx != MSIINSTALLCONTEXT_MACHINE) SetLastError( ERROR_SUCCESS ); + + if (MSIREG_OpenFeaturesKey( product, usersid, ctx, &hkey, FALSE )) return ERROR_UNKNOWN_PRODUCT; + + parent = msi_reg_get_val_str( hkey, feature ); + RegCloseKey( hkey ); + if (!parent) return ERROR_UNKNOWN_FEATURE; + + *state = (parent[0] == 6) ? INSTALLSTATE_ABSENT : INSTALLSTATE_LOCAL; + msi_free( parent ); + if (*state == INSTALLSTATE_ABSENT) + return ERROR_SUCCESS; + + r = MSIREG_OpenUserDataFeaturesKey( product, usersid, ctx, &hkey, FALSE ); + if (r != ERROR_SUCCESS) + { + *state = INSTALLSTATE_ADVERTISED; + return ERROR_SUCCESS; + } + components = msi_reg_get_val_str( hkey, feature ); + RegCloseKey( hkey ); + + TRACE("buffer = %s\n", debugstr_w(components)); + + if (!components) + { + *state = INSTALLSTATE_ADVERTISED; + return ERROR_SUCCESS; + } + for (p = components; *p && *p != 2 ; p += 20) + { + if (!decode_base85_guid( p, &guid )) + { + if (p != components) break; + msi_free( components ); + *state = INSTALLSTATE_BADCONFIG; + return ERROR_BAD_CONFIGURATION; + } + StringFromGUID2( &guid, comp, GUID_SIZE ); + if (ctx == MSIINSTALLCONTEXT_MACHINE) + r = MSIREG_OpenUserDataComponentKey( comp, szLocalSid, &hkey, FALSE ); + else + r = MSIREG_OpenUserDataComponentKey( comp, usersid, &hkey, FALSE ); + + if (r != ERROR_SUCCESS) + { + msi_free( components ); + *state = INSTALLSTATE_ADVERTISED; + return ERROR_SUCCESS; + } + path = msi_reg_get_val_str( hkey, squashed ); + if (!path) missing = TRUE; + else if (strlenW( path ) > 2 && + path[0] >= '0' && path[0] <= '9' && + path[1] >= '0' && path[1] <= '9') + { + source = TRUE; + } + msi_free( path ); + } + msi_free( components ); + + if (missing) + *state = INSTALLSTATE_ADVERTISED; + else if (source) + *state = INSTALLSTATE_SOURCE; + else + *state = INSTALLSTATE_LOCAL; + + TRACE("returning state %d\n", *state); + return ERROR_SUCCESS; +} + +UINT WINAPI MsiQueryFeatureStateExA( LPCSTR product, LPCSTR usersid, MSIINSTALLCONTEXT ctx, + LPCSTR feature, INSTALLSTATE *state ) +{ + UINT r; + WCHAR *productW = NULL, *usersidW = NULL, *featureW = NULL; + + if (product && !(productW = strdupAtoW( product ))) return ERROR_OUTOFMEMORY; + if (usersid && !(usersidW = strdupAtoW( usersid ))) + { + msi_free( productW ); + return ERROR_OUTOFMEMORY; + } + if (feature && !(featureW = strdupAtoW( feature ))) + { + msi_free( productW ); + msi_free( usersidW ); + return ERROR_OUTOFMEMORY; + } + r = MsiQueryFeatureStateExW( productW, usersidW, ctx, featureW, state ); + msi_free( productW ); + msi_free( usersidW ); + msi_free( featureW ); + return r; +} + +UINT WINAPI MsiQueryFeatureStateExW( LPCWSTR product, LPCWSTR usersid, MSIINSTALLCONTEXT ctx, + LPCWSTR feature, INSTALLSTATE *state ) +{ + WCHAR squashed[33]; + if (!squash_guid( product, squashed )) return ERROR_INVALID_PARAMETER; + return query_feature_state( product, squashed, usersid, ctx, feature, state ); +} + /****************************************************************** * MsiQueryFeatureStateA [MSI.@] */ @@ -2966,117 +3083,25 @@ */ INSTALLSTATE WINAPI MsiQueryFeatureStateW(LPCWSTR szProduct, LPCWSTR szFeature) { - WCHAR squishProduct[33], comp[GUID_SIZE]; - GUID guid; - LPWSTR components, p, parent_feature, path; - UINT rc; - HKEY hkey; - INSTALLSTATE r; - BOOL missing = FALSE; - BOOL machine = FALSE; - BOOL source = FALSE; + UINT r; + INSTALLSTATE state; + WCHAR squashed[33]; TRACE("%s %s\n", debugstr_w(szProduct), debugstr_w(szFeature)); - if (!szProduct || !szFeature) + if (!szProduct || !szFeature || !squash_guid( szProduct, squashed )) return INSTALLSTATE_INVALIDARG; - if (!squash_guid( szProduct, squishProduct )) - return INSTALLSTATE_INVALIDARG; - - SetLastError( ERROR_SUCCESS ); - - if (MSIREG_OpenFeaturesKey(szProduct, MSIINSTALLCONTEXT_USERMANAGED, - &hkey, FALSE) != ERROR_SUCCESS && - MSIREG_OpenFeaturesKey(szProduct, MSIINSTALLCONTEXT_USERUNMANAGED, - &hkey, FALSE) != ERROR_SUCCESS) - { - rc = MSIREG_OpenFeaturesKey(szProduct, MSIINSTALLCONTEXT_MACHINE, - &hkey, FALSE); - if (rc != ERROR_SUCCESS) - return INSTALLSTATE_UNKNOWN; - - machine = TRUE; - } - - parent_feature = msi_reg_get_val_str( hkey, szFeature ); - RegCloseKey(hkey); - - if (!parent_feature) - return INSTALLSTATE_UNKNOWN; - - r = (parent_feature[0] == 6) ? INSTALLSTATE_ABSENT : INSTALLSTATE_LOCAL; - msi_free(parent_feature); - if (r == INSTALLSTATE_ABSENT) - return r; - - if (machine) - rc = MSIREG_OpenUserDataFeaturesKey(szProduct, - MSIINSTALLCONTEXT_MACHINE, - &hkey, FALSE); - else - rc = MSIREG_OpenUserDataFeaturesKey(szProduct, - MSIINSTALLCONTEXT_USERUNMANAGED, - &hkey, FALSE); - - if (rc != ERROR_SUCCESS) - return INSTALLSTATE_ADVERTISED; - - components = msi_reg_get_val_str( hkey, szFeature ); - RegCloseKey(hkey); - - TRACE("rc = %d buffer = %s\n", rc, debugstr_w(components)); - - if (!components) - return INSTALLSTATE_ADVERTISED; - - for( p = components; *p && *p != 2 ; p += 20) - { - if (!decode_base85_guid( p, &guid )) - { - if (p != components) - break; - - msi_free(components); - return INSTALLSTATE_BADCONFIG; - } - - StringFromGUID2(&guid, comp, GUID_SIZE); - - if (machine) - rc = MSIREG_OpenUserDataComponentKey(comp, szLocalSid, &hkey, FALSE); - else - rc = MSIREG_OpenUserDataComponentKey(comp, NULL, &hkey, FALSE); - - if (rc != ERROR_SUCCESS) - { - msi_free(components); - return INSTALLSTATE_ADVERTISED; - } - - path = msi_reg_get_val_str(hkey, squishProduct); - if (!path) - missing = TRUE; - else if (lstrlenW(path) > 2 && - path[0] >= '0' && path[0] <= '9' && - path[1] >= '0' && path[1] <= '9') - { - source = TRUE; - } - - msi_free(path); - } - msi_free(components); - - if (missing) - r = INSTALLSTATE_ADVERTISED; - else if (source) - r = INSTALLSTATE_SOURCE; - else - r = INSTALLSTATE_LOCAL; - - TRACE("-> %d\n", r); - return r; + r = query_feature_state( szProduct, squashed, NULL, MSIINSTALLCONTEXT_USERMANAGED, szFeature, &state ); + if (r == ERROR_SUCCESS || r == ERROR_BAD_CONFIGURATION) return state; + + r = query_feature_state( szProduct, squashed, NULL, MSIINSTALLCONTEXT_USERUNMANAGED, szFeature, &state ); + if (r == ERROR_SUCCESS || r == ERROR_BAD_CONFIGURATION) return state; + + r = query_feature_state( szProduct, squashed, NULL, MSIINSTALLCONTEXT_MACHINE, szFeature, &state ); + if (r == ERROR_SUCCESS || r == ERROR_BAD_CONFIGURATION) return state; + + return INSTALLSTATE_UNKNOWN; } /****************************************************************** @@ -3137,7 +3162,7 @@ static const WCHAR szVersionResource[] = {'\\',0}; static const WCHAR szVersionFormat[] = {'%','d','.','%','d','.','%','d','.','%','d',0}; static const WCHAR szLangFormat[] = {'%','d',0}; - UINT ret = ERROR_SUCCESS; + UINT ret = ERROR_MORE_DATA; DWORD len, error; LPVOID version; VS_FIXEDFILEINFO *ffi; @@ -3148,6 +3173,7 @@ { error = GetLastError(); if (error == ERROR_BAD_PATHNAME) return ERROR_FILE_NOT_FOUND; + if (error == ERROR_RESOURCE_DATA_NOT_FOUND) return ERROR_FILE_INVALID; return error; } if (!(version = msi_alloc( len ))) return ERROR_OUTOFMEMORY; @@ -3155,6 +3181,11 @@ { msi_free( version ); return GetLastError(); + } + if (!verbuf && !verlen && !langbuf && !langlen) + { + msi_free( version ); + return ERROR_SUCCESS; } if (verlen) { @@ -3165,7 +3196,7 @@ HIWORD(ffi->dwFileVersionLS), LOWORD(ffi->dwFileVersionLS) ); if (verbuf) lstrcpynW( verbuf, tmp, *verlen ); len = strlenW( tmp ); - if (len >= *verlen) ret = ERROR_MORE_DATA; + if (*verlen > len) ret = ERROR_SUCCESS; *verlen = len; } else @@ -3181,7 +3212,7 @@ sprintfW( tmp, szLangFormat, *lang ); if (langbuf) lstrcpynW( langbuf, tmp, *langlen ); len = strlenW( tmp ); - if (len >= *langlen) ret = ERROR_MORE_DATA; + if (*langlen > len) ret = ERROR_SUCCESS; *langlen = len; } else @@ -3789,7 +3820,7 @@ lstrcatW(path, installerW); - if (!CreateDirectoryW(path, NULL)) + if (!CreateDirectoryW(path, NULL) && GetLastError() != ERROR_ALREADY_EXISTS) return ERROR_FUNCTION_FAILED; return ERROR_SUCCESS; Modified: trunk/reactos/dll/win32/msi/msi.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msi/msi.spec?rev…
============================================================================== --- trunk/reactos/dll/win32/msi/msi.spec [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msi/msi.spec [iso-8859-1] Wed Apr 3 21:58:03 2013 @@ -244,8 +244,8 @@ 248 stdcall MsiGetProductInfoExW(wstr wstr long wstr ptr ptr) 249 stdcall MsiQueryComponentStateA(str str long str ptr) 250 stdcall MsiQueryComponentStateW(wstr wstr long wstr ptr) -251 stub MsiQueryFeatureStateExA -252 stub MsiQueryFeatureStateExW +251 stdcall MsiQueryFeatureStateExA(str str long str ptr) +252 stdcall MsiQueryFeatureStateExW(wstr wstr long wstr ptr) 253 stdcall MsiDeterminePatchSequenceA(str str long long ptr) 254 stdcall MsiDeterminePatchSequenceW(wstr wstr long long ptr) 255 stdcall MsiSourceListAddSourceExA(str str long long str long) Modified: trunk/reactos/dll/win32/msi/msipriv.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msi/msipriv.h?re…
============================================================================== --- trunk/reactos/dll/win32/msi/msipriv.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msi/msipriv.h [iso-8859-1] Wed Apr 3 21:58:03 2013 @@ -338,6 +338,7 @@ enum platform { + PLATFORM_UNKNOWN, PLATFORM_INTEL, PLATFORM_INTEL64, PLATFORM_X64, @@ -414,6 +415,7 @@ unsigned char need_reboot_at_end : 1; unsigned char need_reboot_now : 1; unsigned char need_rollback : 1; + unsigned char full_reinstall : 1; } MSIPACKAGE; typedef struct tagMSIPREVIEW @@ -884,10 +886,10 @@ extern UINT MSIREG_DeleteUninstallKey(const WCHAR *, enum platform) DECLSPEC_HIDDEN; extern UINT MSIREG_OpenProductKey(LPCWSTR szProduct, LPCWSTR szUserSid, MSIINSTALLCONTEXT context, HKEY* key, BOOL create) DECLSPEC_HIDDEN; -extern UINT MSIREG_OpenFeaturesKey(LPCWSTR szProduct, MSIINSTALLCONTEXT context, +extern UINT MSIREG_OpenFeaturesKey(LPCWSTR szProduct, LPCWSTR szUserSid, MSIINSTALLCONTEXT context, HKEY *key, BOOL create) DECLSPEC_HIDDEN; extern UINT MSIREG_OpenUserPatchesKey(LPCWSTR szPatch, HKEY* key, BOOL create) DECLSPEC_HIDDEN; -UINT MSIREG_OpenUserDataFeaturesKey(LPCWSTR szProduct, MSIINSTALLCONTEXT context, +UINT MSIREG_OpenUserDataFeaturesKey(LPCWSTR szProduct, LPCWSTR szUserSid, MSIINSTALLCONTEXT context, HKEY *key, BOOL create) DECLSPEC_HIDDEN; extern UINT MSIREG_OpenUserComponentsKey(LPCWSTR szComponent, HKEY* key, BOOL create) DECLSPEC_HIDDEN; extern UINT MSIREG_OpenUserDataComponentKey(LPCWSTR szComponent, LPCWSTR szUserSid, @@ -1016,7 +1018,6 @@ extern MSICOMPONENT *msi_get_loaded_component(MSIPACKAGE *package, const WCHAR *Component) DECLSPEC_HIDDEN; extern MSIFEATURE *msi_get_loaded_feature(MSIPACKAGE *package, const WCHAR *Feature) DECLSPEC_HIDDEN; extern MSIFILE *msi_get_loaded_file(MSIPACKAGE *package, const WCHAR *file) DECLSPEC_HIDDEN; -extern MSIFILEPATCH *msi_get_loaded_filepatch(MSIPACKAGE* package, const WCHAR *key) DECLSPEC_HIDDEN; extern MSIFOLDER *msi_get_loaded_folder(MSIPACKAGE *package, const WCHAR *dir) DECLSPEC_HIDDEN; extern int msi_track_tempfile(MSIPACKAGE *package, const WCHAR *path) DECLSPEC_HIDDEN; extern void msi_free_action_script(MSIPACKAGE *package, UINT script) DECLSPEC_HIDDEN; @@ -1040,6 +1041,7 @@ extern void msi_destroy_assembly_caches(MSIPACKAGE *) DECLSPEC_HIDDEN; extern WCHAR *msi_font_version_from_file(const WCHAR *) DECLSPEC_HIDDEN; extern WCHAR **msi_split_string(const WCHAR *, WCHAR) DECLSPEC_HIDDEN; +extern UINT msi_set_original_database_property(MSIDATABASE *, const WCHAR *) DECLSPEC_HIDDEN; /* media */ Modified: trunk/reactos/dll/win32/msi/package.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msi/package.c?re…
============================================================================== --- trunk/reactos/dll/win32/msi/package.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msi/package.c [iso-8859-1] Wed Apr 3 21:58:03 2013 @@ -158,7 +158,6 @@ static void free_package_structures( MSIPACKAGE *package ) { - INT i; struct list *item, *cursor; LIST_FOR_EACH_SAFE( item, cursor, &package->features ) @@ -287,11 +286,14 @@ if (package->script) { + INT i; + UINT j; + for (i = 0; i < SCRIPT_MAX; i++) msi_free_action_script( package, i ); - for (i = 0; i < package->script->UniqueActionsCount; i++) - msi_free( package->script->UniqueActions[i] ); + for (j = 0; j < package->script->UniqueActionsCount; j++) + msi_free( package->script->UniqueActions[j] ); msi_free( package->script->UniqueActions ); msi_free( package->script ); @@ -753,6 +755,8 @@ static const WCHAR szPrintHoodFolder[] = {'P','r','i','n','t','H','o','o','d','F','o','l','d','e','r',0}; static const WCHAR szRecentFolder[] = {'R','e','c','e','n','t','F','o','l','d','e','r',0}; static const WCHAR szComputerName[] = {'C','o','m','p','u','t','e','r','N','a','m','e',0}; + static const WCHAR szBrowseProperty[] = {'_','B','r','o','w','s','e','P','r','o','p','e','r','t','y',0}; + static const WCHAR szInstallDir[] = {'I','N','S','T','A','L','L','D','I','R',0}; /* * Other things that probably should be set: @@ -1024,6 +1028,7 @@ msi_free( computername ); } } + msi_set_property( package->db, szBrowseProperty, szInstallDir, -1 ); } static UINT msi_load_summary_properties( MSIPACKAGE *package ) @@ -1270,9 +1275,18 @@ return ERROR_SUCCESS; } +static enum platform parse_platform( WCHAR *str ) +{ + if (!str[0] || !strcmpW( str, szIntel )) return PLATFORM_INTEL; + else if (!strcmpW( str, szIntel64 )) return PLATFORM_INTEL64; + else if (!strcmpW( str, szX64 ) || !strcmpW( str, szAMD64 )) return PLATFORM_X64; + else if (!strcmpW( str, szARM )) return PLATFORM_ARM; + return PLATFORM_UNKNOWN; +} + static UINT msi_parse_summary( MSISUMMARYINFO *si, MSIPACKAGE *package ) { - WCHAR *template, *p, *q; + WCHAR *template, *p, *q, *platform; DWORD i, count; package->version = msi_suminfo_get_int32( si, PID_PAGECOUNT ); @@ -1292,16 +1306,16 @@ return ERROR_PATCH_PACKAGE_INVALID; } *p = 0; - if ((q = strchrW( template, ',' ))) *q = 0; - if (!template[0] || !strcmpW( template, szIntel )) - package->platform = PLATFORM_INTEL; - else if (!strcmpW( template, szIntel64 )) - package->platform = PLATFORM_INTEL64; - else if (!strcmpW( template, szX64 ) || !strcmpW( template, szAMD64 )) - package->platform = PLATFORM_X64; - else if (!strcmpW( template, szARM )) - package->platform = PLATFORM_ARM; - else + platform = template; + if ((q = strchrW( platform, ',' ))) *q = 0; + package->platform = parse_platform( platform ); + while (package->platform == PLATFORM_UNKNOWN && q) + { + platform = q + 1; + if ((q = strchrW( platform, ',' ))) *q = 0; + package->platform = parse_platform( platform ); + } + if (package->platform == PLATFORM_UNKNOWN) { WARN("unknown platform %s\n", debugstr_w(template)); msi_free( template ); @@ -1511,6 +1525,28 @@ msi_free( package_code ); msi_free( product_code ); msiobj_release( &db->hdr ); + return r; +} + +UINT msi_set_original_database_property( MSIDATABASE *db, const WCHAR *package ) +{ + UINT r; + + if (UrlIsW( package, URLIS_URL )) + r = msi_set_property( db, szOriginalDatabase, package, -1 ); + else if (package[0] == '#') + r = msi_set_property( db, szOriginalDatabase, db->path, -1 ); + else + { + DWORD len; + WCHAR *path; + + if (!(len = GetFullPathNameW( package, 0, NULL, NULL ))) return GetLastError(); + if (!(path = msi_alloc( len * sizeof(WCHAR) ))) return ERROR_OUTOFMEMORY; + len = GetFullPathNameW( package, len, path, NULL ); + r = msi_set_property( db, szOriginalDatabase, path, len ); + msi_free( path ); + } return r; } @@ -1623,17 +1659,6 @@ return r; } msi_set_property( package->db, szDatabase, db->path, -1 ); - - if( UrlIsW( szPackage, URLIS_URL ) ) - msi_set_property( package->db, szOriginalDatabase, szPackage, -1 ); - else if( szPackage[0] == '#' ) - msi_set_property( package->db, szOriginalDatabase, db->path, -1 ); - else - { - WCHAR fullpath[MAX_PATH]; - DWORD len = GetFullPathNameW( szPackage, MAX_PATH, fullpath, NULL ); - msi_set_property( package->db, szOriginalDatabase, fullpath, len ); - } msi_set_context( package ); while (1) @@ -1659,6 +1684,12 @@ { msi_clone_properties( package ); msi_adjust_privilege_properties( package ); + } + r = msi_set_original_database_property( package->db, szPackage ); + if (r != ERROR_SUCCESS) + { + msiobj_release( &package->hdr ); + return r; } if (gszLogFile) package->log_file = CreateFileW( gszLogFile, GENERIC_WRITE, FILE_SHARE_WRITE, NULL, Modified: trunk/reactos/dll/win32/msi/record.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msi/record.c?rev…
============================================================================== --- trunk/reactos/dll/win32/msi/record.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msi/record.c [iso-8859-1] Wed Apr 3 21:58:03 2013 @@ -83,15 +83,14 @@ MSIRECORD *MSI_CreateRecord( UINT cParams ) { MSIRECORD *rec; - UINT len; TRACE("%d\n", cParams); if( cParams>65535 ) return NULL; - len = sizeof (MSIRECORD) + sizeof (MSIFIELD)*cParams; - rec = alloc_msiobject( MSIHANDLETYPE_RECORD, len, MSI_CloseRecord ); + rec = alloc_msiobject( MSIHANDLETYPE_RECORD, FIELD_OFFSET(MSIRECORD, fields[cParams + 1]), + MSI_CloseRecord ); if( rec ) rec->count = cParams; return rec; Modified: trunk/reactos/dll/win32/msi/registry.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msi/registry.c?r…
============================================================================== --- trunk/reactos/dll/win32/msi/registry.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msi/registry.c [iso-8859-1] Wed Apr 3 21:58:03 2013 @@ -566,12 +566,12 @@ return RegOpenKeyW(HKEY_CURRENT_USER, keypath, key); } -UINT MSIREG_OpenFeaturesKey(LPCWSTR szProduct, MSIINSTALLCONTEXT context, HKEY *key, BOOL create) -{ - LPWSTR usersid; +UINT MSIREG_OpenFeaturesKey(LPCWSTR szProduct, LPCWSTR szUserSid, MSIINSTALLCONTEXT context, + HKEY *key, BOOL create) +{ HKEY root = HKEY_LOCAL_MACHINE; REGSAM access = KEY_WOW64_64KEY | KEY_ALL_ACCESS; - WCHAR squished_pc[GUID_SIZE], keypath[MAX_PATH]; + WCHAR squished_pc[GUID_SIZE], keypath[MAX_PATH], *usersid = NULL; if (!squash_guid(szProduct, squished_pc)) return ERROR_FUNCTION_FAILED; TRACE("%s squished %s\n", debugstr_w(szProduct), debugstr_w(squished_pc)); @@ -589,12 +589,16 @@ } else { - if (!(usersid = get_user_sid())) - { - ERR("Failed to retrieve user SID\n"); - return ERROR_FUNCTION_FAILED; - } - sprintfW(keypath, szInstaller_LocalManagedFeat_fmt, usersid, squished_pc); + if (!szUserSid) + { + if (!(usersid = get_user_sid())) + { + ERR("Failed to retrieve user SID\n"); + return ERROR_FUNCTION_FAILED; + } + szUserSid = usersid; + } + sprintfW(keypath, szInstaller_LocalManagedFeat_fmt, szUserSid, squished_pc); LocalFree(usersid); } if (create) return RegCreateKeyExW(root, keypath, 0, NULL, 0, access, NULL, key, NULL); @@ -628,11 +632,11 @@ return RegOpenKeyExW(HKEY_LOCAL_MACHINE, keypath, 0, access, key); } -UINT MSIREG_OpenUserDataFeaturesKey(LPCWSTR szProduct, MSIINSTALLCONTEXT context, HKEY *key, BOOL create) -{ - LPWSTR usersid; +UINT MSIREG_OpenUserDataFeaturesKey(LPCWSTR szProduct, LPCWSTR szUserSid, MSIINSTALLCONTEXT context, + HKEY *key, BOOL create) +{ REGSAM access = KEY_WOW64_64KEY | KEY_ALL_ACCESS; - WCHAR squished_pc[GUID_SIZE], keypath[0x200]; + WCHAR squished_pc[GUID_SIZE], keypath[0x200], *usersid = NULL; if (!squash_guid(szProduct, squished_pc)) return ERROR_FUNCTION_FAILED; TRACE("%s squished %s\n", debugstr_w(szProduct), debugstr_w(squished_pc)); @@ -643,12 +647,16 @@ } else { - if (!(usersid = get_user_sid())) - { - ERR("Failed to retrieve user SID\n"); - return ERROR_FUNCTION_FAILED; - } - sprintfW(keypath, szUserDataFeatures_fmt, usersid, squished_pc); + if (!szUserSid) + { + if (!(usersid = get_user_sid())) + { + ERR("Failed to retrieve user SID\n"); + return ERROR_FUNCTION_FAILED; + } + szUserSid = usersid; + } + sprintfW(keypath, szUserDataFeatures_fmt, szUserSid, squished_pc); LocalFree(usersid); } if (create) return RegCreateKeyExW(HKEY_LOCAL_MACHINE, keypath, 0, NULL, 0, access, NULL, key, NULL); Modified: trunk/reactos/dll/win32/msi/streams.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msi/streams.c?re…
============================================================================== --- trunk/reactos/dll/win32/msi/streams.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msi/streams.c [iso-8859-1] Wed Apr 3 21:58:03 2013 @@ -204,6 +204,7 @@ if (FAILED(hr)) { WARN("failed to open stream: %08x\n", hr); + msi_free(stream); goto done; } Modified: trunk/reactos/dll/win32/msi/suminfo.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msi/suminfo.c?re…
============================================================================== --- trunk/reactos/dll/win32/msi/suminfo.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msi/suminfo.c [iso-8859-1] Wed Apr 3 21:58:03 2013 @@ -928,7 +928,7 @@ UINT msi_add_suminfo( MSIDATABASE *db, LPWSTR **records, int num_records, int num_columns ) { UINT r = ERROR_FUNCTION_FAILED; - DWORD i, j; + int i, j; MSISUMMARYINFO *si; si = MSI_GetSummaryInformationW( db->storage, num_records * (num_columns / 2) ); Modified: trunk/reactos/dll/win32/msi/where.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msi/where.c?rev=…
============================================================================== --- trunk/reactos/dll/win32/msi/where.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msi/where.c [iso-8859-1] Wed Apr 3 21:58:03 2013 @@ -774,7 +774,7 @@ JOINTABLE *table = wv->tables; UINT *rows; JOINTABLE **ordered_tables; - int i = 0; + UINT i = 0; TRACE("%p %p\n", wv, record); @@ -1056,7 +1056,7 @@ column_info *column = columns; MSIORDERINFO *orderinfo; UINT r, count = 0; - int i; + UINT i; TRACE("%p %p\n", view, columns); @@ -1072,7 +1072,7 @@ if (count == 0) return ERROR_SUCCESS; - orderinfo = msi_alloc(sizeof(MSIORDERINFO) + (count - 1) * sizeof(union ext_column)); + orderinfo = msi_alloc(FIELD_OFFSET(MSIORDERINFO, columns[count])); if (!orderinfo) return ERROR_OUTOFMEMORY; Modified: trunk/reactos/include/psdk/msi.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/msi.h?rev=586…
============================================================================== --- trunk/reactos/include/psdk/msi.h [iso-8859-1] (original) +++ trunk/reactos/include/psdk/msi.h [iso-8859-1] Wed Apr 3 21:58:03 2013 @@ -539,6 +539,10 @@ INSTALLSTATE WINAPI MsiQueryFeatureStateW(LPCWSTR, LPCWSTR); #define MsiQueryFeatureState WINELIB_NAME_AW(MsiQueryFeatureState) +UINT WINAPI MsiQueryFeatureStateExA(LPCSTR, LPCSTR, MSIINSTALLCONTEXT, LPCSTR, INSTALLSTATE*); +UINT WINAPI MsiQueryFeatureStateExW(LPCWSTR, LPCWSTR, MSIINSTALLCONTEXT, LPCWSTR, INSTALLSTATE*); +#define MsiQueryFeatureStateEx WINELIB_NAME_AW(MsiQueryFeatureStateEx) + UINT WINAPI MsiGetFeatureInfoA(MSIHANDLE, LPCSTR, LPDWORD, LPSTR, LPDWORD, LPSTR, LPDWORD); UINT WINAPI MsiGetFeatureInfoW(MSIHANDLE, LPCWSTR, LPDWORD, LPWSTR, LPDWORD, LPWSTR, LPDWORD); #define MsiGetFeatureInfo WINELIB_NAME_AW(MsiGetFeatureInfo) Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Wed Apr 3 21:58:03 2013 @@ -104,7 +104,7 @@ reactos/dll/win32/msgsm32.acm # Synced to Wine-1.5.4 reactos/dll/win32/mshtml # Autosync reactos/dll/win32/mshtml.tlb # Synced to Wine-1.5.19 -reactos/dll/win32/msi # Synced to Wine-1.5.19 +reactos/dll/win32/msi # Synced to Wine-1.5.26 reactos/dll/win32/msimg32 # Synced to Wine-1.5.19 reactos/dll/win32/msimtf # Synced to Wine-1.5.19 reactos/dll/win32/msisip # Synced to Wine-1.5.19
11 years, 8 months
1
0
0
0
[akhaldi] 58664: [JSCRIPT_WINETEST] * Sync with Wine 1.5.26.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Wed Apr 3 21:20:05 2013 New Revision: 58664 URL:
http://svn.reactos.org/svn/reactos?rev=58664&view=rev
Log: [JSCRIPT_WINETEST] * Sync with Wine 1.5.26. Added: trunk/rostests/winetests/jscript/caller.c (with props) trunk/rostests/winetests/jscript/cc.js (with props) Modified: trunk/rostests/winetests/jscript/CMakeLists.txt trunk/rostests/winetests/jscript/activex.c trunk/rostests/winetests/jscript/api.js trunk/rostests/winetests/jscript/jscript.c trunk/rostests/winetests/jscript/lang.js trunk/rostests/winetests/jscript/regexp.js trunk/rostests/winetests/jscript/rsrc.rc trunk/rostests/winetests/jscript/run.c trunk/rostests/winetests/jscript/testlist.c [This mail would be too long, it was shortened to contain the URLs only.] Modified: trunk/rostests/winetests/jscript/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/jscript/CMakeLi…
Modified: trunk/rostests/winetests/jscript/activex.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/jscript/activex…
Modified: trunk/rostests/winetests/jscript/api.js URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/jscript/api.js?…
Added: trunk/rostests/winetests/jscript/caller.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/jscript/caller.…
Added: trunk/rostests/winetests/jscript/cc.js URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/jscript/cc.js?r…
Modified: trunk/rostests/winetests/jscript/jscript.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/jscript/jscript…
Modified: trunk/rostests/winetests/jscript/lang.js URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/jscript/lang.js…
Modified: trunk/rostests/winetests/jscript/regexp.js URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/jscript/regexp.…
Modified: trunk/rostests/winetests/jscript/rsrc.rc URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/jscript/rsrc.rc…
Modified: trunk/rostests/winetests/jscript/run.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/jscript/run.c?r…
Modified: trunk/rostests/winetests/jscript/testlist.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/jscript/testlis…
11 years, 8 months
1
0
0
0
[akhaldi] 58663: [JSCRIPT] * Sync with Wine 1.5.26. CORE-7049
by akhaldi@svn.reactos.org
Author: akhaldi Date: Wed Apr 3 21:19:50 2013 New Revision: 58663 URL:
http://svn.reactos.org/svn/reactos?rev=58663&view=rev
Log: [JSCRIPT] * Sync with Wine 1.5.26. CORE-7049 Added: trunk/reactos/dll/win32/jscript/compile.c (with props) trunk/reactos/dll/win32/jscript/decode.c (with props) trunk/reactos/dll/win32/jscript/jscript.rc (with props) trunk/reactos/dll/win32/jscript/jscript.rgs (with props) trunk/reactos/dll/win32/jscript/jscript_classes.idl (with props) trunk/reactos/dll/win32/jscript/jscript_classes.rgs (with props) trunk/reactos/dll/win32/jscript/jsregexp.c (with props) trunk/reactos/dll/win32/jscript/jsstr.c (with props) trunk/reactos/dll/win32/jscript/jsstr.h (with props) trunk/reactos/dll/win32/jscript/jsval.h (with props) trunk/reactos/dll/win32/jscript/regexp.h (with props) trunk/reactos/dll/win32/jscript/vbarray.c (with props) Removed: trunk/reactos/dll/win32/jscript/jscript.inf Modified: trunk/reactos/dll/win32/jscript/CMakeLists.txt trunk/reactos/dll/win32/jscript/activex.c trunk/reactos/dll/win32/jscript/array.c trunk/reactos/dll/win32/jscript/bool.c trunk/reactos/dll/win32/jscript/date.c trunk/reactos/dll/win32/jscript/dispex.c trunk/reactos/dll/win32/jscript/engine.c trunk/reactos/dll/win32/jscript/engine.h trunk/reactos/dll/win32/jscript/error.c trunk/reactos/dll/win32/jscript/function.c trunk/reactos/dll/win32/jscript/global.c trunk/reactos/dll/win32/jscript/jscript.c trunk/reactos/dll/win32/jscript/jscript.h trunk/reactos/dll/win32/jscript/jscript_main.c trunk/reactos/dll/win32/jscript/jsutils.c trunk/reactos/dll/win32/jscript/lex.c trunk/reactos/dll/win32/jscript/math.c trunk/reactos/dll/win32/jscript/number.c trunk/reactos/dll/win32/jscript/object.c trunk/reactos/dll/win32/jscript/parser.tab.c trunk/reactos/dll/win32/jscript/parser.tab.h trunk/reactos/dll/win32/jscript/parser.y trunk/reactos/dll/win32/jscript/regexp.c trunk/reactos/dll/win32/jscript/resource.h trunk/reactos/dll/win32/jscript/rsrc.rc trunk/reactos/dll/win32/jscript/string.c trunk/reactos/media/doc/README.WINE [This mail would be too long, it was shortened to contain the URLs only.] Modified: trunk/reactos/dll/win32/jscript/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/CMakeLis…
Modified: trunk/reactos/dll/win32/jscript/activex.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/activex.…
Modified: trunk/reactos/dll/win32/jscript/array.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/array.c?…
Modified: trunk/reactos/dll/win32/jscript/bool.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/bool.c?r…
Added: trunk/reactos/dll/win32/jscript/compile.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/compile.…
Modified: trunk/reactos/dll/win32/jscript/date.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/date.c?r…
Added: trunk/reactos/dll/win32/jscript/decode.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/decode.c…
Modified: trunk/reactos/dll/win32/jscript/dispex.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/dispex.c…
Modified: trunk/reactos/dll/win32/jscript/engine.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/engine.c…
Modified: trunk/reactos/dll/win32/jscript/engine.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/engine.h…
Modified: trunk/reactos/dll/win32/jscript/error.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/error.c?…
Modified: trunk/reactos/dll/win32/jscript/function.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/function…
Modified: trunk/reactos/dll/win32/jscript/global.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/global.c…
Modified: trunk/reactos/dll/win32/jscript/jscript.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/jscript.…
Modified: trunk/reactos/dll/win32/jscript/jscript.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/jscript.…
Removed: trunk/reactos/dll/win32/jscript/jscript.inf URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/jscript.…
Added: trunk/reactos/dll/win32/jscript/jscript.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/jscript.…
Added: trunk/reactos/dll/win32/jscript/jscript.rgs URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/jscript.…
Added: trunk/reactos/dll/win32/jscript/jscript_classes.idl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/jscript_…
Added: trunk/reactos/dll/win32/jscript/jscript_classes.rgs URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/jscript_…
Modified: trunk/reactos/dll/win32/jscript/jscript_main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/jscript_…
Added: trunk/reactos/dll/win32/jscript/jsregexp.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/jsregexp…
Added: trunk/reactos/dll/win32/jscript/jsstr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/jsstr.c?…
Added: trunk/reactos/dll/win32/jscript/jsstr.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/jsstr.h?…
Modified: trunk/reactos/dll/win32/jscript/jsutils.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/jsutils.…
Added: trunk/reactos/dll/win32/jscript/jsval.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/jsval.h?…
Modified: trunk/reactos/dll/win32/jscript/lex.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/lex.c?re…
Modified: trunk/reactos/dll/win32/jscript/math.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/math.c?r…
Modified: trunk/reactos/dll/win32/jscript/number.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/number.c…
Modified: trunk/reactos/dll/win32/jscript/object.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/object.c…
Modified: trunk/reactos/dll/win32/jscript/parser.tab.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/parser.t…
Modified: trunk/reactos/dll/win32/jscript/parser.tab.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/parser.t…
Modified: trunk/reactos/dll/win32/jscript/parser.y URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/parser.y…
Modified: trunk/reactos/dll/win32/jscript/regexp.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/regexp.c…
Added: trunk/reactos/dll/win32/jscript/regexp.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/regexp.h…
Modified: trunk/reactos/dll/win32/jscript/resource.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/resource…
Modified: trunk/reactos/dll/win32/jscript/rsrc.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/rsrc.rc?…
Modified: trunk/reactos/dll/win32/jscript/string.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/string.c…
Added: trunk/reactos/dll/win32/jscript/vbarray.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/vbarray.…
Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
11 years, 8 months
1
0
0
0
[akhaldi] 58662: [PSDK] * Import DEFAULT_UNREACHABLE from Wine.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Wed Apr 3 21:16:57 2013 New Revision: 58662 URL:
http://svn.reactos.org/svn/reactos?rev=58662&view=rev
Log: [PSDK] * Import DEFAULT_UNREACHABLE from Wine. Modified: trunk/reactos/include/psdk/winnt.h Modified: trunk/reactos/include/psdk/winnt.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/winnt.h?rev=5…
============================================================================== --- trunk/reactos/include/psdk/winnt.h [iso-8859-1] (original) +++ trunk/reactos/include/psdk/winnt.h [iso-8859-1] Wed Apr 3 21:16:57 2013 @@ -415,6 +415,15 @@ typedef DWORD FLONG; #define C_ASSERT(expr) extern char (*c_assert(void)) [(expr) ? 1 : -1] + +/* Eliminate Microsoft C/C++ compiler warning 4715 */ +#if defined(_MSC_VER) && (_MSC_VER > 1200) +# define DEFAULT_UNREACHABLE default: __assume(0) +#elif defined(__clang__) || (defined(__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)))) +# define DEFAULT_UNREACHABLE default: __builtin_unreachable() +#else +# define DEFAULT_UNREACHABLE default: +#endif #include "intrin.h"
11 years, 8 months
1
0
0
0
[gadamopoulos] 58661: - Fix some tests for OpenInputDesktop and add some more
by gadamopoulos@svn.reactos.org
Author: gadamopoulos Date: Wed Apr 3 14:23:02 2013 New Revision: 58661 URL:
http://svn.reactos.org/svn/reactos?rev=58661&view=rev
Log: - Fix some tests for OpenInputDesktop and add some more Modified: trunk/rostests/apitests/user32/desktop.c Modified: trunk/rostests/apitests/user32/desktop.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/user32/desktop.c…
============================================================================== --- trunk/rostests/apitests/user32/desktop.c [iso-8859-1] (original) +++ trunk/rostests/apitests/user32/desktop.c [iso-8859-1] Wed Apr 3 14:23:02 2013 @@ -27,7 +27,8 @@ {NULL, NULL}, {NULL, NULL}, {L"WinSta0",L"Default"}, - {L"TestWinsta", L"TestDesktop"}}; + {L"TestWinsta", L"TestDesktop"}, + {NULL, NULL}}; void do_InitialDesktop_child(int i) { @@ -129,7 +130,16 @@ test_CreateProcessWithDesktop(7, argv0, NULL, 0); test_CreateProcessWithDesktop(8, argv0, "TestWinsta\\TestDesktop", 0); - test_CreateProcessWithDesktop(8, argv0, "NonExistantWinsta\\NonExistantDesktop", 0); + test_CreateProcessWithDesktop(8, argv0, "NonExistantWinsta\\NonExistantDesktop", STATUS_DLL_INIT_FAILED); + + ret = SetProcessWindowStation(hwinstaInitial); + ok(ret != 0, "SetProcessWindowStation failed\n"); + + ret = CloseDesktop(hdesktop); + ok(ret != 0, "CloseDesktop failed\n"); + + ret = CloseWindowStation(hwinsta); + ok(ret != 0, "CloseWindowStation failed\n"); } void Test_OpenInputDesktop() @@ -137,6 +147,8 @@ HDESK hDeskInput ,hDeskInput2; HDESK hDeskInitial; BOOL ret; + HWINSTA hwinsta = NULL, hwinstaInitial; + DWORD err; hDeskInput = OpenInputDesktop(0, FALSE, DESKTOP_ALL_ACCESS); ok(hDeskInput != NULL, "OpenInputDesktop failed\n"); @@ -157,6 +169,29 @@ ok(ret == TRUE, "SetThreadDesktop for initial desktop failed\n"); ok(CloseDesktop(hDeskInput) != 0, "CloseDesktop failed\n"); + + /* Try calling OpenInputDesktop after switching to a new winsta */ + hwinstaInitial = GetProcessWindowStation(); + ok(hwinstaInitial != 0, "GetProcessWindowStation failed\n"); + + hwinsta = CreateWindowStationW(L"TestWinsta", 0, WINSTA_ALL_ACCESS, NULL); + ok(hwinsta != 0, "CreateWindowStationW failed\n"); + + ret = SetProcessWindowStation(hwinsta); + ok(ret != 0, "SetProcessWindowStation failed\n"); + + hDeskInput = OpenInputDesktop(0, FALSE, DESKTOP_ALL_ACCESS); + ok(hDeskInput == 0, "OpenInputDesktop should fail\n"); + + err = GetLastError(); + ok(err == ERROR_INVALID_FUNCTION, "Got last error: %lu\n", err); + + ret = SetProcessWindowStation(hwinstaInitial); + ok(ret != 0, "SetProcessWindowStation failed\n"); + + ret = CloseWindowStation(hwinsta); + ok(ret != 0, "CloseWindowStation failed\n"); + } START_TEST(desktop)
11 years, 8 months
1
0
0
0
[jgardou] 58660: [MESA32] * Disable SSE optimizations, as they only cause mayhem.
by jgardou@svn.reactos.org
Author: jgardou Date: Wed Apr 3 12:02:58 2013 New Revision: 58660 URL:
http://svn.reactos.org/svn/reactos?rev=58660&view=rev
Log: [MESA32] * Disable SSE optimizations, as they only cause mayhem. Modified: trunk/reactos/dll/opengl/mesa/src/mesa/CMakeLists.txt Modified: trunk/reactos/dll/opengl/mesa/src/mesa/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/opengl/mesa/src/mesa/C…
============================================================================== --- trunk/reactos/dll/opengl/mesa/src/mesa/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/dll/opengl/mesa/src/mesa/CMakeLists.txt [iso-8859-1] Wed Apr 3 12:02:58 2013 @@ -33,17 +33,18 @@ x86/3dnow_xform3.S x86/3dnow_xform4.S x86/3dnow_normal.S - x86/sse_xform1.S - x86/sse_xform2.S - x86/sse_xform3.S - x86/sse_xform4.S - x86/sse_normal.S + # x86/sse_xform1.S + # x86/sse_xform2.S + # x86/sse_xform3.S + # x86/sse_xform4.S + # x86/sse_normal.S x86/read_rgba_span_x86.S) add_definitions( -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM - -DUSE_SSE_ASM) + # -DUSE_SSE_ASM + ) endif() list(APPEND SOURCE
11 years, 8 months
1
0
0
0
[jgardou] 58659: [CDROM] * Fix a typo. Found by PVS-Studio
by jgardou@svn.reactos.org
Author: jgardou Date: Wed Apr 3 11:33:26 2013 New Revision: 58659 URL:
http://svn.reactos.org/svn/reactos?rev=58659&view=rev
Log: [CDROM] * Fix a typo. Found by PVS-Studio Modified: trunk/reactos/drivers/storage/class/cdrom/cdrom.c Modified: trunk/reactos/drivers/storage/class/cdrom/cdrom.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/class/cdro…
============================================================================== --- trunk/reactos/drivers/storage/class/cdrom/cdrom.c [iso-8859-1] (original) +++ trunk/reactos/drivers/storage/class/cdrom/cdrom.c [iso-8859-1] Wed Apr 3 11:33:26 2013 @@ -1288,7 +1288,7 @@ // cddata->XAFlags &= ~XA_USE_6_BYTE; - cddata->XAFlags = XA_USE_READ_CD | XA_USE_10_BYTE; + cddata->XAFlags |= XA_USE_READ_CD | XA_USE_10_BYTE; } else { RtlCopyMemory(&cddata->u1.Header, buffer, sizeof(ERROR_RECOVERY_DATA10));
11 years, 8 months
1
0
0
0
[hbelusca] 58658: [FREELDR] - Further improve FreeLdr's edit-boxes editing capabilities, by supporting insert-mode (only at the moment), backspace and delete to remove a character, moving left or r...
by hbelusca@svn.reactos.org
Author: hbelusca Date: Tue Apr 2 22:49:03 2013 New Revision: 58658 URL:
http://svn.reactos.org/svn/reactos?rev=58658&view=rev
Log: [FREELDR] - Further improve FreeLdr's edit-boxes editing capabilities, by supporting insert-mode (only at the moment), backspace and delete to remove a character, moving left or right, going to the beginning or to the end of the string. - Add a helper function DrawText2 to allow for displaying partial string (giving a maximum number of characters to display). Enjoy :) Modified: trunk/reactos/boot/freeldr/freeldr/include/keycodes.h trunk/reactos/boot/freeldr/freeldr/include/ui.h trunk/reactos/boot/freeldr/freeldr/include/ui/gui.h trunk/reactos/boot/freeldr/freeldr/include/ui/noui.h trunk/reactos/boot/freeldr/freeldr/include/ui/tui.h trunk/reactos/boot/freeldr/freeldr/ui/directui.c trunk/reactos/boot/freeldr/freeldr/ui/gui.c trunk/reactos/boot/freeldr/freeldr/ui/minitui.c trunk/reactos/boot/freeldr/freeldr/ui/noui.c trunk/reactos/boot/freeldr/freeldr/ui/tui.c trunk/reactos/boot/freeldr/freeldr/ui/ui.c Modified: trunk/reactos/boot/freeldr/freeldr/include/keycodes.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/inclu…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/include/keycodes.h [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/include/keycodes.h [iso-8859-1] Tue Apr 2 22:49:03 2013 @@ -20,28 +20,31 @@ #pragma once // Key codes -#define KEY_EXTENDED 0x00 -#define KEY_ENTER 0x0D -#define KEY_BACKSPACE 0x08 -#define KEY_SPACE 0x20 +#define KEY_EXTENDED 0x00 +#define KEY_ENTER 0x0D +#define KEY_BACKSPACE 0x08 +#define KEY_DELETE 0x53 +#define KEY_SPACE 0x20 #define KEY_LEFTSHIFT 0x2A #define KEY_HOME 0x47 -#define KEY_UP 0x48 -#define KEY_DOWN 0x50 -#define KEY_LEFT 0x4B -#define KEY_RIGHT 0x4D -#define KEY_ESC 0x1B -#define KEY_CAPS_LOCK 0x3A -#define KEY_F1 0x3B -#define KEY_F2 0x3C -#define KEY_F3 0x3D -#define KEY_F4 0x3E -#define KEY_F5 0x3F -#define KEY_F6 0x40 -#define KEY_F7 0x41 -#define KEY_F8 0x42 -#define KEY_F9 0x43 +#define KEY_UP 0x48 +#define KEY_DOWN 0x50 +#define KEY_LEFT 0x4B +#define KEY_RIGHT 0x4D +#define KEY_ESC 0x1B +#define KEY_CAPS_LOCK 0x3A +#define KEY_F1 0x3B +#define KEY_F2 0x3C +#define KEY_F3 0x3D +#define KEY_F4 0x3E +#define KEY_F5 0x3F +#define KEY_F6 0x40 +#define KEY_F7 0x41 +#define KEY_F8 0x42 +#define KEY_F9 0x43 #define KEY_F10 0x44 -#define KEY_KEYPAD_PLUS 0x4e -#define KEY_END 0x4f +#define KEY_F11 0x57 +#define KEY_F12 0x58 +#define KEY_KEYPAD_PLUS 0x4E +#define KEY_END 0x4F #define KEY_SEND 0xE7 Modified: trunk/reactos/boot/freeldr/freeldr/include/ui.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/inclu…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/include/ui.h [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/include/ui.h [iso-8859-1] Tue Apr 2 22:49:03 2013 @@ -61,6 +61,7 @@ VOID UiDrawShadow(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom); // Draws a shadow on the bottom and right sides of the area specified VOID UiDrawBox(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, UCHAR VertStyle, UCHAR HorzStyle, BOOLEAN Fill, BOOLEAN Shadow, UCHAR Attr); // Draws a box around the area specified VOID UiDrawText(ULONG X, ULONG Y, PCSTR Text, UCHAR Attr); // Draws text at coordinates specified +VOID UiDrawText2(ULONG X, ULONG Y, ULONG MaxNumChars, PCSTR Text, UCHAR Attr); // Draws text at coordinates specified VOID UiDrawCenteredText(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, PCSTR TextString, UCHAR Attr); // Draws centered text at the coordinates specified and clips the edges VOID UiDrawStatusText(PCSTR StatusText); // Draws text at the very bottom line on the screen VOID UiUpdateDateTime(VOID); // Updates the date and time @@ -123,6 +124,7 @@ VOID (*DrawShadow)(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom); VOID (*DrawBox)(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, UCHAR VertStyle, UCHAR HorzStyle, BOOLEAN Fill, BOOLEAN Shadow, UCHAR Attr); VOID (*DrawText)(ULONG X, ULONG Y, PCSTR Text, UCHAR Attr); + VOID (*DrawText2)(ULONG X, ULONG Y, ULONG MaxNumChars, PCSTR Text, UCHAR Attr); VOID (*DrawCenteredText)(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, PCSTR TextString, UCHAR Attr); VOID (*DrawStatusText)(PCSTR StatusText); VOID (*UpdateDateTime)(VOID); Modified: trunk/reactos/boot/freeldr/freeldr/include/ui/gui.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/inclu…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/include/ui/gui.h [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/include/ui/gui.h [iso-8859-1] Tue Apr 2 22:49:03 2013 @@ -32,6 +32,7 @@ VOID GuiDrawShadow(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom); // Draws a shadow on the bottom and right sides of the area specified VOID GuiDrawBox(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, UCHAR VertStyle, UCHAR HorzStyle, BOOLEAN Fill, BOOLEAN Shadow, UCHAR Attr); // Draws a box around the area specified VOID GuiDrawText(ULONG X, ULONG Y, PUCHAR Text, UCHAR Attr); // Draws text at coordinates specified +VOID GuiDrawText2(ULONG X, ULONG Y, ULONG MaxNumChars, PUCHAR Text, UCHAR Attr); // Draws text at coordinates specified VOID GuiDrawStatusText(PCSTR StatusText); // Draws text at the very bottom line on the screen VOID GuiUpdateDateTime(VOID); // Updates the date and time VOID GuiSaveScreen(PUCHAR Buffer); // Saves the screen so that it can be restored later Modified: trunk/reactos/boot/freeldr/freeldr/include/ui/noui.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/inclu…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/include/ui/noui.h [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/include/ui/noui.h [iso-8859-1] Tue Apr 2 22:49:03 2013 @@ -22,6 +22,7 @@ VOID NoUiDrawShadow(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom); VOID NoUiDrawBox(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, UCHAR VertStyle, UCHAR HorzStyle, BOOLEAN Fill, BOOLEAN Shadow, UCHAR Attr); VOID NoUiDrawText(ULONG X, ULONG Y, PCSTR Text, UCHAR Attr); +VOID NoUiDrawText2(ULONG X, ULONG Y, ULONG MaxNumChars, PCSTR Text, UCHAR Attr); VOID NoUiDrawCenteredText(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, PCSTR TextString, UCHAR Attr); VOID NoUiDrawStatusText(PCSTR StatusText); VOID NoUiUpdateDateTime(VOID); Modified: trunk/reactos/boot/freeldr/freeldr/include/ui/tui.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/inclu…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/include/ui/tui.h [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/include/ui/tui.h [iso-8859-1] Tue Apr 2 22:49:03 2013 @@ -35,6 +35,7 @@ VOID TuiDrawShadow(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom); // Draws a shadow on the bottom and right sides of the area specified VOID TuiDrawBox(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, UCHAR VertStyle, UCHAR HorzStyle, BOOLEAN Fill, BOOLEAN Shadow, UCHAR Attr); // Draws a box around the area specified VOID TuiDrawText(ULONG X, ULONG Y, PCSTR Text, UCHAR Attr); // Draws text at coordinates specified +VOID TuiDrawText2(ULONG X, ULONG Y, ULONG MaxNumChars, PCSTR Text, UCHAR Attr); // Draws text at coordinates specified VOID TuiDrawCenteredText(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, PCSTR TextString, UCHAR Attr); // Draws centered text at the coordinates specified and clips the edges VOID TuiDrawStatusText(PCSTR StatusText); // Draws text at the very bottom line on the screen VOID TuiUpdateDateTime(VOID); // Updates the date and time Modified: trunk/reactos/boot/freeldr/freeldr/ui/directui.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/ui/di…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/ui/directui.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/ui/directui.c [iso-8859-1] Tue Apr 2 22:49:03 2013 @@ -84,11 +84,28 @@ { ULONG i, j; - /* Draw the text character by character, but don't exceed the width */ + /* Draw the text character by character, but don't exceed the width */ for (i = X, j = 0; Text[j] && i < UiScreenWidth; i++, j++) { - /* Write the character */ - MachVideoPutChar(Text[j], Attr, i, Y); + /* Write the character */ + MachVideoPutChar(Text[j], Attr, i, Y); + } +} + +VOID +UiDrawText2(IN ULONG X, + IN ULONG Y, + IN ULONG MaxNumChars, + IN PCSTR Text, + IN UCHAR Attr) +{ + ULONG i, j; + + /* Draw the text character by character, but don't exceed the width */ + for (i = X, j = 0; Text[j] && i < UiScreenWidth && (MaxNumChars > 0 ? j < MaxNumChars : TRUE); i++, j++) + { + /* Write the character */ + MachVideoPutChar(Text[j], Attr, i, Y); } } Modified: trunk/reactos/boot/freeldr/freeldr/ui/gui.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/ui/gu…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/ui/gui.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/ui/gui.c [iso-8859-1] Tue Apr 2 22:49:03 2013 @@ -37,6 +37,10 @@ } VOID GuiDrawText(ULONG X, ULONG Y, PUCHAR Text, UCHAR Attr) +{ +} + +VOID GuiDrawText2(ULONG X, ULONG Y, ULONG MaxNumChars, PUCHAR Text, UCHAR Attr) { } @@ -80,13 +84,15 @@ const UIVTBL GuiVtbl = { - /*GuiInitialize, + /* + GuiInitialize, GuiUnInitialize, GuiDrawBackdrop, GuiFillArea, GuiDrawShadow, GuiDrawBox, GuiDrawText, + GuiDrawText2, GuiDrawCenteredText, GuiDrawStatusText, GuiUpdateDateTime, @@ -99,9 +105,12 @@ GuiTextToFillStyle, GuiFadeInBackdrop, GuiFadeOut, - GuiDisplayMenu,*/ + GuiDisplayMenu, + GuiDrawMenu, + */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL + NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL }; #endif Modified: trunk/reactos/boot/freeldr/freeldr/ui/minitui.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/ui/mi…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/ui/minitui.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/ui/minitui.c [iso-8859-1] Tue Apr 2 22:49:03 2013 @@ -143,6 +143,7 @@ TuiDrawShadow, TuiDrawBox, TuiDrawText, + TuiDrawText2, TuiDrawCenteredText, MiniTuiDrawStatusText, TuiUpdateDateTime, Modified: trunk/reactos/boot/freeldr/freeldr/ui/noui.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/ui/no…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/ui/noui.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/ui/noui.c [iso-8859-1] Tue Apr 2 22:49:03 2013 @@ -34,6 +34,10 @@ } VOID NoUiDrawText(ULONG X, ULONG Y, PCSTR Text, UCHAR Attr) +{ +} + +VOID NoUiDrawText2(ULONG X, ULONG Y, ULONG MaxNumChars, PCSTR Text, UCHAR Attr) { } Modified: trunk/reactos/boot/freeldr/freeldr/ui/tui.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/ui/tu…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/ui/tui.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/ui/tui.c [iso-8859-1] Tue Apr 2 22:49:03 2013 @@ -318,7 +318,26 @@ ULONG i, j; // Draw the text - for (i=X, j=0; Text[j] && i<UiScreenWidth; i++,j++) + for (i = X, j = 0; Text[j] && i < UiScreenWidth; i++, j++) + { + ScreenMemory[((Y*2)*UiScreenWidth)+(i*2)] = (UCHAR)Text[j]; + ScreenMemory[((Y*2)*UiScreenWidth)+(i*2)+1] = Attr; + } +} + +/* + * DrawText2() + * This function assumes coordinates are zero-based. + * MaxNumChars is the maximum number of characters to display. + * If MaxNumChars == 0, then display the whole string. + */ +VOID TuiDrawText2(ULONG X, ULONG Y, ULONG MaxNumChars, PCSTR Text, UCHAR Attr) +{ + PUCHAR ScreenMemory = (PUCHAR)TextVideoBuffer; + ULONG i, j; + + // Draw the text + for (i = X, j = 0; Text[j] && i < UiScreenWidth && (MaxNumChars > 0 ? j < MaxNumChars : TRUE); i++, j++) { ScreenMemory[((Y*2)*UiScreenWidth)+(i*2)] = (UCHAR)Text[j]; ScreenMemory[((Y*2)*UiScreenWidth)+(i*2)+1] = Attr; @@ -789,19 +808,20 @@ BOOLEAN TuiEditBox(PCSTR MessageText, PCHAR EditTextBuffer, ULONG Length) { - int width = 8; - unsigned int height = 1; - int curline = 0; - int k; - size_t i , j; - int x1, x2, y1, y2; - char temp[260]; - char key; - int EditBoxLine; - ULONG EditBoxStartX, EditBoxEndX; - int EditBoxCursorX; - unsigned int EditBoxTextCount; - int EditBoxTextDisplayIndex; + INT width = 8; + ULONG height = 1; + INT curline = 0; + INT k; + size_t i , j; + INT x1, x2, y1, y2; + CHAR temp[260]; + CHAR key; + BOOLEAN Extended; + INT EditBoxLine; + ULONG EditBoxStartX, EditBoxEndX; + INT EditBoxCursorX; + ULONG EditBoxTextLength, EditBoxTextPosition; + INT EditBoxTextDisplayIndex; BOOLEAN ReturnCode; PVOID ScreenBuffer; @@ -855,7 +875,8 @@ temp[j++] = MessageText[i]; } - EditBoxTextCount = 0; + EditBoxTextLength = 0; + EditBoxTextPosition = 0; EditBoxLine = y2 - 2; EditBoxStartX = x1 + 3; EditBoxEndX = x2 - 3; @@ -871,13 +892,20 @@ VideoCopyOffScreenBufferToVRAM(); + // + // Enter the text. Please keep in mind that the default input mode + // of the edit boxes is in insertion mode, that is, you can insert + // text without erasing the existing one. + // for (;;) { if (MachConsKbHit()) { + Extended = FALSE; key = MachConsGetCh(); if(key == KEY_EXTENDED) { + Extended = TRUE; key = MachConsGetCh(); } @@ -893,46 +921,94 @@ } else if (key == KEY_BACKSPACE) // Remove a character { - if (EditBoxTextCount) + if ( (EditBoxTextLength > 0) && (EditBoxTextPosition > 0) && + (EditBoxTextPosition <= EditBoxTextLength) ) { - EditBoxTextCount--; - EditTextBuffer[EditBoxTextCount] = 0; + EditBoxTextPosition--; + memmove(EditTextBuffer + EditBoxTextPosition, + EditTextBuffer + EditBoxTextPosition + 1, + EditBoxTextLength - EditBoxTextPosition); + EditBoxTextLength--; + EditTextBuffer[EditBoxTextLength] = 0; } else { MachBeep(); } } - else // Add this key to the buffer - { - if (EditBoxTextCount < Length - 1) + else if (Extended && key == KEY_DELETE) // Remove a character + { + if ( (EditBoxTextLength > 0) && + (EditBoxTextPosition < EditBoxTextLength) ) { - EditTextBuffer[EditBoxTextCount] = key; - EditBoxTextCount++; - EditTextBuffer[EditBoxTextCount] = 0; + memmove(EditTextBuffer + EditBoxTextPosition, + EditTextBuffer + EditBoxTextPosition + 1, + EditBoxTextLength - EditBoxTextPosition); + EditBoxTextLength--; + EditTextBuffer[EditBoxTextLength] = 0; } else { MachBeep(); } } + else if (key == KEY_HOME) // Go to the start of the buffer + { + EditBoxTextPosition = 0; + } + else if (key == KEY_END) // Go to the end of the buffer + { + EditBoxTextPosition = EditBoxTextLength; + } + else if (key == KEY_RIGHT) // Go right + { + if (EditBoxTextPosition < EditBoxTextLength) + EditBoxTextPosition++; + else + MachBeep(); + } + else if (key == KEY_LEFT) // Go left + { + if (EditBoxTextPosition > 0) + EditBoxTextPosition--; + else + MachBeep(); + } + else // Add this key to the buffer + { + if ( (EditBoxTextLength < Length - 1) && + (EditBoxTextPosition < Length - 1) ) + { + memmove(EditTextBuffer + EditBoxTextPosition + 1, + EditTextBuffer + EditBoxTextPosition, + EditBoxTextLength - EditBoxTextPosition); + EditTextBuffer[EditBoxTextPosition] = key; + EditBoxTextPosition++; + EditBoxTextLength++; + EditTextBuffer[EditBoxTextLength] = 0; + } + else + { + MachBeep(); + } + } } // Draw the edit box background UiFillArea(EditBoxStartX, EditBoxLine, EditBoxEndX, EditBoxLine, ' ', ATTR(UiEditBoxTextColor, UiEditBoxBgColor)); // Fill the text in - if (EditBoxTextCount > (EditBoxEndX - EditBoxStartX)) - { - EditBoxTextDisplayIndex = EditBoxTextCount - (EditBoxEndX - EditBoxStartX); + if (EditBoxTextPosition > (EditBoxEndX - EditBoxStartX)) + { + EditBoxTextDisplayIndex = EditBoxTextPosition - (EditBoxEndX - EditBoxStartX); EditBoxCursorX = EditBoxEndX; } else { EditBoxTextDisplayIndex = 0; - EditBoxCursorX = EditBoxStartX + EditBoxTextCount; - } - UiDrawText(EditBoxStartX, EditBoxLine, &EditTextBuffer[EditBoxTextDisplayIndex], ATTR(UiEditBoxTextColor, UiEditBoxBgColor)); + EditBoxCursorX = EditBoxStartX + EditBoxTextPosition; + } + UiDrawText2(EditBoxStartX, EditBoxLine, EditBoxEndX - EditBoxStartX + 1, &EditTextBuffer[EditBoxTextDisplayIndex], ATTR(UiEditBoxTextColor, UiEditBoxBgColor)); // Move the cursor MachVideoSetTextCursorPosition(EditBoxCursorX, EditBoxLine); @@ -963,6 +1039,7 @@ TuiDrawShadow, TuiDrawBox, TuiDrawText, + TuiDrawText2, TuiDrawCenteredText, TuiDrawStatusText, TuiUpdateDateTime, Modified: trunk/reactos/boot/freeldr/freeldr/ui/ui.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/ui/ui…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/ui/ui.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/ui/ui.c [iso-8859-1] Tue Apr 2 22:49:03 2013 @@ -62,6 +62,7 @@ NoUiDrawShadow, NoUiDrawBox, NoUiDrawText, + NoUiDrawText2, NoUiDrawCenteredText, NoUiDrawStatusText, NoUiUpdateDateTime, @@ -260,6 +261,11 @@ UiVtbl.DrawText(X, Y, Text, Attr); } +VOID UiDrawText2(ULONG X, ULONG Y, ULONG MaxNumChars, PCSTR Text, UCHAR Attr) +{ + UiVtbl.DrawText2(X, Y, MaxNumChars, Text, Attr); +} + VOID UiDrawCenteredText(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, PCSTR TextString, UCHAR Attr) { UiVtbl.DrawCenteredText(Left, Top, Right, Bottom, TextString, Attr);
11 years, 8 months
1
0
0
0
[spetreolle] 58657: Arch, don't try to fix build when it has been fixed. Reverts 58656.
by spetreolle@svn.reactos.org
Author: spetreolle Date: Tue Apr 2 21:13:35 2013 New Revision: 58657 URL:
http://svn.reactos.org/svn/reactos?rev=58657&view=rev
Log: Arch, don't try to fix build when it has been fixed. Reverts 58656. Modified: trunk/reactos/drivers/wdm/audio/drivers/CMIDriver/CMakeLists.txt Modified: trunk/reactos/drivers/wdm/audio/drivers/CMIDriver/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/drivers/…
============================================================================== --- trunk/reactos/drivers/wdm/audio/drivers/CMIDriver/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/drivers/wdm/audio/drivers/CMIDriver/CMakeLists.txt [iso-8859-1] Tue Apr 2 21:13:35 2013 @@ -23,7 +23,6 @@ target_link_libraries(cmipci stdunk libcntpr - chkstk ) set_module_type(cmipci wdmdriver UNICODE ENTRYPOINT 0)
11 years, 8 months
1
0
0
0
← Newer
1
...
21
22
23
24
25
26
27
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
Results per page:
10
25
50
100
200