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
January 2018
----- 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
37 participants
372 discussions
Start a n
N
ew thread
01/01: [MSI] Sync with Wine 3.0. CORE-14225
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=f8b992f2d31aaea06dd6a…
commit f8b992f2d31aaea06dd6a360ad19165d56c331dc Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Sat Jan 20 12:29:30 2018 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Sat Jan 20 12:29:30 2018 +0100 [MSI] Sync with Wine 3.0. CORE-14225 --- dll/win32/msi/action.c | 392 +++++++++++++------------ dll/win32/msi/appsearch.c | 2 +- dll/win32/msi/cond.tab.c | 712 +++++++++++++++++++++------------------------- dll/win32/msi/cond.y | 301 ++++++++++---------- dll/win32/msi/custom.c | 47 ++- dll/win32/msi/database.c | 184 +++--------- dll/win32/msi/dialog.c | 10 +- dll/win32/msi/install.c | 2 +- dll/win32/msi/msi.c | 6 +- dll/win32/msi/msipriv.h | 40 ++- dll/win32/msi/package.c | 70 ++--- dll/win32/msi/streams.c | 28 +- dll/win32/msi/suminfo.c | 111 -------- media/doc/README.WINE | 2 +- 14 files changed, 792 insertions(+), 1115 deletions(-) diff --git a/dll/win32/msi/action.c b/dll/win32/msi/action.c index 98aaec49f3..c3a36eefac 100644 --- a/dll/win32/msi/action.c +++ b/dll/win32/msi/action.c @@ -139,13 +139,8 @@ static const WCHAR szValidateProductID[] = {'V','a','l','i','d','a','t','e','P','r','o','d','u','c','t','I','D',0}; static const WCHAR szWriteEnvironmentStrings[] = {'W','r','i','t','e','E','n','v','i','r','o','n','m','e','n','t','S','t','r','i','n','g','s',0}; - -struct dummy_thread -{ - HANDLE started; - HANDLE stopped; - HANDLE thread; -}; +static const WCHAR szINSTALL[] = + {'I','N','S','T','A','L','L',0}; static INT ui_actionstart(MSIPACKAGE *package, LPCWSTR action, LPCWSTR description, LPCWSTR template) { @@ -182,7 +177,11 @@ static void ui_actioninfo(MSIPACKAGE *package, LPCWSTR action, BOOL start, template = msi_get_error_message(package->db, start ? MSIERR_INFO_ACTIONSTART : MSIERR_INFO_ACTIONENDED); row = MSI_CreateRecord(2); - if (!row) return; + if (!row) + { + msi_free(template); + return; + } MSI_RecordSetStringW(row, 0, template); MSI_RecordSetStringW(row, 1, action); MSI_RecordSetInteger(row, 2, start ? package->LastActionResult : rc); @@ -493,10 +492,7 @@ static UINT ITERATE_Actions(MSIRECORD *row, LPVOID param) return ERROR_SUCCESS; } - if (needs_ui_sequence(package)) - rc = ACTION_PerformUIAction(package, action, SCRIPT_NONE); - else - rc = ACTION_PerformAction(package, action, SCRIPT_NONE); + rc = ACTION_PerformAction(package, action, SCRIPT_NONE); msi_dialog_check_messages( NULL ); @@ -536,41 +532,26 @@ UINT MSI_Sequence( MSIPACKAGE *package, LPCWSTR table ) return r; } -static UINT ACTION_ProcessExecSequence(MSIPACKAGE *package, BOOL UIran) +static UINT ACTION_ProcessExecSequence(MSIPACKAGE *package) { static const WCHAR query[] = { 'S','E','L','E','C','T',' ','*',' ', 'F','R','O','M',' ', '`','I','n','s','t','a','l','l','E','x','e','c','u','t','e', 'S','e','q','u','e','n','c','e','`',' ', 'W','H','E','R','E',' ', - '`','S','e','q','u','e','n','c','e','`',' ', '>',' ','%','i',' ', + '`','S','e','q','u','e','n','c','e','`',' ', '>',' ','0',' ', 'O','R','D','E','R',' ', 'B','Y',' ','`','S','e','q','u','e','n','c','e','`',0}; - static const WCHAR query_validate[] = { - 'S','E','L','E','C','T',' ','`','S','e','q','u','e','n','c','e','`', - ' ', 'F','R','O','M',' ','`','I','n','s','t','a','l','l', - 'E','x','e','c','u','t','e','S','e','q','u','e','n','c','e','`',' ', - 'W','H','E','R','E',' ','`','A','c','t','i','o','n','`',' ','=', - ' ','\'', 'I','n','s','t','a','l','l','V','a','l','i','d','a','t','e','\'',0}; MSIQUERY *view; - INT seq = 0; UINT rc; - if (package->script->ExecuteSequenceRun) + if (package->ExecuteSequenceRun) { TRACE("Execute Sequence already Run\n"); return ERROR_SUCCESS; } - package->script->ExecuteSequenceRun = TRUE; + package->ExecuteSequenceRun = TRUE; - /* get the sequence number */ - if (UIran) - { - MSIRECORD *row = MSI_QueryGetRecord(package->db, query_validate); - if (!row) return ERROR_FUNCTION_FAILED; - seq = MSI_RecordGetInteger(row,1); - msiobj_release(&row->hdr); - } - rc = MSI_OpenQuery(package->db, &view, query, seq); + rc = MSI_OpenQuery(package->db, &view, query); if (rc == ERROR_SUCCESS) { TRACE("Running the actions\n"); @@ -1541,39 +1522,36 @@ static UINT ACTION_CostInitialize(MSIPACKAGE *package) return ERROR_SUCCESS; } -static UINT execute_script_action( MSIPACKAGE *package, UINT script, UINT index ) -{ - const WCHAR *action = package->script->Actions[script][index]; - ui_actionstart( package, action, NULL, NULL ); - TRACE("executing %s\n", debugstr_w(action)); - return ACTION_PerformAction( package, action, script ); -} - static UINT execute_script( MSIPACKAGE *package, UINT script ) { UINT i, rc = ERROR_SUCCESS; TRACE("executing script %u\n", script); - if (!package->script) - { - ERR("no script!\n"); - return ERROR_FUNCTION_FAILED; - } if (script == SCRIPT_ROLLBACK) { - for (i = package->script->ActionCount[script]; i > 0; i--) + for (i = package->script_actions_count[script]; i > 0; i--) { - rc = execute_script_action( package, script, i - 1 ); - if (rc != ERROR_SUCCESS) break; + rc = ACTION_PerformAction(package, package->script_actions[script][i-1], script); + if (rc != ERROR_SUCCESS) + { + ERR("Execution of script %i halted; action %s returned %u\n", + script, debugstr_w(package->script_actions[script][i-1]), rc); + break; + } } } else { - for (i = 0; i < package->script->ActionCount[script]; i++) + for (i = 0; i < package->script_actions_count[script]; i++) { - rc = execute_script_action( package, script, i ); - if (rc != ERROR_SUCCESS) break; + rc = ACTION_PerformAction(package, package->script_actions[script][i], script); + if (rc != ERROR_SUCCESS) + { + ERR("Execution of script %i halted; action %s returned %u\n", + script, debugstr_w(package->script_actions[script][i]), rc); + break; + } } } msi_free_action_script(package, script); @@ -1743,7 +1721,7 @@ static BOOL process_overrides( MSIPACKAGE *package, int level ) ret |= process_state_property( package, level, szReinstall, INSTALLSTATE_UNKNOWN ); ret |= process_state_property( package, level, szAdvertise, INSTALLSTATE_ADVERTISED ); - if (ret && !package->full_reinstall) + if (ret) msi_set_property( package->db, szPreselected, szOne, -1 ); return ret; @@ -1798,7 +1776,7 @@ UINT MSI_SetFeatureStates(MSIPACKAGE *package) level = msi_get_property_int(package->db, szInstallLevel, 1); - if (!msi_get_property_int( package->db, szPreselected, 0 )) + if (msi_get_property_int( package->db, szPreselected, 0 )) { LIST_FOR_EACH_ENTRY( feature, &package->features, MSIFEATURE, entry ) { @@ -1806,24 +1784,18 @@ UINT MSI_SetFeatureStates(MSIPACKAGE *package) if (feature->ActionRequest == INSTALLSTATE_UNKNOWN) { - if (feature->Attributes & msidbFeatureAttributesFavorSource) - { - feature->Action = INSTALLSTATE_SOURCE; - feature->ActionRequest = INSTALLSTATE_SOURCE; - } - else if (feature->Attributes & msidbFeatureAttributesFavorAdvertise) + if (feature->Installed == INSTALLSTATE_ABSENT) { - feature->Action = INSTALLSTATE_ADVERTISED; - feature->ActionRequest = INSTALLSTATE_ADVERTISED; + feature->Action = INSTALLSTATE_UNKNOWN; + feature->ActionRequest = INSTALLSTATE_UNKNOWN; } else { - feature->Action = INSTALLSTATE_LOCAL; - feature->ActionRequest = INSTALLSTATE_LOCAL; + feature->Action = feature->Installed; + feature->ActionRequest = feature->Installed; } } } - /* disable child features of unselected parent or follow parent */ LIST_FOR_EACH_ENTRY( feature, &package->features, MSIFEATURE, entry ) { if (feature->Feature_Parent) continue; @@ -1831,7 +1803,7 @@ UINT MSI_SetFeatureStates(MSIPACKAGE *package) follow_parent( feature ); } } - else /* preselected */ + else if (!msi_get_property_int( package->db, szInstalled, 0 )) { LIST_FOR_EACH_ENTRY( feature, &package->features, MSIFEATURE, entry ) { @@ -1839,18 +1811,24 @@ UINT MSI_SetFeatureStates(MSIPACKAGE *package) if (feature->ActionRequest == INSTALLSTATE_UNKNOWN) { - if (feature->Installed == INSTALLSTATE_ABSENT) + if (feature->Attributes & msidbFeatureAttributesFavorSource) { - feature->Action = INSTALLSTATE_UNKNOWN; - feature->ActionRequest = INSTALLSTATE_UNKNOWN; + feature->Action = INSTALLSTATE_SOURCE; + feature->ActionRequest = INSTALLSTATE_SOURCE; + } + else if (feature->Attributes & msidbFeatureAttributesFavorAdvertise) + { + feature->Action = INSTALLSTATE_ADVERTISED; + feature->ActionRequest = INSTALLSTATE_ADVERTISED; } else { - feature->Action = feature->Installed; - feature->ActionRequest = feature->Installed; + feature->Action = INSTALLSTATE_LOCAL; + feature->ActionRequest = INSTALLSTATE_LOCAL; } } } + /* disable child features of unselected parent or follow parent */ LIST_FOR_EACH_ENTRY( feature, &package->features, MSIFEATURE, entry ) { if (feature->Feature_Parent) continue; @@ -1906,6 +1884,14 @@ UINT MSI_SetFeatureStates(MSIPACKAGE *package) else component->hasLocalFeature = 1; break; + case INSTALLSTATE_UNKNOWN: + if (feature->Installed == INSTALLSTATE_ADVERTISED) + component->hasAdvertisedFeature = 1; + if (feature->Installed == INSTALLSTATE_SOURCE) + component->hasSourceFeature = 1; + if (feature->Installed == INSTALLSTATE_LOCAL) + component->hasLocalFeature = 1; + break; default: break; } @@ -4318,7 +4304,7 @@ static BOOL msi_check_publish(MSIPACKAGE *package) LIST_FOR_EACH_ENTRY(feature, &package->features, MSIFEATURE, entry) { feature->Action = msi_get_feature_action( package, feature ); - if (feature->Action == INSTALLSTATE_LOCAL) + if (feature->Action == INSTALLSTATE_LOCAL || feature->Action == INSTALLSTATE_SOURCE) return TRUE; } @@ -5361,25 +5347,16 @@ static UINT ACTION_UnpublishProduct(MSIPACKAGE *package) static BOOL is_full_uninstall( MSIPACKAGE *package ) { - WCHAR **features, *remove = msi_dup_property( package->db, szRemove ); MSIFEATURE *feature; - BOOL ret = TRUE; - UINT i; LIST_FOR_EACH_ENTRY( feature, &package->features, MSIFEATURE, entry ) { - if (feature->Action == INSTALLSTATE_LOCAL) ret = FALSE; - } - - features = msi_split_string( remove, ',' ); - for (i = 0; features && features[i]; i++) - { - if (!strcmpW( features[i], szAll )) ret = TRUE; + if (feature->Action != INSTALLSTATE_ABSENT && + (feature->Installed != INSTALLSTATE_ABSENT || feature->Action != INSTALLSTATE_UNKNOWN)) + return FALSE; } - msi_free(features); - msi_free(remove); - return ret; + return TRUE; } static UINT ACTION_InstallFinalize(MSIPACKAGE *package) @@ -5559,16 +5536,154 @@ end: return rc; } +static UINT iterate_properties(MSIRECORD *record, void *param) +{ + static const WCHAR prop_template[] = + {'P','r','o','p','e','r','t','y','(','S',')',':',' ','[','1',']',' ','=',' ','[','2',']',0}; + MSIRECORD *uirow; + + uirow = MSI_CloneRecord(record); + if (!uirow) return ERROR_OUTOFMEMORY; + MSI_RecordSetStringW(uirow, 0, prop_template); + MSI_ProcessMessage(param, INSTALLMESSAGE_INFO|MB_ICONHAND, uirow); + msiobj_release(&uirow->hdr); + + return ERROR_SUCCESS; +} + static UINT ACTION_ExecuteAction(MSIPACKAGE *package) { + static const WCHAR prop_query[] = + {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ','`','_','P','r','o','p','e','r','t','y','`',0}; + WCHAR *productname; + WCHAR *action; + WCHAR *info_template; + MSIQUERY *view; + MSIRECORD *uirow, *uirow_info; UINT rc; - package->script->InWhatSequence |= SEQUENCE_EXEC; - rc = ACTION_ProcessExecSequence(package,FALSE); + /* Send COMMONDATA and INFO messages. */ + /* FIXME: when should these messages be sent? [see also MsiOpenPackage()] */ + uirow = MSI_CreateRecord(3); + if (!uirow) return ERROR_OUTOFMEMORY; + MSI_RecordSetStringW(uirow, 0, NULL); + MSI_RecordSetInteger(uirow, 1, 0); + MSI_RecordSetInteger(uirow, 2, package->num_langids ? package->langids[0] : 0); + MSI_RecordSetInteger(uirow, 3, msi_get_string_table_codepage(package->db->strings)); + MSI_ProcessMessageVerbatim(package, INSTALLMESSAGE_COMMONDATA, uirow); + /* FIXME: send INSTALLMESSAGE_PROGRESS */ + MSI_ProcessMessageVerbatim(package, INSTALLMESSAGE_COMMONDATA, uirow); + + if (!(needs_ui_sequence(package) && ui_sequence_exists(package))) + { + uirow_info = MSI_CreateRecord(0); + if (!uirow_info) + { + msiobj_release(&uirow->hdr); + return ERROR_OUTOFMEMORY; + } + info_template = msi_get_error_message(package->db, MSIERR_INFO_LOGGINGSTART); + MSI_RecordSetStringW(uirow_info, 0, info_template); + msi_free(info_template); + MSI_ProcessMessage(package, INSTALLMESSAGE_INFO|MB_ICONHAND, uirow_info); + msiobj_release(&uirow_info->hdr); + } + + MSI_ProcessMessage(package, INSTALLMESSAGE_COMMONDATA, uirow); + + productname = msi_dup_property(package->db, INSTALLPROPERTY_PRODUCTNAMEW); + MSI_RecordSetInteger(uirow, 1, 1); + MSI_RecordSetStringW(uirow, 2, productname); + MSI_RecordSetStringW(uirow, 3, NULL); + MSI_ProcessMessage(package, INSTALLMESSAGE_COMMONDATA, uirow); + msiobj_release(&uirow->hdr); + + package->LastActionResult = MSI_NULL_INTEGER; + + action = msi_dup_property(package->db, szEXECUTEACTION); + if (!action) action = msi_strdupW(szINSTALL, strlenW(szINSTALL)); + + /* Perform the action. Top-level actions trigger a sequence. */ + if (!strcmpW(action, szINSTALL)) + { + /* Send ACTIONSTART/INFO and INSTALLSTART. */ + ui_actionstart(package, szINSTALL, NULL, NULL); + ui_actioninfo(package, szINSTALL, TRUE, 0); + uirow = MSI_CreateRecord(2); + if (!uirow) + { + rc = ERROR_OUTOFMEMORY; + goto end; + } + MSI_RecordSetStringW(uirow, 0, NULL); + MSI_RecordSetStringW(uirow, 1, productname); + MSI_RecordSetStringW(uirow, 2, package->ProductCode); + MSI_ProcessMessage(package, INSTALLMESSAGE_INSTALLSTART, uirow); + msiobj_release(&uirow->hdr); + + /* Perform the installation. Always use the ExecuteSequence. */ + package->InWhatSequence |= SEQUENCE_EXEC; + rc = ACTION_ProcessExecSequence(package); + + /* Send return value and INSTALLEND. */ + ui_actioninfo(package, szINSTALL, FALSE, !rc); + uirow = MSI_CreateRecord(3); + if (!uirow) + { + rc = ERROR_OUTOFMEMORY; + goto end; + } + MSI_RecordSetStringW(uirow, 0, NULL); + MSI_RecordSetStringW(uirow, 1, productname); + MSI_RecordSetStringW(uirow, 2, package->ProductCode); + MSI_RecordSetInteger(uirow, 3, !rc); + MSI_ProcessMessage(package, INSTALLMESSAGE_INSTALLEND, uirow); + msiobj_release(&uirow->hdr); + } + else + rc = ACTION_PerformAction(package, action, SCRIPT_NONE); + + /* Send all set properties. */ + if (!MSI_OpenQuery(package->db, &view, prop_query)) + { + MSI_IterateRecords(view, NULL, iterate_properties, package); + msiobj_release(&view->hdr); + } + + /* And finally, toggle the cancel off and on. */ + uirow = MSI_CreateRecord(2); + if (!uirow) + { + rc = ERROR_OUTOFMEMORY; + goto end; + } + MSI_RecordSetStringW(uirow, 0, NULL); + MSI_RecordSetInteger(uirow, 1, 2); + MSI_RecordSetInteger(uirow, 2, 0); + MSI_ProcessMessageVerbatim(package, INSTALLMESSAGE_COMMONDATA, uirow); + MSI_RecordSetInteger(uirow, 2, 1); + MSI_ProcessMessageVerbatim(package, INSTALLMESSAGE_COMMONDATA, uirow); + msiobj_release(&uirow->hdr); + +end: + msi_free(productname); + msi_free(action); return rc; } +static UINT ACTION_INSTALL(MSIPACKAGE *package) +{ + msi_set_property(package->db, szEXECUTEACTION, szINSTALL, -1); + if (needs_ui_sequence(package) && ui_sequence_exists(package)) + { + package->InWhatSequence |= SEQUENCE_UI; + return ACTION_ProcessUISequence(package); + } + else + return ACTION_ExecuteAction(package); +} + WCHAR *msi_create_component_advertise_string( MSIPACKAGE *package, MSICOMPONENT *component, const WCHAR *feature ) { static const WCHAR fmt[] = {'%','s','%','s','%','c','%','s',0}; @@ -7720,6 +7835,7 @@ StandardActions[] = { szWriteEnvironmentStrings, IDS_DESC_WRITEENVIRONMENTSTRINGS, IDS_TEMP_WRITEENVIRONMENTSTRINGS, ACTION_WriteEnvironmentStrings, szRemoveEnvironmentStrings }, { szWriteIniValues, IDS_DESC_WRITEINIVALUES, IDS_TEMP_WRITEINIVALUES, ACTION_WriteIniValues, szRemoveIniValues }, { szWriteRegistryValues, IDS_DESC_WRITEREGISTRYVALUES, IDS_TEMP_WRITEREGISTRYVALUES, ACTION_WriteRegistryValues, szRemoveRegistryValues }, + { szINSTALL, 0, 0, ACTION_INSTALL, NULL }, { 0 } }; @@ -7771,23 +7887,6 @@ UINT ACTION_PerformAction(MSIPACKAGE *package, const WCHAR *action, UINT script) TRACE("Performing action (%s)\n", debugstr_w(action)); - rc = ACTION_HandleStandardAction(package, action); - - if (rc == ERROR_FUNCTION_NOT_CALLED) - rc = ACTION_HandleCustomAction(package, action, script); - - if (rc == ERROR_FUNCTION_NOT_CALLED) - WARN("unhandled msi action %s\n", debugstr_w(action)); - - return rc; -} - -UINT ACTION_PerformUIAction(MSIPACKAGE *package, const WCHAR *action, UINT script) -{ - UINT rc; - - TRACE("Performing action (%s)\n", debugstr_w(action)); - package->action_progress_increment = 0; rc = ACTION_HandleStandardAction(package, action); @@ -7845,10 +7944,7 @@ static UINT ACTION_PerformActionSequence(MSIPACKAGE *package, UINT seq) return ERROR_FUNCTION_FAILED; } - if (needs_ui_sequence(package)) - rc = ACTION_PerformUIAction(package, action, SCRIPT_NONE); - else - rc = ACTION_PerformAction(package, action, SCRIPT_NONE); + rc = ACTION_PerformAction(package, action, SCRIPT_NONE); msiobj_release(&row->hdr); } @@ -7856,42 +7952,6 @@ static UINT ACTION_PerformActionSequence(MSIPACKAGE *package, UINT seq) return rc; } -DWORD WINAPI dummy_thread_proc(void *arg) -{ - struct dummy_thread *info = arg; - HRESULT hr; - - hr = CoInitializeEx(0, COINIT_MULTITHREADED); - if (FAILED(hr)) ERR("CoInitializeEx failed %08x\n", hr); - - SetEvent(info->started); - WaitForSingleObject(info->stopped, INFINITE); - - CoUninitialize(); - return 0; -} - -static void start_dummy_thread(struct dummy_thread *info) -{ - if (!(info->started = CreateEventA(NULL, TRUE, FALSE, NULL))) return; - if (!(info->stopped = CreateEventA(NULL, TRUE, FALSE, NULL))) return; - if (!(info->thread = CreateThread(NULL, 0, dummy_thread_proc, info, 0, NULL))) return; - - WaitForSingleObject(info->started, INFINITE); -} - -static void stop_dummy_thread(struct dummy_thread *info) -{ - if (info->thread) - { - SetEvent(info->stopped); - WaitForSingleObject(info->thread, INFINITE); - CloseHandle(info->thread); - } - if (info->started) CloseHandle(info->started); - if (info->stopped) CloseHandle(info->stopped); -} - /**************************************************** * TOP level entry points *****************************************************/ @@ -7901,15 +7961,9 @@ UINT MSI_InstallPackage( MSIPACKAGE *package, LPCWSTR szPackagePath, { static const WCHAR szDisableRollback[] = {'D','I','S','A','B','L','E','R','O','L','L','B','A','C','K',0}; static const WCHAR szAction[] = {'A','C','T','I','O','N',0}; - static const WCHAR szInstall[] = {'I','N','S','T','A','L','L',0}; - WCHAR *reinstall, *remove, *patch, *productcode; - struct dummy_thread thread_info = {NULL, NULL, NULL}; - BOOL ui_exists; + WCHAR *reinstall = NULL, *productcode, *action; UINT rc; - - msi_set_property( package->db, szAction, szInstall, -1 ); - - package->script->InWhatSequence = SEQUENCE_INSTALL; + DWORD len = 0; if (szPackagePath) { @@ -7954,23 +8008,16 @@ UINT MSI_InstallPackage( MSIPACKAGE *package, LPCWSTR szPackagePath, msi_apply_transforms( package ); msi_apply_patches( package ); - patch = msi_dup_property( package->db, szPatch ); - remove = msi_dup_property( package->db, szRemove ); - reinstall = msi_dup_property( package->db, szReinstall ); - if (msi_get_property_int( package->db, szInstalled, 0 ) && !remove && !reinstall && !patch) - { - TRACE("setting REINSTALL property to ALL\n"); - msi_set_property( package->db, szReinstall, szAll, -1 ); - package->full_reinstall = 1; - } + if (msi_get_property( package->db, szAction, NULL, &len )) + msi_set_property( package->db, szAction, szINSTALL, -1 ); + action = msi_dup_property( package->db, szAction ); + CharUpperW(action); msi_set_original_database_property( package->db, szPackagePath ); msi_parse_command_line( package, szCommandLine, FALSE ); msi_adjust_privilege_properties( package ); msi_set_context( package ); - start_dummy_thread(&thread_info); - productcode = msi_dup_property( package->db, szProductCode ); if (strcmpiW( productcode, package->ProductCode )) { @@ -7986,19 +8033,7 @@ UINT MSI_InstallPackage( MSIPACKAGE *package, LPCWSTR szPackagePath, msi_set_property( package->db, szRollbackDisabled, szOne, -1 ); } - if (needs_ui_sequence( package)) - { - package->script->InWhatSequence |= SEQUENCE_UI; - rc = ACTION_ProcessUISequence(package); - ui_exists = ui_sequence_exists(package); - if (rc == ERROR_SUCCESS || !ui_exists) - { - package->script->InWhatSequence |= SEQUENCE_EXEC; - rc = ACTION_ProcessExecSequence(package, ui_exists); - } - } - else - rc = ACTION_ProcessExecSequence(package, FALSE); + rc = ACTION_PerformAction(package, action, SCRIPT_NONE); /* process the ending type action */ if (rc == ERROR_SUCCESS) @@ -8019,16 +8054,13 @@ UINT MSI_InstallPackage( MSIPACKAGE *package, LPCWSTR szPackagePath, /* finish up running custom actions */ ACTION_FinishCustomActions(package); - stop_dummy_thread(&thread_info); - - if (package->need_rollback && !reinstall) + if (package->need_rollback && !(reinstall = msi_dup_property( package->db, szReinstall ))) { WARN("installation failed, running rollback script\n"); execute_script( package, SCRIPT_ROLLBACK ); } msi_free( reinstall ); - msi_free( remove ); - msi_free( patch ); + msi_free( action ); if (rc == ERROR_SUCCESS && package->need_reboot_at_end) return ERROR_SUCCESS_REBOOT_REQUIRED; diff --git a/dll/win32/msi/appsearch.c b/dll/win32/msi/appsearch.c index e27fa74540..8f2df294b4 100644 --- a/dll/win32/msi/appsearch.c +++ b/dll/win32/msi/appsearch.c @@ -493,7 +493,7 @@ static LPWSTR get_ini_field(LPWSTR buf, int field) while ((end = strchrW(beg, ',')) && i < field) { beg = end + 1; - while (*beg && *beg == ' ') + while (*beg == ' ') beg++; i++; diff --git a/dll/win32/msi/cond.tab.c b/dll/win32/msi/cond.tab.c index 61ca113369..122f92a153 100644 --- a/dll/win32/msi/cond.tab.c +++ b/dll/win32/msi/cond.tab.c @@ -1,4 +1,4 @@ -/* A Bison parser, made by GNU Bison 3.0.2. */ +/* A Bison parser, made by GNU Bison 3.0. */ /* Bison implementation for Yacc-like parsers in C @@ -44,7 +44,7 @@ #define YYBISON 1 /* Bison version. */ -#define YYBISON_VERSION "3.0.2" +#define YYBISON_VERSION "3.0" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -109,6 +109,18 @@ struct cond_str { INT len; }; +struct value { + enum value_type { + VALUE_INTEGER, + VALUE_LITERAL, + VALUE_SYMBOL + } type; + union { + INT integer; + WCHAR *string; + } u; +}; + static LPWSTR COND_GetString( COND_input *info, const struct cond_str *str ); static LPWSTR COND_GetLiteral( COND_input *info, const struct cond_str *str ); static int cond_lex( void *COND_lval, COND_input *info); @@ -121,16 +133,6 @@ static void cond_free( void *ptr ); static INT compare_int( INT a, INT operator, INT b ); static INT compare_string( LPCWSTR a, INT operator, LPCWSTR b, BOOL convert ); -static INT compare_and_free_strings( LPWSTR a, INT op, LPWSTR b, BOOL convert ) -{ - INT r; - - r = compare_string( a, op, b, convert ); - cond_free( a ); - cond_free( b ); - return r; -} - static BOOL num_from_prop( LPCWSTR p, INT *val ) { INT ret = 0, sign = 1; @@ -155,14 +157,20 @@ static BOOL num_from_prop( LPCWSTR p, INT *val ) return TRUE; } +static void value_free( struct value val ) +{ + if (val.type != VALUE_INTEGER) + cond_free( val.u.string ); +} + -#line 180 "cond.tab.c" /* yacc.c:339 */ +#line 168 "cond.tab.c" /* yacc.c:339 */ -# ifndef YY_NULLPTR +# ifndef YY_NULL # if defined __cplusplus && 201103L <= __cplusplus -# define YY_NULLPTR nullptr +# define YY_NULL nullptr # else -# define YY_NULLPTR 0 +# define YY_NULL 0 # endif # endif @@ -174,7 +182,10 @@ static BOOL num_from_prop( LPCWSTR p, INT *val ) # define YYERROR_VERBOSE 0 #endif - +/* In a future release of Bison, this section will be replaced + by #include "cond.tab.h". */ +#ifndef YY_COND_E_REACTOSSYNC3_0_GCC_DLL_WIN32_MSI_COND_TAB_H_INCLUDED +# define YY_COND_E_REACTOSSYNC3_0_GCC_DLL_WIN32_MSI_COND_TAB_H_INCLUDED /* Debug traces. */ #ifndef YYDEBUG # define YYDEBUG 0 @@ -234,13 +245,15 @@ extern int cond_debug; typedef union YYSTYPE YYSTYPE; union YYSTYPE { -#line 114 "cond.y" /* yacc.c:355 */ +#line 102 "cond.y" /* yacc.c:355 */ struct cond_str str; - LPWSTR string; - INT value; + struct value value; + LPWSTR identifier; + INT operator; + BOOL bool; -#line 264 "cond.tab.c" /* yacc.c:355 */ +#line 257 "cond.tab.c" /* yacc.c:355 */ }; # define YYSTYPE_IS_TRIVIAL 1 # define YYSTYPE_IS_DECLARED 1 @@ -250,11 +263,11 @@ union YYSTYPE int cond_parse (COND_input *info); - +#endif /* !YY_COND_E_REACTOSSYNC3_0_GCC_DLL_WIN32_MSI_COND_TAB_H_INCLUDED */ /* Copy the second part of user declarations. */ -#line 278 "cond.tab.c" /* yacc.c:358 */ +#line 271 "cond.tab.c" /* yacc.c:358 */ #ifdef short # undef short @@ -311,30 +324,11 @@ typedef short int yytype_int16; # endif #endif -#ifndef YY_ATTRIBUTE -# if (defined __GNUC__ \ - && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \ - || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C -# define YY_ATTRIBUTE(Spec) __attribute__(Spec) -# else -# define YY_ATTRIBUTE(Spec) /* empty */ -# endif -#endif - -#ifndef YY_ATTRIBUTE_PURE -# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__)) -#endif - -#ifndef YY_ATTRIBUTE_UNUSED -# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) -#endif - -#if !defined _Noreturn \ - && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112) -# if defined _MSC_VER && 1200 <= _MSC_VER -# define _Noreturn __declspec (noreturn) -# else -# define _Noreturn YY_ATTRIBUTE ((__noreturn__)) +#ifndef __attribute__ +/* This feature is available in gcc versions 2.5 and later. */ +# if (! defined __GNUC__ || __GNUC__ < 2 \ + || (__GNUC__ == 2 && __GNUC_MINOR__ < 5)) +# define __attribute__(Spec) /* empty */ # endif #endif @@ -494,18 +488,18 @@ union yyalloc #endif /* !YYCOPY_NEEDED */ /* YYFINAL -- State number of the termination state. */ -#define YYFINAL 28 +#define YYFINAL 24 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 71 +#define YYLAST 67 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 41 /* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 12 +#define YYNNTS 8 /* YYNRULES -- Number of rules. */ -#define YYNRULES 53 +#define YYNRULES 41 /* YYNSTATES -- Number of states. */ -#define YYNSTATES 70 +#define YYNSTATES 56 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned by yylex, with out-of-bounds checking. */ @@ -555,12 +549,11 @@ static const yytype_uint8 yytranslate[] = /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 138, 138, 144, 151, 155, 159, 163, 167, 174, - 178, 185, 189, 193, 198, 202, 211, 220, 224, 228, - 232, 236, 241, 246, 254, 255, 256, 257, 258, 259, - 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, - 270, 271, 275, 279, 286, 296, 300, 309, 318, 331, - 343, 356, 373, 383 + 0, 129, 129, 135, 142, 146, 150, 154, 158, 165, + 169, 176, 180, 188, 223, 231, 232, 233, 234, 235, + 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, + 246, 247, 248, 252, 266, 281, 289, 299, 316, 333, + 350, 370 }; #endif @@ -577,8 +570,8 @@ static const char *const yytname[] = "COND_IRHS", "COND_LHS", "COND_RHS", "COND_PERCENT", "COND_DOLLARS", "COND_QUESTION", "COND_AMPER", "COND_EXCLAM", "COND_IDENT", "COND_NUMBER", "COND_LITER", "COND_ERROR", "$accept", "condition", - "expression", "boolean_term", "boolean_factor", "operator", "value_s", - "literal", "value_i", "symbol_s", "identifier", "integer", YY_NULLPTR + "expression", "boolean_term", "boolean_factor", "operator", "value", + "identifier", YY_NULL }; #endif @@ -595,10 +588,10 @@ static const yytype_uint16 yytoknum[] = }; # endif -#define YYPACT_NINF -15 +#define YYPACT_NINF -45 #define yypact_value_is_default(Yystate) \ - (!!((Yystate) == (-15))) + (!!((Yystate) == (-45))) #define YYTABLE_NINF -1 @@ -609,13 +602,12 @@ static const yytype_uint16 yytoknum[] = STATE-NUM. */ static const yytype_int8 yypact[] = { - -7, -7, -7, -14, -14, -14, -14, -14, -15, -15, - -15, 24, 46, 30, -15, -15, -9, -9, -9, -15, - -15, -15, 29, -15, -15, -15, -15, -15, -15, -7, - -7, -7, -7, -7, -15, -15, -15, -15, -15, -15, - -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, - -15, -15, 8, 8, 8, -15, 30, 30, 30, 30, - -15, -15, -15, -15, -15, -15, -15, -15, -15, -15 + -7, -7, -7, -36, -36, -36, -36, -36, -45, -45, + -45, 2, 5, 3, -45, 23, -45, -45, -2, -45, + -45, -45, -45, -45, -45, -7, -7, -7, -7, -7, + -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, + -45, -45, -45, -45, -45, -45, -45, -45, 24, -45, + 3, 3, 3, 3, -45, -45 }; /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. @@ -623,27 +615,24 @@ static const yytype_int8 yypact[] = means the default is an error. */ static const yytype_uint8 yydefact[] = { - 3, 0, 0, 0, 0, 0, 0, 0, 52, 53, - 44, 0, 2, 4, 9, 13, 43, 12, 42, 50, - 45, 11, 0, 51, 46, 47, 48, 49, 1, 0, - 0, 0, 0, 0, 26, 27, 24, 25, 29, 28, - 33, 34, 31, 32, 36, 35, 30, 37, 40, 41, - 38, 39, 0, 0, 0, 23, 5, 7, 6, 8, - 10, 20, 21, 19, 22, 14, 16, 18, 15, 17 + 3, 0, 0, 0, 0, 0, 0, 0, 41, 36, + 35, 0, 2, 4, 9, 12, 33, 11, 0, 34, + 37, 38, 39, 40, 1, 0, 0, 0, 0, 0, + 17, 18, 15, 16, 20, 19, 24, 25, 22, 23, + 27, 26, 21, 28, 31, 32, 29, 30, 0, 14, + 5, 7, 6, 8, 10, 13 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int8 yypgoto[] = { - -15, -15, 50, 33, 0, -3, -15, -4, 14, 17, - 54, -15 + -45, -45, 9, 39, 4, -45, -44, 14 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int8 yydefgoto[] = { - -1, 11, 12, 13, 14, 52, 15, 16, 17, 18, - 19, 20 + -1, 11, 12, 13, 14, 48, 15, 16 }; /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If @@ -651,26 +640,24 @@ static const yytype_int8 yydefgoto[] = number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_uint8 yytable[] = { - 1, 21, 34, 35, 36, 37, 38, 39, 40, 41, - 42, 43, 44, 45, 53, 54, 2, 46, 47, 48, - 49, 50, 51, 8, 28, 3, 4, 5, 6, 7, - 8, 9, 10, 60, 29, 0, 33, 30, 31, 32, - 3, 4, 5, 6, 7, 8, 9, 10, 61, 64, - 67, 29, 22, 55, 30, 31, 32, 23, 24, 25, - 26, 27, 56, 57, 58, 59, 62, 65, 68, 63, - 66, 69 + 1, 8, 24, 25, 55, 17, 26, 27, 28, 29, + 25, 18, 0, 26, 27, 28, 2, 19, 20, 21, + 22, 23, 49, 0, 0, 3, 4, 5, 6, 7, + 8, 9, 10, 54, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 0, 0, 0, 42, + 43, 44, 45, 46, 47, 0, 3, 4, 5, 6, + 7, 8, 9, 10, 50, 51, 52, 53 }; static const yytype_int8 yycheck[] = { - 7, 1, 11, 12, 13, 14, 15, 16, 17, 18, - 19, 20, 21, 22, 17, 18, 23, 26, 27, 28, - 29, 30, 31, 37, 0, 32, 33, 34, 35, 36, - 37, 38, 39, 33, 5, -1, 6, 8, 9, 10, - 32, 33, 34, 35, 36, 37, 38, 39, 52, 53, - 54, 5, 2, 24, 8, 9, 10, 3, 4, 5, - 6, 7, 29, 30, 31, 32, 52, 53, 54, 52, - 53, 54 + 7, 37, 0, 5, 48, 1, 8, 9, 10, 6, + 5, 2, -1, 8, 9, 10, 23, 3, 4, 5, + 6, 7, 24, -1, -1, 32, 33, 34, 35, 36, + 37, 38, 39, 29, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 20, 21, 22, -1, -1, -1, 26, + 27, 28, 29, 30, 31, -1, 32, 33, 34, 35, + 36, 37, 38, 39, 25, 26, 27, 28 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing @@ -678,34 +665,31 @@ static const yytype_int8 yycheck[] = static const yytype_uint8 yystos[] = { 0, 7, 23, 32, 33, 34, 35, 36, 37, 38, - 39, 42, 43, 44, 45, 47, 48, 49, 50, 51, - 52, 45, 43, 51, 51, 51, 51, 51, 0, 5, - 8, 9, 10, 6, 11, 12, 13, 14, 15, 16, - 17, 18, 19, 20, 21, 22, 26, 27, 28, 29, - 30, 31, 46, 46, 46, 24, 44, 44, 44, 44, - 45, 48, 49, 50, 48, 49, 50, 48, 49, 50 + 39, 42, 43, 44, 45, 47, 48, 45, 43, 48, + 48, 48, 48, 48, 0, 5, 8, 9, 10, 6, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, + 21, 22, 26, 27, 28, 29, 30, 31, 46, 24, + 44, 44, 44, 44, 45, 47 }; /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const yytype_uint8 yyr1[] = { 0, 41, 42, 42, 43, 43, 43, 43, 43, 44, - 44, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 46, 46, 46, 46, 46, 46, + 44, 45, 45, 45, 45, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 47, 47, 48, 49, 49, 49, 49, 49, - 50, 50, 51, 52 + 46, 46, 46, 47, 47, 47, 47, 47, 47, 47, + 47, 48 }; /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ static const yytype_uint8 yyr2[] = { 0, 2, 1, 0, 1, 3, 3, 3, 3, 1, - 3, 2, 1, 1, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 1, 1, 1, 1, 1, 1, + 3, 2, 1, 3, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, - 1, 2, 1, 1 + 1, 1, 1, 1, 2, 1, 1, 2, 2, 2, + 2, 1 }; @@ -990,11 +974,11 @@ static int yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, yytype_int16 *yyssp, int yytoken) { - YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]); + YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]); YYSIZE_T yysize = yysize0; enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; /* Internationalized format string. */ - const char *yyformat = YY_NULLPTR; + const char *yyformat = YY_NULL; /* Arguments of yyformat. */ char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; /* Number of reported tokens (one for the "unexpected", one per @@ -1051,7 +1035,7 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, } yyarg[yycount++] = yytname[yyx]; { - YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]); + YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]); if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) return 2; @@ -1388,456 +1372,414 @@ yyreduce: switch (yyn) { case 2: -#line 139 "cond.y" /* yacc.c:1646 */ +#line 130 "cond.y" /* yacc.c:1646 */ { COND_input* cond = (COND_input*) info; - cond->result = (yyvsp[0].value); + cond->result = (yyvsp[0].bool); } -#line 1417 "cond.tab.c" /* yacc.c:1646 */ +#line 1381 "E:/reactosSync3.0_gcc/dll/win32/msi/cond.tab.c" /* yacc.c:1646 */ break; case 3: -#line 144 "cond.y" /* yacc.c:1646 */ +#line 135 "cond.y" /* yacc.c:1646 */ { COND_input* cond = (COND_input*) info; cond->result = MSICONDITION_NONE; } -#line 1426 "cond.tab.c" /* yacc.c:1646 */ +#line 1390 "E:/reactosSync3.0_gcc/dll/win32/msi/cond.tab.c" /* yacc.c:1646 */ break; case 4: -#line 152 "cond.y" /* yacc.c:1646 */ +#line 143 "cond.y" /* yacc.c:1646 */ { - (yyval.value) = (yyvsp[0].value); + (yyval.bool) = (yyvsp[0].bool); } -#line 1434 "cond.tab.c" /* yacc.c:1646 */ +#line 1398 "E:/reactosSync3.0_gcc/dll/win32/msi/cond.tab.c" /* yacc.c:1646 */ break; case 5: -#line 156 "cond.y" /* yacc.c:1646 */ +#line 147 "cond.y" /* yacc.c:1646 */ { - (yyval.value) = (yyvsp[-2].value) || (yyvsp[0].value); + (yyval.bool) = (yyvsp[-2].bool) || (yyvsp[0].bool); } -#line 1442 "cond.tab.c" /* yacc.c:1646 */ +#line 1406 "E:/reactosSync3.0_gcc/dll/win32/msi/cond.tab.c" /* yacc.c:1646 */ break; case 6: -#line 160 "cond.y" /* yacc.c:1646 */ +#line 151 "cond.y" /* yacc.c:1646 */ { - (yyval.value) = !(yyvsp[-2].value) || (yyvsp[0].value); + (yyval.bool) = !(yyvsp[-2].bool) || (yyvsp[0].bool); } -#line 1450 "cond.tab.c" /* yacc.c:1646 */ +#line 1414 "E:/reactosSync3.0_gcc/dll/win32/msi/cond.tab.c" /* yacc.c:1646 */ break; case 7: -#line 164 "cond.y" /* yacc.c:1646 */ +#line 155 "cond.y" /* yacc.c:1646 */ { - (yyval.value) = ( (yyvsp[-2].value) || (yyvsp[0].value) ) && !( (yyvsp[-2].value) && (yyvsp[0].value) ); + (yyval.bool) = ( (yyvsp[-2].bool) || (yyvsp[0].bool) ) && !( (yyvsp[-2].bool) && (yyvsp[0].bool) ); } -#line 1458 "cond.tab.c" /* yacc.c:1646 */ +#line 1422 "E:/reactosSync3.0_gcc/dll/win32/msi/cond.tab.c" /* yacc.c:1646 */ break; case 8: -#line 168 "cond.y" /* yacc.c:1646 */ +#line 159 "cond.y" /* yacc.c:1646 */ { - (yyval.value) = ( (yyvsp[-2].value) && (yyvsp[0].value) ) || ( !(yyvsp[-2].value) && !(yyvsp[0].value) ); + (yyval.bool) = ( (yyvsp[-2].bool) && (yyvsp[0].bool) ) || ( !(yyvsp[-2].bool) && !(yyvsp[0].bool) ); } -#line 1466 "cond.tab.c" /* yacc.c:1646 */ +#line 1430 "E:/reactosSync3.0_gcc/dll/win32/msi/cond.tab.c" /* yacc.c:1646 */ break; case 9: -#line 175 "cond.y" /* yacc.c:1646 */ +#line 166 "cond.y" /* yacc.c:1646 */ { - (yyval.value) = (yyvsp[0].value); + (yyval.bool) = (yyvsp[0].bool); } -#line 1474 "cond.tab.c" /* yacc.c:1646 */ +#line 1438 "E:/reactosSync3.0_gcc/dll/win32/msi/cond.tab.c" /* yacc.c:1646 */ break; case 10: -#line 179 "cond.y" /* yacc.c:1646 */ +#line 170 "cond.y" /* yacc.c:1646 */ { - (yyval.value) = (yyvsp[-2].value) && (yyvsp[0].value); + (yyval.bool) = (yyvsp[-2].bool) && (yyvsp[0].bool); } -#line 1482 "cond.tab.c" /* yacc.c:1646 */ +#line 1446 "E:/reactosSync3.0_gcc/dll/win32/msi/cond.tab.c" /* yacc.c:1646 */ break; case 11: -#line 186 "cond.y" /* yacc.c:1646 */ +#line 177 "cond.y" /* yacc.c:1646 */ { - (yyval.value) = (yyvsp[0].value) ? 0 : 1; + (yyval.bool) = !(yyvsp[0].bool); } -#line 1490 "cond.tab.c" /* yacc.c:1646 */ +#line 1454 "E:/reactosSync3.0_gcc/dll/win32/msi/cond.tab.c" /* yacc.c:1646 */ break; case 12: -#line 190 "cond.y" /* yacc.c:1646 */ +#line 181 "cond.y" /* yacc.c:1646 */ { - (yyval.value) = (yyvsp[0].value) ? 1 : 0; + if ((yyvsp[0].value).type == VALUE_INTEGER) + (yyval.bool) = (yyvsp[0].value).u.integer ? 1 : 0; + else + (yyval.bool) = (yyvsp[0].value).u.string && (yyvsp[0].value).u.string[0]; + value_free( (yyvsp[0].value) ); } -#line 1498 "cond.tab.c" /* yacc.c:1646 */ +#line 1466 "E:/reactosSync3.0_gcc/dll/win32/msi/cond.tab.c" /* yacc.c:1646 */ break; case 13: -#line 194 "cond.y" /* yacc.c:1646 */ +#line 189 "cond.y" /* yacc.c:1646 */ { - (yyval.value) = ((yyvsp[0].string) && (yyvsp[0].string)[0]) ? 1 : 0; - cond_free( (yyvsp[0].string) ); + if ((yyvsp[-2].value).type == VALUE_INTEGER && (yyvsp[0].value).type == VALUE_INTEGER) + { + (yyval.bool) = compare_int((yyvsp[-2].value).u.integer, (yyvsp[-1].operator), (yyvsp[0].value).u.integer); + } + else if ((yyvsp[-2].value).type != VALUE_INTEGER && (yyvsp[0].value).type != VALUE_INTEGER) + { + (yyval.bool) = compare_string((yyvsp[-2].value).u.string, (yyvsp[-1].operator), (yyvsp[0].value).u.string, + (yyvsp[-2].value).type == VALUE_SYMBOL || (yyvsp[0].value).type == VALUE_SYMBOL); + } + else if ((yyvsp[-2].value).type == VALUE_LITERAL || (yyvsp[0].value).type == VALUE_LITERAL) + { + (yyval.bool) = FALSE; + } + else if ((yyvsp[-2].value).type == VALUE_SYMBOL) /* symbol operator integer */ + { + int num; + if (num_from_prop( (yyvsp[-2].value).u.string, &num )) + (yyval.bool) = compare_int( num, (yyvsp[-1].operator), (yyvsp[0].value).u.integer ); + else + (yyval.bool) = ((yyvsp[-1].operator) == COND_NE || (yyvsp[-1].operator) == COND_INE ); + } + else /* integer operator symbol */ + { + int num; + if (num_from_prop( (yyvsp[0].value).u.string, &num )) + (yyval.bool) = compare_int( (yyvsp[-2].value).u.integer, (yyvsp[-1].operator), num ); + else + (yyval.bool) = ((yyvsp[-1].operator) == COND_NE || (yyvsp[-1].operator) == COND_INE ); + } + + value_free( (yyvsp[-2].value) ); + value_free( (yyvsp[0].value) ); } -#line 1507 "cond.tab.c" /* yacc.c:1646 */ +#line 1505 "E:/reactosSync3.0_gcc/dll/win32/msi/cond.tab.c" /* yacc.c:1646 */ break; case 14: -#line 199 "cond.y" /* yacc.c:1646 */ +#line 224 "cond.y" /* yacc.c:1646 */ { - (yyval.value) = compare_int( (yyvsp[-2].value), (yyvsp[-1].value), (yyvsp[0].value) ); + (yyval.bool) = (yyvsp[-1].bool); } -#line 1515 "cond.tab.c" /* yacc.c:1646 */ +#line 1513 "E:/reactosSync3.0_gcc/dll/win32/msi/cond.tab.c" /* yacc.c:1646 */ break; case 15: -#line 203 "cond.y" /* yacc.c:1646 */ - { - int num; - if (num_from_prop( (yyvsp[-2].string), &num )) - (yyval.value) = compare_int( num, (yyvsp[-1].value), (yyvsp[0].value) ); - else - (yyval.value) = ((yyvsp[-1].value) == COND_NE || (yyvsp[-1].value) == COND_INE ); - cond_free( (yyvsp[-2].string) ); - } -#line 1528 "cond.tab.c" /* yacc.c:1646 */ +#line 231 "cond.y" /* yacc.c:1646 */ + { (yyval.operator) = COND_EQ; } +#line 1519 "E:/reactosSync3.0_gcc/dll/win32/msi/cond.tab.c" /* yacc.c:1646 */ break; case 16: -#line 212 "cond.y" /* yacc.c:1646 */ - { - int num; - if (num_from_prop( (yyvsp[0].string), &num )) - (yyval.value) = compare_int( (yyvsp[-2].value), (yyvsp[-1].value), num ); - else - (yyval.value) = ((yyvsp[-1].value) == COND_NE || (yyvsp[-1].value) == COND_INE ); - cond_free( (yyvsp[0].string) ); - } -#line 1541 "cond.tab.c" /* yacc.c:1646 */ +#line 232 "cond.y" /* yacc.c:1646 */ + { (yyval.operator) = COND_NE; } +#line 1525 "E:/reactosSync3.0_gcc/dll/win32/msi/cond.tab.c" /* yacc.c:1646 */ break; case 17: -#line 221 "cond.y" /* yacc.c:1646 */ - { - (yyval.value) = compare_and_free_strings( (yyvsp[-2].string), (yyvsp[-1].value), (yyvsp[0].string), TRUE ); - } -#line 1549 "cond.tab.c" /* yacc.c:1646 */ +#line 233 "cond.y" /* yacc.c:1646 */ + { (yyval.operator) = COND_LT; } +#line 1531 "E:/reactosSync3.0_gcc/dll/win32/msi/cond.tab.c" /* yacc.c:1646 */ break; case 18: -#line 225 "cond.y" /* yacc.c:1646 */ - { - (yyval.value) = compare_and_free_strings( (yyvsp[-2].string), (yyvsp[-1].value), (yyvsp[0].string), TRUE ); - } -#line 1557 "cond.tab.c" /* yacc.c:1646 */ +#line 234 "cond.y" /* yacc.c:1646 */ + { (yyval.operator) = COND_GT; } +#line 1537 "E:/reactosSync3.0_gcc/dll/win32/msi/cond.tab.c" /* yacc.c:1646 */ break; case 19: -#line 229 "cond.y" /* yacc.c:1646 */ - { - (yyval.value) = compare_and_free_strings( (yyvsp[-2].string), (yyvsp[-1].value), (yyvsp[0].string), TRUE ); - } -#line 1565 "cond.tab.c" /* yacc.c:1646 */ +#line 235 "cond.y" /* yacc.c:1646 */ + { (yyval.operator) = COND_LE; } +#line 1543 "E:/reactosSync3.0_gcc/dll/win32/msi/cond.tab.c" /* yacc.c:1646 */ break; case 20: -#line 233 "cond.y" /* yacc.c:1646 */ - { - (yyval.value) = compare_and_free_strings( (yyvsp[-2].string), (yyvsp[-1].value), (yyvsp[0].string), FALSE ); - } -#line 1573 "cond.tab.c" /* yacc.c:1646 */ +#line 236 "cond.y" /* yacc.c:1646 */ + { (yyval.operator) = COND_GE; } +#line 1549 "E:/reactosSync3.0_gcc/dll/win32/msi/cond.tab.c" /* yacc.c:1646 */ break; case 21: #line 237 "cond.y" /* yacc.c:1646 */ - { - (yyval.value) = 0; - cond_free( (yyvsp[-2].string) ); - } -#line 1582 "cond.tab.c" /* yacc.c:1646 */ + { (yyval.operator) = COND_SS; } +#line 1555 "E:/reactosSync3.0_gcc/dll/win32/msi/cond.tab.c" /* yacc.c:1646 */ break; case 22: -#line 242 "cond.y" /* yacc.c:1646 */ - { - (yyval.value) = 0; - cond_free( (yyvsp[0].string) ); - } -#line 1591 "cond.tab.c" /* yacc.c:1646 */ +#line 238 "cond.y" /* yacc.c:1646 */ + { (yyval.operator) = COND_IEQ; } +#line 1561 "E:/reactosSync3.0_gcc/dll/win32/msi/cond.tab.c" /* yacc.c:1646 */ break; case 23: -#line 247 "cond.y" /* yacc.c:1646 */ - { - (yyval.value) = (yyvsp[-1].value); - } -#line 1599 "cond.tab.c" /* yacc.c:1646 */ +#line 239 "cond.y" /* yacc.c:1646 */ + { (yyval.operator) = COND_INE; } +#line 1567 "E:/reactosSync3.0_gcc/dll/win32/msi/cond.tab.c" /* yacc.c:1646 */ break; case 24: -#line 254 "cond.y" /* yacc.c:1646 */ - { (yyval.value) = COND_EQ; } -#line 1605 "cond.tab.c" /* yacc.c:1646 */ +#line 240 "cond.y" /* yacc.c:1646 */ + { (yyval.operator) = COND_ILT; } +#line 1573 "E:/reactosSync3.0_gcc/dll/win32/msi/cond.tab.c" /* yacc.c:1646 */ break; case 25: -#line 255 "cond.y" /* yacc.c:1646 */ - { (yyval.value) = COND_NE; } -#line 1611 "cond.tab.c" /* yacc.c:1646 */ +#line 241 "cond.y" /* yacc.c:1646 */ + { (yyval.operator) = COND_IGT; } +#line 1579 "E:/reactosSync3.0_gcc/dll/win32/msi/cond.tab.c" /* yacc.c:1646 */ break; case 26: -#line 256 "cond.y" /* yacc.c:1646 */ - { (yyval.value) = COND_LT; } -#line 1617 "cond.tab.c" /* yacc.c:1646 */ +#line 242 "cond.y" /* yacc.c:1646 */ + { (yyval.operator) = COND_ILE; } +#line 1585 "E:/reactosSync3.0_gcc/dll/win32/msi/cond.tab.c" /* yacc.c:1646 */ break; case 27: -#line 257 "cond.y" /* yacc.c:1646 */ - { (yyval.value) = COND_GT; } -#line 1623 "cond.tab.c" /* yacc.c:1646 */ +#line 243 "cond.y" /* yacc.c:1646 */ + { (yyval.operator) = COND_IGE; } +#line 1591 "E:/reactosSync3.0_gcc/dll/win32/msi/cond.tab.c" /* yacc.c:1646 */ break; case 28: -#line 258 "cond.y" /* yacc.c:1646 */ - { (yyval.value) = COND_LE; } -#line 1629 "cond.tab.c" /* yacc.c:1646 */ +#line 244 "cond.y" /* yacc.c:1646 */ + { (yyval.operator) = COND_ISS; } +#line 1597 "E:/reactosSync3.0_gcc/dll/win32/msi/cond.tab.c" /* yacc.c:1646 */ break; case 29: -#line 259 "cond.y" /* yacc.c:1646 */ - { (yyval.value) = COND_GE; } -#line 1635 "cond.tab.c" /* yacc.c:1646 */ +#line 245 "cond.y" /* yacc.c:1646 */ + { (yyval.operator) = COND_LHS; } +#line 1603 "E:/reactosSync3.0_gcc/dll/win32/msi/cond.tab.c" /* yacc.c:1646 */ break; case 30: -#line 260 "cond.y" /* yacc.c:1646 */ - { (yyval.value) = COND_SS; } -#line 1641 "cond.tab.c" /* yacc.c:1646 */ +#line 246 "cond.y" /* yacc.c:1646 */ + { (yyval.operator) = COND_RHS; } +#line 1609 "E:/reactosSync3.0_gcc/dll/win32/msi/cond.tab.c" /* yacc.c:1646 */ break; case 31: -#line 261 "cond.y" /* yacc.c:1646 */ - { (yyval.value) = COND_IEQ; } -#line 1647 "cond.tab.c" /* yacc.c:1646 */ +#line 247 "cond.y" /* yacc.c:1646 */ + { (yyval.operator) = COND_ILHS; } +#line 1615 "E:/reactosSync3.0_gcc/dll/win32/msi/cond.tab.c" /* yacc.c:1646 */ break; case 32: -#line 262 "cond.y" /* yacc.c:1646 */ - { (yyval.value) = COND_INE; } -#line 1653 "cond.tab.c" /* yacc.c:1646 */ +#line 248 "cond.y" /* yacc.c:1646 */ + { (yyval.operator) = COND_IRHS; } +#line 1621 "E:/reactosSync3.0_gcc/dll/win32/msi/cond.tab.c" /* yacc.c:1646 */ break; case 33: -#line 263 "cond.y" /* yacc.c:1646 */ - { (yyval.value) = COND_ILT; } -#line 1659 "cond.tab.c" /* yacc.c:1646 */ - break; - - case 34: -#line 264 "cond.y" /* yacc.c:1646 */ - { (yyval.value) = COND_IGT; } -#line 1665 "cond.tab.c" /* yacc.c:1646 */ - break; - - case 35: -#line 265 "cond.y" /* yacc.c:1646 */ - { (yyval.value) = COND_ILE; } -#line 1671 "cond.tab.c" /* yacc.c:1646 */ - break; +#line 253 "cond.y" /* yacc.c:1646 */ + { + COND_input* cond = (COND_input*) info; + UINT len; - case 36: -#line 266 "cond.y" /* yacc.c:1646 */ - { (yyval.value) = COND_IGE; } -#line 1677 "cond.tab.c" /* yacc.c:1646 */ + (yyval.value).type = VALUE_SYMBOL; + (yyval.value).u.string = msi_dup_property( cond->package->db, (yyvsp[0].identifier) ); + if ((yyval.value).u.string) + { + len = (lstrlenW((yyval.value).u.string) + 1) * sizeof (WCHAR); + (yyval.value).u.string = cond_track_mem( cond, (yyval.value).u.string, len ); + } + cond_free( (yyvsp[0].identifier) ); + } +#line 1639 "E:/reactosSync3.0_gcc/dll/win32/msi/cond.tab.c" /* yacc.c:1646 */ break; - case 37: + case 34: #line 267 "cond.y" /* yacc.c:1646 */ - { (yyval.value) = COND_ISS; } -#line 1683 "cond.tab.c" /* yacc.c:1646 */ - break; - - case 38: -#line 268 "cond.y" /* yacc.c:1646 */ - { (yyval.value) = COND_LHS; } -#line 1689 "cond.tab.c" /* yacc.c:1646 */ - break; - - case 39: -#line 269 "cond.y" /* yacc.c:1646 */ - { (yyval.value) = COND_RHS; } -#line 1695 "cond.tab.c" /* yacc.c:1646 */ - break; - - case 40: -#line 270 "cond.y" /* yacc.c:1646 */ - { (yyval.value) = COND_ILHS; } -#line 1701 "cond.tab.c" /* yacc.c:1646 */ - break; - - case 41: -#line 271 "cond.y" /* yacc.c:1646 */ - { (yyval.value) = COND_IRHS; } -#line 1707 "cond.tab.c" /* yacc.c:1646 */ - break; - - case 42: -#line 276 "cond.y" /* yacc.c:1646 */ { - (yyval.string) = (yyvsp[0].string); - } -#line 1715 "cond.tab.c" /* yacc.c:1646 */ - break; - - case 43: -#line 280 "cond.y" /* yacc.c:1646 */ - { - (yyval.string) = (yyvsp[0].string); - } -#line 1723 "cond.tab.c" /* yacc.c:1646 */ + COND_input* cond = (COND_input*) info; + UINT len = GetEnvironmentVariableW( (yyvsp[0].identifier), NULL, 0 ); + (yyval.value).type = VALUE_SYMBOL; + (yyval.value).u.string = NULL; + if (len++) + { + (yyval.value).u.string = cond_alloc( cond, len*sizeof (WCHAR) ); + if( !(yyval.value).u.string ) + YYABORT; + GetEnvironmentVariableW( (yyvsp[0].identifier), (yyval.value).u.string, len ); + } + cond_free( (yyvsp[0].identifier) ); + } +#line 1658 "E:/reactosSync3.0_gcc/dll/win32/msi/cond.tab.c" /* yacc.c:1646 */ break; - case 44: -#line 287 "cond.y" /* yacc.c:1646 */ + case 35: +#line 282 "cond.y" /* yacc.c:1646 */ { COND_input* cond = (COND_input*) info; - (yyval.string) = COND_GetLiteral( cond, &(yyvsp[0].str) ); - if( !(yyval.string) ) + (yyval.value).type = VALUE_LITERAL; + (yyval.value).u.string = COND_GetLiteral( cond, &(yyvsp[0].str) ); + if( !(yyval.value).u.string ) YYABORT; } -#line 1734 "cond.tab.c" /* yacc.c:1646 */ +#line 1670 "E:/reactosSync3.0_gcc/dll/win32/msi/cond.tab.c" /* yacc.c:1646 */ break; - case 45: -#line 297 "cond.y" /* yacc.c:1646 */ + case 36: +#line 290 "cond.y" /* yacc.c:1646 */ { - (yyval.value) = (yyvsp[0].value); + COND_input* cond = (COND_input*) info; + LPWSTR szNum = COND_GetString( cond, &(yyvsp[0].str) ); + if( !szNum ) + YYABORT; + (yyval.value).type = VALUE_INTEGER; + (yyval.value).u.integer = atoiW( szNum ); + cond_free( szNum ); } -#line 1742 "cond.tab.c" /* yacc.c:1646 */ +#line 1684 "E:/reactosSync3.0_gcc/dll/win32/msi/cond.tab.c" /* yacc.c:1646 */ break; - case 46: -#line 301 "cond.y" /* yacc.c:1646 */ + case 37: +#line 300 "cond.y" /* yacc.c:1646 */ { COND_input* cond = (COND_input*) info; INSTALLSTATE install = INSTALLSTATE_UNKNOWN, action = INSTALLSTATE_UNKNOWN; - MSI_GetComponentStateW(cond->package, (yyvsp[0].string), &install, &action ); - (yyval.value) = action; - cond_free( (yyvsp[0].string) ); + if(MSI_GetComponentStateW(cond->package, (yyvsp[0].identifier), &install, &action ) != ERROR_SUCCESS) + { + (yyval.value).type = VALUE_LITERAL; + (yyval.value).u.string = NULL; + } + else + { + (yyval.value).type = VALUE_INTEGER; + (yyval.value).u.integer = action; + } + cond_free( (yyvsp[0].identifier) ); } -#line 1755 "cond.tab.c" /* yacc.c:1646 */ +#line 1705 "E:/reactosSync3.0_gcc/dll/win32/msi/cond.tab.c" /* yacc.c:1646 */ break; - case 47: -#line 310 "cond.y" /* yacc.c:1646 */ + case 38: +#line 317 "cond.y" /* yacc.c:1646 */ { COND_input* cond = (COND_input*) info; INSTALLSTATE install = INSTALLSTATE_UNKNOWN, action = INSTALLSTATE_UNKNOWN; - MSI_GetComponentStateW(cond->package, (yyvsp[0].string), &install, &action ); - (yyval.value) = install; - cond_free( (yyvsp[0].string) ); + if(MSI_GetComponentStateW(cond->package, (yyvsp[0].identifier), &install, &action ) != ERROR_SUCCESS) + { + (yyval.value).type = VALUE_LITERAL; + (yyval.value).u.string = NULL; + } + else + { + (yyval.value).type = VALUE_INTEGER; + (yyval.value).u.integer = install; + } + cond_free( (yyvsp[0].identifier) ); } -#line 1768 "cond.tab.c" /* yacc.c:1646 */ +#line 1726 "E:/reactosSync3.0_gcc/dll/win32/msi/cond.tab.c" /* yacc.c:1646 */ break; - case 48: -#line 319 "cond.y" /* yacc.c:1646 */ + case 39: +#line 334 "cond.y" /* yacc.c:1646 */ { COND_input* cond = (COND_input*) info; - INSTALLSTATE install = INSTALLSTATE_UNKNOWN, action = INSTALLSTATE_UNKNOWN; + INSTALLSTATE install, action; - MSI_GetFeatureStateW(cond->package, (yyvsp[0].string), &install, &action ); - if (action == INSTALLSTATE_UNKNOWN) - (yyval.value) = MSICONDITION_FALSE; + if (MSI_GetFeatureStateW(cond->package, (yyvsp[0].identifier), &install, &action ) != ERROR_SUCCESS) + { + (yyval.value).type = VALUE_LITERAL; + (yyval.value).u.string = NULL; + } else - (yyval.value) = action; - - cond_free( (yyvsp[0].string) ); + { + (yyval.value).type = VALUE_INTEGER; + (yyval.value).u.integer = action; + } + cond_free( (yyvsp[0].identifier) ); } -#line 1785 "cond.tab.c" /* yacc.c:1646 */ +#line 1747 "E:/reactosSync3.0_gcc/dll/win32/msi/cond.tab.c" /* yacc.c:1646 */ break; - case 49: -#line 332 "cond.y" /* yacc.c:1646 */ + case 40: +#line 351 "cond.y" /* yacc.c:1646 */ { COND_input* cond = (COND_input*) info; INSTALLSTATE install = INSTALLSTATE_UNKNOWN, action = INSTALLSTATE_UNKNOWN; - MSI_GetFeatureStateW(cond->package, (yyvsp[0].string), &install, &action ); - (yyval.value) = install; - cond_free( (yyvsp[0].string) ); - } -#line 1798 "cond.tab.c" /* yacc.c:1646 */ - break; - - case 50: -#line 344 "cond.y" /* yacc.c:1646 */ - { - COND_input* cond = (COND_input*) info; - UINT len; - - (yyval.string) = msi_dup_property( cond->package->db, (yyvsp[0].string) ); - if ((yyval.string)) + if(MSI_GetFeatureStateW(cond->package, (yyvsp[0].identifier), &install, &action ) != ERROR_SUCCESS) { - len = (lstrlenW((yyval.string)) + 1) * sizeof (WCHAR); - (yyval.string) = cond_track_mem( cond, (yyval.string), len ); + (yyval.value).type = VALUE_LITERAL; + (yyval.value).u.string = NULL; } - cond_free( (yyvsp[0].string) ); - } -#line 1815 "cond.tab.c" /* yacc.c:1646 */ - break; - - case 51: -#line 357 "cond.y" /* yacc.c:1646 */ - { - COND_input* cond = (COND_input*) info; - UINT len = GetEnvironmentVariableW( (yyvsp[0].string), NULL, 0 ); - (yyval.string) = NULL; - if (len++) + else { - (yyval.string) = cond_alloc( cond, len*sizeof (WCHAR) ); - if( !(yyval.string) ) - YYABORT; - GetEnvironmentVariableW( (yyvsp[0].string), (yyval.string), len ); + (yyval.value).type = VALUE_INTEGER; + (yyval.value).u.integer = install; } - cond_free( (yyvsp[0].string) ); - } -#line 1833 "cond.tab.c" /* yacc.c:1646 */ - break; - - case 52: -#line 374 "cond.y" /* yacc.c:1646 */ - { - COND_input* cond = (COND_input*) info; - (yyval.string) = COND_GetString( cond, &(yyvsp[0].str) ); - if( !(yyval.string) ) - YYABORT; + cond_free( (yyvsp[0].identifier) ); } -#line 1844 "cond.tab.c" /* yacc.c:1646 */ +#line 1768 "E:/reactosSync3.0_gcc/dll/win32/msi/cond.tab.c" /* yacc.c:1646 */ break; - case 53: -#line 384 "cond.y" /* yacc.c:1646 */ + case 41: +#line 371 "cond.y" /* yacc.c:1646 */ { COND_input* cond = (COND_input*) info; - LPWSTR szNum = COND_GetString( cond, &(yyvsp[0].str) ); - if( !szNum ) + (yyval.identifier) = COND_GetString( cond, &(yyvsp[0].str) ); + if( !(yyval.identifier) ) YYABORT; - (yyval.value) = atoiW( szNum ); - cond_free( szNum ); } -#line 1857 "cond.tab.c" /* yacc.c:1646 */ +#line 1779 "E:/reactosSync3.0_gcc/dll/win32/msi/cond.tab.c" /* yacc.c:1646 */ break; -#line 1861 "cond.tab.c" /* yacc.c:1646 */ +#line 1783 "E:/reactosSync3.0_gcc/dll/win32/msi/cond.tab.c" /* yacc.c:1646 */ default: break; } /* User semantic actions sometimes alter yychar, and that requires @@ -2065,7 +2007,7 @@ yyreturn: #endif return yyresult; } -#line 394 "cond.y" /* yacc.c:1906 */ +#line 379 "cond.y" /* yacc.c:1906 */ diff --git a/dll/win32/msi/cond.y b/dll/win32/msi/cond.y index fa5582566e..61ace8c57e 100644 --- a/dll/win32/msi/cond.y +++ b/dll/win32/msi/cond.y @@ -20,27 +20,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#define COBJMACROS - -#include "config.h" - -#include <stdarg.h> -#include <stdio.h> -#include <stdlib.h> - -#include "windef.h" -#include "winbase.h" -#include "winuser.h" -#include "msi.h" -#include "msiquery.h" -#include "objbase.h" -#include "oleauto.h" - #include "msipriv.h" -#include "msiserver.h" -#include "wine/debug.h" -#include "wine/unicode.h" -#include "wine/list.h" WINE_DEFAULT_DEBUG_CHANNEL(msi); @@ -58,6 +38,18 @@ struct cond_str { INT len; }; +struct value { + enum value_type { + VALUE_INTEGER, + VALUE_LITERAL, + VALUE_SYMBOL + } type; + union { + INT integer; + WCHAR *string; + } u; +}; + static LPWSTR COND_GetString( COND_input *info, const struct cond_str *str ); static LPWSTR COND_GetLiteral( COND_input *info, const struct cond_str *str ); static int cond_lex( void *COND_lval, COND_input *info); @@ -70,16 +62,6 @@ static void cond_free( void *ptr ); static INT compare_int( INT a, INT operator, INT b ); static INT compare_string( LPCWSTR a, INT operator, LPCWSTR b, BOOL convert ); -static INT compare_and_free_strings( LPWSTR a, INT op, LPWSTR b, BOOL convert ) -{ - INT r; - - r = compare_string( a, op, b, convert ); - cond_free( a ); - cond_free( b ); - return r; -} - static BOOL num_from_prop( LPCWSTR p, INT *val ) { INT ret = 0, sign = 1; @@ -104,6 +86,12 @@ static BOOL num_from_prop( LPCWSTR p, INT *val ) return TRUE; } +static void value_free( struct value val ) +{ + if (val.type != VALUE_INTEGER) + cond_free( val.u.string ); +} + %} %lex-param { COND_input *info } @@ -113,8 +101,10 @@ static BOOL num_from_prop( LPCWSTR p, INT *val ) %union { struct cond_str str; - LPWSTR string; - INT value; + struct value value; + LPWSTR identifier; + INT operator; + BOOL bool; } %token COND_SPACE COND_EOF @@ -128,9 +118,10 @@ static BOOL num_from_prop( LPCWSTR p, INT *val ) %nonassoc COND_ERROR COND_EOF -%type <value> expression boolean_term boolean_factor -%type <value> value_i integer operator -%type <string> identifier symbol_s value_s literal +%type <bool> expression boolean_term boolean_factor +%type <value> value +%type <identifier> identifier +%type <operator> operator %% @@ -184,64 +175,50 @@ boolean_term: boolean_factor: COND_NOT boolean_factor { - $$ = $2 ? 0 : 1; - } - | value_i - { - $$ = $1 ? 1 : 0; - } - | value_s - { - $$ = ($1 && $1[0]) ? 1 : 0; - cond_free( $1 ); - } - | value_i operator value_i - { - $$ = compare_int( $1, $2, $3 ); - } - | symbol_s operator value_i - { - int num; - if (num_from_prop( $1, &num )) - $$ = compare_int( num, $2, $3 ); - else - $$ = ($2 == COND_NE || $2 == COND_INE ); - cond_free( $1 ); - } - | value_i operator symbol_s - { - int num; - if (num_from_prop( $3, &num )) - $$ = compare_int( $1, $2, num ); - else - $$ = ($2 == COND_NE || $2 == COND_INE ); - cond_free( $3 ); - } - | symbol_s operator symbol_s - { - $$ = compare_and_free_strings( $1, $2, $3, TRUE ); - } - | symbol_s operator literal - { - $$ = compare_and_free_strings( $1, $2, $3, TRUE ); + $$ = !$2; } - | literal operator symbol_s + | value { - $$ = compare_and_free_strings( $1, $2, $3, TRUE ); - } - | literal operator literal - { - $$ = compare_and_free_strings( $1, $2, $3, FALSE ); - } - | literal operator value_i - { - $$ = 0; - cond_free( $1 ); + if ($1.type == VALUE_INTEGER) + $$ = $1.u.integer ? 1 : 0; + else + $$ = $1.u.string && $1.u.string[0]; + value_free( $1 ); } - | value_i operator literal + | value operator value { - $$ = 0; - cond_free( $3 ); + if ($1.type == VALUE_INTEGER && $3.type == VALUE_INTEGER) + { + $$ = compare_int($1.u.integer, $2, $3.u.integer); + } + else if ($1.type != VALUE_INTEGER && $3.type != VALUE_INTEGER) + { + $$ = compare_string($1.u.string, $2, $3.u.string, + $1.type == VALUE_SYMBOL || $3.type == VALUE_SYMBOL); + } + else if ($1.type == VALUE_LITERAL || $3.type == VALUE_LITERAL) + { + $$ = FALSE; + } + else if ($1.type == VALUE_SYMBOL) /* symbol operator integer */ + { + int num; + if (num_from_prop( $1.u.string, &num )) + $$ = compare_int( num, $2, $3.u.integer ); + else + $$ = ($2 == COND_NE || $2 == COND_INE ); + } + else /* integer operator symbol */ + { + int num; + if (num_from_prop( $3.u.string, &num )) + $$ = compare_int( $1.u.integer, $2, num ); + else + $$ = ($2 == COND_NE || $2 == COND_INE ); + } + + value_free( $1 ); + value_free( $3 ); } | COND_LPAR expression COND_RPAR { @@ -271,39 +248,69 @@ operator: | COND_IRHS { $$ = COND_IRHS; } ; -value_s: - symbol_s - { - $$ = $1; - } - | literal - { - $$ = $1; - } - ; +value: + identifier + { + COND_input* cond = (COND_input*) info; + UINT len; -literal: - COND_LITER + $$.type = VALUE_SYMBOL; + $$.u.string = msi_dup_property( cond->package->db, $1 ); + if ($$.u.string) + { + len = (lstrlenW($$.u.string) + 1) * sizeof (WCHAR); + $$.u.string = cond_track_mem( cond, $$.u.string, len ); + } + cond_free( $1 ); + } + | COND_PERCENT identifier { COND_input* cond = (COND_input*) info; - $$ = COND_GetLiteral( cond, &$1 ); - if( !$$ ) + UINT len = GetEnvironmentVariableW( $2, NULL, 0 ); + $$.type = VALUE_SYMBOL; + $$.u.string = NULL; + if (len++) + { + $$.u.string = cond_alloc( cond, len*sizeof (WCHAR) ); + if( !$$.u.string ) + YYABORT; + GetEnvironmentVariableW( $2, $$.u.string, len ); + } + cond_free( $2 ); + } + | COND_LITER + { + COND_input* cond = (COND_input*) info; + $$.type = VALUE_LITERAL; + $$.u.string = COND_GetLiteral( cond, &$1 ); + if( !$$.u.string ) YYABORT; } - ; - -value_i: - integer + | COND_NUMBER { - $$ = $1; + COND_input* cond = (COND_input*) info; + LPWSTR szNum = COND_GetString( cond, &$1 ); + if( !szNum ) + YYABORT; + $$.type = VALUE_INTEGER; + $$.u.integer = atoiW( szNum ); + cond_free( szNum ); } | COND_DOLLARS identifier { COND_input* cond = (COND_input*) info; INSTALLSTATE install = INSTALLSTATE_UNKNOWN, action = INSTALLSTATE_UNKNOWN; - MSI_GetComponentStateW(cond->package, $2, &install, &action ); - $$ = action; + if(MSI_GetComponentStateW(cond->package, $2, &install, &action ) != ERROR_SUCCESS) + { + $$.type = VALUE_LITERAL; + $$.u.string = NULL; + } + else + { + $$.type = VALUE_INTEGER; + $$.u.integer = action; + } cond_free( $2 ); } | COND_QUESTION identifier @@ -311,21 +318,33 @@ value_i: COND_input* cond = (COND_input*) info; INSTALLSTATE install = INSTALLSTATE_UNKNOWN, action = INSTALLSTATE_UNKNOWN; - MSI_GetComponentStateW(cond->package, $2, &install, &action ); - $$ = install; + if(MSI_GetComponentStateW(cond->package, $2, &install, &action ) != ERROR_SUCCESS) + { + $$.type = VALUE_LITERAL; + $$.u.string = NULL; + } + else + { + $$.type = VALUE_INTEGER; + $$.u.integer = install; + } cond_free( $2 ); } | COND_AMPER identifier { COND_input* cond = (COND_input*) info; - INSTALLSTATE install = INSTALLSTATE_UNKNOWN, action = INSTALLSTATE_UNKNOWN; + INSTALLSTATE install, action; - MSI_GetFeatureStateW(cond->package, $2, &install, &action ); - if (action == INSTALLSTATE_UNKNOWN) - $$ = MSICONDITION_FALSE; + if (MSI_GetFeatureStateW(cond->package, $2, &install, &action ) != ERROR_SUCCESS) + { + $$.type = VALUE_LITERAL; + $$.u.string = NULL; + } else - $$ = action; - + { + $$.type = VALUE_INTEGER; + $$.u.integer = action; + } cond_free( $2 ); } | COND_EXCLAM identifier @@ -333,37 +352,15 @@ value_i: COND_input* cond = (COND_input*) info; INSTALLSTATE install = INSTALLSTATE_UNKNOWN, action = INSTALLSTATE_UNKNOWN; - MSI_GetFeatureStateW(cond->package, $2, &install, &action ); - $$ = install; - cond_free( $2 ); - } - ; - -symbol_s: - identifier - { - COND_input* cond = (COND_input*) info; - UINT len; - - $$ = msi_dup_property( cond->package->db, $1 ); - if ($$) + if(MSI_GetFeatureStateW(cond->package, $2, &install, &action ) != ERROR_SUCCESS) { - len = (lstrlenW($$) + 1) * sizeof (WCHAR); - $$ = cond_track_mem( cond, $$, len ); + $$.type = VALUE_LITERAL; + $$.u.string = NULL; } - cond_free( $1 ); - } - | COND_PERCENT identifier - { - COND_input* cond = (COND_input*) info; - UINT len = GetEnvironmentVariableW( $2, NULL, 0 ); - $$ = NULL; - if (len++) + else { - $$ = cond_alloc( cond, len*sizeof (WCHAR) ); - if( !$$ ) - YYABORT; - GetEnvironmentVariableW( $2, $$, len ); + $$.type = VALUE_INTEGER; + $$.u.integer = install; } cond_free( $2 ); } @@ -379,18 +376,6 @@ identifier: } ; -integer: - COND_NUMBER - { - COND_input* cond = (COND_input*) info; - LPWSTR szNum = COND_GetString( cond, &$1 ); - if( !szNum ) - YYABORT; - $$ = atoiW( szNum ); - cond_free( szNum ); - } - ; - %% diff --git a/dll/win32/msi/custom.c b/dll/win32/msi/custom.c index 3dffb8680a..c3fb8d3cd7 100644 --- a/dll/win32/msi/custom.c +++ b/dll/win32/msi/custom.c @@ -64,14 +64,14 @@ UINT msi_schedule_action( MSIPACKAGE *package, UINT script, const WCHAR *action } TRACE("Scheduling action %s in script %u\n", debugstr_w(action), script); - count = package->script->ActionCount[script]; - package->script->ActionCount[script]++; - if (count != 0) newbuf = msi_realloc( package->script->Actions[script], - package->script->ActionCount[script] * sizeof(WCHAR *) ); + count = package->script_actions_count[script]; + package->script_actions_count[script]++; + if (count != 0) newbuf = msi_realloc( package->script_actions[script], + package->script_actions_count[script] * sizeof(WCHAR *) ); else newbuf = msi_alloc( sizeof(WCHAR *) ); newbuf[count] = strdupW( action ); - package->script->Actions[script] = newbuf; + package->script_actions[script] = newbuf; return ERROR_SUCCESS; } @@ -80,18 +80,16 @@ UINT msi_register_unique_action( MSIPACKAGE *package, const WCHAR *action ) UINT count; WCHAR **newbuf = NULL; - if (!package->script) return FALSE; - TRACE("Registering %s as unique action\n", debugstr_w(action)); - count = package->script->UniqueActionsCount; - package->script->UniqueActionsCount++; - if (count != 0) newbuf = msi_realloc( package->script->UniqueActions, - package->script->UniqueActionsCount * sizeof(WCHAR *) ); + count = package->unique_actions_count; + package->unique_actions_count++; + if (count != 0) newbuf = msi_realloc( package->unique_actions, + package->unique_actions_count * sizeof(WCHAR *) ); else newbuf = msi_alloc( sizeof(WCHAR *) ); newbuf[count] = strdupW( action ); - package->script->UniqueActions = newbuf; + package->unique_actions = newbuf; return ERROR_SUCCESS; } @@ -99,25 +97,20 @@ BOOL msi_action_is_unique( const MSIPACKAGE *package, const WCHAR *action ) { UINT i; - if (!package->script) return FALSE; - - for (i = 0; i < package->script->UniqueActionsCount; i++) + for (i = 0; i < package->unique_actions_count; i++) { - if (!strcmpW( package->script->UniqueActions[i], action )) return TRUE; + if (!strcmpW( package->unique_actions[i], action )) return TRUE; } return FALSE; } static BOOL check_execution_scheduling_options(MSIPACKAGE *package, LPCWSTR action, UINT options) { - if (!package->script) - return TRUE; - if ((options & msidbCustomActionTypeClientRepeat) == msidbCustomActionTypeClientRepeat) { - if (!(package->script->InWhatSequence & SEQUENCE_UI && - package->script->InWhatSequence & SEQUENCE_EXEC)) + if (!(package->InWhatSequence & SEQUENCE_UI && + package->InWhatSequence & SEQUENCE_EXEC)) { TRACE("Skipping action due to dbCustomActionTypeClientRepeat option.\n"); return FALSE; @@ -125,8 +118,8 @@ static BOOL check_execution_scheduling_options(MSIPACKAGE *package, LPCWSTR acti } else if (options & msidbCustomActionTypeFirstSequence) { - if (package->script->InWhatSequence & SEQUENCE_UI && - package->script->InWhatSequence & SEQUENCE_EXEC ) + if (package->InWhatSequence & SEQUENCE_UI && + package->InWhatSequence & SEQUENCE_EXEC ) { TRACE("Skipping action due to msidbCustomActionTypeFirstSequence option.\n"); return FALSE; @@ -258,7 +251,7 @@ static MSIBINARY *create_temp_binary( MSIPACKAGE *package, LPCWSTR source, BOOL /* keep a reference to prevent the dll from being unloaded */ if (dll && !(binary->module = LoadLibraryW( tmpfile ))) { - WARN( "failed to load dll %s (%u)\n", debugstr_w( tmpfile ), GetLastError() ); + ERR( "failed to load dll %s (%u)\n", debugstr_w( tmpfile ), GetLastError() ); } binary->source = strdupW( source ); binary->tmpfile = tmpfile; @@ -562,7 +555,7 @@ static DWORD ACTION_CallDllFunction( const GUID *guid ) hModule = LoadLibraryW( dll ); if (!hModule) { - WARN( "failed to load dll %s (%u)\n", debugstr_w( dll ), GetLastError() ); + ERR( "failed to load dll %s (%u)\n", debugstr_w( dll ), GetLastError() ); return ERROR_SUCCESS; } @@ -695,7 +688,7 @@ static HANDLE execute_command( const WCHAR *app, WCHAR *arg, const WCHAR *dir ) } if (!len_exe) { - WARN("can't find executable %u\n", GetLastError()); + ERR("can't find executable %u\n", GetLastError()); msi_free( exe ); return INVALID_HANDLE_VALUE; } @@ -733,7 +726,7 @@ static HANDLE execute_command( const WCHAR *app, WCHAR *arg, const WCHAR *dir ) msi_free( exe ); if (!ret) { - WARN("unable to execute command %u\n", GetLastError()); + ERR("unable to execute command %u\n", GetLastError()); return INVALID_HANDLE_VALUE; } CloseHandle( info.hThread ); diff --git a/dll/win32/msi/database.c b/dll/win32/msi/database.c index a94cebdbdf..80d366b479 100644 --- a/dll/win32/msi/database.c +++ b/dll/win32/msi/database.c @@ -36,13 +36,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(msi); #define IS_INTMSIDBOPEN(x) (((ULONG_PTR)(x) >> 16) == 0) -struct row_export_info -{ - HANDLE handle; - LPCWSTR folder; - LPCWSTR table; -}; - static void free_transforms( MSIDATABASE *db ) { while( !list_empty( &db->transforms ) ) @@ -911,131 +904,50 @@ end: return r; } -static UINT msi_export_field( HANDLE handle, MSIRECORD *row, UINT field ) +static UINT msi_export_record( HANDLE handle, MSIRECORD *row, UINT start ) { + UINT i, count, len, r = ERROR_SUCCESS; + const char *sep; char *buffer; - BOOL bret; DWORD sz; - UINT r; - sz = 0x100; - buffer = msi_alloc( sz ); - if (!buffer) + len = 0x100; + buffer = msi_alloc( len ); + if ( !buffer ) return ERROR_OUTOFMEMORY; - r = MSI_RecordGetStringA( row, field, buffer, &sz ); - if (r == ERROR_MORE_DATA) + count = MSI_RecordGetFieldCount( row ); + for ( i=start; i<=count; i++ ) { - char *p; - - sz++; /* leave room for NULL terminator */ - p = msi_realloc( buffer, sz ); - if (!p) + sz = len; + r = MSI_RecordGetStringA( row, i, buffer, &sz ); + if (r == ERROR_MORE_DATA) { - msi_free( buffer ); - return ERROR_OUTOFMEMORY; - } - buffer = p; - - r = MSI_RecordGetStringA( row, field, buffer, &sz ); - if (r != ERROR_SUCCESS) - { - msi_free( buffer ); - return r; + char *p = msi_realloc( buffer, sz + 1 ); + if (!p) + break; + len = sz + 1; + buffer = p; } - } - else if (r != ERROR_SUCCESS) - return r; - - bret = WriteFile( handle, buffer, sz, &sz, NULL ); - msi_free( buffer ); - if (!bret) - return ERROR_FUNCTION_FAILED; - - return r; -} - -static UINT msi_export_stream( LPCWSTR folder, LPCWSTR table, MSIRECORD *row, UINT field, - UINT start ) -{ - static const WCHAR fmt_file[] = { '%','s','/','%','s','/','%','s',0 }; - static const WCHAR fmt_folder[] = { '%','s','/','%','s',0 }; - WCHAR stream_name[256], stream_filename[MAX_PATH]; - DWORD sz, read_size, write_size; - char buffer[1024]; - HANDLE file; - UINT r; - - /* get the name of the file */ - sz = sizeof(stream_name)/sizeof(WCHAR); - r = MSI_RecordGetStringW( row, start, stream_name, &sz ); - if (r != ERROR_SUCCESS) - return r; - - /* if the destination folder does not exist then create it (folder name = table name) */ - snprintfW( stream_filename, sizeof(stream_filename)/sizeof(WCHAR), fmt_folder, folder, table ); - if (GetFileAttributesW( stream_filename ) == INVALID_FILE_ATTRIBUTES) - { - if (!CreateDirectoryW( stream_filename, NULL )) - return ERROR_PATH_NOT_FOUND; - } - - /* actually create the file */ - snprintfW( stream_filename, sizeof(stream_filename)/sizeof(WCHAR), fmt_file, folder, table, stream_name ); - file = CreateFileW( stream_filename, GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, - NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL ); - if (file == INVALID_HANDLE_VALUE) - return ERROR_FILE_NOT_FOUND; - - /* copy the stream to the file */ - read_size = sizeof(buffer); - while (read_size == sizeof(buffer)) - { - r = MSI_RecordReadStream( row, field, buffer, &read_size ); + sz = len; + r = MSI_RecordGetStringA( row, i, buffer, &sz ); if (r != ERROR_SUCCESS) - { - CloseHandle( file ); - return r; - } - if (!WriteFile( file, buffer, read_size, &write_size, NULL ) || read_size != write_size) - { - CloseHandle( file ); - return ERROR_WRITE_FAULT; - } - } - CloseHandle( file ); - return r; -} - -static UINT msi_export_record( struct row_export_info *row_export_info, MSIRECORD *row, UINT start ) -{ - HANDLE handle = row_export_info->handle; - UINT i, count, r = ERROR_SUCCESS; - const char *sep; - DWORD sz; + break; - count = MSI_RecordGetFieldCount( row ); - for (i = start; i <= count; i++) - { - r = msi_export_field( handle, row, i ); - if (r == ERROR_INVALID_PARAMETER) + if (!WriteFile( handle, buffer, sz, &sz, NULL )) { - r = msi_export_stream( row_export_info->folder, row_export_info->table, row, i, start ); - if (r != ERROR_SUCCESS) - return r; - - /* exporting a binary stream, repeat the "Name" field */ - r = msi_export_field( handle, row, start ); - if (r != ERROR_SUCCESS) - return r; + r = ERROR_FUNCTION_FAILED; + break; } - else if (r != ERROR_SUCCESS) - return r; sep = (i < count) ? "\t" : "\r\n"; if (!WriteFile( handle, sep, strlen(sep), &sz, NULL )) - return ERROR_FUNCTION_FAILED; + { + r = ERROR_FUNCTION_FAILED; + break; + } } + msi_free( buffer ); return r; } @@ -1059,25 +971,9 @@ static UINT msi_export_forcecodepage( HANDLE handle, UINT codepage ) return ERROR_SUCCESS; } -static UINT msi_export_summaryinformation( MSIDATABASE *db, HANDLE handle ) -{ - static const char header[] = "PropertyId\tValue\r\n" - "i2\tl255\r\n" - "_SummaryInformation\tPropertyId\r\n"; - DWORD sz; - - sz = lstrlenA(header); - if (!WriteFile(handle, header, sz, &sz, NULL)) - return ERROR_WRITE_FAULT; - - return msi_export_suminfo( db, handle ); -} - static UINT MSI_DatabaseExport( MSIDATABASE *db, LPCWSTR table, LPCWSTR folder, LPCWSTR file ) { - static const WCHAR summaryinformation[] = { - '_','S','u','m','m','a','r','y','I','n','f','o','r','m','a','t','i','o','n',0 }; static const WCHAR query[] = { 's','e','l','e','c','t',' ','*',' ','f','r','o','m',' ','%','s',0 }; static const WCHAR forcecodepage[] = { @@ -1116,22 +1012,14 @@ static UINT MSI_DatabaseExport( MSIDATABASE *db, LPCWSTR table, goto done; } - if (!strcmpW( table, summaryinformation )) - { - r = msi_export_summaryinformation( db, handle ); - goto done; - } - r = MSI_OpenQuery( db, &view, query, table ); if (r == ERROR_SUCCESS) { - struct row_export_info row_export_info = { handle, folder, table }; - /* write out row 1, the column names */ r = MSI_ViewGetColumnInfo(view, MSICOLINFO_NAMES, &rec); if (r == ERROR_SUCCESS) { - msi_export_record( &row_export_info, rec, 1 ); + msi_export_record( handle, rec, 1 ); msiobj_release( &rec->hdr ); } @@ -1139,7 +1027,7 @@ static UINT MSI_DatabaseExport( MSIDATABASE *db, LPCWSTR table, r = MSI_ViewGetColumnInfo(view, MSICOLINFO_TYPES, &rec); if (r == ERROR_SUCCESS) { - msi_export_record( &row_export_info, rec, 1 ); + msi_export_record( handle, rec, 1 ); msiobj_release( &rec->hdr ); } @@ -1148,12 +1036,12 @@ static UINT MSI_DatabaseExport( MSIDATABASE *db, LPCWSTR table, if (r == ERROR_SUCCESS) { MSI_RecordSetStringW( rec, 0, table ); - msi_export_record( &row_export_info, rec, 0 ); + msi_export_record( handle, rec, 0 ); msiobj_release( &rec->hdr ); } /* write out row 4 onwards, the data */ - r = MSI_IterateRecords( view, 0, msi_export_row, &row_export_info ); + r = MSI_IterateRecords( view, 0, msi_export_row, handle ); msiobj_release( &view->hdr ); } @@ -1991,8 +1879,16 @@ MSIDBSTATE WINAPI MsiGetDatabaseState( MSIHANDLE handle ) db = msihandle2msiinfo( handle, MSIHANDLETYPE_DATABASE ); if( !db ) { + IWineMsiRemoteDatabase *remote_database; + + remote_database = (IWineMsiRemoteDatabase *)msi_get_remote( handle ); + if ( !remote_database ) + return MSIDBSTATE_ERROR; + + IWineMsiRemoteDatabase_Release( remote_database ); WARN("MsiGetDatabaseState not allowed during a custom action!\n"); - return MSIDBSTATE_ERROR; + + return MSIDBSTATE_READ; } if (db->mode != MSIDBOPEN_READONLY ) diff --git a/dll/win32/msi/dialog.c b/dll/win32/msi/dialog.c index 8b62bb0a8f..af986a1da6 100644 --- a/dll/win32/msi/dialog.c +++ b/dll/win32/msi/dialog.c @@ -3179,13 +3179,13 @@ static LONGLONG msi_vcl_get_cost( msi_dialog *dialog ) MSICOSTTREE_SELFONLY, INSTALLSTATE_LOCAL, &each_cost))) { /* each_cost is in 512-byte units */ - total_cost += ((LONGLONG)each_cost) * 512; + total_cost += each_cost * 512; } if (ERROR_SUCCESS == (MSI_GetFeatureCost(dialog->package, feature, MSICOSTTREE_SELFONLY, INSTALLSTATE_ABSENT, &each_cost))) { /* each_cost is in 512-byte units */ - total_cost -= ((LONGLONG)each_cost) * 512; + total_cost -= each_cost * 512; } } return total_cost; @@ -4288,7 +4288,7 @@ static UINT event_end_dialog( msi_dialog *dialog, const WCHAR *argument ) static UINT pending_event_end_dialog( msi_dialog *dialog, const WCHAR *argument ) { dialog->pending_event = event_end_dialog; - if (dialog->pending_argument) msi_free( dialog->pending_argument ); + msi_free( dialog->pending_argument ); dialog->pending_argument = strdupW( argument ); return ERROR_SUCCESS; } @@ -4306,7 +4306,7 @@ static UINT event_new_dialog( msi_dialog *dialog, const WCHAR *argument ) static UINT pending_event_new_dialog( msi_dialog *dialog, const WCHAR *argument ) { dialog->pending_event = event_new_dialog; - if (dialog->pending_argument) msi_free( dialog->pending_argument ); + msi_free( dialog->pending_argument ); dialog->pending_argument = strdupW( argument ); return ERROR_SUCCESS; } @@ -4331,7 +4331,7 @@ static UINT event_spawn_dialog( msi_dialog *dialog, const WCHAR *argument ) static UINT pending_event_spawn_dialog( msi_dialog *dialog, const WCHAR *argument ) { dialog->pending_event = event_spawn_dialog; - if (dialog->pending_argument) msi_free( dialog->pending_argument ); + msi_free( dialog->pending_argument ); dialog->pending_argument = strdupW( argument ); return ERROR_SUCCESS; } diff --git a/dll/win32/msi/install.c b/dll/win32/msi/install.c index 83d6badde8..8882ea1fa6 100644 --- a/dll/win32/msi/install.c +++ b/dll/win32/msi/install.c @@ -90,7 +90,7 @@ UINT WINAPI MsiDoActionW( MSIHANDLE hInstall, LPCWSTR szAction ) return ERROR_SUCCESS; } - ret = ACTION_PerformUIAction( package, szAction, SCRIPT_NONE ); + ret = ACTION_PerformAction( package, szAction, SCRIPT_NONE ); msiobj_release( &package->hdr ); return ret; diff --git a/dll/win32/msi/msi.c b/dll/win32/msi/msi.c index 092aac82c3..ce1bd4f6de 100644 --- a/dll/win32/msi/msi.c +++ b/dll/win32/msi/msi.c @@ -3723,7 +3723,7 @@ UINT WINAPI MsiCollectUserInfoW(LPCWSTR szProduct) if (!package) return ERROR_CALL_NOT_IMPLEMENTED; - rc = ACTION_PerformUIAction(package, szFirstRun, SCRIPT_NONE); + rc = ACTION_PerformAction(package, szFirstRun, SCRIPT_NONE); msiobj_release( &package->hdr ); MsiCloseHandle(handle); @@ -3749,7 +3749,7 @@ UINT WINAPI MsiCollectUserInfoA(LPCSTR szProduct) if (!package) return ERROR_CALL_NOT_IMPLEMENTED; - rc = ACTION_PerformUIAction(package, szFirstRun, SCRIPT_NONE); + rc = ACTION_PerformAction(package, szFirstRun, SCRIPT_NONE); msiobj_release( &package->hdr ); MsiCloseHandle(handle); @@ -3830,7 +3830,7 @@ UINT WINAPI MsiConfigureFeatureW(LPCWSTR szProduct, LPCWSTR szFeature, INSTALLST MsiSetInternalUI( INSTALLUILEVEL_BASIC, NULL ); - r = ACTION_PerformUIAction( package, szCostInitialize, SCRIPT_NONE ); + r = ACTION_PerformAction( package, szCostInitialize, SCRIPT_NONE ); if (r != ERROR_SUCCESS) goto end; diff --git a/dll/win32/msi/msipriv.h b/dll/win32/msi/msipriv.h index d680a02435..971750d452 100644 --- a/dll/win32/msi/msipriv.h +++ b/dll/win32/msi/msipriv.h @@ -387,6 +387,15 @@ enum clr_version CLR_VERSION_MAX }; +enum script +{ + SCRIPT_NONE = -1, + SCRIPT_INSTALL = 0, + SCRIPT_COMMIT = 1, + SCRIPT_ROLLBACK = 2, + SCRIPT_MAX = 3 +}; + typedef struct tagMSIPACKAGE { MSIOBJECTHDR hdr; @@ -419,7 +428,12 @@ typedef struct tagMSIPACKAGE struct list mimes; struct list appids; - struct tagMSISCRIPT *script; + LPWSTR *script_actions[SCRIPT_MAX]; + int script_actions_count[SCRIPT_MAX]; + LPWSTR *unique_actions; + int unique_actions_count; + BOOL ExecuteSequenceRun; + UINT InWhatSequence; struct list RunningActions; @@ -449,7 +463,6 @@ typedef struct tagMSIPACKAGE unsigned char need_reboot_at_end : 1; unsigned char need_reboot_now : 1; unsigned char need_rollback : 1; - unsigned char full_reinstall : 1; } MSIPACKAGE; typedef struct tagMSIPREVIEW @@ -695,28 +708,8 @@ struct tagMSIMIME MSICLASS *Class; }; -enum SCRIPTS -{ - SCRIPT_NONE = -1, - SCRIPT_INSTALL = 0, - SCRIPT_COMMIT = 1, - SCRIPT_ROLLBACK = 2, - SCRIPT_MAX = 3 -}; - #define SEQUENCE_UI 0x1 #define SEQUENCE_EXEC 0x2 -#define SEQUENCE_INSTALL 0x10 - -typedef struct tagMSISCRIPT -{ - LPWSTR *Actions[SCRIPT_MAX]; - UINT ActionCount[SCRIPT_MAX]; - BOOL ExecuteSequenceRun; - UINT InWhatSequence; - LPWSTR *UniqueActions; - UINT UniqueActionsCount; -} MSISCRIPT; #define MSIHANDLETYPE_ANY 0 #define MSIHANDLETYPE_DATABASE 1 @@ -975,7 +968,6 @@ extern LPWSTR msi_suminfo_dup_string( MSISUMMARYINFO *si, UINT uiProperty ) DECL 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 UINT msi_export_suminfo( MSIDATABASE *db, HANDLE handle ) DECLSPEC_HIDDEN; extern UINT msi_load_suminfo_properties( MSIPACKAGE *package ) DECLSPEC_HIDDEN; /* undocumented functions */ @@ -1000,7 +992,6 @@ extern HINSTANCE msi_hInstance DECLSPEC_HIDDEN; /* action related functions */ extern UINT ACTION_PerformAction(MSIPACKAGE *package, const WCHAR *action, UINT script) DECLSPEC_HIDDEN; -extern UINT ACTION_PerformUIAction(MSIPACKAGE *package, const WCHAR *action, UINT script) DECLSPEC_HIDDEN; extern void ACTION_FinishCustomActions( const MSIPACKAGE* package) DECLSPEC_HIDDEN; extern UINT ACTION_CustomAction(MSIPACKAGE *, const WCHAR *, UINT) DECLSPEC_HIDDEN; @@ -1221,6 +1212,7 @@ static const WCHAR szLangResource[] = {'\\','V','a','r','F','i','l','e','I','n', 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}; static const WCHAR szUninstallable[] = {'U','n','i','n','s','t','a','l','l','a','b','l','e',0}; +static const WCHAR szEXECUTEACTION[] = {'E','X','E','C','U','T','E','A','C','T','I','O','N',0}; /* memory allocation macro functions */ static void *msi_alloc( size_t len ) __WINE_ALLOC_SIZE(1); diff --git a/dll/win32/msi/package.c b/dll/win32/msi/package.c index 3e0ae717f0..5ddc5c8483 100644 --- a/dll/win32/msi/package.c +++ b/dll/win32/msi/package.c @@ -103,17 +103,18 @@ static void free_assembly( MSIASSEMBLY *assembly ) void msi_free_action_script( MSIPACKAGE *package, UINT script ) { UINT i; - for (i = 0; i < package->script->ActionCount[script]; i++) - msi_free( package->script->Actions[script][i] ); + for (i = 0; i < package->script_actions_count[script]; i++) + msi_free( package->script_actions[script][i] ); - msi_free( package->script->Actions[script] ); - package->script->Actions[script] = NULL; - package->script->ActionCount[script] = 0; + msi_free( package->script_actions[script] ); + package->script_actions[script] = NULL; + package->script_actions_count[script] = 0; } static void free_package_structures( MSIPACKAGE *package ) { struct list *item, *cursor; + int i; LIST_FOR_EACH_SAFE( item, cursor, &package->features ) { @@ -249,20 +250,12 @@ static void free_package_structures( MSIPACKAGE *package ) msi_free( info ); } - if (package->script) - { - INT i; - UINT j; - - for (i = 0; i < SCRIPT_MAX; i++) - msi_free_action_script( package, i ); + for (i = 0; i < SCRIPT_MAX; i++) + msi_free_action_script( package, i ); - for (j = 0; j < package->script->UniqueActionsCount; j++) - msi_free( package->script->UniqueActions[j] ); - - msi_free( package->script->UniqueActions ); - msi_free( package->script ); - } + for (i = 0; i < package->unique_actions_count; i++) + msi_free( package->unique_actions[i] ); + msi_free( package->unique_actions); LIST_FOR_EACH_SAFE( item, cursor, &package->binaries ) { @@ -1061,7 +1054,6 @@ MSIPACKAGE *MSI_CreatePackage( MSIDATABASE *db, LPCWSTR base_url ) msi_adjust_privilege_properties( package ); package->ProductCode = msi_dup_property( package->db, szProductCode ); - package->script = msi_alloc_zero( sizeof(MSISCRIPT) ); set_installer_properties( package ); @@ -1737,6 +1729,8 @@ static INT internal_ui_handler(MSIPACKAGE *package, INSTALLMESSAGE eMessageType, case INSTALLMESSAGE_INFO: case INSTALLMESSAGE_INITIALIZE: case INSTALLMESSAGE_TERMINATE: + case INSTALLMESSAGE_INSTALLSTART: + case INSTALLMESSAGE_INSTALLEND: return 0; case INSTALLMESSAGE_SHOWDIALOG: { @@ -1858,7 +1852,8 @@ LPWSTR msi_get_error_message(MSIDATABASE *db, int error) INT MSI_ProcessMessageVerbatim(MSIPACKAGE *package, INSTALLMESSAGE eMessageType, MSIRECORD *record) { LPWSTR message = {0}; - DWORD len, log_type = 0; + DWORD len; + DWORD log_type = 1 << (eMessageType >> 24); UINT res; INT rc = 0; char *msg; @@ -1866,35 +1861,6 @@ INT MSI_ProcessMessageVerbatim(MSIPACKAGE *package, INSTALLMESSAGE eMessageType, TRACE("%x\n", eMessageType); if (TRACE_ON(msi)) dump_record(record); - if ((eMessageType & 0xff000000) == INSTALLMESSAGE_FATALEXIT) - log_type |= INSTALLLOGMODE_FATALEXIT; - if ((eMessageType & 0xff000000) == INSTALLMESSAGE_ERROR) - log_type |= INSTALLLOGMODE_ERROR; - if ((eMessageType & 0xff000000) == INSTALLMESSAGE_WARNING) - log_type |= INSTALLLOGMODE_WARNING; - if ((eMessageType & 0xff000000) == INSTALLMESSAGE_USER) - log_type |= INSTALLLOGMODE_USER; - if ((eMessageType & 0xff000000) == INSTALLMESSAGE_INFO) - log_type |= INSTALLLOGMODE_INFO; - if ((eMessageType & 0xff000000) == INSTALLMESSAGE_RESOLVESOURCE) - log_type |= INSTALLLOGMODE_RESOLVESOURCE; - if ((eMessageType & 0xff000000) == INSTALLMESSAGE_OUTOFDISKSPACE) - log_type |= INSTALLLOGMODE_OUTOFDISKSPACE; - if ((eMessageType & 0xff000000) == INSTALLMESSAGE_COMMONDATA) - log_type |= INSTALLLOGMODE_COMMONDATA; - if ((eMessageType & 0xff000000) == INSTALLMESSAGE_ACTIONSTART) - log_type |= INSTALLLOGMODE_ACTIONSTART; - if ((eMessageType & 0xff000000) == INSTALLMESSAGE_ACTIONDATA) - log_type |= INSTALLLOGMODE_ACTIONDATA; - if ((eMessageType & 0xff000000) == INSTALLMESSAGE_PROGRESS) - log_type |= INSTALLLOGMODE_PROGRESS; - if ((eMessageType & 0xff000000) == INSTALLMESSAGE_INITIALIZE) - log_type |= INSTALLLOGMODE_INITIALIZE; - if ((eMessageType & 0xff000000) == INSTALLMESSAGE_TERMINATE) - log_type |= INSTALLLOGMODE_TERMINATE; - if ((eMessageType & 0xff000000) == INSTALLMESSAGE_SHOWDIALOG) - log_type |= INSTALLLOGMODE_SHOWDIALOG; - if (!package || !record) message = NULL; else { @@ -2293,7 +2259,10 @@ static MSIRECORD *msi_get_property_row( MSIDATABASE *db, LPCWSTR name ) row = MSI_CreateRecord(1); if (!row) + { + msi_free(buffer); return NULL; + } MSI_RecordSetStringW(row, 1, buffer); msi_free(buffer); return row; @@ -2308,7 +2277,10 @@ static MSIRECORD *msi_get_property_row( MSIDATABASE *db, LPCWSTR name ) row = MSI_CreateRecord(1); if (!row) + { + msi_free(buffer); return NULL; + } MSI_RecordSetStringW(row, 1, buffer); msi_free(buffer); return row; diff --git a/dll/win32/msi/streams.c b/dll/win32/msi/streams.c index 596fa13cc8..642093e92c 100644 --- a/dll/win32/msi/streams.c +++ b/dll/win32/msi/streams.c @@ -194,28 +194,7 @@ static UINT STREAMS_insert_row(struct tagMSIVIEW *view, MSIRECORD *rec, UINT row static UINT STREAMS_delete_row(struct tagMSIVIEW *view, UINT row) { - MSIDATABASE *db = ((MSISTREAMSVIEW *)view)->db; - UINT i, num_rows = db->num_streams - 1; - const WCHAR *name; - WCHAR *encname; - HRESULT hr; - - TRACE("(%p %d)!\n", view, row); - - name = msi_string_lookup( db->strings, db->streams[row].str_index, NULL ); - if (!(encname = encode_streamname( FALSE, name ))) return ERROR_OUTOFMEMORY; - hr = IStorage_DestroyElement( db->storage, encname ); - msi_free( encname ); - if (FAILED( hr )) - return ERROR_FUNCTION_FAILED; - hr = IStream_Release( db->streams[row].stream ); - if (FAILED( hr )) - return ERROR_FUNCTION_FAILED; - - for (i = row; i < num_rows; i++) - db->streams[i] = db->streams[i + 1]; - db->num_streams = num_rows; - + FIXME("(%p %d): stub!\n", view, row); return ERROR_SUCCESS; } @@ -314,15 +293,12 @@ static UINT STREAMS_modify(struct tagMSIVIEW *view, MSIMODIFY eModifyMode, MSIRE r = streams_modify_update(view, rec); break; - case MSIMODIFY_DELETE: - r = STREAMS_delete_row(view, row - 1); - break; - case MSIMODIFY_VALIDATE_NEW: case MSIMODIFY_INSERT_TEMPORARY: case MSIMODIFY_REFRESH: case MSIMODIFY_REPLACE: case MSIMODIFY_MERGE: + case MSIMODIFY_DELETE: case MSIMODIFY_VALIDATE: case MSIMODIFY_VALIDATE_FIELD: case MSIMODIFY_VALIDATE_DELETE: diff --git a/dll/win32/msi/suminfo.c b/dll/win32/msi/suminfo.c index 99bc431c66..067483d629 100644 --- a/dll/win32/msi/suminfo.c +++ b/dll/win32/msi/suminfo.c @@ -1000,117 +1000,6 @@ end: return r; } -static UINT save_prop( MSISUMMARYINFO *si, HANDLE handle, UINT row ) -{ - static const char fmt_systemtime[] = "%d/%02d/%02d %02d:%02d:%02d"; - char data[20]; /* largest string: YYYY/MM/DD hh:mm:ss */ - static const char fmt_begin[] = "%u\t"; - static const char data_end[] = "\r\n"; - static const char fmt_int[] = "%u"; - UINT r, data_type, len; - SYSTEMTIME system_time; - FILETIME file_time; - INT int_value; - awstring str; - DWORD sz; - - str.unicode = FALSE; - str.str.a = NULL; - len = 0; - r = get_prop( si, row, &data_type, &int_value, &file_time, &str, &len ); - if (r != ERROR_SUCCESS && r != ERROR_MORE_DATA) - return r; - if (data_type == VT_EMPTY) - return ERROR_SUCCESS; /* property not set */ - snprintf( data, sizeof(data), fmt_begin, row ); - sz = lstrlenA( data ); - if (!WriteFile( handle, data, sz, &sz, NULL )) - return ERROR_WRITE_FAULT; - - switch (data_type) - { - case VT_I2: - case VT_I4: - snprintf( data, sizeof(data), fmt_int, int_value ); - sz = lstrlenA( data ); - if (!WriteFile( handle, data, sz, &sz, NULL )) - return ERROR_WRITE_FAULT; - break; - case VT_LPSTR: - len++; - if (!(str.str.a = msi_alloc( len ))) - return ERROR_OUTOFMEMORY; - r = get_prop( si, row, NULL, NULL, NULL, &str, &len ); - if (r != ERROR_SUCCESS) - { - msi_free( str.str.a ); - return r; - } - sz = lstrlenA( str.str.a ); - if (!WriteFile( handle, str.str.a, sz, &sz, NULL )) - { - msi_free( str.str.a ); - return ERROR_WRITE_FAULT; - } - msi_free( str.str.a ); - break; - case VT_FILETIME: - if (!FileTimeToSystemTime( &file_time, &system_time )) - return ERROR_FUNCTION_FAILED; - snprintf( data, sizeof(data), fmt_systemtime, system_time.wYear, system_time.wMonth, - system_time.wDay, system_time.wHour, system_time.wMinute, - system_time.wSecond ); - sz = lstrlenA( data ); - if (!WriteFile( handle, data, sz, &sz, NULL )) - return ERROR_WRITE_FAULT; - break; - case VT_EMPTY: - /* cannot reach here, property not set */ - break; - default: - FIXME( "Unknown property variant type\n" ); - return ERROR_FUNCTION_FAILED; - } - - sz = lstrlenA( data_end ); - if (!WriteFile( handle, data_end, sz, &sz, NULL )) - return ERROR_WRITE_FAULT; - - return ERROR_SUCCESS; -} - -UINT msi_export_suminfo( MSIDATABASE *db, HANDLE handle ) -{ - UINT i, r, num_rows; - MSISUMMARYINFO *si; - - r = msi_get_suminfo( db->storage, 0, &si ); - if (r != ERROR_SUCCESS) - r = msi_get_db_suminfo( db, 0, &si ); - if (r != ERROR_SUCCESS) - return r; - - num_rows = get_property_count( si->property ); - if (!num_rows) - { - msiobj_release( &si->hdr ); - return ERROR_FUNCTION_FAILED; - } - - for (i = 0; i < num_rows; i++) - { - r = save_prop( si, handle, i ); - if (r != ERROR_SUCCESS) - { - msiobj_release( &si->hdr ); - return r; - } - } - - msiobj_release( &si->hdr ); - return ERROR_SUCCESS; -} - UINT WINAPI MsiSummaryInfoPersist( MSIHANDLE handle ) { MSISUMMARYINFO *si; diff --git a/media/doc/README.WINE b/media/doc/README.WINE index 31f9c5eea2..1ed35c46fd 100644 --- a/media/doc/README.WINE +++ b/media/doc/README.WINE @@ -112,7 +112,7 @@ reactos/dll/win32/msg711.acm # Synced to WineStaging-2.9 reactos/dll/win32/msgsm32.acm # Synced to WineStaging-2.9 reactos/dll/win32/mshtml # Synced to WineStaging-1.7.55 reactos/dll/win32/mshtml.tlb # Synced to WineStaging-1.7.55 -reactos/dll/win32/msi # Synced to WineStaging-2.16 +reactos/dll/win32/msi # Synced to Wine-3.0 reactos/dll/win32/msimg32 # Synced to WineStaging-2.16 reactos/dll/win32/msimtf # Synced to WineStaging-2.9 reactos/dll/win32/msisip # Synced to WineStaging-2.9
6 years, 11 months
1
0
0
0
01/01: [IMM32_WINETEST] Sync with Wine 3.0. CORE-14225
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=35e6bb91997a18678bc34…
commit 35e6bb91997a18678bc34b0f9eba519978adf8b1 Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Sat Jan 20 12:27:53 2018 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Sat Jan 20 12:27:53 2018 +0100 [IMM32_WINETEST] Sync with Wine 3.0. CORE-14225 --- modules/rostests/winetests/imm32/imm32.c | 155 ++++++++++++++++++++++++++++++- 1 file changed, 152 insertions(+), 3 deletions(-) diff --git a/modules/rostests/winetests/imm32/imm32.c b/modules/rostests/winetests/imm32/imm32.c index b02f85d034..be3ddfce03 100644 --- a/modules/rostests/winetests/imm32/imm32.c +++ b/modules/rostests/winetests/imm32/imm32.c @@ -355,17 +355,92 @@ static void test_ImmNotifyIME(void) { } +static struct { + WNDPROC old_wnd_proc; + BOOL catch_result_str; + BOOL catch_ime_char; + DWORD start; + DWORD timer_id; +} ime_composition_test; + +static LRESULT WINAPI test_ime_wnd_proc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) +{ + switch (msg) + { + case WM_IME_COMPOSITION: + if ((lParam & GCS_RESULTSTR) && !ime_composition_test.catch_result_str) { + HWND hwndIme; + WCHAR wstring[20]; + HIMC imc; + LONG size; + LRESULT ret; + + hwndIme = ImmGetDefaultIMEWnd(hWnd); + ok(hwndIme != NULL, "expected IME window existence\n"); + + ok(!ime_composition_test.catch_ime_char, "WM_IME_CHAR is sent\n"); + ret = CallWindowProcA(ime_composition_test.old_wnd_proc, + hWnd, msg, wParam, lParam); + ok(ime_composition_test.catch_ime_char, "WM_IME_CHAR isn't sent\n"); + + ime_composition_test.catch_ime_char = FALSE; + SendMessageA(hwndIme, msg, wParam, lParam); + ok(!ime_composition_test.catch_ime_char, "WM_IME_CHAR is sent\n"); + + imc = ImmGetContext(hWnd); + size = ImmGetCompositionStringW(imc, GCS_RESULTSTR, + wstring, sizeof(wstring)); + ok(size > 0, "ImmGetCompositionString(GCS_RESULTSTR) is %d\n", size); + ImmReleaseContext(hwnd, imc); + + ime_composition_test.catch_result_str = TRUE; + return ret; + } + break; + case WM_IME_CHAR: + if (!ime_composition_test.catch_result_str) + ime_composition_test.catch_ime_char = TRUE; + break; + case WM_TIMER: + if (wParam == ime_composition_test.timer_id) { + HWND parent = GetParent(hWnd); + char title[64]; + int left = 20 - (GetTickCount() - ime_composition_test.start) / 1000; + wsprintfA(title, "%sLeft %d sec. - IME composition test", + ime_composition_test.catch_result_str ? "[*] " : "", left); + SetWindowTextA(parent, title); + if (left <= 0) + DestroyWindow(parent); + else + SetTimer(hWnd, wParam, 100, NULL); + return TRUE; + } + break; + } + return CallWindowProcA(ime_composition_test.old_wnd_proc, + hWnd, msg, wParam, lParam); +} + static void test_ImmGetCompositionString(void) { HIMC imc; static const WCHAR string[] = {'w','i','n','e',0x65e5,0x672c,0x8a9e}; char cstring[20]; WCHAR wstring[20]; - DWORD len; - DWORD alen,wlen; + LONG len; + LONG alen,wlen; + BOOL ret; + DWORD prop; imc = ImmGetContext(hwnd); - ImmSetCompositionStringW(imc, SCS_SETSTR, string, sizeof(string), NULL,0); + ret = ImmSetCompositionStringW(imc, SCS_SETSTR, string, sizeof(string), NULL,0); + if (!ret) { + win_skip("Composition isn't supported\n"); + ImmReleaseContext(hwnd, imc); + return; + } + msg_spy_flush_msgs(); + alen = ImmGetCompositionStringA(imc, GCS_COMPSTR, cstring, 20); wlen = ImmGetCompositionStringW(imc, GCS_COMPSTR, wstring, 20); /* windows machines without any IME installed just return 0 above */ @@ -376,7 +451,81 @@ static void test_ImmGetCompositionString(void) len = ImmGetCompositionStringA(imc, GCS_COMPATTR, NULL, 0); ok(len==alen,"GCS_COMPATTR(A) not returning correct count\n"); } + else + win_skip("Composition string isn't available\n"); + ImmReleaseContext(hwnd, imc); + + /* Test composition results input by IMM API */ + prop = ImmGetProperty(GetKeyboardLayout(0), IGP_SETCOMPSTR); + if (!(prop & SCS_CAP_COMPSTR)) { + /* Wine's IME doesn't support SCS_SETSTR in ImmSetCompositionString */ + skip("This IME doesn't support SCS_SETSTR\n"); + } + else { + ime_composition_test.old_wnd_proc = + (WNDPROC)SetWindowLongPtrA(hwnd, GWLP_WNDPROC, + (LONG_PTR)test_ime_wnd_proc); + imc = ImmGetContext(hwnd); + msg_spy_flush_msgs(); + + ret = ImmSetCompositionStringW(imc, SCS_SETSTR, + string, sizeof(string), NULL,0); + ok(ret, "ImmSetCompositionStringW failed\n"); + wlen = ImmGetCompositionStringW(imc, GCS_COMPSTR, + wstring, sizeof(wstring)); + if (wlen > 0) { + ret = ImmNotifyIME(imc, NI_COMPOSITIONSTR, CPS_COMPLETE, 0); + ok(ret, "ImmNotifyIME(CPS_COMPLETE) failed\n"); + msg_spy_flush_msgs(); + ok(ime_composition_test.catch_result_str, + "WM_IME_COMPOSITION(GCS_RESULTSTR) isn't sent\n"); + } + else + win_skip("Composition string isn't available\n"); + ImmReleaseContext(hwnd, imc); + SetWindowLongPtrA(hwnd, GWLP_WNDPROC, + (LONG_PTR)ime_composition_test.old_wnd_proc); + msg_spy_flush_msgs(); + } + + /* Test composition results input by hand */ + memset(&ime_composition_test, 0, sizeof(ime_composition_test)); + if (winetest_interactive) { + HWND hwndMain, hwndChild; + MSG msg; + const DWORD MY_TIMER = 0xcaffe; + + hwndMain = CreateWindowExA(WS_EX_CLIENTEDGE, wndcls, + "IME composition test", + WS_OVERLAPPEDWINDOW | WS_VISIBLE, + CW_USEDEFAULT, CW_USEDEFAULT, 320, 160, + NULL, NULL, GetModuleHandleA(NULL), NULL); + hwndChild = CreateWindowExA(0, "static", + "Input a DBCS character here using IME.", + WS_CHILD | WS_VISIBLE, + 0, 0, 320, 100, hwndMain, NULL, + GetModuleHandleA(NULL), NULL); + + ime_composition_test.old_wnd_proc = + (WNDPROC)SetWindowLongPtrA(hwndChild, GWLP_WNDPROC, + (LONG_PTR)test_ime_wnd_proc); + + SetFocus(hwndChild); + + ime_composition_test.timer_id = MY_TIMER; + ime_composition_test.start = GetTickCount(); + SetTimer(hwndChild, ime_composition_test.timer_id, 100, NULL); + while (GetMessageA(&msg, NULL, 0, 0)) { + TranslateMessage(&msg); + DispatchMessageA(&msg); + if (!IsWindow(hwndMain)) + break; + } + if (!ime_composition_test.catch_result_str) + skip("WM_IME_COMPOSITION(GCS_RESULTSTR) isn't tested\n"); + msg_spy_flush_msgs(); + } } static void test_ImmSetCompositionString(void)
6 years, 11 months
1
0
0
0
01/01: [MMDEVAPI_WINETEST] Sync with Wine 3.0. CORE-14225
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=ae5f2352bc1d441bfea93…
commit ae5f2352bc1d441bfea93a40baae910e29784ce4 Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Sat Jan 20 12:26:57 2018 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Sat Jan 20 12:26:57 2018 +0100 [MMDEVAPI_WINETEST] Sync with Wine 3.0. CORE-14225 --- modules/rostests/winetests/mmdevapi/capture.c | 4 ++-- modules/rostests/winetests/mmdevapi/render.c | 13 ++++--------- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/modules/rostests/winetests/mmdevapi/capture.c b/modules/rostests/winetests/mmdevapi/capture.c index 99da296e0a..3cdfda1a37 100644 --- a/modules/rostests/winetests/mmdevapi/capture.c +++ b/modules/rostests/winetests/mmdevapi/capture.c @@ -556,8 +556,7 @@ static void test_audioclient(void) if (hr != S_OK) { skip("Cannot initialize %08x, remainder of tests is useless\n", hr); - CoTaskMemFree(pwfx); - return; + goto cleanup; } hr = IAudioClient_GetStreamLatency(ac, NULL); @@ -592,6 +591,7 @@ static void test_audioclient(void) test_capture(ac, handle, pwfx); +cleanup: IAudioClient_Release(ac); CloseHandle(handle); CoTaskMemFree(pwfx); diff --git a/modules/rostests/winetests/mmdevapi/render.c b/modules/rostests/winetests/mmdevapi/render.c index 040ec7f587..8487fbbb92 100644 --- a/modules/rostests/winetests/mmdevapi/render.c +++ b/modules/rostests/winetests/mmdevapi/render.c @@ -320,11 +320,7 @@ static void test_audioclient(void) hr = IAudioClient_Initialize(ac, AUDCLNT_SHAREMODE_SHARED, 0, 5000000, 0, pwfx, NULL); ok(hr == S_OK, "Valid Initialize returns %08x\n", hr); if (hr != S_OK) - { - IAudioClient_Release(ac); - CoTaskMemFree(pwfx); - return; - } + goto cleanup; hr = IAudioClient_GetStreamLatency(ac, NULL); ok(hr == E_POINTER, "GetStreamLatency(NULL) call returns %08x\n", hr); @@ -369,8 +365,8 @@ static void test_audioclient(void) hr = IAudioClient_Start(ac); ok(hr == AUDCLNT_E_NOT_STOPPED, "Start twice returns %08x\n", hr); +cleanup: IAudioClient_Release(ac); - CloseHandle(handle); CoTaskMemFree(pwfx); } @@ -949,9 +945,8 @@ static void test_clock(int share) ok(gbsize == bufsize, "BufferSize %u at rate %u\n", gbsize, pwfx->nSamplesPerSec); else - todo_wine - ok(gbsize == parts * fragment || gbsize == MulDiv(bufsize, 1, 1024) * 1024, - "BufferSize %u misfits fragment size %u at rate %u\n", gbsize, fragment, pwfx->nSamplesPerSec); + ok(gbsize == parts * fragment || gbsize == MulDiv(bufsize, 1, 1024) * 1024, + "BufferSize %u misfits fragment size %u at rate %u\n", gbsize, fragment, pwfx->nSamplesPerSec); /* In shared mode, GetCurrentPadding decreases in multiples of * fragment size (i.e. updated only at period ticks), whereas
6 years, 11 months
1
0
0
0
01/01: [MMDEVAPI] Sync with Wine 3.0. CORE-14225
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=a3eb2d3811394641723cb…
commit a3eb2d3811394641723cb291fdab5c938bc46a11 Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Sat Jan 20 12:26:03 2018 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Sat Jan 20 12:26:03 2018 +0100 [MMDEVAPI] Sync with Wine 3.0. CORE-14225 --- dll/win32/mmdevapi/devenum.c | 2 +- dll/win32/mmdevapi/main.c | 10 ++++------ media/doc/README.WINE | 2 +- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/dll/win32/mmdevapi/devenum.c b/dll/win32/mmdevapi/devenum.c index e811714065..3cfe661c0f 100644 --- a/dll/win32/mmdevapi/devenum.c +++ b/dll/win32/mmdevapi/devenum.c @@ -595,7 +595,7 @@ static HRESULT WINAPI MMDevice_Activate(IMMDevice *iface, REFIID riid, DWORD cls if (SUCCEEDED(hr)) { IPersistPropertyBag *ppb; - hr = IUnknown_QueryInterface((IUnknown*)*ppv, &IID_IPersistPropertyBag, (void*)&ppb); + hr = IUnknown_QueryInterface((IUnknown*)*ppv, &IID_IPersistPropertyBag, (void **)&ppb); if (SUCCEEDED(hr)) { /* ::Load cannot assume the interface stays alive after the function returns, diff --git a/dll/win32/mmdevapi/main.c b/dll/win32/mmdevapi/main.c index 9677761356..db5a1168e1 100644 --- a/dll/win32/mmdevapi/main.c +++ b/dll/win32/mmdevapi/main.c @@ -82,20 +82,17 @@ static BOOL load_driver(const WCHAR *name, DriverFuncs *driver) return TRUE; } -static BOOL init_driver(void) +static BOOL WINAPI init_driver(INIT_ONCE *once, void *param, void **context) { static const WCHAR drv_value[] = {'A','u','d','i','o',0}; static WCHAR default_list[] = {'p','u','l','s','e',',','a','l','s','a',',','o','s','s',',', - 'c','o','r','e','a','u','d','i','o',0}; + 'c','o','r','e','a','u','d','i','o',',','a','n','d','r','o','i','d',0}; DriverFuncs driver; HKEY key; WCHAR reg_list[256], *p, *next, *driver_list = default_list; - if(drvs.module) - return TRUE; - if(RegOpenKeyW(HKEY_CURRENT_USER, drv_keyW, &key) == ERROR_SUCCESS){ DWORD size = sizeof(reg_list); @@ -249,10 +246,11 @@ static IClassFactoryImpl MMDEVAPI_CF[] = { HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv) { + static INIT_ONCE init_once = INIT_ONCE_STATIC_INIT; unsigned int i = 0; TRACE("(%s, %s, %p)\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv); - if(!init_driver()){ + if(!InitOnceExecuteOnce(&init_once, init_driver, NULL, NULL)) { ERR("Driver initialization failed\n"); return E_FAIL; } diff --git a/media/doc/README.WINE b/media/doc/README.WINE index 6a0bf58c51..31f9c5eea2 100644 --- a/media/doc/README.WINE +++ b/media/doc/README.WINE @@ -97,7 +97,7 @@ reactos/dll/win32/mciseq # Synced to WineStaging-2.9 reactos/dll/win32/mciwave # Synced to WineStaging-2.9 reactos/dll/win32/mgmtapi # Synced to WineStaging-2.9 reactos/dll/win32/mlang # Synced to Wine-3.0 -reactos/dll/win32/mmdevapi # Synced to WineStaging-1.9.23 +reactos/dll/win32/mmdevapi # Synced to Wine-3.0 reactos/dll/win32/mpr # Synced to Wine-3.0 reactos/dll/win32/mprapi # Synced to WineStaging-2.9 reactos/dll/win32/msacm32 # Synced to WineStaging-2.16
6 years, 11 months
1
0
0
0
01/01: [USP10_WINETEST] Sync with Wine 3.0. CORE-14225
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=eeff44827547d276ddb00…
commit eeff44827547d276ddb00325265d4eee547d1113 Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Sat Jan 20 12:23:22 2018 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Sat Jan 20 12:23:22 2018 +0100 [USP10_WINETEST] Sync with Wine 3.0. CORE-14225 --- modules/rostests/winetests/usp10/usp10.c | 262 ++++++++++++++++++++++--------- 1 file changed, 187 insertions(+), 75 deletions(-) diff --git a/modules/rostests/winetests/usp10/usp10.c b/modules/rostests/winetests/usp10/usp10.c index 727201e58e..417d0b8888 100644 --- a/modules/rostests/winetests/usp10/usp10.c +++ b/modules/rostests/winetests/usp10/usp10.c @@ -56,13 +56,16 @@ typedef struct _shapeTest_glyph { SCRIPT_GLYPHPROP GlyphProp; } shapeTest_glyph; +typedef struct _font_fingerprint { + WCHAR check[10]; + WORD result[10]; +} font_fingerprint; + /* Uniscribe 1.6 calls */ static HRESULT (WINAPI *pScriptItemizeOpenType)( const WCHAR *pwcInChars, int cInChars, int cMaxItems, const SCRIPT_CONTROL *psControl, const SCRIPT_STATE *psState, SCRIPT_ITEM *pItems, ULONG *pScriptTags, int *pcItems); static HRESULT (WINAPI *pScriptShapeOpenType)( HDC hdc, SCRIPT_CACHE *psc, SCRIPT_ANALYSIS *psa, OPENTYPE_TAG tagScript, OPENTYPE_TAG tagLangSys, int *rcRangeChars, TEXTRANGE_PROPERTIES **rpRangeProperties, int cRanges, const WCHAR *pwcChars, int cChars, int cMaxGlyphs, WORD *pwLogClust, SCRIPT_CHARPROP *pCharProps, WORD *pwOutGlyphs, SCRIPT_GLYPHPROP *pOutGlyphProps, int *pcGlyphs); -static DWORD (WINAPI *pGetGlyphIndicesW)(HDC hdc, LPCWSTR lpstr, INT count, LPWORD pgi, DWORD flags); - static HRESULT (WINAPI *pScriptGetFontScriptTags)( HDC hdc, SCRIPT_CACHE *psc, SCRIPT_ANALYSIS *psa, int cMaxTags, OPENTYPE_TAG *pScriptTags, int *pcTags); static HRESULT (WINAPI *pScriptGetFontLanguageTags)( HDC hdc, SCRIPT_CACHE *psc, SCRIPT_ANALYSIS *psa, OPENTYPE_TAG tagScript, int cMaxTags, OPENTYPE_TAG *pLangSysTags, int *pcTags); static HRESULT (WINAPI *pScriptGetFontFeatureTags)( HDC hdc, SCRIPT_CACHE *psc, SCRIPT_ANALYSIS *psa, OPENTYPE_TAG tagScript, OPENTYPE_TAG tagLangSys, int cMaxTags, OPENTYPE_TAG *pFeatureTags, int *pcTags); @@ -601,15 +604,8 @@ static void test_ScriptItemize( void ) SCRIPT_CONTROL Control; SCRIPT_STATE State; HRESULT hr; - HMODULE usp10; int nItems; - usp10 = LoadLibraryA("usp10.dll"); - ok (usp10 != 0,"Unable to LoadLibrary on usp10.dll\n"); - pScriptItemizeOpenType = (void*)GetProcAddress(usp10, "ScriptItemizeOpenType"); - pScriptShapeOpenType = (void*)GetProcAddress(usp10, "ScriptShapeOpenType"); - pGetGlyphIndicesW = (void*)GetProcAddress(GetModuleHandleA("gdi32.dll"), "GetGlyphIndicesW"); - memset(&Control, 0, sizeof(Control)); memset(&State, 0, sizeof(State)); @@ -995,14 +991,6 @@ static inline void _test_shape_ok(int valid, HDC hdc, LPCWSTR string, winetest_ok(SUCCEEDED(hr), "Failed to get script properties, hr %#x.\n", hr); hr = pScriptItemizeOpenType(string, cchString, 15, Control, State, outpItems, tags, &outnItems); - if (hr == USP_E_SCRIPT_NOT_IN_FONT) - { - if (valid > 0) - winetest_win_skip("Select font does not support script\n"); - else - winetest_trace("Select font does not support script\n"); - return; - } if (valid > 0) winetest_ok(hr == S_OK, "ScriptItemizeOpenType should return S_OK not %08x\n", hr); else if (hr != S_OK) @@ -1286,7 +1274,7 @@ static int CALLBACK enumFontProc( const LOGFONTA *lpelfe, const TEXTMETRICA *lpn return 1; } -static int _find_font_for_range(HDC hdc, const CHAR *recommended, BYTE range, const WCHAR check, HFONT *hfont, HFONT *origFont) +static int _find_font_for_range(HDC hdc, const CHAR *recommended, BYTE range, const WCHAR check, HFONT *hfont, HFONT *origFont, const font_fingerprint *fingerprint) { int rc = 0; fontEnumParam lParam; @@ -1304,7 +1292,26 @@ static int _find_font_for_range(HDC hdc, const CHAR *recommended, BYTE range, co if (*hfont) { winetest_trace("using font %s\n",lParam.lf.lfFaceName); - rc = 1; + *origFont = SelectObject(hdc,*hfont); + if (fingerprint) + { + WORD output[10]; + int i; + if (GetGlyphIndicesW(hdc, fingerprint->check, 10, output, 0) != GDI_ERROR) + { + for (i=0; i < 10; i++) + if (output[i] != fingerprint->result[i]) + { + winetest_trace("found font does not match fingerprint\n"); + SelectObject(hdc,*origFont); + DeleteObject(*hfont); + *hfont = NULL; + break; + } + if (i == 10) rc = 1; + } + } + else rc = 1; } } if (!rc) @@ -1329,7 +1336,7 @@ static int _find_font_for_range(HDC hdc, const CHAR *recommended, BYTE range, co WORD glyph = 0; *origFont = SelectObject(hdc,*hfont); - if (pGetGlyphIndicesW && (pGetGlyphIndicesW(hdc, &check, 1, &glyph, 0) == GDI_ERROR || glyph ==0)) + if (GetGlyphIndicesW(hdc, &check, 1, &glyph, 0) == GDI_ERROR || glyph == 0) { winetest_trace(" Font fails to contain required glyphs\n"); SelectObject(hdc,*origFont); @@ -1346,7 +1353,7 @@ static int _find_font_for_range(HDC hdc, const CHAR *recommended, BYTE range, co return rc; } -#define find_font_for_range(a,b,c,d,e,f) (winetest_set_location(__FILE__,__LINE__), 0) ? 0 : _find_font_for_range(a,b,c,d,e,f) +#define find_font_for_range(a,b,c,d,e,f,g) (winetest_set_location(__FILE__,__LINE__), 0) ? 0 : _find_font_for_range(a,b,c,d,e,f,g) static void test_ScriptShapeOpenType(HDC hdc) { @@ -1628,6 +1635,11 @@ static void test_ScriptShapeOpenType(HDC hdc) {1,{{SCRIPT_JUSTIFY_NONE,1,0,0,0,0},0}}, {1,{{SCRIPT_JUSTIFY_NONE,0,0,0,0,0},0}} }; + static const font_fingerprint fingerprint_estrangelo = { + {'A','a','B','b','C','c','D','d',0,0}, + {284,310,285,311,286,312,287,313,0,0}}; + + if (!pScriptItemizeOpenType || !pScriptShapeOpenType) { win_skip("ScriptShapeOpenType not available on this platform\n"); @@ -1670,7 +1682,7 @@ static void test_ScriptShapeOpenType(HDC hdc) test_shape_ok(hdc, test2, 4, &Control, &State, 1, 4, t2_c, glyph_test); - test_valid = find_font_for_range(hdc, "Calibri", 0, test3[0], &hfont, &hfont_orig); + test_valid = find_font_for_range(hdc, "Calibri", 0, test3[0], &hfont, &hfont_orig, NULL); if (hfont != NULL) { test_shape_ok_valid(test_valid, hdc, test3, 6, &Control, &State, 0, 2, t3_c, t3_g); @@ -1678,7 +1690,7 @@ static void test_ScriptShapeOpenType(HDC hdc) DeleteObject(hfont); } - test_valid = find_font_for_range(hdc, "Microsoft Sans Serif", 11, test_hebrew[0], &hfont, &hfont_orig); + test_valid = find_font_for_range(hdc, "Microsoft Sans Serif", 11, test_hebrew[0], &hfont, &hfont_orig, NULL); if (hfont != NULL) { test_shape_ok_valid(test_valid, hdc, test_hebrew, 4, &Control, &State, 0, 4, hebrew_c, hebrew_g); @@ -1686,7 +1698,7 @@ static void test_ScriptShapeOpenType(HDC hdc) DeleteObject(hfont); } - test_valid = find_font_for_range(hdc, "Microsoft Sans Serif", 13, test_arabic[0], &hfont, &hfont_orig); + test_valid = find_font_for_range(hdc, "Microsoft Sans Serif", 13, test_arabic[0], &hfont, &hfont_orig, NULL); if (hfont != NULL) { test_shape_ok_valid(test_valid, hdc, test_arabic, 4, &Control, &State, 0, 3, arabic_c, arabic_g); @@ -1694,7 +1706,7 @@ static void test_ScriptShapeOpenType(HDC hdc) DeleteObject(hfont); } - test_valid = find_font_for_range(hdc, "Microsoft Sans Serif", 24, test_thai[0], &hfont, &hfont_orig); + test_valid = find_font_for_range(hdc, "Microsoft Sans Serif", 24, test_thai[0], &hfont, &hfont_orig, NULL); if (hfont != NULL) { test_shape_ok_valid(test_valid, hdc, test_thai, 10, &Control, &State, 0, 10, thai_c, thai_g); @@ -1702,7 +1714,7 @@ static void test_ScriptShapeOpenType(HDC hdc) DeleteObject(hfont); } - test_valid = find_font_for_range(hdc, "Estrangelo Edessa", 71, test_syriac[0], &hfont, &hfont_orig); + test_valid = find_font_for_range(hdc, "Estrangelo Edessa", 71, test_syriac[0], &hfont, &hfont_orig, &fingerprint_estrangelo); if (hfont != NULL) { test_shape_ok_valid(test_valid, hdc, test_syriac, 8, &Control, &State, 0, 7, syriac_c, syriac_g); @@ -1710,7 +1722,7 @@ static void test_ScriptShapeOpenType(HDC hdc) DeleteObject(hfont); } - test_valid = find_font_for_range(hdc, "MV Boli", 72, test_thaana[0], &hfont, &hfont_orig); + test_valid = find_font_for_range(hdc, "MV Boli", 72, test_thaana[0], &hfont, &hfont_orig, NULL); if (hfont != NULL) { test_shape_ok_valid(test_valid, hdc, test_thaana, 13, &Control, &State, 0, 13, thaana_c, thaana_g); @@ -1718,7 +1730,7 @@ static void test_ScriptShapeOpenType(HDC hdc) DeleteObject(hfont); } - test_valid = find_font_for_range(hdc, "Microsoft PhagsPa", 53, test_phagspa[0], &hfont, &hfont_orig); + test_valid = find_font_for_range(hdc, "Microsoft PhagsPa", 53, test_phagspa[0], &hfont, &hfont_orig, NULL); if (hfont != NULL) { test_shape_ok_valid_props2(test_valid, hdc, test_phagspa, 11, &Control, &State, 0, 11, @@ -1727,7 +1739,7 @@ static void test_ScriptShapeOpenType(HDC hdc) DeleteObject(hfont); } - test_valid = find_font_for_range(hdc, "DokChampa", 25, test_lao[0], &hfont, &hfont_orig); + test_valid = find_font_for_range(hdc, "DokChampa", 25, test_lao[0], &hfont, &hfont_orig, NULL); if (hfont != NULL) { test_shape_ok_valid(test_valid, hdc, test_lao, 9, &Control, &State, 0, 9, lao_c, lao_g); @@ -1735,7 +1747,7 @@ static void test_ScriptShapeOpenType(HDC hdc) DeleteObject(hfont); } - test_valid = find_font_for_range(hdc, "Microsoft Himalaya", 70, test_tibetan[0], &hfont, &hfont_orig); + test_valid = find_font_for_range(hdc, "Microsoft Himalaya", 70, test_tibetan[0], &hfont, &hfont_orig, NULL); if (hfont != NULL) { test_shape_ok_valid_props2(test_valid, hdc, test_tibetan, 17, &Control, &State, 0, 17, @@ -1744,7 +1756,7 @@ static void test_ScriptShapeOpenType(HDC hdc) DeleteObject(hfont); } - test_valid = find_font_for_range(hdc, "Mangal", 15, test_devanagari[0], &hfont, &hfont_orig); + test_valid = find_font_for_range(hdc, "Mangal", 15, test_devanagari[0], &hfont, &hfont_orig, NULL); if (hfont != NULL) { test_shape_ok_valid(test_valid, hdc, test_devanagari, 8, &Control, &State, 0, 8, devanagari_c, devanagari_g); @@ -1752,7 +1764,7 @@ static void test_ScriptShapeOpenType(HDC hdc) DeleteObject(hfont); } - test_valid = find_font_for_range(hdc, "Vrinda", 16, test_bengali[0], &hfont, &hfont_orig); + test_valid = find_font_for_range(hdc, "Vrinda", 16, test_bengali[0], &hfont, &hfont_orig, NULL); if (hfont != NULL) { test_shape_ok_valid(test_valid, hdc, test_bengali, 5, &Control, &State, 0, 5, bengali_c, bengali_g); @@ -1760,7 +1772,7 @@ static void test_ScriptShapeOpenType(HDC hdc) DeleteObject(hfont); } - test_valid = find_font_for_range(hdc, "Raavi", 17, test_gurmukhi[0], &hfont, &hfont_orig); + test_valid = find_font_for_range(hdc, "Raavi", 17, test_gurmukhi[0], &hfont, &hfont_orig, NULL); if (hfont != NULL) { test_shape_ok_valid(test_valid, hdc, test_gurmukhi, 7, &Control, &State, 0, 7, gurmukhi_c, gurmukhi_g); @@ -1768,7 +1780,7 @@ static void test_ScriptShapeOpenType(HDC hdc) DeleteObject(hfont); } - test_valid = find_font_for_range(hdc, "Shruti", 18, test_gujarati[0], &hfont, &hfont_orig); + test_valid = find_font_for_range(hdc, "Shruti", 18, test_gujarati[0], &hfont, &hfont_orig, NULL); if (hfont != NULL) { test_shape_ok_valid(test_valid, hdc, test_gujarati, 7, &Control, &State, 0, 7, gujarati_c, gujarati_g); @@ -1776,7 +1788,7 @@ static void test_ScriptShapeOpenType(HDC hdc) DeleteObject(hfont); } - test_valid = find_font_for_range(hdc, "Kalinga", 19, test_oriya[0], &hfont, &hfont_orig); + test_valid = find_font_for_range(hdc, "Kalinga", 19, test_oriya[0], &hfont, &hfont_orig, NULL); if (hfont != NULL) { test_shape_ok_valid(test_valid, hdc, test_oriya, 5, &Control, &State, 0, 4, oriya_c, oriya_g); @@ -1784,7 +1796,7 @@ static void test_ScriptShapeOpenType(HDC hdc) DeleteObject(hfont); } - test_valid = find_font_for_range(hdc, "Latha", 20, test_tamil[0], &hfont, &hfont_orig); + test_valid = find_font_for_range(hdc, "Latha", 20, test_tamil[0], &hfont, &hfont_orig, NULL); if (hfont != NULL) { test_shape_ok_valid(test_valid, hdc, test_tamil, 5, &Control, &State, 0, 4, tamil_c, tamil_g); @@ -1792,7 +1804,7 @@ static void test_ScriptShapeOpenType(HDC hdc) DeleteObject(hfont); } - test_valid = find_font_for_range(hdc, "Gautami", 21, test_telugu[0], &hfont, &hfont_orig); + test_valid = find_font_for_range(hdc, "Gautami", 21, test_telugu[0], &hfont, &hfont_orig, NULL); if (hfont != NULL) { test_shape_ok_valid(test_valid, hdc, test_telugu, 6, &Control, &State, 0, 6, telugu_c, telugu_g); @@ -1800,7 +1812,7 @@ static void test_ScriptShapeOpenType(HDC hdc) DeleteObject(hfont); } - test_valid = find_font_for_range(hdc, "Kartika", 23, test_malayalam[0], &hfont, &hfont_orig); + test_valid = find_font_for_range(hdc, "Kartika", 23, test_malayalam[0], &hfont, &hfont_orig, NULL); if (hfont != NULL) { test_shape_ok_valid(test_valid, hdc, test_malayalam, 6, &Control, &State, 0, 6, malayalam_c, malayalam_g); @@ -1808,7 +1820,7 @@ static void test_ScriptShapeOpenType(HDC hdc) DeleteObject(hfont); } - test_valid = find_font_for_range(hdc, "Tunga", 22, test_kannada[0], &hfont, &hfont_orig); + test_valid = find_font_for_range(hdc, "Tunga", 22, test_kannada[0], &hfont, &hfont_orig, NULL); if (hfont != NULL) { test_shape_ok_valid(test_valid, hdc, test_kannada, 5, &Control, &State, 0, 4, kannada_c, kannada_g); @@ -1821,6 +1833,7 @@ static void test_ScriptShape(HDC hdc) { static const WCHAR test1[] = {'w', 'i', 'n', 'e',0}; static const WCHAR test2[] = {0x202B, 'i', 'n', 0x202C,0}; + static const WCHAR test3[] = {0x30b7}; HRESULT hr; SCRIPT_CACHE sc = NULL; WORD glyphs[4], glyphs2[4], logclust[4], glyphs3[4]; @@ -2052,6 +2065,23 @@ static void test_ScriptShape(HDC hdc) DeleteObject(SelectObject(hdc, oldfont)); ScriptFreeCache(&sc); } + + /* Text does not support this range. */ + memset(items, 0, sizeof(items)); + nb = 0; + hr = ScriptItemize(test3, sizeof(test3)/sizeof(test3[0]), sizeof(items)/sizeof(items[0]), NULL, NULL, items, &nb); + ok(hr == S_OK, "ScriptItemize failed, hr %#x.\n", hr); + ok(items[0].a.eScript > 0, "Expected script id.\n"); + ok(nb == 1, "Unexpected number of items.\n"); + + memset(glyphs, 0xff, sizeof(glyphs)); + nb = 0; + hr = ScriptShape(hdc, &sc, test3, sizeof(test3)/sizeof(test3[0]), sizeof(glyphs)/sizeof(glyphs[0]), &items[0].a, + glyphs, logclust, attrs, &nb); + ok(hr == S_OK, "ScriptShape failed, hr %#x.\n", hr); + ok(nb == 1, "Unexpected glyph count %u\n", nb); + ok(glyphs[0] == 0, "Unexpected glyph id\n"); + ScriptFreeCache(&sc); } static void test_ScriptPlace(HDC hdc) @@ -2517,6 +2547,7 @@ static void test_ScriptGetFontProperties(HDC hdc) hr = ScriptGetFontProperties(hdc,&psc,&sfp); ok( hr == E_INVALIDARG, "(hdc,&psc,&sfp) invalid, expected E_INVALIDARG, got %08x\n", hr); ok( psc != NULL, "Expected a pointer in psc, got NULL\n"); + ok( sfp.cBytes == sizeof(SCRIPT_FONTPROPERTIES) - 1, "Unexpected cBytes.\n"); ScriptFreeCache(&psc); ok( psc == NULL, "Expected psc to be NULL, got %p\n", psc); @@ -2536,12 +2567,6 @@ static void test_ScriptGetFontProperties(HDC hdc) ScriptFreeCache(&psc); ok( psc == NULL, "Expected psc to be NULL, got %p\n", psc); - pGetGlyphIndicesW = (void*)GetProcAddress(GetModuleHandleA("gdi32.dll"), "GetGlyphIndicesW"); - if (!pGetGlyphIndicesW) - { - win_skip("Skip on WINNT4\n"); - return; - } memset(&lf, 0, sizeof(lf)); lf.lfCharSet = DEFAULT_CHARSET; efnd.total = 0; @@ -2575,7 +2600,7 @@ static void test_ScriptGetFontProperties(HDC hdc) ret = GetTextMetricsA(hdc, &tmA); ok(ret != 0, "GetTextMetricsA failed!\n"); - ret = pGetGlyphIndicesW(hdc, invalids, 1, gi, GGI_MARK_NONEXISTING_GLYPHS); + ret = GetGlyphIndicesW(hdc, invalids, 1, gi, GGI_MARK_NONEXISTING_GLYPHS); ok(ret != GDI_ERROR, "GetGlyphIndicesW failed!\n"); ok(sfp.wgBlank == tmA.tmBreakChar || sfp.wgBlank == gi[0], "bitmap font %s wgBlank %04x tmBreakChar %04x Space %04x\n", lf.lfFaceName, sfp.wgBlank, tmA.tmBreakChar, gi[0]); @@ -2621,13 +2646,13 @@ static void test_ScriptGetFontProperties(HDC hdc) } str[0] = 0x0020; /* U+0020: numeric space */ - ret = pGetGlyphIndicesW(hdc, str, 1, gi, 0); + ret = GetGlyphIndicesW(hdc, str, 1, gi, 0); ok(ret != GDI_ERROR, "GetGlyphIndicesW failed!\n"); ok(sfp.wgBlank == gi[0], "truetype font %s wgBlank %04x gi[0] %04x\n", lf.lfFaceName, sfp.wgBlank, gi[0]); ok(sfp.wgDefault == 0 || broken(is_arabic), "truetype font %s wgDefault %04x\n", lf.lfFaceName, sfp.wgDefault); - ret = pGetGlyphIndicesW(hdc, invalids, 3, gi, GGI_MARK_NONEXISTING_GLYPHS); + ret = GetGlyphIndicesW(hdc, invalids, 3, gi, GGI_MARK_NONEXISTING_GLYPHS); ok(ret != GDI_ERROR, "GetGlyphIndicesW failed!\n"); if (gi[2] != 0xFFFF) /* index of default non exist char */ ok(sfp.wgInvalid == gi[2], "truetype font %s wgInvalid %04x gi[2] %04x\n", lf.lfFaceName, sfp.wgInvalid, gi[2]); @@ -2639,7 +2664,7 @@ static void test_ScriptGetFontProperties(HDC hdc) ok(sfp.wgInvalid == 0, "truetype font %s wgInvalid %04x expect 0\n", lf.lfFaceName, sfp.wgInvalid); str[0] = 0x0640; /* U+0640: kashida */ - ret = pGetGlyphIndicesW(hdc, str, 1, gi, GGI_MARK_NONEXISTING_GLYPHS); + ret = GetGlyphIndicesW(hdc, str, 1, gi, GGI_MARK_NONEXISTING_GLYPHS); ok(ret != GDI_ERROR, "GetGlyphIndicesW failed!\n"); is_arial = !lstrcmpA(lf.lfFaceName, "Arial"); is_times_new_roman= !lstrcmpA(lf.lfFaceName, "Times New Roman"); @@ -3128,6 +3153,7 @@ static void test_ScriptXtoX(void) WORD clust = 0; INT advance = 16; hr = ScriptXtoCP(iX, 1, 1, &clust, psva, &advance, &sa, &piCP, &piTrailing); + ok(hr == S_OK, "ScriptXtoCP() failed, hr %#x.\n", hr); ok(piCP==0 && piTrailing==1,"%i should return 0(%i) and 1(%i)\n",iX,piCP,piTrailing); } for (iX = 9; iX < 16; iX++) @@ -3135,6 +3161,7 @@ static void test_ScriptXtoX(void) WORD clust = 0; INT advance = 16; hr = ScriptXtoCP(iX, 1, 1, &clust, psva, &advance, &sa, &piCP, &piTrailing); + ok(hr == S_OK, "ScriptXtoCP() failed, hr %#x.\n", hr); ok(piCP==0 && piTrailing==0,"%i should return 0(%i) and 0(%i)\n",iX,piCP,piTrailing); } @@ -3180,7 +3207,7 @@ static void test_ScriptString(HDC hdc) * This set of tests are for the string functions of uniscribe. The ScriptStringAnalyse * function allocates memory pointed to by the SCRIPT_STRING_ANALYSIS ssa pointer. This * memory is freed by ScriptStringFree. There needs to be a valid hdc for this as - * ScriptStringAnalyse calls ScriptSItemize, ScriptShape and ScriptPlace which require it. + * ScriptStringAnalyse calls ScriptItemize, ScriptShape and ScriptPlace which require it. * */ @@ -3448,11 +3475,27 @@ static void test_ScriptStringXtoCP_CPtoX(HDC hdc) } } +static HWND create_test_window(void) +{ + HWND hwnd = CreateWindowExA(0, "Static", "", WS_POPUP, 0, 0, 100, 100, 0, 0, 0, NULL); + ok(hwnd != NULL, "Failed to create test window.\n"); + + ShowWindow(hwnd, SW_SHOW); + UpdateWindow(hwnd); + + return hwnd; +} + static void test_ScriptCacheGetHeight(HDC hdc) { - HRESULT hr; + HFONT hfont, prev_hfont; SCRIPT_CACHE sc = NULL; - LONG height; + LONG height, height2; + TEXTMETRICW tm; + LOGFONTA lf; + HRESULT hr; + HWND hwnd; + HDC hdc2; hr = ScriptCacheGetHeight(NULL, NULL, NULL); ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got 0x%08x\n", hr); @@ -3463,11 +3506,54 @@ static void test_ScriptCacheGetHeight(HDC hdc) hr = ScriptCacheGetHeight(NULL, &sc, &height); ok(hr == E_PENDING, "expected E_PENDING, got 0x%08x\n", hr); - height = 0; + height = 123; + hr = ScriptCacheGetHeight(hdc, NULL, &height); + ok(hr == E_INVALIDARG, "Uexpected hr %#x.\n", hr); + ok(height == 123, "Unexpected height.\n"); + + memset(&tm, 0, sizeof(tm)); + GetTextMetricsW(hdc, &tm); + ok(tm.tmHeight > 0, "Unexpected tmHeight %u.\n", tm.tmHeight); + height = 0; hr = ScriptCacheGetHeight(hdc, &sc, &height); ok(hr == S_OK, "expected S_OK, got 0x%08x\n", hr); - ok(height > 0, "expected height > 0\n"); + ok(height == tm.tmHeight, "expected height > 0\n"); + + /* Try again with NULL dc. */ + height2 = 0; + hr = ScriptCacheGetHeight(NULL, &sc, &height2); + ok(hr == S_OK, "Failed to get cached height, hr %#x.\n", hr); + ok(height2 == height, "Unexpected height %u.\n", height2); + + hwnd = create_test_window(); + + hdc2 = GetDC(hwnd); + ok(hdc2 != NULL, "Failed to get window dc.\n"); + + memset(&lf, 0, sizeof(LOGFONTA)); + lstrcpyA(lf.lfFaceName, "Tahoma"); + lf.lfHeight = -32; + + hfont = CreateFontIndirectA(&lf); + ok(hfont != NULL, "Failed to create font.\n"); + + prev_hfont = SelectObject(hdc2, hfont); + + memset(&tm, 0, sizeof(tm)); + GetTextMetricsW(hdc2, &tm); + ok(tm.tmHeight > height, "Unexpected tmHeight %u.\n", tm.tmHeight); + + height2 = 0; + hr = ScriptCacheGetHeight(hdc2, &sc, &height2); + ok(hr == S_OK, "Failed to get cached height, hr %#x.\n", hr); + ok(height2 == height, "Unexpected height.\n"); + + SelectObject(hdc2, prev_hfont); + DeleteObject(hfont); + + ReleaseDC(hwnd, hdc2); + DestroyWindow(hwnd); ScriptFreeCache(&sc); } @@ -3647,27 +3733,10 @@ static void test_digit_substitution(void) LGRPID_GEORGIAN, LGRPID_ARMENIAN }; - HMODULE hKernel32; - static BOOL (WINAPI * pEnumLanguageGroupLocalesA)(LANGGROUPLOCALE_ENUMPROCA,LGRPID,DWORD,LONG_PTR); - - hKernel32 = GetModuleHandleA("kernel32.dll"); - pEnumLanguageGroupLocalesA = (void*)GetProcAddress(hKernel32, "EnumLanguageGroupLocalesA"); - - if (!pEnumLanguageGroupLocalesA) - { - win_skip("EnumLanguageGroupLocalesA not available on this platform\n"); - return; - } for (i = 0; i < sizeof(groups)/sizeof(groups[0]); i++) { - ret = pEnumLanguageGroupLocalesA(enum_proc, groups[i], 0, 0); - if (!ret && GetLastError() == ERROR_CALL_NOT_IMPLEMENTED) - { - win_skip("EnumLanguageGroupLocalesA not implemented on this platform\n"); - break; - } - + ret = EnumLanguageGroupLocalesA(enum_proc, groups[i], 0, 0); ok(ret, "EnumLanguageGroupLocalesA failed unexpectedly: %u\n", GetLastError()); } } @@ -3788,9 +3857,6 @@ static void test_newlines(void) static void test_ScriptGetFontFunctions(HDC hdc) { HRESULT hr; - pScriptGetFontScriptTags = (void*)GetProcAddress(GetModuleHandleA("usp10.dll"), "ScriptGetFontScriptTags"); - pScriptGetFontLanguageTags = (void*)GetProcAddress(GetModuleHandleA("usp10.dll"), "ScriptGetFontLanguageTags"); - pScriptGetFontFeatureTags = (void*)GetProcAddress(GetModuleHandleA("usp10.dll"), "ScriptGetFontFeatureTags"); if (!pScriptGetFontScriptTags || !pScriptGetFontLanguageTags || !pScriptGetFontFeatureTags) { win_skip("ScriptGetFontScriptTags,ScriptGetFontLanguageTags or ScriptGetFontFeatureTags not available on this platform\n"); @@ -4016,6 +4082,49 @@ static void test_ScriptIsComplex(void) ok(hr == S_FALSE, "got 0x%08x\n", hr); } +static void test_ScriptString_pSize(HDC hdc) +{ + static const WCHAR textW[] = {'A',0}; + SCRIPT_STRING_ANALYSIS ssa; + const SIZE *size; + TEXTMETRICW tm; + HRESULT hr; + ABC abc; + + hr = ScriptStringAnalyse(hdc, textW, 1, 16, -1, SSA_GLYPHS, 0, NULL, NULL, NULL, NULL, NULL, &ssa); + ok(hr == S_OK, "ScriptStringAnalyse failed, hr %#x.\n", hr); + + size = ScriptString_pSize(NULL); + ok(size == NULL || broken(size != NULL) /* <win7 */, "Unexpected size pointer.\n"); + + GetCharABCWidthsW(hdc, textW[0], textW[0], &abc); + + memset(&tm, 0, sizeof(tm)); + GetTextMetricsW(hdc, &tm); + ok(tm.tmHeight > 0, "Unexpected tmHeight.\n"); + + size = ScriptString_pSize(ssa); + ok(size != NULL, "Unexpected size pointer.\n"); + ok(size->cx == abc.abcA + abc.abcB + abc.abcC, "Unexpected cx size %d.\n", size->cx); + ok(size->cy == tm.tmHeight, "Unexpected cy size %d.\n", size->cy); + + hr = ScriptStringFree(&ssa); + ok(hr == S_OK, "Failed to free ssa, hr %#x.\n", hr); +} + +static void init_tests(void) +{ + HMODULE module = GetModuleHandleA("usp10.dll"); + + ok(module != 0, "Expected usp10.dll to be loaded.\n"); + + pScriptItemizeOpenType = (void *)GetProcAddress(module, "ScriptItemizeOpenType"); + pScriptShapeOpenType = (void *)GetProcAddress(module, "ScriptShapeOpenType"); + pScriptGetFontScriptTags = (void *)GetProcAddress(module, "ScriptGetFontScriptTags"); + pScriptGetFontLanguageTags = (void *)GetProcAddress(module, "ScriptGetFontLanguageTags"); + pScriptGetFontFeatureTags = (void *)GetProcAddress(module, "ScriptGetFontFeatureTags"); +} + START_TEST(usp10) { HWND hwnd; @@ -4045,6 +4154,8 @@ START_TEST(usp10) hfont = SelectObject(hdc, CreateFontIndirectA(&lf)); ok(hfont != NULL, "SelectObject failed: %p\n", hfont); + init_tests(); + test_ScriptItemize(); test_ScriptItemize_surrogates(); test_ScriptItemIzeShapePlace(hdc,pwOutGlyphs); @@ -4062,6 +4173,7 @@ START_TEST(usp10) test_ScriptXtoX(); test_ScriptString(hdc); test_ScriptStringXtoCP_CPtoX(hdc); + test_ScriptString_pSize(hdc); test_ScriptLayout(); test_digit_substitution();
6 years, 11 months
1
0
0
0
01/01: [USP10] Sync with Wine 3.0. CORE-14225
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=cea8085626e4e4d408274…
commit cea8085626e4e4d4082747b05f6019c973c65794 Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Sat Jan 20 12:16:49 2018 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Sat Jan 20 12:17:14 2018 +0100 [USP10] Sync with Wine 3.0. CORE-14225 --- dll/win32/usp10/opentype.c | 2 +- dll/win32/usp10/usp10.c | 75 ++++++++++++++++++++++------------------------ media/doc/README.WINE | 2 +- 3 files changed, 37 insertions(+), 42 deletions(-) diff --git a/dll/win32/usp10/opentype.c b/dll/win32/usp10/opentype.c index 018813d9ef..9b7827af65 100644 --- a/dll/win32/usp10/opentype.c +++ b/dll/win32/usp10/opentype.c @@ -2041,7 +2041,7 @@ static void GPOS_apply_MarkToLigature(const OT_LookupTable *look, const SCRIPT_A } if (!offset) { - ERR("Failed to find avalible ligature connection point\n"); + ERR("Failed to find available ligature connection point\n"); return; } diff --git a/dll/win32/usp10/usp10.c b/dll/win32/usp10/usp10.c index 89e85dffa9..058fc6f368 100644 --- a/dll/win32/usp10/usp10.c +++ b/dll/win32/usp10/usp10.c @@ -672,15 +672,21 @@ typedef struct { int* piAdvance; SCRIPT_VISATTR* psva; GOFFSET* pGoffset; - ABC* abc; + ABC abc; int iMaxPosX; HFONT fallbackFont; } StringGlyphs; +enum stringanalysis_flags +{ + SCRIPT_STRING_ANALYSIS_FLAGS_SIZE = 0x1, + SCRIPT_STRING_ANALYSIS_FLAGS_INVALID = 0x2, +}; + typedef struct { HDC hdc; - DWORD dwFlags; - BOOL invalid; + DWORD ssa_flags; + DWORD flags; int clip_len; int cItems; int cMaxGlyphs; @@ -688,7 +694,7 @@ typedef struct { int numItems; StringGlyphs* glyphs; SCRIPT_LOGATTR* logattrs; - SIZE* sz; + SIZE sz; int* logical2visual; } StringAnalysis; @@ -730,6 +736,8 @@ BOOL usp10_array_reserve(void **elements, SIZE_T *capacity, SIZE_T count, SIZE_T /* TODO Fix font properties on Arabic locale */ static inline BOOL set_cache_font_properties(const HDC hdc, ScriptCache *sc) { + sc->sfp.cBytes = sizeof(sc->sfp); + if (!sc->sfnt) { sc->sfp.wgBlank = sc->tm.tmBreakChar; @@ -777,11 +785,7 @@ static inline BOOL set_cache_font_properties(const HDC hdc, ScriptCache *sc) static inline void get_cache_font_properties(SCRIPT_FONTPROPERTIES *sfp, ScriptCache *sc) { - sfp->wgBlank = sc->sfp.wgBlank; - sfp->wgDefault = sc->sfp.wgDefault; - sfp->wgInvalid = sc->sfp.wgInvalid; - sfp->wgKashida = sc->sfp.wgKashida; - sfp->iKashidaWidth = sc->sfp.iKashidaWidth; + *sfp = sc->sfp; } static inline LONG get_cache_height(SCRIPT_CACHE *psc) @@ -1945,7 +1949,7 @@ HRESULT WINAPI ScriptStringAnalyse(HDC hdc, const void *pString, int cString, /* FIXME: handle clipping */ analysis->clip_len = cString; analysis->hdc = hdc; - analysis->dwFlags = dwFlags; + analysis->ssa_flags = dwFlags; if (psState) sState = *psState; @@ -2020,7 +2024,6 @@ HRESULT WINAPI ScriptStringAnalyse(HDC hdc, const void *pString, int cString, int *piAdvance = heap_alloc_zero(sizeof(int) * numGlyphs); SCRIPT_VISATTR *psva = heap_alloc_zero(sizeof(SCRIPT_VISATTR) * numGlyphs); GOFFSET *pGoffset = heap_alloc_zero(sizeof(GOFFSET) * numGlyphs); - ABC *abc = heap_alloc_zero(sizeof(ABC)); int numGlyphsReturned; HFONT originalFont = 0x0; @@ -2028,7 +2031,7 @@ HRESULT WINAPI ScriptStringAnalyse(HDC hdc, const void *pString, int cString, const WCHAR* pStr = (const WCHAR*)pString; analysis->glyphs[i].fallbackFont = NULL; - if (!glyphs || !pwLogClust || !piAdvance || !psva || !pGoffset || !abc) + if (!glyphs || !pwLogClust || !piAdvance || !psva || !pGoffset) { heap_free (BidiLevel); heap_free (glyphs); @@ -2036,7 +2039,6 @@ HRESULT WINAPI ScriptStringAnalyse(HDC hdc, const void *pString, int cString, heap_free (piAdvance); heap_free (psva); heap_free (pGoffset); - heap_free (abc); hr = E_OUTOFMEMORY; goto error; } @@ -2069,7 +2071,7 @@ HRESULT WINAPI ScriptStringAnalyse(HDC hdc, const void *pString, int cString, ScriptShape(hdc, sc, &pStr[analysis->pItem[i].iCharPos], cChar, numGlyphs, &analysis->pItem[i].a, glyphs, pwLogClust, psva, &numGlyphsReturned); hr = ScriptPlace(hdc, sc, glyphs, numGlyphsReturned, psva, &analysis->pItem[i].a, - piAdvance, pGoffset, abc); + piAdvance, pGoffset, &analysis->glyphs[i].abc); if (originalFont) SelectObject(hdc,originalFont); @@ -2090,7 +2092,6 @@ HRESULT WINAPI ScriptStringAnalyse(HDC hdc, const void *pString, int cString, analysis->glyphs[i].piAdvance = piAdvance; analysis->glyphs[i].psva = psva; analysis->glyphs[i].pGoffset = pGoffset; - analysis->glyphs[i].abc = abc; analysis->glyphs[i].iMaxPosX= -1; BidiLevel[i] = analysis->pItem[i].a.s.uBidiLevel; @@ -2313,7 +2314,7 @@ HRESULT WINAPI ScriptStringOut(SCRIPT_STRING_ANALYSIS ssa, ssa, iX, iY, uOptions, wine_dbgstr_rect(prc), iMinSel, iMaxSel, fDisabled); if (!(analysis = ssa)) return E_INVALIDARG; - if (!(analysis->dwFlags & SSA_GLYPHS)) return E_INVALIDARG; + if (!(analysis->ssa_flags & SSA_GLYPHS)) return E_INVALIDARG; for (item = 0; item < analysis->numItems; item++) { @@ -2350,12 +2351,12 @@ HRESULT WINAPI ScriptStringCPtoX(SCRIPT_STRING_ANALYSIS ssa, int icp, BOOL fTrai TRACE("(%p), %d, %d, (%p)\n", ssa, icp, fTrailing, pX); if (!ssa || !pX) return S_FALSE; - if (!(analysis->dwFlags & SSA_GLYPHS)) return S_FALSE; + if (!(analysis->ssa_flags & SSA_GLYPHS)) return S_FALSE; /* icp out of range */ if(icp < 0) { - analysis->invalid = TRUE; + analysis->flags |= SCRIPT_STRING_ANALYSIS_FLAGS_INVALID; return E_INVALIDARG; } @@ -2396,7 +2397,7 @@ HRESULT WINAPI ScriptStringCPtoX(SCRIPT_STRING_ANALYSIS ssa, int icp, BOOL fTrai } /* icp out of range */ - analysis->invalid = TRUE; + analysis->flags |= SCRIPT_STRING_ANALYSIS_FLAGS_INVALID; return E_INVALIDARG; } @@ -2412,7 +2413,7 @@ HRESULT WINAPI ScriptStringXtoCP(SCRIPT_STRING_ANALYSIS ssa, int iX, int* piCh, TRACE("(%p), %d, (%p), (%p)\n", ssa, iX, piCh, piTrailing); if (!ssa || !piCh || !piTrailing) return S_FALSE; - if (!(analysis->dwFlags & SSA_GLYPHS)) return S_FALSE; + if (!(analysis->ssa_flags & SSA_GLYPHS)) return S_FALSE; /* out of range */ if(iX < 0) @@ -2496,7 +2497,7 @@ HRESULT WINAPI ScriptStringFree(SCRIPT_STRING_ANALYSIS *pssa) if (!pssa || !(analysis = *pssa)) return E_INVALIDARG; - invalid = analysis->invalid; + invalid = analysis->flags & SCRIPT_STRING_ANALYSIS_FLAGS_INVALID; if (analysis->glyphs) { @@ -2507,7 +2508,6 @@ HRESULT WINAPI ScriptStringFree(SCRIPT_STRING_ANALYSIS *pssa) heap_free(analysis->glyphs[i].piAdvance); heap_free(analysis->glyphs[i].psva); heap_free(analysis->glyphs[i].pGoffset); - heap_free(analysis->glyphs[i].abc); if (analysis->glyphs[i].fallbackFont) DeleteObject(analysis->glyphs[i].fallbackFont); ScriptFreeCache((SCRIPT_CACHE *)&analysis->glyphs[i].sc); @@ -2518,7 +2518,6 @@ HRESULT WINAPI ScriptStringFree(SCRIPT_STRING_ANALYSIS *pssa) heap_free(analysis->pItem); heap_free(analysis->logattrs); - heap_free(analysis->sz); heap_free(analysis->logical2visual); heap_free(analysis); @@ -2631,7 +2630,7 @@ HRESULT WINAPI ScriptCPtoX(int iCP, iPosX = 0.0; for (item=0; item < iCP && item < cChars; item++) { - if (iSpecial == -1 && (iCluster == -1 || (iCluster != -1 && iCluster+clust_size <= item))) + if (iSpecial == -1 && (iCluster == -1 || iCluster+clust_size <= item)) { int check; int clust = pwLogClust[item]; @@ -3018,9 +3017,6 @@ HRESULT WINAPI ScriptIsComplex(const WCHAR *chars, int len, DWORD flag) for (i = 0; i < len; i+=consumed) { - if (i >= len) - break; - if ((flag & SIC_ASCIIDIGIT) && chars[i] >= 0x30 && chars[i] <= 0x39) return S_OK; @@ -3741,7 +3737,7 @@ HRESULT WINAPI ScriptStringGetLogicalWidths(SCRIPT_STRING_ANALYSIS ssa, int *piD TRACE("%p, %p\n", ssa, piDx); if (!analysis) return S_FALSE; - if (!(analysis->dwFlags & SSA_GLYPHS)) return S_FALSE; + if (!(analysis->ssa_flags & SSA_GLYPHS)) return S_FALSE; for (i = 0; i < analysis->numItems; i++) { @@ -3790,7 +3786,7 @@ HRESULT WINAPI ScriptStringValidate(SCRIPT_STRING_ANALYSIS ssa) TRACE("(%p)\n", ssa); if (!analysis) return E_INVALIDARG; - return (analysis->invalid) ? S_FALSE : S_OK; + return analysis->flags & SCRIPT_STRING_ANALYSIS_FLAGS_INVALID ? S_FALSE : S_OK; } /*********************************************************************** @@ -3813,23 +3809,22 @@ const SIZE * WINAPI ScriptString_pSize(SCRIPT_STRING_ANALYSIS ssa) TRACE("(%p)\n", ssa); if (!analysis) return NULL; - if (!(analysis->dwFlags & SSA_GLYPHS)) return NULL; + if (!(analysis->ssa_flags & SSA_GLYPHS)) return NULL; - if (!analysis->sz) + if (!(analysis->flags & SCRIPT_STRING_ANALYSIS_FLAGS_SIZE)) { - if (!(analysis->sz = heap_alloc(sizeof(SIZE)))) return NULL; - analysis->sz->cy = analysis->glyphs[0].sc->tm.tmHeight; + analysis->sz.cy = analysis->glyphs[0].sc->tm.tmHeight; - analysis->sz->cx = 0; + analysis->sz.cx = 0; for (i = 0; i < analysis->numItems; i++) { - if (analysis->glyphs[i].sc->tm.tmHeight > analysis->sz->cy) - analysis->sz->cy = analysis->glyphs[i].sc->tm.tmHeight; + if (analysis->glyphs[i].sc->tm.tmHeight > analysis->sz.cy) + analysis->sz.cy = analysis->glyphs[i].sc->tm.tmHeight; for (j = 0; j < analysis->glyphs[i].numGlyphs; j++) - analysis->sz->cx += analysis->glyphs[i].piAdvance[j]; + analysis->sz.cx += analysis->glyphs[i].piAdvance[j]; } } - return analysis->sz; + return &analysis->sz; } /*********************************************************************** @@ -3851,7 +3846,7 @@ const SCRIPT_LOGATTR * WINAPI ScriptString_pLogAttr(SCRIPT_STRING_ANALYSIS ssa) TRACE("(%p)\n", ssa); if (!analysis) return NULL; - if (!(analysis->dwFlags & SSA_BREAK)) return NULL; + if (!(analysis->ssa_flags & SSA_BREAK)) return NULL; return analysis->logattrs; } @@ -3899,7 +3894,7 @@ HRESULT WINAPI ScriptStringGetOrder(SCRIPT_STRING_ANALYSIS ssa, UINT *order) TRACE("(%p)\n", ssa); if (!analysis) return S_FALSE; - if (!(analysis->dwFlags & SSA_GLYPHS)) return S_FALSE; + if (!(analysis->ssa_flags & SSA_GLYPHS)) return S_FALSE; /* FIXME: handle RTL scripts */ for (i = 0, k = 0; i < analysis->numItems; i++) diff --git a/media/doc/README.WINE b/media/doc/README.WINE index b99c43d5be..6a0bf58c51 100644 --- a/media/doc/README.WINE +++ b/media/doc/README.WINE @@ -189,7 +189,7 @@ reactos/dll/win32/twain_32 # Synced to WineStaging-2.9 reactos/dll/win32/updspapi # Synced to WineStaging-2.9 reactos/dll/win32/url # Synced to WineStaging-2.9 reactos/dll/win32/urlmon # Synced to WineStaging-2.16 -reactos/dll/win32/usp10 # Synced to WineStaging-2.16 +reactos/dll/win32/usp10 # Synced to Wine-3.0 reactos/dll/win32/uxtheme # Forked reactos/dll/win32/vbscript # Synced to WineStaging-2.9 reactos/dll/win32/version # Synced to WineStaging-2.9
6 years, 11 months
1
0
0
0
01/01: [RTL] Handle RtlReAllocateHeap failure in com_class_add_progid. CID 1223161
by Thomas Faber
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=095a4d1d23681b3a101e3…
commit 095a4d1d23681b3a101e38324fec3d9434bc5d58 Author: Thomas Faber <thomas.faber(a)reactos.org> AuthorDate: Sat Jan 20 09:47:24 2018 +0100 Commit: Thomas Faber <thomas.faber(a)reactos.org> CommitDate: Sat Jan 20 09:48:07 2018 +0100 [RTL] Handle RtlReAllocateHeap failure in com_class_add_progid. CID 1223161 --- sdk/lib/rtl/actctx.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sdk/lib/rtl/actctx.c b/sdk/lib/rtl/actctx.c index 4cf9bbaa4b..6ce1734017 100644 --- a/sdk/lib/rtl/actctx.c +++ b/sdk/lib/rtl/actctx.c @@ -1504,8 +1504,11 @@ static BOOL com_class_add_progid(const xmlstr_t *progid, struct entity *entity) if (progids->allocated == progids->num) { + WCHAR **new_progids = RtlReAllocateHeap(RtlGetProcessHeap(), 0, progids->progids, + 2 * progids->allocated * sizeof(WCHAR*)); + if (!new_progids) return FALSE; progids->allocated *= 2; - progids->progids = RtlReAllocateHeap(RtlGetProcessHeap(), 0, progids->progids, progids->allocated * sizeof(WCHAR*)); + progids->progids = new_progids; } if (!(progids->progids[progids->num] = xmlstrdupW(progid))) return FALSE;
6 years, 11 months
1
0
0
0
01/01: [COMCTL32] Unset the toolbar's hot item when deleting a button. CORE-14222
by Thomas Faber
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=73e6bc960ac0b0414808b…
commit 73e6bc960ac0b0414808b30700be5f661ed6367c Author: Thomas Faber <thomas.faber(a)reactos.org> AuthorDate: Sat Jan 20 02:21:32 2018 +0100 Commit: Thomas Faber <thomas.faber(a)reactos.org> CommitDate: Sat Jan 20 02:24:01 2018 +0100 [COMCTL32] Unset the toolbar's hot item when deleting a button. CORE-14222 This fixes occasional crashes when hovering over disappearing tray icons. --- dll/win32/comctl32/toolbar.c | 1 + modules/rostests/winetests/comctl32/toolbar.c | 16 +++++++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/dll/win32/comctl32/toolbar.c b/dll/win32/comctl32/toolbar.c index 98965f42b8..c2befb228c 100644 --- a/dll/win32/comctl32/toolbar.c +++ b/dll/win32/comctl32/toolbar.c @@ -3382,6 +3382,7 @@ TOOLBAR_DeleteButton (TOOLBAR_INFO *infoPtr, INT nIndex) TOOLBAR_TooltipDelTool(infoPtr, &infoPtr->buttons[nIndex]); + infoPtr->nHotItem = -1; if (infoPtr->nNumButtons == 1) { TRACE(" simple delete\n"); free_string( infoPtr->buttons ); diff --git a/modules/rostests/winetests/comctl32/toolbar.c b/modules/rostests/winetests/comctl32/toolbar.c index f49cd2ae81..fc217eede8 100644 --- a/modules/rostests/winetests/comctl32/toolbar.c +++ b/modules/rostests/winetests/comctl32/toolbar.c @@ -857,7 +857,7 @@ static void test_hotitem(void) ok(ret == 3, "Hot item: %lx, expected 3\n", ret); g_fBlockHotItemChange = TRUE; ret = SendMessageA(hToolbar, TB_SETHOTITEM, 2, 0); - ok(ret == 3, "TB_SETHOTITEM returned %ld, expected 2\n", ret); + ok(ret == 3, "TB_SETHOTITEM returned %ld, expected 3\n", ret); ret = SendMessageA(hToolbar, TB_GETHOTITEM, 0, 0); ok(ret == 3, "Hot item: %lx, expected 3\n", ret); g_fBlockHotItemChange = FALSE; @@ -888,7 +888,7 @@ static void test_hotitem(void) /* enabling the button won't change that */ SendMessageA(hToolbar, TB_ENABLEBUTTON, 9, TRUE); ret = SendMessageA(hToolbar, TB_GETHOTITEM, 0, 0); - ok(ret == -1, "TB_SETHOTITEM returned %ld, expected -1\n", ret); + ok(ret == -1, "TB_GETHOTITEM returned %ld, expected -1\n", ret); /* disabling a hot button works */ ret = SendMessageA(hToolbar, TB_SETHOTITEM, 3, 0); @@ -896,7 +896,7 @@ static void test_hotitem(void) g_fReceivedHotItemChange = FALSE; SendMessageA(hToolbar, TB_ENABLEBUTTON, 7, FALSE); ret = SendMessageA(hToolbar, TB_GETHOTITEM, 0, 0); - ok(ret == 3, "TB_SETHOTITEM returned %ld, expected 3\n", ret); + ok(ret == 3, "TB_GETHOTITEM returned %ld, expected 3\n", ret); ok(g_fReceivedHotItemChange == FALSE, "Unexpected TBN_HOTITEMCHANGE\n"); SendMessageA(hToolbar, TB_SETHOTITEM, 1, 0); @@ -906,7 +906,17 @@ static void test_hotitem(void) g_fReceivedHotItemChange = FALSE; ok(SendMessageA(hToolbar, TB_SETBUTTONINFOA, 1, (LPARAM)&tbinfo) == TRUE, "TB_SETBUTTONINFOA failed\n"); ret = SendMessageA(hToolbar, TB_GETHOTITEM, 0, 0); + ok(ret == 1, "TB_GETHOTITEM returned %ld, expected 1\n", ret); + ok(g_fReceivedHotItemChange == FALSE, "Unexpected TBN_HOTITEMCHANGE\n"); + + /* deleting a button unsets the hot item */ + ret = SendMessageA(hToolbar, TB_SETHOTITEM, 0, 0); ok(ret == 1, "TB_SETHOTITEM returned %ld, expected 1\n", ret); + g_fReceivedHotItemChange = FALSE; + ret = SendMessageA(hToolbar, TB_DELETEBUTTON, 1, 0); + ok(ret == TRUE, "TB_DELETEBUTTON returned %ld, expected TRUE\n", ret); + ret = SendMessageA(hToolbar, TB_GETHOTITEM, 0, 0); + ok(ret == -1, "TB_GETHOTITEM returned %ld, expected -1\n", ret); ok(g_fReceivedHotItemChange == FALSE, "Unexpected TBN_HOTITEMCHANGE\n"); DestroyWindow(hToolbar);
6 years, 11 months
1
0
0
0
01/01: [DRWTSN32][SHIMDBG] Add missing va_end. CORE-14193
by Lee Schroeder
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=9be6ac9cbb013440e7a9e…
commit 9be6ac9cbb013440e7a9ebbb689b7ee384b7ca79 Author: Lee Schroeder <spaceseel(a)gmail.com> AuthorDate: Fri Jan 19 22:08:14 2018 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Fri Jan 19 22:09:47 2018 +0100 [DRWTSN32][SHIMDBG] Add missing va_end. CORE-14193 --- base/applications/drwtsn32/main.cpp | 1 + modules/rosapps/applications/devutils/shimdbg/shimdbg.c | 1 + 2 files changed, 2 insertions(+) diff --git a/base/applications/drwtsn32/main.cpp b/base/applications/drwtsn32/main.cpp index 2f86518836..65c7dc1995 100644 --- a/base/applications/drwtsn32/main.cpp +++ b/base/applications/drwtsn32/main.cpp @@ -32,6 +32,7 @@ void xfprintf(FILE* stream, const char *fmt, ...) va_start(ap, fmt); vfprintf(stream, fmt, ap); vDbgPrintEx(-1, DPFLTR_ERROR_LEVEL, fmt, ap); + va_end(ap); } diff --git a/modules/rosapps/applications/devutils/shimdbg/shimdbg.c b/modules/rosapps/applications/devutils/shimdbg/shimdbg.c index da1117036c..9d8570cf61 100644 --- a/modules/rosapps/applications/devutils/shimdbg/shimdbg.c +++ b/modules/rosapps/applications/devutils/shimdbg/shimdbg.c @@ -20,6 +20,7 @@ void xprintf(const char *fmt, ...) va_start(ap, fmt); vprintf(fmt, ap); vDbgPrintEx(-1, DPFLTR_ERROR_LEVEL, fmt, ap); + va_end(ap); }
6 years, 11 months
1
0
0
0
01/01: [MSCTF_WINETEST] Sync with Wine 3.0. CORE-14225
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=45ec86c442dacafbc403d…
commit 45ec86c442dacafbc403d3a70d799ddcd29bb304 Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Fri Jan 19 12:33:20 2018 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Fri Jan 19 12:33:20 2018 +0100 [MSCTF_WINETEST] Sync with Wine 3.0. CORE-14225 --- modules/rostests/winetests/msctf/inputprocessor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/rostests/winetests/msctf/inputprocessor.c b/modules/rostests/winetests/msctf/inputprocessor.c index 34a27098d8..9bd112c830 100644 --- a/modules/rostests/winetests/msctf/inputprocessor.c +++ b/modules/rostests/winetests/msctf/inputprocessor.c @@ -1901,7 +1901,7 @@ TfEditCookie ec) ok(SUCCEEDED(hr),"ITfContext_GetSelection failed\n"); ok(fetched == 1,"fetched incorrect\n"); ok(selection.range != NULL,"NULL range\n"); - sink_check_ok(&test_ACP_GetSelection,"ACP_GetSepection"); + sink_check_ok(&test_ACP_GetSelection,"GetSelection"); ITfRange_Release(selection.range); test_InsertAtSelection(ec, cxt);
6 years, 11 months
1
0
0
0
← Newer
1
...
20
21
22
23
24
25
26
...
38
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
Results per page:
10
25
50
100
200