diff -r c22d5b37f6a4 Doc/library/msilib.rst --- a/Doc/library/msilib.rst Fri May 06 09:31:02 2011 +0300 +++ b/Doc/library/msilib.rst Sat May 07 13:41:48 2011 +0900 @@ -150,12 +150,20 @@ values. +The following attribute is also available: + +.. attribute:: Database.handle + + The underlying MSI SDK handle. + + .. seealso:: `MSIDatabaseOpenView `_ `MSIDatabaseCommit `_ `MSIGetSummaryInformation `_ + .. _view-objects: View Objects @@ -197,6 +205,10 @@ Close the view, through :c:func:`MsiViewClose`. +.. attribute:: View.handle + + The underlying MSI SDK handle. + .. seealso:: @@ -241,6 +253,10 @@ Write the modified properties to the summary information stream, using :c:func:`MsiSummaryInfoPersist`. +.. attribute:: SummaryInformation.handle + + The underlying MSI SDK handle. + .. seealso:: @@ -295,6 +311,13 @@ Set all fields of the record to 0, through :c:func:`MsiRecordClearData`. +.. attribute:: Record.handle + + The underlying MSI SDK handle. + + For example the handle to the record can be passed to + :c:func:`MSIRecordReadStream` to read streams in MSI tables. + .. seealso:: diff -r c22d5b37f6a4 PC/_msi.c --- a/PC/_msi.c Fri May 06 09:31:02 2011 +0300 +++ b/PC/_msi.c Sat May 07 13:41:48 2011 +0900 @@ -11,6 +11,7 @@ #include #include #include +#include static PyObject *MSIError; @@ -444,6 +445,10 @@ } +static PyMemberDef msiobj_members[] = { + {"handle", T_INT, offsetof(msiobj, h), READONLY}, + {NULL} /* Sentinel */ +}; static PyMethodDef record_methods[] = { { "GetFieldCount", (PyCFunction)record_getfieldcount, METH_NOARGS, @@ -492,8 +497,8 @@ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - record_methods, /*tp_methods*/ - 0, /*tp_members*/ + record_methods, /*tp_methods*/ + msiobj_members, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ @@ -663,7 +668,7 @@ 0, /*tp_iter*/ 0, /*tp_iternext*/ summary_methods, /*tp_methods*/ - 0, /*tp_members*/ + msiobj_members, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ @@ -811,7 +816,7 @@ 0, /*tp_iter*/ 0, /*tp_iternext*/ view_methods, /*tp_methods*/ - 0, /*tp_members*/ + msiobj_members, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ @@ -928,7 +933,7 @@ 0, /*tp_iter*/ 0, /*tp_iternext*/ db_methods, /*tp_methods*/ - 0, /*tp_members*/ + msiobj_members, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/