Thanks for the review; I'll fix these.
On 09/13/2017 04:14 AM, Hans Leidekker wrote:
On Tue, 2017-09-12 at 20:51 -0500, Zebediah Figura wrote:
+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((MSIPACKAGE *)param, INSTALLMESSAGE_INFO|MB_ICONHAND, uirow);
You don't need this cast.
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 = msi_dup_property(package->db, szEXECUTEACTION);
- MSIQUERY *view;
- MSIRECORD *uirow; UINT rc;
- package->script->InWhatSequence |= SEQUENCE_EXEC;
- rc = ACTION_ProcessExecSequence(package,FALSE);
- if (!action) action = msi_strdupW(szINSTALL, strlenW(szINSTALL));
action is leaked.
- /* 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);
- MSI_ProcessMessage(package, INSTALLMESSAGE_COMMONDATA, uirow);
- productname = msi_dup_property(package->db, INSTALLPROPERTY_PRODUCTNAMEW);
productname is leaked on error paths.