@pymethod |pythoncom|CoGetInterfaceAndReleaseStream|Unmarshals a buffer containing an interface pointer and releases the stream when an interface pointer has been marshaled from another thread to the calling thread.
| 1150 | |
| 1151 | // @pymethod <o PyIUnknown>|pythoncom|CoGetInterfaceAndReleaseStream|Unmarshals a buffer containing an interface pointer and releases the stream when an interface pointer has been marshaled from another thread to the calling thread. |
| 1152 | static PyObject *pythoncom_CoGetInterfaceAndReleaseStream(PyObject *self, PyObject*args) |
| 1153 | { |
| 1154 | PyObject *obStream, *obIID; |
| 1155 | if ( !PyArg_ParseTuple(args, "OO:CoGetInterfaceAndReleaseStream", |
| 1156 | &obStream, // @pyparm <o PyIStream>|stream||The stream to unmarshal the object from. |
| 1157 | &obIID )) // @pyparm <o PyIID>|iid||The IID if the interface to unmarshal. |
| 1158 | return NULL; |
| 1159 | |
| 1160 | IID iid; |
| 1161 | if (!PyWinObject_AsIID(obIID, &iid)) |
| 1162 | return NULL; |
| 1163 | |
| 1164 | IStream *pStream; |
| 1165 | if (!PyCom_InterfaceFromPyObject(obStream, IID_IStream, (void **)&pStream, FALSE)) |
| 1166 | return NULL; |
| 1167 | |
| 1168 | IUnknown *pUnk; |
| 1169 | PY_INTERFACE_PRECALL; |
| 1170 | HRESULT hr = CoGetInterfaceAndReleaseStream(pStream, iid, (void **)&pUnk); |
| 1171 | // pStream is released by this call - no need for me to do it! |
| 1172 | PY_INTERFACE_POSTCALL; |
| 1173 | if (FAILED(hr)) |
| 1174 | return PyCom_BuildPyException(hr); |
| 1175 | return PyCom_PyObjectFromIUnknown(pUnk, iid, /*BOOL bAddRef*/ FALSE); |
| 1176 | } |
| 1177 | |
| 1178 | // @pymethod <o PyIUnknown>|pythoncom|CoCreateFreeThreadedMarshaler|Creates an aggregatable object capable of context-dependent marshaling. |
| 1179 | static PyObject *pythoncom_CoCreateFreeThreadedMarshaler(PyObject *self, PyObject*args) |
nothing calls this directly
no test coverage detected