MCPcopy Create free account
hub / github.com/mhammond/pywin32 / pythoncom_CoUnmarshalInterface

Function pythoncom_CoUnmarshalInterface

com/win32com/src/PythonCOM.cpp:1239–1261  ·  view source on GitHub ↗

@pymethod interface|pythoncom|CoUnmarshalInterface|Unmarshals an interface

Source from the content-addressed store, hash-verified

1237
1238// @pymethod interface|pythoncom|CoUnmarshalInterface|Unmarshals an interface
1239static PyObject *pythoncom_CoUnmarshalInterface(PyObject *self, PyObject*args)
1240{
1241 PyObject *obriid, *obIStream, *ret=NULL;
1242 IID riid;
1243 IStream *pIStream=NULL;
1244 IUnknown *pIUnknown=NULL;
1245 if (!PyArg_ParseTuple(args, "OO:CoUnmarshalInterface",
1246 &obIStream, // @pyparm <o PyIStream>|Stm||Stream containing marshalled interface
1247 &obriid)) // @pyparm <o PyIID>|riid||IID of interface to be unmarshalled
1248 return NULL;
1249 if (PyWinObject_AsIID(obriid, &riid)
1250 &&PyCom_InterfaceFromPyObject(obIStream, IID_IStream, (void **)&pIStream, FALSE)){
1251 PY_INTERFACE_PRECALL;
1252 HRESULT hr = CoUnmarshalInterface(pIStream, riid, (void **)&pIUnknown);
1253 pIStream->Release();
1254 PY_INTERFACE_POSTCALL;
1255 if (FAILED(hr))
1256 PyCom_BuildPyException(hr);
1257 else
1258 ret=PyCom_PyObjectFromIUnknown(pIUnknown, riid, FALSE);
1259 }
1260 return ret;
1261}
1262
1263// @pymethod |pythoncom|CoReleaseMarshalData|Frees resources used by a marshalled interface
1264// @comm This is usually only needed when the interface could not be successfully unmarshalled

Callers

nothing calls this directly

Calls 6

PyWinObject_AsIIDFunction · 0.85
FAILEDFunction · 0.85
PyCom_BuildPyExceptionFunction · 0.85
ReleaseMethod · 0.45

Tested by

no test coverage detected