This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author markm
Recipients loewis, markm
Date 2011-05-08.08:28:50
SpamBayes Score 7.3981845e-08
Marked as misclassified No
Message-id <1304843331.65.0.400246064682.issue12026@psf.upfronthosting.co.za>
In-reply-to
Content
You can pass it to any function in the MSI SDK through ctypes.

e.g. 

    def ReadStream(record, field):
        buf = (ctypes.c_char * 2048)()
        orig_size = ctypes.sizeof(buf)
        status = 0
        res = []
        while status == 0:
            size = ctypes.c_long(ctypes.sizeof(buf))
            status = msidll.MsiRecordReadStream(
                record.hanlde, field, ctypes.byref(buf), ctypes.byref(size))
            res.append(buf.raw)
            if size.value != orig_size:
                break
        data = "".join(res)
        return data


or any of the other functions not currently implemented in _msi.c
Some of the other important ones (to me at least) are:
 - MsiDatabaseGetPrimaryKeys
 - MsiDatabaseExport
 - MsiDatabaseImport

If the whole MSI SDK is wrapped - then exposing the handles would have no use :).

The alternative I have so far is to re-write _msi.c using ctypes (already done), but I thought it would be better if not all of _msi.c had to be re-implemented.

One alternative patch is to include those extra functions in _msi.c (though I am not sure I have the C skills to achieve that easily - and it may still miss functionality, and it may have even less chance of being accepted)
History
Date User Action Args
2011-05-08 08:28:51markmsetrecipients: + markm, loewis
2011-05-08 08:28:51markmsetmessageid: <1304843331.65.0.400246064682.issue12026@psf.upfronthosting.co.za>
2011-05-08 08:28:50markmlinkissue12026 messages
2011-05-08 08:28:50markmcreate