ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
March 2015
----- 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
18 participants
496 discussions
Start a n
N
ew thread
[akhaldi] 66633: [MSI_WINETEST] Sync with Wine Staging 1.7.37. CORE-9246
by akhaldi@svn.reactos.org
Author: akhaldi Date: Mon Mar 9 20:28:54 2015 New Revision: 66633 URL:
http://svn.reactos.org/svn/reactos?rev=66633&view=rev
Log: [MSI_WINETEST] Sync with Wine Staging 1.7.37. CORE-9246 Modified: trunk/rostests/winetests/msi/action.c trunk/rostests/winetests/msi/automation.c trunk/rostests/winetests/msi/db.c trunk/rostests/winetests/msi/install.c trunk/rostests/winetests/msi/msi.c trunk/rostests/winetests/msi/package.c trunk/rostests/winetests/msi/source.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] Mon Mar 9 20:28:54 2015 @@ -182,7 +182,8 @@ "SERVNAME2\tTestService2\n" "SERVDISP\tTestServiceDisp\n" "SERVDISP2\tTestServiceDisp2\n" - "MSIFASTINSTALL\t1\n"; + "MSIFASTINSTALL\t1\n" + "regdata15\t#x01\n"; static const char environment_dat[] = "Environment\tName\tValue\tComponent_\n" @@ -242,7 +243,10 @@ "ServiceControl\tName\tEvent\tArguments\tWait\tComponent_\n" "s72\tl255\ti2\tL255\tI2\ts72\n" "ServiceControl\tServiceControl\n" - "ServiceControl\tSpooler\t1\t\t0\tservice_comp"; + "ServiceControl\tSpooler\t1\t\t1\tservice_comp\n" + "ServiceControl2\tSpooler\t2\t\t1\tservice_comp\n" + "ServiceControl3\tSpooler\t16\t\t1\tservice_comp\n" + "ServiceControl4\tSpooler\t32\t\t1\tservice_comp\n"; static const char sss_install_exec_seq_dat[] = "Action\tCondition\tSequence\n" @@ -255,11 +259,15 @@ "CostFinalize\t\t1000\n" "InstallValidate\t\t1400\n" "InstallInitialize\t\t1500\n" + "StopServices\t\t4000\n" "DeleteServices\t\t5000\n" "MoveFiles\t\t5100\n" "InstallFiles\t\t5200\n" "DuplicateFiles\t\t5300\n" "StartServices\t\t5400\n" + "RegisterProduct\t\t5500\n" + "PublishFeatures\t\t5600\n" + "PublishProduct\t\t5700\n" "InstallFinalize\t\t6000\n"; static const char sds_install_exec_seq_dat[] = @@ -510,7 +518,11 @@ "regdata8\t2\tSOFTWARE\\Wine\\msitest\tValue4\tone[~]two\taugustus\n" "regdata9\t2\tSOFTWARE\\Wine\\msitest\tValue5\t[~]one[~]two[~]three\taugustus\n" "regdata10\t2\tSOFTWARE\\Wine\\msitest\tValue6\t[~]\taugustus\n" - "regdata11\t2\tSOFTWARE\\Wine\\msitest\tValue7\t[~]two\taugustus\n"; + "regdata11\t2\tSOFTWARE\\Wine\\msitest\tValue7\t[~]two\taugustus\n" + "regdata12\t2\tSOFTWARE\\Wine\\msitest\tValue8\t#1\taugustus\n" + "regdata13\t2\tSOFTWARE\\Wine\\msitest\tValue9\t#x1\taugustus\n" + "regdata14\t2\tSOFTWARE\\Wine\\msitest\tValue10\t#x01\taugustus\n" + "regdata15\t2\tSOFTWARE\\Wine\\msitest\tValue11\t[regdata15]\taugustus\n"; static const char cf_directory_dat[] = "Directory\tDirectory_Parent\tDefaultDir\n" @@ -2706,7 +2718,7 @@ } if (!expected) - ok_(__FILE__, line)(lstrlenA(val) == 0, "Expected empty string, got %s\n", val); + ok_(__FILE__, line)(!val[0], "Expected empty string, got %s\n", val); else { if (bcase) @@ -4919,6 +4931,7 @@ HKEY hkey; DWORD type, size; CHAR path[MAX_PATH]; + BYTE buf[8]; if (is_process_limited()) { @@ -5050,6 +5063,42 @@ ok(!memcmp(path, "two\0", size), "Wrong multi-sz data\n"); ok(size == 5, "Expected 5, got %d\n", size); ok(type == REG_MULTI_SZ, "Expected REG_MULTI_SZ, got %d\n", type); + + size = sizeof(buf); + type = 0xdeadbeef; + memset(buf, 0, size); + res = RegQueryValueExA(hkey, "Value8", NULL, &type, buf, &size); + ok(res == ERROR_SUCCESS, "got %u\n", res); + ok(*(DWORD *)buf == 1, "got %u\n", *(DWORD *)buf); + ok(size == 4, "got %u\n", size); + ok(type == REG_DWORD, "got %u\n", type); + + size = sizeof(buf); + type = 0xdeadbeef; + memset(buf, 0, size); + res = RegQueryValueExA(hkey, "Value9", NULL, &type, buf, &size); + ok(res == ERROR_SUCCESS, "got %u\n", res); + ok(buf[0] == 1, "got %u\n", buf[0]); + ok(size == 1, "got %u\n", size); + ok(type == REG_BINARY, "got %u\n", type); + + size = sizeof(buf); + type = 0xdeadbeef; + memset(buf, 0, size); + res = RegQueryValueExA(hkey, "Value10", NULL, &type, buf, &size); + ok(res == ERROR_SUCCESS, "got %u\n", res); + ok(buf[0] == 1, "got %u\n", buf[0]); + ok(size == 1, "got %u\n", size); + ok(type == REG_BINARY, "got %u\n", type); + + size = sizeof(buf); + type = 0xdeadbeef; + memset(buf, 0, size); + res = RegQueryValueExA(hkey, "Value11", NULL, &type, buf, &size); + ok(res == ERROR_SUCCESS, "got %u\n", res); + ok(buf[0] == 1, "got %u\n", buf[0]); + ok(size == 1, "got %u\n", size); + ok(type == REG_BINARY, "got %u\n", type); RegDeleteValueA(hkey, "Value"); RegDeleteValueA(hkey, "Value1"); @@ -5059,6 +5108,10 @@ RegDeleteValueA(hkey, "Value5"); RegDeleteValueA(hkey, "Value6"); RegDeleteValueA(hkey, "Value7"); + RegDeleteValueA(hkey, "Value8"); + RegDeleteValueA(hkey, "Value9"); + RegDeleteValueA(hkey, "Value10"); + RegDeleteValueA(hkey, "Value11"); RegCloseKey(hkey); RegDeleteKeyA(HKEY_LOCAL_MACHINE, "SOFTWARE\\Wine\\msitest"); @@ -5260,7 +5313,7 @@ DeleteFileA(msifile); } -static void test_start_services(void) +static void test_start_stop_services(void) { UINT r; SC_HANDLE scm, service; @@ -5307,6 +5360,23 @@ MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL); r = MsiInstallProductA(msifile, NULL); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); + + if (error == ERROR_SUCCESS) + { + SERVICE_STATUS status; + + scm = OpenSCManagerA(NULL, NULL, SC_MANAGER_ALL_ACCESS); + service = OpenServiceA(scm, "Spooler", SC_MANAGER_ALL_ACCESS); + + ret = ControlService(service, SERVICE_CONTROL_STOP, &status); + ok(ret, "ControlService failed %u\n", GetLastError()); + + CloseServiceHandle(service); + CloseServiceHandle(scm); + } + + r = MsiInstallProductA(msifile, "REMOVE=ALL"); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n"); @@ -5323,22 +5393,22 @@ ok(delete_pf("msitest\\service2.exe", TRUE), "File not installed\n"); ok(delete_pf("msitest", FALSE), "Directory not created\n"); + if (error == ERROR_SUCCESS) + { + SERVICE_STATUS status; + + scm = OpenSCManagerA(NULL, NULL, SC_MANAGER_ALL_ACCESS); + service = OpenServiceA(scm, "Spooler", SC_MANAGER_ALL_ACCESS); + + ret = ControlService(service, SERVICE_CONTROL_STOP, &status); + ok(ret, "ControlService failed %u\n", GetLastError()); + + CloseServiceHandle(service); + CloseServiceHandle(scm); + } + delete_test_files(); DeleteFileA(msifile); - - if (error == ERROR_SUCCESS) - { - SERVICE_STATUS status; - - scm = OpenSCManagerA(NULL, NULL, SC_MANAGER_ALL_ACCESS); - service = OpenServiceA(scm, "Spooler", SC_MANAGER_ALL_ACCESS); - - ret = ControlService(service, SERVICE_CONTROL_STOP, &status); - ok(ret, "ControlService failed %u\n", GetLastError()); - - CloseServiceHandle(service); - CloseServiceHandle(scm); - } } static void test_delete_services(void) @@ -6819,7 +6889,7 @@ test_write_registry_values(); test_envvar(); test_create_remove_folder(); - test_start_services(); + test_start_stop_services(); test_delete_services(); test_install_services(); test_self_registration(); 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] Mon Mar 9 20:28:54 2015 @@ -1934,7 +1934,7 @@ hr = Session_ModePut(pSession, MSIRUNMODE_REBOOTNOW, TRUE); ok(hr == S_OK, "Session_ModePut failed, hresult 0x%08x\n", hr); - if (hr == DISP_E_EXCEPTION) ok_exception(hr, szModeFlag); + ok_exception(hr, szModeFlag); hr = Session_ModeGet(pSession, MSIRUNMODE_REBOOTNOW, &bool); ok(hr == S_OK, "Session_ModeGet failed, hresult 0x%08x\n", hr); @@ -1942,7 +1942,7 @@ hr = Session_ModePut(pSession, MSIRUNMODE_REBOOTNOW, FALSE); /* set it again so we don't reboot */ ok(hr == S_OK, "Session_ModePut failed, hresult 0x%08x\n", hr); - if (hr == DISP_E_EXCEPTION) ok_exception(hr, szModeFlag); + ok_exception(hr, szModeFlag); hr = Session_ModePut(pSession, MSIRUNMODE_MAINTENANCE, TRUE); ok(hr == DISP_E_EXCEPTION, "Session_ModePut failed, hresult 0x%08x\n", hr); Modified: trunk/rostests/winetests/msi/db.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/msi/db.c?rev=66…
============================================================================== --- trunk/rostests/winetests/msi/db.c [iso-8859-1] (original) +++ trunk/rostests/winetests/msi/db.c [iso-8859-1] Mon Mar 9 20:28:54 2015 @@ -1670,6 +1670,28 @@ MsiViewClose( view ); MsiCloseHandle( view ); + /* try again */ + create_file( "test1.txt" ); + + rec = MsiCreateRecord( 2 ); + MsiRecordSetStringA( rec, 1, "data1" ); + + r = MsiRecordSetStreamA( rec, 2, "test1.txt" ); + ok( r == ERROR_SUCCESS, "Failed to add stream data to the record: %d\n", r ); + + DeleteFileA( "test1.txt" ); + + r = MsiDatabaseOpenViewA( hdb, + "INSERT INTO `_Streams` ( `Name`, `Data` ) VALUES ( ?, ? )", &view ); + ok( r == ERROR_SUCCESS, "Failed to open database view: %d\n", r ); + + r = MsiViewExecute( view, rec ); + ok( r == ERROR_FUNCTION_FAILED, "got %u\n", r ); + + MsiCloseHandle( rec ); + MsiViewClose( view ); + MsiCloseHandle( view ); + r = MsiDatabaseOpenViewA( hdb, "SELECT `Name`, `Data` FROM `_Streams` WHERE `Name` = 'data'", &view ); ok( r == ERROR_SUCCESS, "Failed to open database view: %d\n", r); @@ -1759,7 +1781,7 @@ memset(buf, 0, MAX_PATH); r = MsiRecordReadStream( rec, 2, buf, &size ); ok( r == ERROR_SUCCESS, "Failed to get stream: %d\n", r); - todo_wine ok( !lstrcmpA(buf, "test2.txt\n"), "Expected 'test2.txt\\n', got %s\n", buf); + ok( !lstrcmpA(buf, "test2.txt\n"), "Expected 'test2.txt\\n', got %s\n", buf); MsiCloseHandle( rec ); MsiViewClose( view ); @@ -1791,9 +1813,40 @@ ok( r == ERROR_SUCCESS, "Failed to add stream data to the record: %d\n", r); DeleteFileA( "test.txt" ); + /* try a name that exceeds maximum OLE stream name length */ + query = "INSERT INTO `Binary` ( `Name`, `ID`, `Data` ) VALUES ( 'encryption.dll.CB4E6205_F99A_4C51_ADD4_184506EFAB87', 10000, ? )"; + r = run_query( hdb, rec, query ); + ok( r == ERROR_SUCCESS, "Insert into Binary table failed: %d\n", r ); + + r = MsiCloseHandle( rec ); + ok( r == ERROR_SUCCESS , "Failed to close record handle\n" ); + + r = MsiDatabaseCommit( hdb ); + ok( r == ERROR_FUNCTION_FAILED , "got %u\n", r ); + + r = MsiCloseHandle( hdb ); + ok( r == ERROR_SUCCESS , "Failed to close database\n" ); + + r = MsiOpenDatabaseW(msifileW, MSIDBOPEN_CREATE, &hdb ); + ok( r == ERROR_SUCCESS , "Failed to open database\n" ); + + query = "CREATE TABLE `Binary` ( `Name` CHAR(72) NOT NULL, `ID` INT NOT NULL, `Data` OBJECT PRIMARY KEY `Name`, `ID`)"; + r = run_query( hdb, 0, query ); + ok( r == ERROR_SUCCESS, "Cannot create Binary table: %d\n", r ); + + create_file( "test.txt" ); + rec = MsiCreateRecord( 1 ); + r = MsiRecordSetStreamA( rec, 1, "test.txt" ); + ok( r == ERROR_SUCCESS, "Failed to add stream data to the record: %d\n", r ); + DeleteFileA( "test.txt" ); + query = "INSERT INTO `Binary` ( `Name`, `ID`, `Data` ) VALUES ( 'filename1', 1, ? )"; r = run_query( hdb, rec, query ); ok( r == ERROR_SUCCESS, "Insert into Binary table failed: %d\n", r ); + + query = "INSERT INTO `Binary` ( `Name`, `ID`, `Data` ) VALUES ( 'filename1', 1, ? )"; + r = run_query( hdb, rec, query ); + ok( r == ERROR_FUNCTION_FAILED, "got %u\n", r ); r = MsiCloseHandle( rec ); ok( r == ERROR_SUCCESS , "Failed to close record handle\n" ); @@ -4535,7 +4588,7 @@ size = MAX_PATH; r = MsiRecordGetStringA(rec, 1, result, &size); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); - ok(!lstrlenA(result), "Expected an empty string, got %s\n", result); + ok(!result[0], "Expected an empty string, got %s\n", result); MsiCloseHandle(rec); @@ -4581,7 +4634,7 @@ size = MAX_PATH; r = MsiRecordGetStringA(rec, 1, result, &size); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); - ok(!lstrlenA(result), "Expected an empty string, got %s\n", result); + ok(!result[0], "Expected an empty string, got %s\n", result); MsiCloseHandle(rec); 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] Mon Mar 9 20:28:54 2015 @@ -561,34 +561,10 @@ "2\t2\t\ttest2.cab\tDISK2\t\n" "3\t12\t\ttest3.cab\tDISK3\t\n"; -static const CHAR ci_install_exec_seq_dat[] = "Action\tCondition\tSequence\n" - "s72\tS255\tI2\n" - "InstallExecuteSequence\tAction\n" - "CostFinalize\t\t1000\n" - "CostInitialize\t\t800\n" - "FileCost\t\t900\n" - "InstallFiles\t\t4000\n" - "InstallServices\t\t5000\n" - "InstallFinalize\t\t6600\n" - "InstallInitialize\t\t1500\n" - "RunInstall\t\t1600\n" - "InstallValidate\t\t1400\n" - "LaunchConditions\t\t100"; - -static const CHAR ci_custom_action_dat[] = "Action\tType\tSource\tTarget\tISComments\n" - "s72\ti2\tS64\tS0\tS255\n" - "CustomAction\tAction\n" - "RunInstall\t87\tmsitest\\concurrent.msi\tMYPROP=[UILevel]\t\n"; - static const CHAR ci_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n" "s72\tS38\ts72\ti2\tS255\tS72\n" "Component\tComponent\n" "maximus\t{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}\tMSITESTDIR\t0\tUILevel=5\tmaximus\n"; - -static const CHAR ci2_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n" - "s72\tS38\ts72\ti2\tS255\tS72\n" - "Component\tComponent\n" - "augustus\t\tMSITESTDIR\t0\tUILevel=3 AND MYPROP=5\taugustus\n"; static const CHAR ci2_feature_comp_dat[] = "Feature_\tComponent_\n" "s38\ts72\n" @@ -656,13 +632,6 @@ "s72\tS38\ts72\ti2\tS255\tS72\n" "Component\tComponent\n" "augustus\t\tMSITESTDIR\t0\tMYPROP=2718 and MyProp=42\taugustus\n"; - -static const CHAR rem_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"; static const CHAR rem_install_exec_seq_dat[] = "Action\tCondition\tSequence\n" "s72\tS255\tI2\n" @@ -1538,31 +1507,6 @@ ADD_TABLE(cie_file), ADD_TABLE(install_exec_seq), ADD_TABLE(cie_media), - ADD_TABLE(property), -}; - -static const msi_table ci_tables[] = -{ - ADD_TABLE(ci_component), - ADD_TABLE(directory), - ADD_TABLE(rof_feature), - ADD_TABLE(rof_feature_comp), - ADD_TABLE(rof_file), - ADD_TABLE(ci_install_exec_seq), - ADD_TABLE(rof_media), - ADD_TABLE(property), - ADD_TABLE(ci_custom_action), -}; - -static const msi_table ci2_tables[] = -{ - ADD_TABLE(ci2_component), - ADD_TABLE(directory), - ADD_TABLE(rof_feature), - ADD_TABLE(ci2_feature_comp), - ADD_TABLE(ci2_file), - ADD_TABLE(install_exec_seq), - ADD_TABLE(rof_media), ADD_TABLE(property), }; @@ -5723,7 +5667,7 @@ res = RegOpenKeyExA(HKEY_CLASSES_ROOT, "CLSID\\{8dfef911-6885-41eb-b280-8f0304728e8b}\\InProcServer32", 0, KEY_ALL_ACCESS|KEY_WOW64_32KEY, &hkey); - todo_wine ok(res == ERROR_SUCCESS, "can't open 32-bit CLSID key, got %d\n", res); + ok(res == ERROR_SUCCESS, "can't open 32-bit CLSID key, got %d\n", res); if (res == ERROR_SUCCESS) { size = sizeof(value); res = RegQueryValueExA(hkey, "", NULL, NULL, (LPBYTE)value, &size); @@ -5786,7 +5730,7 @@ res = RegOpenKeyExA(HKEY_CLASSES_ROOT, "CLSID\\{8dfef911-6885-41eb-b280-8f0304728e8b}\\InProcServer32", 0, KEY_ALL_ACCESS|KEY_WOW64_32KEY, &hkey); - todo_wine ok(res == ERROR_SUCCESS, "can't open 32-bit CLSID key, got %d\n", res); + ok(res == ERROR_SUCCESS, "can't open 32-bit CLSID key, got %d\n", res); if (res == ERROR_SUCCESS) { size = sizeof(value); res = RegQueryValueExA(hkey, "", NULL, NULL, (LPBYTE)value, &size); Modified: trunk/rostests/winetests/msi/msi.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/msi/msi.c?rev=6…
============================================================================== --- trunk/rostests/winetests/msi/msi.c [iso-8859-1] (original) +++ trunk/rostests/winetests/msi/msi.c [iso-8859-1] Mon Mar 9 20:28:54 2015 @@ -48,6 +48,10 @@ static INSTALLSTATE (WINAPI *pMsiGetComponentPathA) (LPCSTR, LPCSTR, LPSTR, DWORD*); +static INSTALLSTATE (WINAPI *pMsiProvideComponentA) + (LPCSTR, LPCSTR, LPCSTR, DWORD, LPSTR, LPDWORD); +static INSTALLSTATE (WINAPI *pMsiProvideComponentW) + (LPCWSTR, LPCWSTR, LPCWSTR, DWORD, LPWSTR, LPDWORD); static UINT (WINAPI *pMsiGetFileHashA) (LPCSTR, DWORD, PMSIFILEHASHINFO); static UINT (WINAPI *pMsiGetProductInfoExA) @@ -86,6 +90,8 @@ trace("GetProcAddress(%s) failed\n", #func); GET_PROC(hmsi, MsiGetComponentPathA) + GET_PROC(hmsi, MsiProvideComponentA) + GET_PROC(hmsi, MsiProvideComponentW) GET_PROC(hmsi, MsiGetFileHashA) GET_PROC(hmsi, MsiGetProductInfoExA) GET_PROC(hmsi, MsiOpenPackageExA) @@ -3402,6 +3408,100 @@ LocalFree(usersid); } +static void test_MsiProvideComponent(void) +{ + static const WCHAR sourcedirW[] = + {'s','o','u','r','c','e','d','i','r',0}; + static const WCHAR productW[] = + {'{','3','8','8','4','7','3','3','8','-','1','B','B','C','-','4','1','0','4','-', + '8','1','A','C','-','2','F','A','A','C','7','E','C','D','D','C','D','}',0}; + static const WCHAR componentW[] = + {'{','D','D','4','2','2','F','9','2','-','3','E','D','8','-','4','9','B','5','-', + 'A','0','B','7','-','F','2','6','6','F','9','8','3','5','7','D','F','}',0}; + INSTALLSTATE state; + char buf[0x100]; + WCHAR bufW[0x100]; + DWORD len, len2; + UINT r; + + if (is_process_limited()) + { + skip("process is limited\n"); + return; + } + + create_test_files(); + create_file("msitest\\sourcedir.txt", "msitest\\sourcedir.txt", 1000); + create_database(msifile, sd_tables, sizeof(sd_tables) / sizeof(msi_table)); + + MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL); + + buf[0] = 0; + len = sizeof(buf); + r = pMsiProvideComponentA("{90120000-0070-0000-0000-4000000FF1CE}", + "{17961602-C4E2-482E-800A-DF6E627549CF}", + "ProductFiles", INSTALLMODE_NODETECTION, buf, &len); + ok(r == ERROR_INVALID_PARAMETER, "got %u\n", r); + + r = MsiInstallProductA(msifile, NULL); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); + + state = MsiQueryFeatureStateA("{38847338-1BBC-4104-81AC-2FAAC7ECDDCD}", "sourcedir"); + ok(state == INSTALLSTATE_LOCAL, "got %d\n", state); + + buf[0] = 0; + len = sizeof(buf); + r = pMsiProvideComponentA("{38847338-1BBC-4104-81AC-2FAAC7ECDDCD}", "sourcedir", + "{DD422F92-3ED8-49B5-A0B7-F266F98357DF}", + INSTALLMODE_NODETECTION, buf, &len); + ok(r == ERROR_SUCCESS, "got %u\n", r); + ok(buf[0], "empty path\n"); + ok(len == lstrlenA(buf), "got %u\n", len); + + len2 = 0; + r = pMsiProvideComponentA("{38847338-1BBC-4104-81AC-2FAAC7ECDDCD}", "sourcedir", + "{DD422F92-3ED8-49B5-A0B7-F266F98357DF}", + INSTALLMODE_NODETECTION, NULL, &len2); + ok(r == ERROR_SUCCESS, "got %u\n", r); + ok(len2 == len, "got %u\n", len2); + + len2 = 0; + r = pMsiProvideComponentA("{38847338-1BBC-4104-81AC-2FAAC7ECDDCD}", "sourcedir", + "{DD422F92-3ED8-49B5-A0B7-F266F98357DF}", + INSTALLMODE_NODETECTION, buf, &len2); + ok(r == ERROR_MORE_DATA, "got %u\n", r); + ok(len2 == len, "got %u\n", len2); + + /* wide version */ + + bufW[0] = 0; + len = sizeof(buf); + r = pMsiProvideComponentW(productW, sourcedirW, componentW, + INSTALLMODE_NODETECTION, bufW, &len); + ok(r == ERROR_SUCCESS, "got %u\n", r); + ok(bufW[0], "empty path\n"); + ok(len == lstrlenW(bufW), "got %u\n", len); + + len2 = 0; + r = pMsiProvideComponentW(productW, sourcedirW, componentW, + INSTALLMODE_NODETECTION, NULL, &len2); + ok(r == ERROR_SUCCESS, "got %u\n", r); + ok(len2 == len, "got %u\n", len2); + + len2 = 0; + r = pMsiProvideComponentW(productW, sourcedirW, componentW, + INSTALLMODE_NODETECTION, bufW, &len2); + ok(r == ERROR_MORE_DATA, "got %u\n", r); + ok(len2 == len, "got %u\n", len2); + + r = MsiInstallProductA(msifile, "REMOVE=ALL"); + ok(r == ERROR_SUCCESS, "got %u\n", r); + + DeleteFileA("msitest\\sourcedir.txt"); + delete_test_files(); + DeleteFileA(msifile); +} + static void test_MsiGetProductCode(void) { HKEY compkey, prodkey; @@ -14298,6 +14398,7 @@ test_MsiQueryFeatureState(); test_MsiQueryComponentState(); test_MsiGetComponentPath(); + test_MsiProvideComponent(); test_MsiGetProductCode(); test_MsiEnumClients(); test_MsiGetProductInfo(); 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] Mon Mar 9 20:28:54 2015 @@ -2194,7 +2194,7 @@ sz = 6; r = MsiGetPropertyA(hpkg, "property", buffer, &sz); ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); - ok( !strlen(buffer), "Expected empty string, got %s\n", buffer); + ok(!buffer[0], "Expected empty string, got %s\n", buffer); MsiCloseHandle( hpkg ); DeleteFileA(msifile); @@ -2347,7 +2347,7 @@ lstrcpyA(buffer, "aaa"); r = MsiGetPropertyA(hpkg, "dantes", buffer, &sz); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); - ok(lstrlenA(buffer) == 0, "Expected empty string, got %s\n", buffer); + ok(!buffer[0], "Expected empty string, got %s\n", buffer); r = MsiSetPropertyA(hpkg, "dantes", "mercedes"); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); Modified: trunk/rostests/winetests/msi/source.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/msi/source.c?re…
============================================================================== --- trunk/rostests/winetests/msi/source.c [iso-8859-1] (original) +++ trunk/rostests/winetests/msi/source.c [iso-8859-1] Mon Mar 9 20:28:54 2015 @@ -175,7 +175,7 @@ } if (!expected) - ok_(__FILE__, line)(lstrlenA(val) == 0, "Expected empty string, got %s\n", val); + ok_(__FILE__, line)(!val[0], "Expected empty string, got %s\n", val); else { if (bcase)
9 years, 9 months
1
0
0
0
[akhaldi] 66632: [MSI] Sync with Wine Staging 1.7.37. CORE-9246
by akhaldi@svn.reactos.org
Author: akhaldi Date: Mon Mar 9 20:28:19 2015 New Revision: 66632 URL:
http://svn.reactos.org/svn/reactos?rev=66632&view=rev
Log: [MSI] Sync with Wine Staging 1.7.37. CORE-9246 Modified: trunk/reactos/dll/win32/msi/action.c trunk/reactos/dll/win32/msi/assembly.c trunk/reactos/dll/win32/msi/database.c trunk/reactos/dll/win32/msi/dialog.c trunk/reactos/dll/win32/msi/media.c trunk/reactos/dll/win32/msi/msi.c trunk/reactos/dll/win32/msi/msi.rc trunk/reactos/dll/win32/msi/msi.spec trunk/reactos/dll/win32/msi/msipriv.h trunk/reactos/dll/win32/msi/msiquery.c trunk/reactos/dll/win32/msi/package.c trunk/reactos/dll/win32/msi/patch.c trunk/reactos/dll/win32/msi/registry.c trunk/reactos/dll/win32/msi/script.c trunk/reactos/dll/win32/msi/storages.c trunk/reactos/dll/win32/msi/streams.c trunk/reactos/dll/win32/msi/string.c trunk/reactos/dll/win32/msi/table.c 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] Mon Mar 9 20:28:19 2015 @@ -2407,7 +2407,6 @@ sprintfW( buf, fmtW, free.QuadPart / 512 ); msi_set_property( package->db, szPrimaryVolumeSpaceAvailable, buf, -1 ); } - toupperW( primary_folder[0] ); msi_set_property( package->db, szPrimaryVolumePath, primary_folder, 2 ); } msi_free( primary_folder ); @@ -2422,9 +2421,9 @@ return MSI_SetFeatureStates(package); } -static BYTE *parse_value( MSIPACKAGE *package, const WCHAR *value, DWORD *type, DWORD *size ) -{ - BYTE *data = NULL; +static BYTE *parse_value( MSIPACKAGE *package, const WCHAR *value, DWORD len, DWORD *type, DWORD *size ) +{ + BYTE *data; if (!value) { @@ -2513,19 +2512,18 @@ else { const WCHAR *ptr = value; - DWORD len; *type = REG_SZ; if (value[0] == '#') { - ptr++; + ptr++; len--; if (value[1] == '%') { - ptr++; + ptr++; len--; *type = REG_EXPAND_SZ; } } - len = deformat_string( package, ptr, (WCHAR **)&data ); + data = (BYTE *)msi_strdupW( ptr, len ); if (len > strlenW( (const WCHAR *)data )) *type = REG_MULTI_SZ; *size = (len + 1) * sizeof(WCHAR); } @@ -2574,38 +2572,22 @@ return ret; } -static WCHAR *get_keypath( MSICOMPONENT *comp, HKEY root, const WCHAR *path ) -{ - static const WCHAR prefixW[] = {'S','O','F','T','W','A','R','E','\\'}; - static const UINT len = sizeof(prefixW) / sizeof(prefixW[0]); - - if ((is_64bit || is_wow64) && - !(comp->Attributes & msidbComponentAttributes64bit) && - root == HKEY_LOCAL_MACHINE && !strncmpiW( path, prefixW, len )) - { - UINT size; - WCHAR *path_32node; - - size = (strlenW( path ) + strlenW( szWow6432Node ) + 2) * sizeof(WCHAR); - if (!(path_32node = msi_alloc( size ))) return NULL; - - memcpy( path_32node, path, len * sizeof(WCHAR) ); - strcpyW( path_32node + len, szWow6432Node ); - strcatW( path_32node, szBackSlash ); - strcatW( path_32node, path + len ); - return path_32node; - } - return strdupW( path ); -} - -static HKEY open_key( HKEY root, const WCHAR *path, BOOL create ) +static inline REGSAM get_registry_view( const MSICOMPONENT *comp ) +{ + REGSAM view = 0; + if (is_wow64 || is_64bit) + view |= (comp->Attributes & msidbComponentAttributes64bit) ? KEY_WOW64_64KEY : KEY_WOW64_32KEY; + return view; +} + +static HKEY open_key( const MSICOMPONENT *comp, HKEY root, const WCHAR *path, BOOL create ) { REGSAM access = KEY_ALL_ACCESS; WCHAR *subkey, *p, *q; HKEY hkey, ret = NULL; LONG res; - if (is_wow64) access |= KEY_WOW64_64KEY; + access |= get_registry_view( comp ); if (!(subkey = strdupW( path ))) return NULL; p = subkey; @@ -2622,7 +2604,7 @@ } if (q && q[1]) { - ret = open_key( hkey, q + 1, create ); + ret = open_key( comp, hkey, q + 1, create ); RegCloseKey( hkey ); } else ret = hkey; @@ -2803,7 +2785,7 @@ BYTE *new_value, *old_value = NULL; HKEY root_key, hkey; DWORD type, old_type, new_size, old_size = 0; - LPWSTR deformated, uikey, keypath; + LPWSTR deformated, uikey; const WCHAR *szRoot, *component, *name, *key, *str; MSICOMPONENT *comp; MSIRECORD * uirow; @@ -2847,23 +2829,19 @@ strcpyW(uikey,szRoot); strcatW(uikey,deformated); - keypath = get_keypath( comp, root_key, deformated ); + if (!(hkey = open_key( comp, root_key, deformated, TRUE ))) + { + ERR("Could not create key %s\n", debugstr_w(deformated)); + msi_free(uikey); + msi_free(deformated); + return ERROR_FUNCTION_FAILED; + } msi_free( deformated ); - if (!(hkey = open_key( root_key, keypath, TRUE ))) - { - ERR("Could not create key %s\n", debugstr_w(keypath)); - msi_free(uikey); - msi_free(keypath); - return ERROR_FUNCTION_FAILED; - } - str = msi_record_get_string( row, 5, &len ); - if (str && len > strlenW( str )) - { - type = REG_MULTI_SZ; - new_size = (len + 1) * sizeof(WCHAR); - new_value = (BYTE *)msi_strdupW( str, len ); - } - else new_value = parse_value( package, str, &type, &new_size ); + str = msi_record_get_string( row, 5, NULL ); + len = deformat_string( package, str, &deformated ); + new_value = parse_value( package, deformated, len, &type, &new_size ); + + msi_free( deformated ); deformat_string(package, name, &deformated); if (!is_special_entry( name )) @@ -2911,7 +2889,6 @@ msi_free(old_value); msi_free(deformated); msi_free(uikey); - msi_free(keypath); return ERROR_SUCCESS; } @@ -2933,20 +2910,20 @@ return rc; } -static void delete_key( HKEY root, const WCHAR *path ) +static void delete_key( const MSICOMPONENT *comp, HKEY root, const WCHAR *path ) { REGSAM access = 0; WCHAR *subkey, *p; HKEY hkey; LONG res; - if (is_wow64) access |= KEY_WOW64_64KEY; + access |= get_registry_view( comp ); if (!(subkey = strdupW( path ))) return; for (;;) { if ((p = strrchrW( subkey, '\\' ))) *p = 0; - hkey = open_key( root, subkey, FALSE ); + hkey = open_key( comp, root, subkey, FALSE ); if (!hkey) break; if (p && p[1]) res = RegDeleteKeyExW( hkey, p + 1, access, 0 ); @@ -2963,13 +2940,13 @@ msi_free( subkey ); } -static void delete_value( HKEY root, const WCHAR *path, const WCHAR *value ) +static void delete_value( const MSICOMPONENT *comp, HKEY root, const WCHAR *path, const WCHAR *value ) { LONG res; HKEY hkey; DWORD num_subkeys, num_values; - if ((hkey = open_key( root, path, FALSE ))) + if ((hkey = open_key( comp, root, path, FALSE ))) { if ((res = RegDeleteValueW( hkey, value ))) TRACE("failed to delete value %s (%d)\n", debugstr_w(value), res); @@ -2980,20 +2957,20 @@ if (!res && !num_subkeys && !num_values) { TRACE("removing empty key %s\n", debugstr_w(path)); - delete_key( root, path ); - } - } -} - -static void delete_tree( HKEY root, const WCHAR *path ) + delete_key( comp, root, path ); + } + } +} + +static void delete_tree( const MSICOMPONENT *comp, HKEY root, const WCHAR *path ) { LONG res; HKEY hkey; - if (!(hkey = open_key( root, path, FALSE ))) return; + if (!(hkey = open_key( comp, root, path, FALSE ))) return; res = SHDeleteKeyW( hkey, NULL ); if (res) TRACE("failed to delete subtree of %s (%d)\n", debugstr_w(path), res); - delete_key( root, path ); + delete_key( comp, root, path ); RegCloseKey( hkey ); } @@ -3001,7 +2978,7 @@ { MSIPACKAGE *package = param; LPCWSTR component, name, key_str, root_key_str; - LPWSTR deformated_key, deformated_name, ui_key_str, keypath; + LPWSTR deformated_key, deformated_name, ui_key_str; MSICOMPONENT *comp; MSIRECORD *uirow; BOOL delete_key = FALSE; @@ -3050,11 +3027,9 @@ deformat_string( package, name, &deformated_name ); - keypath = get_keypath( comp, hkey_root, deformated_key ); + if (delete_key) delete_tree( comp, hkey_root, deformated_key ); + else delete_value( comp, hkey_root, deformated_key, deformated_name ); msi_free( deformated_key ); - if (delete_key) delete_tree( hkey_root, keypath ); - else delete_value( hkey_root, keypath, deformated_name ); - msi_free( keypath ); uirow = MSI_CreateRecord( 2 ); MSI_RecordSetStringW( uirow, 1, ui_key_str ); @@ -3071,7 +3046,7 @@ { MSIPACKAGE *package = param; LPCWSTR component, name, key_str, root_key_str; - LPWSTR deformated_key, deformated_name, ui_key_str, keypath; + LPWSTR deformated_key, deformated_name, ui_key_str; MSICOMPONENT *comp; MSIRECORD *uirow; BOOL delete_key = FALSE; @@ -3115,11 +3090,9 @@ deformat_string( package, name, &deformated_name ); - keypath = get_keypath( comp, hkey_root, deformated_key ); + if (delete_key) delete_tree( comp, hkey_root, deformated_key ); + else delete_value( comp, hkey_root, deformated_key, deformated_name ); msi_free( deformated_key ); - if (delete_key) delete_tree( hkey_root, keypath ); - else delete_value( hkey_root, keypath, deformated_name ); - msi_free( keypath ); uirow = MSI_CreateRecord( 2 ); MSI_RecordSetStringW( uirow, 1, ui_key_str ); @@ -5300,7 +5273,7 @@ WCHAR *remove; /* first do the same as an InstallExecute */ - rc = ACTION_InstallExecute(package); + rc = execute_script(package, SCRIPT_INSTALL); if (rc != ERROR_SUCCESS) return rc; @@ -5940,23 +5913,20 @@ if (!comp) return ERROR_SUCCESS; + event = MSI_RecordGetInteger( rec, 3 ); + deformat_string( package, MSI_RecordGetString( rec, 2 ), &name ); + comp->Action = msi_get_component_action( package, comp ); - if (comp->Action != INSTALLSTATE_LOCAL) - { - TRACE("component not scheduled for installation %s\n", debugstr_w(component)); - return ERROR_SUCCESS; - } - - deformat_string(package, MSI_RecordGetString(rec, 2), &name); + if (!(comp->Action == INSTALLSTATE_LOCAL && (event & msidbServiceControlEventStart)) && + !(comp->Action == INSTALLSTATE_ABSENT && (event & msidbServiceControlEventUninstallStart))) + { + TRACE("not starting %s\n", debugstr_w(name)); + msi_free( name ); + return ERROR_SUCCESS; + } + deformat_string(package, MSI_RecordGetString(rec, 4), &args); - event = MSI_RecordGetInteger(rec, 3); wait = MSI_RecordGetInteger(rec, 5); - - if (!(event & msidbServiceControlEventStart)) - { - r = ERROR_SUCCESS; - goto done; - } scm = OpenSCManagerW(NULL, NULL, SC_MANAGER_CONNECT); if (!scm) @@ -6147,23 +6117,24 @@ MSICOMPONENT *comp; MSIRECORD *uirow; LPCWSTR component; - LPWSTR name = NULL, display_name = NULL; + WCHAR *name, *display_name = NULL; DWORD event, len; SC_HANDLE scm; - - event = MSI_RecordGetInteger( rec, 3 ); - if (!(event & msidbServiceControlEventStop)) - return ERROR_SUCCESS; component = MSI_RecordGetString( rec, 6 ); comp = msi_get_loaded_component( package, component ); if (!comp) return ERROR_SUCCESS; + event = MSI_RecordGetInteger( rec, 3 ); + deformat_string( package, MSI_RecordGetString( rec, 2 ), &name ); + comp->Action = msi_get_component_action( package, comp ); - if (comp->Action != INSTALLSTATE_ABSENT) - { - TRACE("component not scheduled for removal %s\n", debugstr_w(component)); + if (!(comp->Action == INSTALLSTATE_LOCAL && (event & msidbServiceControlEventStop)) && + !(comp->Action == INSTALLSTATE_ABSENT && (event & msidbServiceControlEventUninstallStop))) + { + TRACE("not stopping %s\n", debugstr_w(name)); + msi_free( name ); return ERROR_SUCCESS; } @@ -6183,7 +6154,6 @@ } CloseServiceHandle( scm ); - deformat_string( package, MSI_RecordGetString( rec, 2 ), &name ); stop_service( name ); done: @@ -6982,6 +6952,7 @@ data = msi_alloc(size); if (!data) { + msi_free(deformatted); RegCloseKey(env); return ERROR_OUTOFMEMORY; } @@ -7801,10 +7772,7 @@ 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 ); msi_set_context( package ); Modified: trunk/reactos/dll/win32/msi/assembly.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msi/assembly.c?r…
============================================================================== --- trunk/reactos/dll/win32/msi/assembly.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msi/assembly.c [iso-8859-1] Mon Mar 9 20:28:19 2015 @@ -242,7 +242,7 @@ memset( &info, 0, sizeof(info) ); info.cbAssemblyInfo = sizeof(info); hr = IAssemblyCache_QueryAssemblyInfo( cache, 0, display_name, &info ); - if (hr == S_OK /* sxs version */ || hr == HRESULT_FROM_WIN32( ERROR_INSUFFICIENT_BUFFER )) + if (hr == S_OK /* sxs version */ || hr == E_NOT_SUFFICIENT_BUFFER) { return (info.dwAssemblyFlags == ASSEMBLYINFO_FLAG_INSTALLED); } @@ -348,7 +348,7 @@ if (!pGetFileVersion) return CLR_VERSION_V10; hr = pGetFileVersion( filename, NULL, 0, &len ); - if (hr != HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER)) return CLR_VERSION_V11; + if (hr != E_NOT_SUFFICIENT_BUFFER) return CLR_VERSION_V11; if ((strW = msi_alloc( len * sizeof(WCHAR) ))) { hr = pGetFileVersion( filename, strW, len, &len ); Modified: trunk/reactos/dll/win32/msi/database.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msi/database.c?r…
============================================================================== --- trunk/reactos/dll/win32/msi/database.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msi/database.c [iso-8859-1] Mon Mar 9 20:28:19 2015 @@ -36,179 +36,25 @@ #define IS_INTMSIDBOPEN(x) (((ULONG_PTR)(x) >> 16) == 0) -typedef struct tagMSITRANSFORM { - struct list entry; - IStorage *stg; -} MSITRANSFORM; - -typedef struct tagMSISTREAM { - struct list entry; - IStorage *stg; - IStream *stm; -} MSISTREAM; - -static UINT find_open_stream( MSIDATABASE *db, IStorage *stg, LPCWSTR name, IStream **stm ) -{ - MSISTREAM *stream; - - LIST_FOR_EACH_ENTRY( stream, &db->streams, MSISTREAM, entry ) - { - HRESULT r; - STATSTG stat; - - if (stream->stg != stg) continue; - - r = IStream_Stat( stream->stm, &stat, 0 ); - if( FAILED( r ) ) - { - WARN("failed to stat stream r = %08x!\n", r); - continue; - } - - if( !strcmpW( name, stat.pwcsName ) ) - { - TRACE("found %s\n", debugstr_w(name)); - *stm = stream->stm; - CoTaskMemFree( stat.pwcsName ); - return ERROR_SUCCESS; - } - - CoTaskMemFree( stat.pwcsName ); - } - - return ERROR_FUNCTION_FAILED; -} - -UINT msi_clone_open_stream( MSIDATABASE *db, IStorage *stg, LPCWSTR name, IStream **stm ) -{ - IStream *stream; - - if (find_open_stream( db, stg, name, &stream ) == ERROR_SUCCESS) - { - HRESULT r; - LARGE_INTEGER pos; - - r = IStream_Clone( stream, stm ); - if( FAILED( r ) ) - { - WARN("failed to clone stream r = %08x!\n", r); - return ERROR_FUNCTION_FAILED; - } - - pos.QuadPart = 0; - r = IStream_Seek( *stm, pos, STREAM_SEEK_SET, NULL ); - if( FAILED( r ) ) - { - IStream_Release( *stm ); - return ERROR_FUNCTION_FAILED; - } - - return ERROR_SUCCESS; - } - - return ERROR_FUNCTION_FAILED; -} - -UINT msi_get_raw_stream( MSIDATABASE *db, LPCWSTR stname, IStream **stm ) -{ - HRESULT r; - IStorage *stg; - WCHAR decoded[MAX_STREAM_NAME_LEN + 1]; - - decode_streamname( stname, decoded ); - TRACE("%s -> %s\n", debugstr_w(stname), debugstr_w(decoded)); - - if (msi_clone_open_stream( db, db->storage, stname, stm ) == ERROR_SUCCESS) - return ERROR_SUCCESS; - - r = IStorage_OpenStream( db->storage, stname, NULL, - STGM_READ | STGM_SHARE_EXCLUSIVE, 0, stm ); - if( FAILED( r ) ) - { - MSITRANSFORM *transform; - - LIST_FOR_EACH_ENTRY( transform, &db->transforms, MSITRANSFORM, entry ) - { - r = IStorage_OpenStream( transform->stg, stname, NULL, - STGM_READ | STGM_SHARE_EXCLUSIVE, 0, stm ); - if (SUCCEEDED(r)) - { - stg = transform->stg; - break; - } - } - } - else stg = db->storage; - - if( SUCCEEDED(r) ) - { - MSISTREAM *stream; - - if (!(stream = msi_alloc( sizeof(MSISTREAM) ))) return ERROR_NOT_ENOUGH_MEMORY; - stream->stg = stg; - IStorage_AddRef( stg ); - stream->stm = *stm; - IStream_AddRef( *stm ); - list_add_tail( &db->streams, &stream->entry ); - } - - return SUCCEEDED(r) ? ERROR_SUCCESS : ERROR_FUNCTION_FAILED; -} - static void free_transforms( MSIDATABASE *db ) { while( !list_empty( &db->transforms ) ) { - MSITRANSFORM *t = LIST_ENTRY( list_head( &db->transforms ), - MSITRANSFORM, entry ); + MSITRANSFORM *t = LIST_ENTRY( list_head( &db->transforms ), MSITRANSFORM, entry ); list_remove( &t->entry ); IStorage_Release( t->stg ); msi_free( t ); } } -void msi_destroy_stream( MSIDATABASE *db, const WCHAR *stname ) -{ - MSISTREAM *stream, *stream2; - - LIST_FOR_EACH_ENTRY_SAFE( stream, stream2, &db->streams, MSISTREAM, entry ) - { - HRESULT r; - STATSTG stat; - - r = IStream_Stat( stream->stm, &stat, 0 ); - if (FAILED(r)) - { - WARN("failed to stat stream r = %08x\n", r); - continue; - } - - if (!strcmpW( stname, stat.pwcsName )) - { - TRACE("destroying %s\n", debugstr_w(stname)); - - list_remove( &stream->entry ); - IStream_Release( stream->stm ); - IStorage_Release( stream->stg ); - IStorage_DestroyElement( stream->stg, stname ); - msi_free( stream ); - CoTaskMemFree( stat.pwcsName ); - break; - } - CoTaskMemFree( stat.pwcsName ); - } -} - static void free_streams( MSIDATABASE *db ) { - while( !list_empty( &db->streams ) ) - { - MSISTREAM *s = LIST_ENTRY(list_head( &db->streams ), MSISTREAM, entry); - list_remove( &s->entry ); - IStream_Release( s->stm ); - IStorage_Release( s->stg ); - msi_free( s ); - } + UINT i; + for (i = 0; i < db->num_streams; i++) + { + if (db->streams[i].stream) IStream_Release( db->streams[i].stream ); + } + msi_free( db->streams ); } void append_storage_to_db( MSIDATABASE *db, IStorage *stg ) @@ -219,18 +65,15 @@ t->stg = stg; IStorage_AddRef( stg ); list_add_head( &db->transforms, &t->entry ); - - /* the transform may add or replace streams */ +} + +static VOID MSI_CloseDatabase( MSIOBJECTHDR *arg ) +{ + MSIDATABASE *db = (MSIDATABASE *) arg; + + msi_free(db->path); free_streams( db ); -} - -static VOID MSI_CloseDatabase( MSIOBJECTHDR *arg ) -{ - MSIDATABASE *db = (MSIDATABASE *) arg; - - msi_free(db->path); free_cached_tables( db ); - free_streams( db ); free_transforms( db ); if (db->strings) msi_destroy_stringtable( db->strings ); IStorage_Release( db->storage ); @@ -413,7 +256,6 @@ db->deletefile = strdupW( szDBPath ); list_init( &db->tables ); list_init( &db->transforms ); - list_init( &db->streams ); db->strings = msi_load_string_table( stg, &db->bytes_per_strref ); if( !db->strings ) 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] Mon Mar 9 20:28:19 2015 @@ -135,7 +135,6 @@ static const WCHAR szVolumeSelectCombo[] = { 'V','o','l','u','m','e','S','e','l','e','c','t','C','o','m','b','o',0 }; static const WCHAR szSelectionDescription[] = {'S','e','l','e','c','t','i','o','n','D','e','s','c','r','i','p','t','i','o','n',0}; static const WCHAR szSelectionPath[] = {'S','e','l','e','c','t','i','o','n','P','a','t','h',0}; -static const WCHAR szProperty[] = {'P','r','o','p','e','r','t','y',0}; static const WCHAR szHyperLink[] = {'H','y','p','e','r','L','i','n','k',0}; /* dialog sequencing */ @@ -2152,7 +2151,7 @@ /* FIXME: test when this should fail */ static BOOL msi_dialog_verify_path( LPWSTR path ) { - if ( !lstrlenW( path ) ) + if ( !path[0] ) return FALSE; if ( PathIsRelativeW( path ) ) Modified: trunk/reactos/dll/win32/msi/media.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msi/media.c?rev=…
============================================================================== --- trunk/reactos/dll/win32/msi/media.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msi/media.c [iso-8859-1] Mon Mar 9 20:28:19 2015 @@ -216,15 +216,12 @@ WARN("failed to encode stream name\n"); return -1; } - if (msi_clone_open_stream( package_disk.package->db, cab->storage, encoded, &stream ) != ERROR_SUCCESS) - { - hr = IStorage_OpenStream( cab->storage, encoded, NULL, STGM_READ|STGM_SHARE_EXCLUSIVE, 0, &stream ); - if (FAILED(hr)) - { - WARN("failed to open stream 0x%08x\n", hr); - msi_free( encoded ); - return -1; - } + hr = IStorage_OpenStream( cab->storage, encoded, NULL, STGM_READ|STGM_SHARE_EXCLUSIVE, 0, &stream ); + if (FAILED(hr)) + { + WARN("failed to open stream 0x%08x\n", hr); + msi_free( encoded ); + return -1; } msi_free( encoded ); return (INT_PTR)stream; @@ -286,9 +283,6 @@ mi->disk_prompt = strdupW(MSI_RecordGetString(row, 3)); mi->cabinet = strdupW(MSI_RecordGetString(row, 4)); mi->volume_label = strdupW(MSI_RecordGetString(row, 5)); - - if (!mi->first_volume) - mi->first_volume = strdupW(mi->volume_label); msiobj_release(&row->hdr); return ERROR_SUCCESS; @@ -662,7 +656,6 @@ msi_free(mi->disk_prompt); msi_free(mi->cabinet); msi_free(mi->volume_label); - msi_free(mi->first_volume); msi_free(mi); } @@ -707,9 +700,6 @@ msi_free(mi->volume_label); mi->volume_label = strdupW(MSI_RecordGetString(row, 5)); msiobj_release(&row->hdr); - - if (!mi->first_volume) - mi->first_volume = strdupW(mi->volume_label); msi_set_sourcedir_props(package, FALSE); source_dir = msi_dup_property(package->db, szSourceDir); @@ -880,7 +870,7 @@ } } /* check volume matches, change media if not */ - if (mi->volume_label && mi->disk_id > 1 && strcmpW( mi->first_volume, mi->volume_label )) + if (mi->volume_label && mi->disk_id > 1) { WCHAR *source = msi_dup_property( package->db, szSourceDir ); BOOL match = source_matches_volume( mi, source ); Modified: trunk/reactos/dll/win32/msi/msi.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msi/msi.c?rev=66…
============================================================================== --- trunk/reactos/dll/win32/msi/msi.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msi/msi.c [iso-8859-1] Mon Mar 9 20:28:19 2015 @@ -1737,10 +1737,6 @@ { datakey = patch; szProperty = szInstalled; - } - else if (!strcmpW( szProperty, INSTALLPROPERTY_LOCALPACKAGEW )) - { - datakey = udpatch; } else if (!strcmpW( szProperty, INSTALLPROPERTY_UNINSTALLABLEW ) || !strcmpW( szProperty, INSTALLPROPERTY_PATCHSTATEW ) || @@ -4178,6 +4174,92 @@ return ERROR_SUCCESS; } +UINT WINAPI MsiProvideComponentA( LPCSTR product, LPCSTR feature, LPCSTR component, DWORD mode, LPSTR buf, LPDWORD buflen ) +{ + WCHAR *productW = NULL, *componentW = NULL, *featureW = NULL, *bufW = NULL; + UINT r = ERROR_OUTOFMEMORY; + DWORD lenW; + int len; + + TRACE("%s, %s, %s, %x, %p, %p\n", debugstr_a(product), debugstr_a(component), debugstr_a(feature), mode, buf, buflen); + + if (product && !(productW = strdupAtoW( product ))) goto done; + if (feature && !(featureW = strdupAtoW( feature ))) goto done; + if (component && !(componentW = strdupAtoW( component ))) goto done; + + r = MsiProvideComponentW( productW, featureW, componentW, mode, NULL, &lenW ); + if (r != ERROR_SUCCESS) + goto done; + + if (!(bufW = msi_alloc( ++lenW * sizeof(WCHAR) ))) + { + r = ERROR_OUTOFMEMORY; + goto done; + } + + r = MsiProvideComponentW( productW, featureW, componentW, mode, bufW, &lenW ); + if (r != ERROR_SUCCESS) + goto done; + + len = WideCharToMultiByte( CP_ACP, 0, bufW, -1, NULL, 0, NULL, NULL ); + if (buf) + { + if (len > *buflen) + r = ERROR_MORE_DATA; + else + WideCharToMultiByte( CP_ACP, 0, bufW, -1, buf, *buflen, NULL, NULL ); + } + + *buflen = len - 1; + +done: + msi_free( productW ); + msi_free( featureW ); + msi_free( componentW ); + msi_free( bufW ); + return r; +} + +UINT WINAPI MsiProvideComponentW( LPCWSTR product, LPCWSTR feature, LPCWSTR component, DWORD mode, LPWSTR buf, LPDWORD buflen ) +{ + INSTALLSTATE state; + + TRACE("%s, %s, %s, %x, %p, %p\n", debugstr_w(product), debugstr_w(component), debugstr_w(feature), mode, buf, buflen); + + state = MsiQueryFeatureStateW( product, feature ); + TRACE("feature state: %d\n", state); + switch (mode) + { + case INSTALLMODE_NODETECTION: + break; + + default: + FIXME("mode %x not implemented\n", mode); + return ERROR_INSTALL_FAILURE; + } + + state = MsiGetComponentPathW( product, component, buf, buflen ); + TRACE("component state: %d\n", state); + switch (state) + { + case INSTALLSTATE_INVALIDARG: + return ERROR_INVALID_PARAMETER; + + case INSTALLSTATE_MOREDATA: + return ERROR_MORE_DATA; + + case INSTALLSTATE_ADVERTISED: + case INSTALLSTATE_LOCAL: + case INSTALLSTATE_SOURCE: + MsiUseFeatureW( product, feature ); + return ERROR_SUCCESS; + + default: + TRACE("MsiGetComponentPathW returned %d\n", state); + return ERROR_INSTALL_FAILURE; + } +} + /*********************************************************************** * MsiBeginTransactionA [MSI.@] */ @@ -4224,3 +4306,21 @@ FIXME("%p,%p,%p,%08x\n", a, b, c, d); return ERROR_SUCCESS; } + +/*********************************************************************** + * MsiRemovePatchesA [MSI.@] + */ +UINT WINAPI MsiRemovePatchesA(LPCSTR patchlist, LPCSTR product, INSTALLTYPE type, LPCSTR propertylist) +{ + FIXME("(%s %s %d %s\n", debugstr_a(patchlist), debugstr_a(product), type, debugstr_a(propertylist)); + return ERROR_SUCCESS; +} + +/*********************************************************************** + * MsiRemovePatchesW [MSI.@] + */ +UINT WINAPI MsiRemovePatchesW(LPCWSTR patchlist, LPCWSTR product, INSTALLTYPE type, LPCWSTR propertylist) +{ + FIXME("(%s %s %d %s\n", debugstr_w(patchlist), debugstr_w(product), type, debugstr_w(propertylist)); + return ERROR_SUCCESS; +} Modified: trunk/reactos/dll/win32/msi/msi.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msi/msi.rc?rev=6…
============================================================================== --- trunk/reactos/dll/win32/msi/msi.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msi/msi.rc [iso-8859-1] Mon Mar 9 20:28:19 2015 @@ -84,9 +84,9 @@ #define WINE_FILEDESCRIPTION_STR "Wine MSI dll" #define WINE_FILENAME_STR "msi.dll" -#define WINE_FILEVERSION 4,5,6001,22299 -#define WINE_FILEVERSION_STR "4.5.6001.22299" -#define WINE_PRODUCTVERSION 4,5,6001,22299 -#define WINE_PRODUCTVERSION_STR "4.5.6001.22299" +#define WINE_FILEVERSION 4,5,6001,22308 +#define WINE_FILEVERSION_STR "4.5.6001.22308" +#define WINE_PRODUCTVERSION 4,5,6001,22308 +#define WINE_PRODUCTVERSION_STR "4.5.6001.22308" #include <wine/wine_common_ver.rc> 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] Mon Mar 9 20:28:19 2015 @@ -97,10 +97,10 @@ 101 stub MsiProcessAdvertiseScriptA 102 stub MsiProcessAdvertiseScriptW 103 stdcall MsiProcessMessage(long long long) -104 stub MsiProvideComponentA +104 stdcall MsiProvideComponentA(str str str long ptr ptr) 105 stdcall MsiProvideComponentFromDescriptorA(str ptr ptr ptr) 106 stdcall MsiProvideComponentFromDescriptorW(wstr ptr ptr ptr) -107 stub MsiProvideComponentW +107 stdcall MsiProvideComponentW(wstr wstr wstr long ptr ptr) 108 stdcall MsiProvideQualifiedComponentA(str str long ptr ptr) 109 stdcall MsiProvideQualifiedComponentW(wstr wstr long ptr ptr) 110 stdcall MsiQueryFeatureStateA(str str) @@ -230,8 +230,8 @@ 234 stub MsiDeleteUserDataW 235 stub Migrate10CachedPackagesA 236 stdcall Migrate10CachedPackagesW(ptr ptr ptr long) -237 stub MsiRemovePatchesA -238 stub MsiRemovePatchesW +237 stdcall MsiRemovePatchesA(str str long str) +238 stdcall MsiRemovePatchesW(wstr wstr long wstr) 239 stdcall MsiApplyMultiplePatchesA(str str str) 240 stdcall MsiApplyMultiplePatchesW(wstr wstr wstr) 241 stub MsiExtractPatchXMLDataA @@ -281,9 +281,16 @@ 285 stdcall MsiBeginTransactionW(wstr long ptr ptr) 286 stdcall MsiEndTransaction(long) 287 stub MsiJoinTransaction -288 stub QueryInstanceCount +288 stub MsiSetOfflineContextW +289 stdcall MsiEnumComponentsExA(str long long ptr ptr ptr ptr) +290 stdcall MsiEnumComponentsExW(wstr long long ptr ptr ptr ptr) +291 stdcall MsiEnumClientsExA(str str long long ptr ptr ptr ptr) +292 stdcall MsiEnumClientsExW(wstr wstr long long ptr ptr ptr ptr) +293 stub MsiGetComponentPathExA +294 stub MsiGetComponentPathExW +295 stub QueryInstanceCount + @ stdcall -private DllCanUnloadNow() @ stdcall -private DllGetClassObject(ptr ptr ptr) @ stdcall -private DllRegisterServer() @ stdcall -private DllUnregisterServer() - 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] Mon Mar 9 20:28:19 2015 @@ -94,6 +94,18 @@ #define MSI_INITIAL_MEDIA_TRANSFORM_OFFSET 10000 #define MSI_INITIAL_MEDIA_TRANSFORM_DISKID 30000 +typedef struct tagMSISTREAM +{ + UINT str_index; + IStream *stream; +} MSISTREAM; + +typedef struct tagMSITRANSFORM +{ + struct list entry; + IStorage *stg; +} MSITRANSFORM; + typedef struct tagMSIDATABASE { MSIOBJECTHDR hdr; @@ -107,7 +119,9 @@ UINT media_transform_disk_id; struct list tables; struct list transforms; - struct list streams; + MSISTREAM *streams; + UINT num_streams; + UINT num_streams_allocated; } MSIDATABASE; typedef struct tagMSIVIEW MSIVIEW; @@ -168,7 +182,6 @@ UINT last_sequence; LPWSTR disk_prompt; LPWSTR cabinet; - LPWSTR first_volume; LPWSTR volume_label; BOOL is_continuous; BOOL is_extracted; @@ -757,6 +770,7 @@ extern void free_cached_tables( MSIDATABASE *db ) DECLSPEC_HIDDEN; extern UINT MSI_CommitTables( MSIDATABASE *db ) DECLSPEC_HIDDEN; +extern UINT msi_commit_streams( MSIDATABASE *db ) DECLSPEC_HIDDEN; /* string table functions */ @@ -766,7 +780,7 @@ StringNonPersistent = 1 }; -extern BOOL msi_addstringW( string_table *st, const WCHAR *data, int len, USHORT refcount, enum StringPersistence persistence ) DECLSPEC_HIDDEN; +extern BOOL msi_add_string( string_table *st, const WCHAR *data, int len, enum StringPersistence persistence ) DECLSPEC_HIDDEN; extern UINT msi_string2id( const string_table *st, const WCHAR *data, int len, UINT *id ) DECLSPEC_HIDDEN; extern VOID msi_destroy_stringtable( string_table *st ) DECLSPEC_HIDDEN; extern const WCHAR *msi_string_lookup( const string_table *st, UINT id, int *len ) DECLSPEC_HIDDEN; @@ -844,9 +858,7 @@ extern BOOL decode_streamname(LPCWSTR in, LPWSTR out) DECLSPEC_HIDDEN; /* database internals */ -extern UINT msi_get_raw_stream( MSIDATABASE *, LPCWSTR, IStream ** ) DECLSPEC_HIDDEN; -extern UINT msi_clone_open_stream( MSIDATABASE *, IStorage *, const WCHAR *, IStream ** ) DECLSPEC_HIDDEN; -void msi_destroy_stream( MSIDATABASE *, const WCHAR * ) DECLSPEC_HIDDEN; +extern UINT msi_get_stream( MSIDATABASE *, const WCHAR *, IStream ** ) DECLSPEC_HIDDEN; extern UINT MSI_OpenDatabaseW( LPCWSTR, LPCWSTR, MSIDATABASE ** ) DECLSPEC_HIDDEN; extern UINT MSI_DatabaseOpenViewW(MSIDATABASE *, LPCWSTR, MSIQUERY ** ) DECLSPEC_HIDDEN; extern UINT MSI_OpenQuery( MSIDATABASE *, MSIQUERY **, LPCWSTR, ... ) DECLSPEC_HIDDEN; @@ -879,7 +891,7 @@ extern UINT msi_download_file( LPCWSTR szUrl, LPWSTR filename ) DECLSPEC_HIDDEN; extern UINT msi_package_add_info(MSIPACKAGE *, DWORD, DWORD, LPCWSTR, LPWSTR) DECLSPEC_HIDDEN; extern UINT msi_package_add_media_disk(MSIPACKAGE *, DWORD, DWORD, DWORD, LPWSTR, LPWSTR) DECLSPEC_HIDDEN; -extern UINT msi_clone_properties(MSIPACKAGE *) DECLSPEC_HIDDEN; +extern UINT msi_clone_properties(MSIDATABASE *) DECLSPEC_HIDDEN; extern UINT msi_set_context(MSIPACKAGE *) DECLSPEC_HIDDEN; extern void msi_adjust_privilege_properties(MSIPACKAGE *) DECLSPEC_HIDDEN; extern UINT MSI_GetFeatureCost(MSIPACKAGE *, MSIFEATURE *, MSICOSTTREE, INSTALLSTATE, LPINT) DECLSPEC_HIDDEN; @@ -955,6 +967,7 @@ extern INT msi_suminfo_get_int32( MSISUMMARYINFO *si, UINT uiProperty ) DECLSPEC_HIDDEN; extern LPWSTR msi_get_suminfo_product( IStorage *stg ) DECLSPEC_HIDDEN; extern UINT msi_add_suminfo( MSIDATABASE *db, LPWSTR **records, int num_records, int num_columns ) DECLSPEC_HIDDEN; +extern enum platform parse_platform( const WCHAR *str ) DECLSPEC_HIDDEN; /* undocumented functions */ UINT WINAPI MsiCreateAndVerifyInstallerDirectory( DWORD ); @@ -1173,7 +1186,6 @@ static const WCHAR szAMD64[] = {'A','M','D','6','4',0}; static const WCHAR szARM[] = {'A','r','m',0}; static const WCHAR szWow6432NodeCLSID[] = {'W','o','w','6','4','3','2','N','o','d','e','\\','C','L','S','I','D',0}; -static const WCHAR szWow6432Node[] = {'W','o','w','6','4','3','2','N','o','d','e',0}; static const WCHAR szStreams[] = {'_','S','t','r','e','a','m','s',0}; static const WCHAR szStorages[] = {'_','S','t','o','r','a','g','e','s',0}; static const WCHAR szMsiPublishAssemblies[] = {'M','s','i','P','u','b','l','i','s','h','A','s','s','e','m','b','l','i','e','s',0}; @@ -1194,6 +1206,7 @@ static const WCHAR szData[] = {'D','a','t','a',0}; static const WCHAR szLangResource[] = {'\\','V','a','r','F','i','l','e','I','n','f','o','\\','T','r','a','n','s','l','a','t','i','o','n',0}; static const WCHAR szInstallLocation[] = {'I','n','s','t','a','l','l','L','o','c','a','t','i','o','n',0}; +static const WCHAR szProperty[] = {'P','r','o','p','e','r','t','y',0}; /* memory allocation macro functions */ static void *msi_alloc( size_t len ) __WINE_ALLOC_SIZE(1); Modified: trunk/reactos/dll/win32/msi/msiquery.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msi/msiquery.c?r…
============================================================================== --- trunk/reactos/dll/win32/msi/msiquery.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msi/msiquery.c [iso-8859-1] Mon Mar 9 20:28:19 2015 @@ -821,8 +821,13 @@ /* FIXME: lock the database */ - r = MSI_CommitTables( db ); - if (r != ERROR_SUCCESS) ERR("Failed to commit tables!\n"); + r = msi_commit_streams( db ); + if (r != ERROR_SUCCESS) ERR("Failed to commit streams!\n"); + else + { + r = MSI_CommitTables( db ); + if (r != ERROR_SUCCESS) ERR("Failed to commit tables!\n"); + } /* FIXME: unlock the database */ 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] Mon Mar 9 20:28:19 2015 @@ -361,7 +361,7 @@ return rc; } -UINT msi_clone_properties(MSIPACKAGE *package) +UINT msi_clone_properties( MSIDATABASE *db ) { static const WCHAR query_select[] = { 'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ', @@ -378,7 +378,7 @@ MSIQUERY *view_select; UINT rc; - rc = MSI_DatabaseOpenViewW( package->db, query_select, &view_select ); + rc = MSI_DatabaseOpenViewW( db, query_select, &view_select ); if (rc != ERROR_SUCCESS) return rc; @@ -399,7 +399,7 @@ if (rc != ERROR_SUCCESS) break; - rc = MSI_DatabaseOpenViewW( package->db, query_insert, &view_insert ); + rc = MSI_DatabaseOpenViewW( db, query_insert, &view_insert ); if (rc != ERROR_SUCCESS) { msiobj_release( &rec_select->hdr ); @@ -415,7 +415,7 @@ TRACE("insert failed, trying update\n"); - rc = MSI_DatabaseOpenViewW( package->db, query_update, &view_update ); + rc = MSI_DatabaseOpenViewW( db, query_update, &view_update ); if (rc != ERROR_SUCCESS) { WARN("open view failed %u\n", rc); @@ -1150,7 +1150,7 @@ package->BaseURL = strdupW( base_url ); create_temp_property_table( package ); - msi_clone_properties( package ); + msi_clone_properties( package->db ); msi_adjust_privilege_properties( package ); package->ProductCode = msi_dup_property( package->db, szProductCode ); @@ -1246,7 +1246,7 @@ return ERROR_SUCCESS; } -static enum platform parse_platform( WCHAR *str ) +enum platform parse_platform( const WCHAR *str ) { if (!str[0] || !strcmpW( str, szIntel )) return PLATFORM_INTEL; else if (!strcmpW( str, szIntel64 )) return PLATFORM_INTEL64; @@ -1652,11 +1652,8 @@ } index++; } - if (index) - { - msi_clone_properties( package ); - msi_adjust_privilege_properties( package ); - } + if (index) msi_adjust_privilege_properties( package ); + r = msi_set_original_database_property( package->db, szPackage ); if (r != ERROR_SUCCESS) { Modified: trunk/reactos/dll/win32/msi/patch.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msi/patch.c?rev=…
============================================================================== --- trunk/reactos/dll/win32/msi/patch.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msi/patch.c [iso-8859-1] Mon Mar 9 20:28:19 2015 @@ -35,57 +35,220 @@ return FALSE; } +struct transform_desc +{ + WCHAR *product_code_from; + WCHAR *product_code_to; + WCHAR *version_from; + WCHAR *version_to; + WCHAR *upgrade_code; +}; + +static void free_transform_desc( struct transform_desc *desc ) +{ + msi_free( desc->product_code_from ); + msi_free( desc->product_code_to ); + msi_free( desc->version_from ); + msi_free( desc->version_to ); + msi_free( desc->upgrade_code ); + msi_free( desc ); +} + +static struct transform_desc *parse_transform_desc( const WCHAR *str ) +{ + struct transform_desc *ret; + const WCHAR *p = str, *q; + UINT len; + + if (!(ret = msi_alloc_zero( sizeof(*ret) ))) return NULL; + + q = strchrW( p, '}' ); + if (*p != '{' || !q) goto error; + + len = q - p + 1; + if (!(ret->product_code_from = msi_alloc( (len + 1) * sizeof(WCHAR) ))) goto error; + memcpy( ret->product_code_from, p, len * sizeof(WCHAR) ); + ret->product_code_from[len] = 0; + + p = q + 1; + if (!(q = strchrW( p, ';' ))) goto error; + len = q - p; + if (!(ret->version_from = msi_alloc( (len + 1) * sizeof(WCHAR) ))) goto error; + memcpy( ret->version_from, p, len * sizeof(WCHAR) ); + ret->version_from[len] = 0; + + p = q + 1; + q = strchrW( p, '}' ); + if (*p != '{' || !q) goto error; + + len = q - p + 1; + if (!(ret->product_code_to = msi_alloc( (len + 1) * sizeof(WCHAR) ))) goto error; + memcpy( ret->product_code_to, p, len * sizeof(WCHAR) ); + ret->product_code_to[len] = 0; + + p = q + 1; + if (!(q = strchrW( p, ';' ))) goto error; + len = q - p; + if (!(ret->version_to = msi_alloc( (len + 1) * sizeof(WCHAR) ))) goto error; + memcpy( ret->version_to, p, len * sizeof(WCHAR) ); + ret->version_to[len] = 0; + + p = q + 1; + q = strchrW( p, '}' ); + if (*p != '{' || !q) goto error; + + len = q - p + 1; + if (!(ret->upgrade_code = msi_alloc( (len + 1) * sizeof(WCHAR) ))) goto error; + memcpy( ret->upgrade_code, p, len * sizeof(WCHAR) ); + ret->upgrade_code[len] = 0; + + return ret; + +error: + free_transform_desc( ret ); + return NULL; +} + static UINT check_transform_applicable( MSIPACKAGE *package, IStorage *transform ) { + static const UINT supported_flags = + MSITRANSFORM_VALIDATE_PRODUCT | MSITRANSFORM_VALIDATE_LANGUAGE | + MSITRANSFORM_VALIDATE_PLATFORM | MSITRANSFORM_VALIDATE_MAJORVERSION | + MSITRANSFORM_VALIDATE_MINORVERSION | MSITRANSFORM_VALIDATE_UPGRADECODE; MSISUMMARYINFO *si = MSI_GetSummaryInformationW( transform, 0 ); UINT valid_flags = 0, wanted_flags = 0; - - if (si) wanted_flags = msi_suminfo_get_int32( si, PID_CHARCOUNT ); - TRACE("validation flags %x\n", wanted_flags); - - if (wanted_flags & ~(MSITRANSFORM_VALIDATE_PRODUCT|MSITRANSFORM_VALIDATE_LANGUAGE)) - FIXME("unsupported validation flags %x\n", wanted_flags); - + WCHAR *template, *product, *p; + struct transform_desc *desc; + + if (!si) + { + WARN("no summary information!\n"); + return ERROR_FUNCTION_FAILED; + } + wanted_flags = msi_suminfo_get_int32( si, PID_CHARCOUNT ); + wanted_flags &= 0xffff; /* mask off error condition flags */ + TRACE("validation flags 0x%04x\n", wanted_flags); + + if (wanted_flags & ~supported_flags) + { + FIXME("unsupported validation flags 0x%04x\n", wanted_flags); + msiobj_release( &si->hdr ); + return ERROR_FUNCTION_FAILED; + } + if (!(template = msi_suminfo_dup_string( si, PID_TEMPLATE ))) + { + WARN("no template property!\n"); + msiobj_release( &si->hdr ); + return ERROR_FUNCTION_FAILED; + } + TRACE("template property: %s\n", debugstr_w(template)); + if (!(product = msi_get_suminfo_product( transform ))) + { + WARN("no product property!\n"); + msi_free( template ); + msiobj_release( &si->hdr ); + return ERROR_FUNCTION_FAILED; + } + TRACE("product property: %s\n", debugstr_w(product)); + if (!(desc = parse_transform_desc( product ))) + { + msi_free( template ); + msiobj_release( &si->hdr ); + return ERROR_FUNCTION_FAILED; + } + msi_free( product ); + + if (wanted_flags & MSITRANSFORM_VALIDATE_LANGUAGE) + { + if (!template[0] || ((p = strchrW( template, ';' )) && match_language( package, atoiW( p + 1 ) ))) + { + valid_flags |= MSITRANSFORM_VALIDATE_LANGUAGE; + } + } if (wanted_flags & MSITRANSFORM_VALIDATE_PRODUCT) { - WCHAR *package_product = msi_dup_property( package->db, szProductCode ); - WCHAR *transform_product = msi_get_suminfo_product( transform ); - - TRACE("package = %s transform = %s\n", debugstr_w(package_product), debugstr_w(transform_product)); - - if (!transform_product || strstrW( transform_product, package_product )) + WCHAR *product_code_installed = msi_dup_property( package->db, szProductCode ); + + if (!product_code_installed) + { + msi_free( template ); + free_transform_desc( desc ); + msiobj_release( &si->hdr ); + return ERROR_INSTALL_PACKAGE_INVALID; + } + if (!strcmpW( desc->product_code_from, product_code_installed )) { valid_flags |= MSITRANSFORM_VALIDATE_PRODUCT; } - msi_free( transform_product ); - msi_free( package_product ); - } - if (wanted_flags & MSITRANSFORM_VALIDATE_LANGUAGE) - { - WCHAR *template; - const WCHAR *p; - - if (!si) - { - ERR("no summary information!\n"); - goto end; - } - if (!(template = msi_suminfo_dup_string( si, PID_TEMPLATE ))) - { - ERR("no template property!\n"); - goto end; - } - TRACE("template: %s\n", debugstr_w(template)); - if (!template[0] || ((p = strchrW( template, ';' )) && match_language( package, atoiW( p + 1 ) ))) - { - valid_flags |= MSITRANSFORM_VALIDATE_LANGUAGE; - } - msi_free( template ); - } - -end: + msi_free( product_code_installed ); + } + if (wanted_flags & MSITRANSFORM_VALIDATE_PLATFORM) + { + if ((p = strchrW( template, ';' ))) + { + *p = 0; + if (package->platform == parse_platform( template )) + valid_flags |= MSITRANSFORM_VALIDATE_PLATFORM; + } + } + msi_free( template ); + if (wanted_flags & MSITRANSFORM_VALIDATE_MAJORVERSION) + { + WCHAR *product_version_installed = msi_dup_property( package->db, szProductVersion ); + DWORD major_installed, minor_installed, major, minor; + + if (!product_version_installed) + { + free_transform_desc( desc ); + msiobj_release( &si->hdr ); + return ERROR_INSTALL_PACKAGE_INVALID; + } + msi_parse_version_string( product_version_installed, &major_installed, &minor_installed ); + msi_parse_version_string( desc->version_from, &major, &minor ); + + if (major_installed == major) + { + valid_flags |= MSITRANSFORM_VALIDATE_MAJORVERSION; + wanted_flags &= ~MSITRANSFORM_VALIDATE_MINORVERSION; + } + msi_free( product_version_installed ); + } + else if (wanted_flags & MSITRANSFORM_VALIDATE_MINORVERSION) + { + WCHAR *product_version_installed = msi_dup_property( package->db, szProductVersion ); + DWORD major_installed, minor_installed, major, minor; + + if (!product_version_installed) + { + free_transform_desc( desc ); + msiobj_release( &si->hdr ); + return ERROR_INSTALL_PACKAGE_INVALID; + } + msi_parse_version_string( product_version_installed, &major_installed, &minor_installed ); + msi_parse_version_string( desc->version_from, &major, &minor ); + + if (major_installed == major && minor_installed == minor) + valid_flags |= MSITRANSFORM_VALIDATE_MINORVERSION; + msi_free( product_version_installed ); + } + if (wanted_flags & MSITRANSFORM_VALIDATE_UPGRADECODE) + { + WCHAR *upgrade_code_installed = msi_dup_property( package->db, szUpgradeCode ); + + if (!upgrade_code_installed) + { + free_transform_desc( desc ); + msiobj_release( &si->hdr ); + return ERROR_INSTALL_PACKAGE_INVALID; + } + if (!strcmpW( desc->upgrade_code, upgrade_code_installed )) + valid_flags |= MSITRANSFORM_VALIDATE_UPGRADECODE; + msi_free( upgrade_code_installed ); + } + + free_transform_desc( desc ); msiobj_release( &si->hdr ); - if (valid_flags & ~wanted_flags) return ERROR_FUNCTION_FAILED; + if ((valid_flags & wanted_flags) != wanted_flags) return ERROR_FUNCTION_FAILED; TRACE("applicable transform\n"); return ERROR_SUCCESS; } 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] Mon Mar 9 20:28:19 2015 @@ -83,12 +83,6 @@ '%','s','\\','P','r','o','d','u','c','t','s','\\','%','s','\\', 'I','n','s','t','a','l','l','P','r','o','p','e','r','t','i','e','s',0}; -static const WCHAR szInstaller_LocalManaged_fmt[] = { - 'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\', - 'W','i','n','d','o','w','s','\\','C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\', - 'I','n','s','t','a','l','l','e','r','\\','M','a','n','a','g','e','d','\\','%','s','\\', - 'I','n','s','t','a','l','l','e','r','\\','P','r','o','d','u','c','t','s',0}; - static const WCHAR szInstaller_LocalManagedProd_fmt[] = { 'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\', 'W','i','n','d','o','w','s','\\','C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\', @@ -110,11 +104,6 @@ 'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\', 'W','i','n','d','o','w','s','\\','C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\', 'I','n','s','t','a','l','l','e','r','\\','P','a','t','c','h','e','s',0}; - -static const WCHAR szInstaller_Components[] = { - 'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\', - 'W','i','n','d','o','w','s','\\','C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\', - 'I','n','s','t','a','l','l','e','r','\\','C','o','m','p','o','n','e','n','t','s',0}; static const WCHAR szInstaller_LocalClassesProducts[] = { 'S','o','f','t','w','a','r','e','\\','C','l','a','s','s','e','s','\\', @@ -1497,6 +1486,24 @@ return r; } +UINT WINAPI MsiEnumClientsExA(LPCSTR component, LPCSTR usersid, DWORD ctx, DWORD index, + CHAR installed_product[GUID_SIZE], + MSIINSTALLCONTEXT *installed_ctx, LPSTR sid, LPDWORD sid_len) +{ + FIXME("%s, %s, %u, %u, %p, %p, %p, %p\n", debugstr_a(component), debugstr_a(usersid), + ctx, index, installed_product, installed_ctx, sid, sid_len); + return ERROR_ACCESS_DENIED; +} + +UINT WINAPI MsiEnumClientsExW(LPCWSTR component, LPCWSTR usersid, DWORD ctx, DWORD index, + WCHAR installed_product[GUID_SIZE], + MSIINSTALLCONTEXT *installed_ctx, LPWSTR sid, LPDWORD sid_len) +{ + FIXME("%s, %s, %u, %u, %p, %p, %p, %p\n", debugstr_w(component), debugstr_w(usersid), + ctx, index, installed_product, installed_ctx, sid, sid_len); + return ERROR_ACCESS_DENIED; +} + static UINT MSI_EnumComponentQualifiers( LPCWSTR szComponent, DWORD iIndex, awstring *lpQualBuf, LPDWORD pcchQual, awstring *lpAppBuf, LPDWORD pcchAppBuf ) Modified: trunk/reactos/dll/win32/msi/script.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msi/script.c?rev…
============================================================================== --- trunk/reactos/dll/win32/msi/script.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msi/script.c [iso-8859-1] Mon Mar 9 20:28:19 2015 @@ -344,7 +344,7 @@ if (FAILED(hr)) goto done; /* Call a function if necessary through the IDispatch interface */ - if (function != NULL && strlenW(function) > 0) { + if (function && function[0]) { TRACE("Calling function %s\n", debugstr_w(function)); hr = IActiveScript_GetScriptDispatch(pActiveScript, NULL, &pDispatch); Modified: trunk/reactos/dll/win32/msi/storages.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msi/storages.c?r…
============================================================================== --- trunk/reactos/dll/win32/msi/storages.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msi/storages.c [iso-8859-1] Mon Mar 9 20:28:19 2015 @@ -62,7 +62,7 @@ if (!storage) return NULL; - storage->str_index = msi_addstringW(sv->db->strings, name, -1, 1, StringNonPersistent); + storage->str_index = msi_add_string(sv->db->strings, name, -1, StringNonPersistent); storage->storage = stg; if (storage->storage) 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] Mon Mar 9 20:28:19 2015 @@ -2,6 +2,7 @@ * Implementation of the Microsoft Installer (msi.dll) * * Copyright 2007 James Hawkins + * Copyright 2015 Hans Leidekker for CodeWeavers * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -24,54 +25,30 @@ #define NUM_STREAMS_COLS 2 -typedef struct tabSTREAM -{ - UINT str_index; - IStream *stream; -} STREAM; - typedef struct tagMSISTREAMSVIEW { MSIVIEW view; MSIDATABASE *db; - STREAM **streams; - UINT max_streams; - UINT num_rows; - UINT row_size; + UINT num_cols; } MSISTREAMSVIEW; -static BOOL streams_set_table_size(MSISTREAMSVIEW *sv, UINT size) -{ - if (size >= sv->max_streams) - { - sv->max_streams *= 2; - sv->streams = msi_realloc_zero(sv->streams, sv->max_streams * sizeof(STREAM *)); - if (!sv->streams) - return FALSE; - } - +static BOOL streams_resize_table( MSIDATABASE *db, UINT size ) +{ + if (!db->num_streams_allocated) + { + if (!(db->streams = msi_alloc_zero( size * sizeof(MSISTREAM) ))) return FALSE; + db->num_streams_allocated = size; + return TRUE; + } + while (size >= db->num_streams_allocated) + { + MSISTREAM *tmp; + UINT new_size = db->num_streams_allocated * 2; + if (!(tmp = msi_realloc_zero( db->streams, new_size * sizeof(MSISTREAM) ))) return FALSE; + db->streams = tmp; + db->num_streams_allocated = new_size; + } return TRUE; -} - -static STREAM *create_stream(MSISTREAMSVIEW *sv, LPCWSTR name, BOOL encoded, IStream *stm) -{ - STREAM *stream; - WCHAR decoded[MAX_STREAM_NAME_LEN + 1]; - - stream = msi_alloc(sizeof(STREAM)); - if (!stream) - return NULL; - - if (encoded) - { - decode_streamname(name, decoded); - TRACE("stream -> %s %s\n", debugstr_w(name), debugstr_w(decoded)); - name = decoded; - } - - stream->str_index = msi_addstringW(sv->db->strings, name, -1, 1, StringNonPersistent); - stream->stream = stm; - return stream; } static UINT STREAMS_fetch_int(struct tagMSIVIEW *view, UINT row, UINT col, UINT *val) @@ -83,10 +60,10 @@ if (col != 1) return ERROR_INVALID_PARAMETER; - if (row >= sv->num_rows) + if (row >= sv->db->num_streams) return ERROR_NO_MORE_ITEMS; - *val = sv->streams[row]->str_index; + *val = sv->db->streams[row].str_index; return ERROR_SUCCESS; } @@ -94,14 +71,21 @@ static UINT STREAMS_fetch_stream(struct tagMSIVIEW *view, UINT row, UINT col, IStream **stm) { MSISTREAMSVIEW *sv = (MSISTREAMSVIEW *)view; + LARGE_INTEGER pos; + HRESULT hr; TRACE("(%p, %d, %d, %p)\n", view, row, col, stm); - if (row >= sv->num_rows) + if (row >= sv->db->num_streams) return ERROR_FUNCTION_FAILED; - IStream_AddRef(sv->streams[row]->stream); - *stm = sv->streams[row]->stream; + pos.QuadPart = 0; + hr = IStream_Seek( sv->db->streams[row].stream, pos, STREAM_SEEK_SET, NULL ); + if (FAILED( hr )) + return ERROR_FUNCTION_FAILED; + + *stm = sv->db->streams[row].stream; + IStream_AddRef( *stm ); return ERROR_SUCCESS; } @@ -118,112 +102,96 @@ static UINT STREAMS_set_row(struct tagMSIVIEW *view, UINT row, MSIRECORD *rec, UINT mask) { MSISTREAMSVIEW *sv = (MSISTREAMSVIEW *)view; - STREAM *stream; - IStream *stm; - STATSTG stat; - LPWSTR encname = NULL, name = NULL; - USHORT *data = NULL; - HRESULT hr; - ULONG count; - UINT r = ERROR_FUNCTION_FAILED; TRACE("(%p, %d, %p, %08x)\n", view, row, rec, mask); - if (row > sv->num_rows) - return ERROR_FUNCTION_FAILED; - - r = MSI_RecordGetIStream(rec, 2, &stm); + if (row > sv->db->num_streams || mask >= (1 << sv->num_cols)) + return ERROR_INVALID_PARAMETER; + + if (mask & 1) + { + const WCHAR *name = MSI_RecordGetString( rec, 1 ); + + if (!name) return ERROR_INVALID_PARAMETER; + sv->db->streams[row].str_index = msi_add_string( sv->db->strings, name, -1, StringNonPersistent ); + } + if (mask & 2) + { + IStream *old, *new; + HRESULT hr; + UINT r; + + r = MSI_RecordGetIStream( rec, 2, &new ); + if (r != ERROR_SUCCESS) + return r; + + old = sv->db->streams[row].stream; + hr = IStream_QueryInterface( new, &IID_IStream, (void **)&sv->db->streams[row].stream ); + if (FAILED( hr )) + { + IStream_Release( new ); + return ERROR_FUNCTION_FAILED; + } + if (old) IStream_Release( old ); + } + + return ERROR_SUCCESS; +} + +static UINT streams_find_row( MSISTREAMSVIEW *sv, MSIRECORD *rec, UINT *row ) +{ + const WCHAR *str; + UINT r, i, id, val; + + str = MSI_RecordGetString( rec, 1 ); + r = msi_string2id( sv->db->strings, str, -1, &id ); if (r != ERROR_SUCCESS) return r; - hr = IStream_Stat(stm, &stat, STATFLAG_NONAME); - if (FAILED(hr)) - { - WARN("failed to stat stream: %08x\n", hr); - goto done; - } - - if (stat.cbSize.QuadPart >> 32) - { - WARN("stream too large\n"); - goto done; - } - - data = msi_alloc(stat.cbSize.QuadPart); - if (!data) - goto done; - - hr = IStream_Read(stm, data, stat.cbSize.QuadPart, &count); - if (FAILED(hr) || count != stat.cbSize.QuadPart) - { - WARN("failed to read stream: %08x\n", hr); - goto done; - } - - name = strdupW(MSI_RecordGetString(rec, 1)); - if (!name) - { - WARN("failed to retrieve stream name\n"); - goto done; - } - - encname = encode_streamname(FALSE, name); - msi_destroy_stream(sv->db, encname); - - r = write_stream_data(sv->db->storage, name, data, count, FALSE); - if (r != ERROR_SUCCESS) - { - WARN("failed to write stream data: %d\n", r); - goto done; - } - - stream = create_stream(sv, name, FALSE, NULL); - if (!stream) - goto done; - - hr = IStorage_OpenStream(sv->db->storage, encname, 0, - STGM_READ | STGM_SHARE_EXCLUSIVE, 0, &stream->stream); - if (FAILED(hr)) - { - WARN("failed to open stream: %08x\n", hr); - msi_free(stream); - goto done; - } - - sv->streams[row] = stream; - -done: - msi_free(name); - msi_free(data); - msi_free(encname); - - IStream_Release(stm); + for (i = 0; i < sv->db->num_streams; i++) + { + STREAMS_fetch_int( &sv->view, i, 1, &val ); + + if (val == id) + { + if (row) *row = i; + return ERROR_SUCCESS; + } + } + + return ERROR_FUNCTION_FAILED; +} + +static UINT STREAMS_insert_row(struct tagMSIVIEW *view, MSIRECORD *rec, UINT row, BOOL temporary) +{ + MSISTREAMSVIEW *sv = (MSISTREAMSVIEW *)view; + UINT i, r, num_rows = sv->db->num_streams + 1; + + TRACE("(%p, %p, %d, %d)\n", view, rec, row, temporary); + + r = streams_find_row( sv, rec, NULL ); + if (r == ERROR_SUCCESS) + return ERROR_FUNCTION_FAILED; + + if (!streams_resize_table( sv->db, num_rows )) + return ERROR_FUNCTION_FAILED; + + if (row == -1) + row = num_rows - 1; + + /* shift the rows to make room for the new row */ + for (i = num_rows - 1; i > row; i--) + { + sv->db->streams[i] = sv->db->streams[i - 1]; + } + + r = STREAMS_set_row( view, row, rec, (1 << sv->num_cols) - 1 ); + if (r == ERROR_SUCCESS) + sv->db->num_streams = num_rows; return r; } -static UINT STREAMS_insert_row(struct tagMSIVIEW *view, MSIRECORD *rec, UINT row, BOOL temporary) -{ - MSISTREAMSVIEW *sv = (MSISTREAMSVIEW *)view; - UINT i; - - TRACE("(%p, %p, %d, %d)\n", view, rec, row, temporary); - - if (!streams_set_table_size(sv, ++sv->num_rows)) - return ERROR_FUNCTION_FAILED; - - if (row == -1) - row = sv->num_rows - 1; - - /* shift the rows to make room for the new row */ - for (i = sv->num_rows - 1; i > row; i--) - { - sv->streams[i] = sv->streams[i - 1]; - } - - return STREAMS_set_row(view, row, rec, 0); -} - static UINT STREAMS_delete_row(struct tagMSIVIEW *view, UINT row) { FIXME("(%p %d): stub!\n", view, row); @@ -248,8 +216,8 @@ TRACE("(%p, %p, %p)\n", view, rows, cols); - if (cols) *cols = NUM_STREAMS_COLS; - if (rows) *rows = sv->num_rows; + if (cols) *cols = sv->num_cols; + if (rows) *rows = sv->db->num_streams; return ERROR_SUCCESS; } @@ -257,10 +225,11 @@ static UINT STREAMS_get_column_info( struct tagMSIVIEW *view, UINT n, LPCWSTR *name, UINT *type, BOOL *temporary, LPCWSTR *table_name ) { - TRACE("(%p, %d, %p, %p, %p, %p)\n", view, n, name, type, temporary, - table_name); - - if (n == 0 || n > NUM_STREAMS_COLS) + MSISTREAMSVIEW *sv = (MSISTREAMSVIEW *)view; + + TRACE("(%p, %d, %p, %p, %p, %p)\n", view, n, name, type, temporary, table_name); + + if (!n || n > sv->num_cols) return ERROR_INVALID_PARAMETER; switch (n) @@ -280,30 +249,6 @@ return ERROR_SUCCESS; } -static UINT streams_find_row(MSISTREAMSVIEW *sv, MSIRECORD *rec, UINT *row) -{ - LPCWSTR str; - UINT r, i, id, data; - - str = MSI_RecordGetString(rec, 1); - r = msi_string2id(sv->db->strings, str, -1, &id); - if (r != ERROR_SUCCESS) - return r; - - for (i = 0; i < sv->num_rows; i++) - { - STREAMS_fetch_int(&sv->view, i, 1, &data); - - if (data == id) - { - *row = i; - return ERROR_SUCCESS; - } - } - - return ERROR_FUNCTION_FAILED; -} - static UINT streams_modify_update(struct tagMSIVIEW *view, MSIRECORD *rec) { MSISTREAMSVIEW *sv = (MSISTREAMSVIEW *)view; @@ -313,15 +258,15 @@ if (r != ERROR_SUCCESS) return ERROR_FUNCTION_FAILED; - return STREAMS_set_row(view, row, rec, 0); + return STREAMS_set_row( view, row, rec, (1 << sv->num_cols) - 1 ); } static UINT streams_modify_assign(struct tagMSIVIEW *view, MSIRECORD *rec) { MSISTREAMSVIEW *sv = (MSISTREAMSVIEW *)view; - UINT r, row; - - r = streams_find_row(sv, rec, &row); + UINT r; + + r = streams_find_row( sv, rec, NULL ); if (r == ERROR_SUCCESS) return streams_modify_update(view, rec); @@ -371,23 +316,10 @@ static UINT STREAMS_delete(struct tagMSIVIEW *view) { MSISTREAMSVIEW *sv = (MSISTREAMSVIEW *)view; - UINT i; TRACE("(%p)\n", view); - for (i = 0; i < sv->num_rows; i++) - { - if (sv->streams[i]) - { - if (sv->streams[i]->stream) - IStream_Release(sv->streams[i]->stream); - msi_free(sv->streams[i]); - } - } - - msi_free(sv->streams); msi_free(sv); - return ERROR_SUCCESS; } @@ -399,23 +331,22 @@ TRACE("(%p, %d, %d, %p, %p)\n", view, col, val, row, handle); - if (col == 0 || col > NUM_STREAMS_COLS) + if (!col || col > sv->num_cols) return ERROR_INVALID_PARAMETER; - while (index < sv->num_rows) - { - if (sv->streams[index]->str_index == val) + while (index < sv->db->num_streams) + { + if (sv->db->streams[index].str_index == val) { *row = index; break; } - index++; } *handle = UlongToPtr(++index); - if (index > sv->num_rows) + if (index > sv->db->num_streams) return ERROR_NO_MORE_ITEMS; return ERROR_SUCCESS; @@ -444,107 +375,256 @@ NULL, }; -static INT add_streams_to_table(MSISTREAMSVIEW *sv) -{ - IEnumSTATSTG *stgenum = NULL; +static HRESULT open_stream( MSIDATABASE *db, const WCHAR *name, IStream **stream ) +{ + HRESULT hr; + + hr = IStorage_OpenStream( db->storage, name, NULL, STGM_READ|STGM_SHARE_EXCLUSIVE, 0, stream ); + if (FAILED( hr )) + { + MSITRANSFORM *transform; + + LIST_FOR_EACH_ENTRY( transform, &db->transforms, MSITRANSFORM, entry ) + { + hr = IStorage_OpenStream( transform->stg, name, NULL, STGM_READ|STGM_SHARE_EXCLUSIVE, 0, stream ); + if (SUCCEEDED( hr )) + break; + } + } + return hr; +} + +static MSISTREAM *find_stream( MSIDATABASE *db, const WCHAR *name ) +{ + UINT r, id, i; + + r = msi_string2id( db->strings, name, -1, &id ); + if (r != ERROR_SUCCESS) + return NULL; + + for (i = 0; i < db->num_streams; i++) + { + if (db->streams[i].str_index == id) return &db->streams[i]; + } + return NULL; +} + +static UINT append_stream( MSIDATABASE *db, const WCHAR *name, IStream *stream ) +{ + WCHAR decoded[MAX_STREAM_NAME_LEN + 1]; + UINT i = db->num_streams; + + if (!streams_resize_table( db, db->num_streams + 1 )) + return ERROR_OUTOFMEMORY; + + decode_streamname( name, decoded ); + db->streams[i].str_index = msi_add_string( db->strings, decoded, -1, StringNonPersistent ); + db->streams[i].stream = stream; + db->num_streams++; + + TRACE("added %s\n", debugstr_w( decoded )); + return ERROR_SUCCESS; +} + +static UINT load_streams( MSIDATABASE *db ) +{ + IEnumSTATSTG *stgenum; STATSTG stat; - STREAM *stream = NULL; HRESULT hr; - UINT r, count = 0, size; - LPWSTR encname; - - hr = IStorage_EnumElements(sv->db->storage, 0, NULL, 0, &stgenum); - if (FAILED(hr)) - return -1; - - sv->max_streams = 1; - sv->streams = msi_alloc_zero(sizeof(STREAM *)); - if (!sv->streams) - return -1; - - while (TRUE) - { - size = 0; - hr = IEnumSTATSTG_Next(stgenum, 1, &stat, &size); - if (FAILED(hr) || !size) + UINT count, r = ERROR_SUCCESS; + IStream *stream; + + hr = IStorage_EnumElements( db->storage, 0, NULL, 0, &stgenum ); + if (FAILED( hr )) + return ERROR_FUNCTION_FAILED; + + for (;;) + { + count = 0; + hr = IEnumSTATSTG_Next( stgenum, 1, &stat, &count ); + if (FAILED( hr ) || !count) break; - if (stat.type != STGTY_STREAM) - { - CoTaskMemFree(stat.pwcsName); + /* table streams are not in the _Streams table */ + if (stat.type != STGTY_STREAM || *stat.pwcsName == 0x4840 || + find_stream( db, stat.pwcsName )) + { + CoTaskMemFree( stat.pwcsName ); continue; } - - /* table streams are not in the _Streams table */ - if (*stat.pwcsName == 0x4840) - { - CoTaskMemFree(stat.pwcsName); - continue; - } - - stream = create_stream(sv, stat.pwcsName, TRUE, NULL); - if (!stream) - { - count = -1; - CoTaskMemFree(stat.pwcsName); + TRACE("found new stream %s\n", debugstr_w( stat.pwcsName )); + + hr = open_stream( db, stat.pwcsName, &stream ); + if (FAILED( hr )) + { + ERR("unable to open stream %08x\n", hr); + CoTaskMemFree( stat.pwcsName ); + r = ERROR_FUNCTION_FAILED; break; } - /* these streams appear to be unencoded */ - if (*stat.pwcsName == 0x0005) - { - r = msi_get_raw_stream(sv->db, stat.pwcsName, &stream->stream); - } - else - { - encname = encode_streamname(FALSE, stat.pwcsName); - r = msi_get_raw_stream(sv->db, encname, &stream->stream); - msi_free(encname); - } - CoTaskMemFree(stat.pwcsName); - + r = append_stream( db, stat.pwcsName, stream ); + CoTaskMemFree( stat.pwcsName ); if (r != ERROR_SUCCESS) - { - WARN("unable to get stream %u\n", r); - count = -1; break; - } - - if (!streams_set_table_size(sv, ++count)) - { - count = -1; - break; - } - - sv->streams[count - 1] = stream; - } - - IEnumSTATSTG_Release(stgenum); - return count; + } + + TRACE("loaded %u streams\n", db->num_streams); + IEnumSTATSTG_Release( stgenum ); + return r; +} + +UINT msi_get_stream( MSIDATABASE *db, const WCHAR *name, IStream **ret ) +{ + MSISTREAM *stream; + WCHAR *encname; + HRESULT hr; + UINT r; + + if ((stream = find_stream( db, name ))) + { + LARGE_INTEGER pos; + + pos.QuadPart = 0; + hr = IStream_Seek( stream->stream, pos, STREAM_SEEK_SET, NULL ); + if (FAILED( hr )) + return ERROR_FUNCTION_FAILED; + + *ret = stream->stream; + IStream_AddRef( *ret ); + return ERROR_SUCCESS; + } + + if (!(encname = encode_streamname( FALSE, name ))) + return ERROR_OUTOFMEMORY; + + hr = open_stream( db, encname, ret ); + msi_free( encname ); + if (FAILED( hr )) + return ERROR_FUNCTION_FAILED; + + r = append_stream( db, name, *ret ); + if (r != ERROR_SUCCESS) + { + IStream_Release( *ret ); + return r; + } + + IStream_AddRef( *ret ); + return ERROR_SUCCESS; } UINT STREAMS_CreateView(MSIDATABASE *db, MSIVIEW **view) { MSISTREAMSVIEW *sv; - INT rows; + UINT r; TRACE("(%p, %p)\n", db, view); - sv = msi_alloc_zero( sizeof(MSISTREAMSVIEW) ); - if (!sv) - return ERROR_FUNCTION_FAILED; + r = load_streams( db ); + if (r != ERROR_SUCCESS) + return r; + + if (!(sv = msi_alloc_zero( sizeof(MSISTREAMSVIEW) ))) + return ERROR_OUTOFMEMORY; sv->view.ops = &streams_ops; + sv->num_cols = NUM_STREAMS_COLS; sv->db = db; - rows = add_streams_to_table(sv); - if (rows < 0) - { - msi_free( sv ); - return ERROR_FUNCTION_FAILED; - } - sv->num_rows = rows; *view = (MSIVIEW *)sv; return ERROR_SUCCESS; } + +static HRESULT write_stream( IStream *dst, IStream *src ) +{ + HRESULT hr; + char buf[4096]; + STATSTG stat; + LARGE_INTEGER pos; + UINT count, size; + + hr = IStream_Stat( src, &stat, STATFLAG_NONAME ); + if (FAILED( hr )) return hr; + + hr = IStream_SetSize( dst, stat.cbSize ); + if (FAILED( hr )) return hr; + + pos.QuadPart = 0; + hr = IStream_Seek( dst, pos, STREAM_SEEK_SET, NULL ); + if (FAILED( hr )) return hr; + + for (;;) + { + size = min( sizeof(buf), stat.cbSize.QuadPart ); + hr = IStream_Read( src, buf, size, &count ); + if (FAILED( hr ) || count != size) + { + WARN("failed to read stream: %08x\n", hr); + return E_INVALIDARG; + } + stat.cbSize.QuadPart -= count; + if (count) + { + size = count; + hr = IStream_Write( dst, buf, size, &count ); + if (FAILED( hr ) || count != size) + { + WARN("failed to write stream: %08x\n", hr); + return E_INVALIDARG; + } + } + if (!stat.cbSize.QuadPart) break; + } + + return S_OK; +} + +UINT msi_commit_streams( MSIDATABASE *db ) +{ + UINT i; + const WCHAR *name; + WCHAR *encname; + IStream *stream; + HRESULT hr; + + TRACE("got %u streams\n", db->num_streams); + + for (i = 0; i < db->num_streams; i++) + { + name = msi_string_lookup( db->strings, db->streams[i].str_index, NULL ); + if (!(encname = encode_streamname( FALSE, name ))) return ERROR_OUTOFMEMORY; + + hr = open_stream( db, encname, &stream ); + if (FAILED( hr )) /* new stream */ + { + hr = IStorage_CreateStream( db->storage, encname, STGM_WRITE|STGM_SHARE_EXCLUSIVE, 0, 0, &stream ); + if (FAILED( hr )) + { + ERR("failed to create stream %s (hr = %08x)\n", debugstr_w(encname), hr); + msi_free( encname ); + return ERROR_FUNCTION_FAILED; + } + hr = write_stream( stream, db->streams[i].stream ); + if (FAILED( hr )) + { + ERR("failed to write stream %s (hr = %08x)\n", debugstr_w(encname), hr); + msi_free( encname ); + IStream_Release( stream ); + return ERROR_FUNCTION_FAILED; + } + } + hr = IStream_Commit( stream, 0 ); + IStream_Release( stream ); + if (FAILED( hr )) + { + WARN("failed to commit stream %s (hr = %08x)\n", debugstr_w(encname), hr); + msi_free( encname ); + return ERROR_FUNCTION_FAILED; + } + msi_free( encname ); + } + + return ERROR_SUCCESS; +} Modified: trunk/reactos/dll/win32/msi/string.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msi/string.c?rev…
============================================================================== --- trunk/reactos/dll/win32/msi/string.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msi/string.c [iso-8859-1] Mon Mar 9 20:28:19 2015 @@ -214,7 +214,7 @@ st->freeslot = n + 1; } -static UINT msi_string2idA( const string_table *st, LPCSTR buffer, UINT *id ) +static UINT string2id( const string_table *st, const char *buffer, UINT *id ) { DWORD sz; UINT r = ERROR_INVALID_PARAMETER; @@ -241,7 +241,7 @@ return r; } -static int msi_addstring( string_table *st, UINT n, const char *data, UINT len, USHORT refcount, enum StringPersistence persistence ) +static int add_string( string_table *st, UINT n, const char *data, UINT len, USHORT refcount, enum StringPersistence persistence ) { LPWSTR str; int sz; @@ -256,7 +256,7 @@ } else { - if( ERROR_SUCCESS == msi_string2idA( st, data, &n ) ) + if (string2id( st, data, &n ) == ERROR_SUCCESS) { if (persistence == StringPersistent) st->strings[n].persistent_refcount += refcount; @@ -287,7 +287,7 @@ return n; } -int msi_addstringW( string_table *st, const WCHAR *data, int len, USHORT refcount, enum StringPersistence persistence ) +int msi_add_string( string_table *st, const WCHAR *data, int len, enum StringPersistence persistence ) { UINT n; LPWSTR str; @@ -303,9 +303,9 @@ if (msi_string2id( st, data, len, &n) == ERROR_SUCCESS ) { if (persistence == StringPersistent) - st->strings[n].persistent_refcount += refcount; + st->strings[n].persistent_refcount++; else - st->strings[n].nonpersistent_refcount += refcount; + st->strings[n].nonpersistent_refcount++; return n; } @@ -322,7 +322,7 @@ memcpy( str, data, len*sizeof(WCHAR) ); str[len] = 0; - set_st_entry( st, n, str, len, refcount, persistence ); + set_st_entry( st, n, str, len, 1, persistence ); return n; } @@ -346,7 +346,7 @@ } /* - * msi_id2stringA + * id2string * * [in] st - pointer to the string table * [in] id - id of the string to retrieve @@ -356,7 +356,7 @@ * * Returned string is not nul terminated. */ -static UINT msi_id2stringA( const string_table *st, UINT id, LPSTR buffer, UINT *sz ) +static UINT id2string( const string_table *st, UINT id, char *buffer, UINT *sz ) { int len, lenW; const WCHAR *str; @@ -529,7 +529,7 @@ break; } - r = msi_addstring( st, n, data+offset, len, refs, StringPersistent ); + r = add_string( st, n, data+offset, len, refs, StringPersistent ); if( r != n ) ERR("Failed to add string %d\n", n ); n++; @@ -599,7 +599,7 @@ } sz = datasize - used; - r = msi_id2stringA( st, i, data+used, &sz ); + r = id2string( st, i, data+used, &sz ); if( r != ERROR_SUCCESS ) { ERR("failed to fetch string\n"); Modified: trunk/reactos/dll/win32/msi/table.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msi/table.c?rev=…
============================================================================== --- trunk/reactos/dll/win32/msi/table.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msi/table.c [iso-8859-1] Mon Mar 9 20:28:19 2015 @@ -88,7 +88,7 @@ return 2; if( (col->type & 0xff) != 4 ) - ERR("Invalid column size!\n"); + ERR("Invalid column size %u\n", col->type & 0xff); return 4; } @@ -741,8 +741,8 @@ for( i = 0, col = col_info; col; i++, col = col->next ) { - UINT table_id = msi_addstringW( db->strings, col->table, -1, 1, string_persistence ); - UINT col_id = msi_addstringW( db->strings, col->column, -1, 1, string_persistence ); + UINT table_id = msi_add_string( db->strings, col->table, -1, string_persistence ); + UINT col_id = msi_add_string( db->strings, col->column, -1, string_persistence ); table->colinfo[ i ].tablename = msi_string_lookup( db->strings, table_id, NULL ); table->colinfo[ i ].number = i + 1; @@ -932,7 +932,7 @@ UINT size, offset, old_count; UINT n; - table = find_cached_table( db, name ); + if (!(table = find_cached_table( db, name ))) return; old_count = table->col_count; msi_free_colinfo( table->colinfo, table->col_count ); msi_free( table->colinfo ); @@ -1130,25 +1130,23 @@ { MSITABLEVIEW *tv = (MSITABLEVIEW*)view; UINT r; - LPWSTR encname, full_name = NULL; + WCHAR *name; if( !view->ops->fetch_int ) return ERROR_INVALID_PARAMETER; - r = msi_stream_name( tv, row, &full_name ); - if ( r != ERROR_SUCCESS ) - { - ERR("fetching stream, error = %d\n", r); + r = msi_stream_name( tv, row, &name ); + if (r != ERROR_SUCCESS) + { + ERR("fetching stream, error = %u\n", r); return r; } - encname = encode_streamname( FALSE, full_name ); - r = msi_get_raw_stream( tv->db, encname, stm ); - if( r ) - ERR("fetching stream %s, error = %d\n",debugstr_w(full_name), r); - - msi_free( full_name ); - msi_free( encname ); + r = msi_get_stream( tv->db, name, stm ); + if (r != ERROR_SUCCESS) + ERR("fetching stream %s, error = %u\n", debugstr_w(name), r); + + msi_free( name ); return r; } @@ -1350,8 +1348,8 @@ { int len; const WCHAR *sval = msi_record_get_string( rec, i + 1, &len ); - val = msi_addstringW( tv->db->strings, sval, len, 1, - persistent ? StringPersistent : StringNonPersistent ); + val = msi_add_string( tv->db->strings, sval, len, + persistent ? StringPersistent : StringNonPersistent ); } else { @@ -2555,6 +2553,12 @@ */ sz = 2; num_cols = mask >> 8; + if (num_cols > tv->num_cols) + { + ERR("excess columns in transform: %u > %u\n", num_cols, tv->num_cols); + break; + } + for (i = 0; i < num_cols; i++) { if( (tv->columns[i].type & MSITYPE_STRING) && @@ -2612,7 +2616,7 @@ /* * Native msi seems writes nul into the Number (2nd) column of - * the _Columns table, only when the columns are from a new table + * the _Columns table when there are new columns */ if ( number == MSI_NULL_INTEGER ) { @@ -2663,7 +2667,7 @@ WARN("failed to insert row %u\n", r); } - if (number != MSI_NULL_INTEGER && !strcmpW( name, szColumns )) + if (!strcmpW( name, szColumns )) msi_update_table_columns( db, table ); msiobj_release( &rec->hdr ); @@ -2697,6 +2701,7 @@ string_table *strings; UINT ret = ERROR_FUNCTION_FAILED; UINT bytes_per_strref; + BOOL property_update = FALSE; TRACE("%p %p\n", db, stg ); @@ -2741,6 +2746,8 @@ tables = transform; else if (!strcmpW( transform->name, szColumns ) ) columns = transform; + else if (!strcmpW( transform->name, szProperty )) + property_update = TRUE; TRACE("transform contains stream %s\n", debugstr_w(name)); @@ -2790,7 +2797,10 @@ } if ( ret == ERROR_SUCCESS ) + { append_storage_to_db( db, stg ); + if (property_update) msi_clone_properties( db ); + } end: if ( stgenum ) 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] Mon Mar 9 20:28:19 2015 @@ -123,7 +123,7 @@ reactos/dll/win32/msgsm32.acm # Synced to Wine-1.7.27 reactos/dll/win32/mshtml # Synced to Wine-1.7.27 reactos/dll/win32/mshtml.tlb # Synced to Wine-1.7.27 -reactos/dll/win32/msi # Synced to Wine-1.7.27 +reactos/dll/win32/msi # Synced to WineStaging-1.7.37 reactos/dll/win32/msimg32 # Synced to Wine-1.7.27 reactos/dll/win32/msimtf # Synced to Wine-1.7.27 reactos/dll/win32/msisip # Synced to Wine-1.7.27
9 years, 9 months
1
0
0
0
[akhaldi] 66631: [PSDK] Add missing MsiProvidedComponent{A, W} declarations. CORE-9246
by akhaldi@svn.reactos.org
Author: akhaldi Date: Mon Mar 9 20:26:03 2015 New Revision: 66631 URL:
http://svn.reactos.org/svn/reactos?rev=66631&view=rev
Log: [PSDK] Add missing MsiProvidedComponent{A,W} declarations. CORE-9246 Modified: trunk/reactos/include/psdk/msi.h Modified: trunk/reactos/include/psdk/msi.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/msi.h?rev=666…
============================================================================== --- trunk/reactos/include/psdk/msi.h [iso-8859-1] (original) +++ trunk/reactos/include/psdk/msi.h [iso-8859-1] Mon Mar 9 20:26:03 2015 @@ -1049,6 +1049,10 @@ #define MsiGetUserInfo WINELIB_NAME_AW(MsiGetUserInfo) +UINT WINAPI MsiProvidedComponentA(LPCSTR, LPCSTR, LPCSTR, DWORD, LPSTR, LPDWORD); +UINT WINAPI MsiProvideComponentW(LPCWSTR, LPCWSTR, LPCWSTR, DWORD, LPWSTR, LPDWORD); +#define MsiProvideComponent WINELIB_NAME_AW(MsiProvideComponent) + UINT WINAPI MsiCollectUserInfoA(_In_ LPCSTR); UINT WINAPI MsiCollectUserInfoW(_In_ LPCWSTR); #define MsiCollectUserInfo WINELIB_NAME_AW(MsiCollectUserInfo)
9 years, 9 months
1
0
0
0
[akhaldi] 66630: [MSIEXEC] Sync with Wine Staging 1.7.37. CORE-9246
by akhaldi@svn.reactos.org
Author: akhaldi Date: Mon Mar 9 20:02:20 2015 New Revision: 66630 URL:
http://svn.reactos.org/svn/reactos?rev=66630&view=rev
Log: [MSIEXEC] Sync with Wine Staging 1.7.37. CORE-9246 Modified: trunk/reactos/base/system/msiexec/msiexec.c trunk/reactos/base/system/msiexec/rsrc.rc trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/base/system/msiexec/msiexec.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/msiexec/msiexe…
============================================================================== --- trunk/reactos/base/system/msiexec/msiexec.c [iso-8859-1] (original) +++ trunk/reactos/base/system/msiexec/msiexec.c [iso-8859-1] Mon Mar 9 20:02:20 2015 @@ -866,7 +866,7 @@ ExitProcess(1); } } - else if(msi_option_equal(argvW[i], "p")) + else if(msi_option_equal(argvW[i], "p") || msi_option_equal(argvW[i], "update")) { FunctionPatch = TRUE; i++; Modified: trunk/reactos/base/system/msiexec/rsrc.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/msiexec/rsrc.r…
============================================================================== --- trunk/reactos/base/system/msiexec/rsrc.rc [iso-8859-1] (original) +++ trunk/reactos/base/system/msiexec/rsrc.rc [iso-8859-1] Mon Mar 9 20:02:20 2015 @@ -21,10 +21,10 @@ #define WINE_FILEDESCRIPTION_STR "Wine Installer" #define WINE_FILENAME_STR "msiexec.exe" #define WINE_FILETYPE VFT_APP -#define WINE_FILEVERSION 4,5,6001,22299 -#define WINE_FILEVERSION_STR "4.5.6001.22299" -#define WINE_PRODUCTVERSION 4,5,6001,22299 -#define WINE_PRODUCTVERSION_STR "4.5.6001.22299" +#define WINE_FILEVERSION 4,5,6001,22308 +#define WINE_FILEVERSION_STR "4.5.6001.22308" +#define WINE_PRODUCTVERSION 4,5,6001,22308 +#define WINE_PRODUCTVERSION_STR "4.5.6001.22308" #define WINE_PRODUCTNAME_STR "Wine Installer" #include "wine/wine_common_ver.rc" 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] Mon Mar 9 20:02:20 2015 @@ -251,7 +251,7 @@ reactos/base/applications/wordpad # Synced to Wine-1.7.27 reactos/base/services/rpcss # Synced to Wine-1.7.27 reactos/base/system/expand # Synced to Wine-1.7.27 -reactos/base/system/msiexec # Synced to Wine-1.7.27 +reactos/base/system/msiexec # Synced to WineStaging-1.7.37 reactos/modules/rosapps/winfile # Autosync In addition the following libs, dlls and source files are mostly based on code ported
9 years, 9 months
1
0
0
0
[akhaldi] 66629: [OLE32_WINETEST] Sync with Wine Staging 1.7.37. CORE-9246
by akhaldi@svn.reactos.org
Author: akhaldi Date: Mon Mar 9 19:58:31 2015 New Revision: 66629 URL:
http://svn.reactos.org/svn/reactos?rev=66629&view=rev
Log: [OLE32_WINETEST] Sync with Wine Staging 1.7.37. CORE-9246 Modified: trunk/rostests/winetests/ole32/compobj.c trunk/rostests/winetests/ole32/moniker.c trunk/rostests/winetests/ole32/storage32.c trunk/rostests/winetests/ole32/usrmarshal.c Modified: trunk/rostests/winetests/ole32/compobj.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/ole32/compobj.c…
============================================================================== --- trunk/rostests/winetests/ole32/compobj.c [iso-8859-1] (original) +++ trunk/rostests/winetests/ole32/compobj.c [iso-8859-1] Mon Mar 9 19:58:31 2015 @@ -38,6 +38,7 @@ //#include "shlguid.h" #include <ole2.h> #include <urlmon.h> /* for CLSID_FileProtocol */ +#include <dde.h> #include <ctxtcall.h> @@ -390,6 +391,7 @@ clsid = CLSID_NULL; hr = CLSIDFromProgID(progidW, &clsid); + ok(hr == S_OK, "got 0x%08x\n", hr); /* it returns generated CLSID here */ ok(!IsEqualCLSID(&clsid, &CLSID_non_existent) && !IsEqualCLSID(&clsid, &CLSID_NULL), "got wrong clsid %s\n", wine_dbgstr_guid(&clsid)); @@ -1166,6 +1168,7 @@ ok(!res, "RegCreateKeyEx returned %d\n", res); res = RegCreateKeyExA(hkey, "ProxyStubClsid32", 0, NULL, 0, KEY_ALL_ACCESS | opposite, NULL, &hkey_psclsid, NULL); + ok(!res, "RegCreateKeyEx returned %d\n", res); res = RegSetValueExA(hkey_psclsid, NULL, 0, REG_SZ, (const BYTE *)clsidA, strlen(clsidA)+1); ok(!res, "RegSetValueEx returned %d\n", res); RegCloseKey(hkey_psclsid); @@ -1919,10 +1922,10 @@ ok(hr == S_OK, "Expected S_OK, got 0x%08x\n", hr); todo_wine ok(ctx == (IObjContext *)token, "Expected interface pointers to be the same\n"); - refs = IUnknown_AddRef((IUnknown *)ctx); + refs = IObjContext_AddRef(ctx); todo_wine ok(refs == 3, "Expected 3, got %u\n", refs); - refs = IUnknown_Release((IUnknown *)ctx); + refs = IObjContext_Release(ctx); todo_wine ok(refs == 2, "Expected 2, got %u\n", refs); refs = IUnknown_Release((IUnknown *)token); @@ -1935,13 +1938,13 @@ ok(token, "Expected token != 0\n"); todo_wine ok(ctx == (IObjContext *)token, "Expected interface pointers to be the same\n"); - refs = IUnknown_AddRef((IUnknown *)ctx); + refs = IObjContext_AddRef(ctx); ok(refs == 2, "Expected 1, got %u\n", refs); - refs = IUnknown_Release((IUnknown *)ctx); + refs = IObjContext_Release(ctx); ok(refs == 1, "Expected 0, got %u\n", refs); - refs = IUnknown_Release((IUnknown *)ctx); + refs = IObjContext_Release(ctx); ok(refs == 0, "Expected 0, got %u\n", refs); CoUninitialize(); @@ -2043,6 +2046,7 @@ /* Cleanup */ CoUninitialize(); OleUninitialize(); + OleUninitialize(); } static void test_OleRegGetMiscStatus(void) @@ -2095,6 +2099,350 @@ hr = CoCreateGuid(NULL); ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); +} + +static void CALLBACK apc_test_proc(ULONG_PTR param) +{ + /* nothing */ +} + +static DWORD CALLBACK release_semaphore_thread( LPVOID arg ) +{ + HANDLE handle = arg; + if (WaitForSingleObject(handle, 200) == WAIT_TIMEOUT) + ReleaseSemaphore(handle, 1, NULL); + return 0; +} + +static DWORD CALLBACK send_message_thread(LPVOID arg) +{ + HWND hWnd = arg; + Sleep(50); + SendMessageA(hWnd, WM_DDE_FIRST, 0, 0); + return 0; +} + +static DWORD CALLBACK post_message_thread(LPVOID arg) +{ + HWND hWnd = arg; + Sleep(50); + PostMessageA(hWnd, WM_DDE_FIRST, 0, 0); + return 0; +} + +static void test_CoWaitForMultipleHandles(void) +{ + static const char cls_name[] = "cowait_test_class"; + HANDLE handles[2], thread; + DWORD index, tid; + WNDCLASSEXA wc; + BOOL success; + HRESULT hr; + HWND hWnd; + MSG msg; + + hr = pCoInitializeEx(NULL, COINIT_APARTMENTTHREADED); + ok(hr == S_OK, "CoInitializeEx failed with error 0x%08x\n", hr); + + memset(&wc, 0, sizeof(wc)); + wc.cbSize = sizeof(wc); + wc.style = CS_VREDRAW | CS_HREDRAW; + wc.hInstance = GetModuleHandleA(0); + wc.hCursor = LoadCursorA(NULL, (LPCSTR)IDC_ARROW); + wc.hbrBackground = NULL; + wc.lpszClassName = cls_name; + wc.lpfnWndProc = DefWindowProcA; + success = RegisterClassExA(&wc) != 0; + ok(success, "RegisterClassExA failed %u\n", GetLastError()); + + hWnd = CreateWindowExA(0, cls_name, "Test", WS_TILEDWINDOW, 0, 0, 640, 480, 0, 0, 0, 0); + ok(hWnd != 0, "CreateWindowExA failed %u\n", GetLastError()); + handles[0] = CreateSemaphoreA(NULL, 1, 1, NULL); + ok(handles[0] != 0, "CreateSemaphoreA failed %u\n", GetLastError()); + handles[1] = CreateSemaphoreA(NULL, 1, 1, NULL); + ok(handles[1] != 0, "CreateSemaphoreA failed %u\n", GetLastError()); + + /* test without flags */ + + PostMessageA(hWnd, WM_DDE_FIRST, 0, 0); + hr = CoWaitForMultipleHandles(0, 50, 0, handles, NULL); + ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got 0x%08x\n", hr); + success = PeekMessageA(&msg, hWnd, WM_DDE_FIRST, WM_DDE_FIRST, PM_REMOVE); + ok(success, "CoWaitForMultipleHandles unexpectedly pumped messages\n"); + + index = 0xdeadbeef; + PostMessageA(hWnd, WM_DDE_FIRST, 0, 0); + hr = CoWaitForMultipleHandles(0, 50, 0, NULL, &index); + ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got 0x%08x\n", hr); + ok(index == 0, "expected index 0, got %u\n", index); + success = PeekMessageA(&msg, hWnd, WM_DDE_FIRST, WM_DDE_FIRST, PM_REMOVE); + ok(success, "CoWaitForMultipleHandles unexpectedly pumped messages\n"); + + index = 0xdeadbeef; + PostMessageA(hWnd, WM_DDE_FIRST, 0, 0); + hr = CoWaitForMultipleHandles(0, 50, 0, handles, &index); + ok(hr == RPC_E_NO_SYNC, "expected RPC_E_NO_SYNC, got 0x%08x\n", hr); + ok(index == 0, "expected index 0, got %u\n", index); + success = PeekMessageA(&msg, hWnd, WM_DDE_FIRST, WM_DDE_FIRST, PM_REMOVE); + ok(success, "CoWaitForMultipleHandles unexpectedly pumped messages\n"); + + index = 0xdeadbeef; + PostMessageA(hWnd, WM_DDE_FIRST, 0, 0); + hr = CoWaitForMultipleHandles(0, 50, 1, handles, &index); + ok(hr == S_OK, "expected S_OK, got 0x%08x\n", hr); + ok(index == 0, "expected index 0, got %u\n", index); + success = PeekMessageA(&msg, hWnd, WM_DDE_FIRST, WM_DDE_FIRST, PM_REMOVE); + ok(success, "CoWaitForMultipleHandles unexpectedly pumped messages\n"); + + index = 0xdeadbeef; + PostMessageA(hWnd, WM_DDE_FIRST, 0, 0); + hr = CoWaitForMultipleHandles(0, 50, 2, handles, &index); + ok(hr == S_OK, "expected S_OK, got 0x%08x\n", hr); + ok(index == 1, "expected index 1, got %u\n", index); + success = PeekMessageA(&msg, hWnd, WM_DDE_FIRST, WM_DDE_FIRST, PM_REMOVE); + ok(success, "CoWaitForMultipleHandles unexpectedly pumped messages\n"); + + index = 0xdeadbeef; + PostMessageA(hWnd, WM_DDE_FIRST, 0, 0); + hr = CoWaitForMultipleHandles(0, 50, 2, handles, &index); + ok(hr == RPC_S_CALLPENDING, "expected RPC_S_CALLPENDING, got 0x%08x\n", hr); + ok(index == 0 || broken(index == 0xdeadbeef) /* Win 8 */, "expected index 0, got %u\n", index); + success = PeekMessageA(&msg, hWnd, WM_DDE_FIRST, WM_DDE_FIRST, PM_REMOVE); + ok(!success, "CoWaitForMultipleHandles didn't pump any messages\n"); + + /* test PostMessageA/SendMessageA from a different thread */ + + index = 0xdeadbeef; + thread = CreateThread(NULL, 0, post_message_thread, hWnd, 0, &tid); + ok(thread != NULL, "CreateThread failed, error %u\n", GetLastError()); + hr = CoWaitForMultipleHandles(0, 100, 2, handles, &index); + ok(hr == RPC_S_CALLPENDING, "expected RPC_S_CALLPENDING, got 0x%08x\n", hr); + ok(index == 0 || broken(index == 0xdeadbeef) /* Win 8 */, "expected index 0, got %u\n", index); + success = PeekMessageA(&msg, hWnd, WM_DDE_FIRST, WM_DDE_FIRST, PM_REMOVE); + ok(!success, "CoWaitForMultipleHandles didn't pump any messages\n"); + index = WaitForSingleObject(thread, 200); + ok(index == WAIT_OBJECT_0, "WaitForSingleObject failed\n"); + CloseHandle(thread); + + index = 0xdeadbeef; + thread = CreateThread(NULL, 0, send_message_thread, hWnd, 0, &tid); + ok(thread != NULL, "CreateThread failed, error %u\n", GetLastError()); + hr = CoWaitForMultipleHandles(0, 100, 2, handles, &index); + ok(hr == RPC_S_CALLPENDING, "expected RPC_S_CALLPENDING, got 0x%08x\n", hr); + ok(index == 0 || broken(index == 0xdeadbeef) /* Win 8 */, "expected index 0, got %u\n", index); + success = PeekMessageA(&msg, hWnd, WM_DDE_FIRST, WM_DDE_FIRST, PM_REMOVE); + ok(!success, "CoWaitForMultipleHandles didn't pump any messages\n"); + index = WaitForSingleObject(thread, 200); + ok(index == WAIT_OBJECT_0, "WaitForSingleObject failed\n"); + CloseHandle(thread); + + ReleaseSemaphore(handles[0], 1, NULL); + ReleaseSemaphore(handles[1], 1, NULL); + + /* test with COWAIT_WAITALL */ + + index = 0xdeadbeef; + PostMessageA(hWnd, WM_DDE_FIRST, 0, 0); + hr = CoWaitForMultipleHandles(COWAIT_WAITALL, 50, 2, handles, &index); + ok(hr == S_OK, "expected S_OK, got 0x%08x\n", hr); + ok(index == 0, "expected index 0, got %u\n", index); + success = PeekMessageA(&msg, hWnd, WM_DDE_FIRST, WM_DDE_FIRST, PM_REMOVE); + ok(success, "CoWaitForMultipleHandles unexpectedly pumped messages\n"); + + index = 0xdeadbeef; + PostMessageA(hWnd, WM_DDE_FIRST, 0, 0); + hr = CoWaitForMultipleHandles(0, 50, 2, handles, &index); + ok(hr == RPC_S_CALLPENDING, "expected RPC_S_CALLPENDING, got 0x%08x\n", hr); + ok(index == 0 || broken(index == 0xdeadbeef) /* Win 8 */, "expected index 0, got %u\n", index); + success = PeekMessageA(&msg, hWnd, WM_DDE_FIRST, WM_DDE_FIRST, PM_REMOVE); + ok(!success, "CoWaitForMultipleHandles didn't pump any messages\n"); + + ReleaseSemaphore(handles[0], 1, NULL); + ReleaseSemaphore(handles[1], 1, NULL); + + /* test with COWAIT_ALERTABLE */ + + index = 0xdeadbeef; + PostMessageA(hWnd, WM_DDE_FIRST, 0, 0); + hr = CoWaitForMultipleHandles(COWAIT_ALERTABLE, 50, 1, handles, &index); + ok(hr == S_OK, "expected S_OK, got 0x%08x\n", hr); + ok(index == 0, "expected index 0, got %u\n", index); + success = PeekMessageA(&msg, hWnd, WM_DDE_FIRST, WM_DDE_FIRST, PM_REMOVE); + ok(success, "CoWaitForMultipleHandles unexpectedly pumped messages\n"); + + index = 0xdeadbeef; + PostMessageA(hWnd, WM_DDE_FIRST, 0, 0); + hr = CoWaitForMultipleHandles(COWAIT_ALERTABLE, 50, 2, handles, &index); + ok(hr == S_OK, "expected S_OK, got 0x%08x\n", hr); + ok(index == 1, "expected index 1, got %u\n", index); + success = PeekMessageA(&msg, hWnd, WM_DDE_FIRST, WM_DDE_FIRST, PM_REMOVE); + ok(success, "CoWaitForMultipleHandles unexpectedly pumped messages\n"); + + index = 0xdeadbeef; + PostMessageA(hWnd, WM_DDE_FIRST, 0, 0); + hr = CoWaitForMultipleHandles(COWAIT_ALERTABLE, 50, 2, handles, &index); + ok(hr == RPC_S_CALLPENDING, "expected RPC_S_CALLPENDING, got 0x%08x\n", hr); + ok(index == 0 || broken(index == 0xdeadbeef) /* Win 8 */, "expected index 0, got %u\n", index); + success = PeekMessageA(&msg, hWnd, WM_DDE_FIRST, WM_DDE_FIRST, PM_REMOVE); + ok(!success, "CoWaitForMultipleHandles didn't pump any messages\n"); + + index = 0xdeadbeef; + PostMessageA(hWnd, WM_DDE_FIRST, 0, 0); + success = QueueUserAPC(apc_test_proc, GetCurrentThread(), 0); + ok(success, "QueueUserAPC failed %u\n", GetLastError()); + hr = CoWaitForMultipleHandles(COWAIT_ALERTABLE, 50, 2, handles, &index); + ok(hr == S_OK, "expected S_OK, got 0x%08x\n", hr); + ok(index == WAIT_IO_COMPLETION, "expected index WAIT_IO_COMPLETION, got %u\n", index); + success = PeekMessageA(&msg, hWnd, WM_DDE_FIRST, WM_DDE_FIRST, PM_REMOVE); + ok(success, "CoWaitForMultipleHandles unexpectedly pumped messages\n"); + + /* test with COWAIT_INPUTAVAILABLE (semaphores are still locked) */ + + index = 0xdeadbeef; + PostMessageA(hWnd, WM_DDE_FIRST, 0, 0); + success = PeekMessageA(&msg, hWnd, WM_DDE_FIRST, WM_DDE_FIRST, PM_NOREMOVE); + ok(success, "PeekMessageA returned FALSE\n"); + hr = CoWaitForMultipleHandles(0, 50, 2, handles, &index); + ok(hr == RPC_S_CALLPENDING, "expected RPC_S_CALLPENDING, got 0x%08x\n", hr); + ok(index == 0 || broken(index == 0xdeadbeef) /* Win 8 */, "expected index 0, got %u\n", index); + success = PeekMessageA(&msg, hWnd, WM_DDE_FIRST, WM_DDE_FIRST, PM_REMOVE); + ok(!success, "CoWaitForMultipleHandles didn't pump any messages\n"); + + index = 0xdeadbeef; + PostMessageA(hWnd, WM_DDE_FIRST, 0, 0); + success = PeekMessageA(&msg, hWnd, WM_DDE_FIRST, WM_DDE_FIRST, PM_NOREMOVE); + ok(success, "PeekMessageA returned FALSE\n"); + thread = CreateThread(NULL, 0, release_semaphore_thread, handles[1], 0, &tid); + ok(thread != NULL, "CreateThread failed, error %u\n", GetLastError()); + hr = CoWaitForMultipleHandles(COWAIT_INPUTAVAILABLE, 50, 2, handles, &index); + ok(hr == RPC_S_CALLPENDING || broken(hr == E_INVALIDARG) || broken(hr == S_OK) /* Win 8 */, + "expected RPC_S_CALLPENDING, got 0x%08x\n", hr); + if (hr != S_OK) ReleaseSemaphore(handles[1], 1, NULL); + ok(index == 0 || broken(index == 1) /* Win 8 */, "expected index 0, got %u\n", index); + success = PeekMessageA(&msg, hWnd, WM_DDE_FIRST, WM_DDE_FIRST, PM_REMOVE); + ok(!success || broken(success && hr == E_INVALIDARG), + "CoWaitForMultipleHandles didn't pump any messages\n"); + index = WaitForSingleObject(thread, 200); + ok(index == WAIT_OBJECT_0, "WaitForSingleObject failed\n"); + CloseHandle(thread); + + /* test behaviour of WM_QUIT (semaphores are still locked) */ + + PostMessageA(hWnd, WM_QUIT, 40, 0); + memset(&msg, 0, sizeof(msg)); + success = PeekMessageA(&msg, hWnd, WM_QUIT, WM_QUIT, PM_REMOVE); + ok(success, "PeekMessageA failed, error %u\n", GetLastError()); + ok(msg.message == WM_QUIT, "expected msg.message = WM_QUIT, got %u\n", msg.message); + ok(msg.wParam == 40, "expected msg.wParam = 40, got %lu\n", msg.wParam); + success = PeekMessageA(&msg, hWnd, WM_QUIT, WM_QUIT, PM_REMOVE); + ok(!success, "PeekMessageA succeeded\n"); + + index = 0xdeadbeef; + PostMessageA(hWnd, WM_DDE_FIRST, 0, 0); + PostMessageA(hWnd, WM_QUIT, 41, 0); + thread = CreateThread(NULL, 0, post_message_thread, hWnd, 0, &tid); + ok(thread != NULL, "CreateThread failed, error %u\n", GetLastError()); + hr = CoWaitForMultipleHandles(0, 100, 2, handles, &index); + ok(hr == RPC_S_CALLPENDING, "expected RPC_S_CALLPENDING, got 0x%08x\n", hr); + ok(index == 0 || broken(index == 0xdeadbeef) /* Win 8 */, "expected index 0, got %u\n", index); + success = PeekMessageA(&msg, hWnd, WM_DDE_FIRST, WM_DDE_FIRST, PM_REMOVE); + todo_wine + ok(success || broken(!success) /* Win 2000/XP/8 */, "PeekMessageA failed, error %u\n", GetLastError()); + success = PeekMessageA(&msg, hWnd, WM_DDE_FIRST, WM_DDE_FIRST, PM_REMOVE); + ok(!success, "PeekMessageA succeeded\n"); + memset(&msg, 0, sizeof(msg)); + success = PeekMessageA(&msg, hWnd, WM_QUIT, WM_QUIT, PM_REMOVE); + todo_wine + ok(!success || broken(success) /* Win 2000/XP/8 */, "PeekMessageA succeeded\n"); + if (success) + { + ok(msg.message == WM_QUIT, "expected msg.message = WM_QUIT, got %u\n", msg.message); + ok(msg.wParam == 41, "expected msg.wParam = 41, got %lu\n", msg.wParam); + } + index = WaitForSingleObject(thread, 200); + ok(index == WAIT_OBJECT_0, "WaitForSingleObject failed\n"); + CloseHandle(thread); + + index = 0xdeadbeef; + PostMessageA(hWnd, WM_DDE_FIRST, 0, 0); + PostMessageA(hWnd, WM_QUIT, 42, 0); + thread = CreateThread(NULL, 0, send_message_thread, hWnd, 0, &tid); + ok(thread != NULL, "CreateThread failed, error %u\n", GetLastError()); + hr = CoWaitForMultipleHandles(0, 100, 2, handles, &index); + ok(hr == RPC_S_CALLPENDING, "expected RPC_S_CALLPENDING, got 0x%08x\n", hr); + ok(index == 0 || broken(index == 0xdeadbeef) /* Win 8 */, "expected index 0, got %u\n", index); + success = PeekMessageA(&msg, hWnd, WM_DDE_FIRST, WM_DDE_FIRST, PM_REMOVE); + ok(!success, "CoWaitForMultipleHandles didn't pump all WM_DDE_FIRST messages\n"); + memset(&msg, 0, sizeof(msg)); + success = PeekMessageA(&msg, hWnd, WM_QUIT, WM_QUIT, PM_REMOVE); + ok(success, "PeekMessageA failed, error %u\n", GetLastError()); + ok(msg.message == WM_QUIT, "expected msg.message = WM_QUIT, got %u\n", msg.message); + ok(msg.wParam == 42, "expected msg.wParam = 42, got %lu\n", msg.wParam); + index = WaitForSingleObject(thread, 200); + ok(index == WAIT_OBJECT_0, "WaitForSingleObject failed\n"); + CloseHandle(thread); + + PostQuitMessage(43); + memset(&msg, 0, sizeof(msg)); + success = PeekMessageA(&msg, hWnd, WM_QUIT, WM_QUIT, PM_REMOVE); + ok(success || broken(!success) /* Win 8 */, "PeekMessageA failed, error %u\n", GetLastError()); + if (!success) + win_skip("PostQuitMessage didn't queue a WM_QUIT message, skipping tests\n"); + else + { + ok(msg.message == WM_QUIT, "expected msg.message = WM_QUIT, got %u\n", msg.message); + ok(msg.wParam == 43, "expected msg.wParam = 43, got %lu\n", msg.wParam); + success = PeekMessageA(&msg, hWnd, WM_QUIT, WM_QUIT, PM_REMOVE); + ok(!success, "PeekMessageA succeeded\n"); + + index = 0xdeadbeef; + PostMessageA(hWnd, WM_DDE_FIRST, 0, 0); + PostQuitMessage(44); + thread = CreateThread(NULL, 0, post_message_thread, hWnd, 0, &tid); + ok(thread != NULL, "CreateThread failed, error %u\n", GetLastError()); + hr = CoWaitForMultipleHandles(0, 100, 2, handles, &index); + ok(hr == RPC_S_CALLPENDING, "expected RPC_S_CALLPENDING, got 0x%08x\n", hr); + ok(index == 0 || broken(index == 0xdeadbeef) /* Win 8 */, "expected index 0, got %u\n", index); + success = PeekMessageA(&msg, hWnd, WM_DDE_FIRST, WM_DDE_FIRST, PM_REMOVE); + ok(success, "PeekMessageA failed, error %u\n", GetLastError()); + success = PeekMessageA(&msg, hWnd, WM_DDE_FIRST, WM_DDE_FIRST, PM_REMOVE); + todo_wine + ok(!success, "PeekMessageA succeeded\n"); + success = PeekMessageA(&msg, hWnd, WM_QUIT, WM_QUIT, PM_REMOVE); + todo_wine + ok(!success, "CoWaitForMultipleHandles didn't remove WM_QUIT messages\n"); + index = WaitForSingleObject(thread, 200); + ok(index == WAIT_OBJECT_0, "WaitForSingleObject failed\n"); + CloseHandle(thread); + + index = 0xdeadbeef; + PostMessageA(hWnd, WM_DDE_FIRST, 0, 0); + PostQuitMessage(45); + thread = CreateThread(NULL, 0, send_message_thread, hWnd, 0, &tid); + ok(thread != NULL, "CreateThread failed, error %u\n", GetLastError()); + hr = CoWaitForMultipleHandles(0, 100, 2, handles, &index); + ok(hr == RPC_S_CALLPENDING, "expected RPC_S_CALLPENDING, got 0x%08x\n", hr); + ok(index == 0 || broken(index == 0xdeadbeef) /* Win 8 */, "expected index 0, got %u\n", index); + success = PeekMessageA(&msg, hWnd, WM_DDE_FIRST, WM_DDE_FIRST, PM_REMOVE); + ok(success, "PeekMessageA failed, error %u\n", GetLastError()); + success = PeekMessageA(&msg, hWnd, WM_DDE_FIRST, WM_DDE_FIRST, PM_REMOVE); + todo_wine + ok(!success, "PeekMessageA succeeded\n"); + success = PeekMessageA(&msg, hWnd, WM_QUIT, WM_QUIT, PM_REMOVE); + ok(!success, "CoWaitForMultipleHandles didn't remove WM_QUIT messages\n"); + index = WaitForSingleObject(thread, 200); + ok(index == WAIT_OBJECT_0, "WaitForSingleObject failed\n"); + CloseHandle(thread); + } + + CloseHandle(handles[0]); + CloseHandle(handles[1]); + DestroyWindow(hWnd); + + success = UnregisterClassA(cls_name, GetModuleHandleA(0)); + ok(success, "UnregisterClass failed %u\n", GetLastError()); + + CoUninitialize(); } static void init_funcs(void) @@ -2157,4 +2505,5 @@ test_CoInitializeEx(); test_OleRegGetMiscStatus(); test_CoCreateGuid(); -} + test_CoWaitForMultipleHandles(); +} Modified: trunk/rostests/winetests/ole32/moniker.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/ole32/moniker.c…
============================================================================== --- trunk/rostests/winetests/ole32/moniker.c [iso-8859-1] (original) +++ trunk/rostests/winetests/ole32/moniker.c [iso-8859-1] Mon Mar 9 19:58:31 2015 @@ -61,14 +61,6 @@ static char const * const *expected_method_list; static const WCHAR wszFileName1[] = {'c',':','\\','w','i','n','d','o','w','s','\\','t','e','s','t','1','.','d','o','c',0}; static const WCHAR wszFileName2[] = {'c',':','\\','w','i','n','d','o','w','s','\\','t','e','s','t','2','.','d','o','c',0}; - -static const CLSID CLSID_WineTest = -{ /* 9474ba1a-258b-490b-bc13-516e9239ace0 */ - 0x9474ba1a, - 0x258b, - 0x490b, - {0xbc, 0x13, 0x51, 0x6e, 0x92, 0x39, 0xac, 0xe0} -}; static const CLSID CLSID_TestMoniker = { /* b306bfbc-496e-4f53-b93e-2ff9c83223d7 */ @@ -2028,9 +2020,7 @@ hr = IMoniker_Save(pMk, pStm, TRUE); ok_ole_success(hr, "IMoniker_Save"); - - hr = IMoniker_Release(pMk); - ok_ole_success(hr, "IMoniker_Release"); + IMoniker_Release(pMk); /* overwrite the constants with various values */ hr = IStream_Seek(pStm, zero_pos, STREAM_SEEK_SET, NULL); @@ -2061,11 +2051,8 @@ hr = IMoniker_Load(pMk, pStm); ok_ole_success(hr, "IMoniker_Load"); - hr = IMoniker_Release(pMk); - ok_ole_success(hr, "IMoniker_Release"); - - hr = IStream_Release(pStm); - ok_ole_success(hr, "IStream_Release"); + IMoniker_Release(pMk); + IStream_Release(pStm); } START_TEST(moniker) Modified: trunk/rostests/winetests/ole32/storage32.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/ole32/storage32…
============================================================================== --- trunk/rostests/winetests/ole32/storage32.c [iso-8859-1] (original) +++ trunk/rostests/winetests/ole32/storage32.c [iso-8859-1] Mon Mar 9 19:58:31 2015 @@ -1052,7 +1052,7 @@ r = IStorage_CreateStream(stg, stmname, STGM_SHARE_EXCLUSIVE | STGM_READWRITE, 0, 0, &stm ); ok(r==S_OK, "IStorage->CreateStream failed\n"); - r = IStream_Release(stm); + IStream_Release(stm); /* first enum ... should be 1 stream */ r = IStorage_EnumElements(stg, 0, NULL, 0, &ee); Modified: trunk/rostests/winetests/ole32/usrmarshal.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/ole32/usrmarsha…
============================================================================== --- trunk/rostests/winetests/ole32/usrmarshal.c [iso-8859-1] (original) +++ trunk/rostests/winetests/ole32/usrmarshal.c [iso-8859-1] Mon Mar 9 19:58:31 2015 @@ -281,7 +281,6 @@ ok(*(DWORD *)wirehemf == (size - 0x10), "wirestgm + 0xc should be size - 0x10 instead of 0x%08x\n", *(DWORD *)wirehemf); wirehemf += sizeof(DWORD); ok(*(DWORD *)wirehemf == EMR_HEADER, "wirestgm + 0x10 should be EMR_HEADER instead of %d\n", *(DWORD *)wirehemf); - wirehemf += sizeof(DWORD); /* ... rest of data not tested - refer to tests for GetEnhMetaFileBits * at this point */ @@ -306,7 +305,6 @@ ok(*(DWORD *)wirehemf == WDT_REMOTE_CALL, "wirestgm + 0x0 should be WDT_REMOTE_CALL instead of 0x%08x\n", *(DWORD *)wirehemf); wirehemf += sizeof(DWORD); ok(*(DWORD *)wirehemf == (DWORD)(DWORD_PTR)hemf, "wirestgm + 0x4 should be hemf instead of 0x%08x\n", *(DWORD *)wirehemf); - wirehemf += sizeof(DWORD); init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, buffer, size, MSHCTX_DIFFERENTMACHINE); HENHMETAFILE_UserUnmarshal(&umcb.Flags, buffer, &hemf2); @@ -442,7 +440,6 @@ ok(*(DWORD *)wirehmfp == (buffer_end - buffer - 0x28), "wirestgm + 0x24 should be size - 0x34 instead of 0x%08x\n", *(DWORD *)wirehmfp); wirehmfp += sizeof(DWORD); ok(*(WORD *)wirehmfp == 1, "wirehmfp + 0x28 should be 1 instead of 0x%08x\n", *(DWORD *)wirehmfp); - wirehmfp += sizeof(DWORD); /* ... rest of data not tested - refer to tests for GetMetaFileBits * at this point */ @@ -585,6 +582,7 @@ ok(size == 0, "size should be 0 bytes, not %d\n", size); buffer = HeapAlloc(GetProcessHeap(), 0, size); buffer_end = WdtpInterfacePointer_UserMarshal(&umcb.Flags, ctx, buffer, unk, &IID_IUnknown); + ok(buffer_end == buffer, "buffer_end %p buffer %p\n", buffer_end, buffer); HeapFree(GetProcessHeap(), 0, buffer); /* Now for a non-NULL pointer. The marshalled data are two size DWORDS and then
9 years, 9 months
1
0
0
0
[akhaldi] 66628: [OLE32] Sync with Wine Staging 1.7.37. CORE-9246
by akhaldi@svn.reactos.org
Author: akhaldi Date: Mon Mar 9 19:57:38 2015 New Revision: 66628 URL:
http://svn.reactos.org/svn/reactos?rev=66628&view=rev
Log: [OLE32] Sync with Wine Staging 1.7.37. CORE-9246 Modified: trunk/reactos/dll/win32/ole32/CMakeLists.txt trunk/reactos/dll/win32/ole32/clipboard.c trunk/reactos/dll/win32/ole32/compobj.c trunk/reactos/dll/win32/ole32/ole2.c trunk/reactos/dll/win32/ole32/ole32_ros.diff trunk/reactos/dll/win32/ole32/storage32.c trunk/reactos/dll/win32/ole32/storage32.h trunk/reactos/dll/win32/ole32/usrmarshal.c trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/ole32/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/CMakeLists…
============================================================================== --- trunk/reactos/dll/win32/ole32/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/dll/win32/ole32/CMakeLists.txt [iso-8859-1] Mon Mar 9 19:57:38 2015 @@ -80,7 +80,7 @@ set_module_type(ole32 win32dll) target_link_libraries(ole32 wine uuid ${PSEH_LIB}) -add_importlibs(ole32 advapi32 user32 gdi32 rpcrt4 msvcrt kernel32 ntdll) +add_importlibs(ole32 advapi32 user32 gdi32 rpcrt4 msvcrt kernel32 kernel32_vista ntdll) add_delay_importlibs(ole32 oleaut32) add_dependencies(ole32 ole32idl) add_pch(ole32 precomp.h SOURCE) Modified: trunk/reactos/dll/win32/ole32/clipboard.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/clipboard.…
============================================================================== --- trunk/reactos/dll/win32/ole32/clipboard.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/ole32/clipboard.c [iso-8859-1] Mon Mar 9 19:57:38 2015 @@ -174,8 +174,6 @@ */ static const WCHAR clipbrd_wndclass[] = {'C','L','I','P','B','R','D','W','N','D','C','L','A','S','S',0}; -static const WCHAR wine_marshal_dataobject[] = {'W','i','n','e',' ','m','a','r','s','h','a','l',' ','d','a','t','a','o','b','j','e','c','t',0}; - UINT ownerlink_clipboard_format = 0; UINT filename_clipboard_format = 0; UINT filenameW_clipboard_format = 0; @@ -190,13 +188,11 @@ static UINT wine_marshal_clipboard_format; -static inline char *dump_fmtetc(FORMATETC *fmt) -{ - static char buf[100]; - - snprintf(buf, sizeof(buf), "cf %04x ptd %p aspect %x lindex %d tymed %x", - fmt->cfFormat, fmt->ptd, fmt->dwAspect, fmt->lindex, fmt->tymed); - return buf; +static inline const char *dump_fmtetc(FORMATETC *fmt) +{ + if (!fmt) return "(null)"; + return wine_dbg_sprintf("cf %04x ptd %p aspect %x lindex %d tymed %x", + fmt->cfFormat, fmt->ptd, fmt->dwAspect, fmt->lindex, fmt->tymed); } /*---------------------------------------------------------------------* @@ -1113,6 +1109,8 @@ return TYMED_ENHMF; case CF_METAFILEPICT: return TYMED_MFPICT; + case CF_BITMAP: + return TYMED_GDI; default: FIXME("returning TYMED_NULL for cf %04x\n", cf); return TYMED_NULL; @@ -1290,6 +1288,27 @@ return S_OK; } +/************************************************************************ + * get_stgmed_for_bitmap + * + * Returns a stg medium with a bitmap based on the handle + */ +static HRESULT get_stgmed_for_bitmap(HBITMAP hbmp, STGMEDIUM *med) +{ + HRESULT hr; + + med->pUnkForRelease = NULL; + med->tymed = TYMED_NULL; + + hr = dup_bitmap(hbmp, &med->u.hBitmap); + + if (FAILED(hr)) + return hr; + + med->tymed = TYMED_GDI; + return S_OK; +} + static inline BOOL string_off_equal(const DVTARGETDEVICE *t1, WORD off1, const DVTARGETDEVICE *t2, WORD off2) { const WCHAR *str1, *str2; @@ -1381,6 +1400,8 @@ hr = get_stgmed_for_stream(h, med); else if(mask & TYMED_ENHMF) hr = get_stgmed_for_emf((HENHMETAFILE)h, med); + else if(mask & TYMED_GDI) + hr = get_stgmed_for_bitmap((HBITMAP)h, med); else { FIXME("Unhandled tymed - mask %x req tymed %x\n", mask, fmt->tymed); Modified: trunk/reactos/dll/win32/ole32/compobj.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/compobj.c?…
============================================================================== --- trunk/reactos/dll/win32/ole32/compobj.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/ole32/compobj.c [iso-8859-1] Mon Mar 9 19:57:38 2015 @@ -1628,7 +1628,6 @@ return hr; } -#ifndef __REACTOS__ static BOOL WINAPI register_class( INIT_ONCE *once, void *param, void **context ) { WNDCLASSW wclass; @@ -1649,33 +1648,24 @@ RegisterClassW(&wclass); return TRUE; } -#endif /* create a window for the apartment or return the current one if one has * already been created */ HRESULT apartment_createwindowifneeded(struct apartment *apt) { -#ifndef __REACTOS__ static INIT_ONCE class_init_once = INIT_ONCE_STATIC_INIT; -#endif if (apt->multi_threaded) return S_OK; if (!apt->win) { -#ifndef __REACTOS__ HWND hwnd; InitOnceExecuteOnce( &class_init_once, register_class, NULL, NULL ); hwnd = CreateWindowW(wszAptWinClass, NULL, 0, 0, 0, 0, 0, HWND_MESSAGE, 0, hProxyDll, NULL); -#else - HWND hwnd = CreateWindowW(wszAptWinClass, NULL, 0, - 0, 0, 0, 0, - HWND_MESSAGE, 0, hProxyDll, NULL); -#endif if (!hwnd) { ERR("CreateWindow failed with error %d\n", GetLastError()); @@ -1701,35 +1691,6 @@ apartment_addref(MTA); COM_CurrentInfo()->apt = MTA; } - -#ifdef __REACTOS__ - -static void COMPOBJ_InitProcess( void ) -{ - WNDCLASSW wclass; - - /* Dispatching to the correct thread in an apartment is done through - * window messages rather than RPC transports. When an interface is - * marshalled into another apartment in the same process, a window of the - * following class is created. The *caller* of CoMarshalInterface (i.e., the - * application) is responsible for pumping the message loop in that thread. - * The WM_USER messages which point to the RPCs are then dispatched to - * apartment_wndproc by the user's code from the apartment in which the - * interface was unmarshalled. - */ - memset(&wclass, 0, sizeof(wclass)); - wclass.lpfnWndProc = apartment_wndproc; - wclass.hInstance = hProxyDll; - wclass.lpszClassName = wszAptWinClass; - RegisterClassW(&wclass); -} - -static void COMPOBJ_UninitProcess( void ) -{ - UnregisterClassW(wszAptWinClass, hProxyDll); -} - -#endif static void COM_TlsDestroy(void) { @@ -1964,7 +1925,7 @@ * SEE ALSO * CoInitializeEx */ -void WINAPI CoUninitialize(void) +void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void) { struct oletls * info = COM_CurrentInfo(); LONG lCOMRefCnt; @@ -4443,10 +4404,22 @@ DWORD start_time = GetTickCount(); APARTMENT *apt = COM_CurrentApt(); BOOL message_loop = apt && !apt->multi_threaded; + BOOL check_apc = (dwFlags & COWAIT_ALERTABLE) != 0; TRACE("(0x%08x, 0x%08x, %d, %p, %p)\n", dwFlags, dwTimeout, cHandles, pHandles, lpdwindex); + if (!lpdwindex) + return E_INVALIDARG; + + *lpdwindex = 0; + + if (!pHandles) + return E_INVALIDARG; + + if (!cHandles) + return RPC_E_NO_SYNC; + while (TRUE) { DWORD now = GetTickCount(); @@ -4465,9 +4438,19 @@ TRACE("waiting for rpc completion or window message\n"); - res = MsgWaitForMultipleObjectsEx(cHandles, pHandles, - (dwTimeout == INFINITE) ? INFINITE : start_time + dwTimeout - now, - QS_SENDMESSAGE | QS_ALLPOSTMESSAGE | QS_PAINT, wait_flags); + res = WAIT_TIMEOUT; + + if (check_apc) + { + res = WaitForMultipleObjectsEx(cHandles, pHandles, + (dwFlags & COWAIT_WAITALL) != 0, 0, TRUE); + check_apc = FALSE; + } + + if (res == WAIT_TIMEOUT) + res = MsgWaitForMultipleObjectsEx(cHandles, pHandles, + (dwTimeout == INFINITE) ? INFINITE : start_time + dwTimeout - now, + QS_SENDMESSAGE | QS_ALLPOSTMESSAGE | QS_PAINT, wait_flags); if (res == WAIT_OBJECT_0 + cHandles) /* messages available */ { @@ -5047,19 +5030,12 @@ switch(fdwReason) { case DLL_PROCESS_ATTACH: hProxyDll = hinstDLL; -#ifdef __REACTOS__ - COMPOBJ_InitProcess(); -#endif break; case DLL_PROCESS_DETACH: if (reserved) break; release_std_git(); -#ifdef __REACTOS__ - COMPOBJ_UninitProcess(); -#else UnregisterClassW( wszAptWinClass, hProxyDll ); -#endif RPC_UnregisterAllChannelHooks(); COMPOBJ_DllList_Free(); DeleteCriticalSection(&csRegisteredClassList); Modified: trunk/reactos/dll/win32/ole32/ole2.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/ole2.c?rev…
============================================================================== --- trunk/reactos/dll/win32/ole32/ole2.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/ole32/ole2.c [iso-8859-1] Mon Mar 9 19:57:38 2015 @@ -205,7 +205,7 @@ /****************************************************************************** * OleUninitialize [OLE32.@] */ -void WINAPI OleUninitialize(void) +void WINAPI DECLSPEC_HOTPATCH OleUninitialize(void) { TRACE("()\n"); @@ -2381,11 +2381,12 @@ */ case DRAGDROP_S_DROP: if (*trackerInfo->pdwEffect != DROPEFFECT_NONE) - trackerInfo->returnValue = IDropTarget_Drop(trackerInfo->curDragTarget, - trackerInfo->dataObject, - trackerInfo->dwKeyState, - trackerInfo->curMousePos, - trackerInfo->pdwEffect); + { + hr = IDropTarget_Drop(trackerInfo->curDragTarget, trackerInfo->dataObject, + trackerInfo->dwKeyState, trackerInfo->curMousePos, trackerInfo->pdwEffect); + if (FAILED(hr)) + trackerInfo->returnValue = hr; + } else IDropTarget_DragLeave(trackerInfo->curDragTarget); break; Modified: trunk/reactos/dll/win32/ole32/ole32_ros.diff URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/ole32_ros.…
============================================================================== --- trunk/reactos/dll/win32/ole32/ole32_ros.diff [iso-8859-1] (original) +++ trunk/reactos/dll/win32/ole32/ole32_ros.diff [iso-8859-1] Mon Mar 9 19:57:38 2015 @@ -1,7 +1,7 @@ -diff -prudN e:\Wine\dlls\ole32/compobj.c e:\reactos\dll\win32\ole32/compobj.c ---- e:\Wine\dlls\ole32/compobj.c 2014-04-04 14:12:42.091208400 +0100 -+++ e:\reactos\dll\win32\ole32/compobj.c 2014-04-24 12:30:07.466625200 +0100 -@@ -331,8 +303,12 @@ static NTSTATUS create_key( HKEY *retkey +diff -prudN e:\wine\dlls\ole32/compobj.c dll\win32\ole32/compobj.c +--- e:\wine\dlls\ole32/compobj.c 2015-02-21 17:13:09.561542200 +0100 ++++ dll\win32\ole32/compobj.c 2015-02-28 13:26:29.259662000 +0100 +@@ -331,8 +304,12 @@ static NTSTATUS create_key( HKEY *retkey return status; } @@ -14,135 +14,9 @@ static HKEY classes_root_hkey; -@@ -1635,6 +1611,7 @@ static HRESULT apartment_hostobject_in_h - return hr; - } - -+#ifndef __REACTOS__ - static BOOL WINAPI register_class( INIT_ONCE *once, void *param, void **context ) - { - WNDCLASSW wclass; -@@ -1655,24 +1632,20 @@ static BOOL WINAPI register_class( INIT_ - RegisterClassW(&wclass); - return TRUE; - } -+#endif - - /* create a window for the apartment or return the current one if one has - * already been created */ - HRESULT apartment_createwindowifneeded(struct apartment *apt) - { -- static INIT_ONCE class_init_once = INIT_ONCE_STATIC_INIT; -- - if (apt->multi_threaded) - return S_OK; - - if (!apt->win) - { -- HWND hwnd; -- -- InitOnceExecuteOnce( &class_init_once, register_class, NULL, NULL ); -- -- hwnd = CreateWindowW(wszAptWinClass, NULL, 0, 0, 0, 0, 0, -- HWND_MESSAGE, 0, hProxyDll, NULL); -+ HWND hwnd = CreateWindowW(wszAptWinClass, NULL, 0, -+ 0, 0, 0, 0, -+ HWND_MESSAGE, 0, hProxyDll, NULL); - if (!hwnd) - { - ERR("CreateWindow failed with error %d\n", GetLastError()); -@@ -1699,6 +1672,35 @@ void apartment_joinmta(void) - COM_CurrentInfo()->apt = MTA; - } - -+#ifdef __REACTOS__ -+ -+static void COMPOBJ_InitProcess( void ) -+{ -+ WNDCLASSW wclass; -+ -+ /* Dispatching to the correct thread in an apartment is done through -+ * window messages rather than RPC transports. When an interface is -+ * marshalled into another apartment in the same process, a window of the -+ * following class is created. The *caller* of CoMarshalInterface (i.e., the -+ * application) is responsible for pumping the message loop in that thread. -+ * The WM_USER messages which point to the RPCs are then dispatched to -+ * apartment_wndproc by the user's code from the apartment in which the -+ * interface was unmarshalled. -+ */ -+ memset(&wclass, 0, sizeof(wclass)); -+ wclass.lpfnWndProc = apartment_wndproc; -+ wclass.hInstance = hProxyDll; -+ wclass.lpszClassName = wszAptWinClass; -+ RegisterClassW(&wclass); -+} -+ -+static void COMPOBJ_UninitProcess( void ) -+{ -+ UnregisterClassW(wszAptWinClass, hProxyDll); -+} -+ -+#endif -+ - static void COM_TlsDestroy(void) - { - struct oletls *info = NtCurrentTeb()->ReservedForOle; -@@ -4984,12 +4986,13 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, - switch(fdwReason) { - case DLL_PROCESS_ATTACH: - hProxyDll = hinstDLL; -+ COMPOBJ_InitProcess(); - break; - - case DLL_PROCESS_DETACH: - if (reserved) break; - release_std_git(); -- UnregisterClassW( wszAptWinClass, hProxyDll ); -+ COMPOBJ_UninitProcess(); - RPC_UnregisterAllChannelHooks(); - COMPOBJ_DllList_Free(); - DeleteCriticalSection(&csRegisteredClassList); -diff -prudN e:\Wine\dlls\ole32/stg_prop.c e:\reactos\dll\win32\ole32/stg_prop.c ---- e:\Wine\dlls\ole32/stg_prop.c 2014-04-04 14:12:42.103216400 +0100 -+++ e:\reactos\dll\win32\ole32/stg_prop.c 2014-04-08 19:21:32.097336500 +0100 -@@ -36,32 +36,15 @@ - * PropertyStorage_ReadFromStream - */ - --#include "config.h" --#include "wine/port.h" -- --#include <assert.h> --#include <stdarg.h> --#include <stdio.h> --#include <stdlib.h> --#include <string.h> -- --#define COBJMACROS --#define NONAMELESSUNION --#define NONAMELESSSTRUCT -- --#include "windef.h" --#include "winbase.h" --#include "winnls.h" --#include "winuser.h" --#include "wine/unicode.h" --#include "wine/debug.h" --#include "dictionary.h" -+#include "precomp.h" - #include "storage32.h" --#include "enumx.h" --#include "oleauto.h" - - WINE_DEFAULT_DEBUG_CHANNEL(storage); - -+#ifdef _MSC_VER -+#define __ASM_STDCALL_FUNC(name,args,code) -+#endif -+ - static inline StorageImpl *impl_from_IPropertySetStorage( IPropertySetStorage *iface ) - { - return CONTAINING_RECORD(iface, StorageImpl, base.IPropertySetStorage_iface); +diff -prudN e:\wine\dlls\ole32/stg_prop.c dll\win32\ole32/stg_prop.c +--- e:\wine\dlls\ole32/stg_prop.c 2015-02-21 17:13:09.569542200 +0100 ++++ dll\win32\ole32/stg_prop.c 2014-04-08 19:21:32.097336500 +0100 @@ -1035,12 +1018,12 @@ static HRESULT PropertyStorage_ReadDicti } @@ -184,4 +58,3 @@ + void* (__cdecl *fn)(void*,ULONG) = **(void***)this; return fn(this, cbSize); } - Modified: trunk/reactos/dll/win32/ole32/storage32.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/storage32.…
============================================================================== --- trunk/reactos/dll/win32/ole32/storage32.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/ole32/storage32.c [iso-8859-1] Mon Mar 9 19:57:38 2015 @@ -2950,7 +2950,7 @@ hr = S_OK; /* First check for any conflicting locks. */ - if (SUCCEEDED(hr) && (openFlags & STGM_PRIORITY) == STGM_PRIORITY) + if ((openFlags & STGM_PRIORITY) == STGM_PRIORITY) hr = StorageImpl_CheckLockRange(This, RANGELOCK_COMMIT, RANGELOCK_COMMIT, STG_E_LOCKVIOLATION); if (SUCCEEDED(hr) && (STGM_ACCESS_MODE(openFlags) != STGM_WRITE)) @@ -6976,10 +6976,8 @@ This->ownerDirEntry, &chainEntry); - if (SUCCEEDED(hr)) - { + if (SUCCEEDED(hr) && chainEntry.startingBlock < BLOCK_FIRST_SPECIAL) return chainEntry.startingBlock; - } } return BLOCK_END_OF_CHAIN; @@ -7501,11 +7499,8 @@ This->ownerDirEntry, &chainEntry); - if (SUCCEEDED(hr)) - { + if (SUCCEEDED(hr) && chainEntry.startingBlock < BLOCK_FIRST_SPECIAL) return chainEntry.startingBlock; - } - } return BLOCK_END_OF_CHAIN; Modified: trunk/reactos/dll/win32/ole32/storage32.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/storage32.…
============================================================================== --- trunk/reactos/dll/win32/ole32/storage32.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/ole32/storage32.h [iso-8859-1] Mon Mar 9 19:57:38 2015 @@ -69,6 +69,7 @@ static const WORD DEF_SMALL_BLOCK_SIZE_BITS = 0x0006; static const WORD DEF_BIG_BLOCK_SIZE = 0x0200; static const WORD DEF_SMALL_BLOCK_SIZE = 0x0040; +static const ULONG BLOCK_FIRST_SPECIAL = 0xFFFFFFFB; static const ULONG BLOCK_EXTBBDEPOT = 0xFFFFFFFC; static const ULONG BLOCK_SPECIAL = 0xFFFFFFFD; static const ULONG BLOCK_END_OF_CHAIN = 0xFFFFFFFE; Modified: trunk/reactos/dll/win32/ole32/usrmarshal.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/usrmarshal…
============================================================================== --- trunk/reactos/dll/win32/ole32/usrmarshal.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/ole32/usrmarshal.c [iso-8859-1] Mon Mar 9 19:57:38 2015 @@ -1622,7 +1622,7 @@ if(CoMarshalInterface(stm, riid, punk, LOWORD(RealFlags), NULL, MSHLFLAGS_NORMAL) != S_OK) { IStream_Release(stm); - return NULL; + return pBuffer; } ALIGN_POINTER(pBuffer, 3); 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] Mon Mar 9 19:57:38 2015 @@ -151,7 +151,7 @@ reactos/dll/win32/objsel # Synced to Wine-1.7.27 reactos/dll/win32/odbc32 # Synced to Wine-1.7.27. Depends on port of Linux ODBC. reactos/dll/win32/odbccp32 # Synced to Wine-1.7.27 -reactos/dll/win32/ole32 # Synced to Wine-1.7.27 +reactos/dll/win32/ole32 # Synced to WineStaging-1.7.37 reactos/dll/win32/oleacc # Synced to Wine-1.7.27 reactos/dll/win32/oleaut32 # Synced to Wine-1.7.27 reactos/dll/win32/olecli32 # Synced to Wine-1.7.27
9 years, 9 months
1
0
0
0
[akhaldi] 66627: [ADVPACK_WINETEST] Sync with Wine Staging 1.7.37. CORE-9246
by akhaldi@svn.reactos.org
Author: akhaldi Date: Mon Mar 9 19:20:13 2015 New Revision: 66627 URL:
http://svn.reactos.org/svn/reactos?rev=66627&view=rev
Log: [ADVPACK_WINETEST] Sync with Wine Staging 1.7.37. CORE-9246 Modified: trunk/rostests/winetests/advpack/advpack.c Modified: trunk/rostests/winetests/advpack/advpack.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/advpack/advpack…
============================================================================== --- trunk/rostests/winetests/advpack/advpack.c [iso-8859-1] (original) +++ trunk/rostests/winetests/advpack/advpack.c [iso-8859-1] Mon Mar 9 19:20:13 2015 @@ -193,7 +193,6 @@ CloseHandle(hn); hr = pDelNode(lstrcatA(currDir, "\\DelNodeTestDir"), 0); ok (hr == S_OK, "DelNode failed deleting a directory containing multiple files\n"); - currDir[currDirLen] = '\0'; } static void append_str(char **str, const char *data, ...)
9 years, 9 months
1
0
0
0
[akhaldi] 66626: [ADVPACK] Sync with Wine Staging 1.7.37. CORE-9246
by akhaldi@svn.reactos.org
Author: akhaldi Date: Mon Mar 9 19:19:38 2015 New Revision: 66626 URL:
http://svn.reactos.org/svn/reactos?rev=66626&view=rev
Log: [ADVPACK] Sync with Wine Staging 1.7.37. CORE-9246 Modified: trunk/reactos/dll/win32/advpack/advpack.c trunk/reactos/dll/win32/advpack/files.c trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/advpack/advpack.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advpack/advpack.…
============================================================================== --- trunk/reactos/dll/win32/advpack/advpack.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/advpack/advpack.c [iso-8859-1] Mon Mar 9 19:19:38 2015 @@ -665,7 +665,7 @@ dwBufferSize, NULL, NULL); } else - res = HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER); + res = E_NOT_SUFFICIENT_BUFFER; } HeapFree(GetProcessHeap(), 0, bufferW); @@ -725,7 +725,7 @@ pszBuffer, dwBufferSize, pdwRequiredSize)) { if (dwBufferSize < *pdwRequiredSize) - hret = HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER); + hret = E_NOT_SUFFICIENT_BUFFER; else hret = SPAPI_E_LINE_NOT_FOUND; } @@ -782,7 +782,7 @@ dwBufferSize, NULL, NULL); } else - res = HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER); + res = E_NOT_SUFFICIENT_BUFFER; } HeapFree(GetProcessHeap(), 0, bufferW); @@ -840,7 +840,7 @@ pszBuffer, dwBufferSize, pdwRequiredSize)) { if (dwBufferSize < *pdwRequiredSize) - return HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER); + return E_NOT_SUFFICIENT_BUFFER; return SPAPI_E_LINE_NOT_FOUND; } Modified: trunk/reactos/dll/win32/advpack/files.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advpack/files.c?…
============================================================================== --- trunk/reactos/dll/win32/advpack/files.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/advpack/files.c [iso-8859-1] Mon Mar 9 19:19:38 2015 @@ -554,7 +554,7 @@ szConvertedList[dwLen - 1] = '\0'; /* empty list */ - if (!lstrlenA(szConvertedList)) + if (!szConvertedList[0]) { HeapFree(GetProcessHeap(), 0, szConvertedList); return NULL; 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] Mon Mar 9 19:19:38 2015 @@ -51,7 +51,7 @@ reactos/dll/win32/activeds # Synced to Wine-1.7.27 reactos/dll/win32/actxprxy # Synced to Wine-1.7.27 -reactos/dll/win32/advpack # Synced to Wine-1.7.27 +reactos/dll/win32/advpack # Synced to WineStaging-1.7.37 reactos/dll/win32/atl # Synced to Wine-1.7.27 reactos/dll/win32/atl80 # Synced to Wine-1.7.27 reactos/dll/win32/atl100 # Synced to Wine-1.7.27
9 years, 9 months
1
0
0
0
[akhaldi] 66625: * Silence a debug print. Spotted by Aleksey.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Mon Mar 9 19:08:16 2015 New Revision: 66625 URL:
http://svn.reactos.org/svn/reactos?rev=66625&view=rev
Log: * Silence a debug print. Spotted by Aleksey. Modified: trunk/reactos/lib/rtl/actctx.c Modified: trunk/reactos/lib/rtl/actctx.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/actctx.c?rev=66625…
============================================================================== --- trunk/reactos/lib/rtl/actctx.c [iso-8859-1] (original) +++ trunk/reactos/lib/rtl/actctx.c [iso-8859-1] Mon Mar 9 19:08:16 2015 @@ -2975,8 +2975,8 @@ HANDLE file; DWORD len; - DPRINT1( "looking for name=%S version=%u.%u.%u.%u arch=%S\n", - ai->name, ai->version.major, ai->version.minor, ai->version.build, ai->version.revision, ai->arch ); + DPRINT( "looking for name=%S version=%u.%u.%u.%u arch=%S\n", + ai->name, ai->version.major, ai->version.minor, ai->version.build, ai->version.revision, ai->arch ); if ((status = lookup_winsxs(acl, ai)) != STATUS_NO_SUCH_FILE) return status;
9 years, 9 months
1
0
0
0
[cwittich] 66624: [GDI32] fix gdi32 clipping winetest
by cwittich@svn.reactos.org
Author: cwittich Date: Mon Mar 9 19:05:58 2015 New Revision: 66624 URL:
http://svn.reactos.org/svn/reactos?rev=66624&view=rev
Log: [GDI32] fix gdi32 clipping winetest Modified: trunk/reactos/win32ss/gdi/gdi32/objects/region.c Modified: trunk/reactos/win32ss/gdi/gdi32/objects/region.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/gdi32/objects/…
============================================================================== --- trunk/reactos/win32ss/gdi/gdi32/objects/region.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/gdi32/objects/region.c [iso-8859-1] Mon Mar 9 19:05:58 2015 @@ -837,7 +837,7 @@ { /* Last error code differs from what NtGdiGetRandomRgn returns */ SetLastError(ERROR_INVALID_PARAMETER); - return 0; + return -1; } Ret = NtGdiGetRandomRgn(hdc, hrgn, CLIPRGN);
9 years, 9 months
1
0
0
0
← Newer
1
...
35
36
37
38
39
40
41
...
50
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
Results per page:
10
25
50
100
200