From b1efff0fdee6d986df33ec13d9d64808bf2619b6 Mon Sep 17 00:00:00 2001 From: Marc-André Lureau Date: Mon, 17 Dec 2012 14:55:32 +0100 Subject: summary-info: replace get_property_count() by get_properties() The later is more useful, since it returns the existing properties. --- libmsi/libmsi-summary-info.c | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) (limited to 'libmsi') diff --git a/libmsi/libmsi-summary-info.c b/libmsi/libmsi-summary-info.c index edec5da..a185055 100644 --- a/libmsi/libmsi-summary-info.c +++ b/libmsi/libmsi-summary-info.c @@ -194,6 +194,22 @@ static unsigned get_property_count( const LibmsiOLEVariant *property ) return n; } +GArray * +libmsi_summary_info_get_properties (LibmsiSummaryInfo *self) +{ + GArray *props; + int i; + + g_return_val_if_fail (LIBMSI_IS_SUMMARY_INFO (self), NULL); + + props = g_array_new (FALSE, FALSE, sizeof(LibmsiProperty)); + for (i = 0; i < MSI_MAX_PROPS; i++) + if (self->property[i].vt != OLEVT_EMPTY) + g_array_append_val (props, i); + + return props; +} + static unsigned read_word( const uint8_t *data, unsigned *ofs ) { unsigned val = 0; @@ -541,21 +557,6 @@ static unsigned suminfo_persist( LibmsiSummaryInfo *si ) return r; } -LibmsiResult libmsi_summary_info_get_property_count (LibmsiSummaryInfo *si, unsigned *pCount) -{ - TRACE("%d %p\n", si, pCount); - - if( !si ) - return LIBMSI_RESULT_INVALID_HANDLE; - - g_object_ref(si); - if( pCount ) - *pCount = get_property_count( si->property ); - g_object_unref(si); - - return LIBMSI_RESULT_SUCCESS; -} - LibmsiPropertyType libmsi_summary_info_get_property_type (LibmsiSummaryInfo *self, LibmsiProperty prop, -- cgit