// @pymethod |PyIContext|SetProperty|Sets a property on the context PyObject *PyIContext::SetProperty(PyObject *self, PyObject *args) { IContext *pIC = GetI(self); if ( pIC == NULL ) return NULL; // @pyparm <o PyIID>|rpolicyId||GUID identifying the property to be set // @pyparm int|flags||Reserved, use only 0 // @pyparm <o PyIUnknown>|pUnk||The property value CPFLAGS flags; PyObject *obrpolicyId; PyObject *obUnk; IID rpolicyId; IUnknown * pUnk; if ( !PyArg_ParseTuple(args, "OkO:SetProperty", &obrpolicyId, &flags, &obUnk) ) return NULL; if (!PyWinObject_AsIID(obrpolicyId, &rpolicyId)) return NULL; if (!PyCom_InterfaceFromPyInstanceOrObject(obUnk, IID_IUnknown, (void **)&pUnk, FALSE)) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pIC->SetProperty( rpolicyId, flags, pUnk ); pUnk->Release(); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pIC, IID_IContext ); Py_INCREF(Py_None); return Py_None; }